/** Terminate the process normally. An exit code of 0 indicates successful termination of the program. The meanings of other values is dependent on the environment. */
exportdeclarefunctionproc_exit(rval: u32):void;
/** Send a signal to the process of the calling thread. */
/** File or memory access pattern advisory information. */
exportconstenumadvice{
/** The application has no advice to give on its behavior with respect to the specified data. */
NORMAL=0,
/** The application expects to access the specified data sequentially from lower offsets to higher offsets. */
SEQUENTIAL=1,
/** The application expects to access the specified data in a random order. */
RANDOM=2,
/** The application expects to access the specified data in the near future. */
WILLNEED=3,
/** The application expects that it will not access the specified data in the near future. */
DONTNEED=4,
/** The application expects to access the specified data once and then not reuse it thereafter. */
NOREUSE=5
}
exporttypeadvice_t=u8;
/** Identifiers for clocks. */
exportconstenumclockid{
/** The clock measuring real time. Time value zero corresponds with 1970-01-01T00:00:00Z. */
REALTIME=0,
/** The store-wide monotonic clock. Absolute value has no meaning. */
MONOTONIC=1,
/** The CPU-time clock associated with the current process. */
PROCESS_CPUTIME_ID=2,
/** The CPU-time clock associated with the current thread. */
THREAD_CPUTIME_ID=3
}
exporttypeclockid_t=u32;
/** Identifier for a device containing a file system. Can be used in combination with `inode` to uniquely identify a file or directory in the filesystem. */
exporttypedevice_t=u64;
/** A reference to the offset of a directory entry. */
exporttypedircookie_t=u64;
/** A directory entry. */
@unmanagedexportclassdirent{
/** The offset of the next directory entry stored in this directory. */
/** The state of the file descriptor subscribed to with `eventtype.FD_READ` or `eventtype.FD_WRITE`. */
exportconstenumeventrwflags{
/** The peer of this socket has closed or disconnected. */
HANGUP=1
}
exporttypeeventrwflags_t=u16;
/** Type of a subscription to an event or its occurrence. */
exportconstenumeventtype{
/** The time value of clock has reached the timestamp. */
CLOCK=0,
/** File descriptor has data available for reading. */
FD_READ=1,
/** File descriptor has capacity available for writing */
FD_WRITE=2
}
exporttypeeventtype_t=u8;
/** Exit code generated by a process when exiting. */
exporttypeexitcode_t=u32;
/** A file descriptor number. */
exporttypefd_t=u32;
/** File descriptor flags. */
exportconstenumfdflags{
/** Append mode: Data written to the file is always appended to the file's end. */
APPEND=1,
/** Write according to synchronized I/O data integrity completion. Only the data stored in the file is synchronized. */
DSYNC=2,
/** Non-blocking mode. */
NONBLOCK=4,
/** Synchronized read I/O operations. */
RSYNC=8,
/** Write according to synchronized I/O file integrity completion. */
SYNC=16
}
exporttypefdflags_t=u16;
/** File descriptor attributes. */
@unmanagedexportclassfdstat{
/** File type. */
filetype: filetype_t;
/** File descriptor flags. */
flags: fdflags_t;
/** Rights that apply to this file descriptor. */
rights_base: rights_t;
/** Maximum set of rights that may be installed on new file descriptors that are created through this file descriptor, e.g., through `path_open`. */
rights_inheriting: rights_t;
}
/** Relative offset within a file. */
exporttypefiledelta_t=i64;
/** Non-negative file size or length of a region within a file. */
exporttypefilesize_t=u64;
/** File attributes. */
@unmanagedexportclassfilestat{
/** Device ID of device containing the file. */
dev: device_t;
/** File serial number. */
ino: inode_t;
/** File type. */
filetype: filetype_t;
/** Number of hard links to the file. */
nlink: linkcount_t;
/** For regular files, the file size in bytes. For symbolic links, the length in bytes of the pathname contained in the symbolic link. */
size: filesize_t;
/** Last data access timestamp. */
atim: timestamp_t;
/** Last data modification timestamp. */
mtim: timestamp_t;
/** Last file status change timestamp. */
ctim: timestamp_t;
}
/** The type of a file descriptor or file. */
exportconstenumfiletype{
/** The type of the file descriptor or file is unknown or is different from any of the other types specified. */
UNKNOWN=0,
/** The file descriptor or file refers to a block device inode. */
BLOCK_DEVICE=1,
/** The file descriptor or file refers to a character device inode. */
CHARACTER_DEVICE=2,
/** The file descriptor or file refers to a directory inode. */
DIRECTORY=3,
/** The file descriptor or file refers to a regular file inode. */
REGULAR_FILE=4,
/** The file descriptor or file refers to a datagram socket. */
SOCKET_DGRAM=5,
/** The file descriptor or file refers to a byte-stream socket. */
SOCKET_STREAM=6,
/** The file refers to a symbolic link inode. */
SYMBOLIC_LINK=7
}
exporttypefiletype_t=u8;
/** Which file time attributes to adjust. */
exportconstenumfstflags{
/** Adjust the last data access timestamp to the value stored in `filestat#st_atim`. */
SET_ATIM=1,
/** Adjust the last data access timestamp to the time of clock `clockid.REALTIME`. */
SET_ATIM_NOW=2,
/** Adjust the last data modification timestamp to the value stored in `filestat#st_mtim`. */
SET_MTIM=4,
/** Adjust the last data modification timestamp to the time of clock `clockid.REALTIME`. */
SET_MTIM_NOW=8
}
exporttypefstflags_t=u16;
/** File serial number that is unique within its file system. */
exporttypeinode_t=u64;
/** A region of memory for scatter/gather reads. */
@unmanagedexportclassiovec{
/** The address of the buffer to be filled. */
buf: uintptr_t;
/** The length of the buffer to be filled. */
buf_len: size_t;
}
/** Number of hard links to an inode. */
exporttypelinkcount_t=u32;
/** Flags determining the method of how paths are resolved. */
exportconstenumlookupflags{
/** As long as the resolved path corresponds to a symbolic link, it is expanded. */
SYMLINK_FOLLOW=1
}
exporttypelookupflags_t=u32;
/** Open flags. */
exportconstenumoflags{
/** Create file if it does not exist. */
CREAT=1,
/** Fail if not a directory. */
DIRECTORY=2,
/** Fail if file already exists. */
EXCL=4,
/** Truncate file to size 0. */
TRUNC=8
}
exporttypeoflags_t=u16;
/** Flags provided to `sock_recv`. */
exportconstenumriflags{
/** Returns the message without removing it from the socket's receive queue. */
PEEK=1,
/** On byte-stream sockets, block until the full amount of data can be returned. */
WAITALL=2
}
exporttyperiflags_t=u16;
/** File descriptor rights, determining which actions may be performed. */
exportconstenumrights{
/** The right to invoke `fd_datasync`. */
FD_DATASYNC=1,
/** The right to invoke `fd_read` and `sock_recv`. */
FD_READ=2,
/** The right to invoke `fd_seek`. This flag implies `rights.FD_TELL`. */
FD_SEEK=4,
/** The right to invoke `fd_fdstat_set_flags`. */
FD_FDSTAT_SET_FLAGS=8,
/** The right to invoke `fd_sync`. */
FD_SYNC=16,
/** The right to invoke `fd_seek` in such a way that the file offset remains unaltered (i.e., `whence.CUR` with offset zero), or to invoke `fd_tell`). */
FD_TELL=32,
/** The right to invoke `fd_write` and `sock_send`. If `rights.FD_SEEK` is set, includes the right to invoke `fd_pwrite`. */
FD_WRITE=64,
/** The right to invoke `fd_advise`. */
FD_ADVISE=128,
/** The right to invoke `fd_allocate`. */
FD_ALLOCATE=256,
/** The right to invoke `path_create_directory`. */
PATH_CREATE_DIRECTORY=512,
/** If `rights.PATH_OPEN` is set, the right to invoke `path_open` with `oflags.CREAT`. */
PATH_CREATE_FILE=1024,
/** The right to invoke `path_link` with the file descriptor as the source directory. */
PATH_LINK_SOURCE=2048,
/** The right to invoke `path_link` with the file descriptor as the target directory. */
PATH_LINK_TARGET=4096,
/** The right to invoke `path_open`. */
PATH_OPEN=8192,
/** The right to invoke `fd_readdir`. */
FD_READDIR=16384,
/** The right to invoke `path_readlink`. */
PATH_READLINK=32768,
/** The right to invoke `path_rename` with the file descriptor as the source directory. */
PATH_RENAME_SOURCE=65536,
/** The right to invoke `path_rename` with the file descriptor as the target directory. */
PATH_RENAME_TARGET=131072,
/** The right to invoke `path_filestat_get`. */
PATH_FILESTAT_GET=262144,
/** The right to change a file's size (there is no `path_filestat_set_size`). If `rights.PATH_OPEN` is set, includes the right to invoke `path_open` with `oflags.TRUNC`. */
PATH_FILESTAT_SET_SIZE=524288,
/** The right to invoke `path_filestat_set_times`. */
PATH_FILESTAT_SET_TIMES=1048576,
/** The right to invoke `fd_filestat_get`. */
FD_FILESTAT_GET=2097152,
/** The right to invoke `fd_filestat_set_size`. */
FD_FILESTAT_SET_SIZE=4194304,
/** The right to invoke `fd_filestat_set_times`. */
FD_FILESTAT_SET_TIMES=8388608,
/** The right to invoke `path_symlink`. */
RIGHT_PATH_SYMLINK=16777216,
/** The right to invoke `path_remove_directory`. */
PATH_REMOVE_DIRECTORY=33554432,
/** The right to invoke `path_unlink_file`. */
PATH_UNLINK_FILE=67108864,
/** If `rights.FD_READ` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype.FD_READ`. If `rights.FD_WRITE` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype.FD_WRITE`. */
POLL_FD_READWRITE=134217728,
/** The right to invoke `sock_shutdown`. */
SOCK_SHUTDOWN=268435456
}
exporttyperights_t=u64;
/** Flags returned by `sock_recv`. */
exportconstenumroflags{
/** Message data has been truncated. */
DATA_TRUNCATED=1
}
exporttyperoflags_t=u16;
/** Which channels on a socket to shut down. */
exportconstenumsdflags{
/** Disables further receive operations. */
RD=1,
/** Disables further send operations. */
WR=2
}
exporttypesdflags_t=u8;
/** Flags provided to `sock_send`. */
exportconstenumsiflags{
// As there are currently no flags defined, it must be set to zero.
}
exporttypesiflags_t=u16;
/** Signal condition. */
exportconstenumsignal{
/** Hangup. */
HUP=1,
/** Terminate interrupt signal. */
INT=2,
/** Terminal quit signal. */
QUIT=3,
/** Illegal instruction. */
ILL=4,
/** Trace/breakpoint trap. */
TRAP=5,
/** Process abort signal. */
ABRT=6,
/** Access to an undefined portion of a memory object. */
BUS=7,
/** Erroneous arithmetic operation. */
FPE=8,
/** Kill. */
KILL=9,
/** User-defined signal 1. */
USR1=10,
/** Invalid memory reference. */
SEGV=11,
/** User-defined signal 2. */
USR2=12,
/** Write on a pipe with no one to read it. */
PIPE=13,
/** Alarm clock. */
ALRM=14,
/** Termination signal. */
TERM=15,
/** Child process terminated, stopped, or continued. */
CHLD=16,
/** Continue executing, if stopped. */
CONT=17,
/** Stop executing. */
STOP=18,
/** Terminal stop signal. */
TSTP=19,
/** Background process attempting read. */
TTIN=20,
/** Background process attempting write. */
TTOU=21,
/** High bandwidth data is available at a socket. */
URG=22,
/** CPU time limit exceeded. */
XCPU=23,
/** File size limit exceeded. */
XFSZ=24,
/** Virtual timer expired. */
VTALRM=25,
PROF=26,
WINCH=27,
POLL=28,
PWR=29,
/** Bad system call. */
SYS=30
}
exporttypesignal_t=u8;
/** Flags determining how to interpret the timestamp provided in `subscription_t::u.clock.timeout. */
exportconstenumsubclockflags{
/** If set, treat the timestamp provided in `clocksubscription` as an absolute timestamp. */