Tristan Ross
6067d39522
std.builtin: make atomic order fields lowercase
2024-03-11 07:09:10 -07:00
Tristan Ross
9d70d614ae
std.builtin: make link mode fields lowercase
2024-03-11 07:09:10 -07:00
mlugg
265f42d472
std.os.linux: rework io_uring support
...
* `linux.IO_Uring` -> `linux.IoUring` to align with naming conventions.
* All functions `io_uring_prep_foo` are now methods `prep_foo` on `io_uring_sqe`, which is in a file of its own.
* `SubmissionQueue` and `CompletionQueue` are namespaced under `IoUring`.
This is a breaking change.
The new file and namespace layouts are more idiomatic, and allow us to
eliminate one more usage of `usingnamespace` from the standard library.
2 remain.
2024-03-08 08:02:45 +00:00
mlugg
229800482d
std.os.linux: do not use usingnamespace to define getauxval
...
This usage of `usingnamespace` was removed fairly trivially - the
resulting code is, IMO, more clear.
Eliminates one more usage of `usingnamespace` from the standard library.
2024-03-08 08:02:44 +00:00
mlugg
14ab9fb154
std.os.linux: remove unnecessary use of usingnamespace
...
This is a trivial change - this code did `usingnamespace` into an
otherwise empty namespace, so the outer namespace was just unnecessary.
Eliminates one more usage of `usingnamespace` from the standard library.
2024-03-08 08:02:44 +00:00
OK Ryoko
0b2e23b066
std.os.linux: enforce null-terminated path arguments
2024-03-05 20:11:49 +02:00
Andrew Kelley
5f92558290
std.posix.termios: bring V back
...
In d7563a7753393d7f0d1af445276a64b8a55cb857, I misunderstood what `cc_t`
was supposed to do. Those V enum values are indices into the array.
2024-02-13 20:10:32 -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
fad5e7a997
Merge pull request #18898 from psnszsn/iouring_waitid
...
io_uring: add waitid operation
2024-02-12 12:20:12 -08: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
Vlad Pănăzan
20ea0012f0
linux: add missing io_uring opcodes
2024-02-11 15:43:12 +01:00
Andrew Kelley
9f3165540e
std.os.linux.MAP: use a packed struct
...
Introduces type safety to this constant. Eliminates one use of
`usingnamespace`.
2024-02-06 21:12:11 -07:00
Stephen Gregoratto
3200fae9c5
Linux: Add syscall bindings, enhance documentation.
...
- Add syscall bindings/structures for the `futex2` family.
The documentation is taken from the syscall definitions.
- Add documnentation for the `cachestat` bindings and structures.
Taken from work I did in Cosmopolitian libc.
- Add binding for `map_shadow_stack`.
No documentation for this one, since the kernel devs didn't bother to
do it ¯\_(ツ)_/¯.
2024-01-15 20:05:03 +11:00
Stephen Gregoratto
cf6751ae55
Add fchmodat2 bits to os/linux.zig
2024-01-13 23:52:01 -07:00
David Rubin
2f8e4347b1
Optimized std.mem.eql with SIMD ( #18389 )
...
* optimized memeql
* add `sched_setaffinity` to `std.os.linux`
Co-authored-by: Protty <45520026+kprotty@users.noreply.github.com>
Co-authored-by: Ryan Liptak <squeek502@hotmail.com>
2024-01-09 02:50:22 -05:00
xdBronch
7a46c20a79
switch to mem.span
...
Co-authored-by: erikarvstedt <36110478+erikarvstedt@users.noreply.github.com>
2023-12-08 15:58:08 +02:00
xdBronch
e9bd10cfda
add getName helper to inotify_event
2023-12-08 15:58:08 +02:00
mlugg
51595d6b75
lib: correct unnecessary uses of 'var'
2023-11-19 09:55:07 +00:00
Kai Jellinghaus
7ee7c90274
Fix regressing #17290 from #17734
2023-11-01 18:30:56 +02:00
Andrew Kelley
3fc6fc6812
std.builtin.Endian: make the tags lower case
...
Let's take this breaking change opportunity to fix the style of this
enum.
2023-10-31 21:37:35 -04:00
joadnacer
0005e7e70b
std.linux: Update io_uring structs and consts for kernel 6.3.8
2023-10-27 00:31:52 +01:00
Prokop Randacek
fee09009a8
gettimeofday takes nullable pointers
2023-10-20 00:15:34 -04:00
Ratakor
8ce33795e9
Add pause() to linux.zig
2023-10-06 11:49:31 -07:00
Ratakor
cef90eab57
Add filled_sigset to os.linux
...
filled_sigset is equivalent to sigfillset() as empty_sigset is
equivalent to sigemptyset().
2023-10-06 11:49:31 -07:00
Jacob Young
2a5335d7b6
x86_64: implement C abi for 128-bit integers
2023-10-04 14:42:35 -04:00
nikneym
9f0d2f9417
linux: add fanotify API
2023-10-04 13:48:22 +03:00
Kai Jellinghaus
11489bb04f
Update IORING_OP to reflect upstream ( #17388 )
...
Reference [upstream io_uring.h](cbf3a2cb15/include/uapi/linux/io_uring.h (L234) )
2023-10-04 09:18:14 +00:00
Stephen Gregoratto
bc0bf4e97a
Linux: Add cachestat wrapper.
...
Can be tested using this program I whipped up:
https://gist.github.com/The-King-of-Toasters/aee448f5975c50f735fd1946794574f7
2023-09-28 18:58:05 +10:00
Kai Jellinghaus
d1e39b6914
Add new fields to io_sqring_offsets & io_cqring_offsets
...
`user_addr`s were introduced in `03d89a2` ([github link](03d89a2de2 ) which was shipped in v6.5
`flags` was introduced even earlier
2023-09-26 18:16:36 -07:00
kcbanner
2e2d6d2c3d
linux: fixup for platforms that don't support extern functions yet
2023-08-27 19:50:57 -04:00
kcbanner
fb0cef8522
linux: only export getauxval if not linking libc
2023-08-27 16:52:43 -04:00
kcbanner
fba81cd606
linux: instead of export elf_aux_maybe, export getauxval itself
2023-08-27 11:12:31 -04:00
kcbanner
731c6d3fbb
linux: export elf_aux_maybe so that libraries can call getauxval
2023-08-26 17:55:12 -04:00
mllken
9676a43a5d
linux: add setsid
2023-08-09 11:33:06 -07:00
Andrew Kelley
e84cda0ebf
Merge pull request #16622 from jacobly0/cbe-asm-compat
...
CBE: fix regressions and get new targets passing behavior tests
2023-07-31 15:34:32 -07:00
Andrew Kelley
8678d445c2
Revert "linux adding some NUMA support"
...
This reverts commit 6f418c11e1ad1150fbdb002cfe1be92bda4e93cb.
2023-07-31 11:02:43 -07:00
Andrew Kelley
182bec8771
Revert "std.os: adding linux's sched_setaffinity and its wrapper"
...
This reverts commit c7bf8bab38f8b89c1371eedb9229e00a29b5ca5b.
2023-07-31 11:01:42 -07:00
Andrew Kelley
833af381f0
Revert "std.os: add linux timer api"
...
This reverts commit b9d2e0e308794463db1b1acf04d76778c470a070.
2023-07-31 10:56:55 -07:00
Jacob Young
228c956377
std: finish cleanup up asm
...
This also required implementing the necessary syntax in the x86_64 backend.
2023-07-31 03:49:21 -04:00
Zachary Raineri
dc98b001f3
std.os.linux | Fix sendmmsg function | Issue #16513
...
Closes #16513
2023-07-25 11:04:10 -07:00
Zachary Raineri
d82b359010
Use builtin inference over @as where possible
2023-07-24 10:23:51 -07:00
kcbanner
891fa3b8b5
debug: fix initialization of the optional fields on StackIterator
...
dwarf: documentation fixups
target: enable unwind tables on macho
2023-07-20 22:58:15 -04:00
kcbanner
41832aa1e6
linux: add getcontext for x86_64
2023-07-20 22:58:14 -04:00