Files
Odin/core/sys/posix/sys_uio.odin
Harold Brenes 219b0fe535 Replace system:System.framework imports with system:System
This makes the linker work for both macOS and iOS targets
2025-07-13 15:45:21 -04:00

42 lines
1.1 KiB
Odin

#+build linux, darwin, netbsd, openbsd, freebsd, haiku
package posix
import "core:c"
when ODIN_OS == .Darwin {
foreign import libc "system:System"
} else {
foreign import libc "system:c"
}
// sys/uio.h - definitions for vector I/O operations
foreign libc {
/*
Equivalent to read() but takes a vector of inputs.
iovcnt can be 0..=IOV_MAX in length.
[[ More; https://pubs.opengroup.org/onlinepubs/9699919799/functions/readv.html ]]
*/
readv :: proc(fildes: FD, iov: [^]iovec, iovcnt: c.int) -> c.ssize_t ---
/*
Equivalent to write() but takes a vector of inputs.
iovcnt can be 0..=IOV_MAX in length.
[[ More; https://pubs.opengroup.org/onlinepubs/9699919799/functions/readv.html ]]
*/
writev :: proc(fildes: FD, iov: [^]iovec, iovcnt: c.int) -> c.ssize_t ---
}
when ODIN_OS == .Darwin || ODIN_OS == .FreeBSD || ODIN_OS == .NetBSD || ODIN_OS == .OpenBSD || ODIN_OS == .Linux || ODIN_OS == .Haiku {
iovec :: struct {
iov_base: rawptr, /* [PSX] base address of I/O memory region */
iov_len: c.size_t, /* [PSX] size of the region iov_base points to */
}
}