Isaac Freund
5f2bdafa39
std.posix: remove unchecked std.os.linux usage
...
Using std.os.linux directly in e.g. std.posix.timerfd_create() causes
the function to compile but silently fail at runtime when targeting any
OS other than Linux.
To catch errors like this at compile time, std.os.linux must only be
directly accessed within std.posix where there has been a comptime check
that the target os is in fact Linux.
2024-06-18 22:35:28 +02:00
Isaac Freund
a1777cb5cb
std: fix pthread_{get,set}name_np return type ABI
...
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.
2024-06-17 23:26:53 +02:00
Isaac Freund
687a756bf9
std: make all dirent structs extern
...
Using structs with unspecified layout on the ABI boundry can't end well.
2024-06-17 23:26:53 +02:00
Andrew Kelley
d06e5b4349
std.fs.Dir.openFile: use wasi libc API when -lc
...
Also removes the LOCK namespace from std.c.wasi because wasi libc does
not have flock.
closes #19336
related to #19352
Co-authored-by: Ryan Liptak <squeek502@hotmail.com>
2024-04-18 17:49:05 -07:00
Jacob Young
0c83fa2fd0
haiku: fix directory iteration
2024-04-08 13:20:14 -04:00
Jacob Young
5a41704f7e
cbe: rewrite CType
...
Closes #14904
2024-03-30 20:50:48 -04:00
Jacob Young
77ff6bc656
haiku: fix poll definitions
2024-03-27 01:55:42 -04:00
Jacob Young
2dd74cd312
haiku: debitrot
2024-03-23 18:11:32 +01:00
Andrew Kelley
8c94950c24
fix compilation failures found by CI
2024-03-19 16:18:18 -07:00
Andrew Kelley
cd62005f19
extract std.posix from std.os
...
closes #5019
2024-03-19 11:45:09 -07:00
Jacob Young
d10c52c194
AstGen: disallow alignment on function types
...
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.
2024-03-17 03:06:17 +01:00
Michael Dusan
d7cf25f5ca
bsd: debitrot std.c
...
- follow-up to f4bf061d8a
- updated std.fs.Dir to use properly named symbols
2024-03-15 02:28:50 -04:00
Michael Dusan
cf4a2099e1
dragonfly: debitrot std.c
2024-03-15 02:28:50 -04:00
Michael Dusan
6724a524d4
bsd: add missing os.IFNAMESIZE
...
- based on system API value IF_NAMESIZE
- unblocks `zig test lib/std/std.zig`
2024-03-14 18:54:25 -07:00
Tristan Ross
9d70d614ae
std.builtin: make link mode fields lowercase
2024-03-11 07:09:10 -07:00
mlugg
508a8739e2
std.c.openbsd: remove nop usingnamespace
...
I have no idea why this was even here...
Eliminates one more usage of `usingnamespace` from the standard library.
5 remain.
2024-03-08 08:02:45 +00:00
Michael Dusan
2ff64c7cb2
std.os.termios: add/fix std.c.TCSA for BSDs
2024-02-15 02:40:11 -05:00
Michael Dusan
7e83e7d9a8
bsd: debitrot type-safe std.c.O
...
Minor changes as per 7680c5330c mostly about pipe2() flags.
closes #18927
2024-02-14 19:26:12 -08:00
Tim Culverhouse
bec8511728
std.os: export T struct and winsize struct
...
Export the T struct and winsize struct for targets which have it defined
in std.c. This struct defines libc constants for ioctl syscalls.
2024-02-14 17:53:37 -08:00
Andrew Kelley
ae107cf71b
std.os.speed_t: add type safety
...
and collect the missing flag bits from all the operating systems.
2024-02-12 21:49:09 -07:00
Andrew Kelley
a280ff2767
std.os.termios: add type safety to lflag field
...
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.
2024-02-12 21:21:45 -07:00
Andrew Kelley
e97fa8b038
std.os.termios: add type safety to cflag field
...
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.
2024-02-12 18:24:07 -07:00
Andrew Kelley
20abc0caee
std.os.termios: add type safety to oflag field
...
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.
2024-02-12 17:28:09 -07:00
Andrew Kelley
47643cc5cc
std.os.termios: add type safety to iflag field
...
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.
2024-02-12 16:43:51 -07:00
Andrew Kelley
0c88f927f1
std.os.termios: consolidate and correct
2024-02-12 16:21:21 -07:00
Andrew Kelley
9a64318554
std.c.NCSS: consolidate and correct
2024-02-12 15:52:13 -07:00
Andrew Kelley
5258c3caad
std: add type safety to cc_t
2024-02-12 15:41:38 -07:00
Andrew Kelley
7680c5330c
some API work on std.c, std.os, std.os.wasi
...
* 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.
2024-02-11 13:38:55 -07:00
Andrew Kelley
a60f219660
std.c.MAP: use a packed struct
...
Same as previous commit, but for the libc interface.
2024-02-06 22:06:01 -07:00
Veikka Tuominen
74010fecc7
translate-c: use Aro's tokenizer
2023-11-25 12:28:19 +02:00
Andrew Kelley
7733894761
Merge pull request #17341 from rzezeski/illumos-updates
...
Illumos/Solaris updates
2023-10-03 11:04:41 -07:00
xdBronch
c9c3ee704c
correctly detect apple a15 and a16 chips
2023-10-03 00:36:59 -07:00
Ryan Zezeski
c17ebdca6a
solaris: fix path component max
2023-09-30 11:38:56 -06:00
Ryan Zezeski
f0724229d6
solaris: add missing registers
2023-09-30 11:38:56 -06:00
Aven Bross
6c54ed73f7
Added basic support for wasm32-emscripten target
2023-09-22 12:49:03 -07:00
Linus Groh
c097209792
std.c.linux: Add getpw{nam,uid}()
2023-09-08 21:46:05 +03:00
Michael Dusan
e1216686f3
dragonfly: std.c: more decls
...
- add ucontext_t, mcontext_t
- add pthread_rwlock_t
2023-08-15 17:29:35 -04:00
Michael Dusan
4532ff2780
netbsd: std.c: fix pthread_rwlock_t
...
- make .owner field optional
2023-08-15 17:29:35 -04:00
Michael Dusan
25542c3443
netbsd: std.c.REG: populate indexes for x86_64
2023-08-15 17:20:04 -04:00
Andrew Kelley
04d5e07d40
std.c.openbsd: remove "msg_" prefixes from structs
...
Reapplies 8f14431bc8 which was reverted in
95e2605d30 .
2023-07-31 11:57:48 -07:00
Andrew Kelley
479fd2f721
std.c.openbsd: add PTHREAD_STACK_MIN
...
@semarie audited this definition.
2023-07-31 11:54:27 -07:00
Andrew Kelley
b1bde35651
std.c.openbsd: add ucontext_t for aarch64
...
Reapplies 1585ed637d which was reverted in
f3adbe249b .
I removed use of `usingnamespace` in this commit.
@semarie audited this struct definition.
2023-07-31 11:51:08 -07:00
Andrew Kelley
235b9fc28a
Revert "std: add FreeBSD's procctl api."
...
This reverts commit 2e2d37917d .
2023-07-31 11:24:21 -07:00
Andrew Kelley
99c70ec24f
Revert "std: add kinfo_vmentry for FreeBSD"
...
This reverts commit 4a0508e56c .
2023-07-31 11:24:14 -07:00
Andrew Kelley
68134e56cb
Revert "std add getrandom to solato solaris based systems"
...
This reverts commit 56d800ff7e .
2023-07-31 11:24:09 -07:00
Andrew Kelley
a18a116bda
Revert "std: add shm_create_largepage for FreeBSD, completing MFD* constants."
...
This reverts commit 7b908e173f .
2023-07-31 11:24:04 -07:00
Andrew Kelley
c0ac1411db
Revert "std: freebsd update proposal"
...
This reverts commit 2568da2f41 .
2023-07-31 11:23:56 -07:00
Andrew Kelley
26777d98fe
Revert "std: adding freebsd's elf_aux_info api"
...
This reverts commit 83970b6d91 .
2023-07-31 11:23:49 -07:00
Andrew Kelley
b5df1bfcdb
Revert "os: expand sched_getaffinity wrapper and update freebsd's cpuset api flags."
...
This reverts commit dbdafb6cc5 .
2023-07-31 11:23:38 -07:00
Andrew Kelley
14353590f2
Revert "std: adding netbsd's pthread to cpu affinity api"
...
This reverts commit 3f259d3550 .
2023-07-31 11:23:33 -07:00