fork() on Linux/sparc64 seems to return its result in two registers,
with %o0 always holding the current process' PID, and the parent/child
status returned in %o1. Add some glue code to convert those into
the libc-style return value.
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?
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.
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.
- correct uid_t from i32 to u32 on linux
- define uid_t and gid_t for OSes missing definitions
- use uid_t/gid_t instead of plain u32s throughout std.os
* moved bpf syscall, added some bpf instructions and tests
* had to move bpf out of bits so that a freestanding target could import it
* removed line
* fixed imports
* improve docs
* add TODO comments for things that don't have open issues
* remove redundant namespacing of struct fields
* guard against ioctl returning EINTR
* remove the general std.os.ioctl function in favor of the specific
ioctl_SIOCGIFINDEX function. This allows us to have a more precise
error set, and more type-safe API.