size
: u32
Size: 4
Alignment: 4
filesize
: u64
Non-negative file size or length of a region within a file.
Size: 8
Alignment: 8
timestamp
: u64
Timestamp in nanoseconds.
Size: 8
Alignment: 8
clockid
: Enum(u32
)Identifiers for clocks.
Size: 4
Alignment: 4
<a href="#clockid.realtime" name="clockid.realtime"></a> realtime
The clock measuring real time. Time value zero corresponds with
1970-01-01T00:00:00Z.
<a href="#clockid.monotonic" name="clockid.monotonic"></a> monotonic
The store-wide monotonic clock, which is defined as a clock measuring
real time, whose value cannot be adjusted and which cannot have negative
clock jumps. The epoch of this clock is undefined. The absolute time
value of this clock therefore has no meaning.
<a href="#clockid.process_cputime_id" name="clockid.process_cputime_id"></a> process_cputime_id
The CPU-time clock associated with the current process.
<a href="#clockid.thread_cputime_id" name="clockid.thread_cputime_id"></a> thread_cputime_id
The CPU-time clock associated with the current thread.
errno
: Enum(u16
)Error codes returned by functions.
Not all of these error codes are returned by the functions provided by this
API; some are used in higher-level library layers, and others are provided
merely for alignment with POSIX.
Size: 2
Alignment: 2
<a href="#errno.success" name="errno.success"></a> success
No error occurred. System call completed successfully.
<a href="#errno.2big" name="errno.2big"></a> 2big
Argument list too long.
<a href="#errno.acces" name="errno.acces"></a> acces
Permission denied.
<a href="#errno.addrinuse" name="errno.addrinuse"></a> addrinuse
Address in use.
<a href="#errno.addrnotavail" name="errno.addrnotavail"></a> addrnotavail
Address not available.
<a href="#errno.afnosupport" name="errno.afnosupport"></a> afnosupport
Address family not supported.
<a href="#errno.again" name="errno.again"></a> again
Resource unavailable, or operation would block.
<a href="#errno.already" name="errno.already"></a> already
Connection already in progress.
<a href="#errno.badf" name="errno.badf"></a> badf
Bad file descriptor.
<a href="#errno.badmsg" name="errno.badmsg"></a> badmsg
Bad message.
<a href="#errno.busy" name="errno.busy"></a> busy
Device or resource busy.
<a href="#errno.canceled" name="errno.canceled"></a> canceled
Operation canceled.
<a href="#errno.child" name="errno.child"></a> child
No child processes.
<a href="#errno.connaborted" name="errno.connaborted"></a> connaborted
Connection aborted.
<a href="#errno.connrefused" name="errno.connrefused"></a> connrefused
Connection refused.
<a href="#errno.connreset" name="errno.connreset"></a> connreset
Connection reset.
<a href="#errno.deadlk" name="errno.deadlk"></a> deadlk
Resource deadlock would occur.
<a href="#errno.destaddrreq" name="errno.destaddrreq"></a> destaddrreq
Destination address required.
<a href="#errno.dom" name="errno.dom"></a> dom
Mathematics argument out of domain of function.
<a href="#errno.dquot" name="errno.dquot"></a> dquot
Reserved.
<a href="#errno.exist" name="errno.exist"></a> exist
File exists.
<a href="#errno.fault" name="errno.fault"></a> fault
Bad address.
<a href="#errno.fbig" name="errno.fbig"></a> fbig
File too large.
<a href="#errno.hostunreach" name="errno.hostunreach"></a> hostunreach
Host is unreachable.
<a href="#errno.idrm" name="errno.idrm"></a> idrm
Identifier removed.
<a href="#errno.ilseq" name="errno.ilseq"></a> ilseq
Illegal byte sequence.
<a href="#errno.inprogress" name="errno.inprogress"></a> inprogress
Operation in progress.
<a href="#errno.intr" name="errno.intr"></a> intr
Interrupted function.
<a href="#errno.inval" name="errno.inval"></a> inval
Invalid argument.
<a href="#errno.io" name="errno.io"></a> io
I/O error.
<a href="#errno.isconn" name="errno.isconn"></a> isconn
Socket is connected.
<a href="#errno.isdir" name="errno.isdir"></a> isdir
Is a directory.
<a href="#errno.loop" name="errno.loop"></a> loop
Too many levels of symbolic links.
<a href="#errno.mfile" name="errno.mfile"></a> mfile
File descriptor value too large.
<a href="#errno.mlink" name="errno.mlink"></a> mlink
Too many links.
<a href="#errno.msgsize" name="errno.msgsize"></a> msgsize
Message too large.
<a href="#errno.multihop" name="errno.multihop"></a> multihop
Reserved.
<a href="#errno.nametoolong" name="errno.nametoolong"></a> nametoolong
Filename too long.
<a href="#errno.netdown" name="errno.netdown"></a> netdown
Network is down.
<a href="#errno.netreset" name="errno.netreset"></a> netreset
Connection aborted by network.
<a href="#errno.netunreach" name="errno.netunreach"></a> netunreach
Network unreachable.
<a href="#errno.nfile" name="errno.nfile"></a> nfile
Too many files open in system.
<a href="#errno.nobufs" name="errno.nobufs"></a> nobufs
No buffer space available.
<a href="#errno.nodev" name="errno.nodev"></a> nodev
No such device.
<a href="#errno.noent" name="errno.noent"></a> noent
No such file or directory.
<a href="#errno.noexec" name="errno.noexec"></a> noexec
Executable file format error.
<a href="#errno.nolck" name="errno.nolck"></a> nolck
No locks available.
<a href="#errno.nolink" name="errno.nolink"></a> nolink
Reserved.
<a href="#errno.nomem" name="errno.nomem"></a> nomem
Not enough space.
<a href="#errno.nomsg" name="errno.nomsg"></a> nomsg
No message of the desired type.
<a href="#errno.noprotoopt" name="errno.noprotoopt"></a> noprotoopt
Protocol not available.
<a href="#errno.nospc" name="errno.nospc"></a> nospc
No space left on device.
<a href="#errno.nosys" name="errno.nosys"></a> nosys
Function not supported.
<a href="#errno.notconn" name="errno.notconn"></a> notconn
The socket is not connected.
<a href="#errno.notdir" name="errno.notdir"></a> notdir
Not a directory or a symbolic link to a directory.
<a href="#errno.notempty" name="errno.notempty"></a> notempty
Directory not empty.
<a href="#errno.notrecoverable" name="errno.notrecoverable"></a> notrecoverable
State not recoverable.
<a href="#errno.notsock" name="errno.notsock"></a> notsock
Not a socket.
<a href="#errno.notsup" name="errno.notsup"></a> notsup
Not supported, or operation not supported on socket.
<a href="#errno.notty" name="errno.notty"></a> notty
Inappropriate I/O control operation.
<a href="#errno.nxio" name="errno.nxio"></a> nxio
No such device or address.
<a href="#errno.overflow" name="errno.overflow"></a> overflow
Value too large to be stored in data type.
<a href="#errno.ownerdead" name="errno.ownerdead"></a> ownerdead
Previous owner died.
<a href="#errno.perm" name="errno.perm"></a> perm
Operation not permitted.
<a href="#errno.pipe" name="errno.pipe"></a> pipe
Broken pipe.
<a href="#errno.proto" name="errno.proto"></a> proto
Protocol error.
<a href="#errno.protonosupport" name="errno.protonosupport"></a> protonosupport
Protocol not supported.
<a href="#errno.prototype" name="errno.prototype"></a> prototype
Protocol wrong type for socket.
<a href="#errno.range" name="errno.range"></a> range
Result too large.
<a href="#errno.rofs" name="errno.rofs"></a> rofs
Read-only file system.
<a href="#errno.spipe" name="errno.spipe"></a> spipe
Invalid seek.
<a href="#errno.srch" name="errno.srch"></a> srch
No such process.
<a href="#errno.stale" name="errno.stale"></a> stale
Reserved.
<a href="#errno.timedout" name="errno.timedout"></a> timedout
Connection timed out.
<a href="#errno.txtbsy" name="errno.txtbsy"></a> txtbsy
Text file busy.
<a href="#errno.xdev" name="errno.xdev"></a> xdev
Cross-device link.
<a href="#errno.notcapable" name="errno.notcapable"></a> notcapable
Extension: Capabilities insufficient.
rights
: Flags(u64
)File descriptor rights, determining which actions may be performed.
Size: 8
Alignment: 8
<a href="#rights.fd_datasync" name="rights.fd_datasync"></a> fd_datasync
The right to invoke fd_datasync
.
If path_open
is set, includes the right to invokepath_open
with fdflags::dsync
.
<a href="#rights.fd_read" name="rights.fd_read"></a> fd_read
The right to invoke fd_read
and sock_recv
.
If rights::fd_seek
is set, includes the right to invoke fd_pread
.
<a href="#rights.fd_seek" name="rights.fd_seek"></a> fd_seek
The right to invoke fd_seek
. This flag implies rights::fd_tell
.
<a href="#rights.fd_fdstat_set_flags" name="rights.fd_fdstat_set_flags"></a> fd_fdstat_set_flags
The right to invoke fd_fdstat_set_flags
.
<a href="#rights.fd_sync" name="rights.fd_sync"></a> fd_sync
The right to invoke fd_sync
.
If path_open
is set, includes the right to invokepath_open
with fdflags::rsync
and fdflags::dsync
.
<a href="#rights.fd_tell" name="rights.fd_tell"></a> fd_tell
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
.
<a href="#rights.fd_write" name="rights.fd_write"></a> fd_write
The right to invoke fd_write
and sock_send
.
If rights::fd_seek
is set, includes the right to invoke fd_pwrite
.
<a href="#rights.fd_advise" name="rights.fd_advise"></a> fd_advise
The right to invoke fd_advise
.
<a href="#rights.fd_allocate" name="rights.fd_allocate"></a> fd_allocate
The right to invoke fd_allocate
.
<a href="#rights.path_create_directory" name="rights.path_create_directory"></a> path_create_directory
The right to invoke path_create_directory
.
<a href="#rights.path_create_file" name="rights.path_create_file"></a> path_create_file
If path_open
is set, the right to invoke path_open
with oflags::creat
.
<a href="#rights.path_link_source" name="rights.path_link_source"></a> path_link_source
The right to invoke path_link
with the file descriptor as the
source directory.
<a href="#rights.path_link_target" name="rights.path_link_target"></a> path_link_target
The right to invoke path_link
with the file descriptor as the
target directory.
<a href="#rights.path_open" name="rights.path_open"></a> path_open
The right to invoke path_open
.
<a href="#rights.fd_readdir" name="rights.fd_readdir"></a> fd_readdir
The right to invoke fd_readdir
.
<a href="#rights.path_readlink" name="rights.path_readlink"></a> path_readlink
The right to invoke path_readlink
.
<a href="#rights.path_rename_source" name="rights.path_rename_source"></a> path_rename_source
The right to invoke path_rename
with the file descriptor as the source directory.
<a href="#rights.path_rename_target" name="rights.path_rename_target"></a> path_rename_target
The right to invoke path_rename
with the file descriptor as the target directory.
<a href="#rights.path_filestat_get" name="rights.path_filestat_get"></a> path_filestat_get
The right to invoke path_filestat_get
.
<a href="#rights.path_filestat_set_size" name="rights.path_filestat_set_size"></a> path_filestat_set_size
The right to change a file's size (there is no path_filestat_set_size
).
If path_open
is set, includes the right to invoke path_open
with oflags::trunc
.
<a href="#rights.path_filestat_set_times" name="rights.path_filestat_set_times"></a> path_filestat_set_times
The right to invoke path_filestat_set_times
.
<a href="#rights.fd_filestat_get" name="rights.fd_filestat_get"></a> fd_filestat_get
The right to invoke fd_filestat_get
.
<a href="#rights.fd_filestat_set_size" name="rights.fd_filestat_set_size"></a> fd_filestat_set_size
The right to invoke fd_filestat_set_size
.
<a href="#rights.fd_filestat_set_times" name="rights.fd_filestat_set_times"></a> fd_filestat_set_times
The right to invoke fd_filestat_set_times
.
<a href="#rights.path_symlink" name="rights.path_symlink"></a> path_symlink
The right to invoke path_symlink
.
<a href="#rights.path_remove_directory" name="rights.path_remove_directory"></a> path_remove_directory
The right to invoke path_remove_directory
.
<a href="#rights.path_unlink_file" name="rights.path_unlink_file"></a> path_unlink_file
The right to invoke path_unlink_file
.
<a href="#rights.poll_fd_readwrite" name="rights.poll_fd_readwrite"></a> poll_fd_readwrite
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
.
<a href="#rights.sock_shutdown" name="rights.sock_shutdown"></a> sock_shutdown
The right to invoke sock_shutdown
.
fd
A file descriptor handle.
Size: 4
Alignment: 4
iovec
: StructA region of memory for scatter/gather reads.
Size: 8
Alignment: 4
buf
: Pointer<u8>
buf_len
: size
ciovec
: Structbuf
: ConstPointer<u8>
buf_len
: size
iovec_array
: Array<iovec>
ciovec_array
: Array<ciovec>
filedelta
: s64
whence
: Enum(u8
)<a href="#whence.set" name="whence.set"></a> set
Seek relative to start-of-file.
<a href="#whence.cur" name="whence.cur"></a> cur
Seek relative to current position.
<a href="#whence.end" name="whence.end"></a> end
Seek relative to end-of-file.
dircookie
: u64
A reference to the offset of a directory entry.
The value 0 signifies the start of the directory.
Size: 8
Alignment: 8
dirnamlen
: u32
The type for the $d_namlen field of $dirent.
Size: 4
Alignment: 4
inode
: u64
File serial number that is unique within its file system.
Size: 8
Alignment: 8
filetype
: Enum(u8
)The type of a file descriptor or file.
Size: 1
Alignment: 1
<a href="#filetype.unknown" name="filetype.unknown"></a> unknown
The type of the file descriptor or file is unknown or is different from any of the other types specified.
<a href="#filetype.block_device" name="filetype.block_device"></a> block_device
The file descriptor or file refers to a block device inode.
<a href="#filetype.character_device" name="filetype.character_device"></a> character_device
The file descriptor or file refers to a character device inode.
<a href="#filetype.directory" name="filetype.directory"></a> directory
The file descriptor or file refers to a directory inode.
<a href="#filetype.regular_file" name="filetype.regular_file"></a> regular_file
The file descriptor or file refers to a regular file inode.
<a href="#filetype.socket_dgram" name="filetype.socket_dgram"></a> socket_dgram
The file descriptor or file refers to a datagram socket.
<a href="#filetype.socket_stream" name="filetype.socket_stream"></a> socket_stream
The file descriptor or file refers to a byte-stream socket.
<a href="#filetype.symbolic_link" name="filetype.symbolic_link"></a> symbolic_link
The file refers to a symbolic link inode.
dirent
: StructA directory entry.
Size: 24
Alignment: 8
d_next
: dircookie
d_ino
: inode
d_namlen
: dirnamlen
d_type
: filetype
advice
: Enum(u8
)<a href="#advice.normal" name="advice.normal"></a> normal
The application has no advice to give on its behavior with respect to the specified data.
<a href="#advice.sequential" name="advice.sequential"></a> sequential
The application expects to access the specified data sequentially from lower offsets to higher offsets.
<a href="#advice.random" name="advice.random"></a> random
The application expects to access the specified data in a random order.
<a href="#advice.willneed" name="advice.willneed"></a> willneed
The application expects to access the specified data in the near future.
<a href="#advice.dontneed" name="advice.dontneed"></a> dontneed
The application expects that it will not access the specified data in the near future.
<a href="#advice.noreuse" name="advice.noreuse"></a> noreuse
The application expects to access the specified data once and then not reuse it thereafter.
fdflags
: Flags(u16
)File descriptor flags.
Size: 2
Alignment: 2
<a href="#fdflags.append" name="fdflags.append"></a> append
Append mode: Data written to the file is always appended to the file's end.
<a href="#fdflags.dsync" name="fdflags.dsync"></a> dsync
Write according to synchronized I/O data integrity completion. Only the data stored in the file is synchronized.
<a href="#fdflags.nonblock" name="fdflags.nonblock"></a> nonblock
Non-blocking mode.
<a href="#fdflags.rsync" name="fdflags.rsync"></a> rsync
Synchronized read I/O operations.
<a href="#fdflags.sync" name="fdflags.sync"></a> sync
Write according to synchronized I/O file integrity completion. In
addition to synchronizing the data stored in the file, the implementation
may also synchronously update the file's metadata.
fdstat
: StructFile descriptor attributes.
Size: 24
Alignment: 8
fs_filetype
: filetype
fs_flags
: fdflags
fs_rights_base
: rights
fs_rights_inheriting
: rights
path_open
.device
: u64
inode
to uniquely identify a file or directory in the filesystem.fstflags
: Flags(u16
)<a href="#fstflags.atim" name="fstflags.atim"></a> atim
Adjust the last data access timestamp to the value stored in filestat::atim
.
<a href="#fstflags.atim_now" name="fstflags.atim_now"></a> atim_now
Adjust the last data access timestamp to the time of clock clockid::realtime
.
<a href="#fstflags.mtim" name="fstflags.mtim"></a> mtim
Adjust the last data modification timestamp to the value stored in filestat::mtim
.
<a href="#fstflags.mtim_now" name="fstflags.mtim_now"></a> mtim_now
Adjust the last data modification timestamp to the time of clock clockid::realtime
.
lookupflags
: Flags(u32
)Flags determining the method of how paths are resolved.
Size: 4
Alignment: 4
symlink_follow
oflags
: Flags(u16
)Open flags used by path_open
.
Size: 2
Alignment: 2
<a href="#oflags.creat" name="oflags.creat"></a> creat
Create file if it does not exist.
<a href="#oflags.directory" name="oflags.directory"></a> directory
Fail if not a directory.
<a href="#oflags.excl" name="oflags.excl"></a> excl
Fail if file already exists.
<a href="#oflags.trunc" name="oflags.trunc"></a> trunc
Truncate file to size 0.
linkcount
: u64
Number of hard links to an inode.
Size: 8
Alignment: 8
filestat
: StructFile attributes.
Size: 64
Alignment: 8
dev
: device
ino
: inode
filetype
: filetype
nlink
: linkcount
size
: filesize
atim
: timestamp
mtim
: timestamp
ctim
: timestamp
userdata
: u64
eventtype
: Enum(u8
)<a href="#eventtype.clock" name="eventtype.clock"></a> clock
The time value of clock subscription_clock::id
has
reached timestamp subscription_clock::timeout
.
<a href="#eventtype.fd_read" name="eventtype.fd_read"></a> fd_read
File descriptor subscription_fd_readwrite::file_descriptor
has data
available for reading. This event always triggers for regular files.
<a href="#eventtype.fd_write" name="eventtype.fd_write"></a> fd_write
File descriptor subscription_fd_readwrite::file_descriptor
has capacity
available for writing. This event always triggers for regular files.
eventrwflags
: Flags(u16
)The state of the file descriptor subscribed to witheventtype::fd_read
or eventtype::fd_write
.
Size: 2
Alignment: 2
fd_readwrite_hangup
event_fd_readwrite
: StructThe contents of an $event when type is eventtype::fd_read
oreventtype::fd_write
.
Size: 16
Alignment: 8
nbytes
: filesize
flags
: eventrwflags
event
: Structuserdata
: userdata
subscription::userdata
.error
: errno
type
: eventtype
fd_readwrite
: event_fd_readwrite
eventtype::fd_read
oreventtype::fd_write
. eventtype::clock
events ignore this field.subclockflags
: Flags(u16
)subscription_clock::timeout
.subscription_clock_abstime
subscription_clock::timeout
as an absolute timestamp of clocksubscription_clock::id
. If clear, treat the timestampsubscription_clock::timeout
relative to thesubscription_clock::id
.subscription_clock
: StructThe contents of a subscription
when type is eventtype::clock
.
Size: 32
Alignment: 8
id
: clockid
timeout
: timestamp
precision
: timestamp
flags
: subclockflags
subscription_fd_readwrite
: Structsubscription
when type is type iseventtype::fd_read
or eventtype::fd_write
.file_descriptor
: fd
subscription_u
: Unionsubscription
.<a href="#subscription_u.clock" name="subscription_u.clock"></a> clock
: subscription_clock
<a href="#subscription_u.fd_read" name="subscription_u.fd_read"></a> fd_read
: subscription_fd_readwrite
<a href="#subscription_u.fd_write" name="subscription_u.fd_write"></a> fd_write
: subscription_fd_readwrite
subscription
: StructSubscription to an event.
Size: 48
Alignment: 8
userdata
: userdata
event::userdata
.u
: subscription_u
exitcode
: u32
signal
: Enum(u8
)<a href="#signal.none" name="signal.none"></a> none
No signal. Note that POSIX has special semantics for kill(pid, 0)
,
so this value is reserved.
<a href="#signal.hup" name="signal.hup"></a> hup
Hangup.
Action: Terminates the process.
<a href="#signal.int" name="signal.int"></a> int
Terminate interrupt signal.
Action: Terminates the process.
<a href="#signal.quit" name="signal.quit"></a> quit
Terminal quit signal.
Action: Terminates the process.
<a href="#signal.ill" name="signal.ill"></a> ill
Illegal instruction.
Action: Terminates the process.
<a href="#signal.trap" name="signal.trap"></a> trap
Trace/breakpoint trap.
Action: Terminates the process.
<a href="#signal.abrt" name="signal.abrt"></a> abrt
Process abort signal.
Action: Terminates the process.
<a href="#signal.bus" name="signal.bus"></a> bus
Access to an undefined portion of a memory object.
Action: Terminates the process.
<a href="#signal.fpe" name="signal.fpe"></a> fpe
Erroneous arithmetic operation.
Action: Terminates the process.
<a href="#signal.kill" name="signal.kill"></a> kill
Kill.
Action: Terminates the process.
<a href="#signal.usr1" name="signal.usr1"></a> usr1
User-defined signal 1.
Action: Terminates the process.
<a href="#signal.segv" name="signal.segv"></a> segv
Invalid memory reference.
Action: Terminates the process.
<a href="#signal.usr2" name="signal.usr2"></a> usr2
User-defined signal 2.
Action: Terminates the process.
<a href="#signal.pipe" name="signal.pipe"></a> pipe
Write on a pipe with no one to read it.
Action: Ignored.
<a href="#signal.alrm" name="signal.alrm"></a> alrm
Alarm clock.
Action: Terminates the process.
<a href="#signal.term" name="signal.term"></a> term
Termination signal.
Action: Terminates the process.
<a href="#signal.chld" name="signal.chld"></a> chld
Child process terminated, stopped, or continued.
Action: Ignored.
<a href="#signal.cont" name="signal.cont"></a> cont
Continue executing, if stopped.
Action: Continues executing, if stopped.
<a href="#signal.stop" name="signal.stop"></a> stop
Stop executing.
Action: Stops executing.
<a href="#signal.tstp" name="signal.tstp"></a> tstp
Terminal stop signal.
Action: Stops executing.
<a href="#signal.ttin" name="signal.ttin"></a> ttin
Background process attempting read.
Action: Stops executing.
<a href="#signal.ttou" name="signal.ttou"></a> ttou
Background process attempting write.
Action: Stops executing.
<a href="#signal.urg" name="signal.urg"></a> urg
High bandwidth data is available at a socket.
Action: Ignored.
<a href="#signal.xcpu" name="signal.xcpu"></a> xcpu
CPU time limit exceeded.
Action: Terminates the process.
<a href="#signal.xfsz" name="signal.xfsz"></a> xfsz
File size limit exceeded.
Action: Terminates the process.
<a href="#signal.vtalrm" name="signal.vtalrm"></a> vtalrm
Virtual timer expired.
Action: Terminates the process.
<a href="#signal.prof" name="signal.prof"></a> prof
Profiling timer expired.
Action: Terminates the process.
<a href="#signal.winch" name="signal.winch"></a> winch
Window changed.
Action: Ignored.
<a href="#signal.poll" name="signal.poll"></a> poll
I/O possible.
Action: Terminates the process.
<a href="#signal.pwr" name="signal.pwr"></a> pwr
Power failure.
Action: Terminates the process.
<a href="#signal.sys" name="signal.sys"></a> sys
Bad system call.
Action: Terminates the process.
riflags
: Flags(u16
)Flags provided to sock_recv
.
Size: 2
Alignment: 2
<a href="#riflags.recv_peek" name="riflags.recv_peek"></a> recv_peek
Returns the message without removing it from the socket's receive queue.
<a href="#riflags.recv_waitall" name="riflags.recv_waitall"></a> recv_waitall
On byte-stream sockets, block until the full amount of data can be returned.
roflags
: Flags(u16
)Flags returned by sock_recv
.
Size: 2
Alignment: 2
recv_data_truncated
sock_recv
: Message data has been truncated.siflags
: u16
Flags provided to sock_send
. As there are currently no flags
defined, it must be set to zero.
Size: 2
Alignment: 2
sdflags
: Flags(u8
)Which channels on a socket to shut down.
Size: 1
Alignment: 1
<a href="#sdflags.rd" name="sdflags.rd"></a> rd
Disables further receive operations.
<a href="#sdflags.wr" name="sdflags.wr"></a> wr
Disables further send operations.
preopentype
: Enum(u8
)Identifiers for preopened capabilities.
Size: 1
Alignment: 1
dir
prestat_dir
: StructThe contents of a $prestat when type is preopentype::dir
.
Size: 4
Alignment: 4
pr_name_len
: size
fd_prestat_dir_name
.prestat
: Uniondir
: prestat_dir
args_get(argv: Pointer<Pointer<u8>>, argv_buf: Pointer<u8>) -> errno
Read command-line argument data.
The size of the array should match that returned by args_sizes_get
<a href="#args_get.argv" name="args_get.argv"></a> argv
: Pointer<Pointer<u8>>
<a href="#args_get.argv_buf" name="args_get.argv_buf"></a> argv_buf
: Pointer<u8>
error
: errno
args_sizes_get() -> (errno, size, size)
Return command-line argument data sizes.
<a href="#args_sizes_get.error" name="args_sizes_get.error"></a> error
: errno
<a href="#args_sizes_get.argc" name="args_sizes_get.argc"></a> argc
: size
The number of arguments.
<a href="#args_sizes_get.argv_buf_size" name="args_sizes_get.argv_buf_size"></a> argv_buf_size
: size
The size of the argument string data.
environ_get(environ: Pointer<Pointer<u8>>, environ_buf: Pointer<u8>) -> errno
Read environment variable data.
The sizes of the buffers should match that returned by environ_sizes_get
.
<a href="#environ_get.environ" name="environ_get.environ"></a> environ
: Pointer<Pointer<u8>>
<a href="#environ_get.environ_buf" name="environ_get.environ_buf"></a> environ_buf
: Pointer<u8>
error
: errno
environ_sizes_get() -> (errno, size, size)
Return environment variable data sizes.
<a href="#environ_sizes_get.error" name="environ_sizes_get.error"></a> error
: errno
<a href="#environ_sizes_get.environc" name="environ_sizes_get.environc"></a> environc
: size
The number of environment variable arguments.
<a href="#environ_sizes_get.environ_buf_size" name="environ_sizes_get.environ_buf_size"></a> environ_buf_size
: size
The size of the environment variable data.
clock_res_get(id: clockid) -> (errno, timestamp)
Return the resolution of a clock.
Implementations are required to provide a non-zero value for supported clocks. For unsupported clocks,
return errno::inval
.
Note: This is similar to clock_getres
in POSIX.
id
: clockid
<a href="#clock_res_get.error" name="clock_res_get.error"></a> error
: errno
<a href="#clock_res_get.resolution" name="clock_res_get.resolution"></a> resolution
: timestamp
The resolution of the clock.
clock_time_get(id: clockid, precision: timestamp) -> (errno, timestamp)
Return the time value of a clock.
Note: This is similar to clock_gettime
in POSIX.
<a href="#clock_time_get.id" name="clock_time_get.id"></a> id
: clockid
The clock for which to return the time.
<a href="#clock_time_get.precision" name="clock_time_get.precision"></a> precision
: timestamp
The maximum lag (exclusive) that the returned time value may have, compared to its actual value.
<a href="#clock_time_get.error" name="clock_time_get.error"></a> error
: errno
<a href="#clock_time_get.time" name="clock_time_get.time"></a> time
: timestamp
The time value of the clock.
fd_advise(fd: fd, offset: filesize, len: filesize, advice: advice) -> errno
Provide file advisory information on a file descriptor.
Note: This is similar to posix_fadvise
in POSIX.
<a href="#fd_advise.fd" name="fd_advise.fd"></a> fd
: fd
<a href="#fd_advise.offset" name="fd_advise.offset"></a> offset
: filesize
The offset within the file to which the advisory applies.
<a href="#fd_advise.len" name="fd_advise.len"></a> len
: filesize
The length of the region to which the advisory applies.
<a href="#fd_advise.advice" name="fd_advise.advice"></a> advice
: advice
The advice.
error
: errno
fd_allocate(fd: fd, offset: filesize, len: filesize) -> errno
Force the allocation of space in a file.
Note: This is similar to posix_fallocate
in POSIX.
<a href="#fd_allocate.fd" name="fd_allocate.fd"></a> fd
: fd
<a href="#fd_allocate.offset" name="fd_allocate.offset"></a> offset
: filesize
The offset at which to start the allocation.
<a href="#fd_allocate.len" name="fd_allocate.len"></a> len
: filesize
The length of the area that is allocated.
error
: errno
fd_close(fd: fd) -> errno
Close a file descriptor.
Note: This is similar to close
in POSIX.
fd
: fd
error
: errno
fd_datasync(fd: fd) -> errno
Synchronize the data of a file to disk.
Note: This is similar to fdatasync
in POSIX.
fd
: fd
error
: errno
fd_fdstat_get(fd: fd) -> (errno, fdstat)
Get the attributes of a file descriptor.
Note: This returns similar flags to fsync(fd, F_GETFL)
in POSIX, as well as additional fields.
fd
: fd
<a href="#fd_fdstat_get.error" name="fd_fdstat_get.error"></a> error
: errno
<a href="#fd_fdstat_get.stat" name="fd_fdstat_get.stat"></a> stat
: fdstat
The buffer where the file descriptor's attributes are stored.
fd_fdstat_set_flags(fd: fd, flags: fdflags) -> errno
Adjust the flags associated with a file descriptor.
Note: This is similar to fcntl(fd, F_SETFL, flags)
in POSIX.
<a href="#fd_fdstat_set_flags.fd" name="fd_fdstat_set_flags.fd"></a> fd
: fd
<a href="#fd_fdstat_set_flags.flags" name="fd_fdstat_set_flags.flags"></a> flags
: fdflags
The desired values of the file descriptor flags.
error
: errno
fd_fdstat_set_rights(fd: fd, fs_rights_base: rights, fs_rights_inheriting: rights) -> errno
Adjust the rights associated with a file descriptor.
This can only be used to remove rights, and returns errno::notcapable
if called in a way that would attempt to add rights
<a href="#fd_fdstat_set_rights.fd" name="fd_fdstat_set_rights.fd"></a> fd
: fd
<a href="#fd_fdstat_set_rights.fs_rights_base" name="fd_fdstat_set_rights.fs_rights_base"></a> fs_rights_base
: rights
The desired rights of the file descriptor.
<a href="#fd_fdstat_set_rights.fs_rights_inheriting" name="fd_fdstat_set_rights.fs_rights_inheriting"></a> fs_rights_inheriting
: rights
error
: errno
fd_filestat_get(fd: fd) -> (errno, filestat)
Return the attributes of an open file.
fd
: fd
<a href="#fd_filestat_get.error" name="fd_filestat_get.error"></a> error
: errno
<a href="#fd_filestat_get.buf" name="fd_filestat_get.buf"></a> buf
: filestat
The buffer where the file's attributes are stored.
fd_filestat_set_size(fd: fd, size: filesize) -> errno
Adjust the size of an open file. If this increases the file's size, the extra bytes are filled with zeros.
Note: This is similar to ftruncate
in POSIX.
<a href="#fd_filestat_set_size.fd" name="fd_filestat_set_size.fd"></a> fd
: fd
<a href="#fd_filestat_set_size.size" name="fd_filestat_set_size.size"></a> size
: filesize
The desired file size.
error
: errno
fd_filestat_set_times(fd: fd, atim: timestamp, mtim: timestamp, fst_flags: fstflags) -> errno
Adjust the timestamps of an open file or directory.
Note: This is similar to futimens
in POSIX.
<a href="#fd_filestat_set_times.fd" name="fd_filestat_set_times.fd"></a> fd
: fd
<a href="#fd_filestat_set_times.atim" name="fd_filestat_set_times.atim"></a> atim
: timestamp
The desired values of the data access timestamp.
<a href="#fd_filestat_set_times.mtim" name="fd_filestat_set_times.mtim"></a> mtim
: timestamp
The desired values of the data modification timestamp.
<a href="#fd_filestat_set_times.fst_flags" name="fd_filestat_set_times.fst_flags"></a> fst_flags
: fstflags
A bitmask indicating which timestamps to adjust.
error
: errno
fd_pread(fd: fd, iovs: iovec_array, offset: filesize) -> (errno, size)
Read from a file descriptor, without using and updating the file descriptor's offset.
Note: This is similar to preadv
in POSIX.
<a href="#fd_pread.fd" name="fd_pread.fd"></a> fd
: fd
<a href="#fd_pread.iovs" name="fd_pread.iovs"></a> iovs
: iovec_array
List of scatter/gather vectors in which to store data.
<a href="#fd_pread.offset" name="fd_pread.offset"></a> offset
: filesize
The offset within the file at which to read.
<a href="#fd_pread.error" name="fd_pread.error"></a> error
: errno
<a href="#fd_pread.nread" name="fd_pread.nread"></a> nread
: size
The number of bytes read.
fd_prestat_get(fd: fd) -> (errno, prestat)
Return a description of the given preopened file descriptor.
fd
: fd
<a href="#fd_prestat_get.error" name="fd_prestat_get.error"></a> error
: errno
<a href="#fd_prestat_get.buf" name="fd_prestat_get.buf"></a> buf
: prestat
The buffer where the description is stored.
fd_prestat_dir_name(fd: fd, path: Pointer<u8>, path_len: size) -> errno
Return a description of the given preopened file descriptor.
<a href="#fd_prestat_dir_name.fd" name="fd_prestat_dir_name.fd"></a> fd
: fd
<a href="#fd_prestat_dir_name.path" name="fd_prestat_dir_name.path"></a> path
: Pointer<u8>
A buffer into which to write the preopened directory name.
<a href="#fd_prestat_dir_name.path_len" name="fd_prestat_dir_name.path_len"></a> path_len
: size
error
: errno
fd_pwrite(fd: fd, iovs: ciovec_array, offset: filesize) -> (errno, size)
Write to a file descriptor, without using and updating the file descriptor's offset.
Note: This is similar to pwritev
in POSIX.
<a href="#fd_pwrite.fd" name="fd_pwrite.fd"></a> fd
: fd
<a href="#fd_pwrite.iovs" name="fd_pwrite.iovs"></a> iovs
: ciovec_array
List of scatter/gather vectors from which to retrieve data.
<a href="#fd_pwrite.offset" name="fd_pwrite.offset"></a> offset
: filesize
The offset within the file at which to write.
<a href="#fd_pwrite.error" name="fd_pwrite.error"></a> error
: errno
<a href="#fd_pwrite.nwritten" name="fd_pwrite.nwritten"></a> nwritten
: size
The number of bytes written.
fd_read(fd: fd, iovs: iovec_array) -> (errno, size)
Read from a file descriptor.
Note: This is similar to readv
in POSIX.
<a href="#fd_read.fd" name="fd_read.fd"></a> fd
: fd
<a href="#fd_read.iovs" name="fd_read.iovs"></a> iovs
: iovec_array
List of scatter/gather vectors to which to store data.
<a href="#fd_read.error" name="fd_read.error"></a> error
: errno
<a href="#fd_read.nread" name="fd_read.nread"></a> nread
: size
The number of bytes read.
fd_readdir(fd: fd, buf: Pointer<u8>, buf_len: size, cookie: dircookie) -> (errno, size)
Read directory entries from a directory.
When successful, the contents of the output buffer consist of a sequence of
directory entries. Each directory entry consists of a dirent_t object,
followed by dirent_t::d_namlen bytes holding the name of the directory
entry.
This function fills the output buffer as much as possible, potentially
truncating the last directory entry. This allows the caller to grow its
read buffer size in case it's too small to fit a single large directory
entry, or skip the oversized directory entry.
<a href="#fd_readdir.fd" name="fd_readdir.fd"></a> fd
: fd
<a href="#fd_readdir.buf" name="fd_readdir.buf"></a> buf
: Pointer<u8>
The buffer where directory entries are stored
<a href="#fd_readdir.buf_len" name="fd_readdir.buf_len"></a> buf_len
: size
<a href="#fd_readdir.cookie" name="fd_readdir.cookie"></a> cookie
: dircookie
The location within the directory to start reading
<a href="#fd_readdir.error" name="fd_readdir.error"></a> error
: errno
<a href="#fd_readdir.bufused" name="fd_readdir.bufused"></a> bufused
: size
The number of bytes stored in the read buffer. If less than the size of the read buffer, the end of the directory has been reached.
fd_renumber(fd: fd, to: fd) -> errno
Atomically replace a file descriptor by renumbering another file descriptor.
Due to the strong focus on thread safety, this environment does not provide
a mechanism to duplicate or renumber a file descriptor to an arbitrary
number, like dup2()
. This would be prone to race conditions, as an actual
file descriptor with the same number could be allocated by a different
thread at the same time.
This function provides a way to atomically renumber file descriptors, which
would disappear if dup2()
were to be removed entirely.
<a href="#fd_renumber.fd" name="fd_renumber.fd"></a> fd
: fd
<a href="#fd_renumber.to" name="fd_renumber.to"></a> to
: fd
The file descriptor to overwrite.
error
: errno
fd_seek(fd: fd, offset: filedelta, whence: whence) -> (errno, filesize)
Move the offset of a file descriptor.
Note: This is similar to lseek
in POSIX.
<a href="#fd_seek.fd" name="fd_seek.fd"></a> fd
: fd
<a href="#fd_seek.offset" name="fd_seek.offset"></a> offset
: filedelta
The number of bytes to move.
<a href="#fd_seek.whence" name="fd_seek.whence"></a> whence
: whence
The base from which the offset is relative.
<a href="#fd_seek.error" name="fd_seek.error"></a> error
: errno
<a href="#fd_seek.newoffset" name="fd_seek.newoffset"></a> newoffset
: filesize
The new offset of the file descriptor, relative to the start of the file.
fd_sync(fd: fd) -> errno
Synchronize the data and metadata of a file to disk.
Note: This is similar to fsync
in POSIX.
fd
: fd
error
: errno
fd_tell(fd: fd) -> (errno, filesize)
Return the current offset of a file descriptor.
Note: This is similar to lseek(fd, 0, SEEK_CUR)
in POSIX.
fd
: fd
<a href="#fd_tell.error" name="fd_tell.error"></a> error
: errno
<a href="#fd_tell.offset" name="fd_tell.offset"></a> offset
: filesize
The current offset of the file descriptor, relative to the start of the file.
fd_write(fd: fd, iovs: ciovec_array) -> (errno, size)
Write to a file descriptor.
Note: This is similar to writev
in POSIX.
<a href="#fd_write.fd" name="fd_write.fd"></a> fd
: fd
<a href="#fd_write.iovs" name="fd_write.iovs"></a> iovs
: ciovec_array
List of scatter/gather vectors from which to retrieve data.
<a href="#fd_write.error" name="fd_write.error"></a> error
: errno
<a href="#fd_write.nwritten" name="fd_write.nwritten"></a> nwritten
: size
The number of bytes written.
path_create_directory(fd: fd, path: string) -> errno
Create a directory.
Note: This is similar to mkdirat
in POSIX.
<a href="#path_create_directory.fd" name="path_create_directory.fd"></a> fd
: fd
<a href="#path_create_directory.path" name="path_create_directory.path"></a> path
: string
The path at which to create the directory.
error
: errno
path_filestat_get(fd: fd, flags: lookupflags, path: string) -> (errno, filestat)
Return the attributes of a file or directory.
Note: This is similar to stat
in POSIX.
<a href="#path_filestat_get.fd" name="path_filestat_get.fd"></a> fd
: fd
<a href="#path_filestat_get.flags" name="path_filestat_get.flags"></a> flags
: lookupflags
Flags determining the method of how the path is resolved.
<a href="#path_filestat_get.path" name="path_filestat_get.path"></a> path
: string
The path of the file or directory to inspect.
<a href="#path_filestat_get.error" name="path_filestat_get.error"></a> error
: errno
<a href="#path_filestat_get.buf" name="path_filestat_get.buf"></a> buf
: filestat
The buffer where the file's attributes are stored.
path_filestat_set_times(fd: fd, flags: lookupflags, path: string, atim: timestamp, mtim: timestamp, fst_flags: fstflags) -> errno
Adjust the timestamps of a file or directory.
Note: This is similar to utimensat
in POSIX.
<a href="#path_filestat_set_times.fd" name="path_filestat_set_times.fd"></a> fd
: fd
<a href="#path_filestat_set_times.flags" name="path_filestat_set_times.flags"></a> flags
: lookupflags
Flags determining the method of how the path is resolved.
<a href="#path_filestat_set_times.path" name="path_filestat_set_times.path"></a> path
: string
The path of the file or directory to operate on.
<a href="#path_filestat_set_times.atim" name="path_filestat_set_times.atim"></a> atim
: timestamp
The desired values of the data access timestamp.
<a href="#path_filestat_set_times.mtim" name="path_filestat_set_times.mtim"></a> mtim
: timestamp
The desired values of the data modification timestamp.
<a href="#path_filestat_set_times.fst_flags" name="path_filestat_set_times.fst_flags"></a> fst_flags
: fstflags
A bitmask indicating which timestamps to adjust.
error
: errno
path_link(old_fd: fd, old_flags: lookupflags, old_path: string, new_fd: fd, new_path: string) -> errno
Create a hard link.
Note: This is similar to linkat
in POSIX.
<a href="#path_link.old_fd" name="path_link.old_fd"></a> old_fd
: fd
<a href="#path_link.old_flags" name="path_link.old_flags"></a> old_flags
: lookupflags
Flags determining the method of how the path is resolved.
<a href="#path_link.old_path" name="path_link.old_path"></a> old_path
: string
The source path from which to link.
<a href="#path_link.new_fd" name="path_link.new_fd"></a> new_fd
: fd
The working directory at which the resolution of the new path starts.
<a href="#path_link.new_path" name="path_link.new_path"></a> new_path
: string
The destination path at which to create the hard link.
error
: errno
path_open(fd: fd, dirflags: lookupflags, path: string, oflags: oflags, fs_rights_base: rights, fs_rights_inherting: rights, fdflags: fdflags) -> (errno, fd)
Open a file or directory.
The returned file descriptor is not guaranteed to be the lowest-numbered
file descriptor not currently open; it is randomized to prevent
applications from depending on making assumptions about indexes, since this
is error-prone in multi-threaded contexts. The returned file descriptor is
guaranteed to be less than 2**31.
Note: This is similar to openat
in POSIX.
<a href="#path_open.fd" name="path_open.fd"></a> fd
: fd
<a href="#path_open.dirflags" name="path_open.dirflags"></a> dirflags
: lookupflags
Flags determining the method of how the path is resolved.
<a href="#path_open.path" name="path_open.path"></a> path
: string
The relative path of the file or directory to open, relative to thepath_open::fd
directory.
<a href="#path_open.oflags" name="path_open.oflags"></a> oflags
: oflags
The method by which to open the file.
<a href="#path_open.fs_rights_base" name="path_open.fs_rights_base"></a> fs_rights_base
: rights
The initial rights of the newly created file descriptor. The
implementation is allowed to return a file descriptor with fewer rights
than specified, if and only if those rights do not apply to the type of
file being opened.
The base rights are rights that will apply to operations using the file
descriptor itself, while the inheriting rights are rights that apply to
file descriptors derived from it.
<a href="#path_open.fs_rights_inherting" name="path_open.fs_rights_inherting"></a> fs_rights_inherting
: rights
<a href="#path_open.fdflags" name="path_open.fdflags"></a> fdflags
: fdflags
<a href="#path_open.error" name="path_open.error"></a> error
: errno
<a href="#path_open.opened_fd" name="path_open.opened_fd"></a> opened_fd
: fd
The file descriptor of the file that has been opened.
path_readlink(fd: fd, path: string, buf: Pointer<u8>, buf_len: size) -> (errno, size)
Read the contents of a symbolic link.
Note: This is similar to readlinkat
in POSIX.
<a href="#path_readlink.fd" name="path_readlink.fd"></a> fd
: fd
<a href="#path_readlink.path" name="path_readlink.path"></a> path
: string
The path of the symbolic link from which to read.
<a href="#path_readlink.buf" name="path_readlink.buf"></a> buf
: Pointer<u8>
The buffer to which to write the contents of the symbolic link.
<a href="#path_readlink.buf_len" name="path_readlink.buf_len"></a> buf_len
: size
<a href="#path_readlink.error" name="path_readlink.error"></a> error
: errno
<a href="#path_readlink.bufused" name="path_readlink.bufused"></a> bufused
: size
The number of bytes placed in the buffer.
path_remove_directory(fd: fd, path: string) -> errno
Remove a directory.
Return errno::notempty
if the directory is not empty.
Note: This is similar to unlinkat(fd, path, AT_REMOVEDIR)
in POSIX.
<a href="#path_remove_directory.fd" name="path_remove_directory.fd"></a> fd
: fd
<a href="#path_remove_directory.path" name="path_remove_directory.path"></a> path
: string
The path to a directory to remove.
error
: errno
path_rename(fd: fd, old_path: string, new_fd: fd, new_path: string) -> errno
Rename a file or directory.
Note: This is similar to renameat
in POSIX.
<a href="#path_rename.fd" name="path_rename.fd"></a> fd
: fd
<a href="#path_rename.old_path" name="path_rename.old_path"></a> old_path
: string
The source path of the file or directory to rename.
<a href="#path_rename.new_fd" name="path_rename.new_fd"></a> new_fd
: fd
The working directory at which the resolution of the new path starts.
<a href="#path_rename.new_path" name="path_rename.new_path"></a> new_path
: string
The destination path to which to rename the file or directory.
error
: errno
path_symlink(old_path: string, fd: fd, new_path: string) -> errno
Create a symbolic link.
Note: This is similar to symlinkat
in POSIX.
<a href="#path_symlink.old_path" name="path_symlink.old_path"></a> old_path
: string
The contents of the symbolic link.
<a href="#path_symlink.fd" name="path_symlink.fd"></a> fd
: fd
<a href="#path_symlink.new_path" name="path_symlink.new_path"></a> new_path
: string
The destination path at which to create the symbolic link.
error
: errno
path_unlink_file(fd: fd, path: string) -> errno
Unlink a file.
Return errno::isdir
if the path refers to a directory.
Note: This is similar to unlinkat(fd, path, 0)
in POSIX.
<a href="#path_unlink_file.fd" name="path_unlink_file.fd"></a> fd
: fd
<a href="#path_unlink_file.path" name="path_unlink_file.path"></a> path
: string
The path to a file to unlink.
error
: errno
poll_oneoff(in: ConstPointer<subscription>, out: Pointer<event>, nsubscriptions: size) -> (errno, size)
Concurrently poll for the occurrence of a set of events.
<a href="#poll_oneoff.in" name="poll_oneoff.in"></a> in
: ConstPointer<subscription>
The events to which to subscribe.
<a href="#poll_oneoff.out" name="poll_oneoff.out"></a> out
: Pointer<event>
The events that have occurred.
<a href="#poll_oneoff.nsubscriptions" name="poll_oneoff.nsubscriptions"></a> nsubscriptions
: size
Both the number of subscriptions and events.
<a href="#poll_oneoff.error" name="poll_oneoff.error"></a> error
: errno
<a href="#poll_oneoff.nevents" name="poll_oneoff.nevents"></a> nevents
: size
The number of events stored.
proc_exit(rval: exitcode)
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.
rval
: exitcode
proc_raise(sig: signal) -> errno
Send a signal to the process of the calling thread.
Note: This is similar to raise
in POSIX.
sig
: signal
error
: errno
sched_yield() -> errno
Temporarily yield execution of the calling thread.
Note: This is similar to sched_yield
in POSIX.
error
: errno
random_get(buf: Pointer<u8>, buf_len: size) -> errno
Write high-quality random data into a buffer.
This function blocks when the implementation is unable to immediately
provide sufficient high-quality random data.
This function may execute slowly, so when large mounts of random data are
required, it's advisable to use this function to seed a pseudo-random
number generator, rather than to provide the random data directly.
<a href="#random_get.buf" name="random_get.buf"></a> buf
: Pointer<u8>
The buffer to fill with random data.
<a href="#random_get.buf_len" name="random_get.buf_len"></a> buf_len
: size
error
: errno
sock_recv(fd: fd, ri_data: iovec_array, ri_flags: riflags) -> (errno, size, roflags)
Receive a message from a socket.
Note: This is similar to recv
in POSIX, though it also supports reading
the data into multiple buffers in the manner of readv
.
<a href="#sock_recv.fd" name="sock_recv.fd"></a> fd
: fd
<a href="#sock_recv.ri_data" name="sock_recv.ri_data"></a> ri_data
: iovec_array
List of scatter/gather vectors to which to store data.
<a href="#sock_recv.ri_flags" name="sock_recv.ri_flags"></a> ri_flags
: riflags
Message flags.
<a href="#sock_recv.error" name="sock_recv.error"></a> error
: errno
<a href="#sock_recv.ro_datalen" name="sock_recv.ro_datalen"></a> ro_datalen
: size
Number of bytes stored in ri_data.
<a href="#sock_recv.ro_flags" name="sock_recv.ro_flags"></a> ro_flags
: roflags
Message flags.
sock_send(fd: fd, si_data: ciovec_array, si_flags: siflags) -> (errno, size)
Send a message on a socket.
Note: This is similar to send
in POSIX, though it also supports writing
the data from multiple buffers in the manner of writev
.
<a href="#sock_send.fd" name="sock_send.fd"></a> fd
: fd
<a href="#sock_send.si_data" name="sock_send.si_data"></a> si_data
: ciovec_array
List of scatter/gather vectors to which to retrieve data
<a href="#sock_send.si_flags" name="sock_send.si_flags"></a> si_flags
: siflags
Message flags.
<a href="#sock_send.error" name="sock_send.error"></a> error
: errno
<a href="#sock_send.so_datalen" name="sock_send.so_datalen"></a> so_datalen
: size
Number of bytes transmitted.
sock_shutdown(fd: fd, how: sdflags) -> errno
Shut down socket send and receive channels.
Note: This is similar to shutdown
in POSIX.
<a href="#sock_shutdown.fd" name="sock_shutdown.fd"></a> fd
: fd
<a href="#sock_shutdown.how" name="sock_shutdown.how"></a> how
: sdflags
Which channels on the socket to shut down.
error
: errno