Andrew Kelley
c9551652b0
Merge pull request #6978 from LemonBoy/statshit
...
Decouple kernel and libc stat definitions
2020-11-05 17:27:22 -05:00
Andrew Kelley
cf7505da1f
Merge pull request #6974 from daurnimator/prctl-cleanup
...
prctl improvements
2020-11-05 17:25:24 -05:00
Andrew Kelley
f85d719952
Merge pull request #6895 from jorangreef/fallocate
...
linux: add fallocate()
2020-11-05 17:23:00 -05:00
LemonBoy
cca6b11138
Label WASI stat as kernel_stat
...
We're using WASI syscalls, it makes sense to put the kernel_ prefix.
2020-11-05 12:44:43 +01:00
LemonBoy
0e95fa455c
std: Split kernel&libc definitions of stat struct
...
There's no guarantee for the kernel definition to be ABI compatible with
the libc one (and vice versa).
There's also no guarantee of ABI compatibility between musl/glibc.
Fun, isn't it?
2020-11-05 09:38:50 +01:00
rageoholic
e5100605e9
Add missing LONG_PTR type
2020-11-04 18:30:48 -06:00
rageoholic
04267fb1ba
Fix CoInitializeEx so it can take a null pointer
2020-11-04 16:53:05 -06:00
LemonBoy
346a686b9d
std: Correct stack_t definition for mips
2020-11-04 15:55:06 +01:00
LemonBoy
f313c88428
std: Fix pipe syscall stub for sparc64
2020-11-04 15:54:38 +01:00
daurnimator
b42ffbe9e8
std: use PR enum as only location of opcode numbers
2020-11-04 22:39:35 +11:00
daurnimator
b90fb1e96b
std: add PR enum for the prctl opcode
2020-11-04 22:32:57 +11:00
Jakub Konka
5060497174
Merge pull request #6921 from xackus/gimmeMoreOfThoseSweetSweetFileDescriptors
...
stage2: ask for more file descriptors
2020-11-03 10:07:39 +01:00
Joran Dirk Greef
8193f55820
Support 32-bit big-endian targets
2020-11-03 06:03:38 +02:00
Jakub Konka
8dda64fa3e
Fix Darwin codepath
...
On Darwin, according to the man pages for setrlimit(), when adjusting
max number of open fds, the reported hard max by getrlimit() is only
theoretical, while the actual maximum, set in the kernel, is hardcoded
in the header file. Therefore, the reported max has to be adjusted
as `min(OPEN_MAX, lim.max)`.
Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-11-03 00:38:43 +01:00
LemonBoy
dc872a221d
std: Fix syscall stubs passing 64bit offsets for BE targets
2020-11-02 12:11:07 +01:00
Joran Dirk Greef
78e9e131e0
Pending #5127
2020-11-02 12:37:55 +02:00
Joran Dirk Greef
067bd7e424
Switch back to writing Zig
2020-11-02 09:55:25 +02:00
Joran Dirk Greef
9dec310826
Debug unhandled errno
2020-11-02 09:52:42 +02:00
Andrew Kelley
909aae8153
Merge pull request #6792 from koachan/sparc64-linux
...
Initial sparc64-linux bringup
2020-11-01 22:14:56 -05:00
xackus
6418284680
std: add {set,get}rlimit bits and improve test
2020-11-01 15:47:46 -05:00
Joran Dirk Greef
c910f03a7b
Swap endianness
2020-11-01 13:14:32 +02:00
Joran Dirk Greef
a67f140d2f
Add test
2020-11-01 11:55:27 +02:00
Joran Dirk Greef
2dd8613adc
"The Traveling Wilburys' - Handle With Care"
...
Both `offset` and `len` are `off_t`.
Like the rest of the std lib we assume that `_FILE_OFFSET_BITS == 64`
is always true, so that `off_t` is a `u64`.
When passing to 32-bit kernels, we split these into two `u32`
parameters.
2020-11-01 11:49:08 +02:00
Joran Dirk Greef
2fdb30a571
Add definitions for FALLOC_FL_ mode flags
2020-11-01 11:47:09 +02:00
Joran Dirk Greef
8fd88fdb31
linux: add fallocate()
2020-10-31 13:39:33 +02:00
Joran Dirk Greef
ab1ed93ad9
Add close_range, faccessat2 and process_madvise
2020-10-30 12:39:01 +02:00
Joran Dirk Greef
9423ed1671
Add more mips syscall numbers
...
As per: lib/libc/musl/arch/mips/bits/syscall.h.in
...and as promised: https://github.com/ziglang/zig/pull/6356#issuecomment-696023349
Thanks @daurnimator again for the help with #6356 .
2020-10-30 11:53:45 +02:00
Koakuma
891c6ddd5f
Select stat struct type based on whether we are linking with libc
2020-10-30 11:46:33 +07:00
Andrew Kelley
a41c0b63bb
Merge pull request #6356 from jorangreef/io_uring
...
std: add io_uring library
2020-10-29 18:20:38 -04:00
Koakuma
5125eb77bd
Use the *_stat type as self
2020-10-29 21:37:45 +07:00
johnLate
23c28c72b7
std.os.linux.accept/accept4: allow null for addr and len
...
std.os.accept already wants to allow null, which matches `man 3p accept`:
> address Either a null pointer, or a pointer to a sockaddr structure
> where the address of the connecting socket shall be re‐
> turned.
>
> address_len Either a null pointer, if address is a null pointer, or a
> pointer to a socklen_t object which on input specifies the
> length of the supplied sockaddr structure, and on output
> specifies the length of the stored address.
Fixes ziglang#6832.
2020-10-27 21:52:47 +01:00
LemonBoy
8044ed4c66
std: Add basic smoke test for net functionality
2020-10-27 21:52:47 +01:00
Frank Denis
74a1175d9d
std/*: add missing MIT license headers
2020-10-26 17:41:29 +01:00
Sébastien Marie
2a0a11aa66
openbsd: make dl_phdr_info cross arches
...
introduce Addr and Half definition to std.elf, and use them for dl_phdr_info
2020-10-25 20:46:28 -04:00
Koakuma
cbc8750502
Separate libc stat and kernel stat definitions
2020-10-25 23:52:08 +07:00
Koakuma
3ce9428e3d
Various formatting fixes
2020-10-25 21:53:16 +07:00
Koakuma
1a362ea5b0
Fix sparc64 bits definitions
2020-10-25 21:38:39 +07:00
Koakuma
785153d756
Fix SA_* constants for sparc64
2020-10-25 20:39:32 +07:00
Koakuma
f018201009
Predict error-less path on syscalls
2020-10-25 20:07:18 +07:00
Koakuma
2e7a4758b3
Add back ppc input/output/clobber definitions
...
Accidentally removed when rebasing, this adds it back.
2020-10-25 13:39:22 +07:00
Koakuma
1d3abb761d
"zig fmt" on lib/std/os/linux.zig
2020-10-25 13:38:08 +07:00
Koakuma
e7369ada93
Fix boolean operator in if clause
2020-10-24 21:33:40 +07:00
Koakuma
73e62f22ec
Fix sigaction(2) call on sparc64
2020-10-24 20:05:37 +07:00
Koakuma
cdbf66e36e
Add sparc64-specific values for the various SA_ and SIG_ constants
2020-10-24 20:05:34 +07:00
Koakuma
268516d5d9
Fix constants
2020-10-24 20:04:18 +07:00
Koakuma
238f253de9
Move comptime out
2020-10-24 20:03:41 +07:00
Koakuma
300cfbf252
Add TLS implementation for sparc64
2020-10-24 20:03:40 +07:00
Koakuma
6146f81c6e
Add pipe(2) support
2020-10-24 20:03:37 +07:00
Koakuma
dba009fd21
Account for the delay slot
2020-10-24 20:01:32 +07:00
Koakuma
c29da84c0e
Add sp loading
2020-10-24 20:01:29 +07:00