Commit Graph

122 Commits (26e08d57016352c469ae34b3fbd61e7f2a85a76c)

Author SHA1 Message Date
Benjamin Feng c3d93cd9f2 WASI time_t / timespec 2019-11-19 16:12:26 -06:00
daurnimator 431eeb5e20
std: add pieces for WSAIoctl on windows 2019-11-15 10:31:52 +11:00
daurnimator 3b8afe31a0
std: add NtDeviceIoControlFile definition for windows 2019-11-15 10:31:51 +11:00
daurnimator 6469900e79
std: add WSAStartup and WSACleanup for windows 2019-11-15 10:31:47 +11:00
daurnimator 4cf535a01b
std: add WSASocketW for windows 2019-11-14 17:09:22 +11:00
daurnimator d9d3268cc1
std: add DeviceIoControl and GetOverlappedResult for windows 2019-11-14 17:09:21 +11:00
daurnimator f4c6cc3270
std: add winsock some definitions 2019-11-14 17:09:19 +11:00
daurnimator a832b35c19
std: add windows socket constants
Taken from https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasocketw
2019-11-14 17:09:17 +11:00
daurnimator be86e41d97
std: add CTL_CODE function for windows 2019-11-14 17:09:16 +11:00
daurnimator 4830415071
std: add FILE_ANY_ constants for windows 2019-11-14 17:00:09 +11:00
daurnimator 0270545edb
std: add windows ioctl transfer types 2019-11-14 17:00:07 +11:00
daurnimator ef6cec983c
std: add windows FILE_DEVICE_ defines 2019-11-14 17:00:05 +11:00
Vexu f0c94d95dd
use @atomicStore in std lib 2019-11-13 00:52:15 +02:00
Luna d1eabe81a9 add sockaddr_un to os/bits/windows 2019-11-10 14:38:33 -03:00
Andrew Kelley 3cf5c2c62b
fix regressed tests and update docs to use "type coercion" 2019-11-08 15:57:25 -05:00
Andrew Kelley aa0daea541
update more of the std lib to use `@as` 2019-11-08 15:57:25 -05:00
Andrew Kelley e0db54e89d
update the codebase to use `@as` 2019-11-08 15:57:24 -05:00
Andrew Kelley 2723ffc2b2
fixups and zig fmt 2019-11-08 01:52:23 -05:00
Andrew Kelley fbbcf2f30d
Merge branch 'adaptive_lock' of https://github.com/kprotty/zig into kprotty-adaptive_lock 2019-11-08 01:21:22 -05:00
kprotty b5d84635f2 remove WaitOnAddress backend in std.ThreadParker 2019-11-07 15:46:57 -06:00
kprotty b535e86cc0 move SpinLock definitions around 2019-11-07 15:32:20 -06:00
Andrew Kelley c7fd414dab
Merge pull request #3618 from nrdmn/uefi
UEFI improvements
2019-11-06 23:19:46 -05:00
Nick Erdmann 78b54d9c96
std/os/uefi: protocol handling improvements 2019-11-07 03:06:06 +01:00
Nick Erdmann cef51eaffb
std/os/uefi: snp, mnp, ip6, and udp6 support 2019-11-07 02:53:53 +01:00
Nick Erdmann f4767186dd
std/os/uefi: loading images 2019-11-07 02:53:53 +01:00
kprotty 465ebf494d ThreadParker implementation 2019-11-05 15:58:58 -06:00
kprotty 0d4f4aad9e adaptive SpinLock 2019-11-05 08:16:08 -06:00
Andrew Kelley 081c62fc00
fix regression in std.os.dirent64 on linux 2019-10-31 13:56:15 -04:00
Tse 00382f6dae DragonFlyBSD tidyup 2019-10-31 13:53:32 -04:00
Andrew Kelley 61d5a0bf48
Merge branch 'std.net' 2019-10-30 21:30:16 -04:00
Andrew Kelley 6a15e8a7a7
add comments to disabled tests linking to the tracking issue 2019-10-30 21:29:45 -04:00
Tse 33cc204481 DragonFlyBSD support 2019-10-30 21:21:58 -04:00
Andrew Kelley 7b7ba51642
fix os.sockaddr being a union instead of a struct 2019-10-30 20:57:20 -04:00
Andrew Kelley c52ee6efca
canonicalize std.os IPPROTO constants 2019-10-30 20:41:28 -04:00
Andrew Kelley 0de862e8ba
make std.net more portable
* 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-30 20:22:05 -04:00
Andrew Kelley 618ee5b63a fixes for macos and 32 bit arches 2019-10-30 14:43:55 -04:00
Andrew Kelley 24b3da871d
fix regressions 2019-10-30 12:49:37 -04:00
Andrew Kelley 67058b9b70
basic DNS address resolution for linux without libc 2019-10-29 02:19:22 -04:00
Andrew Kelley d5865f5319
move libc/linux bits around 2019-10-28 15:29:50 -04:00
Andrew Kelley f4c244b3d0
partial no-libc implementation of std.net.getAddressList 2019-10-28 15:29:50 -04:00
Andrew Kelley 4b80e376e3
std.net.getAddressList 2019-10-28 15:29:50 -04:00
Andrew Kelley 60cd11bd4b
get rid of std.os.foo.is_the_target
It had the downside of running all the comptime blocks and resolving
all the usingnamespaces of each system, when just trying to discover if
the current system is a particular one.

For Darwin, where it's nice to use `std.Target.current.isDarwin()`, this
demonstrates the utility that #425 would provide.
2019-10-24 01:14:52 -04:00
Andrew Kelley 17eb24a7e4
move types from builtin to std
* All the data types from `@import("builtin")` are moved to
  `@import("std").builtin`. The target-related types are moved
  to `std.Target`. This allows the data types to have methods, such as
  `std.Target.current.isDarwin()`.
 * `std.os.windows.subsystem` is moved to
   `std.Target.current.subsystem`.
 * Remove the concept of the panic package from the compiler
   implementation. Instead, `std.builtin.panic` is always the panic
   function. It checks for `@hasDecl(@import("root"), "panic")`,
   or else provides a default implementation.

This is an important step for multibuilds (#3028). Without this change,
the types inside the builtin namespace look like different types, when
trying to merge builds with different target settings. With this change,
Zig can figure out that, e.g., `std.builtin.Os` (the enum type) from one
compilation and `std.builtin.Os` from another compilation are the same
type, even if the target OS value differs.
2019-10-23 19:09:49 -04:00
Andrew Kelley e839250c51
Merge branch 'stratact-no-dir-allocators'
closes #2885
closes #2886
closes #2888
closes #3249
2019-10-21 23:54:29 -04:00
Andrew Kelley fc6f84f3f0 fix os.unlinkatW implementation 2019-10-21 20:58:53 -04:00
Andrew Kelley 9a82f00a4f
add freebsd AT_* bits 2019-10-21 20:50:47 -04:00
Andrew Kelley 98c4365b66 darwin: add AT_* bits 2019-10-21 19:39:30 -04:00
Andrew Kelley 87f632b08a fs.Dir.openDir: use empty object name for "." on Windows 2019-10-21 19:19:49 -04:00
Andrew Kelley ef67c49785
[wip] use NtDll APIs on Windows to implement std.fs.Dir 2019-10-21 14:18:01 -04:00
stratact e78d3750c5
Use 8192 sized buffers and remove allocator parameters 2019-10-19 14:04:51 -04:00
Nick Erdmann 8774b1d947
std/os/windows: remove subsystem detection for uefi 2019-10-18 19:49:02 +02:00
Andrew Kelley 2aec35525d
mipsel: fix padding on stat struct 2019-10-17 13:20:30 -04:00
Andrew Kelley 45e5841281
Merge pull request #3464 from nrdmn/uefi
UEFI improvements
2019-10-16 18:14:32 -04:00
Andrew Kelley 5181970807
improve docs and field names of Statx struct 2019-10-16 17:24:42 -04:00
Nick Erdmann e6eae25053
std/os/uefi: add documentation 2019-10-16 21:46:41 +02:00
Nick Erdmann 77104da43e
std/os/uefi: add Guid format() 2019-10-16 19:49:51 +02:00
LemonBoy ead9630c13 Fix signedness for some fields in ARM stat definition 2019-10-12 20:52:10 +02:00
LemonBoy 40fc7a1fda Add support for the statx syscall 2019-10-12 20:51:51 +02:00
Andrew Kelley 01b2c291d5
miscellaneous improvements to generated docs
* introduce std.json.WriteStream API for writing json
   data to a stream
 * add WIP tools/merge_anal_dumps.zig for merging multiple semantic
   analysis dumps into one. See #3028
 * add std.json.Array, improves generated docs
 * add test for `std.process.argsAlloc`, improves test coverage and
   generated docs
2019-10-10 23:25:40 -04:00
LemonBoy 7640bec8e0 Fix pipe syscall for MIPS 2019-10-03 17:07:53 -04:00
LemonBoy 17f2af10b5 Correct signal bits for MIPS
Also enable the segfault handler for all the supported architectures
beside MIPS.
2019-10-01 13:58:58 -04:00
Nick Erdmann ff9c3c6e5b std/os/uefi: fix Guid alignment in rng protocol 2019-09-29 12:28:14 -04:00
Andrew Kelley ce0e794092
fix glibc builds on aarch64-linux-gnu
There was a missing include path in the compilation line, leading to
incorrect fstat ABI.

closes #3291
2019-09-27 18:19:21 -04:00
LemonBoy 5aaa7d0fbb Avoid truncating mmap2 offsets if not multiple of page size 2019-09-27 18:18:38 +02:00
Nick Erdmann 4527110e02
std/os/uefi: add some hii support 2019-09-27 07:56:14 +02:00
Nick Erdmann a4f324e9ea
std/os/uefi: add exitBootServices and allocatePool 2019-09-27 07:56:02 +02:00
Andrew Kelley 23a82b5ffd
fix mipsel regression in previous commit
I think that should actually be a compile error, it's a usingnamespace
that depends on itself. This workaround is fine for now.
2019-09-26 21:38:04 -04:00
Andrew Kelley ebe79329a2
fix some linux declarations not getting exposed 2019-09-26 18:49:37 -04:00
LemonBoy a94372231c Errno changes for MIPS 2019-09-26 18:07:39 +02:00
LemonBoy a9be62f085 Fix wrong IOCTL value 2019-09-26 11:49:49 +02:00
LemonBoy 4ebcf64864 Initial support for mipsel architecture¬ 2019-09-26 09:31:55 +02:00
Andrew Kelley ed36dbbd9c
mv std/ lib/
that's all this commit does. further commits will fix cli flags and
such.

see #2221
2019-09-25 23:35:41 -04:00