| Age | Commit message (Collapse) | Author |
|
std: Add several sockopt-related constants and structs
|
|
|
|
Because these lists are very long in several cases and quite
varied, I opted to place them in the existing c/foo.zig files.
There are many other sets of network-related constants like this
to add over time across all the OSes. For now I picked these
because I needed a few constants from each of these namespaces for
my own project, so I tried to flesh out these namespaces
completely as best I could, at least for basic sockopt purposes.
Note windows has some of these already defined in ws2_32 as
individual constants rather than contained in a namespacing
struct. I'm not sure what to do with that in the long run (break
it and namespace them?), but this doesn't change the status quo
for windows in any case.
|
|
It is now composed of these main sections:
* Declarations that are shared among all operating systems.
* Declarations that have the same name, but different type signatures
depending on the operating system. Often multiple operating systems
share the same type signatures however.
* Declarations that are specific to a single operating system.
- These are imported one per line so you can see where they come from,
protected by a comptime block to prevent accessing the wrong one.
Closes #19352 by changing the convention to making types `void` and
functions `{}`, so that it becomes possible to update `@hasDecl` sites
to use `@TypeOf(f) != void` or `T != void`. Happily, this ended up
removing some duplicate logic and update some bitrotted feature
detection checks.
A handful of types have been modified to gain namespacing and type
safety. This is a breaking change.
Oh, and the last usage of `usingnamespace` site is eliminated.
|
|
I believe this was accidentally broken when the E enum for errno values
was introduces. These functions are quite the special case in that they
return the error value directly rather than returning -1 and passing the
error value through the errno variable.
In any case, using a u16 as the return type at the ABI boundary where a
c_int is expected is asking for trouble.
|
|
Closes #14904
|
|
|
|
closes #5019
|
|
A pointer type already has an alignment, so this information does not
need to be duplicated on the function type. This already has precedence
with addrspace which is already disallowed on function types for this
reason. Also fixes `@TypeOf(&func)` to have the correct addrspace and
alignment.
|
|
- follow-up to f4bf061d8a8
- updated std.fs.Dir to use properly named symbols
|
|
- based on system API value IF_NAMESIZE
- unblocks `zig test lib/std/std.zig`
|
|
|
|
Minor changes as per 7680c5330cb mostly about pipe2() flags.
closes #18927
|
|
and collect the missing flag bits from all the operating systems.
|
|
This creates `tc_cflag_t` even though such a type is not defined by
libc.
I also collected the missing flag bits from all the operating systems.
|
|
This creates `tc_oflag_t` even though such a type is not defined by
libc.
I also collected the missing flag bits from all the operating systems.
|
|
This creates `tc_iflag_t` even though such a type is not defined by
libc.
I also collected the missing flag bits from all the operating systems.
|
|
|
|
|
|
|
|
* std.c: consolidate some definitions, making them share code. For
example, freebsd, dragonfly, and openbsd can all share the same
`pthread_mutex_t` definition.
* add type safety to std.c.O
- this caught a bug where mode flags were incorrectly passed as the
open flags.
* 3 fewer uses of usingnamespace keyword
* as per convention, remove purposeless field prefixes from struct field
names even if they have those prefixes in the corresponding C code.
* fix incorrect wasi libc Stat definition
* remove C definitions from incorrectly being in std.os.wasi
* make std.os.wasi definitions type safe
* go through wasi native APIs even when linking libc because the libc
APIs are problematic and wasteful
* don't expose WASI definitions in std.posix
* remove std.os.wasi.rights_t.ALL: this is a footgun. should it be all
future rights too? or only all current rights known? both are
the wrong answer.
|
|
Same as previous commit, but for the libc interface.
|
|
- make .owner field optional
|
|
|
|
This reverts commit 3f259d35502ed5a8bdb6bbc22f9adb39d610b006.
|
|
This reverts commit 23c4f55a612842d8544a9dfe604a9caf1ca39697.
|
|
This reverts commit 4f248e1b519b001cee67e461068245c142d38e73.
|
|
This reverts commit b677b3627818edc24828f36f8269a3c3843703a1.
|
|
This reverts commit ccfb0d408d5ffb40f77a8ad1fb57f0bb854583ad.
|
|
targetted towards platform like Linux/musl (#15791)"
This reverts commit 41502c6aa53a3da31b276c23c4db74db7d04796b.
|
|
This reverts commit 54ea0bbcdddc9e13ed98415d8883f03d59392509.
|
|
This reverts commit 64f0059cd33b571d6cf91df45f4cb2e0af9c0742.
|
|
This reverts commit 8f14431bc883898aaf78cc985e2d90716187e882.
|
|
|
|
Most of this migration was performed automatically with `zig fmt`. There
were a few exceptions which I had to manually fix:
* `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten
* `@truncate`'s fixup is incorrect for vectors
* Test cases are not formatted, and their error locations change
|
|
|
|
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
|
|
|
|
targetted towards platform like Linux/musl (#15791)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The system linker shows warning when `msync` is linked instead of `__msync13`:
"warning: reference to compatibility msync(); include <sys/mman.h> for correct reference"
closes #14422
|
|
- test `lib/std/std.zig` passes
- stack traces work
|
|
networking: delete std.x; add std.crypto.tls and std.http.Client
|
|
|
|
|