core/os/old
os_old
Types
29ADDRESS_FAMILY
ADDRESS_FAMILY :: u16SourceDir
Dir :: rawptrSourceDIR*
Dirent
Dirent :: struct {
ino: u64,
off: u64,
reclen: u16,
type: u8,
name: [256]u8,
}SourceNOTE(laleksic, 2021-01-21): Comment and rename these to match OS_Stat above
Errno
Errno :: ErrorSourcealias for legacy use
Error
Error :: union {
General_Error,
io.Error,
runtime.Allocator_Error,
Platform_Error,
}SourceFile_Info
File_Info :: struct {
fullpath: string,
name: string,
size: i64,
mode: File_Mode,
is_dir: bool,
creation_time: time.Time,
modification_time: time.Time,
access_time: time.Time,
}SourceFile_Mode
File_Mode :: u32SourceFile_Time
File_Time :: u64SourceGeneral_Error
General_Error :: enum u32 {
None = 0,
Exist = 1,
Not_Exist = 2,
Timeout = 3,
Broken_Pipe = 4,
Invalid_File = 5,
Invalid_Dir = 6,
Invalid_Path = 7,
Invalid_Callback = 8,
Pattern_Has_Separator = 9,
File_Is_Pipe = 10,
Not_Dir = 11,
// Environment variable not found.
Env_Var_Not_Found = 12,
}SourceHandle
Handle :: i32SourceOS_Stat
OS_Stat :: struct {
device_id: u64,
serial: u64,
nlink: u64,
mode: u32,
uid: u32,
gid: u32,
_: i32,
rdev: u64,
size: i64,
block_size: i64,
blocks: i64,
last_access: Unix_File_Time,
modified: Unix_File_Time,
status_change: Unix_File_Time,
_reserved: [3]i64,
}SourcePid
Pid :: i32SourceSIOCGIFFLAG
SIOCGIFFLAG :: enum c.int {
UP = 0, // Interface is up.
BROADCAST = 1, // Broadcast address valid.
DEBUG = 2, // Turn on debugging.
LOOPBACK = 3, // Is a loopback net.
POINT_TO_POINT = 4, // Interface is point-to-point link.
NO_TRAILERS = 5, // Avoid use of trailers.
RUNNING = 6, // Resources allocated.
NOARP = 7, // No address resolution protocol.
PROMISC = 8, // Receive all packets.
ALL_MULTI = 9, // Receive all multicast packets. Unimplemented.
MASTER = 10, // Master of a load balancer.
SLAVE = 11, // Slave of a load balancer.
MULTICAST = 12, // Supports multicast.
PORTSEL = 13, // Can set media type.
AUTOMEDIA = 14, // Auto media select active.
DYNAMIC = 15, // Dialup device with changing addresses.
LOWER_UP = 16,
DORMANT = 17,
ECHO = 18,
}SourceSIOCGIFFLAGS
SIOCGIFFLAGS :: bit_set[SIOCGIFFLAG; c.int]SourceSOCKADDR
SOCKADDR :: struct #packed {
sa_family: ADDRESS_FAMILY,
sa_data: [14]c.char,
}SourceSOCKADDR_STORAGE_LH
SOCKADDR_STORAGE_LH :: struct #packed {
ss_family: ADDRESS_FAMILY,
__ss_pad1: [6]c.char,
__ss_align: i64,
__ss_pad2: [112]c.char,
}SourceSocket
Socket :: intSourceTimeval
Timeval :: struct {
seconds: i64,
microseconds: int,
}SourceUnix_File_Time
Unix_File_Time :: struct {
seconds: i64,
nanoseconds: i64,
}Source_Platform_Error
_Platform_Error :: ErrnoSourceifaddrs
ifaddrs :: struct {
next: ^ifaddrs,
name: cstring,
flags: SIOCGIFFLAGS,
address: ^SOCKADDR,
netmask: ^SOCKADDR,
broadcast_or_dest: ^SOCKADDR,
data: rawptr,
}Sourcein6_addr
in6_addr :: struct #packed {
s6_addr: [16]u8,
}Sourcein_addr
in_addr :: struct #packed {
s_addr: u32,
}Sourcepollfd
pollfd :: struct {
fd: c.int,
events: c.short,
revents: c.short,
}Sourcertnl_link_stats
rtnl_link_stats :: struct #packed {
rx_packets: u32,
tx_packets: u32,
rx_bytes: u32,
tx_bytes: u32,
rx_errors: u32,
tx_errors: u32,
rx_dropped: u32,
tx_dropped: u32,
multicast: u32,
collisions: u32,
rx_length_errors: u32,
rx_over_errors: u32,
rx_crc_errors: u32,
rx_frame_errors: u32,
rx_fifo_errors: u32,
rx_missed_errors: u32,
tx_aborted_errors: u32,
tx_carrier_errors: u32,
tx_fifo_errors: u32,
tx_heartbeat_errors: u32,
tx_window_errors: u32,
rx_compressed: u32,
tx_compressed: u32,
rx_nohandler: u32,
}Sourcesigset_t
sigset_t :: u64Sourcesockaddr_in
sockaddr_in :: struct #packed {
sin_family: ADDRESS_FAMILY,
sin_port: u16be,
sin_addr: in_addr,
sin_zero: [8]c.char,
}Sourcesockaddr_in6
sockaddr_in6 :: struct #packed {
sin6_family: ADDRESS_FAMILY,
sin6_port: u16be,
sin6_flowinfo: c.ulong,
sin6_addr: in6_addr,
sin6_scope_id: c.ulong,
}Sourcesocklen_t
socklen_t :: intSourceConstants
242ADDR_NO_RANDOMIZE
ADDR_NO_RANDOMIZE :: 0x40000SourceAF_BLUETOOTH
AF_BLUETOOTH :: int = 31SourceAF_INET
AF_INET :: int = 2SourceAF_INET6
AF_INET6 :: int = 10SourceAF_LOCAL
AF_LOCAL :: int = AF_UNIXSourceAF_PACKET
AF_PACKET :: int = 17SourceAF_UNIX
AF_UNIX :: int = 1SourceAF_UNSPEC
AF_UNSPEC :: int = 0SourceARCH
ARCH :: ODIN_ARCHSourceAT_FDCWD
AT_FDCWD :: _ = ~uintptr(99)SourceAT_REMOVEDIR
AT_REMOVEDIR :: uintptr = uintptr(0x200)SourceAT_SYMLINK_NOFOLLOW
AT_SYMLINK_NOFOLLOW :: uintptr = uintptr(0x100)SourceEACCES
EACCES :: Platform_Error.EACCESSourceEADDRINUSE
EADDRINUSE :: Platform_Error.EADDRINUSESourceEADDRNOTAVAIL
EADDRNOTAVAIL :: Platform_Error.EADDRNOTAVAILSourceEADV
EADV :: Platform_Error.EADVSourceEAFNOSUPPORT
EAFNOSUPPORT :: Platform_Error.EAFNOSUPPORTSourceEAGAIN
EAGAIN :: Platform_Error.EAGAINSourceEALREADY
EALREADY :: Platform_Error.EALREADYSourceEBADE
EBADE :: Platform_Error.EBADESourceEBADF
EBADF :: Platform_Error.EBADFSourceEBADFD
EBADFD :: Platform_Error.EBADFDSourceEBADMSG
EBADMSG :: Platform_Error.EBADMSGSourceEBADR
EBADR :: Platform_Error.EBADRSourceEBADRQC
EBADRQC :: Platform_Error.EBADRQCSourceEBADSLT
EBADSLT :: Platform_Error.EBADSLTSourceEBFONT
EBFONT :: Platform_Error.EBFONTSourceECANCELED
ECANCELED :: Platform_Error.ECANCELEDSourceECHRNG
ECHRNG :: Platform_Error.ECHRNGSourceECOMM
ECOMM :: Platform_Error.ECOMMSourceECONNABORTED
ECONNABORTED :: Platform_Error.ECONNABORTEDSourceECONNREFUSED
ECONNREFUSED :: Platform_Error.ECONNREFUSEDSourceECONNRESET
ECONNRESET :: Platform_Error.ECONNRESETSourceEDEADLK
EDEADLK :: Platform_Error.EDEADLKSourceEDEADLOCK
EDEADLOCK :: Platform_Error.EDEADLOCKSourceEDESTADDRREQ
EDESTADDRREQ :: Platform_Error.EDESTADDRREQSourceEDOTDOT
EDOTDOT :: Platform_Error.EDOTDOTSourceEDQUOT
EDQUOT :: Platform_Error.EDQUOTSourceEEXIST
EEXIST :: Platform_Error.EEXISTSourceEFAULT
EFAULT :: Platform_Error.EFAULTSourceEFBIG
EFBIG :: Platform_Error.EFBIGSourceEHOSTDOWN
EHOSTDOWN :: Platform_Error.EHOSTDOWNSourceEHOSTUNREACH
EHOSTUNREACH :: Platform_Error.EHOSTUNREACHSourceEHWPOISON
EHWPOISON :: Platform_Error.EHWPOISONSourceEIDRM
EIDRM :: Platform_Error.EIDRMSourceEILSEQ
EILSEQ :: Platform_Error.EILSEQSourceEINPROGRESS
EINPROGRESS :: Platform_Error.EINPROGRESSSourceEINTR
EINTR :: Platform_Error.EINTRSourceEINVAL
EINVAL :: Platform_Error.EINVALSourceEIO
EIO :: Platform_Error.EIOSourceEISCONN
EISCONN :: Platform_Error.EISCONNSourceEISDIR
EISDIR :: Platform_Error.EISDIRSourceEISNAM
EISNAM :: Platform_Error.EISNAMSourceEKEYEXPIRED
EKEYEXPIRED :: Platform_Error.EKEYEXPIREDSourceEKEYREJECTED
EKEYREJECTED :: Platform_Error.EKEYREJECTEDSourceEKEYREVOKED
EKEYREVOKED :: Platform_Error.EKEYREVOKEDSourceEL2HLT
EL2HLT :: Platform_Error.EL2HLTSourceEL2NSYNC
EL2NSYNC :: Platform_Error.EL2NSYNCSourceEL3HLT
EL3HLT :: Platform_Error.EL3HLTSourceEL3RST
EL3RST :: Platform_Error.EL3RSTSourceELIBACC
ELIBACC :: Platform_Error.ELIBACCSourceELIBBAD
ELIBBAD :: Platform_Error.ELIBBADSourceELIBEXEC
ELIBEXEC :: Platform_Error.ELIBEXECSourceELIBMAX
ELIBMAX :: Platform_Error.ELIBMAXSourceELIBSCN
ELIBSCN :: Platform_Error.ELIBSCNSourceELNRNG
ELNRNG :: Platform_Error.ELNRNGSourceELOOP
ELOOP :: Platform_Error.ELOOPSourceEMEDIUMTYPE
EMEDIUMTYPE :: Platform_Error.EMEDIUMTYPESourceEMFILE
EMFILE :: Platform_Error.EMFILESourceEMSGSIZE
EMSGSIZE :: Platform_Error.EMSGSIZESourceEMULTIHOP
EMULTIHOP :: Platform_Error.EMULTIHOPSourceENAMETOOLONG
ENAMETOOLONG :: Platform_Error.ENAMETOOLONGSourceENAVAIL
ENAVAIL :: Platform_Error.ENAVAILSourceENDIAN
ENDIAN :: ODIN_ENDIANSourceENETDOWN
ENETDOWN :: Platform_Error.ENETDOWNSourceENETRESET
ENETRESET :: Platform_Error.ENETRESETSourceENETUNREACH
ENETUNREACH :: Platform_Error.ENETUNREACHSourceENFILE
ENFILE :: Platform_Error.ENFILESourceENOANO
ENOANO :: Platform_Error.ENOANOSourceENOBUFS
ENOBUFS :: Platform_Error.ENOBUFSSourceENOCSI
ENOCSI :: Platform_Error.ENOCSISourceENODATA
ENODATA :: Platform_Error.ENODATASourceENODEV
ENODEV :: Platform_Error.ENODEVSourceENOENT
ENOENT :: Platform_Error.ENOENTSourceENOKEY
ENOKEY :: Platform_Error.ENOKEYSourceENOLCK
ENOLCK :: Platform_Error.ENOLCKSourceENOLINK
ENOLINK :: Platform_Error.ENOLINKSourceENOMEDIUM
ENOMEDIUM :: Platform_Error.ENOMEDIUMSourceENOMEM
ENOMEM :: Platform_Error.ENOMEMSourceENOMSG
ENOMSG :: Platform_Error.ENOMSGSourceENONET
ENONET :: Platform_Error.ENONETSourceENOPKG
ENOPKG :: Platform_Error.ENOPKGSourceENOPROTOOPT
ENOPROTOOPT :: Platform_Error.ENOPROTOOPTSourceENOSPC
ENOSPC :: Platform_Error.ENOSPCSourceENOSR
ENOSR :: Platform_Error.ENOSRSourceENOSTR
ENOSTR :: Platform_Error.ENOSTRSourceENOSYS
ENOSYS :: Platform_Error.ENOSYSSourceENOTCONN
ENOTCONN :: Platform_Error.ENOTCONNSourceENOTDIR
ENOTDIR :: Platform_Error.ENOTDIRSourceENOTEMPTY
ENOTEMPTY :: Platform_Error.ENOTEMPTYSourceENOTNAM
ENOTNAM :: Platform_Error.ENOTNAMSourceENOTRECOVERABLE
ENOTRECOVERABLE :: Platform_Error.ENOTRECOVERABLESourceENOTSOCK
ENOTSOCK :: Platform_Error.ENOTSOCKSourceENOTUNIQ
ENOTUNIQ :: Platform_Error.ENOTUNIQSourceENXIO
ENXIO :: Platform_Error.ENXIOSourceEOPNOTSUPP
EOPNOTSUPP :: Platform_Error.EOPNOTSUPPSourceEOVERFLOW
EOVERFLOW :: Platform_Error.EOVERFLOWSourceEOWNERDEAD
EOWNERDEAD :: Platform_Error.EOWNERDEADSourcefor robust mutexes
EPERM
EPERM :: Platform_Error.EPERMSourceEPFNOSUPPORT
EPFNOSUPPORT :: Platform_Error.EPFNOSUPPORTSourceEPIPE
EPIPE :: Platform_Error.EPIPESourceEPROTO
EPROTO :: Platform_Error.EPROTOSourceEPROTONOSUPPOR
EPROTONOSUPPOR :: Platform_Error.EPROTONOSUPPORTSourceEPROTOTYPE
EPROTOTYPE :: Platform_Error.EPROTOTYPESourceERANGE
ERANGE :: Platform_Error.ERANGESourceEREMCHG
EREMCHG :: Platform_Error.EREMCHGSourceEREMOTE
EREMOTE :: Platform_Error.EREMOTESourceEREMOTEIO
EREMOTEIO :: Platform_Error.EREMOTEIOSourceERESTART
ERESTART :: Platform_Error.ERESTARTSourceERFKILL
ERFKILL :: Platform_Error.ERFKILLSourceEROFS
EROFS :: Platform_Error.EROFSSourceERROR_EOF
ERROR_EOF :: io.Error.EOFSourceERROR_NONE
ERROR_NONE :: Error = Error{}SourceESHUTDOWN
ESHUTDOWN :: Platform_Error.ESHUTDOWNSourceESOCKTNOSUPPOR
ESOCKTNOSUPPOR :: Platform_Error.ESOCKTNOSUPPORTSourceESPIPE
ESPIPE :: Platform_Error.ESPIPESourceESRCH
ESRCH :: Platform_Error.ESRCHSourceESRMNT
ESRMNT :: Platform_Error.ESRMNTSourceESTALE
ESTALE :: Platform_Error.ESTALESourceESTRPIPE
ESTRPIPE :: Platform_Error.ESTRPIPESourceETIME
ETIME :: Platform_Error.ETIMESourceETIMEDOUT
ETIMEDOUT :: Platform_Error.ETIMEDOUTSourceETOOMANYREFS
ETOOMANYREFS :: Platform_Error.ETOOMANYREFSSourceETXTBSY
ETXTBSY :: Platform_Error.ETXTBSYSourceEUCLEAN
EUCLEAN :: Platform_Error.EUCLEANSourceEUNATCH
EUNATCH :: Platform_Error.EUNATCHSourceEUSERS
EUSERS :: Platform_Error.EUSERSSourceEWOULDBLOCK
EWOULDBLOCK :: Platform_Error.EWOULDBLOCKSourceEXFULL
EXFULL :: Platform_Error.EXFULLSourceF_GETFL
F_GETFL :: int = 3SourceTODO: add remaining fcntl commands reference: https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/fcntl.h
F_OK
F_OK :: 0SourceTest for file existance
F_SETFL
F_SETFL :: int = 4SourceFile_Mode_Char_Device
File_Mode_Char_Device :: File_Mode = File_Mode(1<<19)SourceFile_Mode_Device
File_Mode_Device :: File_Mode = File_Mode(1<<18)SourceFile_Mode_Dir
File_Mode_Dir :: File_Mode = File_Mode(1<<16)SourceFile_Mode_Named_Pipe
File_Mode_Named_Pipe :: File_Mode = File_Mode(1<<17)SourceFile_Mode_Sym_Link
File_Mode_Sym_Link :: File_Mode = File_Mode(1<<20)SourceINADDR_ANY
INADDR_ANY :: c.ulong = 0SourceINADDR_BROADCAST
INADDR_BROADCAST :: c.ulong = 0xffffffffSourceINADDR_DUMMY
INADDR_DUMMY :: c.ulong = 0xc0000008SourceINADDR_NONE
INADDR_NONE :: c.ulong = 0xffffffffSourceINVALID_HANDLE
INVALID_HANDLE :: _ = ~Handle(0)SourceIPPROTO_ETHERNET
IPPROTO_ETHERNET :: int = 143SourceIPPROTO_ICMP
IPPROTO_ICMP :: int = 1SourceIPPROTO_IP
IPPROTO_IP :: int = 0SourceIPPROTO_IPV6
IPPROTO_IPV6 :: int = 41SourceIPPROTO_RAW
IPPROTO_RAW :: int = 255SourceIPPROTO_TCP
IPPROTO_TCP :: int = 6SourceIPPROTO_UDP
IPPROTO_UDP :: int = 17SourceMSG_TRUNC
MSG_TRUNC :: int = 0x20SourceOS
OS :: ODIN_OSSourceO_APPEND
O_APPEND :: 0x00400SourceO_ASYNC
O_ASYNC :: 0x02000SourceO_CLOEXEC
O_CLOEXEC :: 0x80000SourceO_CREATE
O_CREATE :: 0x00040SourceO_EXCL
O_EXCL :: 0x00080SourceO_NOCTTY
O_NOCTTY :: 0x00100SourceO_NONBLOCK
O_NONBLOCK :: 0x00800SourceO_RDONLY
O_RDONLY :: 0x00000SourceO_RDWR
O_RDWR :: 0x00002SourceO_SYNC
O_SYNC :: 0x01000SourceO_TRUNC
O_TRUNC :: 0x00200SourceO_WRONLY
O_WRONLY :: 0x00001SourcePlatform_Error
Platform_Error :: _Platform_ErrorSourceRTLD_BINDING_MASK
RTLD_BINDING_MASK :: 0x0003SourceRTLD_DEEPBIND
RTLD_DEEPBIND :: 0x0008SourceRTLD_GLOBAL
RTLD_GLOBAL :: 0x0100SourceRTLD_LAZY
RTLD_LAZY :: 0x0001SourceNOTE(zangent): These are OS specific! Do not mix these up!
RTLD_NODELETE
RTLD_NODELETE :: 0x1000SourceRTLD_NOLOAD
RTLD_NOLOAD :: 0x0004SourceRTLD_NOW
RTLD_NOW :: 0x0002SourceR_OK
R_OK :: 4SourceTest for read permission
SEEK_CUR
SEEK_CUR :: 1SourceSEEK_DATA
SEEK_DATA :: 3SourceSEEK_END
SEEK_END :: 2SourceSEEK_HOLE
SEEK_HOLE :: 4SourceSEEK_MAX
SEEK_MAX :: SEEK_HOLESourceSEEK_SET
SEEK_SET :: 0SourceSHUT_RD
SHUT_RD :: int = 0SourceSHUT_RDWR
SHUT_RDWR :: int = 2SourceSHUT_WR
SHUT_WR :: int = 1SourceSOCK_DGRAM
SOCK_DGRAM :: int = 2SourceSOCK_PACKET
SOCK_PACKET :: int = 10SourceSOCK_RAW
SOCK_RAW :: int = 3SourceSOCK_RDM
SOCK_RDM :: int = 4SourceSOCK_SEQPACKET
SOCK_SEQPACKET :: int = 5SourceSOCK_STREAM
SOCK_STREAM :: int = 1SourceSOL_SOCKET
SOL_SOCKET :: int = 1SourceSO_BROADCAST
SO_BROADCAST :: int = 6SourceSO_DEBUG
SO_DEBUG :: int = 1SourceSO_DONTROUTE
SO_DONTROUTE :: int = 5SourceSO_KEEPALIVE
SO_KEEPALIVE :: int = 9SourceSO_LINGER
SO_LINGER :: int = 13SourceSO_OOBINLINE
SO_OOBINLINE :: int = 10SourceSO_RCVBUF
SO_RCVBUF :: int = 8SourceSO_RCVTIMEO_NEW
SO_RCVTIMEO_NEW :: int = 66SourceSO_REUSEADDR
SO_REUSEADDR :: int = 2SourceSO_REUSEPORT
SO_REUSEPORT :: int = 15SourceSO_SNDBUF
SO_SNDBUF :: int = 7SourceSO_SNDTIMEO_NEW
SO_SNDTIMEO_NEW :: int = 67SourceS_IFBLK
S_IFBLK :: 0o060000SourceBlock special
S_IFCHR
S_IFCHR :: 0o020000SourceCharacter special
S_IFDIR
S_IFDIR :: 0o040000SourceDirectory
S_IFIFO
S_IFIFO :: 0o010000SourceNamed pipe (fifo)
S_IFLNK
S_IFLNK :: 0o120000SourceSymbolic link
S_IFMT
S_IFMT :: 0o170000SourceFile type
S_IFREG
S_IFREG :: 0o100000SourceRegular
S_IFSOCK
S_IFSOCK :: 0o140000SourceSocket
S_IRGRP
S_IRGRP :: 0o0040SourceR for group
S_IROTH
S_IROTH :: 0o0004SourceR for other
S_IRUSR
S_IRUSR :: 0o0400SourceR for owner
S_IRWXG
S_IRWXG :: 0o0070SourceRead, write, execute/search by group
S_IRWXO
S_IRWXO :: 0o0007SourceRead, write, execute/search by others
S_IRWXU
S_IRWXU :: 0o0700SourceFile mode Read, write, execute/search by owner
S_ISGID
S_ISGID :: 0o2000SourceSet group id on execution
S_ISUID
S_ISUID :: 0o4000SourceSet user id on execution
S_ISVTX
S_ISVTX :: 0o1000SourceDirectory restrcted delete
S_IWGRP
S_IWGRP :: 0o0020SourceW for group
S_IWOTH
S_IWOTH :: 0o0002SourceW for other
S_IWUSR
S_IWUSR :: 0o0200SourceW for owner
S_IXGRP
S_IXGRP :: 0o0010SourceX for group
S_IXOTH
S_IXOTH :: 0o0001SourceX for other
S_IXUSR
S_IXUSR :: 0o0100SourceX for owner
TCP_CORK
TCP_CORK :: int = 3SourceTCP_NODELAY
TCP_NODELAY :: int = 1SourceW_OK
W_OK :: 2SourceTest for write permission
X_OK
X_OK :: 1SourceTest for execute permission
heap_alloc
heap_alloc :: runtime.heap_allocSourceheap_allocator
heap_allocator :: runtime.heap_allocatorSourceheap_allocator_proc
heap_allocator_proc :: runtime.heap_allocator_procSourceheap_free
heap_free :: runtime.heap_freeSourceheap_resize
heap_resize :: runtime.heap_resizeSourceVariables
4Procedures
91S_ISBLK
S_ISBLK :: proc(m: u32) -> (bool)SourceS_ISCHR
S_ISCHR :: proc(m: u32) -> (bool)SourceS_ISDIR
S_ISDIR :: proc(m: u32) -> (bool)SourceS_ISFIFO
S_ISFIFO :: proc(m: u32) -> (bool)SourceS_ISLNK
S_ISLNK :: proc(m: u32) -> (bool)SourceS_ISREG
S_ISREG :: proc(m: u32) -> (bool)SourceS_ISSOCK
S_ISSOCK :: proc(m: u32) -> (bool)Sourceabsolute_path_from_handle
absolute_path_from_handle :: proc(fd: Handle) -> (Error, string)Sourceabsolute_path_from_relative
absolute_path_from_relative :: proc(rel: string, allocator: mem.Allocator = context.allocator) -> (path: string, err: Error)Sourceaccept
accept :: proc(sd: Socket, addr: ^SOCKADDR, len: rawptr) -> (Error, Socket)Sourceaccess
access :: proc(path: string, mask: int) -> (Error, bool)Sourcebind
bind :: proc(sd: Socket, addr: ^SOCKADDR, len: socklen_t) -> (Error)Sourceclose
close :: proc(fd: Handle) -> (Error)Sourceconnect
connect :: proc(sd: Socket, addr: ^SOCKADDR, len: socklen_t) -> (Error)Sourcecurrent_thread_id
current_thread_id :: proc() -> (int)Sourcedlclose
dlclose :: proc(handle: rawptr) -> (bool)Sourcedlerror
dlerror :: proc() -> (string)Sourcedlopen
dlopen :: proc(filename: string, flags: int) -> (rawptr)Sourcedlsym
dlsym :: proc(handle: rawptr, symbol: string) -> (rawptr)Sourceerror_string
error_string :: proc(ferr: Error) -> (string)Sourceexecvp
execvp :: proc(path: string, args: []string) -> (Error)Sourceexists
exists :: proc(path: string) -> (bool)Sourceexit
exit :: proc(code: int) -> ()Sourcefcntl
fcntl :: proc(fd: int, cmd: int, arg: int) -> (Error, int)Sourcefile_info_delete
file_info_delete :: proc(fi: File_Info, allocator: mem.Allocator = context.allocator)Sourcefile_info_slice_delete
file_info_slice_delete :: proc(infos: []File_Info, allocator: mem.Allocator = context.allocator)Sourcefile_size
file_size :: proc(fd: Handle) -> (Error, i64)Sourcefile_size_from_path
file_size_from_path :: proc(path: string) -> (i64)Sourceflush
flush :: proc(fd: Handle) -> (Error)Sourcefork
fork :: proc() -> (Error, Pid)Sourcefstat
fstat :: proc(fd: Handle, allocator: mem.Allocator = context.allocator) -> (fi: File_Info, err: Error)Sourceget_current_directory
get_current_directory :: proc(allocator: mem.Allocator = context.allocator) -> (string)Sourceget_env_alloc
get_env_alloc :: proc(key: string, allocator: mem.Allocator = context.allocator) -> (value: string)Sourceget_env_buf
get_env_buf :: proc(buf: []u8, key: string) -> (value: string)Sourceget_last_error
get_last_error :: proc() -> (Error)Sourceget errno from libc
get_page_size
get_page_size :: proc() -> (int)Sourceis_dir_handle
is_dir_handle :: proc(fd: Handle) -> (bool)Sourceis_dir_path
is_dir_path :: proc(path: string, follow_links: bool) -> (bool)Sourceis_file_handle
is_file_handle :: proc(fd: Handle) -> (bool)Sourceis_file_path
is_file_path :: proc(path: string, follow_links: bool) -> (bool)Sourceis_path_separator
is_path_separator :: proc(r: rune) -> (bool)Sourceis_platform_error
is_platform_error :: proc(ferr: Error) -> (err: i32, ok: bool)Sourcelast_write_time
last_write_time :: proc(fd: Handle) -> (time: File_Time, err: Error)SourceTODO(zangent): Implement these! last_write_time :: proc(fd: Handle) -> File_Time {} last_write_time_by_name :: proc(name: string) -> File_Time {}
last_write_time_by_name
last_write_time_by_name :: proc(name: string) -> (time: File_Time, err: Error)Sourcelisten
listen :: proc(sd: Socket, backlog: int) -> (Error)Sourcelookup_env_alloc
lookup_env_alloc :: proc(key: string, allocator: mem.Allocator = context.allocator) -> (value: string, found: bool)Sourcelookup_env_buffer
lookup_env_buffer :: proc(buf: []u8, key: string) -> (value: string, err: Error)Sourcelstat
lstat :: proc(name: string, allocator: mem.Allocator = context.allocator) -> (fi: File_Info, err: Error)Sourcemake_directory
make_directory :: proc(path: string, mode: u32) -> (Error)Sourceopen
open :: proc(path: string, flags: int, mode: int) -> (Error, Handle)Sourcepersonality
personality :: proc(persona: u64) -> (Error)Sourcepoll
poll :: proc(fds: []pollfd, timeout: int) -> (Error, int)Sourceppoll
ppoll :: proc(fds: []pollfd, timeout: ^unix.timespec, sigmask: ^sigset_t) -> (Error, int)Sourceprint_error
print_error :: proc(f: Handle, ferr: Error, msg: string) -> (n: int, err: Error)Sourceprocessor_core_count
processor_core_count :: proc() -> (int)Sourceread
read :: proc(fd: Handle, data: []u8) -> (Error, int)Sourceread_at
read_at :: proc(fd: Handle, data: []u8, offset: i64) -> (Error, int)Sourceread_at_least
read_at_least :: proc(fd: Handle, buf: []u8, min: int) -> (n: int, err: Error)Sourceread_dir
read_dir :: proc(fd: Handle, n: int, allocator: mem.Allocator = context.allocator) -> (fi: []File_Info, err: Error)Sourceread_entire_file_from_filename
read_entire_file_from_filename :: proc(name: string, allocator: mem.Allocator = context.allocator, loc = #caller_location) -> (data: []u8, success: bool)Sourceread_entire_file_from_filename_or_err
read_entire_file_from_filename_or_err :: proc(name: string, allocator: mem.Allocator = context.allocator, loc = #caller_location) -> (data: []u8, err: Error)Sourceread_entire_file_from_handle
read_entire_file_from_handle :: proc(fd: Handle, allocator: mem.Allocator = context.allocator, loc = #caller_location) -> (data: []u8, success: bool)Sourceread_entire_file_from_handle_or_err
read_entire_file_from_handle_or_err :: proc(fd: Handle, allocator: mem.Allocator = context.allocator, loc = #caller_location) -> (data: []u8, err: Error)Sourceread_full
read_full :: proc(fd: Handle, buf: []u8) -> (n: int, err: Error)Sourceread_ptr
read_ptr :: proc(fd: Handle, data: rawptr, len: int) -> (Error, int)Sourcerecv
recv :: proc(sd: Socket, data: []u8, flags: int) -> (Error, u32)Sourcerecvfrom
recvfrom :: proc(sd: Socket, data: []u8, flags: int, addr: ^SOCKADDR, addr_size: ^socklen_t) -> (Error, u32)Sourceremove
remove :: proc(path: string) -> (Error)Sourceremove_directory
remove_directory :: proc(path: string) -> (Error)Sourcerename
rename :: proc(old_path: string, new_path: string) -> (Error)Sourcereplace_environment_placeholders
replace_environment_placeholders :: proc(path: string, allocator: mem.Allocator = context.allocator) -> (res: string)SourceAlways allocates for consistency.
seek
seek :: proc(fd: Handle, offset: i64, whence: int) -> (Error, i64)Sourcesend
send :: proc(sd: Socket, data: []u8, flags: int) -> (Error, u32)Sourcesendto
sendto :: proc(sd: Socket, data: []u8, flags: int, addr: ^SOCKADDR, addrlen: socklen_t) -> (Error, u32)Sourceset_current_directory
set_current_directory :: proc(path: string) -> (err: Error)Sourceset_env
set_env :: proc(key: string, value: string) -> (Error)Sourcesetsockopt
setsockopt :: proc(sd: Socket, level: int, optname: int, optval: rawptr, optlen: socklen_t) -> (Error)Sourceshutdown
shutdown :: proc(sd: Socket, how: int) -> (Error)Sourcesocket
socket :: proc(domain: int, type: int, protocol: int) -> (Error, Socket)Sourcestat
stat :: proc(name: string, allocator: mem.Allocator = context.allocator) -> (fi: File_Info, err: Error)Sourcestream_from_handle
stream_from_handle :: proc(fd: Handle) -> (io.Stream)Sourceunset_env
unset_env :: proc(key: string) -> (Error)Sourcewrite
write :: proc(fd: Handle, data: []u8) -> (Error, int)Sourcewrite_at
write_at :: proc(fd: Handle, data: []u8, offset: i64) -> (Error, int)Sourcewrite_byte
write_byte :: proc(fd: Handle, b: u8) -> (Error, int)Sourcewrite_encoded_rune
write_encoded_rune :: proc(f: Handle, r: rune) -> (n: int, err: Error)Sourcewrite_entire_file
write_entire_file :: proc(name: string, data: []u8, truncate: untyped boolean = true) -> (success: bool)Sourcewrite_entire_file_or_err
write_entire_file_or_err :: proc(name: string, data: []u8, truncate: untyped boolean = true) -> (Error)Sourcewrite_ptr
write_ptr :: proc(fd: Handle, data: rawptr, len: int) -> (Error, int)Sourcewrite_rune
write_rune :: proc(fd: Handle, r: rune) -> (Error, int)Sourcewrite_string
write_string :: proc(fd: Handle, str: string) -> (Error, int)SourceProcedure Groups
6get_env
get_env :: proc{get_env_alloc, get_env_buf}Sourceis_dir
is_dir :: proc{is_dir_path, is_dir_handle}Sourceis_file
is_file :: proc{is_file_path, is_file_handle}Sourcelookup_env
lookup_env :: proc{lookup_env_alloc, lookup_env_buffer}Sourceread_entire_file
read_entire_file :: proc{read_entire_file_from_filename, read_entire_file_from_handle}Sourceread_entire_file_or_err
read_entire_file_or_err :: proc{read_entire_file_from_filename_or_err, read_entire_file_from_handle_or_err}Source