mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-12 06:11:26 -07:00
sys/posix: impl rest of linux, impl some of Windows
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#+build linux, darwin, netbsd, openbsd, freebsd
|
||||
package posix
|
||||
|
||||
import "core:c"
|
||||
@@ -13,16 +14,6 @@ when ODIN_OS == .Darwin {
|
||||
// NOTE: most of the symbols in this header are not useful in Odin and have been left out.
|
||||
|
||||
foreign lib {
|
||||
/*
|
||||
Map the error number to a locale-dependent error message string.
|
||||
|
||||
Returns: a string that may be invalidated by subsequent calls
|
||||
|
||||
[[ More; https://pubs.opengroup.org/onlinepubs/9699919799/functions/strerror.html ]]
|
||||
*/
|
||||
@(link_name="strerror")
|
||||
_strerror :: proc(errnum: Errno) -> cstring ---
|
||||
|
||||
/*
|
||||
Map the error number to a locale-dependent error message string and put it in the buffer.
|
||||
|
||||
@@ -41,7 +32,3 @@ foreign lib {
|
||||
*/
|
||||
strsignal :: proc(sig: Signal) -> cstring ---
|
||||
}
|
||||
|
||||
strerror :: #force_inline proc "contextless" (errnum: Maybe(Errno) = nil) -> cstring {
|
||||
return _strerror(errnum.? or_else errno())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user