posix

This is a raw POSIX interface module. It does not not provide any convenience: cstrings are used instead of proper Nim strings and return codes indicate errors. If you want exceptions and a proper Nim-like interface, use the OS module or write a wrapper.

For high-level wrappers specialized for Linux and BSDs see: posix_utils

Coding conventions: ALL types are named the same as in the POSIX standard except that they start with 'T' or 'P' (if they are pointers) and without the '_t' suffix to be consistent with Nim conventions. If an identifier is a Nim keyword the `identifier` notation is used.

This library relies on the header files of your C compiler. The resulting C code will just #include <XYZ.h> and not define the symbols declared here.

Types

DIR {...}{.importc: "DIR", header: "<dirent.h>", incompleteStruct.} = object
A type representing a directory stream. Source Edit
SocketHandle = distinct cint
Source Edit
Time {...}{.importc: "time_t", header: "<time.h>".} = distinct clong
Source Edit
Timespec {...}{.importc: "struct timespec", header: "<time.h>", final, pure.} = object
  tv_sec*: Time              ## Seconds.
  tv_nsec*: clong            ## Nanoseconds.
struct timespec Source Edit
Dirent {...}{.importc: "struct dirent", header: "<dirent.h>", final, pure.} = object
  d_ino*: Ino
  d_off*: Off
  d_reclen*: cushort
  d_type*: int8
  d_name*: array[256, cchar]
dirent_t struct Source Edit
Tflock {...}{.importc: "struct flock", final, pure, header: "<fcntl.h>".} = object
  l_type*: cshort            ## Type of lock; F_RDLCK, F_WRLCK, F_UNLCK.
  l_whence*: cshort          ## Flag for starting offset.
  l_start*: Off              ## Relative offset in bytes.
  l_len*: Off                ## Size; if 0 then until EOF.
  l_pid*: Pid                ## Process ID of the process holding the lock;
                             ## returned with F_GETLK.
flock type Source Edit
Glob {...}{.importc: "glob_t", header: "<glob.h>", final, pure.} = object
  gl_pathc*: csize_t         ## Count of paths matched by pattern.
  gl_pathv*: cstringArray    ## Pointer to a list of matched pathnames.
  gl_offs*: csize_t          ## Slots to reserve at the beginning of gl_pathv.
  gl_flags*: cint
  gl_closedir*: pointer
  gl_readdir*: pointer
  gl_opendir*: pointer
  gl_lstat*: pointer
  gl_stat*: pointer
glob_t Source Edit
Group {...}{.importc: "struct group", header: "<grp.h>", final, pure.} = object
  gr_name*: cstring          ## The name of the group.
  gr_passwd*: cstring
  gr_gid*: Gid               ## Numerical group ID.
  gr_mem*: cstringArray      ## Pointer to a null-terminated array of character
                             ## pointers to member names.
struct group Source Edit
Iconv {...}{.importc: "iconv_t", header: "<iconv.h>".} = pointer
Identifies the conversion from one codeset to another. Source Edit
Lconv {...}{.importc: "struct lconv", header: "<locale.h>", final, pure.} = object
  decimal_point*: cstring
  thousands_sep*: cstring
  grouping*: cstring
  int_curr_symbol*: cstring
  currency_symbol*: cstring
  mon_decimal_point*: cstring
  mon_thousands_sep*: cstring
  mon_grouping*: cstring
  positive_sign*: cstring
  negative_sign*: cstring
  int_frac_digits*: char
  frac_digits*: char
  p_cs_precedes*: char
  p_sep_by_space*: char
  n_cs_precedes*: char
  n_sep_by_space*: char
  p_sign_posn*: char
  n_sign_posn*: char
  int_p_cs_precedes*: char
  int_p_sep_by_space*: char
  int_n_cs_precedes*: char
  int_n_sep_by_space*: char
  int_p_sign_posn*: char
  int_n_sign_posn*: char
Source Edit
Mqd {...}{.importc: "mqd_t", header: "<mqueue.h>".} = cint
Source Edit
MqAttr {...}{.importc: "struct mq_attr", header: "<mqueue.h>", final, pure.} = object
  mq_flags*: clong           ## Message queue flags.
  mq_maxmsg*: clong          ## Maximum number of messages.
  mq_msgsize*: clong         ## Maximum message size.
  mq_curmsgs*: clong         ## Number of messages currently queued.
  pad: array[4, clong]
message queue attribute Source Edit
Passwd {...}{.importc: "struct passwd", header: "<pwd.h>", final, pure.} = object
  pw_name*: cstring          ## User's login name.
  pw_passwd*: cstring
  pw_uid*: Uid               ## Numerical user ID.
  pw_gid*: Gid               ## Numerical group ID.
  pw_gecos*: cstring
  pw_dir*: cstring           ## Initial working directory.
  pw_shell*: cstring         ## Program to use as shell.
struct passwd Source Edit
Blkcnt {...}{.importc: "blkcnt_t", header: "<sys/types.h>".} = clong
used for file block counts Source Edit
Blksize {...}{.importc: "blksize_t", header: "<sys/types.h>".} = clong
used for block sizes Source Edit
Clock {...}{.importc: "clock_t", header: "<sys/types.h>".} = clong
Source Edit
ClockId {...}{.importc: "clockid_t", header: "<sys/types.h>".} = cint
Source Edit
Dev {...}{.importc: "dev_t", header: "<sys/types.h>".} = culong
Source Edit
Fsblkcnt {...}{.importc: "fsblkcnt_t", header: "<sys/types.h>".} = culong
Source Edit
Fsfilcnt {...}{.importc: "fsfilcnt_t", header: "<sys/types.h>".} = culong
Source Edit
Gid {...}{.importc: "gid_t", header: "<sys/types.h>".} = cuint
Source Edit
Id {...}{.importc: "id_t", header: "<sys/types.h>".} = cuint
Source Edit
Ino {...}{.importc: "ino_t", header: "<sys/types.h>".} = culong
Source Edit
Key {...}{.importc: "key_t", header: "<sys/types.h>".} = cint
Source Edit
Mode {...}{.importc: "mode_t", header: "<sys/types.h>".} = uint32
Source Edit
Source Edit
Off {...}{.importc: "off_t", header: "<sys/types.h>".} = clong
Source Edit
Pid {...}{.importc: "pid_t", header: "<sys/types.h>".} = cint
Source Edit
Pthread_attr {...}{.importc: "pthread_attr_t", header: "<sys/types.h>", pure, final.} = object
  abi: array[56 div 8, clong]
Source Edit
Pthread_barrier {...}{.importc: "pthread_barrier_t", header: "<sys/types.h>", pure,
                  final.} = object
  abi: array[32 div 8, clong]
Source Edit
Pthread_barrierattr {...}{.importc: "pthread_barrierattr_t", header: "<sys/types.h>",
                      pure, final.} = object
  abi: array[4 div 4, cint]
Source Edit
Pthread_cond {...}{.importc: "pthread_cond_t", header: "<sys/types.h>", pure, final.} = object
  abi: array[48 div 8, clonglong]
Source Edit
Pthread_condattr {...}{.importc: "pthread_condattr_t", header: "<sys/types.h>", pure,
                   final.} = object
  abi: array[4 div 4, cint]
Source Edit
Pthread_key {...}{.importc: "pthread_key_t", header: "<sys/types.h>".} = cuint
Source Edit
Pthread_mutex {...}{.importc: "pthread_mutex_t", header: "<sys/types.h>", pure, final.} = object
  abi: array[48 div 8, clong]
Source Edit
Pthread_mutexattr {...}{.importc: "pthread_mutexattr_t", header: "<sys/types.h>",
                    pure, final.} = object
  abi: array[4 div 4, cint]
Source Edit
Pthread_once {...}{.importc: "pthread_once_t", header: "<sys/types.h>".} = cint
Source Edit
Pthread_rwlock {...}{.importc: "pthread_rwlock_t", header: "<sys/types.h>", pure,
                 final.} = object
  abi: array[56 div 8, clong]
Source Edit
Pthread_rwlockattr {...}{.importc: "pthread_rwlockattr_t", header: "<sys/types.h>".} = object
  abi: array[8 div 8, clong]
Source Edit
Pthread_spinlock {...}{.importc: "pthread_spinlock_t", header: "<sys/types.h>".} = cint
Source Edit
Pthread {...}{.importc: "pthread_t", header: "<sys/types.h>".} = culong
Source Edit
Suseconds {...}{.importc: "suseconds_t", header: "<sys/types.h>".} = clong
Source Edit
Timer {...}{.importc: "timer_t", header: "<sys/types.h>".} = pointer
Source Edit
Uid {...}{.importc: "uid_t", header: "<sys/types.h>".} = cuint
Source Edit
Useconds {...}{.importc: "useconds_t", header: "<sys/types.h>".} = cuint
Source Edit
Utsname {...}{.importc: "struct utsname", header: "<sys/utsname.h>", final, pure.} = object
  sysname*,                 ## Name of this implementation of the operating system.
  nodename*,                ## Name of this node within the communications
                             ## network to which this node is attached, if any.
  release*,                 ## Current release level of this implementation.
  version*,                 ## Current version level of this release.
  machine*,                 ## Name of the hardware type on which the
                             ## system is running.
  domainname*: array[65, char]
struct utsname Source Edit
Sem {...}{.importc: "sem_t", header: "<semaphore.h>", final, pure.} = object
  abi: array[32 div 8, clong]
Source Edit
Ipc_perm {...}{.importc: "struct ipc_perm", header: "<sys/ipc.h>", final, pure.} = object
  key: Key
  uid*: Uid                  ## Owner's user ID.
  gid*: Gid                  ## Owner's group ID.
  cuid*: Uid                 ## Creator's user ID.
  cgid*: Gid                 ## Creator's group ID.
  mode*: cshort              ## Read/write permission.
  pad1: cshort
  seq1: cshort
  pad2: cshort
  reserved1: culong
  reserved2: culong
struct ipc_perm Source Edit
Stat {...}{.importc: "struct stat", header: "<sys/stat.h>", final, pure.} = object
  st_dev*: Dev               ## Device ID of device containing file.
  st_ino*: Ino               ## File serial number.
  st_nlink*: Nlink           ## Number of hard links to the file.
  st_mode*: Mode             ## Mode of file (see below).
  st_uid*: Uid               ## User ID of file.
  st_gid*: Gid               ## Group ID of file.
  pad0 {...}{.importc: "__pad0".}: cint
  st_rdev*: Dev              ## Device ID (if file is character or block special).
  st_size*: Off              ## For regular files, the file size in bytes.
                             ## For symbolic links, the length in bytes of the
                             ## pathname contained in the symbolic link.
                             ## For a shared memory object, the length in bytes.
                             ## For a typed memory object, the length in bytes.
                             ## For other file types, the use of this field is
                             ## unspecified.
  st_blksize*: Blksize       ## A file system-specific preferred I/O block size
                             ## 
                             ## for this object. In some file system types, this
                             ## 
                             ## may vary from file to file.
  st_blocks*: Blkcnt         ## Number of blocks allocated for this object.
  st_atim*: Timespec         ## Time of last access.
  st_mtim*: Timespec         ## Time of last data modification.
  st_ctim*: Timespec         ## Time of last status change.
struct stat Source Edit
Statvfs {...}{.importc: "struct statvfs", header: "<sys/statvfs.h>", final, pure.} = object
  f_bsize*: culong           ## File system block size.
  f_frsize*: culong          ## Fundamental file system block size.
  f_blocks*: Fsblkcnt        ## Total number of blocks on file system
                             ## in units of f_frsize.
  f_bfree*: Fsblkcnt         ## Total number of free blocks.
  f_bavail*: Fsblkcnt        ## Number of free blocks available to
                             ## non-privileged process.
  f_files*: Fsfilcnt         ## Total number of file serial numbers.
  f_ffree*: Fsfilcnt         ## Total number of free file serial numbers.
  f_favail*: Fsfilcnt        ## Number of file serial numbers available to
                             ## non-privileged process.
  f_fsid*: culong            ## File system ID.
  f_flag*: culong            ## Bit mask of f_flag values.
  f_namemax*: culong         ## Maximum filename length.
  f_spare: array[6, cint]
struct statvfs Source Edit
Tm {...}{.importc: "struct tm", header: "<time.h>", final, pure.} = object
  tm_sec*: cint              ## Seconds [0,60].
  tm_min*: cint              ## Minutes [0,59].
  tm_hour*: cint             ## Hour [0,23].
  tm_mday*: cint             ## Day of month [1,31].
  tm_mon*: cint              ## Month of year [0,11].
  tm_year*: cint             ## Years since 1900.
  tm_wday*: cint             ## Day of week [0,6] (Sunday =0).
  tm_yday*: cint             ## Day of year [0,365].
  tm_isdst*: cint            ## Daylight Savings flag.
  tm_gmtoff*: clong
  tm_zone*: cstring
struct tm Source Edit
Itimerspec {...}{.importc: "struct itimerspec", header: "<time.h>", final, pure.} = object
  it_interval*: Timespec     ## Timer period.
  it_value*: Timespec        ## Timer expiration.
struct itimerspec Source Edit
Sig_atomic {...}{.importc: "sig_atomic_t", header: "<signal.h>".} = cint
Possibly volatile-qualified integer type of an object that can be accessed as an atomic entity, even in the presence of asynchronous interrupts. Source Edit
Sigset {...}{.importc: "sigset_t", header: "<signal.h>", final, pure.} = object
  abi: array[1024 div 64, culong]
Source Edit
SigEvent {...}{.importc: "struct sigevent", header: "<signal.h>", final, pure.} = object
  sigev_value*: SigVal       ## Signal value.
  sigev_signo*: cint         ## Signal number.
  sigev_notify*: cint        ## Notification type.
  sigev_notify_function*: proc (x: SigVal) {...}{.noconv.} ## Notification func.
  sigev_notify_attributes*: ptr Pthread_attr ## Notification attributes.
  abi: array[12, int]
struct sigevent Source Edit
SigVal {...}{.importc: "union sigval", header: "<signal.h>", final, pure.} = object
  sival_ptr*: pointer        ## pointer signal value;
                             ## integer signal value not defined!
struct sigval Source Edit
Sigaction {...}{.importc: "struct sigaction", header: "<signal.h>", final, pure.} = object
  sa_handler*: proc (x: cint) {...}{.noconv.} ## Pointer to a signal-catching
                                         ## function or one of the macros
                                         ## SIG_IGN or SIG_DFL.
  sa_mask*: Sigset           ## Set of signals to be blocked during execution of
                             ## the signal handling function.
  sa_flags*: cint            ## Special flags.
  sa_sigaction*: proc (x: cint; y: ptr SigInfo; z: pointer) {...}{.noconv.}
struct sigaction Source Edit
Stack {...}{.importc: "stack_t", header: "<signal.h>", final, pure.} = object
  ss_sp*: pointer            ## Stack base or pointer.
  ss_size*: int              ## Stack size.
  ss_flags*: cint            ## Flags.
stack_t Source Edit
SigStack {...}{.importc: "struct sigstack", header: "<signal.h>", final, pure.} = object
  ss_onstack*: cint          ## Non-zero when signal stack is in use.
  ss_sp*: pointer            ## Signal stack pointer.
struct sigstack Source Edit
SigInfo {...}{.importc: "siginfo_t", header: "<signal.h>", final, pure.} = object
  si_signo*: cint            ## Signal number.
  si_code*: cint             ## Signal code.
  si_errno*: cint            ## If non-zero, an errno value associated with
                             ## this signal, as defined in <errno.h>.
  si_pid*: Pid               ## Sending process ID.
  si_uid*: Uid               ## Real user ID of sending process.
  si_addr*: pointer          ## Address of faulting instruction.
  si_status*: cint           ## Exit value or signal.
  si_band*: int              ## Band event for SIGPOLL.
  si_value*: SigVal          ## Signal value.
  pad {...}{.importc: "_pad".}: array[128 - 56, uint8]
siginfo_t Source Edit
Nl_item {...}{.importc: "nl_item", header: "<nl_types.h>".} = cint
Source Edit
Nl_catd {...}{.importc: "nl_catd", header: "<nl_types.h>".} = pointer
Source Edit
Sched_param {...}{.importc: "struct sched_param", header: "<sched.h>", final, pure.} = object
  sched_priority*: cint
struct sched_param Source Edit
Timeval {...}{.importc: "struct timeval", header: "<sys/select.h>", final, pure.} = object
  tv_sec*: Time              ## Seconds.
  tv_usec*: Suseconds        ## Microseconds.
struct timeval Source Edit
TFdSet {...}{.importc: "fd_set", header: "<sys/select.h>", final, pure.} = object
  abi: array[1024 div 64, clong]
Source Edit
Mcontext {...}{.importc: "mcontext_t", header: "<ucontext.h>", final, pure.} = object
  gregs: array[23, clonglong]
  fpregs: pointer
  reserved1: array[8, clonglong]
Source Edit
Ucontext {...}{.importc: "ucontext_t", header: "<ucontext.h>", final, pure.} = object
  uc_flags: clong
  uc_link*: ptr Ucontext     ## Pointer to the context that is resumed
                             ## when this context returns.
  uc_stack*: Stack           ## The stack used by this context.
  uc_mcontext*: Mcontext     ## A machine-specific representation of the saved
                             ## 
                             ## context.
  uc_sigmask*: Sigset        ## The set of signals that are blocked when this
                             ## context is active.
ucontext_t Source Edit
Taiocb {...}{.importc: "struct aiocb", header: "<aio.h>", final, pure.} = object
  aio_fildes*: cint          ## File descriptor.
  aio_lio_opcode*: cint      ## Operation to be performed.
  aio_reqprio*: cint         ## Request priority offset.
  aio_buf*: pointer          ## Location of buffer.
  aio_nbytes*: csize_t       ## Length of transfer.
  aio_sigevent*: SigEvent    ## Signal number and value.
  next_prio: pointer
  abs_prio: cint
  policy: cint
  error_Code: cint
  return_value: clong
  aio_offset*: Off           ## File offset.
  reserved: array[32, uint8]
struct aiocb Source Edit
Tposix_spawnattr {...}{.importc: "posix_spawnattr_t", header: "<spawn.h>", final,
                   pure.} = object
  flags: cshort
  pgrp: Pid
  sd: Sigset
  ss: Sigset
  sp: Sched_param
  policy: cint
  pad: array[16, cint]
Source Edit
Tposix_spawn_file_actions {...}{.importc: "posix_spawn_file_actions_t",
                            header: "<spawn.h>", final, pure.} = object
  allocated: cint
  used: cint
  actions: pointer
  pad: array[16, cint]
Source Edit
SockLen {...}{.importc: "socklen_t", header: "<sys/socket.h>".} = cuint
Source Edit
TSa_Family {...}{.importc: "sa_family_t", header: "<sys/socket.h>".} = cushort
Source Edit
SockAddr {...}{.importc: "struct sockaddr", header: "<sys/socket.h>", pure, final.} = object
  sa_family*: TSa_Family     ## Address family.
  sa_data*: array[14, char]  ## Socket address (variable-length data).
struct sockaddr Source Edit
Sockaddr_un {...}{.importc: "struct sockaddr_un", header: "<sys/un.h>", pure, final.} = object
  sun_family*: TSa_Family    ## Address family.
  sun_path*: array[108, char] ## Socket path
struct sockaddr_un Source Edit
Sockaddr_storage {...}{.importc: "struct sockaddr_storage", header: "<sys/socket.h>",
                   pure, final.} = object
  ss_family*: TSa_Family     ## Address family.
  ss_padding: array[126 - 8, char]
  ss_align: clong
struct sockaddr_storage Source Edit
Tif_nameindex {...}{.importc: "struct if_nameindex", final, pure,
                header: "<net/if.h>".} = object
  if_index*: cuint           ## Numeric index of the interface.
  if_name*: cstring          ## Null-terminated name of the interface.
struct if_nameindex Source Edit
IOVec {...}{.importc: "struct iovec", pure, final, header: "<sys/uio.h>".} = object
  iov_base*: pointer         ## Base address of a memory region for input or output.
  iov_len*: csize_t          ## The size of the memory pointed to by iov_base.
struct iovec Source Edit
Tmsghdr {...}{.importc: "struct msghdr", pure, final, header: "<sys/socket.h>".} = object
  msg_name*: pointer         ## Optional address.
  msg_namelen*: SockLen      ## Size of address.
  msg_iov*: ptr IOVec        ## Scatter/gather array.
  msg_iovlen*: csize_t       ## Members in msg_iov.
  msg_control*: pointer      ## Ancillary data; see below.
  msg_controllen*: csize_t   ## Ancillary data buffer len.
  msg_flags*: cint           ## Flags on received message.
struct msghdr Source Edit
Tcmsghdr {...}{.importc: "struct cmsghdr", pure, final, header: "<sys/socket.h>".} = object
  cmsg_len*: csize_t         ## Data byte count, including the cmsghdr.
  cmsg_level*: cint          ## Originating protocol.
  cmsg_type*: cint           ## Protocol-specific type.
struct cmsghdr Source Edit
TLinger {...}{.importc: "struct linger", pure, final, header: "<sys/socket.h>".} = object
  l_onoff*: cint             ## Indicates whether linger option is enabled.
  l_linger*: cint            ## Linger time, in seconds.
struct linger Source Edit
InPort = uint16
Source Edit
InAddrScalar = uint32
Source Edit
InAddrT {...}{.importc: "in_addr_t", pure, final, header: "<netinet/in.h>".} = uint32
Source Edit
InAddr {...}{.importc: "struct in_addr", pure, final, header: "<netinet/in.h>".} = object
  s_addr*: InAddrScalar
struct in_addr Source Edit
Sockaddr_in {...}{.importc: "struct sockaddr_in", pure, final,
              header: "<netinet/in.h>".} = object
  sin_family*: TSa_Family    ## AF_INET.
  sin_port*: InPort          ## Port number.
  sin_addr*: InAddr          ## IP address.
  sin_zero: array[12 - 4, uint8]
struct sockaddr_in Source Edit
In6Addr {...}{.importc: "struct in6_addr", pure, final, header: "<netinet/in.h>".} = object
  s6_addr*: array[0 .. 15, char]
struct in6_addr Source Edit
Sockaddr_in6 {...}{.importc: "struct sockaddr_in6", pure, final,
               header: "<netinet/in.h>".} = object
  sin6_family*: TSa_Family   ## AF_INET6.
  sin6_port*: InPort         ## Port number.
  sin6_flowinfo*: uint32     ## IPv6 traffic class and flow information.
  sin6_addr*: In6Addr        ## IPv6 address.
  sin6_scope_id*: uint32     ## Set of interfaces for a scope.
struct sockaddr_in6 Source Edit
Tipv6_mreq {...}{.importc: "struct ipv6_mreq", pure, final, header: "<netinet/in.h>".} = object
  ipv6mr_multiaddr*: In6Addr ## IPv6 multicast address.
  ipv6mr_interface*: cuint   ## Interface index.
struct ipv6_mreq Source Edit
Hostent {...}{.importc: "struct hostent", pure, final, header: "<netdb.h>".} = object
  h_name*: cstring           ## Official name of the host.
  h_aliases*: cstringArray   ## A pointer to an array of pointers to
                             ## alternative host names, terminated by a
                             ## null pointer.
  h_addrtype*: cint          ## Address type.
  h_length*: cint            ## The length, in bytes, of the address.
  h_addr_list*: cstringArray ## A pointer to an array of pointers to network
                             ## 
                             ## addresses (in network byte order) for the
                             ## host, 
                             ## terminated by a null pointer.
struct hostent Source Edit
Tnetent {...}{.importc: "struct netent", pure, final, header: "<netdb.h>".} = object
  n_name*: cstring           ## Official, fully-qualified (including the
                             ## domain) name of the host.
  n_aliases*: cstringArray   ## A pointer to an array of pointers to
                             ## alternative network names, terminated by a
                             ## null 
                             ## pointer.
  n_addrtype*: cint          ## The address type of the network.
  n_net*: uint32             ## The network number, in host byte order.
struct netent Source Edit
Protoent {...}{.importc: "struct protoent", pure, final, header: "<netdb.h>".} = object
  p_name*: cstring           ## Official name of the protocol.
  p_aliases*: cstringArray   ## A pointer to an array of pointers to
                             ## alternative protocol names, terminated by
                             ## a null 
                             ## pointer.
  p_proto*: cint             ## The protocol number.
struct protoent Source Edit
Servent {...}{.importc: "struct servent", pure, final, header: "<netdb.h>".} = object
  s_name*: cstring           ## Official name of the service.
  s_aliases*: cstringArray   ## A pointer to an array of pointers to
                             ## alternative service names, terminated by
                             ## a null pointer.
  s_port*: cint              ## The port number at which the service
                             ## resides, in network byte order.
  s_proto*: cstring          ## The name of the protocol to use when
                             ## contacting the service.
struct servent Source Edit
AddrInfo {...}{.importc: "struct addrinfo", pure, final, header: "<netdb.h>".} = object
  ai_flags*: cint            ## Input flags.
  ai_family*: cint           ## Address family of socket.
  ai_socktype*: cint         ## Socket type.
  ai_protocol*: cint         ## Protocol of socket.
  ai_addrlen*: SockLen       ## Length of socket address.
  ai_addr*: ptr SockAddr     ## Socket address of socket.
  ai_canonname*: cstring     ## Canonical name of service location.
  ai_next*: ptr AddrInfo     ## Pointer to next in list.
struct addrinfo Source Edit
TPollfd {...}{.importc: "struct pollfd", pure, final, header: "<poll.h>".} = object
  fd*: cint                  ## The following descriptor being polled.
  events*: cshort            ## The input event flags (see below).
  revents*: cshort           ## The output event flags (see below).
struct pollfd Source Edit
Tnfds {...}{.importc: "nfds_t", header: "<poll.h>".} = culong
Source Edit
Rusage {...}{.importc: "struct rusage", header: "<sys/resource.h>", bycopy.} = object
  ru_utime*, ru_stime*: Timeval
  ru_maxrss*, ru_ixrss*, ru_idrss*, ru_isrss*, ru_minflt*, ru_majflt*,
  ru_nswap*, ru_inblock*, ru_oublock*, ru_msgsnd*, ru_msgrcv*, ru_nsignals*,
  ru_nvcsw*, ru_nivcsw*: clong
Source Edit
RLimit {...}{.importc: "struct rlimit", header: "<sys/resource.h>", pure, final.} = object
  rlim_cur*: int
  rlim_max*: int
Source Edit

Vars

errno: cint
error variable Source Edit
h_errno: cint
Source Edit
daylight: cint
Source Edit
timezone: clong
Source Edit
in6addr_any: In6Addr
Source Edit
in6addr_loopback: In6Addr
Source Edit

Consts

MM_NULLLBL = nil
Source Edit
MM_NULLSEV = 0
Source Edit
MM_NULLMC = 0
Source Edit
MM_NULLTXT = nil
Source Edit
MM_NULLACT = nil
Source Edit
MM_NULLTAG = nil
Source Edit
STDERR_FILENO = 2
File number of stderr; Source Edit
STDIN_FILENO = 0
File number of stdin; Source Edit
STDOUT_FILENO = 1
File number of stdout; Source Edit
DT_UNKNOWN = 0
Unknown file type. Source Edit
DT_FIFO = 1
Named pipe, or FIFO. Source Edit
DT_CHR = 2
Character device. Source Edit
DT_DIR = 4
Directory. Source Edit
DT_BLK = 6
Block device. Source Edit
DT_REG = 8
Regular file. Source Edit
DT_LNK = 10
Symbolic link. Source Edit
DT_SOCK = 12
UNIX domain socket. Source Edit
DT_WHT = 14
Source Edit
StatHasNanoseconds = true
Boolean flag that indicates if the system supports nanosecond time resolution in the fields of Stat. Note that the nanosecond based fields (Stat.st_atim, Stat.st_mtim and Stat.st_ctim) can be accessed without checking this flag, because this module defines fallback procs when they are not available. Source Edit
Sockaddr_un_path_length = 108
Source Edit
AIO_ALLDONE = 2'i32
Source Edit
AIO_CANCELED = 0'i32
Source Edit
AIO_NOTCANCELED = 1'i32
Source Edit
LIO_NOP = 2'i32
Source Edit
LIO_NOWAIT = 1'i32
Source Edit
LIO_READ = 0'i32
Source Edit
LIO_WAIT = 0'i32
Source Edit
LIO_WRITE = 1'i32
Source Edit
RTLD_LAZY = 1'i32
Source Edit
RTLD_NOW = 2'i32
Source Edit
RTLD_GLOBAL = 256'i32
Source Edit
RTLD_LOCAL = 0'i32
Source Edit
E2BIG = 7'i32
Source Edit
EACCES = 13'i32
Source Edit
EADDRINUSE = 98'i32
Source Edit
EADDRNOTAVAIL = 99'i32
Source Edit
EAFNOSUPPORT = 97'i32
Source Edit
EAGAIN = 11'i32
Source Edit
EALREADY = 114'i32
Source Edit
EBADF = 9'i32
Source Edit
EBADMSG = 74'i32
Source Edit
EBUSY = 16'i32
Source Edit
ECANCELED = 125'i32
Source Edit
ECHILD = 10'i32
Source Edit
ECONNABORTED = 103'i32
Source Edit
ECONNREFUSED = 111'i32
Source Edit
ECONNRESET = 104'i32
Source Edit
EDEADLK = 35'i32
Source Edit
EDESTADDRREQ = 89'i32
Source Edit
EDOM = 33'i32
Source Edit
EDQUOT = 122'i32
Source Edit
EEXIST = 17'i32
Source Edit
EFAULT = 14'i32
Source Edit
EFBIG = 27'i32
Source Edit
EHOSTUNREACH = 113'i32
Source Edit
EIDRM = 43'i32
Source Edit
EILSEQ = 84'i32
Source Edit
EINPROGRESS = 115'i32
Source Edit
EINTR = 4'i32
Source Edit
EINVAL = 22'i32
Source Edit
EIO = 5'i32
Source Edit
EISCONN = 106'i32
Source Edit
EISDIR = 21'i32
Source Edit
ELOOP = 40'i32
Source Edit
EMFILE = 24'i32
Source Edit
Source Edit
EMSGSIZE = 90'i32
Source Edit
EMULTIHOP = 72'i32
Source Edit
ENAMETOOLONG = 36'i32
Source Edit
ENETDOWN = 100'i32
Source Edit
ENETRESET = 102'i32
Source Edit
ENETUNREACH = 101'i32
Source Edit
ENFILE = 23'i32
Source Edit
ENOBUFS = 105'i32
Source Edit
ENODATA = 61'i32
Source Edit
ENODEV = 19'i32
Source Edit
ENOENT = 2'i32
Source Edit
ENOEXEC = 8'i32
Source Edit
ENOLCK = 37'i32
Source Edit
Source Edit
ENOMEM = 12'i32
Source Edit
ENOMSG = 42'i32
Source Edit
ENOPROTOOPT = 92'i32
Source Edit
ENOSPC = 28'i32
Source Edit
ENOSR = 63'i32
Source Edit
ENOSTR = 60'i32
Source Edit
ENOSYS = 38'i32
Source Edit
ENOTCONN = 107'i32
Source Edit
ENOTDIR = 20'i32
Source Edit
ENOTEMPTY = 39'i32
Source Edit
ENOTSOCK = 88'i32
Source Edit
ENOTSUP = 95'i32
Source Edit
ENOTTY = 25'i32
Source Edit
ENXIO = 6'i32
Source Edit
EOPNOTSUPP = 95'i32
Source Edit
EOVERFLOW = 75'i32
Source Edit
EPERM = 1'i32
Source Edit
EPIPE = 32'i32
Source Edit
EPROTO = 71'i32
Source Edit
EPROTONOSUPPORT = 93'i32
Source Edit
EPROTOTYPE = 91'i32
Source Edit
ERANGE = 34'i32
Source Edit
EROFS = 30'i32
Source Edit
ESPIPE = 29'i32
Source Edit
ESRCH = 3'i32
Source Edit
ESTALE = 116'i32
Source Edit
ETIME = 62'i32
Source Edit
ETIMEDOUT = 110'i32
Source Edit
ETXTBSY = 26'i32
Source Edit
EWOULDBLOCK = 11'i32
Source Edit
EXDEV = 18'i32
Source Edit
F_DUPFD = 0'i32
Source Edit
F_DUPFD_CLOEXEC = 1030'i32
Source Edit
F_GETFD = 1'i32
Source Edit
F_SETFD = 2'i32
Source Edit
F_GETFL = 3'i32
Source Edit
F_SETFL = 4'i32
Source Edit
F_GETLK = 5'i32
Source Edit
F_SETLK = 6'i32
Source Edit
F_SETLKW = 7'i32
Source Edit
F_GETOWN = 9'i32
Source Edit
F_SETOWN = 8'i32
Source Edit
FD_CLOEXEC = 1'i32
Source Edit
F_RDLCK = 0'i32
Source Edit
F_UNLCK = 2'i32
Source Edit
F_WRLCK = 1'i32
Source Edit
O_CREAT = 64'i32
Source Edit
O_EXCL = 128'i32
Source Edit
O_NOCTTY = 256'i32
Source Edit
O_TRUNC = 512'i32
Source Edit
O_APPEND = 1024'i32
Source Edit
O_DSYNC = 4096'i32
Source Edit
O_NONBLOCK = 2048'i32
Source Edit
O_RSYNC = 1052672'i32
Source Edit
O_SYNC = 1052672'i32
Source Edit
O_ACCMODE = 3'i32
Source Edit
O_RDONLY = 0'i32
Source Edit
O_RDWR = 2'i32
Source Edit
O_WRONLY = 1'i32
Source Edit
O_CLOEXEC = 524288'i32
Source Edit
O_DIRECT = 16384'i32
Source Edit
O_PATH = 2097152'i32
Source Edit
O_NOATIME = 262144'i32
Source Edit
O_TMPFILE = 4259840'i32
Source Edit
POSIX_FADV_NORMAL = 0'i32
Source Edit
POSIX_FADV_SEQUENTIAL = 2'i32
Source Edit
POSIX_FADV_RANDOM = 1'i32
Source Edit
POSIX_FADV_WILLNEED = 3'i32
Source Edit
POSIX_FADV_DONTNEED = 4'i32
Source Edit
POSIX_FADV_NOREUSE = 5'i32
Source Edit
FE_DIVBYZERO = 4'i32
Source Edit
FE_INEXACT = 32'i32
Source Edit
FE_INVALID = 1'i32
Source Edit
FE_OVERFLOW = 8'i32
Source Edit
FE_UNDERFLOW = 16'i32
Source Edit
FE_ALL_EXCEPT = 61'i32
Source Edit
FE_DOWNWARD = 1024'i32
Source Edit
FE_TONEAREST = 0'i32
Source Edit
FE_TOWARDZERO = 3072'i32
Source Edit
FE_UPWARD = 2048'i32
Source Edit
FE_DFL_ENV = -1'i32
Source Edit
MM_HARD = 1'i32
Source Edit
MM_SOFT = 2'i32
Source Edit
MM_FIRM = 4'i32
Source Edit
MM_APPL = 8'i32
Source Edit
MM_UTIL = 16'i32
Source Edit
MM_OPSYS = 32'i32
Source Edit
MM_RECOVER = 64'i32
Source Edit
MM_NRECOV = 128'i32
Source Edit
MM_HALT = 1'i32
Source Edit
MM_ERROR = 2'i32
Source Edit
MM_WARNING = 3'i32
Source Edit
MM_INFO = 4'i32
Source Edit
MM_NOSEV = 0'i32
Source Edit
MM_PRINT = 256'i32
Source Edit
MM_CONSOLE = 512'i32
Source Edit
MM_OK = 0'i32
Source Edit
MM_NOTOK = -1'i32
Source Edit
MM_NOMSG = 1'i32
Source Edit
MM_NOCON = 4'i32
Source Edit
FNM_NOMATCH = 1'i32
Source Edit
FNM_PATHNAME = 1'i32
Source Edit
FNM_PERIOD = 4'i32
Source Edit
FNM_NOESCAPE = 2'i32
Source Edit
FNM_NOSYS = -1'i32
Source Edit
FTW_F = 0'i32
Source Edit
FTW_D = 1'i32
Source Edit
FTW_DNR = 2'i32
Source Edit
FTW_DP = 5'i32
Source Edit
FTW_NS = 3'i32
Source Edit
FTW_SL = 4'i32
Source Edit
FTW_SLN = 6'i32
Source Edit
FTW_PHYS = 1'i32
Source Edit
FTW_MOUNT = 2'i32
Source Edit
FTW_DEPTH = 8'i32
Source Edit
FTW_CHDIR = 4'i32
Source Edit
GLOB_APPEND = 32'i32
Source Edit
GLOB_DOOFFS = 8'i32
Source Edit
GLOB_ERR = 1'i32
Source Edit
GLOB_MARK = 2'i32
Source Edit
GLOB_NOCHECK = 16'i32
Source Edit
GLOB_NOESCAPE = 64'i32
Source Edit
GLOB_NOSORT = 4'i32
Source Edit
GLOB_ABORTED = 2'i32
Source Edit
GLOB_NOMATCH = 3'i32
Source Edit
GLOB_NOSPACE = 1'i32
Source Edit
GLOB_NOSYS = 4'i32
Source Edit
CODESET = 14'i32
Source Edit
D_T_FMT = 131112'i32
Source Edit
D_FMT = 131113'i32
Source Edit
T_FMT = 131114'i32
Source Edit
T_FMT_AMPM = 131115'i32
Source Edit
AM_STR = 131110'i32
Source Edit
PM_STR = 131111'i32
Source Edit
DAY_1 = 131079'i32
Source Edit
DAY_2 = 131080'i32
Source Edit
DAY_3 = 131081'i32
Source Edit
DAY_4 = 131082'i32
Source Edit
DAY_5 = 131083'i32
Source Edit
DAY_6 = 131084'i32
Source Edit
DAY_7 = 131085'i32
Source Edit
ABDAY_1 = 131072'i32
Source Edit
ABDAY_2 = 131073'i32
Source Edit
ABDAY_3 = 131074'i32
Source Edit
ABDAY_4 = 131075'i32
Source Edit
ABDAY_5 = 131076'i32
Source Edit
ABDAY_6 = 131077'i32
Source Edit
ABDAY_7 = 131078'i32
Source Edit
MON_1 = 131098'i32
Source Edit
MON_2 = 131099'i32
Source Edit
MON_3 = 131100'i32
Source Edit
MON_4 = 131101'i32
Source Edit
MON_5 = 131102'i32
Source Edit
MON_6 = 131103'i32
Source Edit
MON_7 = 131104'i32
Source Edit
MON_8 = 131105'i32
Source Edit
MON_9 = 131106'i32
Source Edit
MON_10 = 131107'i32
Source Edit
MON_11 = 131108'i32
Source Edit
MON_12 = 131109'i32
Source Edit
ABMON_1 = 131086'i32
Source Edit
ABMON_2 = 131087'i32
Source Edit
ABMON_3 = 131088'i32
Source Edit
ABMON_4 = 131089'i32
Source Edit
ABMON_5 = 131090'i32
Source Edit
ABMON_6 = 131091'i32
Source Edit
ABMON_7 = 131092'i32
Source Edit
ABMON_8 = 131093'i32
Source Edit
ABMON_9 = 131094'i32
Source Edit
ABMON_10 = 131095'i32
Source Edit
ABMON_11 = 131096'i32
Source Edit
ABMON_12 = 131097'i32
Source Edit
ERA = 131116'i32
Source Edit
ERA_D_FMT = 131118'i32
Source Edit
ERA_D_T_FMT = 131120'i32
Source Edit
ERA_T_FMT = 131121'i32
Source Edit
ALT_DIGITS = 131119'i32
Source Edit
RADIXCHAR = 65536'i32
Source Edit
THOUSEP = 65537'i32
Source Edit
YESEXPR = 327680'i32
Source Edit
NOEXPR = 327681'i32
Source Edit
CRNCYSTR = 262159'i32
Source Edit
LC_ALL = 6'i32
Source Edit
LC_COLLATE = 3'i32
Source Edit
LC_CTYPE = 0'i32
Source Edit
LC_MESSAGES = 5'i32
Source Edit
LC_MONETARY = 4'i32
Source Edit
LC_NUMERIC = 1'i32
Source Edit
LC_TIME = 2'i32
Source Edit
IPPORT_RESERVED = 1024'i32
Source Edit
HOST_NOT_FOUND = 1'i32
Source Edit
NO_DATA = 4'i32
Source Edit
NO_RECOVERY = 3'i32
Source Edit
TRY_AGAIN = 2'i32
Source Edit
AI_PASSIVE = 1'i32
Source Edit
AI_CANONNAME = 2'i32
Source Edit
AI_NUMERICHOST = 4'i32
Source Edit
AI_NUMERICSERV = 1024'i32
Source Edit
AI_V4MAPPED = 8'i32
Source Edit
AI_ALL = 16'i32
Source Edit
AI_ADDRCONFIG = 32'i32
Source Edit
NI_NOFQDN = 4'i32
Source Edit
NI_NUMERICHOST = 1'i32
Source Edit
NI_NAMEREQD = 8'i32
Source Edit
NI_NUMERICSERV = 2'i32
Source Edit
NI_DGRAM = 16'i32
Source Edit
EAI_AGAIN = -3'i32
Source Edit
EAI_BADFLAGS = -1'i32
Source Edit
EAI_FAIL = -4'i32
Source Edit
EAI_FAMILY = -6'i32
Source Edit
EAI_MEMORY = -10'i32
Source Edit
EAI_NONAME = -2'i32
Source Edit
EAI_SERVICE = -8'i32
Source Edit
EAI_SOCKTYPE = -7'i32
Source Edit
EAI_SYSTEM = -11'i32
Source Edit
EAI_OVERFLOW = -12'i32
Source Edit
IF_NAMESIZE = 16'i32
Source Edit
IPPROTO_IP = 0'i32
Source Edit
IPPROTO_IPV6 = 41'i32
Source Edit
IPPROTO_ICMP = 1'i32
Source Edit
IPPROTO_ICMPV6 = 58'i32
Source Edit
IPPROTO_RAW = 255'i32
Source Edit
IPPROTO_TCP = 6'i32
Source Edit
IPPROTO_UDP = 17'i32
Source Edit
INADDR_ANY = 0'u
Source Edit
INADDR_LOOPBACK = 2130706433'u
Source Edit
INADDR_BROADCAST = 4294967295'u
Source Edit
INET_ADDRSTRLEN = 16'i32
Source Edit
INET6_ADDRSTRLEN = 46'i32
Source Edit
IPV6_JOIN_GROUP = 20'i32
Source Edit
IPV6_LEAVE_GROUP = 21'i32
Source Edit
IPV6_MULTICAST_HOPS = 18'i32
Source Edit
IPV6_MULTICAST_IF = 17'i32
Source Edit
IPV6_MULTICAST_LOOP = 19'i32
Source Edit
IPV6_UNICAST_HOPS = 16'i32
Source Edit
IPV6_V6ONLY = 26'i32
Source Edit
TCP_NODELAY = 1'i32
Source Edit
NL_SETD = 1'i32
Source Edit
NL_CAT_LOCALE = 1'i32
Source Edit
POLLIN = 1'i16
Source Edit
POLLRDNORM = 64'i16
Source Edit
POLLRDBAND = 128'i16
Source Edit
POLLPRI = 2'i16
Source Edit
POLLOUT = 4'i16
Source Edit
POLLWRNORM = 256'i16
Source Edit
POLLWRBAND = 512'i16
Source Edit
POLLERR = 8'i16
Source Edit
POLLHUP = 16'i16
Source Edit
POLLNVAL = 32'i16
Source Edit
PTHREAD_BARRIER_SERIAL_THREAD = -1'i32
Source Edit
PTHREAD_CANCEL_ASYNCHRONOUS = 1'i32
Source Edit
PTHREAD_CANCEL_ENABLE = 0'i32
Source Edit
PTHREAD_CANCEL_DEFERRED = 0'i32
Source Edit
PTHREAD_CANCEL_DISABLE = 1'i32
Source Edit
PTHREAD_CREATE_DETACHED = 1'i32
Source Edit
PTHREAD_CREATE_JOINABLE = 0'i32
Source Edit
PTHREAD_EXPLICIT_SCHED = 1'i32
Source Edit
PTHREAD_INHERIT_SCHED = 0'i32
Source Edit
PTHREAD_PROCESS_SHARED = 1'i32
Source Edit
PTHREAD_PROCESS_PRIVATE = 0'i32
Source Edit
PTHREAD_SCOPE_PROCESS = 1'i32
Source Edit
PTHREAD_SCOPE_SYSTEM = 0'i32
Source Edit
SCHED_FIFO = 1'i32
Source Edit
SCHED_RR = 2'i32
Source Edit
SCHED_OTHER = 0'i32
Source Edit
SEM_FAILED = nil
Source Edit
SIGEV_NONE = 1'i32
Source Edit
SIGEV_SIGNAL = 0'i32
Source Edit
SIGEV_THREAD = 2'i32
Source Edit
SIGABRT = 6'i32
Source Edit
SIGALRM = 14'i32
Source Edit
SIGBUS = 7'i32
Source Edit
SIGCHLD = 17'i32
Source Edit
SIGCONT = 18'i32
Source Edit
SIGFPE = 8'i32
Source Edit
SIGHUP = 1'i32
Source Edit
SIGILL = 4'i32
Source Edit
SIGINT = 2'i32
Source Edit
SIGKILL = 9'i32
Source Edit
SIGPIPE = 13'i32
Source Edit
SIGQUIT = 3'i32
Source Edit
SIGSEGV = 11'i32
Source Edit
SIGSTOP = 19'i32
Source Edit
SIGTERM = 15'i32
Source Edit
SIGTSTP = 20'i32
Source Edit
SIGTTIN = 21'i32
Source Edit
SIGTTOU = 22'i32
Source Edit
SIGUSR1 = 10'i32
Source Edit
SIGUSR2 = 12'i32
Source Edit
SIGPOLL = 29'i32
Source Edit
SIGPROF = 27'i32
Source Edit
SIGSYS = 31'i32
Source Edit
SIGTRAP = 5'i32
Source Edit
SIGURG = 23'i32
Source Edit
SIGVTALRM = 26'i32
Source Edit
SIGXCPU = 24'i32
Source Edit
SIGXFSZ = 25'i32
Source Edit
SA_NOCLDSTOP = 1'i32
Source Edit
SIG_BLOCK = 0'i32
Source Edit
SIG_UNBLOCK = 1'i32
Source Edit
SIG_SETMASK = 2'i32
Source Edit
SA_ONSTACK = 134217728'i32
Source Edit
SA_RESETHAND = -2147483648'i32
Source Edit
SA_RESTART = 268435456'i32
Source Edit
SA_SIGINFO = 4'i32
Source Edit
SA_NOCLDWAIT = 2'i32
Source Edit
SA_NODEFER = 1073741824'i32
Source Edit
SS_ONSTACK = 1'i32
Source Edit
SS_DISABLE = 2'i32
Source Edit
MINSIGSTKSZ = 2048'i32
Source Edit
SIGSTKSZ = 8192'i32
Source Edit
SIG_HOLD = 2
Source Edit
SIG_DFL = 0
Source Edit
SIG_ERR = -1
Source Edit
SIG_IGN = 1
Source Edit
IPC_CREAT = 512'i32
Source Edit
IPC_EXCL = 1024'i32
Source Edit
IPC_NOWAIT = 2048'i32
Source Edit
IPC_PRIVATE = 0'i32
Source Edit
IPC_RMID = 0'i32
Source Edit
IPC_SET = 1'i32
Source Edit
IPC_STAT = 2'i32
Source Edit
PROT_READ = 1'i32
Source Edit
PROT_WRITE = 2'i32
Source Edit
PROT_EXEC = 4'i32
Source Edit
PROT_NONE = 0'i32
Source Edit
MAP_ANONYMOUS = 32'i32
Source Edit
MAP_FIXED_NOREPLACE = 1048576'i32
Source Edit
MAP_NORESERVE = 16384'i32
Source Edit
MAP_SHARED = 1'i32
Source Edit
MAP_PRIVATE = 2'i32
Source Edit
MAP_FIXED = 16'i32
Source Edit
MS_ASYNC = 1'i32
Source Edit
MS_SYNC = 4'i32
Source Edit
MS_INVALIDATE = 2'i32
Source Edit
MCL_CURRENT = 1'i32
Source Edit
MCL_FUTURE = 2'i32
Source Edit
MAP_FAILED = 0xFFFFFFFF
Source Edit
POSIX_MADV_NORMAL = 0'i32
Source Edit
POSIX_MADV_SEQUENTIAL = 2'i32
Source Edit
POSIX_MADV_RANDOM = 1'i32
Source Edit
POSIX_MADV_WILLNEED = 3'i32
Source Edit
POSIX_MADV_DONTNEED = 4'i32
Source Edit
MAP_POPULATE = 32768'i32
Source Edit
RLIMIT_NOFILE = 7'i32
Source Edit
FD_SETSIZE = 1024'i32
Source Edit
MSG_CTRUNC = 8'i32
Source Edit
MSG_DONTROUTE = 4'i32
Source Edit
MSG_EOR = 128'i32
Source Edit
MSG_OOB = 1'i32
Source Edit
SCM_RIGHTS = 1'i32
Source Edit
SO_ACCEPTCONN = 30'i32
Source Edit
SO_BROADCAST = 6'i32
Source Edit
SO_DEBUG = 1'i32
Source Edit
SO_DONTROUTE = 5'i32
Source Edit
SO_ERROR = 4'i32
Source Edit
SO_KEEPALIVE = 9'i32
Source Edit
SO_LINGER = 13'i32
Source Edit
SO_OOBINLINE = 10'i32
Source Edit
SO_RCVBUF = 8'i32
Source Edit
SO_RCVLOWAT = 18'i32
Source Edit
SO_RCVTIMEO = 20'i32
Source Edit
SO_REUSEADDR = 2'i32
Source Edit
SO_SNDBUF = 7'i32
Source Edit
SO_SNDLOWAT = 19'i32
Source Edit
SO_SNDTIMEO = 21'i32
Source Edit
SO_TYPE = 3'i32
Source Edit
SOCK_DGRAM = 2'i32
Source Edit
SOCK_RAW = 3'i32
Source Edit
SOCK_SEQPACKET = 5'i32
Source Edit
SOCK_STREAM = 1'i32
Source Edit
SOCK_CLOEXEC = 524288'i32
Source Edit
SOL_SOCKET = 1'i32
Source Edit
SOMAXCONN = 4096'i32
Source Edit
SO_REUSEPORT = 15'i32
Source Edit
MSG_NOSIGNAL = 16384'i32
Source Edit
MSG_PEEK = 2'i32
Source Edit
MSG_TRUNC = 32'i32
Source Edit
MSG_WAITALL = 256'i32
Source Edit
AF_INET = 2'i32
Source Edit
AF_INET6 = 10'i32
Source Edit
AF_UNIX = 1'i32
Source Edit
AF_UNSPEC = 0'i32
Source Edit
SHUT_RD = 0'i32
Source Edit
SHUT_RDWR = 2'i32
Source Edit
SHUT_WR = 1'i32
Source Edit
S_IFBLK = 24576'i32
Source Edit
S_IFCHR = 8192'i32
Source Edit
S_IFDIR = 16384'i32
Source Edit
S_IFIFO = 4096'i32
Source Edit
S_IFLNK = 40960'i32
Source Edit
S_IFMT = 61440'i32
Source Edit
S_IFREG = 32768'i32
Source Edit
S_IFSOCK = 49152'i32
Source Edit
S_IRGRP = 32'i32
Source Edit
S_IROTH = 4'i32
Source Edit
S_IRUSR = 256'i32
Source Edit
S_IRWXG = 56'i32
Source Edit
S_IRWXO = 7'i32
Source Edit
S_IRWXU = 448'i32
Source Edit
S_ISGID = 1024'i32
Source Edit
S_ISUID = 2048'i32
Source Edit
S_ISVTX = 512'i32
Source Edit
S_IWGRP = 16'i32
Source Edit
S_IWOTH = 2'i32
Source Edit
S_IWUSR = 128'i32
Source Edit
S_IXGRP = 8'i32
Source Edit
S_IXOTH = 1'i32
Source Edit
S_IXUSR = 64'i32
Source Edit
ST_RDONLY = 1'i32
Source Edit
ST_NOSUID = 2'i32
Source Edit
WNOHANG = 1'i32
Source Edit
WUNTRACED = 2'i32
Source Edit
WEXITED = 4'i32
Source Edit
WSTOPPED = 2'i32
Source Edit
WCONTINUED = 8'i32
Source Edit
WNOWAIT = 16777216'i32
Source Edit
POSIX_SPAWN_RESETIDS = 1'i32
Source Edit
POSIX_SPAWN_SETPGROUP = 2'i32
Source Edit
POSIX_SPAWN_SETSCHEDPARAM = 16'i32
Source Edit
POSIX_SPAWN_SETSCHEDULER = 32'i32
Source Edit
POSIX_SPAWN_SETSIGDEF = 4'i32
Source Edit
POSIX_SPAWN_SETSIGMASK = 8'i32
Source Edit
POSIX_SPAWN_USEVFORK = 64'i32
Source Edit
IOFBF = 0'i32
Source Edit
IONBF = 2'i32
Source Edit
CLOCKS_PER_SEC = 1000000
Source Edit
CLOCK_PROCESS_CPUTIME_ID = 2'i32
Source Edit
CLOCK_THREAD_CPUTIME_ID = 3'i32
Source Edit
CLOCK_REALTIME = 0'i32
Source Edit
TIMER_ABSTIME = 1'i32
Source Edit
CLOCK_MONOTONIC = 1'i32
Source Edit
POSIX_ASYNC_IO = 1'i32
Source Edit
F_OK = 0'i32
Source Edit
R_OK = 4'i32
Source Edit
W_OK = 2'i32
Source Edit
X_OK = 1'i32
Source Edit
CS_PATH = 0'i32
Source Edit
CS_POSIX_V6_ILP32_OFF32_CFLAGS = 1116'i32
Source Edit
CS_POSIX_V6_ILP32_OFF32_LDFLAGS = 1117'i32
Source Edit
CS_POSIX_V6_ILP32_OFF32_LIBS = 1118'i32
Source Edit
CS_POSIX_V6_ILP32_OFFBIG_CFLAGS = 1120'i32
Source Edit
CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS = 1121'i32
Source Edit
CS_POSIX_V6_ILP32_OFFBIG_LIBS = 1122'i32
Source Edit
CS_POSIX_V6_LP64_OFF64_CFLAGS = 1124'i32
Source Edit
CS_POSIX_V6_LP64_OFF64_LDFLAGS = 1125'i32
Source Edit
CS_POSIX_V6_LP64_OFF64_LIBS = 1126'i32
Source Edit
CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS = 1128'i32
Source Edit
CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS = 1129'i32
Source Edit
CS_POSIX_V6_LPBIG_OFFBIG_LIBS = 1130'i32
Source Edit
CS_POSIX_V6_WIDTH_RESTRICTED_ENVS = 1'i32
Source Edit
F_LOCK = 1'i32
Source Edit
F_TEST = 3'i32
Source Edit
F_TLOCK = 2'i32
Source Edit
F_ULOCK = 0'i32
Source Edit
Source Edit
PC_ALLOC_SIZE_MIN = 18'i32
Source Edit
PC_ASYNC_IO = 10'i32
Source Edit
PC_CHOWN_RESTRICTED = 6'i32
Source Edit
PC_FILESIZEBITS = 13'i32
Source Edit
Source Edit
PC_MAX_CANON = 1'i32
Source Edit
PC_MAX_INPUT = 2'i32
Source Edit
PC_NAME_MAX = 3'i32
Source Edit
PC_NO_TRUNC = 7'i32
Source Edit
PC_PATH_MAX = 4'i32
Source Edit
PC_PIPE_BUF = 5'i32
Source Edit
PC_PRIO_IO = 11'i32
Source Edit
PC_REC_INCR_XFER_SIZE = 14'i32
Source Edit
PC_REC_MIN_XFER_SIZE = 16'i32
Source Edit
PC_REC_XFER_ALIGN = 17'i32
Source Edit
Source Edit
PC_SYNC_IO = 9'i32
Source Edit
PC_VDISABLE = 8'i32
Source Edit
SC_2_C_BIND = 47'i32
Source Edit
SC_2_C_DEV = 48'i32
Source Edit
SC_2_CHAR_TERM = 95'i32
Source Edit
SC_2_FORT_DEV = 49'i32
Source Edit
SC_2_FORT_RUN = 50'i32
Source Edit
SC_2_LOCALEDEF = 52'i32
Source Edit
SC_2_PBS = 168'i32
Source Edit
SC_2_PBS_ACCOUNTING = 169'i32
Source Edit
SC_2_PBS_CHECKPOINT = 175'i32
Source Edit
SC_2_PBS_LOCATE = 170'i32
Source Edit
SC_2_PBS_MESSAGE = 171'i32
Source Edit
SC_2_PBS_TRACK = 172'i32
Source Edit
SC_2_SW_DEV = 51'i32
Source Edit
SC_2_UPE = 97'i32
Source Edit
SC_2_VERSION = 46'i32
Source Edit
SC_ADVISORY_INFO = 132'i32
Source Edit
SC_AIO_LISTIO_MAX = 23'i32
Source Edit
SC_AIO_MAX = 24'i32
Source Edit
SC_AIO_PRIO_DELTA_MAX = 25'i32
Source Edit
SC_ARG_MAX = 0'i32
Source Edit
SC_ASYNCHRONOUS_IO = 12'i32
Source Edit
SC_ATEXIT_MAX = 87'i32
Source Edit
SC_BARRIERS = 133'i32
Source Edit
SC_BC_BASE_MAX = 36'i32
Source Edit
SC_BC_DIM_MAX = 37'i32
Source Edit
SC_BC_SCALE_MAX = 38'i32
Source Edit
SC_BC_STRING_MAX = 39'i32
Source Edit
SC_CHILD_MAX = 1'i32
Source Edit
SC_CLK_TCK = 2'i32
Source Edit
SC_CLOCK_SELECTION = 137'i32
Source Edit
SC_COLL_WEIGHTS_MAX = 40'i32
Source Edit
SC_CPUTIME = 138'i32
Source Edit
SC_DELAYTIMER_MAX = 26'i32
Source Edit
SC_EXPR_NEST_MAX = 42'i32
Source Edit
SC_FSYNC = 15'i32
Source Edit
SC_GETGR_R_SIZE_MAX = 69'i32
Source Edit
SC_GETPW_R_SIZE_MAX = 70'i32
Source Edit
SC_HOST_NAME_MAX = 180'i32
Source Edit
SC_IOV_MAX = 60'i32
Source Edit
SC_IPV6 = 235'i32
Source Edit
SC_JOB_CONTROL = 7'i32
Source Edit
SC_LINE_MAX = 43'i32
Source Edit
SC_LOGIN_NAME_MAX = 71'i32
Source Edit
SC_MAPPED_FILES = 16'i32
Source Edit
SC_MEMLOCK = 17'i32
Source Edit
SC_MEMLOCK_RANGE = 18'i32
Source Edit
SC_MEMORY_PROTECTION = 19'i32
Source Edit
SC_MESSAGE_PASSING = 20'i32
Source Edit
SC_MONOTONIC_CLOCK = 149'i32
Source Edit
SC_MQ_OPEN_MAX = 27'i32
Source Edit
SC_MQ_PRIO_MAX = 28'i32
Source Edit
SC_NGROUPS_MAX = 3'i32
Source Edit
SC_OPEN_MAX = 4'i32
Source Edit
SC_PAGESIZE = 30'i32
Source Edit
SC_PRIORITIZED_IO = 13'i32
Source Edit
SC_PRIORITY_SCHEDULING = 10'i32
Source Edit
SC_RAW_SOCKETS = 236'i32
Source Edit
SC_RE_DUP_MAX = 44'i32
Source Edit
SC_READER_WRITER_LOCKS = 153'i32
Source Edit
SC_REALTIME_SIGNALS = 9'i32
Source Edit
SC_REGEXP = 155'i32
Source Edit
SC_RTSIG_MAX = 31'i32
Source Edit
SC_SAVED_IDS = 8'i32
Source Edit
SC_SEM_NSEMS_MAX = 32'i32
Source Edit
SC_SEM_VALUE_MAX = 33'i32
Source Edit
SC_SEMAPHORES = 21'i32
Source Edit
SC_SHARED_MEMORY_OBJECTS = 22'i32
Source Edit
SC_SHELL = 157'i32
Source Edit
SC_SIGQUEUE_MAX = 34'i32
Source Edit
SC_SPAWN = 159'i32
Source Edit
SC_SPIN_LOCKS = 154'i32
Source Edit
SC_SPORADIC_SERVER = 160'i32
Source Edit
SC_SS_REPL_MAX = 241'i32
Source Edit
SC_STREAM_MAX = 5'i32
Source Edit
SC_SYMLOOP_MAX = 173'i32
Source Edit
SC_SYNCHRONIZED_IO = 14'i32
Source Edit
SC_THREAD_ATTR_STACKADDR = 77'i32
Source Edit
SC_THREAD_ATTR_STACKSIZE = 78'i32
Source Edit
SC_THREAD_CPUTIME = 139'i32
Source Edit
SC_THREAD_DESTRUCTOR_ITERATIONS = 73'i32
Source Edit
SC_THREAD_KEYS_MAX = 74'i32
Source Edit
SC_THREAD_PRIO_INHERIT = 80'i32
Source Edit
SC_THREAD_PRIO_PROTECT = 81'i32
Source Edit
SC_THREAD_PRIORITY_SCHEDULING = 79'i32
Source Edit
SC_THREAD_PROCESS_SHARED = 82'i32
Source Edit
SC_THREAD_SAFE_FUNCTIONS = 68'i32
Source Edit
SC_THREAD_SPORADIC_SERVER = 161'i32
Source Edit
SC_THREAD_STACK_MIN = 75'i32
Source Edit
SC_THREAD_THREADS_MAX = 76'i32
Source Edit
SC_THREADS = 67'i32
Source Edit
SC_TIMEOUTS = 164'i32
Source Edit
SC_TIMER_MAX = 35'i32
Source Edit
SC_TIMERS = 11'i32
Source Edit
SC_TRACE = 181'i32
Source Edit
SC_TRACE_EVENT_FILTER = 182'i32
Source Edit
SC_TRACE_EVENT_NAME_MAX = 242'i32
Source Edit
SC_TRACE_INHERIT = 183'i32
Source Edit
SC_TRACE_LOG = 184'i32
Source Edit
SC_TRACE_NAME_MAX = 243'i32
Source Edit
SC_TRACE_SYS_MAX = 244'i32
Source Edit
SC_TRACE_USER_EVENT_MAX = 245'i32
Source Edit
SC_TTY_NAME_MAX = 72'i32
Source Edit
SC_TYPED_MEMORY_OBJECTS = 165'i32
Source Edit
SC_TZNAME_MAX = 6'i32
Source Edit
SC_V6_ILP32_OFF32 = 176'i32
Source Edit
SC_V6_ILP32_OFFBIG = 177'i32
Source Edit
SC_V6_LP64_OFF64 = 178'i32
Source Edit
SC_V6_LPBIG_OFFBIG = 179'i32
Source Edit
SC_VERSION = 29'i32
Source Edit
SC_XBS5_ILP32_OFF32 = 125'i32
Source Edit
SC_XBS5_ILP32_OFFBIG = 126'i32
Source Edit
SC_XBS5_LP64_OFF64 = 127'i32
Source Edit
SC_XBS5_LPBIG_OFFBIG = 128'i32
Source Edit
SC_XOPEN_CRYPT = 92'i32
Source Edit
SC_XOPEN_ENH_I18N = 93'i32
Source Edit
SC_XOPEN_LEGACY = 129'i32
Source Edit
SC_XOPEN_REALTIME = 130'i32
Source Edit
SC_XOPEN_REALTIME_THREADS = 131'i32
Source Edit
SC_XOPEN_SHM = 94'i32
Source Edit
SC_XOPEN_STREAMS = 246'i32
Source Edit
SC_XOPEN_UNIX = 91'i32
Source Edit
SC_XOPEN_VERSION = 89'i32
Source Edit
SC_NPROCESSORS_ONLN = 84'i32
Source Edit
SEEK_SET = 0'i32
Source Edit
SEEK_CUR = 1'i32
Source Edit
SEEK_END = 2'i32
Source Edit
RUSAGE_SELF = 0'i32
Source Edit
RUSAGE_CHILDREN = -1'i32
Source Edit
RUSAGE_THREAD = 1'i32
Source Edit
INVALID_SOCKET = -1'i32
Source Edit

Procs

proc WEXITSTATUS(s: cint): cint {...}{.raises: [], tags: [].}
Source Edit
proc WTERMSIG(s: cint): cint {...}{.raises: [], tags: [].}
Source Edit
proc WSTOPSIG(s: cint): cint {...}{.raises: [], tags: [].}
Source Edit
proc WIFEXITED(s: cint): bool {...}{.raises: [], tags: [].}
Source Edit
proc WIFSIGNALED(s: cint): bool {...}{.raises: [], tags: [].}
Source Edit
proc WIFSTOPPED(s: cint): bool {...}{.raises: [], tags: [].}
Source Edit
proc WIFCONTINUED(s: cint): bool {...}{.raises: [], tags: [].}
Source Edit
proc st_atime(s: Stat): Time {...}{.inline, raises: [], tags: [].}
Second-granularity time of last access. Source Edit
proc st_mtime(s: Stat): Time {...}{.inline, raises: [], tags: [].}
Second-granularity time of last data modification. Source Edit
proc st_ctime(s: Stat): Time {...}{.inline, raises: [], tags: [].}
Second-granularity time of last status change. Source Edit
proc aio_cancel(a1: cint; a2: ptr Taiocb): cint {...}{.importc, header: "<aio.h>".}
Source Edit
proc aio_error(a1: ptr Taiocb): cint {...}{.importc, header: "<aio.h>".}
Source Edit
proc aio_fsync(a1: cint; a2: ptr Taiocb): cint {...}{.importc, header: "<aio.h>".}
Source Edit
proc aio_read(a1: ptr Taiocb): cint {...}{.importc, header: "<aio.h>".}
Source Edit
proc aio_return(a1: ptr Taiocb): int {...}{.importc, header: "<aio.h>".}
Source Edit
proc aio_suspend(a1: ptr ptr Taiocb; a2: cint; a3: ptr Timespec): cint {...}{.
    importc, header: "<aio.h>".}
Source Edit
proc aio_write(a1: ptr Taiocb): cint {...}{.importc, header: "<aio.h>".}
Source Edit
proc lio_listio(a1: cint; a2: ptr ptr Taiocb; a3: cint; a4: ptr SigEvent): cint {...}{.
    importc, header: "<aio.h>".}
Source Edit
proc htonl(a1: uint32): uint32 {...}{.importc, header: "<arpa/inet.h>".}
Source Edit
proc htons(a1: uint16): uint16 {...}{.importc, header: "<arpa/inet.h>".}
Source Edit
proc ntohl(a1: uint32): uint32 {...}{.importc, header: "<arpa/inet.h>".}
Source Edit
proc ntohs(a1: uint16): uint16 {...}{.importc, header: "<arpa/inet.h>".}
Source Edit
proc inet_addr(a1: cstring): InAddrT {...}{.importc, header: "<arpa/inet.h>".}
Source Edit
proc inet_ntoa(a1: InAddr): cstring {...}{.importc, header: "<arpa/inet.h>".}
Source Edit
proc inet_ntop(a1: cint; a2: pointer; a3: cstring; a4: int32): cstring {...}{.
    importc: "(char *)$1", header: "<arpa/inet.h>".}
Source Edit
proc inet_pton(a1: cint; a2: cstring; a3: pointer): cint {...}{.importc,
    header: "<arpa/inet.h>".}
Source Edit
proc IN6ADDR_ANY_INIT(): In6Addr {...}{.importc, header: "<netinet/in.h>".}
Source Edit
proc IN6ADDR_LOOPBACK_INIT(): In6Addr {...}{.importc, header: "<netinet/in.h>".}
Source Edit
proc closedir(a1: ptr DIR): cint {...}{.importc, header: "<dirent.h>".}
Source Edit
proc opendir(a1: cstring): ptr DIR {...}{.importc, header: "<dirent.h>", sideEffect.}
Source Edit
proc readdir(a1: ptr DIR): ptr Dirent {...}{.importc, header: "<dirent.h>",
                                        sideEffect.}
Source Edit
proc readdir_r(a1: ptr DIR; a2: ptr Dirent; a3: ptr ptr Dirent): cint {...}{.importc,
    header: "<dirent.h>", sideEffect.}
Source Edit
proc rewinddir(a1: ptr DIR) {...}{.importc, header: "<dirent.h>".}
Source Edit
proc seekdir(a1: ptr DIR; a2: int) {...}{.importc, header: "<dirent.h>".}
Source Edit
proc telldir(a1: ptr DIR): int {...}{.importc, header: "<dirent.h>".}
Source Edit
proc dlclose(a1: pointer): cint {...}{.importc, header: "<dlfcn.h>", sideEffect.}
Source Edit
proc dlerror(): cstring {...}{.importc, header: "<dlfcn.h>", sideEffect.}
Source Edit
proc dlopen(a1: cstring; a2: cint): pointer {...}{.importc, header: "<dlfcn.h>",
    sideEffect.}
Source Edit
proc dlsym(a1: pointer; a2: cstring): pointer {...}{.importc, header: "<dlfcn.h>",
    sideEffect.}
Source Edit
proc creat(a1: cstring; a2: Mode): cint {...}{.importc, header: "<fcntl.h>",
    sideEffect.}
Source Edit
proc fcntl(a1: cint | SocketHandle; a2: cint): cint {...}{.varargs, importc,
    header: "<fcntl.h>", sideEffect.}
Source Edit
proc open(a1: cstring; a2: cint): cint {...}{.varargs, importc, header: "<fcntl.h>",
    sideEffect.}
Source Edit
proc posix_fadvise(a1: cint; a2, a3: Off; a4: cint): cint {...}{.importc,
    header: "<fcntl.h>".}
Source Edit
proc posix_fallocate(a1: cint; a2, a3: Off): cint {...}{.importc, header: "<fcntl.h>".}
Source Edit
proc fmtmsg(a1: int; a2: cstring; a3: cint; a4, a5, a6: cstring): cint {...}{.
    importc, header: "<fmtmsg.h>".}
Source Edit
proc fnmatch(a1, a2: cstring; a3: cint): cint {...}{.importc, header: "<fnmatch.h>".}
Source Edit
proc ftw(a1: cstring;
         a2: proc (x1: cstring; x2: ptr Stat; x3: cint): cint {...}{.noconv.};
         a3: cint): cint {...}{.importc, header: "<ftw.h>".}
Source Edit
proc glob(a1: cstring; a2: cint;
          a3: proc (x1: cstring; x2: cint): cint {...}{.noconv.}; a4: ptr Glob): cint {...}{.
    importc, header: "<glob.h>", sideEffect.}
Filename globbing. Use os.walkPattern() and similar. Source Edit
proc globfree(a1: ptr Glob) {...}{.importc, header: "<glob.h>".}
Source Edit
proc getgrgid(a1: Gid): ptr Group {...}{.importc, header: "<grp.h>".}
Source Edit
proc getgrnam(a1: cstring): ptr Group {...}{.importc, header: "<grp.h>".}
Source Edit
proc getgrgid_r(a1: Gid; a2: ptr Group; a3: cstring; a4: int; a5: ptr ptr Group): cint {...}{.
    importc, header: "<grp.h>".}
Source Edit
proc getgrnam_r(a1: cstring; a2: ptr Group; a3: cstring; a4: int;
                a5: ptr ptr Group): cint {...}{.importc, header: "<grp.h>".}
Source Edit
proc getgrent(): ptr Group {...}{.importc, header: "<grp.h>".}
Source Edit
proc endgrent() {...}{.importc, header: "<grp.h>".}
Source Edit
proc setgrent() {...}{.importc, header: "<grp.h>".}
Source Edit
proc iconv_open(a1, a2: cstring): Iconv {...}{.importc, header: "<iconv.h>".}
Source Edit
proc iconv(a1: Iconv; a2: var cstring; a3: var int; a4: var cstring; a5: var int): int {...}{.
    importc, header: "<iconv.h>".}
Source Edit
proc iconv_close(a1: Iconv): cint {...}{.importc, header: "<iconv.h>".}
Source Edit
proc nl_langinfo(a1: Nl_item): cstring {...}{.importc, header: "<langinfo.h>".}
Source Edit
proc basename(a1: cstring): cstring {...}{.importc, header: "<libgen.h>".}
Source Edit
proc dirname(a1: cstring): cstring {...}{.importc, header: "<libgen.h>".}
Source Edit
proc localeconv(): ptr Lconv {...}{.importc, header: "<locale.h>".}
Source Edit
proc setlocale(a1: cint; a2: cstring): cstring {...}{.importc, header: "<locale.h>",
    sideEffect.}
Source Edit
proc strfmon(a1: cstring; a2: int; a3: cstring): int {...}{.varargs, importc,
    header: "<monetary.h>".}
Source Edit
proc mq_close(a1: Mqd): cint {...}{.importc, header: "<mqueue.h>".}
Source Edit
proc mq_getattr(a1: Mqd; a2: ptr MqAttr): cint {...}{.importc, header: "<mqueue.h>".}
Source Edit
proc mq_notify(a1: Mqd; a2: ptr SigEvent): cint {...}{.importc, header: "<mqueue.h>".}
Source Edit
proc mq_open(a1: cstring; a2: cint): Mqd {...}{.varargs, importc,
    header: "<mqueue.h>".}
Source Edit
proc mq_receive(a1: Mqd; a2: cstring; a3: int; a4: var int): int {...}{.importc,
    header: "<mqueue.h>".}
Source Edit
proc mq_send(a1: Mqd; a2: cstring; a3: int; a4: int): cint {...}{.importc,
    header: "<mqueue.h>".}
Source Edit
proc mq_setattr(a1: Mqd; a2, a3: ptr MqAttr): cint {...}{.importc,
    header: "<mqueue.h>".}
Source Edit
proc mq_timedreceive(a1: Mqd; a2: cstring; a3: int; a4: int; a5: ptr Timespec): int {...}{.
    importc, header: "<mqueue.h>".}
Source Edit
proc mq_timedsend(a1: Mqd; a2: cstring; a3: int; a4: int; a5: ptr Timespec): cint {...}{.
    importc, header: "<mqueue.h>".}
Source Edit
proc mq_unlink(a1: cstring): cint {...}{.importc, header: "<mqueue.h>".}
Source Edit
proc getpwnam(a1: cstring): ptr Passwd {...}{.importc, header: "<pwd.h>".}
Source Edit
proc getpwuid(a1: Uid): ptr Passwd {...}{.importc, header: "<pwd.h>".}
Source Edit
proc getpwnam_r(a1: cstring; a2: ptr Passwd; a3: cstring; a4: int;
                a5: ptr ptr Passwd): cint {...}{.importc, header: "<pwd.h>".}
Source Edit
proc getpwuid_r(a1: Uid; a2: ptr Passwd; a3: cstring; a4: int;
                a5: ptr ptr Passwd): cint {...}{.importc, header: "<pwd.h>".}
Source Edit
proc endpwent() {...}{.importc, header: "<pwd.h>".}
Source Edit
proc getpwent(): ptr Passwd {...}{.importc, header: "<pwd.h>".}
Source Edit
proc setpwent() {...}{.importc, header: "<pwd.h>".}
Source Edit
proc uname(a1: var Utsname): cint {...}{.importc, header: "<sys/utsname.h>".}
Source Edit
proc strerror(errnum: cint): cstring {...}{.importc, header: "<string.h>".}
Source Edit
proc pthread_atfork(a1, a2, a3: proc () {...}{.noconv.}): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_attr_destroy(a1: ptr Pthread_attr): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_attr_getdetachstate(a1: ptr Pthread_attr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_attr_getguardsize(a1: ptr Pthread_attr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_attr_getinheritsched(a1: ptr Pthread_attr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_attr_getschedparam(a1: ptr Pthread_attr; a2: ptr Sched_param): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_attr_getschedpolicy(a1: ptr Pthread_attr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_attr_getscope(a1: ptr Pthread_attr; a2: var cint): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_attr_getstack(a1: ptr Pthread_attr; a2: var pointer; a3: var int): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_attr_getstackaddr(a1: ptr Pthread_attr; a2: var pointer): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_attr_getstacksize(a1: ptr Pthread_attr; a2: var int): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_attr_init(a1: ptr Pthread_attr): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_attr_setdetachstate(a1: ptr Pthread_attr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_attr_setguardsize(a1: ptr Pthread_attr; a2: int): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_attr_setinheritsched(a1: ptr Pthread_attr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_attr_setschedparam(a1: ptr Pthread_attr; a2: ptr Sched_param): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_attr_setschedpolicy(a1: ptr Pthread_attr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_attr_setscope(a1: ptr Pthread_attr; a2: cint): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_attr_setstack(a1: ptr Pthread_attr; a2: pointer; a3: int): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_attr_setstackaddr(a1: ptr Pthread_attr; a2: pointer): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_attr_setstacksize(a1: ptr Pthread_attr; a2: int): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_barrier_destroy(a1: ptr Pthread_barrier): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_barrier_init(a1: ptr Pthread_barrier; a2: ptr Pthread_barrierattr;
                          a3: cint): cint {...}{.importc, header: "<pthread.h>".}
Source Edit
proc pthread_barrier_wait(a1: ptr Pthread_barrier): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_barrierattr_destroy(a1: ptr Pthread_barrierattr): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_barrierattr_getpshared(a1: ptr Pthread_barrierattr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_barrierattr_init(a1: ptr Pthread_barrierattr): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_barrierattr_setpshared(a1: ptr Pthread_barrierattr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_cancel(a1: Pthread): cint {...}{.importc, header: "<pthread.h>".}
Source Edit
proc pthread_cleanup_push(a1: proc (x: pointer) {...}{.noconv.}; a2: pointer) {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_cleanup_pop(a1: cint) {...}{.importc, header: "<pthread.h>".}
Source Edit
proc pthread_cond_broadcast(a1: ptr Pthread_cond): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_cond_destroy(a1: ptr Pthread_cond): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_cond_init(a1: ptr Pthread_cond; a2: ptr Pthread_condattr): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_cond_signal(a1: ptr Pthread_cond): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_cond_timedwait(a1: ptr Pthread_cond; a2: ptr Pthread_mutex;
                            a3: ptr Timespec): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_cond_wait(a1: ptr Pthread_cond; a2: ptr Pthread_mutex): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_condattr_destroy(a1: ptr Pthread_condattr): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_condattr_getclock(a1: ptr Pthread_condattr; a2: var ClockId): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_condattr_getpshared(a1: ptr Pthread_condattr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_condattr_init(a1: ptr Pthread_condattr): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_condattr_setclock(a1: ptr Pthread_condattr; a2: ClockId): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_condattr_setpshared(a1: ptr Pthread_condattr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_create(a1: ptr Pthread; a2: ptr Pthread_attr;
                    a3: proc (x: pointer): pointer {...}{.noconv.}; a4: pointer): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_detach(a1: Pthread): cint {...}{.importc, header: "<pthread.h>".}
Source Edit
proc pthread_equal(a1, a2: Pthread): cint {...}{.importc, header: "<pthread.h>".}
Source Edit
proc pthread_exit(a1: pointer) {...}{.importc, header: "<pthread.h>".}
Source Edit
proc pthread_getconcurrency(): cint {...}{.importc, header: "<pthread.h>".}
Source Edit
proc pthread_getcpuclockid(a1: Pthread; a2: var ClockId): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_getschedparam(a1: Pthread; a2: var cint; a3: ptr Sched_param): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_getspecific(a1: Pthread_key): pointer {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_join(a1: Pthread; a2: ptr pointer): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_key_create(a1: ptr Pthread_key; a2: proc (x: pointer) {...}{.noconv.}): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_key_delete(a1: Pthread_key): cint {...}{.importc, header: "<pthread.h>".}
Source Edit
proc pthread_mutex_destroy(a1: ptr Pthread_mutex): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_mutex_getprioceiling(a1: ptr Pthread_mutex; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_mutex_init(a1: ptr Pthread_mutex; a2: ptr Pthread_mutexattr): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_mutex_lock(a1: ptr Pthread_mutex): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_mutex_setprioceiling(a1: ptr Pthread_mutex; a2: cint; a3: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_mutex_timedlock(a1: ptr Pthread_mutex; a2: ptr Timespec): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_mutex_trylock(a1: ptr Pthread_mutex): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_mutex_unlock(a1: ptr Pthread_mutex): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_mutexattr_destroy(a1: ptr Pthread_mutexattr): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_mutexattr_getprioceiling(a1: ptr Pthread_mutexattr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_mutexattr_getprotocol(a1: ptr Pthread_mutexattr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_mutexattr_getpshared(a1: ptr Pthread_mutexattr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_mutexattr_gettype(a1: ptr Pthread_mutexattr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_mutexattr_init(a1: ptr Pthread_mutexattr): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_mutexattr_setprioceiling(a1: ptr Pthread_mutexattr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_mutexattr_setprotocol(a1: ptr Pthread_mutexattr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_mutexattr_setpshared(a1: ptr Pthread_mutexattr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_mutexattr_settype(a1: ptr Pthread_mutexattr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_once(a1: ptr Pthread_once; a2: proc () {...}{.noconv.}): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_rwlock_destroy(a1: ptr Pthread_rwlock): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_rwlock_init(a1: ptr Pthread_rwlock; a2: ptr Pthread_rwlockattr): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_rwlock_rdlock(a1: ptr Pthread_rwlock): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_rwlock_timedrdlock(a1: ptr Pthread_rwlock; a2: ptr Timespec): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_rwlock_timedwrlock(a1: ptr Pthread_rwlock; a2: ptr Timespec): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_rwlock_tryrdlock(a1: ptr Pthread_rwlock): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_rwlock_trywrlock(a1: ptr Pthread_rwlock): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_rwlock_unlock(a1: ptr Pthread_rwlock): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_rwlock_wrlock(a1: ptr Pthread_rwlock): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_rwlockattr_destroy(a1: ptr Pthread_rwlockattr): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_rwlockattr_getpshared(a1: ptr Pthread_rwlockattr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_rwlockattr_init(a1: ptr Pthread_rwlockattr): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_rwlockattr_setpshared(a1: ptr Pthread_rwlockattr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_self(): Pthread {...}{.importc, header: "<pthread.h>".}
Source Edit
proc pthread_setcancelstate(a1: cint; a2: var cint): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_setcanceltype(a1: cint; a2: var cint): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_setconcurrency(a1: cint): cint {...}{.importc, header: "<pthread.h>".}
Source Edit
proc pthread_setschedparam(a1: Pthread; a2: cint; a3: ptr Sched_param): cint {...}{.
    importc, header: "<pthread.h>".}
Source Edit
proc pthread_setschedprio(a1: Pthread; a2: cint): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_setspecific(a1: Pthread_key; a2: pointer): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_spin_destroy(a1: ptr Pthread_spinlock): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_spin_init(a1: ptr Pthread_spinlock; a2: cint): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_spin_lock(a1: ptr Pthread_spinlock): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_spin_trylock(a1: ptr Pthread_spinlock): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_spin_unlock(a1: ptr Pthread_spinlock): cint {...}{.importc,
    header: "<pthread.h>".}
Source Edit
proc pthread_testcancel() {...}{.importc, header: "<pthread.h>".}
Source Edit
proc exitnow(code: int): void {...}{.importc: "_exit", header: "<unistd.h>".}
Source Edit
proc access(a1: cstring; a2: cint): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc alarm(a1: cint): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc chdir(a1: cstring): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc chown(a1: cstring; a2: Uid; a3: Gid): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc close(a1: cint | SocketHandle): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc confstr(a1: cint; a2: cstring; a3: int): int {...}{.importc,
    header: "<unistd.h>".}
Source Edit
proc crypt(a1, a2: cstring): cstring {...}{.importc, header: "<unistd.h>".}
Source Edit
proc ctermid(a1: cstring): cstring {...}{.importc, header: "<unistd.h>".}
Source Edit
proc dup(a1: cint): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc dup2(a1, a2: cint): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc encrypt(a1: array[0 .. 63, char]; a2: cint) {...}{.importc, header: "<unistd.h>".}
Source Edit
proc execl(a1, a2: cstring): cint {...}{.varargs, importc, header: "<unistd.h>",
                                    sideEffect.}
Source Edit
proc execle(a1, a2: cstring): cint {...}{.varargs, importc, header: "<unistd.h>",
                                     sideEffect.}
Source Edit
proc execlp(a1, a2: cstring): cint {...}{.varargs, importc, header: "<unistd.h>",
                                     sideEffect.}
Source Edit
proc execv(a1: cstring; a2: cstringArray): cint {...}{.importc, header: "<unistd.h>",
    sideEffect.}
Source Edit
proc execve(a1: cstring; a2, a3: cstringArray): cint {...}{.importc,
    header: "<unistd.h>", sideEffect.}
Source Edit
proc execvp(a1: cstring; a2: cstringArray): cint {...}{.importc,
    header: "<unistd.h>", sideEffect.}
Source Edit
proc execvpe(a1: cstring; a2: cstringArray; a3: cstringArray): cint {...}{.importc,
    header: "<unistd.h>", sideEffect.}
Source Edit
proc fchown(a1: cint; a2: Uid; a3: Gid): cint {...}{.importc, header: "<unistd.h>",
    sideEffect.}
Source Edit
proc fchdir(a1: cint): cint {...}{.importc, header: "<unistd.h>", sideEffect.}
Source Edit
proc fdatasync(a1: cint): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc fork(): Pid {...}{.importc, header: "<unistd.h>", sideEffect.}
Source Edit
proc fpathconf(a1, a2: cint): int {...}{.importc, header: "<unistd.h>".}
Source Edit
proc fsync(a1: cint): cint {...}{.importc, header: "<unistd.h>".}
synchronize a file's buffer cache to the storage device Source Edit
proc ftruncate(a1: cint; a2: Off): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc getcwd(a1: cstring; a2: int): cstring {...}{.importc, header: "<unistd.h>",
    sideEffect.}
Source Edit
proc getuid(): Uid {...}{.importc, header: "<unistd.h>", sideEffect.}
returns the real user ID of the calling process Source Edit
proc geteuid(): Uid {...}{.importc, header: "<unistd.h>", sideEffect.}
returns the effective user ID of the calling process Source Edit
proc getgid(): Gid {...}{.importc, header: "<unistd.h>", sideEffect.}
returns the real group ID of the calling process Source Edit
proc getegid(): Gid {...}{.importc, header: "<unistd.h>", sideEffect.}
returns the effective group ID of the calling process Source Edit
proc getgroups(a1: cint; a2: ptr array[0 .. 255, Gid]): cint {...}{.importc,
    header: "<unistd.h>".}
Source Edit
proc gethostid(): int {...}{.importc, header: "<unistd.h>", sideEffect.}
Source Edit
proc gethostname(a1: cstring; a2: int): cint {...}{.importc, header: "<unistd.h>",
    sideEffect.}
Source Edit
proc getlogin(): cstring {...}{.importc, header: "<unistd.h>", sideEffect.}
Source Edit
proc getlogin_r(a1: cstring; a2: int): cint {...}{.importc, header: "<unistd.h>",
    sideEffect.}
Source Edit
proc getopt(a1: cint; a2: cstringArray; a3: cstring): cint {...}{.importc,
    header: "<unistd.h>".}
Source Edit
proc getpgid(a1: Pid): Pid {...}{.importc, header: "<unistd.h>".}
Source Edit
proc getpgrp(): Pid {...}{.importc, header: "<unistd.h>".}
Source Edit
proc getpid(): Pid {...}{.importc, header: "<unistd.h>", sideEffect.}
returns the process ID (PID) of the calling process Source Edit
proc getppid(): Pid {...}{.importc, header: "<unistd.h>", sideEffect.}
returns the process ID of the parent of the calling process Source Edit
proc getsid(a1: Pid): Pid {...}{.importc, header: "<unistd.h>", sideEffect.}
returns the session ID of the calling process Source Edit
proc getwd(a1: cstring): cstring {...}{.importc, header: "<unistd.h>".}
Source Edit
proc isatty(a1: cint): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc lchown(a1: cstring; a2: Uid; a3: Gid): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc link(a1, a2: cstring): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc lockf(a1, a2: cint; a3: Off): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc lseek(a1: cint; a2: Off; a3: cint): Off {...}{.importc, header: "<unistd.h>".}
Source Edit
proc nice(a1: cint): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc pathconf(a1: cstring; a2: cint): int {...}{.importc, header: "<unistd.h>".}
Source Edit
proc pause(): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc pclose(a: File): cint {...}{.importc, header: "<stdio.h>".}
Source Edit
proc pipe(a: array[0 .. 1, cint]): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc popen(a1, a2: cstring): File {...}{.importc, header: "<stdio.h>".}
Source Edit
proc pread(a1: cint; a2: pointer; a3: int; a4: Off): int {...}{.importc,
    header: "<unistd.h>".}
Source Edit
proc pwrite(a1: cint; a2: pointer; a3: int; a4: Off): int {...}{.importc,
    header: "<unistd.h>".}
Source Edit
proc read(a1: cint; a2: pointer; a3: int): int {...}{.importc, header: "<unistd.h>".}
Source Edit
proc readlink(a1, a2: cstring; a3: int): int {...}{.importc, header: "<unistd.h>".}
Source Edit
proc ioctl(f: FileHandle; device: uint): int {...}{.importc: "ioctl",
    header: "<sys/ioctl.h>", varargs, tags: [WriteIOEffect].}
A system call for device-specific input/output operations and other operations which cannot be expressed by regular system calls Source Edit
proc rmdir(a1: cstring): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc setegid(a1: Gid): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc seteuid(a1: Uid): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc setgid(a1: Gid): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc setpgid(a1, a2: Pid): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc setpgrp(): Pid {...}{.importc, header: "<unistd.h>".}
Source Edit
proc setregid(a1, a2: Gid): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc setreuid(a1, a2: Uid): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc setsid(): Pid {...}{.importc, header: "<unistd.h>".}
Source Edit
proc setuid(a1: Uid): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc sleep(a1: cint): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc swab(a1, a2: pointer; a3: int) {...}{.importc, header: "<unistd.h>".}
Source Edit
proc symlink(a1, a2: cstring): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc sync() {...}{.importc, header: "<unistd.h>".}
Source Edit
proc sysconf(a1: cint): int {...}{.importc, header: "<unistd.h>".}
Source Edit
proc tcgetpgrp(a1: cint): Pid {...}{.importc, header: "<unistd.h>".}
Source Edit
proc tcsetpgrp(a1: cint; a2: Pid): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc truncate(a1: cstring; a2: Off): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc ttyname(a1: cint): cstring {...}{.importc, header: "<unistd.h>".}
Source Edit
proc ttyname_r(a1: cint; a2: cstring; a3: int): cint {...}{.importc,
    header: "<unistd.h>".}
Source Edit
proc ualarm(a1, a2: Useconds): Useconds {...}{.importc, header: "<unistd.h>".}
Source Edit
proc unlink(a1: cstring): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc usleep(a1: Useconds): cint {...}{.importc, header: "<unistd.h>".}
Source Edit
proc vfork(): Pid {...}{.importc, header: "<unistd.h>".}
Source Edit
proc write(a1: cint; a2: pointer; a3: int): int {...}{.importc, header: "<unistd.h>".}
Source Edit
proc sem_close(a1: ptr Sem): cint {...}{.importc, header: "<semaphore.h>".}
Source Edit
proc sem_destroy(a1: ptr Sem): cint {...}{.importc, header: "<semaphore.h>".}
Source Edit
proc sem_getvalue(a1: ptr Sem; a2: var cint): cint {...}{.importc,
    header: "<semaphore.h>".}
Source Edit
proc sem_init(a1: ptr Sem; a2: cint; a3: cint): cint {...}{.importc,
    header: "<semaphore.h>".}
Source Edit
proc sem_open(a1: cstring; a2: cint): ptr Sem {...}{.varargs, importc,
    header: "<semaphore.h>".}
Source Edit
proc sem_post(a1: ptr Sem): cint {...}{.importc, header: "<semaphore.h>".}
Source Edit
proc sem_timedwait(a1: ptr Sem; a2: ptr Timespec): cint {...}{.importc,
    header: "<semaphore.h>".}
Source Edit
proc sem_trywait(a1: ptr Sem): cint {...}{.importc, header: "<semaphore.h>".}
Source Edit
proc sem_unlink(a1: cstring): cint {...}{.importc, header: "<semaphore.h>".}
Source Edit
proc sem_wait(a1: ptr Sem): cint {...}{.importc, header: "<semaphore.h>".}
Source Edit
proc ftok(a1: cstring; a2: cint): Key {...}{.importc, header: "<sys/ipc.h>".}
Source Edit
proc statvfs(a1: cstring; a2: var Statvfs): cint {...}{.importc,
    header: "<sys/statvfs.h>".}
Source Edit
proc fstatvfs(a1: cint; a2: var Statvfs): cint {...}{.importc,
    header: "<sys/statvfs.h>".}
Source Edit
proc chmod(a1: cstring; a2: Mode): cint {...}{.importc, header: "<sys/stat.h>",
    sideEffect.}
Source Edit
proc fchmod(a1: cint; a2: Mode): cint {...}{.importc, header: "<sys/stat.h>",
                                        sideEffect.}
Source Edit
proc fstat(a1: cint; a2: var Stat): cint {...}{.importc, header: "<sys/stat.h>",
    sideEffect.}
Source Edit
proc lstat(a1: cstring; a2: var Stat): cint {...}{.importc, header: "<sys/stat.h>",
    sideEffect.}
Source Edit
proc mkdir(a1: cstring; a2: Mode): cint {...}{.importc, header: "<sys/stat.h>",
    sideEffect.}
Use os.createDir() and similar. Source Edit
proc mkfifo(a1: cstring; a2: Mode): cint {...}{.importc, header: "<sys/stat.h>".}
Source Edit
proc mknod(a1: cstring; a2: Mode; a3: Dev): cint {...}{.importc,
    header: "<sys/stat.h>".}
Source Edit
proc stat(a1: cstring; a2: var Stat): cint {...}{.importc, header: "<sys/stat.h>".}
Source Edit
proc umask(a1: Mode): Mode {...}{.importc, header: "<sys/stat.h>".}
Source Edit
proc S_ISBLK(m: Mode): bool {...}{.importc, header: "<sys/stat.h>".}
Test for a block special file. Source Edit
proc S_ISCHR(m: Mode): bool {...}{.importc, header: "<sys/stat.h>".}
Test for a character special file. Source Edit
proc S_ISDIR(m: Mode): bool {...}{.importc, header: "<sys/stat.h>".}
Test for a directory. Source Edit
proc S_ISFIFO(m: Mode): bool {...}{.importc, header: "<sys/stat.h>".}
Test for a pipe or FIFO special file. Source Edit
proc S_ISREG(m: Mode): bool {...}{.importc, header: "<sys/stat.h>".}
Test for a regular file. Source Edit
proc S_ISLNK(m: Mode): bool {...}{.importc, header: "<sys/stat.h>".}
Test for a symbolic link. Source Edit
proc S_ISSOCK(m: Mode): bool {...}{.importc, header: "<sys/stat.h>".}
Test for a socket. Source Edit
proc S_TYPEISMQ(buf: var Stat): bool {...}{.importc, header: "<sys/stat.h>".}
Test for a message queue. Source Edit
proc S_TYPEISSEM(buf: var Stat): bool {...}{.importc, header: "<sys/stat.h>".}
Test for a semaphore. Source Edit
proc S_TYPEISSHM(buf: var Stat): bool {...}{.importc, header: "<sys/stat.h>".}
Test for a shared memory object. Source Edit
proc S_TYPEISTMO(buf: var Stat): bool {...}{.importc, header: "<sys/stat.h>".}
Test macro for a typed memory object. Source Edit
proc mlock(a1: pointer; a2: int): cint {...}{.importc, header: "<sys/mman.h>".}
Source Edit
proc mlockall(a1: cint): cint {...}{.importc, header: "<sys/mman.h>".}
Source Edit
proc mmap(a1: pointer; a2: int; a3, a4, a5: cint; a6: Off): pointer {...}{.importc,
    header: "<sys/mman.h>".}
Source Edit
proc mprotect(a1: pointer; a2: int; a3: cint): cint {...}{.importc,
    header: "<sys/mman.h>".}
Source Edit
proc msync(a1: pointer; a2: int; a3: cint): cint {...}{.importc,
    header: "<sys/mman.h>".}
Source Edit
proc munlock(a1: pointer; a2: int): cint {...}{.importc, header: "<sys/mman.h>".}
Source Edit
proc munlockall(): cint {...}{.importc, header: "<sys/mman.h>".}
Source Edit
proc munmap(a1: pointer; a2: int): cint {...}{.importc, header: "<sys/mman.h>".}
Source Edit
proc posix_madvise(a1: pointer; a2: int; a3: cint): cint {...}{.importc,
    header: "<sys/mman.h>".}
Source Edit
proc posix_mem_offset(a1: pointer; a2: int; a3: var Off; a4: var int;
                      a5: var cint): cint {...}{.importc, header: "<sys/mman.h>".}
Source Edit
proc posix_typed_mem_open(a1: cstring; a2, a3: cint): cint {...}{.importc,
    header: "<sys/mman.h>".}
Source Edit
proc shm_open(a1: cstring; a2: cint; a3: Mode): cint {...}{.importc,
    header: "<sys/mman.h>".}
Source Edit
proc shm_unlink(a1: cstring): cint {...}{.importc, header: "<sys/mman.h>".}
Source Edit
proc asctime(a1: var Tm): cstring {...}{.importc, header: "<time.h>".}
Source Edit
proc asctime_r(a1: var Tm; a2: cstring): cstring {...}{.importc, header: "<time.h>".}
Source Edit
proc clock(): Clock {...}{.importc, header: "<time.h>", sideEffect.}
Source Edit
proc clock_getcpuclockid(a1: Pid; a2: var ClockId): cint {...}{.importc,
    header: "<time.h>", sideEffect.}
Source Edit
proc clock_getres(a1: ClockId; a2: var Timespec): cint {...}{.importc,
    header: "<time.h>", sideEffect.}
Source Edit
proc clock_gettime(a1: ClockId; a2: var Timespec): cint {...}{.importc,
    header: "<time.h>", sideEffect.}
Source Edit
proc clock_nanosleep(a1: ClockId; a2: cint; a3: var Timespec; a4: var Timespec): cint {...}{.
    importc, header: "<time.h>", sideEffect.}
Source Edit
proc clock_settime(a1: ClockId; a2: var Timespec): cint {...}{.importc,
    header: "<time.h>", sideEffect.}
Source Edit
proc `==`(a, b: Time): bool {...}{.borrow.}
Source Edit
proc `-`(a, b: Time): Time {...}{.borrow.}
Source Edit
proc ctime(a1: var Time): cstring {...}{.importc, header: "<time.h>".}
Source Edit
proc ctime_r(a1: var Time; a2: cstring): cstring {...}{.importc, header: "<time.h>".}
Source Edit
proc difftime(a1, a2: Time): cdouble {...}{.importc, header: "<time.h>".}
Source Edit
proc getdate(a1: cstring): ptr Tm {...}{.importc, header: "<time.h>".}
Source Edit
proc gmtime(a1: var Time): ptr Tm {...}{.importc, header: "<time.h>".}
Source Edit
proc gmtime_r(a1: var Time; a2: var Tm): ptr Tm {...}{.importc, header: "<time.h>".}
Source Edit
proc localtime(a1: var Time): ptr Tm {...}{.importc, header: "<time.h>".}
Source Edit
proc localtime_r(a1: var Time; a2: var Tm): ptr Tm {...}{.importc, header: "<time.h>".}
Source Edit
proc mktime(a1: var Tm): Time {...}{.importc, header: "<time.h>".}
Source Edit
proc timegm(a1: var Tm): Time {...}{.importc, header: "<time.h>".}
Source Edit
proc nanosleep(a1, a2: var Timespec): cint {...}{.importc, header: "<time.h>",
    sideEffect.}
Source Edit
proc strftime(a1: cstring; a2: int; a3: cstring; a4: var Tm): int {...}{.importc,
    header: "<time.h>".}
Source Edit
proc strptime(a1, a2: cstring; a3: var Tm): cstring {...}{.importc,
    header: "<time.h>".}
Source Edit
proc time(a1: var Time): Time {...}{.importc, header: "<time.h>", sideEffect.}
Source Edit
proc timer_create(a1: ClockId; a2: var SigEvent; a3: var Timer): cint {...}{.importc,
    header: "<time.h>".}
Source Edit
proc timer_delete(a1: Timer): cint {...}{.importc, header: "<time.h>".}
Source Edit
proc timer_gettime(a1: Timer; a2: var Itimerspec): cint {...}{.importc,
    header: "<time.h>".}
Source Edit
proc timer_getoverrun(a1: Timer): cint {...}{.importc, header: "<time.h>".}
Source Edit
proc timer_settime(a1: Timer; a2: cint; a3: var Itimerspec; a4: var Itimerspec): cint {...}{.
    importc, header: "<time.h>".}
Source Edit
proc tzset() {...}{.importc, header: "<time.h>".}
Source Edit
proc wait(a1: ptr cint): Pid {...}{.importc, discardable, header: "<sys/wait.h>",
                               sideEffect.}
Source Edit
proc waitid(a1: cint; a2: Id; a3: var SigInfo; a4: cint): cint {...}{.importc,
    header: "<sys/wait.h>", sideEffect.}
Source Edit
proc waitpid(a1: Pid; a2: var cint; a3: cint): Pid {...}{.importc,
    header: "<sys/wait.h>", sideEffect.}
Source Edit
proc wait4(pid: Pid; status: ptr cint; options: cint; rusage: ptr Rusage): Pid {...}{.
    importc, header: "<sys/wait.h>", sideEffect.}
Source Edit
proc getrusage(who: cint; rusage: ptr Rusage): cint {...}{.importc,
    header: "<sys/resource.h>", discardable.}
Source Edit
proc bsd_signal(a1: cint; a2: proc (x: pointer) {...}{.noconv.}) {...}{.importc,
    header: "<signal.h>".}
Source Edit
proc kill(a1: Pid; a2: cint): cint {...}{.importc, header: "<signal.h>", sideEffect.}
Source Edit
proc killpg(a1: Pid; a2: cint): cint {...}{.importc, header: "<signal.h>", sideEffect.}
Source Edit
proc pthread_kill(a1: Pthread; a2: cint): cint {...}{.importc, header: "<signal.h>".}
Source Edit
proc pthread_sigmask(a1: cint; a2, a3: var Sigset): cint {...}{.importc,
    header: "<signal.h>".}
Source Edit
proc `raise`(a1: cint): cint {...}{.importc, header: "<signal.h>".}
Source Edit
proc sigaction(a1: cint; a2, a3: var Sigaction): cint {...}{.importc,
    header: "<signal.h>".}
Source Edit
proc sigaction(a1: cint; a2: var Sigaction; a3: ptr Sigaction = nil): cint {...}{.
    importc, header: "<signal.h>".}
Source Edit
proc sigaddset(a1: var Sigset; a2: cint): cint {...}{.importc, header: "<signal.h>".}
Source Edit
proc sigaltstack(a1, a2: var Stack): cint {...}{.importc, header: "<signal.h>".}
Source Edit
proc sigdelset(a1: var Sigset; a2: cint): cint {...}{.importc, header: "<signal.h>".}
Source Edit
proc sigemptyset(a1: var Sigset): cint {...}{.importc, header: "<signal.h>".}
Source Edit
proc sigfillset(a1: var Sigset): cint {...}{.importc, header: "<signal.h>".}
Source Edit
proc sighold(a1: cint): cint {...}{.importc, header: "<signal.h>".}
Source Edit
proc sigignore(a1: cint): cint {...}{.importc, header: "<signal.h>".}
Source Edit
proc siginterrupt(a1, a2: cint): cint {...}{.importc, header: "<signal.h>".}
Source Edit
proc sigismember(a1: var Sigset; a2: cint): cint {...}{.importc, header: "<signal.h>".}
Source Edit
proc signal(a1: cint; a2: Sighandler) {...}{.importc, header: "<signal.h>".}
Source Edit
proc sigpause(a1: cint): cint {...}{.importc, header: "<signal.h>".}
Source Edit
proc sigpending(a1: var Sigset): cint {...}{.importc, header: "<signal.h>".}
Source Edit
proc sigprocmask(a1: cint; a2, a3: var Sigset): cint {...}{.importc,
    header: "<signal.h>".}
Source Edit
proc sigqueue(a1: Pid; a2: cint; a3: SigVal): cint {...}{.importc,
    header: "<signal.h>".}
Source Edit
proc sigrelse(a1: cint): cint {...}{.importc, header: "<signal.h>".}
Source Edit
proc sigset(a1: int; a2: proc (x: cint) {...}{.noconv.}) {...}{.importc,
    header: "<signal.h>".}
Source Edit
proc sigsuspend(a1: var Sigset): cint {...}{.importc, header: "<signal.h>".}
Source Edit
proc sigtimedwait(a1: var Sigset; a2: var SigInfo; a3: var Timespec): cint {...}{.
    importc, header: "<signal.h>".}
Source Edit
proc sigwait(a1: var Sigset; a2: var cint): cint {...}{.importc, header: "<signal.h>".}
Source Edit
proc sigwaitinfo(a1: var Sigset; a2: var SigInfo): cint {...}{.importc,
    header: "<signal.h>".}
Source Edit
proc catclose(a1: Nl_catd): cint {...}{.importc, header: "<nl_types.h>".}
Source Edit
proc catgets(a1: Nl_catd; a2, a3: cint; a4: cstring): cstring {...}{.importc,
    header: "<nl_types.h>".}
Source Edit
proc catopen(a1: cstring; a2: cint): Nl_catd {...}{.importc, header: "<nl_types.h>".}
Source Edit
proc sched_get_priority_max(a1: cint): cint {...}{.importc, header: "<sched.h>".}
Source Edit
proc sched_get_priority_min(a1: cint): cint {...}{.importc, header: "<sched.h>".}
Source Edit
proc sched_getparam(a1: Pid; a2: var Sched_param): cint {...}{.importc,
    header: "<sched.h>".}
Source Edit
proc sched_getscheduler(a1: Pid): cint {...}{.importc, header: "<sched.h>".}
Source Edit
proc sched_rr_get_interval(a1: Pid; a2: var Timespec): cint {...}{.importc,
    header: "<sched.h>".}
Source Edit
proc sched_setparam(a1: Pid; a2: var Sched_param): cint {...}{.importc,
    header: "<sched.h>".}
Source Edit
proc sched_setscheduler(a1: Pid; a2: cint; a3: var Sched_param): cint {...}{.importc,
    header: "<sched.h>".}
Source Edit
proc sched_yield(): cint {...}{.importc, header: "<sched.h>".}
Source Edit
proc hstrerror(herrnum: cint): cstring {...}{.importc: "(char *)$1",
    header: "<netdb.h>".}
Source Edit
proc FD_CLR(a1: cint; a2: var TFdSet) {...}{.importc, header: "<sys/select.h>".}
Source Edit
proc FD_ISSET(a1: cint | SocketHandle; a2: var TFdSet): cint {...}{.importc,
    header: "<sys/select.h>".}
Source Edit
proc FD_SET(a1: cint | SocketHandle; a2: var TFdSet) {...}{.importc: "FD_SET",
    header: "<sys/select.h>".}
Source Edit
proc FD_ZERO(a1: var TFdSet) {...}{.importc, header: "<sys/select.h>".}
Source Edit
proc pselect(a1: cint; a2, a3, a4: ptr TFdSet; a5: ptr Timespec; a6: var Sigset): cint {...}{.
    importc, header: "<sys/select.h>".}
Source Edit
proc select(a1: cint | SocketHandle; a2, a3, a4: ptr TFdSet; a5: ptr Timeval): cint {...}{.
    importc, header: "<sys/select.h>".}
Source Edit
proc posix_spawn(a1: var Pid; a2: cstring; a3: var Tposix_spawn_file_actions;
                 a4: var Tposix_spawnattr; a5, a6: cstringArray): cint {...}{.
    importc, header: "<spawn.h>".}
Source Edit
proc posix_spawn_file_actions_addclose(a1: var Tposix_spawn_file_actions;
                                       a2: cint): cint {...}{.importc,
    header: "<spawn.h>".}
Source Edit
proc posix_spawn_file_actions_adddup2(a1: var Tposix_spawn_file_actions;
                                      a2, a3: cint): cint {...}{.importc,
    header: "<spawn.h>".}
Source Edit
proc posix_spawn_file_actions_addopen(a1: var Tposix_spawn_file_actions;
                                      a2: cint; a3: cstring; a4: cint; a5: Mode): cint {...}{.
    importc, header: "<spawn.h>".}
Source Edit
proc posix_spawn_file_actions_destroy(a1: var Tposix_spawn_file_actions): cint {...}{.
    importc, header: "<spawn.h>".}
Source Edit
proc posix_spawn_file_actions_init(a1: var Tposix_spawn_file_actions): cint {...}{.
    importc, header: "<spawn.h>".}
Source Edit
proc posix_spawnattr_destroy(a1: var Tposix_spawnattr): cint {...}{.importc,
    header: "<spawn.h>".}
Source Edit
proc posix_spawnattr_getsigdefault(a1: var Tposix_spawnattr; a2: var Sigset): cint {...}{.
    importc, header: "<spawn.h>".}
Source Edit
proc posix_spawnattr_getflags(a1: var Tposix_spawnattr; a2: var cshort): cint {...}{.
    importc, header: "<spawn.h>".}
Source Edit
proc posix_spawnattr_getpgroup(a1: var Tposix_spawnattr; a2: var Pid): cint {...}{.
    importc, header: "<spawn.h>".}
Source Edit
proc posix_spawnattr_getschedparam(a1: var Tposix_spawnattr; a2: var Sched_param): cint {...}{.
    importc, header: "<spawn.h>".}
Source Edit
proc posix_spawnattr_getschedpolicy(a1: var Tposix_spawnattr; a2: var cint): cint {...}{.
    importc, header: "<spawn.h>".}
Source Edit
proc posix_spawnattr_getsigmask(a1: var Tposix_spawnattr; a2: var Sigset): cint {...}{.
    importc, header: "<spawn.h>".}
Source Edit
proc posix_spawnattr_init(a1: var Tposix_spawnattr): cint {...}{.importc,
    header: "<spawn.h>".}
Source Edit
proc posix_spawnattr_setsigdefault(a1: var Tposix_spawnattr; a2: var Sigset): cint {...}{.
    importc, header: "<spawn.h>".}
Source Edit
proc posix_spawnattr_setflags(a1: var Tposix_spawnattr; a2: cint): cint {...}{.
    importc, header: "<spawn.h>".}
Source Edit
proc posix_spawnattr_setpgroup(a1: var Tposix_spawnattr; a2: Pid): cint {...}{.
    importc, header: "<spawn.h>".}
Source Edit
proc posix_spawnattr_setschedparam(a1: var Tposix_spawnattr; a2: var Sched_param): cint {...}{.
    importc, header: "<spawn.h>".}
Source Edit
proc posix_spawnattr_setschedpolicy(a1: var Tposix_spawnattr; a2: cint): cint {...}{.
    importc, header: "<spawn.h>".}
Source Edit
proc posix_spawnattr_setsigmask(a1: var Tposix_spawnattr; a2: var Sigset): cint {...}{.
    importc, header: "<spawn.h>".}
Source Edit
proc posix_spawnp(a1: var Pid; a2: cstring; a3: var Tposix_spawn_file_actions;
                  a4: var Tposix_spawnattr; a5, a6: cstringArray): cint {...}{.
    importc, header: "<spawn.h>".}
Source Edit
proc getcontext(a1: var Ucontext): cint {...}{.importc, header: "<ucontext.h>".}
Source Edit
proc makecontext(a1: var Ucontext; a4: proc () {...}{.noconv.}; a3: cint) {...}{.varargs,
    importc, header: "<ucontext.h>".}
Source Edit
proc setcontext(a1: var Ucontext): cint {...}{.importc, header: "<ucontext.h>".}
Source Edit
proc swapcontext(a1, a2: var Ucontext): cint {...}{.importc, header: "<ucontext.h>".}
Source Edit
proc readv(a1: cint; a2: ptr IOVec; a3: cint): int {...}{.importc,
    header: "<sys/uio.h>".}
Source Edit
proc writev(a1: cint; a2: ptr IOVec; a3: cint): int {...}{.importc,
    header: "<sys/uio.h>".}
Source Edit
proc CMSG_DATA(cmsg: ptr Tcmsghdr): cstring {...}{.importc, header: "<sys/socket.h>".}
Source Edit
proc CMSG_NXTHDR(mhdr: ptr Tmsghdr; cmsg: ptr Tcmsghdr): ptr Tcmsghdr {...}{.importc,
    header: "<sys/socket.h>".}
Source Edit
proc CMSG_FIRSTHDR(mhdr: ptr Tmsghdr): ptr Tcmsghdr {...}{.importc,
    header: "<sys/socket.h>".}
Source Edit
proc CMSG_SPACE(len: csize): csize {...}{.importc, header: "<sys/socket.h>", deprecated: "argument `len` should be of type `csize_t`".}
Deprecated: argument `len` should be of type `csize_t`
Source Edit
proc CMSG_SPACE(len: csize_t): csize_t {...}{.importc, header: "<sys/socket.h>".}
Source Edit
proc CMSG_LEN(len: csize): csize {...}{.importc, header: "<sys/socket.h>", deprecated: "argument `len` should be of type `csize_t`".}
Deprecated: argument `len` should be of type `csize_t`
Source Edit
proc CMSG_LEN(len: csize_t): csize_t {...}{.importc, header: "<sys/socket.h>".}
Source Edit
proc `==`(x, y: SocketHandle): bool {...}{.borrow.}
Source Edit
proc accept(a1: SocketHandle; a2: ptr SockAddr; a3: ptr SockLen): SocketHandle {...}{.
    importc, header: "<sys/socket.h>", sideEffect.}
Source Edit
proc accept4(a1: SocketHandle; a2: ptr SockAddr; a3: ptr SockLen; flags: cint): SocketHandle {...}{.
    importc, header: "<sys/socket.h>".}
Source Edit
proc bindSocket(a1: SocketHandle; a2: ptr SockAddr; a3: SockLen): cint {...}{.
    importc: "bind", header: "<sys/socket.h>".}
is Posix's bind, because bind is a reserved word Source Edit
proc connect(a1: SocketHandle; a2: ptr SockAddr; a3: SockLen): cint {...}{.importc,
    header: "<sys/socket.h>".}
Source Edit
proc getpeername(a1: SocketHandle; a2: ptr SockAddr; a3: ptr SockLen): cint {...}{.
    importc, header: "<sys/socket.h>".}
Source Edit
proc getsockname(a1: SocketHandle; a2: ptr SockAddr; a3: ptr SockLen): cint {...}{.
    importc, header: "<sys/socket.h>".}
Source Edit
proc getsockopt(a1: SocketHandle; a2, a3: cint; a4: pointer; a5: ptr SockLen): cint {...}{.
    importc, header: "<sys/socket.h>".}
Source Edit
proc listen(a1: SocketHandle; a2: cint): cint {...}{.importc,
    header: "<sys/socket.h>", sideEffect.}
Source Edit
proc recv(a1: SocketHandle; a2: pointer; a3: int; a4: cint): int {...}{.importc,
    header: "<sys/socket.h>", sideEffect.}
Source Edit
proc recvfrom(a1: SocketHandle; a2: pointer; a3: int; a4: cint;
              a5: ptr SockAddr; a6: ptr SockLen): int {...}{.importc,
    header: "<sys/socket.h>", sideEffect.}
Source Edit
proc recvmsg(a1: SocketHandle; a2: ptr Tmsghdr; a3: cint): int {...}{.importc,
    header: "<sys/socket.h>", sideEffect.}
Source Edit
proc send(a1: SocketHandle; a2: pointer; a3: int; a4: cint): int {...}{.importc,
    header: "<sys/socket.h>", sideEffect.}
Source Edit
proc sendmsg(a1: SocketHandle; a2: ptr Tmsghdr; a3: cint): int {...}{.importc,
    header: "<sys/socket.h>", sideEffect.}
Source Edit
proc sendto(a1: SocketHandle; a2: pointer; a3: int; a4: cint; a5: ptr SockAddr;
            a6: SockLen): int {...}{.importc, header: "<sys/socket.h>", sideEffect.}
Source Edit
proc setsockopt(a1: SocketHandle; a2, a3: cint; a4: pointer; a5: SockLen): cint {...}{.
    importc, header: "<sys/socket.h>".}
Source Edit
proc shutdown(a1: SocketHandle; a2: cint): cint {...}{.importc,
    header: "<sys/socket.h>".}
Source Edit
proc socket(a1, a2, a3: cint): SocketHandle {...}{.importc, header: "<sys/socket.h>".}
Source Edit
proc sockatmark(a1: cint): cint {...}{.importc, header: "<sys/socket.h>".}
Source Edit
proc socketpair(a1, a2, a3: cint; a4: var array[0 .. 1, cint]): cint {...}{.importc,
    header: "<sys/socket.h>".}
Source Edit
proc if_nametoindex(a1: cstring): cint {...}{.importc, header: "<net/if.h>".}
Source Edit
proc if_indextoname(a1: cint; a2: cstring): cstring {...}{.importc,
    header: "<net/if.h>".}
Source Edit
proc if_nameindex(): ptr Tif_nameindex {...}{.importc, header: "<net/if.h>".}
Source Edit
proc if_freenameindex(a1: ptr Tif_nameindex) {...}{.importc, header: "<net/if.h>".}
Source Edit
proc IN6_IS_ADDR_UNSPECIFIED(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
Unspecified address. Source Edit
proc IN6_IS_ADDR_LOOPBACK(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
Loopback address. Source Edit
proc IN6_IS_ADDR_MULTICAST(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
Multicast address. Source Edit
proc IN6_IS_ADDR_LINKLOCAL(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
Unicast link-local address. Source Edit
proc IN6_IS_ADDR_SITELOCAL(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
Unicast site-local address. Source Edit
proc IN6_IS_ADDR_V4MAPPED(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
IPv4 mapped address. Source Edit
proc IN6_IS_ADDR_V4COMPAT(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
IPv4-compatible address. Source Edit
proc IN6_IS_ADDR_MC_NODELOCAL(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
Multicast node-local address. Source Edit
proc IN6_IS_ADDR_MC_LINKLOCAL(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
Multicast link-local address. Source Edit
proc IN6_IS_ADDR_MC_SITELOCAL(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
Multicast site-local address. Source Edit
proc IN6_IS_ADDR_MC_ORGLOCAL(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
Multicast organization-local address. Source Edit
proc IN6_IS_ADDR_MC_GLOBAL(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
Multicast global address. Source Edit
proc endhostent() {...}{.importc, header: "<netdb.h>".}
Source Edit
proc endnetent() {...}{.importc, header: "<netdb.h>".}
Source Edit
proc endprotoent() {...}{.importc, header: "<netdb.h>".}
Source Edit
proc endservent() {...}{.importc, header: "<netdb.h>".}
Source Edit
proc freeaddrinfo(a1: ptr AddrInfo) {...}{.importc, header: "<netdb.h>".}
Source Edit
proc gai_strerror(a1: cint): cstring {...}{.importc: "(char *)$1",
                                       header: "<netdb.h>".}
Source Edit
proc getaddrinfo(a1, a2: cstring; a3: ptr AddrInfo; a4: var ptr AddrInfo): cint {...}{.
    importc, header: "<netdb.h>".}
Source Edit
proc gethostbyaddr(a1: pointer; a2: SockLen; a3: cint): ptr Hostent {...}{.importc,
    header: "<netdb.h>".}
Source Edit
proc gethostbyname(a1: cstring): ptr Hostent {...}{.importc, header: "<netdb.h>".}
Source Edit
proc gethostent(): ptr Hostent {...}{.importc, header: "<netdb.h>".}
Source Edit
proc getnameinfo(a1: ptr SockAddr; a2: SockLen; a3: cstring; a4: SockLen;
                 a5: cstring; a6: SockLen; a7: cint): cint {...}{.importc,
    header: "<netdb.h>".}
Source Edit
proc getnetbyaddr(a1: int32; a2: cint): ptr Tnetent {...}{.importc,
    header: "<netdb.h>".}
Source Edit
proc getnetbyname(a1: cstring): ptr Tnetent {...}{.importc, header: "<netdb.h>".}
Source Edit
proc getnetent(): ptr Tnetent {...}{.importc, header: "<netdb.h>".}
Source Edit
proc getprotobyname(a1: cstring): ptr Protoent {...}{.importc, header: "<netdb.h>".}
Source Edit
proc getprotobynumber(a1: cint): ptr Protoent {...}{.importc, header: "<netdb.h>".}
Source Edit
proc getprotoent(): ptr Protoent {...}{.importc, header: "<netdb.h>".}
Source Edit
proc getservbyname(a1, a2: cstring): ptr Servent {...}{.importc, header: "<netdb.h>".}
Source Edit
proc getservbyport(a1: cint; a2: cstring): ptr Servent {...}{.importc,
    header: "<netdb.h>".}
Source Edit
proc getservent(): ptr Servent {...}{.importc, header: "<netdb.h>".}
Source Edit
proc sethostent(a1: cint) {...}{.importc, header: "<netdb.h>".}
Source Edit
proc setnetent(a1: cint) {...}{.importc, header: "<netdb.h>".}
Source Edit
proc setprotoent(a1: cint) {...}{.importc, header: "<netdb.h>".}
Source Edit
proc setservent(a1: cint) {...}{.importc, header: "<netdb.h>".}
Source Edit
proc poll(a1: ptr TPollfd; a2: Tnfds; a3: int): cint {...}{.importc,
    header: "<poll.h>", sideEffect.}
Source Edit
proc realpath(name, resolved: cstring): cstring {...}{.importc: "realpath",
    header: "<stdlib.h>".}
Source Edit
proc mkstemp(tmpl: cstring): cint {...}{.importc, header: "<stdlib.h>", sideEffect.}

Creates a unique temporary file.

Warning: The tmpl argument is written to by mkstemp and thus can't be a string literal. If in doubt make a copy of the cstring before passing it in.

Source Edit
proc mkstemps(tmpl: cstring; suffixlen: int): cint {...}{.importc,
    header: "<stdlib.h>", sideEffect.}

Creates a unique temporary file.

Warning: The tmpl argument is written to by mkstemps and thus can't be a string literal. If in doubt make a copy of the cstring before passing it in.

Source Edit
proc mkdtemp(tmpl: cstring): pointer {...}{.importc, header: "<stdlib.h>", sideEffect.}
Source Edit
proc mkostemp(tmpl: cstring; oflags: cint): cint {...}{.importc,
    header: "<stdlib.h>", sideEffect.}
Source Edit
proc mkostemps(tmpl: cstring; suffixlen: cint; oflags: cint): cint {...}{.importc,
    header: "<stdlib.h>", sideEffect.}
Source Edit
proc posix_memalign(memptr: pointer; alignment: csize_t; size: csize_t): cint {...}{.
    importc, header: "<stdlib.h>".}
Source Edit
proc utimes(path: cstring; times: ptr array[2, Timeval]): int {...}{.
    importc: "utimes", header: "<sys/time.h>", sideEffect.}

Sets file access and modification times.

Pass the filename and an array of times to set the access and modification times respectively. If you pass nil as the array both attributes will be set to the current time.

Returns zero on success.

For more information read http://www.unix.com/man-page/posix/3/utimes/.

Source Edit
proc setrlimit(resource: cint; rlp: var RLimit): cint {...}{.importc: "setrlimit",
    header: "<sys/resource.h>".}
The setrlimit() system calls sets resource limits. Source Edit
proc getrlimit(resource: cint; rlp: var RLimit): cint {...}{.importc: "getrlimit",
    header: "<sys/resource.h>".}
The getrlimit() system call gets resource limits. Source Edit

Templates

template onSignal(signals: varargs[cint]; body: untyped)

Setup code to be executed when Unix signals are received. The currently handled signal is injected as sig into the calling scope.

Example:

from posix import SIGINT, SIGTERM, onSignal
onSignal(SIGINT, SIGTERM):
  echo "bye from signal ", sig
Source Edit

© 2006–2021 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/posix.html