Platform-specific package target: freebsd_amd64

Collection Info

View Source
Collection
core
Path
sys/freebsd
Entries
125

Source Files

Constants

30

FD_CLOEXEC #

Source
FD_CLOEXEC :: 1

file descriptor flags (F_GETFD, F_SETFD)

RTM_VERSION #

Source
RTM_VERSION :: 5

Up the ante and ignore older versions

STDERR_FILENO #

Source
STDERR_FILENO :: Fd(2)

Standard error file descriptor

STDIN_FILENO #

Source
STDIN_FILENO :: Fd(0)

Standard input file descriptor

STDOUT_FILENO #

Source
STDOUT_FILENO :: Fd(1)

Standard output file descriptor

Types

54

File_Status_Flag #

Source
File_Status_Flag :: File_Status_Flag

* File status flags: these are used by open(2), fcntl(2). * They are also used (indirectly) in the kernel file structure f_flags, * which is a superset of the open/fcntl flags. Open flags and f_flags * are inter-convertible using OFLAGS(fflags) and FFLAGS(oflags). * Open/fcntl flags begin with O_; kernel-internal flags begin with F.

Interface_Address_Message_Header_Len #

Source
Interface_Address_Message_Header_Len :: Interface_Address_Message_Header_Len

* The 'l' version shall be used by new interfaces, like NET_RT_IFLISTL. It is * extensible after ifam_metric or within ifam_data. Both the ifa_msghdrl and * if_data now have a member field detailing the struct length in addition to * the routing message length. Macros are provided to find the start of * ifm_data and the start of the socket address strucutres immediately following * struct ifa_msghdrl given a pointer to struct ifa_msghdrl. struct ifa_msghdrl

Interface_Data #

Source
Interface_Data :: Interface_Data

* Structure describing information about an interface * which may be of interest to management entities. struct if_data

Interface_Message_Header_Len #

Source
Interface_Message_Header_Len :: Interface_Message_Header_Len

* The 'l' version shall be used by new interfaces, like NET_RT_IFLISTL. It is * extensible after ifm_data_off or within ifm_data. Both the if_msghdr and * if_data now have a member field detailing the struct length in addition to * the routing message length. Macros are provided to find the start of * ifm_data and the start of the socket address strucutres immediately following * struct if_msghdrl given a pointer to struct if_msghdrl. struct if_msghdrl

Route_Message_Type #

Source
Route_Message_Type :: Route_Message_Type

* Message types. * * The format for each message is annotated below using the following * identifiers: * * (1) struct rt_msghdr * (2) struct ifa_msghdr * (3) struct if_msghdr * (4) struct ifma_msghdr * (5) struct if_announcemsghdr * #define RTM_*

Socket_Address_Header #

Source
Socket_Address_Header :: Socket_Address_Header

Socket address struct header without protocol-specific data. Inherit from this if you want a custom socket address datatype for use with bind(), listen(), et cetera.

Procedures

39

accept_nil #

Source
accept_nil :: proc "contextless" (s: Fd) -> (Fd, Errno) {…}

Accept a connection on a socket. The accept() system call appeared in 4.2BSD.

accept_T #

Source
accept_T :: proc "contextless" (s: Fd, sockaddr: ^$T) -> (Fd, Errno) {…}

Accept a connection on a socket. The accept() system call appeared in 4.2BSD.

accept4_nil #

Source
accept4_nil :: proc "contextless" (s: Fd, flags: bit_set[Socket_Flag_Index] = {}) -> (Fd, Errno) {…}

Accept a connection on a socket. The accept4() system call appeared in FreeBSD 10.0.

accept4_T #

Source
accept4_T :: proc "contextless" (s: Fd, sockaddr: ^$T, flags: bit_set[Socket_Flag_Index] = {}) -> (Fd, Errno) {…}

Accept a connection on a socket. The accept4() system call appeared in FreeBSD 10.0.

bind #

Source
bind :: proc "contextless" (s: Fd, sockaddr: ^$T, addrlen: socklen_t) -> Errno {…}

Assign a local protocol address to a socket. The bind() system call appeared in 4.2BSD.

close #

Source
close :: proc "contextless" (fd: Fd) -> Errno {…}

Delete a descriptor. The open() function appeared in Version 1 AT&T UNIX.

connect #

Source
connect :: proc "contextless" (fd: Fd, sockaddr: ^$T, addrlen: socklen_t) -> Errno {…}

Initiate a connection on a socket. The connect() system call appeared in 4.2BSD.

fcntl #

Source
fcntl :: proc "contextless" (fd: Fd, cmd: File_Control_Command, arg: i32) -> (int, Errno) {…}

File control. The fcntl() system call appeared in 4.2BSD. The F_DUP2FD constant first appeared in FreeBSD 7.1. NOTE: If you know at compile-time what command you're calling, use one of the `fcntl_*` procedures instead to preserve type safety.

fsync #

Source
fsync :: proc "contextless" (fd: Fd) -> Errno {…}

Synchronize changes to a file. The fsync() system call appeared in 4.2BSD.

getpeername #

Source
getpeername :: proc "contextless" (s: Fd, sockaddr: ^$T) -> Errno {…}

Get name of connected peer The getpeername() system call appeared in 4.2BSD.

getpid #

Source
getpid :: proc "contextless" () -> pid_t {…}

Get parent or calling process identification. The getpid() function appeared in Version 7 AT&T UNIX.

getsockname #

Source
getsockname :: proc "contextless" (s: Fd, sockaddr: ^$T) -> Errno {…}

Get socket name. The getsockname() system call appeared in 4.2BSD.

getsockname_or_peername #

Source
getsockname_or_peername :: proc "contextless" (s: Fd, sockaddr: ^$T, is_peer: bool) -> Errno {…}

listen #

Source
listen :: proc "contextless" (s: Fd, backlog: int) -> Errno {…}

Listen for connections on a socket. The listen() system call appeared in 4.2BSD.

open #

Source
open :: proc "contextless" (path: string, flags: bit_set[File_Status_Index], mode: int = 0o000) -> (Fd, Errno) {…}

Open or create a file for reading, writing or executing. The open() function appeared in Version 1 AT&T UNIX. The openat() function was introduced in FreeBSD 8.0.

pread #

Source
pread :: proc "contextless" (fd: Fd, buf: []u8, offset: off_t) -> (int, Errno) {…}

Read input without modifying the file pointer. The pread() function appeared in AT&T System V Release 4 UNIX.

pwrite #

Source
pwrite :: proc "contextless" (fd: Fd, buf: []u8, offset: off_t) -> (int, Errno) {…}

Write output without modifying the file pointer. The pwrite() function appeared in AT&T System V Release 4 UNIX. BUGS The pwrite() system call appends the file without changing the file offset if O_APPEND is set, contrary to IEEE Std 1003.1-2008 (“POSIX.1”) where pwrite() writes into offset regardless of whether O_APPEND is set.

read #

Source
read :: proc "contextless" (fd: Fd, buf: []u8) -> (int, Errno) {…}

Read input. The read() function appeared in Version 1 AT&T UNIX.

recv #

Source
recv :: proc "contextless" (s: Fd, buf: []u8, flags: Recv_Flags) -> (int, Errno) {…}

Receive message(s) from a socket. The recv() function appeared in 4.2BSD. The recvmmsg() function appeared in FreeBSD 11.0.

recvfrom #

Source
recvfrom :: proc "contextless" (s: Fd, buf: []u8, flags: Recv_Flags, from: ^$T) -> (int, Errno) {…}

Receive message(s) from a socket. The recv() function appeared in 4.2BSD. The recvmmsg() function appeared in FreeBSD 11.0.

send #

Source
send :: proc "contextless" (s: Fd, msg: []u8, flags: Send_Flags) -> (int, Errno) {…}

Send message(s) from a socket. The send() function appeared in 4.2BSD. The sendmmsg() function appeared in FreeBSD 11.0.

sendto #

Source
sendto :: proc "contextless" (s: Fd, msg: []u8, flags: Send_Flags, to: ^$T) -> (int, Errno) {…}

Send message(s) from a socket. The send() function appeared in 4.2BSD. The sendmmsg() function appeared in FreeBSD 11.0.

shutdown #

Source
shutdown :: proc "contextless" (s: Fd, how: Shutdown_Method) -> Errno {…}

Disable sends and/or receives on a socket. The shutdown() system call appeared in 4.2BSD.

write #

Source
write :: proc "contextless" (fd: Fd, buf: []u8) -> (int, Errno) {…}

Write output. The write() function appeared in Version 1 AT&T UNIX.

Procedure Groups

2