package core:os

⌘K
Ctrl+K
or
/

    Overview

    Cross-platform OS interactions like file I/O.

    Index

    Constants (236)
    Variables (4)
    Procedures (91)

    Types

    ADDRESS_FAMILY ¶

    ADDRESS_FAMILY :: u16

    Dir ¶

    Dir :: distinct rawptr
     

    DIR*

    Dirent ¶

    Dirent :: struct {
    	ino:    u64,
    	off:    u64,
    	reclen: u16,
    	type:   u8,
    	name:   [256]u8,
    }
     

    NOTE(laleksic, 2021-01-21): Comment and rename these to match OS_Stat above

    File_Info ¶

    File_Info :: struct {
    	fullpath:          string,
    	// allocated
    	name:              string,
    	// uses `fullpath` as underlying data
    	size:              i64,
    	mode:              File_Mode,
    	is_dir:            bool,
    	creation_time:     time.Time,
    	modification_time: time.Time,
    	access_time:       time.Time,
    }
    Related Procedures With Parameters
    Related Procedures With Returns

    File_Time ¶

    File_Time :: distinct u64
    Related Procedures With Returns

    General_Error ¶

    General_Error :: enum u32 {
    	None, 
    	Exist, 
    	Not_Exist, 
    	Timeout, 
    	Broken_Pipe, 
    	Invalid_File, 
    	Invalid_Dir, 
    	Invalid_Path, 
    	Invalid_Callback, 
    	Pattern_Has_Separator, 
    	File_Is_Pipe, 
    	Not_Dir, 
    	// Environment variable not found.
    	Env_Var_Not_Found, 
    }

    OS_Stat ¶

    OS_Stat :: struct {
    	device_id:     u64,
    	// ID of device containing file
    	serial:        u64,
    	// File serial number
    	nlink:         u64,
    	// Number of hard links
    	mode:          u32,
    	// Mode of the file
    	uid:           u32,
    	// User ID of the file's owner
    	gid:           u32,
    	// Group ID of the file's group
    	_:             i32,
    	// 32 bits of padding
    	rdev:          u64,
    	// Device ID, if device
    	size:          i64,
    	// Size of the file, in bytes
    	block_size:    i64,
    	// Optimal bllocksize for I/O
    	blocks:        i64,
    	// Number of 512-byte blocks allocated
    	last_access:   Unix_File_Time,
    	// Time of last access
    	modified:      Unix_File_Time,
    	// Time of last modification
    	status_change: Unix_File_Time,
    	// Time of last status change
    	_reserved:     [3]i64,
    }

    Pid ¶

    Pid :: distinct i32
    Related Procedures With Returns

    SIOCGIFFLAG ¶

    SIOCGIFFLAG :: enum i32 {
    	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, 
    }

    SIOCGIFFLAGS ¶

    SIOCGIFFLAGS :: bit_set[SIOCGIFFLAG; i32]

    SOCKADDR ¶

    SOCKADDR :: struct #packed {
    	sa_family: u16,
    	sa_data:   [14]u8,
    }
    Related Procedures With Parameters

    SOCKADDR_STORAGE_LH ¶

    SOCKADDR_STORAGE_LH :: struct #packed {
    	ss_family:  u16,
    	__ss_pad1:  [6]u8,
    	__ss_align: i64,
    	__ss_pad2:  [112]u8,
    }

    Socket ¶

    Socket :: distinct int
    Related Procedures With Parameters
    Related Procedures With Returns

    Timeval ¶

    Timeval :: struct {
    	seconds:      i64,
    	microseconds: int,
    }

    Unix_File_Time ¶

    Unix_File_Time :: struct {
    	seconds:     i64,
    	nanoseconds: i64,
    }

    ifaddrs ¶

    ifaddrs :: struct {
    	next:              ^ifaddrs,
    	name:              cstring,
    	flags:             bit_set[SIOCGIFFLAG; i32],
    	address:           ^SOCKADDR,
    	netmask:           ^SOCKADDR,
    	broadcast_or_dest: ^SOCKADDR,
    	// Broadcast or Point-to-Point address
    	data:              rawptr,
    }

    in6_addr ¶

    in6_addr :: struct #packed {
    	s6_addr: [16]u8,
    }

    in_addr ¶

    in_addr :: struct #packed {
    	s_addr: u32,
    }

    pollfd ¶

    pollfd :: struct {
    	fd:      i32,
    	events:  i16,
    	revents: i16,
    }
    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,
    }

    sigset_t ¶

    sigset_t :: distinct u64
    Related Procedures With Parameters

    sockaddr_in ¶

    sockaddr_in :: struct #packed {
    	sin_family: u16,
    	sin_port:   u16be,
    	sin_addr:   in_addr,
    	sin_zero:   [8]u8,
    }

    sockaddr_in6 ¶

    sockaddr_in6 :: struct #packed {
    	sin6_family:   u16,
    	sin6_port:     u16be,
    	sin6_flowinfo: u64,
    	sin6_addr:     in6_addr,
    	sin6_scope_id: u64,
    }

    socklen_t ¶

    socklen_t :: i32
    Related Procedures With Parameters
    Related Procedures With Returns

    Constants

    ADDR_NO_RANDOMIZE ¶

    ADDR_NO_RANDOMIZE: int : 0x40000

    AF_BLUETOOTH ¶

    AF_BLUETOOTH: int : 31

    AF_INET ¶

    AF_INET: int : 2

    AF_INET6 ¶

    AF_INET6: int : 10

    AF_LOCAL ¶

    AF_LOCAL: int : AF_UNIX

    AF_PACKET ¶

    AF_PACKET: int : 17

    AF_UNIX ¶

    AF_UNIX: int : 1

    AF_UNSPEC ¶

    AF_UNSPEC: int : 0

    ARCH ¶

    ARCH: .Odin_Arch_Type : ODIN_ARCH

    AT_FDCWD ¶

    AT_FDCWD: uintptr : ~uintptr(99)
     

    -100

    AT_REMOVEDIR ¶

    AT_REMOVEDIR :: uintptr(0x200)
    AT_SYMLINK_NOFOLLOW :: uintptr(0x100)

    EACCES ¶

    EACCES: linux.Errno : Platform_Error.EACCES

    EADDRINUSE ¶

    EADDRINUSE: linux.Errno : Platform_Error.EADDRINUSE
     

    Address already in use

    EADDRNOTAVAIL ¶

    EADDRNOTAVAIL: linux.Errno : Platform_Error.EADDRNOTAVAIL
     

    Cannot assign requested address

    EADV ¶

    EADV: linux.Errno : Platform_Error.EADV
     

    Advertise error

    EAFNOSUPPORT ¶

    EAFNOSUPPORT: linux.Errno : Platform_Error.EAFNOSUPPORT
     

    Address family not supported by protocol

    EAGAIN ¶

    EAGAIN: linux.Errno : Platform_Error.EAGAIN

    EALREADY ¶

    EALREADY: linux.Errno : Platform_Error.EALREADY
     

    Operation already in progress

    EBADE ¶

    EBADE: linux.Errno : Platform_Error.EBADE
     

    Invalid exchange

    EBADF ¶

    EBADF: linux.Errno : Platform_Error.EBADF

    EBADFD ¶

    EBADFD: linux.Errno : Platform_Error.EBADFD
     

    File descriptor in bad state

    EBADMSG ¶

    EBADMSG: linux.Errno : Platform_Error.EBADMSG
     

    Not a data message

    EBADR ¶

    EBADR: linux.Errno : Platform_Error.EBADR
     

    Invalid request descriptor

    EBADRQC ¶

    EBADRQC: linux.Errno : Platform_Error.EBADRQC
     

    Invalid request code

    EBADSLT ¶

    EBADSLT: linux.Errno : Platform_Error.EBADSLT
     

    Invalid slot

    EBFONT ¶

    EBFONT: linux.Errno : Platform_Error.EBFONT
     

    Bad font file format

    ECANCELED ¶

    ECANCELED: linux.Errno : Platform_Error.ECANCELED
     

    Operation Canceled

    ECHRNG ¶

    ECHRNG: linux.Errno : Platform_Error.ECHRNG
     

    Channel number out of range

    ECOMM ¶

    ECOMM: linux.Errno : Platform_Error.ECOMM
     

    Communication error on send

    ECONNABORTED ¶

    ECONNABORTED: linux.Errno : Platform_Error.ECONNABORTED
     

    Software caused connection abort

    ECONNREFUSED ¶

    ECONNREFUSED: linux.Errno : Platform_Error.ECONNREFUSED
     

    Connection refused

    ECONNRESET ¶

    ECONNRESET: linux.Errno : Platform_Error.ECONNRESET
     

    Connection reset by peer

    EDEADLK ¶

    EDEADLK: linux.Errno : Platform_Error.EDEADLK
     

    Resource deadlock would occur

    EDEADLOCK ¶

    EDEADLOCK: linux.Errno : Platform_Error.EDEADLOCK

    EDESTADDRREQ ¶

    EDESTADDRREQ: linux.Errno : Platform_Error.EDESTADDRREQ
     

    Destination address required

    EDOTDOT ¶

    EDOTDOT: linux.Errno : Platform_Error.EDOTDOT
     

    RFS specific error

    EDQUOT ¶

    EDQUOT: linux.Errno : Platform_Error.EDQUOT
     

    Quota exceeded

    EEXIST ¶

    EEXIST: linux.Errno : Platform_Error.EEXIST

    EFAULT ¶

    EFAULT: linux.Errno : Platform_Error.EFAULT

    EFBIG ¶

    EFBIG: linux.Errno : Platform_Error.EFBIG

    EHOSTDOWN ¶

    EHOSTDOWN: linux.Errno : Platform_Error.EHOSTDOWN
     

    Host is down

    EHOSTUNREACH ¶

    EHOSTUNREACH: linux.Errno : Platform_Error.EHOSTUNREACH
     

    No route to host

    EHWPOISON ¶

    EHWPOISON: linux.Errno : Platform_Error.EHWPOISON
     

    Memory page has hardware error

    EIDRM ¶

    EIDRM: linux.Errno : Platform_Error.EIDRM
     

    Identifier removed

    EILSEQ ¶

    EILSEQ: linux.Errno : Platform_Error.EILSEQ
     

    Illegal byte sequence

    EINPROGRESS ¶

    EINPROGRESS: linux.Errno : Platform_Error.EINPROGRESS
     

    Operation now in progress

    EINTR ¶

    EINTR: linux.Errno : Platform_Error.EINTR

    EINVAL ¶

    EINVAL: linux.Errno : Platform_Error.EINVAL

    EIO ¶

    EIO: linux.Errno : Platform_Error.EIO

    EISCONN ¶

    EISCONN: linux.Errno : Platform_Error.EISCONN
     

    Transport endpoint is already connected

    EISDIR ¶

    EISDIR: linux.Errno : Platform_Error.EISDIR

    EISNAM ¶

    EISNAM: linux.Errno : Platform_Error.EISNAM
     

    Is a named type file

    EKEYEXPIRED ¶

    EKEYEXPIRED: linux.Errno : Platform_Error.EKEYEXPIRED
     

    Key has expired

    EKEYREJECTED ¶

    EKEYREJECTED: linux.Errno : Platform_Error.EKEYREJECTED
     

    Key was rejected by service

    EKEYREVOKED ¶

    EKEYREVOKED: linux.Errno : Platform_Error.EKEYREVOKED
     

    Key has been revoked

    EL2HLT ¶

    EL2HLT: linux.Errno : Platform_Error.EL2HLT
     

    Level 2 halted

    EL2NSYNC ¶

    EL2NSYNC: linux.Errno : Platform_Error.EL2NSYNC
     

    Level 2 not synchronized

    EL3HLT ¶

    EL3HLT: linux.Errno : Platform_Error.EL3HLT
     

    Level 3 halted

    EL3RST ¶

    EL3RST: linux.Errno : Platform_Error.EL3RST
     

    Level 3 reset

    ELIBACC ¶

    ELIBACC: linux.Errno : Platform_Error.ELIBACC
     

    Can not access a needed shared library

    ELIBBAD ¶

    ELIBBAD: linux.Errno : Platform_Error.ELIBBAD
     

    Accessing a corrupted shared library

    ELIBEXEC ¶

    ELIBEXEC: linux.Errno : Platform_Error.ELIBEXEC
     

    Cannot exec a shared library directly

    ELIBMAX ¶

    ELIBMAX: linux.Errno : Platform_Error.ELIBMAX
     

    Attempting to link in too many shared libraries

    ELIBSCN ¶

    ELIBSCN: linux.Errno : Platform_Error.ELIBSCN
     

    .lib section in a.out corrupted

    ELNRNG ¶

    ELNRNG: linux.Errno : Platform_Error.ELNRNG
     

    Link number out of range

    ELOOP ¶

    ELOOP: linux.Errno : Platform_Error.ELOOP
     

    Too many symbolic links encountered

    EMEDIUMTYPE ¶

    EMEDIUMTYPE: linux.Errno : Platform_Error.EMEDIUMTYPE
     

    Wrong medium type

    EMFILE ¶

    EMFILE: linux.Errno : Platform_Error.EMFILE

    EMSGSIZE ¶

    EMSGSIZE: linux.Errno : Platform_Error.EMSGSIZE
     

    Message too long

    EMULTIHOP ¶

    EMULTIHOP: linux.Errno : Platform_Error.EMULTIHOP
     

    Multihop attempted

    ENAMETOOLONG ¶

    ENAMETOOLONG: linux.Errno : Platform_Error.ENAMETOOLONG
     

    File name too long

    ENAVAIL ¶

    ENAVAIL: linux.Errno : Platform_Error.ENAVAIL
     

    No XENIX semaphores available

    ENDIAN ¶

    ENDIAN: .Odin_Endian_Type : ODIN_ENDIAN

    ENETDOWN ¶

    ENETDOWN: linux.Errno : Platform_Error.ENETDOWN
     

    Network is down

    ENETRESET ¶

    ENETRESET: linux.Errno : Platform_Error.ENETRESET
     

    Network dropped connection because of reset

    ENETUNREACH ¶

    ENETUNREACH: linux.Errno : Platform_Error.ENETUNREACH
     

    Network is unreachable

    ENFILE ¶

    ENFILE: linux.Errno : Platform_Error.ENFILE

    ENOANO ¶

    ENOANO: linux.Errno : Platform_Error.ENOANO
     

    No anode

    ENOBUFS ¶

    ENOBUFS: linux.Errno : Platform_Error.ENOBUFS
     

    No buffer space available

    ENOCSI ¶

    ENOCSI: linux.Errno : Platform_Error.ENOCSI
     

    No CSI structure available

    ENODATA ¶

    ENODATA: linux.Errno : Platform_Error.ENODATA
     

    No data available

    ENODEV ¶

    ENODEV: linux.Errno : Platform_Error.ENODEV

    ENOENT ¶

    ENOENT: linux.Errno : Platform_Error.ENOENT

    ENOKEY ¶

    ENOKEY: linux.Errno : Platform_Error.ENOKEY
     

    Required key not available

    ENOLCK ¶

    ENOLCK: linux.Errno : Platform_Error.ENOLCK
     

    No record locks available

    ENOLINK: linux.Errno : Platform_Error.ENOLINK
     

    Link has been severed

    ENOMEDIUM ¶

    ENOMEDIUM: linux.Errno : Platform_Error.ENOMEDIUM
     

    No medium found

    ENOMEM ¶

    ENOMEM: linux.Errno : Platform_Error.ENOMEM

    ENOMSG ¶

    ENOMSG: linux.Errno : Platform_Error.ENOMSG
     

    No message of desired type

    ENONET ¶

    ENONET: linux.Errno : Platform_Error.ENONET
     

    Machine is not on the network

    ENOPKG ¶

    ENOPKG: linux.Errno : Platform_Error.ENOPKG
     

    Package not installed

    ENOPROTOOPT ¶

    ENOPROTOOPT: linux.Errno : Platform_Error.ENOPROTOOPT
     

    Protocol not available

    ENOSPC ¶

    ENOSPC: linux.Errno : Platform_Error.ENOSPC

    ENOSR ¶

    ENOSR: linux.Errno : Platform_Error.ENOSR
     

    Out of streams resources

    ENOSTR ¶

    ENOSTR: linux.Errno : Platform_Error.ENOSTR
     

    Device not a stream

    ENOSYS ¶

    ENOSYS: linux.Errno : Platform_Error.ENOSYS
     

    Invalid system call number

    ENOTCONN ¶

    ENOTCONN: linux.Errno : Platform_Error.ENOTCONN
     

    Transport endpoint is not connected

    ENOTDIR ¶

    ENOTDIR: linux.Errno : Platform_Error.ENOTDIR

    ENOTEMPTY ¶

    ENOTEMPTY: linux.Errno : Platform_Error.ENOTEMPTY
     

    Directory not empty

    ENOTNAM ¶

    ENOTNAM: linux.Errno : Platform_Error.ENOTNAM
     

    Not a XENIX named type file

    ENOTRECOVERABLE ¶

    ENOTRECOVERABLE: linux.Errno : Platform_Error.ENOTRECOVERABLE
     

    State not recoverable

    ENOTSOCK ¶

    ENOTSOCK: linux.Errno : Platform_Error.ENOTSOCK
     

    Socket operation on non-socket

    ENOTUNIQ ¶

    ENOTUNIQ: linux.Errno : Platform_Error.ENOTUNIQ
     

    Name not unique on network

    ENXIO ¶

    ENXIO: linux.Errno : Platform_Error.ENXIO

    EOPNOTSUPP ¶

    EOPNOTSUPP: linux.Errno : Platform_Error.EOPNOTSUPP
     

    Operation not supported on transport endpoint

    EOVERFLOW ¶

    EOVERFLOW: linux.Errno : Platform_Error.EOVERFLOW
     

    Value too large for defined data type

    EOWNERDEAD ¶

    EOWNERDEAD: linux.Errno : Platform_Error.EOWNERDEAD
     

    for robust mutexes

    EPERM ¶

    EPERM: linux.Errno : Platform_Error.EPERM

    EPFNOSUPPORT ¶

    EPFNOSUPPORT: linux.Errno : Platform_Error.EPFNOSUPPORT
     

    Protocol family not supported

    EPIPE ¶

    EPIPE: linux.Errno : Platform_Error.EPIPE

    EPROTO ¶

    EPROTO: linux.Errno : Platform_Error.EPROTO
     

    Protocol error

    EPROTONOSUPPOR ¶

    EPROTONOSUPPOR: linux.Errno : Platform_Error.EPROTONOSUPPORT
     

    Protocol not supported

    EPROTOTYPE ¶

    EPROTOTYPE: linux.Errno : Platform_Error.EPROTOTYPE
     

    Protocol wrong type for socket

    ERANGE ¶

    ERANGE: linux.Errno : Platform_Error.ERANGE
     

    Result too large

    EREMCHG ¶

    EREMCHG: linux.Errno : Platform_Error.EREMCHG
     

    Remote address changed

    EREMOTE ¶

    EREMOTE: linux.Errno : Platform_Error.EREMOTE
     

    Object is remote

    EREMOTEIO ¶

    EREMOTEIO: linux.Errno : Platform_Error.EREMOTEIO
     

    Remote I/O error

    ERESTART ¶

    ERESTART: linux.Errno : Platform_Error.ERESTART
     

    Interrupted system call should be restarted

    ERFKILL ¶

    ERFKILL: linux.Errno : Platform_Error.ERFKILL
     

    Operation not possible due to RF-kill

    EROFS ¶

    EROFS: linux.Errno : Platform_Error.EROFS

    ERROR_EOF ¶

    ERROR_EOF: io.Error : io.Error.EOF

    ERROR_NONE ¶

    ERROR_NONE :: Error{}

    ESHUTDOWN ¶

    ESHUTDOWN: linux.Errno : Platform_Error.ESHUTDOWN
     

    Cannot send after transport endpoint shutdown

    ESOCKTNOSUPPOR ¶

    ESOCKTNOSUPPOR: linux.Errno : Platform_Error.ESOCKTNOSUPPORT
     

    Socket type not supported

    ESPIPE ¶

    ESPIPE: linux.Errno : Platform_Error.ESPIPE

    ESRCH ¶

    ESRCH: linux.Errno : Platform_Error.ESRCH

    ESRMNT ¶

    ESRMNT: linux.Errno : Platform_Error.ESRMNT
     

    Srmount error

    ESTALE ¶

    ESTALE: linux.Errno : Platform_Error.ESTALE
     

    Stale file handle

    ESTRPIPE ¶

    ESTRPIPE: linux.Errno : Platform_Error.ESTRPIPE
     

    Streams pipe error

    ETIME ¶

    ETIME: linux.Errno : Platform_Error.ETIME
     

    Timer expired

    ETIMEDOUT ¶

    ETIMEDOUT: linux.Errno : Platform_Error.ETIMEDOUT
     

    Connection timed out

    ETOOMANYREFS ¶

    ETOOMANYREFS: linux.Errno : Platform_Error.ETOOMANYREFS
     

    Too many references: cannot splice

    ETXTBSY ¶

    ETXTBSY: linux.Errno : Platform_Error.ETXTBSY

    EUCLEAN ¶

    EUCLEAN: linux.Errno : Platform_Error.EUCLEAN
     

    Structure needs cleaning

    EUNATCH ¶

    EUNATCH: linux.Errno : Platform_Error.EUNATCH
     

    Protocol driver not attached

    EUSERS ¶

    EUSERS: linux.Errno : Platform_Error.EUSERS
     

    Too many users

    EWOULDBLOCK ¶

    EWOULDBLOCK: linux.Errno : Platform_Error.EWOULDBLOCK
     

    Operation would block

    EXFULL ¶

    EXFULL: linux.Errno : Platform_Error.EXFULL
     

    Exchange full

    F_GETFL ¶

    F_GETFL: int : 3
     

    TODO: add remaining fcntl commands reference: https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/fcntl.h

    F_OK ¶

    F_OK: int : 0
     

    Test for file existance

    F_SETFL ¶

    F_SETFL: int : 4
     

    Set file flags

    File_Mode_Char_Device ¶

    File_Mode_Char_Device :: File_Mode(1 << 19)

    File_Mode_Device ¶

    File_Mode_Device :: File_Mode(1 << 18)

    File_Mode_Dir ¶

    File_Mode_Dir :: File_Mode(1 << 16)

    File_Mode_Named_Pipe ¶

    File_Mode_Named_Pipe :: File_Mode(1 << 17)
    File_Mode_Sym_Link :: File_Mode(1 << 20)

    INADDR_ANY ¶

    INADDR_ANY: u64 : 0

    INADDR_BROADCAST ¶

    INADDR_BROADCAST: u64 : 0xffffffff

    INADDR_DUMMY ¶

    INADDR_DUMMY: u64 : 0xc0000008

    INADDR_NONE ¶

    INADDR_NONE: u64 : 0xffffffff

    INVALID_HANDLE ¶

    INVALID_HANDLE: Handle : ~Handle(0)

    IPPROTO_ETHERNET ¶

    IPPROTO_ETHERNET: int : 143

    IPPROTO_ICMP ¶

    IPPROTO_ICMP: int : 1

    IPPROTO_IP ¶

    IPPROTO_IP: int : 0

    IPPROTO_IPV6 ¶

    IPPROTO_IPV6: int : 41

    IPPROTO_RAW ¶

    IPPROTO_RAW: int : 255

    IPPROTO_TCP ¶

    IPPROTO_TCP: int : 6

    IPPROTO_UDP ¶

    IPPROTO_UDP: int : 17

    MSG_TRUNC ¶

    MSG_TRUNC: int : 0x20

    OS ¶

    OS: .Odin_OS_Type : ODIN_OS

    O_APPEND ¶

    O_APPEND: int : 0x00400

    O_ASYNC ¶

    O_ASYNC: int : 0x02000

    O_CLOEXEC ¶

    O_CLOEXEC: int : 0x80000

    O_CREATE ¶

    O_CREATE: int : 0x00040

    O_EXCL ¶

    O_EXCL: int : 0x00080

    O_NOCTTY ¶

    O_NOCTTY: int : 0x00100

    O_NONBLOCK ¶

    O_NONBLOCK: int : 0x00800

    O_RDONLY ¶

    O_RDONLY: int : 0x00000

    O_RDWR ¶

    O_RDWR: int : 0x00002

    O_SYNC ¶

    O_SYNC: int : 0x01000

    O_TRUNC ¶

    O_TRUNC: int : 0x00200

    O_WRONLY ¶

    O_WRONLY: int : 0x00001

    RTLD_BINDING_MASK ¶

    RTLD_BINDING_MASK: int : 0x0003

    RTLD_DEEPBIND ¶

    RTLD_DEEPBIND: int : 0x0008

    RTLD_GLOBAL ¶

    RTLD_GLOBAL: int : 0x0100

    RTLD_LAZY ¶

    RTLD_LAZY: int : 0x0001
     

    NOTE(zangent): These are OS specific! Do not mix these up!

    RTLD_NODELETE ¶

    RTLD_NODELETE: int : 0x1000

    RTLD_NOLOAD ¶

    RTLD_NOLOAD: int : 0x0004

    RTLD_NOW ¶

    RTLD_NOW: int : 0x0002

    R_OK ¶

    R_OK: int : 4
     

    Test for read permission

    SEEK_CUR ¶

    SEEK_CUR: int : 1

    SEEK_DATA ¶

    SEEK_DATA: int : 3

    SEEK_END ¶

    SEEK_END: int : 2

    SEEK_HOLE ¶

    SEEK_HOLE: int : 4

    SEEK_MAX ¶

    SEEK_MAX: int : SEEK_HOLE

    SEEK_SET ¶

    SEEK_SET: int : 0

    SHUT_RD ¶

    SHUT_RD: int : 0

    SHUT_RDWR ¶

    SHUT_RDWR: int : 2

    SHUT_WR ¶

    SHUT_WR: int : 1

    SOCK_DGRAM ¶

    SOCK_DGRAM: int : 2

    SOCK_PACKET ¶

    SOCK_PACKET: int : 10

    SOCK_RAW ¶

    SOCK_RAW: int : 3

    SOCK_RDM ¶

    SOCK_RDM: int : 4

    SOCK_SEQPACKET ¶

    SOCK_SEQPACKET: int : 5

    SOCK_STREAM ¶

    SOCK_STREAM: int : 1

    SOL_SOCKET ¶

    SOL_SOCKET: int : 1

    SO_BROADCAST ¶

    SO_BROADCAST: int : 6

    SO_DEBUG ¶

    SO_DEBUG: int : 1

    SO_DONTROUTE ¶

    SO_DONTROUTE: int : 5

    SO_KEEPALIVE ¶

    SO_KEEPALIVE: int : 9

    SO_LINGER ¶

    SO_LINGER: int : 13

    SO_OOBINLINE ¶

    SO_OOBINLINE: int : 10

    SO_RCVBUF ¶

    SO_RCVBUF: int : 8

    SO_RCVTIMEO_NEW ¶

    SO_RCVTIMEO_NEW: int : 66

    SO_REUSEADDR ¶

    SO_REUSEADDR: int : 2

    SO_REUSEPORT ¶

    SO_REUSEPORT: int : 15

    SO_SNDBUF ¶

    SO_SNDBUF: int : 7

    SO_SNDTIMEO_NEW ¶

    SO_SNDTIMEO_NEW: int : 67

    S_IFBLK ¶

    S_IFBLK: int : 0o060000
     

    Block special

    S_IFCHR ¶

    S_IFCHR: int : 0o020000
     

    Character special

    S_IFDIR ¶

    S_IFDIR: int : 0o040000
     

    Directory

    S_IFIFO ¶

    S_IFIFO: int : 0o010000
     

    Named pipe (fifo)

    S_IFLNK ¶

    S_IFLNK: int : 0o120000
     

    Symbolic link

    S_IFMT ¶

    S_IFMT: int : 0o170000
     

    File type

    S_IFREG ¶

    S_IFREG: int : 0o100000
     

    Regular

    S_IFSOCK ¶

    S_IFSOCK: int : 0o140000
     

    Socket

    S_IRGRP ¶

    S_IRGRP: int : 0o0040
     

    R for group

    S_IROTH ¶

    S_IROTH: int : 0o0004
     

    R for other

    S_IRUSR ¶

    S_IRUSR: int : 0o0400
     

    R for owner

    S_IRWXG ¶

    S_IRWXG: int : 0o0070
     

    Read, write, execute/search by group

    S_IRWXO ¶

    S_IRWXO: int : 0o0007
     

    Read, write, execute/search by others

    S_IRWXU ¶

    S_IRWXU: int : 0o0700
     

    File mode Read, write, execute/search by owner

    S_ISGID ¶

    S_ISGID: int : 0o2000
     

    Set group id on execution

    S_ISUID ¶

    S_ISUID: int : 0o4000
     

    Set user id on execution

    S_ISVTX ¶

    S_ISVTX: int : 0o1000
     

    Directory restrcted delete

    S_IWGRP ¶

    S_IWGRP: int : 0o0020
     

    W for group

    S_IWOTH ¶

    S_IWOTH: int : 0o0002
     

    W for other

    S_IWUSR ¶

    S_IWUSR: int : 0o0200
     

    W for owner

    S_IXGRP ¶

    S_IXGRP: int : 0o0010
     

    X for group

    S_IXOTH ¶

    S_IXOTH: int : 0o0001
     

    X for other

    S_IXUSR ¶

    S_IXUSR: int : 0o0100
     

    X for owner

    TCP_CORK ¶

    TCP_CORK: int : 3

    TCP_NODELAY ¶

    TCP_NODELAY: int : 1

    W_OK ¶

    W_OK: int : 2
     

    Test for write permission

    X_OK ¶

    X_OK: int : 1
     

    Test for execute permission

    Variables

    args ¶

    args: []string = …
     

    "Argv" arguments converted to Odin strings

    stderr ¶

    stderr: Handle = …

    stdin ¶

    stdin: Handle = …

    stdout ¶

    stdout: Handle = …

    Procedures

    S_ISBLK ¶

    S_ISBLK :: proc(m: u32) -> bool {…}

    S_ISCHR ¶

    S_ISCHR :: proc(m: u32) -> bool {…}

    S_ISDIR ¶

    S_ISDIR :: proc(m: u32) -> bool {…}

    S_ISFIFO ¶

    S_ISFIFO :: proc(m: u32) -> bool {…}

    S_ISLNK ¶

    S_ISLNK :: proc(m: u32) -> bool {…}

    S_ISREG ¶

    S_ISREG :: proc(m: u32) -> bool {…}

    S_ISSOCK ¶

    S_ISSOCK :: proc(m: u32) -> bool {…}

    absolute_path_from_handle ¶

    absolute_path_from_handle :: proc(fd: Handle) -> (string, Error) {…}

    absolute_path_from_relative ¶

    absolute_path_from_relative :: proc(rel: string, allocator := context.allocator) -> (path: string, err: Error) {…}

    accept ¶

    accept :: proc(sd: Socket, addr: ^SOCKADDR, len: rawptr) -> (Socket, Error) {…}

    access ¶

    access :: proc(path: string, mask: int) -> (bool, Error) {…}

    bind ¶

    bind :: proc(sd: Socket, addr: ^SOCKADDR, len: i32) -> Error {…}

    close ¶

    close :: proc(fd: Handle) -> Error {…}

    connect ¶

    connect :: proc(sd: Socket, addr: ^SOCKADDR, len: i32) -> Error {…}

    current_thread_id ¶

    current_thread_id :: proc "contextless" () -> int {…}

    dlclose ¶

    dlclose :: proc(handle: rawptr) -> bool {…}

    dlerror ¶

    dlerror :: proc() -> string {…}

    dlopen ¶

    dlopen :: proc(filename: string, flags: int) -> rawptr {…}

    dlsym ¶

    dlsym :: proc(handle: rawptr, symbol: string) -> rawptr {…}

    error_string ¶

    error_string :: proc "contextless" (ferr: Error) -> string {…}

    execvp ¶

    execvp :: proc(path: string, args: []string) -> Error {…}

    exists ¶

    exists :: proc(path: string) -> bool {…}

    exit ¶

    exit :: proc "contextless" (code: int) -> ! {…}

    fcntl ¶

    fcntl :: proc(fd: int, cmd: int, arg: int) -> (int, Error) {…}

    file_info_delete ¶

    file_info_delete :: proc(fi: File_Info, allocator := context.allocator) {…}

    file_info_slice_delete ¶

    file_info_slice_delete :: proc(infos: []File_Info, allocator := context.allocator) {…}

    file_size ¶

    file_size :: proc(fd: Handle) -> (i64, Error) {…}

    file_size_from_path ¶

    file_size_from_path :: proc(path: string) -> i64 {…}

    flush ¶

    flush :: proc(fd: Handle) -> Error {…}

    fork ¶

    fork :: proc() -> (Pid, Error) {…}

    fstat ¶

    fstat :: proc(fd: Handle, allocator := context.allocator) -> (fi: File_Info, err: Error) {…}

    get_current_directory ¶

    get_current_directory :: proc(allocator := context.allocator) -> string {…}

    get_env_alloc ¶

    get_env_alloc :: proc(key: string, allocator := context.allocator) -> (value: string) {…}
    Related Procedure Groups

    get_env_buf ¶

    get_env_buf :: proc(buf: []u8, key: string) -> (value: string) {…}
    Related Procedure Groups

    get_last_error ¶

    get_last_error :: proc "contextless" () -> Error {…}
     

    get errno from libc

    get_page_size ¶

    get_page_size :: proc() -> int {…}

    is_dir_handle ¶

    is_dir_handle :: proc(fd: Handle) -> bool {…}
    Related Procedure Groups

    is_dir_path ¶

    is_dir_path :: proc(path: string, follow_links: bool = true) -> bool {…}
    Related Procedure Groups

    is_file_handle ¶

    is_file_handle :: proc(fd: Handle) -> bool {…}
    Related Procedure Groups

    is_file_path ¶

    is_file_path :: proc(path: string, follow_links: bool = true) -> bool {…}
    Related Procedure Groups

    is_path_separator ¶

    is_path_separator :: proc(r: untyped rune) -> bool {…}

    is_platform_error ¶

    is_platform_error :: proc "contextless" (ferr: Error) -> (err: i32, ok: bool) {…}

    last_write_time ¶

    last_write_time :: proc(fd: Handle) -> (time: File_Time, err: Error) {…}
     

    TODO(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) {…}

    listen ¶

    listen :: proc(sd: Socket, backlog: int) -> Error {…}

    lookup_env_alloc ¶

    lookup_env_alloc :: proc(key: string, allocator := context.allocator) -> (value: string, found: bool) {…}
    Related Procedure Groups

    lookup_env_buffer ¶

    lookup_env_buffer :: proc(buf: []u8, key: string) -> (value: string, err: Error) {…}
    Related Procedure Groups

    lstat ¶

    lstat :: proc(name: string, allocator := context.allocator) -> (fi: File_Info, err: Error) {…}

    make_directory ¶

    make_directory :: proc(path: string, mode: u32 = 0o775) -> Error {…}

    open ¶

    open :: proc(path: string, flags: int = O_RDONLY, mode: int = 0o000) -> (Handle, Error) {…}

    personality ¶

    personality :: proc(persona: u64) -> Error {…}

    poll ¶

    poll :: proc(fds: []pollfd, timeout: int) -> (int, Error) {…}

    ppoll ¶

    ppoll :: proc(fds: []pollfd, timeout: ^unix.timespec, sigmask: ^sigset_t) -> (int, Error) {…}
    print_error :: proc(f: Handle, ferr: Error, msg: string) -> (n: int, err: Error) {…}

    processor_core_count ¶

    processor_core_count :: proc() -> int {…}

    read ¶

    read :: proc(fd: Handle, data: []u8) -> (int, Error) {…}

    read_at ¶

    read_at :: proc(fd: Handle, data: []u8, offset: i64) -> (int, Error) {…}

    read_at_least ¶

    read_at_least :: proc(fd: Handle, buf: []u8, min: int) -> (n: int, err: Error) {…}

    read_dir ¶

    read_dir :: proc(fd: Handle, n: int, allocator := context.allocator) -> (fi: []File_Info, err: Error) {…}

    read_entire_file_from_filename ¶

    read_entire_file_from_filename :: proc(name: string, allocator := context.allocator, loc := #caller_location) -> (data: []u8, success: bool) {…}
    Related Procedure Groups

    read_entire_file_from_filename_or_err ¶

    read_entire_file_from_filename_or_err :: proc(name: string, allocator := context.allocator, loc := #caller_location) -> (data: []u8, err: Error) {…}
    Related Procedure Groups

    read_entire_file_from_handle ¶

    read_entire_file_from_handle :: proc(fd: Handle, allocator := context.allocator, loc := #caller_location) -> (data: []u8, success: bool) {…}
    Related Procedure Groups

    read_entire_file_from_handle_or_err ¶

    read_entire_file_from_handle_or_err :: proc(fd: Handle, allocator := context.allocator, loc := #caller_location) -> (data: []u8, err: Error) {…}
    Related Procedure Groups

    read_full ¶

    read_full :: proc(fd: Handle, buf: []u8) -> (n: int, err: Error) {…}

    read_ptr ¶

    read_ptr :: proc(fd: Handle, data: rawptr, len: int) -> (int, Error) {…}

    recv ¶

    recv :: proc(sd: Socket, data: []u8, flags: int) -> (u32, Error) {…}

    recvfrom ¶

    recvfrom :: proc(sd: Socket, data: []u8, flags: int, addr: ^SOCKADDR, addr_size: ^i32) -> (u32, Error) {…}

    remove ¶

    remove :: proc(path: string) -> Error {…}

    remove_directory ¶

    remove_directory :: proc(path: string) -> Error {…}

    rename ¶

    rename :: proc(old_path, new_path: string) -> Error {…}

    replace_environment_placeholders ¶

    replace_environment_placeholders :: proc(path: string, allocator := context.allocator) -> (res: string) {…}
     

    Always allocates for consistency.

    seek ¶

    seek :: proc(fd: Handle, offset: i64, whence: int) -> (i64, Error) {…}

    send ¶

    send :: proc(sd: Socket, data: []u8, flags: int) -> (u32, Error) {…}

    sendto ¶

    sendto :: proc(sd: Socket, data: []u8, flags: int, addr: ^SOCKADDR, addrlen: i32) -> (u32, Error) {…}

    set_current_directory ¶

    set_current_directory :: proc(path: string) -> (err: Error) {…}

    set_env ¶

    set_env :: proc(key, value: string) -> Error {…}

    setsockopt ¶

    setsockopt :: proc(sd: Socket, level: int, optname: int, optval: rawptr, optlen: i32) -> Error {…}

    shutdown ¶

    shutdown :: proc(sd: Socket, how: int) -> Error {…}

    socket ¶

    socket :: proc(domain: int, type: int, protocol: int) -> (Socket, Error) {…}

    stat ¶

    stat :: proc(name: string, allocator := context.allocator) -> (fi: File_Info, err: Error) {…}

    stream_from_handle ¶

    stream_from_handle :: proc(fd: Handle) -> io.Stream {…}

    unset_env ¶

    unset_env :: proc(key: string) -> Error {…}

    write ¶

    write :: proc(fd: Handle, data: []u8) -> (int, Error) {…}

    write_at ¶

    write_at :: proc(fd: Handle, data: []u8, offset: i64) -> (int, Error) {…}

    write_byte ¶

    write_byte :: proc(fd: Handle, b: u8) -> (int, Error) {…}

    write_encoded_rune ¶

    write_encoded_rune :: proc(f: Handle, r: untyped rune) -> (n: int, err: Error) {…}

    write_entire_file ¶

    write_entire_file :: proc(name: string, data: []u8, truncate: bool = true) -> (success: bool) {…}

    write_entire_file_or_err ¶

    write_entire_file_or_err :: proc(name: string, data: []u8, truncate: bool = true) -> Error {…}

    write_ptr ¶

    write_ptr :: proc(fd: Handle, data: rawptr, len: int) -> (int, Error) {…}

    write_rune ¶

    write_rune :: proc(fd: Handle, r: untyped rune) -> (int, Error) {…}

    write_string ¶

    write_string :: proc(fd: Handle, str: string) -> (int, Error) {…}

    Procedure Groups

    Source Files

    Generation Information

    Generated with odin version dev-v0.0.1 (vendor "odin") Linux_amd64 @ 2026-01-30 10:23:16.467335873 +0000 UTC