Commit Graph

210 Commits

Author SHA1 Message Date
protty 5d30e8016d time: introduce Instant (#10972) 2022-02-24 18:51:44 -05:00
Veikka Tuominen 65aa333197 fix formatting in openbsd.zig
CI was failing for unrelated reasons so this went unnoticed
2022-02-20 11:58:42 +02:00
Dante Catalfamo ec59a04138 Add OpenBSD auth functions 2022-02-20 09:58:58 +02:00
Anthony Carrico 078aa5f7b2 Adds Linux support for POSIX file locking with fcntl
On Linux, locking fails with EAGAIN (vs. EACCES on other systems).
This commit also adds FcntlErrors for EDEADLK and ENOLCK.
2022-02-15 13:22:50 +02:00
Veikka Tuominen 90f2a8d9c5 Merge pull request #10486 from ominitay/metadata
std: Implement cross-platform metadata API
2022-02-14 12:33:49 +02:00
ominitay b2610649fc std.c.*: add birthtime function to Stat
Adds a birthtime function to the `Stat` structs of Unices which support this. This is done to match the `atime`, `mtime`, and `ctime` functions.
2022-02-13 20:40:45 +00:00
ominitay d978fdaa67 std.c.Wasi.Stat: use timespec 2022-02-13 20:40:44 +00:00
ominitay 3dd3c5063b std.c.haiku: move Stat.crtime to Stat.birthtime 2022-02-13 20:40:44 +00:00
ominitay f23005eba7 std.c.darwin.Stat: use timespec
Uses timespec for times in `Stat` instead of two `isize` fields per time. This matches the <sys/stat.h> header file.
2022-02-13 20:40:44 +00:00
m 65299c37d1 validate in Windows using VirtualQuery 2022-02-11 22:15:46 +01:00
m bd8d6a8342 std: validate frame-pointer address in stack walking 2022-02-11 15:28:36 +01:00
John Schmidt 05cf69209e debug: implement segfault handler for macOS aarch64
Tested on a M1 MacBook Pro, macOS Monterey 12.2.
2022-02-07 16:34:05 -05:00
Andrew Kelley 8a94971980 std: fix i386-openbsd failing to build from source
closes #9705
2022-02-07 12:20:25 -07:00
Žiga Željko 5210b9074c os,wasi: use wasi-libc if available 2022-01-31 22:54:30 +01:00
joachimschmidt557 fa84625aeb std: Add some missing termios types to c/linux.zig and os.zig 2022-01-23 17:12:07 +01:00
John Schmidt 305a7def13 Implement segfault handler for macOS x86_64 2022-01-18 15:10:49 -05:00
johnLate 4addb26bba Fix os.rusage when linking with c library on Linux
Fixes ziglang#10543 on Linux.
2022-01-17 16:52:36 +02:00
John Schmidt 66fe5bb0d8 Use libc if_nametoindex if available when parsing IPs
Fixes https://github.com/ziglang/zig/issues/10521 and makes a couple of
additional tests pass when linking libc.
2022-01-12 19:32:46 +01:00
Dante Catalfamo 3bd0575cfe Add BSD Authentication constants (#10376) 2021-12-22 00:59:53 -05:00
Isaac Freund 9f9f215305 stage1, stage2: rename c_void to anyopaque (#10316)
zig fmt now replaces c_void with anyopaque to make updating
code easy.
2021-12-19 00:24:45 -05:00
Zapolsky Anton 2dae860de3 Added an explicit type for the termios constants (#10266)
Adds the `tcflag_t` type to the termios constants.
This is made to allow bitwise operations on the termios
constants without an integer cast, e.g.:

```zig
var raw = try std.os.tcgetattr(std.os.STDIN_FILENO);
raw.lflag &= std.os.linux.ECHO | std.os.linux.ICANON;
```
instead of

```zig
var raw = try std.os.tcgetattr(std.os.STDIN_FILENO);
raw.lflag &= ~@intCast(u32, std.os.linux.ECHO | std.os.linux.ICANON);
```

Contributes to #10181
2021-12-04 16:24:55 -05:00
Andrew Kelley 2a0adef583 Merge pull request #9910 from mikdusan/dragonfly
dragonfly: port Thread.setname/getname
2021-12-03 17:29:55 -08:00
Andrew Kelley 902df103c6 std lib API deprecations for the upcoming 0.9.0 release
See #3811
2021-11-30 00:13:07 -07:00
Andrew Kelley 36c8adf589 Merge pull request #10073 from hoanga/haiku-support-build2
more haiku support
2021-11-24 18:42:30 -08:00
Dante Catalfamo 12140ead43 Change darwin c.VMIN -> c.V.MIN to match Linux 2021-11-21 16:43:16 -05:00
Dante Catalfamo 54bcd1cd51 Add OpenBSD termios constants to std.c.openbsd (#10178) 2021-11-20 01:34:53 -08:00
Al Hoang be541ca5e1 haiku follow up cleanup of constants 2021-11-19 22:04:09 -06:00
Felix "xq" Queißner 2fefd4ea8e Fixes invalid errno definition for ***-linux-android 2021-11-18 12:58:28 -05:00
Al Hoang 4ec83133e9 haiku constants cleanup and update 2021-11-15 00:29:27 -06:00
Al Hoang cfb9bf59c1 update mmap flags, use defines 2021-11-15 00:29:27 -06:00
Al Hoang 59e91f4b25 ensure zig fmt 2021-11-15 00:29:27 -06:00
Al Hoang 426f54026b updates for haiku stdc
* add team_info, area_info
* update signature for get_next_image_info
* add error checks for haiku system calls
* update and cleanup of haiku constants
2021-11-15 00:29:26 -06:00
Andrew Kelley a78e61acf9 std: expose rusage constants under rusage namespace 2021-11-01 15:55:22 -07:00
pfg 1de6f9a267 std: add missing termios def to std/c/linux.zig
Fixes #9707
2021-10-30 18:32:26 +02:00
Michael Dusan d621f4322b dragonfly: port std.Thread.setname/getname 2021-10-09 03:52:28 -04:00
Andrew Kelley 6115cf2240 migrate from std.Target.current to @import("builtin").target
closes #9388
closes #9321
2021-10-04 23:48:55 -07:00
Stephen Gregoratto 87fd502fb6 Initial bringup of the Solaris/Illumos port 2021-09-24 14:06:16 -04:00
Stephen Gregoratto 506f24cac2 Set the Storage socket sizes to be system defined
Some systems (Solaris, OpenBSD, AIX) change their definitions of
sockaddr_storage to be larger than 128 bytes. This comment adds a new
constant in the `sockaddr` that defines the size for every system.

Fixes #9759
2021-09-16 13:32:55 +03:00
Kenta Iwasaki c4f97d3365 os: usingnamespace fixes for std.x.os.Socket and std.os.TCP
Extract existing constants to do with TCP socket options into a 'TCP'
namespace.

Export 'MSG' and 'TCP' from std.os.{linux, windows} into std.c.

Fix compile errors to do with std.x.os.Socket methods related to setting
TCP socket options.

Handle errors in the case that an interface could not be resolved in an
IPv6 address on Windows. Tested using Wine with the loopback interface
disabled.

Have all instantiations of std.x.os.Socket on Windows instantiate an
overlapped socket descriptor. Fixes the '1ms read timeout' test in
std.x.net.tcp.Client. The test would previously deadlock, as read
timeouts only apply to overlapped sockets.

Windows documentation by default recommends that most instantiations of
sockets on Windows be overlapped sockets (s.t. they may operate in both
blocking or nonblocking mode when operated with WSA* syscalls). Refer to
the documentation for WSASocketA for more info.
2021-09-12 23:36:44 -04:00
Jacob G-W 738395f9bc std: update event loop for recent usingnamespace changes 2021-09-06 15:16:29 -04:00
Andrew Kelley 0932b0d9b3 std.os reorg: regression fixes to stack_t, and std.Thread 2021-09-01 17:54:07 -07:00
Andrew Kelley 1a492d5156 re-apply a commit dropped in this branch due to conflicts
This commit reapplies 4f0aa7d639.
2021-09-01 17:54:07 -07:00
Andrew Kelley f8dd4b13d6 std.os reorg: more fixes caught by CI 2021-09-01 17:54:07 -07:00
Andrew Kelley 057f0fec33 std.os fixes to get the test suite passing again 2021-09-01 17:54:07 -07:00
Andrew Kelley cca57042df std: fix regressions from this branch
Also move some usingnamespace test cases from compare_output to
behavior.
2021-09-01 17:54:07 -07:00
Andrew Kelley c05a20fc8c std: reorganization that allows new usingnamespace semantics
The proposal #9629 is now accepted, usingnamespace stays but no longer
puts identifiers in scope.
2021-09-01 17:54:06 -07:00
Andrew Kelley 7884d84315 std.os.windows: reorg to avoid usingnamespace
Down to 19 uses of `usingnamespace`.
2021-09-01 17:54:06 -07:00
Andrew Kelley b781ef464d std.os: fix FILENO constants mapped to wrong values
yikes!
2021-09-01 17:54:06 -07:00
Andrew Kelley 7f03cfe161 std.os: more reorganization efforts
* std lib tests are passing on x86_64-linux with and without -lc
 * stage2 is building from source on x86_64-linux
 * down to 38 remaining uses of `usingnamespace`
2021-09-01 17:54:06 -07:00
Andrew Kelley c09ba8796c std.os.linux: remove the "bits" namespace altogether
Now there is only 1 architecture-specific file for Linux kernel bits.
2021-09-01 17:54:06 -07:00