Files
Odin/core/sys/posix/spawn.odin
Ignacy Koper b5cb4b96fc removed Haiku from core:sys/posix package
Signed-off-by: Ignacy Koper <ignacy423@gmail.com>
2026-04-28 19:27:25 +02:00

22 lines
769 B
Odin

#+build linux, darwin, openbsd, freebsd, netbsd
package posix
when ODIN_OS == .Darwin {
foreign import lib "system:System.framework"
} else {
foreign import lib "system:c"
}
foreign lib {
/*
Creates a child process from a provided filepath
spawnp searches directories on the path for the file
Returns: 0 on success, with the child pid returned in the pid argument, or error values on failure.
[[ More; https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawn.html ]]
*/
posix_spawn :: proc(pid: ^pid_t, path: cstring, file_actions: rawptr, attrp: rawptr, argv: [^]cstring, envp: [^]cstring) -> Errno ---
posix_spawnp :: proc(pid: ^pid_t, file: cstring, file_actions: rawptr, attrp: rawptr, argv: [^]cstring, envp: [^]cstring) -> Errno ---
}