aboutsummaryrefslogtreecommitdiff
path: root/lib/std/event
AgeCommit message (Collapse)Author
2020-05-07Merge pull request #5268 from tadeokondrak/remove-callconv-redundant-syntaxAndrew Kelley
Remove syntax redundant with callconv
2020-05-06Standard library: Fix a regression in loop.waitUntilFdWritableOrReadableTimon Kruiper
This broke async io on linux. Regressed in 8ebcca6734e07aea29098ca4c63c0216b3099d0e
2020-05-05zig fmtTadeo Kondrak
2020-05-05update comments for nosuspendTadeo Kondrak
2020-05-05zig fmtTadeo Kondrak
2020-05-02Merge remote-tracking branch 'origin/master' into FireFox317-windows-evented-ioAndrew Kelley
2020-05-02Get evented io code paths to build on macOS (#5233)Chris Heyes
* Get evented io code paths to build on macOS * Use mode_t instead of usize where appropriate
2020-05-02std.event.Loop: promote the fs thread to be available for all OS'sAndrew Kelley
2020-04-29Fix std.event.Loop.readvTadeo Kondrak
2020-04-12disable flaky event loop testAndrew Kelley
See #4922
2020-03-30std lib API deprecations for the upcoming 0.6.0 releaseAndrew Kelley
See #3811
2020-03-12Merge pull request #4707 from Vexu/small-atomicsAndrew Kelley
Support atomic operations with bools and non power of two integers
2020-03-12add note to disabled tests, improve comptime cmpxchgVexu
2020-03-10fix stack trace code not opening files in forced blocking modeAndrew Kelley
2020-03-10use atomic bools in std libVexu
2020-03-07add std.event.Loop pread and faccessatAndrew Kelley
progress towards std lib tests passing with evented I/O mode
2020-03-03breaking: std.os read/write functions + sendfileAndrew Kelley
* rework os.sendfile and add macosx support, and a fallback implementation for any OS. * fix sendto compile error * std.os write functions support partial writes. closes #3443. * std.os pread / pwrite functions can now return `error.Unseekable`. * std.fs.File read/write functions now have readAll/writeAll variants which loop to complete operations even when partial reads/writes happen. * Audit std.os read/write functions with respect to Linux returning EINVAL for lengths greater than 0x7fff0000. * std.os read/write shim functions do not unnecessarily loop. Since partial reads/writes are part of the API, the caller will be forced to loop anyway, and so that would just be code bloat. * Improve doc comments * Add a non-trivial test for std.os.sendfile * Fix std.os.pread on 32 bit Linux * Add missing SYS_sendfile bit on aarch64
2020-02-28introduce operating system version ranges as part of the targetAndrew Kelley
* re-introduce `std.build.Target` which is distinct from `std.Target`. `std.build.Target` wraps `std.Target` so that it can be annotated as "the native target" or an explicitly specified target. * `std.Target.Os` is moved to `std.Target.Os.Tag`. The former is now a struct which has the tag as well as version range information. * `std.elf` gains some more ELF header constants. * `std.Target.parse` gains the ability to parse operating system version ranges as well as glibc version. * Added `std.Target.isGnuLibC()`. * self-hosted dynamic linker detection and glibc version detection. This also adds the improved logic using `/usr/bin/env` rather than invoking the system C compiler to find the dynamic linker when zig is statically linked. Related: #2084 Note: this `/usr/bin/env` code is work-in-progress. * `-target-glibc` CLI option is removed in favor of the new `-target` syntax. Example: `-target x86_64-linux-gnu.2.27` closes #1907
2020-02-21remove the allocator from std.event.LoopAndrew Kelley
closes #3539
2020-02-16implement os.faccessat for WindowsAndrew Kelley
2020-02-16self-hosted libc detectionAndrew Kelley
* libc_installation.cpp is deleted. src-self-hosted/libc_installation.zig is now used for both stage1 and stage2 compilers. * (breaking) move `std.fs.File.access` to `std.fs.Dir.access`. The API now encourages use with an open directory handle. * Add `std.os.faccessat` and related functions. * Deprecate the "C" suffix naming convention for null-terminated parameters. "C" should be used when it is related to libc. However null-terminated parameters often have to do with the native system ABI rather than libc. "Z" suffix is the new convention. For example, `std.os.openC` is deprecated in favor of `std.os.openZ`. * Add `std.mem.dupeZ` for using an allocator to copy memory and add a null terminator. * Remove dead struct field `std.ChildProcess.llnode`. * Introduce `std.event.Batch`. This API allows expressing concurrency without forcing code to be async. It requires no Allocator and does not introduce any failure conditions. However it is not thread-safe. * There is now an ongoing experiment to transition away from `std.event.Group` in favor of `std.event.Batch`. * `std.os.execvpeC` calls `getenvZ` rather than `getenv`. This is slightly more efficient on most systems, and works around a limitation of `getenv` lack of integration with libc. * (breaking) `std.os.AccessError` gains `FileBusy`, `SymLinkLoop`, and `ReadOnlyFileSystem`. Previously these error codes were all reported as `PermissionDenied`. * Add `std.Target.isDragonFlyBSD`. * stage2: access to the windows_sdk functions is done with a manually maintained .zig binding file instead of `@cImport`. * Update src-self-hosted/libc_installation.zig with all the improvements that stage1 has seen to src/libc_installation.cpp until now. In addition, it now takes advantage of Batch so that evented I/O mode takes advantage of concurrency, but it still works in blocking I/O mode, which is how it is used in stage1.
2020-02-08std: fix bitrotted evented codeAndrew Kelley
2020-02-08std lib typo fixupsAndrew Kelley
2020-02-06more std lib async I/O integrationAndrew Kelley
* `zig test` gainst `--test-evented-io` parameter and gains the ability to seamlessly run async tests. * `std.ChildProcess` opens its child process pipe with O_NONBLOCK when using evented I/O * `std.io.getStdErr()` gives a File that is blocking even in evented I/O mode. * Delete `std.event.fs`. The functionality is now merged into `std.fs` and async file system access (using a dedicated thread) is automatically handled. * `std.fs.File` can be configured to specify whether its handle is expected to block, and whether that is OK to block even when in async I/O mode. This makes async I/O work correctly for e.g. the file system as well as network. * `std.fs.File` has some deprecated functions removed. * Missing readv,writev,pread,pwrite,preadv,pwritev functions are added to `std.os` and `std.fs.File`. They are all integrated with async I/O. * `std.fs.Watch` is still bit rotted and needs to be audited in light of the new async/await syntax. * `std.io.OutStream` integrates with async I/O * linked list nodes in the std lib have default `null` values for `prev` and `next`. * Windows async I/O integration is enabled for reading/writing file handles. * Added `std.os.mode_t`. Integer sizes need to be audited. * Fixed #4403 which was causing compiler to crash. This is working towards: ./zig test ../test/stage1/behavior.zig --test-evented-io Which does not successfully build yet. I'd like to enable behavioral tests and std lib tests with --test-evented-io in the test matrix in the future, to prevent regressions.
2020-01-31Turn win32 errors into a non-exhaustive enumdaurnimator
2020-01-08Pointer alignment fixes for the stdlibLemonBoy
2019-12-10Replace @typeOf with @TypeOf in all zig sourceRobin Voetter
This change was mostly made with `zig fmt` and this also modified some whitespace. Note that in some files, `zig fmt` produced incorrect code, so the change was made manually.
2019-12-09implement async function call with `@call`Andrew Kelley
this removes the last usage of var args in zig std lib
2019-12-08std.fmt.format: tuple parameter instead of var argsAndrew Kelley
2019-12-02bring your own OS layer in the std libAndrew Kelley
closes #3784
2019-12-01fixes for self-hosted compilerAndrew Kelley
2019-12-01Merge remote-tracking branch 'origin/master' into remove-array-type-coercionAndrew Kelley
2019-11-27implement correct buffer wrapping logic in std.event.ChannelQuetzal Bradley
2019-11-27remove type coercion from array values to referencesAndrew Kelley
* Implements #3768. This is a sweeping breaking change that requires many (trivial) edits to Zig source code. Array values no longer coerced to slices; however one may use `&` to obtain a reference to an array value, which may then be coerced to a slice. * Adds `IrInstruction::dump`, for debugging purposes. It's useful to call to inspect the instruction when debugging Zig IR. * Fixes bugs with result location semantics. See the new behavior test cases, and compile error test cases. * Fixes bugs with `@typeInfo` not properly resolving const values. * Behavior tests are passing but std lib tests are not yet. There is more work to do before merging this branch.
2019-11-27add more workaroundsVexu
2019-11-26solve recursion in self hostedVexu
2019-11-25rename std.heap.direct_allocator to std.heap.page_allocatorAndrew Kelley
std.heap.direct_allocator is still available for now but it is marked deprecated.
2019-11-25zig fmtAndrew Kelley
2019-11-25Merge pull request #3761 from Vexu/event.fsAndrew Kelley
Update event.fs to new event loop
2019-11-25update event.fs.watchVexu
2019-11-25more sentinel-terminated pointers std lib integrationAndrew Kelley
See #3767
2019-11-24uncomment event.fs.watchVexu
2019-11-24update event.fs to use global event loopVexu
2019-11-23Merge branch 'master' into modernize-stage2Vexu
2019-11-23re-enable stage2 testsVexu
2019-11-23fix small regressions in std.eventVexu
2019-11-21std: remove O_LARGEFILE from OS bits when the OS does not define itAndrew Kelley
2019-11-13Merge pull request #3675 from Vexu/atomic-storeAndrew Kelley
Add @atomicStore builtin
2019-11-12fn parameters participate in result location semanticsAndrew Kelley
See #3665
2019-11-13use @atomicStore in std libVexu