aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os.zig
AgeCommit message (Collapse)Author
2020-01-31NTSTATUS is a non-exhaustive enumdaurnimator
2020-01-29Correct dl_iterate_phdr addressLemonBoy
The base should be zero so that p_vaddr + dlpi_addr = p_vaddr
2020-01-07Merge branch 'std-utf16-sentinel-terminated' of ↵Andrew Kelley
https://github.com/daurnimator/zig
2020-01-06Removes proc_raise from WASI implementationColin Svingen
2020-01-05Add std.os.getrusagedata-man
2019-12-31std.os.memfd_create: add error.SystemOutdatedAndrew Kelley
2019-12-31improvements to memfd_createAndrew Kelley
* move test from std/io/test.zig to std/os/test.zig * do glibc version check, and make direct system call if glibc is too old * disable test when not linking libc, to avoid not working with outdated qemu version on the CI server. see #4019
2019-12-31os: use system for memfd_createLuna
- os: update flags type for memfd_create
2019-12-31os: add memfd_createLuna
currently only linux is supported
2019-12-30update setsockopt error set according to POSIXAndrew Kelley
In the code review I accidentally encouraged Luna to remove some handling of errors that are possible according to POSIX, but I think how Luna had it before was better, so I fixed it, and now the branch should be good to merge.
2019-12-30std.os: update error set for setsockoptLuna
2019-12-30std.os: make setsockopt receive a slice as optionLuna
2019-12-30net: fix OptionsLuna
- os: fix typos on setsockopt
2019-12-30os: add setsockoptLuna
- net: use os.setsockopt()
2019-12-29std: sentinel terminated pointers for utf16 apisdaurnimator
2019-12-22std: use wrappers from raise() rather than raw syscallsdaurnimator
2019-12-22std: remove high level linux sigprocmask wrappersdaurnimator
2019-12-20fix std.mem.addNullByte and implement sentinel slicingAndrew Kelley
see #3770
2019-12-12allow custom OS entrypointChristine Dodrill
Also: * Expose `std.start.callMain`. * Other fixes added to fix issues found in development.
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-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-02remove upstream support for Zen hobby OSAndrew Kelley
The new plan to support hobby operating systems is #3784. And what kind of name is "Zen" anyway? There's already a [Zen programming language](http://zenlang.sourceforge.net/) and that's just confusing.
2019-12-01Merge remote-tracking branch 'origin/master' into remove-array-type-coercionAndrew Kelley
2019-11-30add missing error code handling on WindowsAndrew Kelley
2019-11-30move `std.fs.Dir.cwd` to `std.fs.cwd`Andrew Kelley
update to non-deprecated std.fs APIs throughout the codebase Related: #3811
2019-11-29more test regression fixesAndrew Kelley
2019-11-29fix windows std lib regressionsAndrew Kelley
2019-11-25move logic to the appropriate layers; add new compile errorAndrew Kelley
2019-11-25Merge branch 'wasi-run-tests' of https://github.com/fengb/zig into ↵Andrew Kelley
fengb-wasi-run-tests
2019-11-25zig fmtAndrew Kelley
2019-11-25more sentinel-terminated pointers std lib integrationAndrew Kelley
See #3767
2019-11-24make std.mem.toSlice use null terminated pointersAndrew Kelley
and fix the fallout
2019-11-21string literals are now null terminatedAndrew Kelley
this also deletes C string literals from the language, and then makes the std lib changes and compiler changes necessary to get the behavior tests and std lib tests passing again.
2019-11-19WASI isattyBenjamin Feng
2019-11-08fix regressed tests and update docs to use "type coercion"Andrew Kelley
2019-11-08update the codebase to use `@as`Andrew Kelley
2019-11-08fixups and zig fmtAndrew Kelley
2019-11-08Merge branch 'adaptive_lock' of https://github.com/kprotty/zig into ↵Andrew Kelley
kprotty-adaptive_lock
2019-11-07Use `system` instead of `builtin.link_libc`kprotty
2019-11-07pthread_sched_yield -> sched_yieldkprotty
2019-11-07move SpinLock definitions aroundkprotty
2019-11-04std.os.read can fail with ConnectionResetByPeerAndrew Kelley
2019-11-02add FileNotFound to os.ConnectError error setLuna
2019-11-02add FileNotFound error to os.connectLuna
2019-11-02std.os: fix sendto, poll, recvfrom when linking libcAndrew Kelley
Thank you to Brendan Hansknecht for this patch.
2019-10-30Merge branch 'std.net'Andrew Kelley
2019-10-30DragonFlyBSD supportTse
2019-10-30make std.net more portableAndrew Kelley
* Delete `std.net.TmpWinAddr`. I don't think that was ever meant to be a real thing. * Delete `std.net.OsAddress`. This abstraction was not helpful. * Rename `std.net.Address` to `std.net.IpAddress`. It is now an extern union of IPv4 and IPv6 addresses. * Move `std.net.parseIp4` and `std.net.parseIp6` to the `std.net.IpAddress` namespace. They now return `IpAddress` instead of `u32` and `std.net.Ip6Addr`, which is deleted. * Add `std.net.IpAddress.parse` which accepts a port and parses either an IPv4 or IPv6 address. * Add `std.net.IpAddress.parseExpectingFamily` which additionally accepts a `family` parameter. * `std.net.IpAddress.initIp4` and `std.net.IpAddress.initIp6` are improved to directly take the address fields instead of a weird in-between type. * `std.net.IpAddress.port` is renamed to `std.net.IpAddress.getPort`. * Added `std.net.IpAddress.setPort`. * `os.sockaddr` struct on all targets is improved to match the corresponding system struct. Previously I had made it a union of sockaddr_in, sockaddr_in6, and sockaddr_un. The new abstraction for this is now `std.net.IpAddress`. * `os.sockaddr` and related bits are added for Windows. * `os.sockaddr` and related bits now have the `zero` fields default to zero initialization, and `len` fields default to the correct size. This is enough to abstract the differences across targets, and so no more switch on the target OS is needed in `std.net.IpAddress`. * Add the missing `os.sockaddr_un` on FreeBSD and NetBSD. * `std.net.IpAddress.initPosix` now takes a pointer to `os.sockaddr`.
2019-10-29std lib networking improvements, especially non-blocking I/OAndrew Kelley
* delete the std/event/net directory * `std.event.Loop.waitUntilFdReadable` and related functions no longer have possibility of failure. On Linux, they fall back to poll() and then fall back to sleep(). * add some missing `noasync` decorations in `std.event.Loop` * redo the `std.net.Server` API. it's quite nice now, but shutdown does not work cleanly. There is a race condition with close() that I am actively working on. * move `std.io.OutStream` to its own file to match `std.io.InStream`. I started working on making `write` integrated with evented I/O, but it got tricky so I backed off and filed #3557. However I did integrate `std.os.writev` and `std.os.pwritev` with evented I/O. * add `std.Target.stack_align` * move networking tests to `lib/std/net/test.zig` * add `std.net.tcpConnectToHost` and `std.net.tcpConnectToAddress`. * rename `error.UnknownName` to `error.UnknownHostName` within the context of DNS resolution. * add `std.os.readv`, which is integrated with evented I/O. * `std.os.preadv`, is now integrated with evented I/O. * `std.os.accept4` now asserts that ENOTSOCK and EOPNOTSUPP never occur (misuse of API), instead of returning errors. * `std.os.connect` is now integrated with evented I/O. `std.os.connect_async` is gone. Just use `std.os.connect`. * fix false positive dependency loop regarding async function frames * add more compile notes to help when dependency loops occur in determining whether a function is async. * ir: change an assert to ir_assert to make it easier to find workarounds for when such an assert is triggered. In this case it was trying to parse an IPv4 address at comptime.