Commit Graph

9419 Commits (6dce317fe39443278ee744e66118c6e9b6023615)

Author SHA1 Message Date
Tadeo Kondrak 6745a6f6f6
zig fmt 2020-05-05 09:38:02 -06:00
Tadeo Kondrak d0e996405b
add zig fmt fix for async/extern fn 2020-05-05 09:37:59 -06:00
Tadeo Kondrak 7ada59f873
remove nakedcc/stdcallcc/async fn/extern fn fnproto 2020-05-05 09:37:28 -06:00
Jakub Konka 81d824bf80 Clear PreopenList on every populate call 2020-05-05 17:23:49 +02:00
Andrew Kelley e6955688ac
Merge pull request #5272 from tadeokondrak/noasync-to-nosuspend
Noasync to nosuspend
2020-05-05 11:21:02 -04:00
Jakub Konka 07a968b344 Add docs 2020-05-05 17:05:30 +02:00
Vexu fde6d28c23
Merge pull request #5273 from haze/hb/fix-posix-errorunion-thread-spawn-result
Update ErrorUnion thread spawn result to return null instead of 0
2020-05-05 16:20:05 +03:00
Jakub Konka 558bb24601 Move preopen and path wasi helpers to std.fs.wasi module
Previously, the path and preopens helpers were prototyped in `std.os.wasi`
module, but since they are higher-level abstraction over wasi, they belong in
`std.fs.wasi` module.
2020-05-05 15:08:52 +02:00
Jakub Konka d4c33129cf Shuffle things around; add PreopenList.findByPath method
This commit removes `std.os.openatWasi` function, and renames it to
`std.os.wasi.openat`. Additionally, the added `PreopenList.findByPath`
method allows querying the list for a matching preopen by path.
2020-05-05 15:08:52 +02:00
Jakub Konka dd238352a4 Encapsulate getPreopens inside PreopenList 2020-05-05 15:08:52 +02:00
Jakub Konka fc77e393fd Remove obsolete PATH_MAX const 2020-05-05 15:08:52 +02:00
Jakub Konka b8112b3d17 Simplify File constructors 2020-05-05 15:08:52 +02:00
Jakub Konka 8bce1b6981 Refactor resolve_preopen into getPreopens function
This commit refactors `std.os.wasi.resolve_preopen` into a (higher-level)
`std.os.wasi.getPreopens` funtion which returns a slice with _all_
preopens at any given time. This fn allows the WASI module to
inquire at any given time for all preopens provided by the runtime.

This commit also makes `cwd()` a compile error on WASI.
2020-05-05 15:08:52 +02:00
Jakub Konka 05fb3e79fe Make std.fs.cwd() return preopen for "." if exists
This commit adds WASI specific impl of `std.fs.cwd()` in which we
emulate the `cwd` behaviour by inquiring the runtime for a "."
preopen if available. This is OK for simple relative ops, but will
not work for any ops which require absolute paths.
2020-05-05 15:08:52 +02:00
Jakub Konka 8e1cd69717 Implement std.fs.Dir.openFileWasi
It seems that `std.os.openZ` is too POSIX-specific, so I think it
should not be a point of entry for WASI `open` call. I figure
WASI should be treated as a separate "os" that's _not_ POSIX
especially given the incoming changes in the ephemeral snapshot.
2020-05-05 15:08:52 +02:00
Jakub Konka d7ca220121 Start drafting out openZ 2020-05-05 15:08:52 +02:00
Tadeo Kondrak fdfdac4939
update comments for nosuspend 2020-05-05 05:55:27 -06:00
Tadeo Kondrak 2c9204032d
update tests for nosuspend 2020-05-05 05:55:26 -06:00
Tadeo Kondrak af00afed98
zig fmt 2020-05-05 05:55:25 -06:00
Tadeo Kondrak b957dc29a4
Rename noasync to nosuspend in C++ compiler 2020-05-05 05:17:34 -06:00
Tadeo Kondrak 8d5636ebe4
Rename noasync to nosuspend in self-hosted, add rewriter 2020-05-05 05:17:33 -06:00
Haze Booth 4cb4097b08
Update ErrorUnion thread spawn result to return null instead of 0 2020-05-05 04:15:43 -04:00
Matthew Knight db4833d4d6 moved duplicated code to common functions 2020-05-04 23:45:31 -07:00
Vexu f127dee474
Merge pull request #5267 from Vexu/const-call
Fix missing compile error on call assigned to const
2020-05-04 21:45:15 +03:00
Jonathan Marler 75b699b2c6 os.zig: add ETIMEDOUT error case to read function
According to documentation ETIMEDOUT (110) is a valid error code for the read function.  I just had my long-running  (been running for about 7 weeks) network program crash because it did not handle the ETIMEDOUT error code from "read".
2020-05-04 13:48:34 -04:00
Vexu 85fd484f07
std: fix blake3 assignment to constant 2020-05-04 14:45:36 +03:00
Vexu adc444ceeb
fix missing compile error on call assigned to const 2020-05-04 14:28:58 +03:00
xackus 887bf8ba93 stage1: remove unneeded switch 2020-05-04 06:51:51 +02:00
xackus 0db9e90e8f stage1: fix assert fail on opaque fn ptr param 2020-05-04 06:51:37 +02:00
Cato 9b788b765c Pass filtered_sock_type to system.socket. Cover PermissionDenied error 2020-05-03 15:35:36 -04:00
daurnimator 277d088558
std: use async for MultiOutStream 2020-05-03 18:33:04 +10:00
Matthew Knight c5198bd76f added scoped typedef to translate-c 2020-05-02 20:22:43 -07:00
data-man c8b4cc2ff9 Include dbg.h to third-party libs 2020-05-02 18:29:02 -04:00
Andrew Kelley 1b201f460f Merge branch 'ninjacato-tomerge-darwin-fix-accept-sockets'
closes #5251
2020-05-02 17:38:17 -04:00
Andrew Kelley 8a8beefa36 solve the problem with Darwin shims in std.os instead
* implement SOCK_NONBLOCK and SOCK_CLOEXEC Darwin shims in std.os
 * revert changes to std.net
 * remove os.accept and rename os.accept4 to os.accept
2020-05-02 17:36:28 -04:00
Isaac Freund 3a397795be
Apply naming conventions of structs to files 2020-05-02 23:28:44 +02:00
Cato 07bee9da42 Fixed Darwin-incompatible socket flags and unavailable system calls 2020-05-02 16:37:39 -04:00
Andrew Kelley 03a7124543
Merge pull request #5249 from ziglang/FireFox317-windows-evented-io
fix behavior test with --test-evented-io on windows
2020-05-02 16:29:58 -04:00
Andrew Kelley b7914d901c add test coverage for top level fields
closes #2022
2020-05-02 14:53:20 -04:00
Andrew Kelley 7998e2b0f4 Merge remote-tracking branch 'origin/master' into FireFox317-windows-evented-io 2020-05-02 14:16:59 -04:00
Chris Heyes 8ebcca6734
Get evented io code paths to build on macOS (#5233)
* Get evented io code paths to build on macOS
* Use mode_t instead of usize where appropriate
2020-05-02 14:14:46 -04:00
Andrew Kelley 5656f5090d fs.File: improve handling async I/O on Windows
Before it was possible for .intended_io_mode = .blocking,
.capable_io_mode = .evented, and then the implementation would put a
request on the fs thread, which is the wrong behavior. Now it always
calls the appropriate WriteFile/ReadFile function, passing the intended
io mode directly as a parameter.

This makes the behavior tests pass on Windows with --test-evented-io.
2020-05-02 14:09:17 -04:00
Michael Dusan 33705d06bb
Merge pull request #5250 from mikdusan/qemu
ci linux: bump qemu-5.0.0-z2
2020-05-02 09:46:40 -04:00
Michael Dusan 5fb8d7dcdc
ci linux: bump qemu-5.0.0-z2
closes #5245
see 1b41e31a5c
2020-05-02 04:39:36 -04:00
Andrew Kelley 9dac8a5be9 update windows impl of child process to new File API 2020-05-02 04:31:26 -04:00
nycex 77376a54bf
correct usages of std.fs.dir.DeleteFileError (#5058)
* correct usages of std.fs.dir.DeleteFileError

* test std.fs.createFileAbsolute() and std.fs.deleteFileAbsolute()
2020-05-02 04:19:07 -04:00
Andrew Kelley 428065da30
Merge pull request #5243 from niacat/kern-arand
Avoid reading from /dev/urandom on NetBSD
2020-05-02 04:16:24 -04:00
Andrew Kelley 6546c74825 child process: no need to remove O_CLOEXEC before execve 2020-05-02 03:38:05 -04:00
Andrew Kelley 92f3e9c92a remove last use of share_with_child_process 2020-05-02 01:54:36 -04:00
Andrew Kelley beebcbb677 Merge remote-tracking branch 'origin/master' into FireFox317-windows-evented-io 2020-05-02 01:53:24 -04:00