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.
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.
DIR = object
SocketHandle = distinct cint
Timespec = object tv_sec*: Time ## Seconds. tv_nsec*: int ## Nanoseconds.
Dirent = object d_ino*: Ino ## File serial number. when defined(dragonfly): d_type*: uint8 elif false or false: d_reclen*: cshort ## Length of this record. (not POSIX) d_type*: int8 ## Type of file; not supported by all filesystem types. ## (not POSIX) when defined(linux) or defined(openbsd): d_off*: Off ## Not an offset. Value that ``telldir()`` would return. d_name*: array[0 .. 255, char] ## Name of entry.
Tflock = 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.
FTW = object base*: cint level*: cint
Glob = object gl_pathc*: int ## Count of paths matched by pattern. gl_pathv*: cstringArray ## Pointer to a list of matched pathnames. gl_offs*: int ## Slots to reserve at the beginning of gl_pathv.
Group = object gr_name*: cstring ## The name of the group. gr_gid*: Gid ## Numerical group ID. gr_mem*: cstringArray ## Pointer to a null-terminated array of character ## pointers to member names.
Iconv = object
Lconv = object currency_symbol*: cstring decimal_point*: cstring frac_digits*: char grouping*: cstring int_curr_symbol*: cstring int_frac_digits*: char int_n_cs_precedes*: char int_n_sep_by_space*: char int_n_sign_posn*: char int_p_cs_precedes*: char int_p_sep_by_space*: char int_p_sign_posn*: char mon_decimal_point*: cstring mon_grouping*: cstring mon_thousands_sep*: cstring negative_sign*: cstring n_cs_precedes*: char n_sep_by_space*: char n_sign_posn*: char positive_sign*: cstring p_cs_precedes*: char p_sep_by_space*: char p_sign_posn*: char thousands_sep*: cstring
Mqd = object
MqAttr = object mq_flags*: int ## Message queue flags. mq_maxmsg*: int ## Maximum number of messages. mq_msgsize*: int ## Maximum message size. mq_curmsgs*: int ## Number of messages currently queued.
Passwd = object pw_name*: cstring ## User's login name. pw_uid*: Uid ## Numerical user ID. pw_gid*: Gid ## Numerical group ID. pw_dir*: cstring ## Initial working directory. pw_shell*: cstring ## Program to use as shell.
Blkcnt = int
Blksize = int
Clock = int
ClockId = int
Dev = int
Fsblkcnt = int
Fsfilcnt = int
Gid = int
Id = int
Ino = int
Key = int
Mode = cint
Nlink = int
Off = int64
Pid = int
Pthread_attr = int
Pthread_barrier = int
Pthread_barrierattr = int
Pthread_cond = int
Pthread_condattr = int
Pthread_key = int
Pthread_mutex = int
Pthread_mutexattr = int
Pthread_once = int
Pthread_rwlock = int
Pthread_rwlockattr = int
Pthread_spinlock = int
Pthread = int
Suseconds = int
Timer = int
Trace_attr = int
Trace_event_id = int
Trace_event_set = int
Trace_id = int
Uid = int
Useconds = int
Utsname = object sysname*, ## Name of the hardware type on which the ## system is running. ## 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*: array[0 .. 255, char]
Sem = object
Ipc_perm = object 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*: Mode ## Read/write permission.
Stat = object st_dev*: Dev ## Device ID of device containing file. st_ino*: Ino ## File serial number. st_mode*: Mode ## Mode of file (see below). st_nlink*: Nlink ## Number of hard links to the file. st_uid*: Uid ## User ID of file. st_gid*: Gid ## Group ID of file. 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. when false or false: st_atime*: Time ## Time of last access. st_mtime*: Time ## Time of last data modification. st_ctime*: Time ## Time of last status change. else: st_atim*: Timespec ## Time of last access. st_mtim*: Timespec ## Time of last data modification. st_ctim*: Timespec ## Time of last status change. 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.
Statvfs = object f_bsize*: int ## File system block size. f_frsize*: int ## 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*: int ## File system ID. f_flag*: int ## Bit mask of f_flag values. f_namemax*: int ## Maximum filename length.
Posix_typed_mem_info = object posix_tmi_length*: int
Tm = 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.
Itimerspec = object it_interval*: Timespec ## Timer period. it_value*: Timespec ## Timer expiration.
Sig_atomic = cint
Sigset = object
SigEvent = object sigev_notify*: cint ## Notification type. sigev_signo*: cint ## Signal number. sigev_value*: SigVal ## Signal value. sigev_notify_function*: proc (x: SigVal) {.noconv.} ## Notification func. sigev_notify_attributes*: ptr Pthread_attr ## Notification attributes.
SigVal = object sival_ptr*: pointer ## pointer signal value; ## integer signal value not defined!
Sigaction = 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.}
Stack = object ss_sp*: pointer ## Stack base or pointer. ss_size*: int ## Stack size. ss_flags*: cint ## Flags.
SigStack = object ss_onstack*: cint ## Non-zero when signal stack is in use. ss_sp*: pointer ## Signal stack pointer.
SigInfo = 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.
Nl_item = cint
Nl_catd = cint
Sched_param = object sched_priority*: cint sched_ss_low_priority*: cint ## Low scheduling priority for ## sporadic server. sched_ss_repl_period*: Timespec ## Replenishment period for ## sporadic server. sched_ss_init_budget*: Timespec ## Initial budget for sporadic server. sched_ss_max_repl*: cint ## Maximum pending replenishments for ## sporadic server.
Timeval = object tv_sec*: int ## Seconds. tv_usec*: int ## Microseconds.
TFdSet = object
Mcontext = object
Ucontext = object uc_link*: ptr Ucontext ## Pointer to the context that is resumed ## when this context returns. uc_sigmask*: Sigset ## The set of signals that are blocked when this ## context is active. uc_stack*: Stack ## The stack used by this context. uc_mcontext*: Mcontext ## A machine-specific representation of the saved ## context.
Tposix_spawnattr = object
Tposix_spawn_file_actions = object
Socklen = cuint
TSa_Family = cint
SockAddr = object sa_family*: TSa_Family ## Address family. sa_data*: array[0 .. 255, char] ## Socket address (variable-length data).
Sockaddr_un = object sun_family*: TSa_Family ## Address family. sun_path*: array[0 .. 92 - 1, char] ## Socket path
Sockaddr_storage = object ss_family*: TSa_Family ## Address family.
Tif_nameindex = object if_index*: cint ## Numeric index of the interface. if_name*: cstring ## Null-terminated name of the interface.
IOVec = object iov_base*: pointer ## Base address of a memory region for input or output. iov_len*: int ## The size of the memory pointed to by iov_base.
Tmsghdr = object msg_name*: pointer ## Optional address. msg_namelen*: Socklen ## Size of address. msg_iov*: ptr IOVec ## Scatter/gather array. msg_iovlen*: cint ## Members in msg_iov. msg_control*: pointer ## Ancillary data; see below. msg_controllen*: Socklen ## Ancillary data buffer len. msg_flags*: cint ## Flags on received message.
Tcmsghdr = object cmsg_len*: Socklen ## Data byte count, including the cmsghdr. cmsg_level*: cint ## Originating protocol. cmsg_type*: cint ## Protocol-specific type.
TLinger = object l_onoff*: cint ## Indicates whether linger option is enabled. l_linger*: cint ## Linger time, in seconds.
InPort = uint16
InAddrScalar = uint32
InAddrT = uint32
InAddr = object s_addr*: InAddrScalar
Sockaddr_in = object sin_family*: TSa_Family ## AF_INET. sin_port*: InPort ## Port number. sin_addr*: InAddr ## IP address.
In6Addr = object s6_addr*: array[0 .. 15, char]
Sockaddr_in6 = object sin6_family*: TSa_Family ## AF_INET6. sin6_port*: InPort ## Port number. sin6_flowinfo*: int32 ## IPv6 traffic class and flow information. sin6_addr*: In6Addr ## IPv6 address. sin6_scope_id*: int32 ## Set of interfaces for a scope.
Tipv6_mreq = object ipv6mr_multiaddr*: In6Addr ## IPv6 multicast address. ipv6mr_interface*: cint ## Interface index.
Hostent = 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.
Tnetent = 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*: int32 ## The network number, in host byte order.
Protoent = 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.
Servent = 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.
AddrInfo = 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.
TPollfd = object fd*: cint ## The following descriptor being polled. events*: cshort ## The input event flags (see below). revents*: cshort ## The output event flags (see below).
Tnfds = cint
errno: cint
h_errno: cint
daylight: cint
timezone: int
AIO_ALLDONE: cint
AIO_CANCELED: cint
AIO_NOTCANCELED: cint
LIO_NOP: cint
LIO_NOWAIT: cint
LIO_READ: cint
LIO_WAIT: cint
LIO_WRITE: cint
RTLD_LAZY: cint
RTLD_NOW: cint
RTLD_GLOBAL: cint
RTLD_LOCAL: cint
E2BIG: cint
EACCES: cint
EADDRINUSE: cint
EADDRNOTAVAIL: cint
EAFNOSUPPORT: cint
EAGAIN: cint
EALREADY: cint
EBADF: cint
EBADMSG: cint
EBUSY: cint
ECANCELED: cint
ECHILD: cint
ECONNABORTED: cint
ECONNREFUSED: cint
ECONNRESET: cint
EDEADLK: cint
EDESTADDRREQ: cint
EDOM: cint
EDQUOT: cint
EEXIST: cint
EFAULT: cint
EFBIG: cint
EHOSTUNREACH: cint
EIDRM: cint
EILSEQ: cint
EINPROGRESS: cint
EINTR: cint
EINVAL: cint
EIO: cint
EISCONN: cint
EISDIR: cint
ELOOP: cint
EMFILE: cint
EMLINK: cint
EMSGSIZE: cint
EMULTIHOP: cint
ENAMETOOLONG: cint
ENETDOWN: cint
ENETRESET: cint
ENETUNREACH: cint
ENFILE: cint
ENOBUFS: cint
ENODATA: cint
ENODEV: cint
ENOENT: cint
ENOEXEC: cint
ENOLCK: cint
ENOLINK: cint
ENOMEM: cint
ENOMSG: cint
ENOPROTOOPT: cint
ENOSPC: cint
ENOSR: cint
ENOSTR: cint
ENOSYS: cint
ENOTCONN: cint
ENOTDIR: cint
ENOTEMPTY: cint
ENOTSOCK: cint
ENOTSUP: cint
ENOTTY: cint
ENXIO: cint
EOPNOTSUPP: cint
EOVERFLOW: cint
EPERM: cint
EPIPE: cint
EPROTO: cint
EPROTONOSUPPORT: cint
EPROTOTYPE: cint
ERANGE: cint
EROFS: cint
ESPIPE: cint
ESRCH: cint
ESTALE: cint
ETIME: cint
ETIMEDOUT: cint
ETXTBSY: cint
EWOULDBLOCK: cint
EXDEV: cint
F_DUPFD: cint
F_GETFD: cint
F_SETFD: cint
F_GETFL: cint
F_SETFL: cint
F_GETLK: cint
F_SETLK: cint
F_SETLKW: cint
F_GETOWN: cint
F_SETOWN: cint
FD_CLOEXEC: cint
F_RDLCK: cint
F_UNLCK: cint
F_WRLCK: cint
O_CREAT: cint
O_EXCL: cint
O_NOCTTY: cint
O_TRUNC: cint
O_APPEND: cint
O_DSYNC: cint
O_NONBLOCK: cint
O_RSYNC: cint
O_SYNC: cint
O_ACCMODE: cint
O_RDONLY: cint
O_RDWR: cint
O_WRONLY: cint
POSIX_FADV_NORMAL: cint
POSIX_FADV_SEQUENTIAL: cint
POSIX_FADV_RANDOM: cint
POSIX_FADV_WILLNEED: cint
POSIX_FADV_DONTNEED: cint
POSIX_FADV_NOREUSE: cint
FE_DIVBYZERO: cint
FE_INEXACT: cint
FE_INVALID: cint
FE_OVERFLOW: cint
FE_UNDERFLOW: cint
FE_ALL_EXCEPT: cint
FE_DOWNWARD: cint
FE_TONEAREST: cint
FE_TOWARDZERO: cint
FE_UPWARD: cint
FE_DFL_ENV: cint
MM_HARD: cint
MM_SOFT: cint
MM_FIRM: cint
MM_APPL: cint
MM_UTIL: cint
MM_OPSYS: cint
MM_RECOVER: cint
MM_NRECOV: cint
MM_HALT: cint
MM_ERROR: cint
MM_WARNING: cint
MM_INFO: cint
MM_NOSEV: cint
MM_PRINT: cint
MM_CONSOLE: cint
MM_OK: cint
MM_NOTOK: cint
MM_NOMSG: cint
MM_NOCON: cint
FNM_NOMATCH: cint
FNM_PATHNAME: cint
FNM_PERIOD: cint
FNM_NOESCAPE: cint
FNM_NOSYS: cint
FTW_F: cint
FTW_D: cint
FTW_DNR: cint
FTW_DP: cint
FTW_NS: cint
FTW_SL: cint
FTW_SLN: cint
FTW_PHYS: cint
FTW_MOUNT: cint
FTW_DEPTH: cint
FTW_CHDIR: cint
GLOB_APPEND: cint
GLOB_DOOFFS: cint
GLOB_ERR: cint
GLOB_MARK: cint
GLOB_NOCHECK: cint
GLOB_NOESCAPE: cint
GLOB_NOSORT: cint
GLOB_ABORTED: cint
GLOB_NOMATCH: cint
GLOB_NOSPACE: cint
GLOB_NOSYS: cint
CODESET: cint
D_T_FMT: cint
D_FMT: cint
T_FMT: cint
T_FMT_AMPM: cint
AM_STR: cint
PM_STR: cint
DAY_1: cint
DAY_2: cint
DAY_3: cint
DAY_4: cint
DAY_5: cint
DAY_6: cint
DAY_7: cint
ABDAY_1: cint
ABDAY_2: cint
ABDAY_3: cint
ABDAY_4: cint
ABDAY_5: cint
ABDAY_6: cint
ABDAY_7: cint
MON_1: cint
MON_2: cint
MON_3: cint
MON_4: cint
MON_5: cint
MON_6: cint
MON_7: cint
MON_8: cint
MON_9: cint
MON_10: cint
MON_11: cint
MON_12: cint
ABMON_1: cint
ABMON_2: cint
ABMON_3: cint
ABMON_4: cint
ABMON_5: cint
ABMON_6: cint
ABMON_7: cint
ABMON_8: cint
ABMON_9: cint
ABMON_10: cint
ABMON_11: cint
ABMON_12: cint
ERA: cint
ERA_D_FMT: cint
ERA_D_T_FMT: cint
ERA_T_FMT: cint
ALT_DIGITS: cint
RADIXCHAR: cint
THOUSEP: cint
YESEXPR: cint
NOEXPR: cint
CRNCYSTR: cint
LC_ALL: cint
LC_COLLATE: cint
LC_CTYPE: cint
LC_MESSAGES: cint
LC_MONETARY: cint
LC_NUMERIC: cint
LC_TIME: cint
IPPORT_RESERVED: cint
HOST_NOT_FOUND: cint
NO_DATA: cint
NO_RECOVERY: cint
TRY_AGAIN: cint
AI_PASSIVE: cint
AI_CANONNAME: cint
AI_NUMERICHOST: cint
AI_NUMERICSERV: cint
AI_V4MAPPED: cint
AI_ALL: cint
AI_ADDRCONFIG: cint
NI_NOFQDN: cint
NI_NUMERICHOST: cint
NI_NAMEREQD: cint
NI_NUMERICSERV: cint
NI_NUMERICSCOPE: cint
NI_DGRAM: cint
EAI_AGAIN: cint
EAI_BADFLAGS: cint
EAI_FAIL: cint
EAI_FAMILY: cint
EAI_MEMORY: cint
EAI_NONAME: cint
EAI_SERVICE: cint
EAI_SOCKTYPE: cint
EAI_SYSTEM: cint
EAI_OVERFLOW: cint
IF_NAMESIZE: cint
IPPROTO_IP: cint
IPPROTO_IPV6: cint
IPPROTO_ICMP: cint
IPPROTO_RAW: cint
IPPROTO_TCP: cint
IPPROTO_UDP: cint
INADDR_ANY: InAddrScalar
INADDR_LOOPBACK: InAddrScalar
INADDR_BROADCAST: InAddrScalar
INET_ADDRSTRLEN: cint
INET6_ADDRSTRLEN: cint
IPV6_JOIN_GROUP: cint
IPV6_LEAVE_GROUP: cint
IPV6_MULTICAST_HOPS: cint
IPV6_MULTICAST_IF: cint
IPV6_MULTICAST_LOOP: cint
IPV6_UNICAST_HOPS: cint
IPV6_V6ONLY: cint
TCP_NODELAY: cint
NL_SETD: cint
NL_CAT_LOCALE: cint
POLLIN: cshort
POLLRDNORM: cshort
POLLRDBAND: cshort
POLLPRI: cshort
POLLOUT: cshort
POLLWRNORM: cshort
POLLWRBAND: cshort
POLLERR: cshort
POLLHUP: cshort
POLLNVAL: cshort
PTHREAD_BARRIER_SERIAL_THREAD: cint
PTHREAD_CANCEL_ASYNCHRONOUS: cint
PTHREAD_CANCEL_ENABLE: cint
PTHREAD_CANCEL_DEFERRED: cint
PTHREAD_CANCEL_DISABLE: cint
PTHREAD_CREATE_DETACHED: cint
PTHREAD_CREATE_JOINABLE: cint
PTHREAD_EXPLICIT_SCHED: cint
PTHREAD_INHERIT_SCHED: cint
PTHREAD_MUTEX_DEFAULT: cint
PTHREAD_MUTEX_ERRORCHECK: cint
PTHREAD_MUTEX_NORMAL: cint
PTHREAD_MUTEX_RECURSIVE: cint
PTHREAD_PRIO_INHERIT: cint
PTHREAD_PRIO_NONE: cint
PTHREAD_PRIO_PROTECT: cint
PTHREAD_PROCESS_SHARED: cint
PTHREAD_PROCESS_PRIVATE: cint
PTHREAD_SCOPE_PROCESS: cint
PTHREAD_SCOPE_SYSTEM: cint
SCHED_FIFO: cint
SCHED_RR: cint
SCHED_SPORADIC: cint
SCHED_OTHER: cint
SEM_FAILED: pointer
SIGEV_NONE: cint
SIGEV_SIGNAL: cint
SIGEV_THREAD: cint
SIGABRT: cint
SIGALRM: cint
SIGBUS: cint
SIGCHLD: cint
SIGCONT: cint
SIGFPE: cint
SIGHUP: cint
SIGILL: cint
SIGINT: cint
SIGKILL: cint
SIGPIPE: cint
SIGQUIT: cint
SIGSEGV: cint
SIGSTOP: cint
SIGTERM: cint
SIGTSTP: cint
SIGTTIN: cint
SIGTTOU: cint
SIGUSR1: cint
SIGUSR2: cint
SIGPOLL: cint
SIGPROF: cint
SIGSYS: cint
SIGTRAP: cint
SIGURG: cint
SIGVTALRM: cint
SIGXCPU: cint
SIGXFSZ: cint
SA_NOCLDSTOP: cint
SIG_BLOCK: cint
SIG_UNBLOCK: cint
SIG_SETMASK: cint
SA_ONSTACK: cint
SA_RESETHAND: cint
SA_RESTART: cint
SA_SIGINFO: cint
SA_NOCLDWAIT: cint
SA_NODEFER: cint
SS_ONSTACK: cint
SS_DISABLE: cint
MINSIGSTKSZ: cint
SIGSTKSZ: cint
SIG_HOLD: Sighandler
SIG_DFL: Sighandler
SIG_ERR: Sighandler
SIG_IGN: Sighandler
IPC_CREAT: cint
IPC_EXCL: cint
IPC_NOWAIT: cint
IPC_PRIVATE: cint
IPC_RMID: cint
IPC_SET: cint
IPC_STAT: cint
PROT_READ: cint
PROT_WRITE: cint
PROT_EXEC: cint
PROT_NONE: cint
MAP_SHARED: cint
MAP_PRIVATE: cint
MAP_FIXED: cint
MS_ASYNC: cint
MS_SYNC: cint
MS_INVALIDATE: cint
MCL_CURRENT: cint
MCL_FUTURE: cint
MAP_FAILED: pointer
POSIX_MADV_NORMAL: cint
POSIX_MADV_SEQUENTIAL: cint
POSIX_MADV_RANDOM: cint
POSIX_MADV_WILLNEED: cint
POSIX_MADV_DONTNEED: cint
POSIX_TYPED_MEM_ALLOCATE: cint
POSIX_TYPED_MEM_ALLOCATE_CONTIG: cint
POSIX_TYPED_MEM_MAP_ALLOCATABLE: cint
FD_SETSIZE: cint
MSG_CTRUNC: cint
MSG_DONTROUTE: cint
MSG_EOR: cint
MSG_OOB: cint
SCM_RIGHTS: cint
SO_ACCEPTCONN: cint
SO_BROADCAST: cint
SO_DEBUG: cint
SO_DONTROUTE: cint
SO_ERROR: cint
SO_KEEPALIVE: cint
SO_LINGER: cint
SO_OOBINLINE: cint
SO_RCVBUF: cint
SO_RCVLOWAT: cint
SO_RCVTIMEO: cint
SO_REUSEADDR: cint
SO_SNDBUF: cint
SO_SNDLOWAT: cint
SO_SNDTIMEO: cint
SO_TYPE: cint
SOCK_DGRAM: cint
SOCK_RAW: cint
SOCK_SEQPACKET: cint
SOCK_STREAM: cint
SOL_SOCKET: cint
SOMAXCONN: cint
MSG_PEEK: cint
MSG_TRUNC: cint
MSG_WAITALL: cint
AF_INET: TSa_Family
AF_INET6: TSa_Family
AF_UNIX: TSa_Family
AF_UNSPEC: TSa_Family
SHUT_RD: cint
SHUT_RDWR: cint
SHUT_WR: cint
S_IFBLK: cint
S_IFCHR: cint
S_IFDIR: cint
S_IFIFO: cint
S_IFLNK: cint
S_IFMT: cint
S_IFREG: cint
S_IFSOCK: cint
S_IRGRP: cint
S_IROTH: cint
S_IRUSR: cint
S_IRWXG: cint
S_IRWXO: cint
S_IRWXU: cint
S_ISGID: cint
S_ISUID: cint
S_ISVTX: cint
S_IWGRP: cint
S_IWOTH: cint
S_IWUSR: cint
S_IXGRP: cint
S_IXOTH: cint
S_IXUSR: cint
ST_RDONLY: cint
ST_NOSUID: cint
WNOHANG: cint
WUNTRACED: cint
WEXITED: cint
WSTOPPED: cint
WCONTINUED: cint
WNOWAIT: cint
P_ALL: cint
P_PID: cint
P_PGID: cint
POSIX_SPAWN_RESETIDS: cint
POSIX_SPAWN_SETPGROUP: cint
POSIX_SPAWN_SETSCHEDPARAM: cint
POSIX_SPAWN_SETSCHEDULER: cint
POSIX_SPAWN_SETSIGDEF: cint
POSIX_SPAWN_SETSIGMASK: cint
IOFBF: cint
IONBF: cint
CLOCKS_PER_SEC: clong
CLOCK_PROCESS_CPUTIME_ID: cint
CLOCK_THREAD_CPUTIME_ID: cint
CLOCK_REALTIME: cint
TIMER_ABSTIME: cint
CLOCK_MONOTONIC: cint
POSIX_ASYNC_IO: cint
POSIX_PRIO_IO: cint
POSIX_SYNC_IO: cint
F_OK: cint
R_OK: cint
W_OK: cint
X_OK: cint
CS_PATH: cint
CS_POSIX_V6_ILP32_OFF32_CFLAGS: cint
CS_POSIX_V6_ILP32_OFF32_LDFLAGS: cint
CS_POSIX_V6_ILP32_OFF32_LIBS: cint
CS_POSIX_V6_ILP32_OFFBIG_CFLAGS: cint
CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS: cint
CS_POSIX_V6_ILP32_OFFBIG_LIBS: cint
CS_POSIX_V6_LP64_OFF64_CFLAGS: cint
CS_POSIX_V6_LP64_OFF64_LDFLAGS: cint
CS_POSIX_V6_LP64_OFF64_LIBS: cint
CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS: cint
CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS: cint
CS_POSIX_V6_LPBIG_OFFBIG_LIBS: cint
CS_POSIX_V6_WIDTH_RESTRICTED_ENVS: cint
F_LOCK: cint
F_TEST: cint
F_TLOCK: cint
F_ULOCK: cint
PC_2_SYMLINKS: cint
PC_ALLOC_SIZE_MIN: cint
PC_ASYNC_IO: cint
PC_CHOWN_RESTRICTED: cint
PC_FILESIZEBITS: cint
PC_LINK_MAX: cint
PC_MAX_CANON: cint
PC_MAX_INPUT: cint
PC_NAME_MAX: cint
PC_NO_TRUNC: cint
PC_PATH_MAX: cint
PC_PIPE_BUF: cint
PC_PRIO_IO: cint
PC_REC_INCR_XFER_SIZE: cint
PC_REC_MIN_XFER_SIZE: cint
PC_REC_XFER_ALIGN: cint
PC_SYMLINK_MAX: cint
PC_SYNC_IO: cint
PC_VDISABLE: cint
SC_2_C_BIND: cint
SC_2_C_DEV: cint
SC_2_CHAR_TERM: cint
SC_2_FORT_DEV: cint
SC_2_FORT_RUN: cint
SC_2_LOCALEDEF: cint
SC_2_PBS: cint
SC_2_PBS_ACCOUNTING: cint
SC_2_PBS_CHECKPOINT: cint
SC_2_PBS_LOCATE: cint
SC_2_PBS_MESSAGE: cint
SC_2_PBS_TRACK: cint
SC_2_SW_DEV: cint
SC_2_UPE: cint
SC_2_VERSION: cint
SC_ADVISORY_INFO: cint
SC_AIO_LISTIO_MAX: cint
SC_AIO_MAX: cint
SC_AIO_PRIO_DELTA_MAX: cint
SC_ARG_MAX: cint
SC_ASYNCHRONOUS_IO: cint
SC_ATEXIT_MAX: cint
SC_BARRIERS: cint
SC_BC_BASE_MAX: cint
SC_BC_DIM_MAX: cint
SC_BC_SCALE_MAX: cint
SC_BC_STRING_MAX: cint
SC_CHILD_MAX: cint
SC_CLK_TCK: cint
SC_CLOCK_SELECTION: cint
SC_COLL_WEIGHTS_MAX: cint
SC_CPUTIME: cint
SC_DELAYTIMER_MAX: cint
SC_EXPR_NEST_MAX: cint
SC_FSYNC: cint
SC_GETGR_R_SIZE_MAX: cint
SC_GETPW_R_SIZE_MAX: cint
SC_HOST_NAME_MAX: cint
SC_IOV_MAX: cint
SC_IPV6: cint
SC_JOB_CONTROL: cint
SC_LINE_MAX: cint
SC_LOGIN_NAME_MAX: cint
SC_MAPPED_FILES: cint
SC_MEMLOCK: cint
SC_MEMLOCK_RANGE: cint
SC_MEMORY_PROTECTION: cint
SC_MESSAGE_PASSING: cint
SC_MONOTONIC_CLOCK: cint
SC_MQ_OPEN_MAX: cint
SC_MQ_PRIO_MAX: cint
SC_NGROUPS_MAX: cint
SC_OPEN_MAX: cint
SC_PAGE_SIZE: cint
SC_PRIORITIZED_IO: cint
SC_PRIORITY_SCHEDULING: cint
SC_RAW_SOCKETS: cint
SC_RE_DUP_MAX: cint
SC_READER_WRITER_LOCKS: cint
SC_REALTIME_SIGNALS: cint
SC_REGEXP: cint
SC_RTSIG_MAX: cint
SC_SAVED_IDS: cint
SC_SEM_NSEMS_MAX: cint
SC_SEM_VALUE_MAX: cint
SC_SEMAPHORES: cint
SC_SHARED_MEMORY_OBJECTS: cint
SC_SHELL: cint
SC_SIGQUEUE_MAX: cint
SC_SPAWN: cint
SC_SPIN_LOCKS: cint
SC_SPORADIC_SERVER: cint
SC_SS_REPL_MAX: cint
SC_STREAM_MAX: cint
SC_SYMLOOP_MAX: cint
SC_SYNCHRONIZED_IO: cint
SC_THREAD_ATTR_STACKADDR: cint
SC_THREAD_ATTR_STACKSIZE: cint
SC_THREAD_CPUTIME: cint
SC_THREAD_DESTRUCTOR_ITERATIONS: cint
SC_THREAD_KEYS_MAX: cint
SC_THREAD_PRIO_INHERIT: cint
SC_THREAD_PRIO_PROTECT: cint
SC_THREAD_PRIORITY_SCHEDULING: cint
SC_THREAD_PROCESS_SHARED: cint
SC_THREAD_SAFE_FUNCTIONS: cint
SC_THREAD_SPORADIC_SERVER: cint
SC_THREAD_STACK_MIN: cint
SC_THREAD_THREADS_MAX: cint
SC_THREADS: cint
SC_TIMEOUTS: cint
SC_TIMER_MAX: cint
SC_TIMERS: cint
SC_TRACE: cint
SC_TRACE_EVENT_FILTER: cint
SC_TRACE_EVENT_NAME_MAX: cint
SC_TRACE_INHERIT: cint
SC_TRACE_LOG: cint
SC_TRACE_NAME_MAX: cint
SC_TRACE_SYS_MAX: cint
SC_TRACE_USER_EVENT_MAX: cint
SC_TTY_NAME_MAX: cint
SC_TYPED_MEMORY_OBJECTS: cint
SC_TZNAME_MAX: cint
SC_V6_ILP32_OFF32: cint
SC_V6_ILP32_OFFBIG: cint
SC_V6_LP64_OFF64: cint
SC_V6_LPBIG_OFFBIG: cint
SC_VERSION: cint
SC_XBS5_ILP32_OFF32: cint
SC_XBS5_ILP32_OFFBIG: cint
SC_XBS5_LP64_OFF64: cint
SC_XBS5_LPBIG_OFFBIG: cint
SC_XOPEN_CRYPT: cint
SC_XOPEN_ENH_I18N: cint
SC_XOPEN_LEGACY: cint
SC_XOPEN_REALTIME: cint
SC_XOPEN_REALTIME_THREADS: cint
SC_XOPEN_SHM: cint
SC_XOPEN_STREAMS: cint
SC_XOPEN_UNIX: cint
SC_XOPEN_VERSION: cint
SC_NPROCESSORS_ONLN: cint
SEEK_SET: cint
SEEK_CUR: cint
SEEK_END: cint
MAP_POPULATE: cint = 0
MSG_NOSIGNAL: cint
in6addr_any: In6Addr
in6addr_loopback: In6Addr
MM_NULLLBL = nil
MM_NULLSEV = 0
MM_NULLMC = 0
MM_NULLTXT = nil
MM_NULLACT = nil
MM_NULLTAG = nil
STDERR_FILENO = 2
STDIN_FILENO = 0
STDOUT_FILENO = 1
DT_UNKNOWN = 0
DT_FIFO = 1
DT_CHR = 2
DT_DIR = 4
DT_BLK = 6
DT_REG = 8
DT_LNK = 10
DT_SOCK = 12
DT_WHT = 14
Sockaddr_un_path_length = 92
SO_REUSEPORT = 0x00000200
POSIX_SPAWN_USEVFORK = 0
INVALID_SOCKET = -1
proc WEXITSTATUS(s: cint): cint {.importc, header: "<sys/wait.h>".}
proc WTERMSIG(s: cint): cint {.importc, header: "<sys/wait.h>".}
proc WSTOPSIG(s: cint): cint {.importc, header: "<sys/wait.h>".}
proc WIFEXITED(s: cint): bool {.importc, header: "<sys/wait.h>".}
proc WIFSIGNALED(s: cint): bool {.importc, header: "<sys/wait.h>".}
proc WIFSTOPPED(s: cint): bool {.importc, header: "<sys/wait.h>".}
proc WIFCONTINUED(s: cint): bool {.importc, header: "<sys/wait.h>".}
proc st_atime(s: Stat): Time {.inline, raises: [], tags: [].}
proc st_mtime(s: Stat): Time {.inline, raises: [], tags: [].}
proc st_ctime(s: Stat): Time {.inline, raises: [], tags: [].}
proc htonl(a1: uint32): uint32 {.importc, header: "<arpa/inet.h>".}
proc htons(a1: uint16): uint16 {.importc, header: "<arpa/inet.h>".}
proc ntohl(a1: uint32): uint32 {.importc, header: "<arpa/inet.h>".}
proc ntohs(a1: uint16): uint16 {.importc, header: "<arpa/inet.h>".}
proc inet_addr(a1: cstring): InAddrT {.importc, header: "<arpa/inet.h>".}
proc inet_ntoa(a1: InAddr): cstring {.importc, header: "<arpa/inet.h>".}
proc inet_ntop(a1: cint; a2: pointer; a3: cstring; a4: int32): cstring {. importc: "(char *)$1", header: "<arpa/inet.h>".}
proc inet_pton(a1: cint; a2: cstring; a3: pointer): cint {.importc, header: "<arpa/inet.h>".}
proc IN6ADDR_ANY_INIT(): In6Addr {.importc, header: "<netinet/in.h>".}
proc IN6ADDR_LOOPBACK_INIT(): In6Addr {.importc, header: "<netinet/in.h>".}
proc closedir(a1: ptr DIR): cint {.importc, header: "<dirent.h>".}
proc opendir(a1: cstring): ptr DIR {.importc, header: "<dirent.h>".}
proc readdir(a1: ptr DIR): ptr Dirent {.importc, header: "<dirent.h>".}
proc readdir_r(a1: ptr DIR; a2: ptr Dirent; a3: ptr ptr Dirent): cint {.importc, header: "<dirent.h>".}
proc rewinddir(a1: ptr DIR) {.importc, header: "<dirent.h>".}
proc seekdir(a1: ptr DIR; a2: int) {.importc, header: "<dirent.h>".}
proc telldir(a1: ptr DIR): int {.importc, header: "<dirent.h>".}
proc dlclose(a1: pointer): cint {.importc, header: "<dlfcn.h>".}
proc dlerror(): cstring {.importc, header: "<dlfcn.h>".}
proc dlopen(a1: cstring; a2: cint): pointer {.importc, header: "<dlfcn.h>".}
proc dlsym(a1: pointer; a2: cstring): pointer {.importc, header: "<dlfcn.h>".}
proc creat(a1: cstring; a2: Mode): cint {.importc, header: "<fcntl.h>".}
proc fcntl(a1: cint | SocketHandle; a2: cint): cint {.varargs, importc, header: "<fcntl.h>".}
proc open(a1: cstring; a2: cint): cint {.varargs, importc, header: "<fcntl.h>".}
proc posix_fadvise(a1: cint; a2, a3: Off; a4: cint): cint {.importc, header: "<fcntl.h>".}
proc posix_fallocate(a1: cint; a2, a3: Off): cint {.importc, header: "<fcntl.h>".}
proc fmtmsg(a1: int; a2: cstring; a3: cint; a4, a5, a6: cstring): cint {.importc, header: "<fmtmsg.h>".}
proc fnmatch(a1, a2: cstring; a3: cint): cint {.importc, header: "<fnmatch.h>".}
proc ftw(a1: cstring; a2: proc (x1: cstring; x2: ptr Stat; x3: cint): cint {.noconv.}; a3: cint): cint {. importc, header: "<ftw.h>".}
proc nftw(a1: cstring; a2: proc (x1: cstring; x2: ptr Stat; x3: cint; x4: ptr FTW): cint {. noconv.}; a3: cint; a4: cint): cint {.importc, header: "<ftw.h>".}
proc glob(a1: cstring; a2: cint; a3: proc (x1: cstring; x2: cint): cint {.noconv.}; a4: ptr Glob): cint {.importc, header: "<glob.h>".}
proc globfree(a1: ptr Glob) {.importc, header: "<glob.h>".}
proc getgrgid(a1: Gid): ptr Group {.importc, header: "<grp.h>".}
proc getgrnam(a1: cstring): ptr Group {.importc, header: "<grp.h>".}
proc getgrgid_r(a1: Gid; a2: ptr Group; a3: cstring; a4: int; a5: ptr ptr Group): cint {. importc, header: "<grp.h>".}
proc getgrnam_r(a1: cstring; a2: ptr Group; a3: cstring; a4: int; a5: ptr ptr Group): cint {. importc, header: "<grp.h>".}
proc getgrent(): ptr Group {.importc, header: "<grp.h>".}
proc endgrent() {.importc, header: "<grp.h>".}
proc setgrent() {.importc, header: "<grp.h>".}
proc iconv_open(a1, a2: cstring): Iconv {.importc, header: "<iconv.h>".}
proc iconv(a1: Iconv; a2: var cstring; a3: var int; a4: var cstring; a5: var int): int {. importc, header: "<iconv.h>".}
proc iconv_close(a1: Iconv): cint {.importc, header: "<iconv.h>".}
proc nl_langinfo(a1: Nl_item): cstring {.importc, header: "<langinfo.h>".}
proc basename(a1: cstring): cstring {.importc, header: "<libgen.h>".}
proc dirname(a1: cstring): cstring {.importc, header: "<libgen.h>".}
proc localeconv(): ptr Lconv {.importc, header: "<locale.h>".}
proc setlocale(a1: cint; a2: cstring): cstring {.importc, header: "<locale.h>".}
proc strfmon(a1: cstring; a2: int; a3: cstring): int {.varargs, importc, header: "<monetary.h>".}
proc mq_close(a1: Mqd): cint {.importc, header: "<mqueue.h>".}
proc mq_getattr(a1: Mqd; a2: ptr MqAttr): cint {.importc, header: "<mqueue.h>".}
proc mq_notify(a1: Mqd; a2: ptr SigEvent): cint {.importc, header: "<mqueue.h>".}
proc mq_open(a1: cstring; a2: cint): Mqd {.varargs, importc, header: "<mqueue.h>".}
proc mq_receive(a1: Mqd; a2: cstring; a3: int; a4: var int): int {.importc, header: "<mqueue.h>".}
proc mq_send(a1: Mqd; a2: cstring; a3: int; a4: int): cint {.importc, header: "<mqueue.h>".}
proc mq_setattr(a1: Mqd; a2, a3: ptr MqAttr): cint {.importc, header: "<mqueue.h>".}
proc mq_timedreceive(a1: Mqd; a2: cstring; a3: int; a4: int; a5: ptr Timespec): int {. importc, header: "<mqueue.h>".}
proc mq_timedsend(a1: Mqd; a2: cstring; a3: int; a4: int; a5: ptr Timespec): cint {.importc, header: "<mqueue.h>".}
proc mq_unlink(a1: cstring): cint {.importc, header: "<mqueue.h>".}
proc getpwnam(a1: cstring): ptr Passwd {.importc, header: "<pwd.h>".}
proc getpwuid(a1: Uid): ptr Passwd {.importc, header: "<pwd.h>".}
proc getpwnam_r(a1: cstring; a2: ptr Passwd; a3: cstring; a4: int; a5: ptr ptr Passwd): cint {. importc, header: "<pwd.h>".}
proc getpwuid_r(a1: Uid; a2: ptr Passwd; a3: cstring; a4: int; a5: ptr ptr Passwd): cint {. importc, header: "<pwd.h>".}
proc endpwent() {.importc, header: "<pwd.h>".}
proc getpwent(): ptr Passwd {.importc, header: "<pwd.h>".}
proc setpwent() {.importc, header: "<pwd.h>".}
proc uname(a1: var Utsname): cint {.importc, header: "<sys/utsname.h>".}
proc pthread_atfork(a1, a2, a3: proc () {.noconv.}): cint {.importc, header: "<pthread.h>".}
proc pthread_attr_destroy(a1: ptr Pthread_attr): cint {.importc, header: "<pthread.h>".}
proc pthread_attr_getdetachstate(a1: ptr Pthread_attr; a2: cint): cint {.importc, header: "<pthread.h>".}
proc pthread_attr_getguardsize(a1: ptr Pthread_attr; a2: var cint): cint {.importc, header: "<pthread.h>".}
proc pthread_attr_getinheritsched(a1: ptr Pthread_attr; a2: var cint): cint {.importc, header: "<pthread.h>".}
proc pthread_attr_getschedparam(a1: ptr Pthread_attr; a2: ptr Sched_param): cint {. importc, header: "<pthread.h>".}
proc pthread_attr_getschedpolicy(a1: ptr Pthread_attr; a2: var cint): cint {.importc, header: "<pthread.h>".}
proc pthread_attr_getscope(a1: ptr Pthread_attr; a2: var cint): cint {.importc, header: "<pthread.h>".}
proc pthread_attr_getstack(a1: ptr Pthread_attr; a2: var pointer; a3: var int): cint {. importc, header: "<pthread.h>".}
proc pthread_attr_getstackaddr(a1: ptr Pthread_attr; a2: var pointer): cint {.importc, header: "<pthread.h>".}
proc pthread_attr_getstacksize(a1: ptr Pthread_attr; a2: var int): cint {.importc, header: "<pthread.h>".}
proc pthread_attr_init(a1: ptr Pthread_attr): cint {.importc, header: "<pthread.h>".}
proc pthread_attr_setdetachstate(a1: ptr Pthread_attr; a2: cint): cint {.importc, header: "<pthread.h>".}
proc pthread_attr_setguardsize(a1: ptr Pthread_attr; a2: int): cint {.importc, header: "<pthread.h>".}
proc pthread_attr_setinheritsched(a1: ptr Pthread_attr; a2: cint): cint {.importc, header: "<pthread.h>".}
proc pthread_attr_setschedparam(a1: ptr Pthread_attr; a2: ptr Sched_param): cint {. importc, header: "<pthread.h>".}
proc pthread_attr_setschedpolicy(a1: ptr Pthread_attr; a2: cint): cint {.importc, header: "<pthread.h>".}
proc pthread_attr_setscope(a1: ptr Pthread_attr; a2: cint): cint {.importc, header: "<pthread.h>".}
proc pthread_attr_setstack(a1: ptr Pthread_attr; a2: pointer; a3: int): cint {.importc, header: "<pthread.h>".}
proc pthread_attr_setstackaddr(a1: ptr Pthread_attr; a2: pointer): cint {.importc, header: "<pthread.h>".}
proc pthread_attr_setstacksize(a1: ptr Pthread_attr; a2: int): cint {.importc, header: "<pthread.h>".}
proc pthread_barrier_destroy(a1: ptr Pthread_barrier): cint {.importc, header: "<pthread.h>".}
proc pthread_barrier_init(a1: ptr Pthread_barrier; a2: ptr Pthread_barrierattr; a3: cint): cint {.importc, header: "<pthread.h>".}
proc pthread_barrier_wait(a1: ptr Pthread_barrier): cint {.importc, header: "<pthread.h>".}
proc pthread_barrierattr_destroy(a1: ptr Pthread_barrierattr): cint {.importc, header: "<pthread.h>".}
proc pthread_barrierattr_init(a1: ptr Pthread_barrierattr): cint {.importc, header: "<pthread.h>".}
proc pthread_cancel(a1: Pthread): cint {.importc, header: "<pthread.h>".}
proc pthread_cleanup_push(a1: proc (x: pointer) {.noconv.}; a2: pointer) {.importc, header: "<pthread.h>".}
proc pthread_cleanup_pop(a1: cint) {.importc, header: "<pthread.h>".}
proc pthread_cond_broadcast(a1: ptr Pthread_cond): cint {.importc, header: "<pthread.h>".}
proc pthread_cond_destroy(a1: ptr Pthread_cond): cint {.importc, header: "<pthread.h>".}
proc pthread_cond_init(a1: ptr Pthread_cond; a2: ptr Pthread_condattr): cint {.importc, header: "<pthread.h>".}
proc pthread_cond_signal(a1: ptr Pthread_cond): cint {.importc, header: "<pthread.h>".}
proc pthread_cond_timedwait(a1: ptr Pthread_cond; a2: ptr Pthread_mutex; a3: ptr Timespec): cint {.importc, header: "<pthread.h>".}
proc pthread_cond_wait(a1: ptr Pthread_cond; a2: ptr Pthread_mutex): cint {.importc, header: "<pthread.h>".}
proc pthread_condattr_destroy(a1: ptr Pthread_condattr): cint {.importc, header: "<pthread.h>".}
proc pthread_condattr_getclock(a1: ptr Pthread_condattr; a2: var ClockId): cint {. importc, header: "<pthread.h>".}
proc pthread_condattr_init(a1: ptr Pthread_condattr): cint {.importc, header: "<pthread.h>".}
proc pthread_condattr_setclock(a1: ptr Pthread_condattr; a2: ClockId): cint {.importc, header: "<pthread.h>".}
proc pthread_create(a1: ptr Pthread; a2: ptr Pthread_attr; a3: proc (x: pointer): pointer {.noconv.}; a4: pointer): cint {. importc, header: "<pthread.h>".}
proc pthread_detach(a1: Pthread): cint {.importc, header: "<pthread.h>".}
proc pthread_equal(a1, a2: Pthread): cint {.importc, header: "<pthread.h>".}
proc pthread_exit(a1: pointer) {.importc, header: "<pthread.h>".}
proc pthread_getconcurrency(): cint {.importc, header: "<pthread.h>".}
proc pthread_getcpuclockid(a1: Pthread; a2: var ClockId): cint {.importc, header: "<pthread.h>".}
proc pthread_getschedparam(a1: Pthread; a2: var cint; a3: ptr Sched_param): cint {. importc, header: "<pthread.h>".}
proc pthread_getspecific(a1: Pthread_key): pointer {.importc, header: "<pthread.h>".}
proc pthread_join(a1: Pthread; a2: ptr pointer): cint {.importc, header: "<pthread.h>".}
proc pthread_key_create(a1: ptr Pthread_key; a2: proc (x: pointer) {.noconv.}): cint {. importc, header: "<pthread.h>".}
proc pthread_key_delete(a1: Pthread_key): cint {.importc, header: "<pthread.h>".}
proc pthread_mutex_destroy(a1: ptr Pthread_mutex): cint {.importc, header: "<pthread.h>".}
proc pthread_mutex_getprioceiling(a1: ptr Pthread_mutex; a2: var cint): cint {.importc, header: "<pthread.h>".}
proc pthread_mutex_init(a1: ptr Pthread_mutex; a2: ptr Pthread_mutexattr): cint {. importc, header: "<pthread.h>".}
proc pthread_mutex_lock(a1: ptr Pthread_mutex): cint {.importc, header: "<pthread.h>".}
proc pthread_mutex_setprioceiling(a1: ptr Pthread_mutex; a2: cint; a3: var cint): cint {. importc, header: "<pthread.h>".}
proc pthread_mutex_timedlock(a1: ptr Pthread_mutex; a2: ptr Timespec): cint {.importc, header: "<pthread.h>".}
proc pthread_mutex_trylock(a1: ptr Pthread_mutex): cint {.importc, header: "<pthread.h>".}
proc pthread_mutex_unlock(a1: ptr Pthread_mutex): cint {.importc, header: "<pthread.h>".}
proc pthread_mutexattr_destroy(a1: ptr Pthread_mutexattr): cint {.importc, header: "<pthread.h>".}
proc pthread_mutexattr_getprioceiling(a1: ptr Pthread_mutexattr; a2: var cint): cint {. importc, header: "<pthread.h>".}
proc pthread_mutexattr_getprotocol(a1: ptr Pthread_mutexattr; a2: var cint): cint {. importc, header: "<pthread.h>".}
proc pthread_mutexattr_gettype(a1: ptr Pthread_mutexattr; a2: var cint): cint {.importc, header: "<pthread.h>".}
proc pthread_mutexattr_init(a1: ptr Pthread_mutexattr): cint {.importc, header: "<pthread.h>".}
proc pthread_mutexattr_setprioceiling(a1: ptr Pthread_mutexattr; a2: cint): cint {. importc, header: "<pthread.h>".}
proc pthread_mutexattr_setprotocol(a1: ptr Pthread_mutexattr; a2: cint): cint {. importc, header: "<pthread.h>".}
proc pthread_mutexattr_settype(a1: ptr Pthread_mutexattr; a2: cint): cint {.importc, header: "<pthread.h>".}
proc pthread_once(a1: ptr Pthread_once; a2: proc () {.noconv.}): cint {.importc, header: "<pthread.h>".}
proc pthread_rwlock_destroy(a1: ptr Pthread_rwlock): cint {.importc, header: "<pthread.h>".}
proc pthread_rwlock_init(a1: ptr Pthread_rwlock; a2: ptr Pthread_rwlockattr): cint {. importc, header: "<pthread.h>".}
proc pthread_rwlock_rdlock(a1: ptr Pthread_rwlock): cint {.importc, header: "<pthread.h>".}
proc pthread_rwlock_timedrdlock(a1: ptr Pthread_rwlock; a2: ptr Timespec): cint {. importc, header: "<pthread.h>".}
proc pthread_rwlock_timedwrlock(a1: ptr Pthread_rwlock; a2: ptr Timespec): cint {. importc, header: "<pthread.h>".}
proc pthread_rwlock_tryrdlock(a1: ptr Pthread_rwlock): cint {.importc, header: "<pthread.h>".}
proc pthread_rwlock_trywrlock(a1: ptr Pthread_rwlock): cint {.importc, header: "<pthread.h>".}
proc pthread_rwlock_unlock(a1: ptr Pthread_rwlock): cint {.importc, header: "<pthread.h>".}
proc pthread_rwlock_wrlock(a1: ptr Pthread_rwlock): cint {.importc, header: "<pthread.h>".}
proc pthread_rwlockattr_destroy(a1: ptr Pthread_rwlockattr): cint {.importc, header: "<pthread.h>".}
proc pthread_rwlockattr_init(a1: ptr Pthread_rwlockattr): cint {.importc, header: "<pthread.h>".}
proc pthread_self(): Pthread {.importc, header: "<pthread.h>".}
proc pthread_setcancelstate(a1: cint; a2: var cint): cint {.importc, header: "<pthread.h>".}
proc pthread_setcanceltype(a1: cint; a2: var cint): cint {.importc, header: "<pthread.h>".}
proc pthread_setconcurrency(a1: cint): cint {.importc, header: "<pthread.h>".}
proc pthread_setschedparam(a1: Pthread; a2: cint; a3: ptr Sched_param): cint {.importc, header: "<pthread.h>".}
proc pthread_setschedprio(a1: Pthread; a2: cint): cint {.importc, header: "<pthread.h>".}
proc pthread_setspecific(a1: Pthread_key; a2: pointer): cint {.importc, header: "<pthread.h>".}
proc pthread_spin_destroy(a1: ptr Pthread_spinlock): cint {.importc, header: "<pthread.h>".}
proc pthread_spin_init(a1: ptr Pthread_spinlock; a2: cint): cint {.importc, header: "<pthread.h>".}
proc pthread_spin_lock(a1: ptr Pthread_spinlock): cint {.importc, header: "<pthread.h>".}
proc pthread_spin_trylock(a1: ptr Pthread_spinlock): cint {.importc, header: "<pthread.h>".}
proc pthread_spin_unlock(a1: ptr Pthread_spinlock): cint {.importc, header: "<pthread.h>".}
proc pthread_testcancel() {.importc, header: "<pthread.h>".}
proc exitnow(code: int): void {.importc: "_exit", header: "<unistd.h>".}
proc access(a1: cstring; a2: cint): cint {.importc, header: "<unistd.h>".}
proc alarm(a1: cint): cint {.importc, header: "<unistd.h>".}
proc chdir(a1: cstring): cint {.importc, header: "<unistd.h>".}
proc chown(a1: cstring; a2: Uid; a3: Gid): cint {.importc, header: "<unistd.h>".}
proc close(a1: cint | SocketHandle): cint {.importc, header: "<unistd.h>".}
proc confstr(a1: cint; a2: cstring; a3: int): int {.importc, header: "<unistd.h>".}
proc crypt(a1, a2: cstring): cstring {.importc, header: "<unistd.h>".}
proc ctermid(a1: cstring): cstring {.importc, header: "<unistd.h>".}
proc dup(a1: cint): cint {.importc, header: "<unistd.h>".}
proc dup2(a1, a2: cint): cint {.importc, header: "<unistd.h>".}
proc encrypt(a1: array[0 .. 63, char]; a2: cint) {.importc, header: "<unistd.h>".}
proc execl(a1, a2: cstring): cint {.varargs, importc, header: "<unistd.h>".}
proc execle(a1, a2: cstring): cint {.varargs, importc, header: "<unistd.h>".}
proc execlp(a1, a2: cstring): cint {.varargs, importc, header: "<unistd.h>".}
proc execv(a1: cstring; a2: cstringArray): cint {.importc, header: "<unistd.h>".}
proc execve(a1: cstring; a2, a3: cstringArray): cint {.importc, header: "<unistd.h>".}
proc execvp(a1: cstring; a2: cstringArray): cint {.importc, header: "<unistd.h>".}
proc execvpe(a1: cstring; a2: cstringArray; a3: cstringArray): cint {.importc, header: "<unistd.h>".}
proc fchown(a1: cint; a2: Uid; a3: Gid): cint {.importc, header: "<unistd.h>".}
proc fchdir(a1: cint): cint {.importc, header: "<unistd.h>".}
proc fdatasync(a1: cint): cint {.importc, header: "<unistd.h>".}
proc fork(): Pid {.importc, header: "<unistd.h>".}
proc fpathconf(a1, a2: cint): int {.importc, header: "<unistd.h>".}
proc fsync(a1: cint): cint {.importc, header: "<unistd.h>".}
proc ftruncate(a1: cint; a2: Off): cint {.importc, header: "<unistd.h>".}
proc getcwd(a1: cstring; a2: int): cstring {.importc, header: "<unistd.h>".}
proc getegid(): Gid {.importc, header: "<unistd.h>".}
proc geteuid(): Uid {.importc, header: "<unistd.h>".}
proc getgid(): Gid {.importc, header: "<unistd.h>".}
proc getgroups(a1: cint; a2: ptr array[0 .. 255, Gid]): cint {.importc, header: "<unistd.h>".}
proc gethostid(): int {.importc, header: "<unistd.h>".}
proc gethostname(a1: cstring; a2: int): cint {.importc, header: "<unistd.h>".}
proc getlogin(): cstring {.importc, header: "<unistd.h>".}
proc getlogin_r(a1: cstring; a2: int): cint {.importc, header: "<unistd.h>".}
proc getopt(a1: cint; a2: cstringArray; a3: cstring): cint {.importc, header: "<unistd.h>".}
proc getpgid(a1: Pid): Pid {.importc, header: "<unistd.h>".}
proc getpgrp(): Pid {.importc, header: "<unistd.h>".}
proc getpid(): Pid {.importc, header: "<unistd.h>".}
proc getppid(): Pid {.importc, header: "<unistd.h>".}
proc getsid(a1: Pid): Pid {.importc, header: "<unistd.h>".}
proc getuid(): Uid {.importc, header: "<unistd.h>".}
proc getwd(a1: cstring): cstring {.importc, header: "<unistd.h>".}
proc isatty(a1: cint): cint {.importc, header: "<unistd.h>".}
proc lchown(a1: cstring; a2: Uid; a3: Gid): cint {.importc, header: "<unistd.h>".}
proc link(a1, a2: cstring): cint {.importc, header: "<unistd.h>".}
proc lockf(a1, a2: cint; a3: Off): cint {.importc, header: "<unistd.h>".}
proc lseek(a1: cint; a2: Off; a3: cint): Off {.importc, header: "<unistd.h>".}
proc nice(a1: cint): cint {.importc, header: "<unistd.h>".}
proc pathconf(a1: cstring; a2: cint): int {.importc, header: "<unistd.h>".}
proc pause(): cint {.importc, header: "<unistd.h>".}
proc pclose(a: File): cint {.importc, header: "<stdio.h>".}
proc pipe(a: array[0 .. 1, cint]): cint {.importc, header: "<unistd.h>".}
proc popen(a1, a2: cstring): File {.importc, header: "<stdio.h>".}
proc pread(a1: cint; a2: pointer; a3: int; a4: Off): int {.importc, header: "<unistd.h>".}
proc pwrite(a1: cint; a2: pointer; a3: int; a4: Off): int {.importc, header: "<unistd.h>".}
proc read(a1: cint; a2: pointer; a3: int): int {.importc, header: "<unistd.h>".}
proc readlink(a1, a2: cstring; a3: int): int {.importc, header: "<unistd.h>".}
proc ioctl(f: FileHandle; device: uint): int {.importc: "ioctl", header: "<sys/ioctl.h>", varargs, tags: [WriteIOEffect].}
proc rmdir(a1: cstring): cint {.importc, header: "<unistd.h>".}
proc setegid(a1: Gid): cint {.importc, header: "<unistd.h>".}
proc seteuid(a1: Uid): cint {.importc, header: "<unistd.h>".}
proc setgid(a1: Gid): cint {.importc, header: "<unistd.h>".}
proc setpgid(a1, a2: Pid): cint {.importc, header: "<unistd.h>".}
proc setpgrp(): Pid {.importc, header: "<unistd.h>".}
proc setregid(a1, a2: Gid): cint {.importc, header: "<unistd.h>".}
proc setreuid(a1, a2: Uid): cint {.importc, header: "<unistd.h>".}
proc setsid(): Pid {.importc, header: "<unistd.h>".}
proc setuid(a1: Uid): cint {.importc, header: "<unistd.h>".}
proc sleep(a1: cint): cint {.importc, header: "<unistd.h>".}
proc swab(a1, a2: pointer; a3: int) {.importc, header: "<unistd.h>".}
proc symlink(a1, a2: cstring): cint {.importc, header: "<unistd.h>".}
proc sync() {.importc, header: "<unistd.h>".}
proc sysconf(a1: cint): int {.importc, header: "<unistd.h>".}
proc tcgetpgrp(a1: cint): Pid {.importc, header: "<unistd.h>".}
proc tcsetpgrp(a1: cint; a2: Pid): cint {.importc, header: "<unistd.h>".}
proc truncate(a1: cstring; a2: Off): cint {.importc, header: "<unistd.h>".}
proc ttyname(a1: cint): cstring {.importc, header: "<unistd.h>".}
proc ttyname_r(a1: cint; a2: cstring; a3: int): cint {.importc, header: "<unistd.h>".}
proc ualarm(a1, a2: Useconds): Useconds {.importc, header: "<unistd.h>".}
proc unlink(a1: cstring): cint {.importc, header: "<unistd.h>".}
proc usleep(a1: Useconds): cint {.importc, header: "<unistd.h>".}
proc vfork(): Pid {.importc, header: "<unistd.h>".}
proc write(a1: cint; a2: pointer; a3: int): int {.importc, header: "<unistd.h>".}
proc sem_close(a1: ptr Sem): cint {.importc, header: "<semaphore.h>".}
proc sem_destroy(a1: ptr Sem): cint {.importc, header: "<semaphore.h>".}
proc sem_getvalue(a1: ptr Sem; a2: var cint): cint {.importc, header: "<semaphore.h>".}
proc sem_init(a1: ptr Sem; a2: cint; a3: cint): cint {.importc, header: "<semaphore.h>".}
proc sem_open(a1: cstring; a2: cint): ptr Sem {.varargs, importc, header: "<semaphore.h>".}
proc sem_post(a1: ptr Sem): cint {.importc, header: "<semaphore.h>".}
proc sem_timedwait(a1: ptr Sem; a2: ptr Timespec): cint {.importc, header: "<semaphore.h>".}
proc sem_trywait(a1: ptr Sem): cint {.importc, header: "<semaphore.h>".}
proc sem_unlink(a1: cstring): cint {.importc, header: "<semaphore.h>".}
proc sem_wait(a1: ptr Sem): cint {.importc, header: "<semaphore.h>".}
proc ftok(a1: cstring; a2: cint): Key {.importc, header: "<sys/ipc.h>".}
proc statvfs(a1: cstring; a2: var Statvfs): cint {.importc, header: "<sys/statvfs.h>".}
proc fstatvfs(a1: cint; a2: var Statvfs): cint {.importc, header: "<sys/statvfs.h>".}
proc chmod(a1: cstring; a2: Mode): cint {.importc, header: "<sys/stat.h>".}
proc fchmod(a1: cint; a2: Mode): cint {.importc, header: "<sys/stat.h>".}
proc fstat(a1: cint; a2: var Stat): cint {.importc, header: "<sys/stat.h>".}
proc lstat(a1: cstring; a2: var Stat): cint {.importc, header: "<sys/stat.h>".}
proc mkdir(a1: cstring; a2: Mode): cint {.importc, header: "<sys/stat.h>".}
proc mkfifo(a1: cstring; a2: Mode): cint {.importc, header: "<sys/stat.h>".}
proc mknod(a1: cstring; a2: Mode; a3: Dev): cint {.importc, header: "<sys/stat.h>".}
proc stat(a1: cstring; a2: var Stat): cint {.importc, header: "<sys/stat.h>".}
proc umask(a1: Mode): Mode {.importc, header: "<sys/stat.h>".}
proc S_ISBLK(m: Mode): bool {.importc, header: "<sys/stat.h>".}
proc S_ISCHR(m: Mode): bool {.importc, header: "<sys/stat.h>".}
proc S_ISDIR(m: Mode): bool {.importc, header: "<sys/stat.h>".}
proc S_ISFIFO(m: Mode): bool {.importc, header: "<sys/stat.h>".}
proc S_ISREG(m: Mode): bool {.importc, header: "<sys/stat.h>".}
proc S_ISLNK(m: Mode): bool {.importc, header: "<sys/stat.h>".}
proc S_ISSOCK(m: Mode): bool {.importc, header: "<sys/stat.h>".}
proc S_TYPEISMQ(buf: var Stat): bool {.importc, header: "<sys/stat.h>".}
proc S_TYPEISSEM(buf: var Stat): bool {.importc, header: "<sys/stat.h>".}
proc S_TYPEISSHM(buf: var Stat): bool {.importc, header: "<sys/stat.h>".}
proc S_TYPEISTMO(buf: var Stat): bool {.importc, header: "<sys/stat.h>".}
proc mlock(a1: pointer; a2: int): cint {.importc, header: "<sys/mman.h>".}
proc mlockall(a1: cint): cint {.importc, header: "<sys/mman.h>".}
proc mmap(a1: pointer; a2: int; a3, a4, a5: cint; a6: Off): pointer {.importc, header: "<sys/mman.h>".}
proc mprotect(a1: pointer; a2: int; a3: cint): cint {.importc, header: "<sys/mman.h>".}
proc msync(a1: pointer; a2: int; a3: cint): cint {.importc, header: "<sys/mman.h>".}
proc munlock(a1: pointer; a2: int): cint {.importc, header: "<sys/mman.h>".}
proc munlockall(): cint {.importc, header: "<sys/mman.h>".}
proc munmap(a1: pointer; a2: int): cint {.importc, header: "<sys/mman.h>".}
proc posix_madvise(a1: pointer; a2: int; a3: cint): cint {.importc, header: "<sys/mman.h>".}
proc posix_mem_offset(a1: pointer; a2: int; a3: var Off; a4: var int; a5: var cint): cint {. importc, header: "<sys/mman.h>".}
proc posix_typed_mem_get_info(a1: cint; a2: var Posix_typed_mem_info): cint {.importc, header: "<sys/mman.h>".}
proc posix_typed_mem_open(a1: cstring; a2, a3: cint): cint {.importc, header: "<sys/mman.h>".}
proc shm_open(a1: cstring; a2: cint; a3: Mode): cint {.importc, header: "<sys/mman.h>".}
proc shm_unlink(a1: cstring): cint {.importc, header: "<sys/mman.h>".}
proc asctime(a1: var Tm): cstring {.importc, header: "<time.h>".}
proc asctime_r(a1: var Tm; a2: cstring): cstring {.importc, header: "<time.h>".}
proc clock(): Clock {.importc, header: "<time.h>".}
proc clock_getcpuclockid(a1: Pid; a2: var ClockId): cint {.importc, header: "<time.h>".}
proc clock_getres(a1: ClockId; a2: var Timespec): cint {.importc, header: "<time.h>".}
proc clock_gettime(a1: ClockId; a2: var Timespec): cint {.importc, header: "<time.h>".}
proc clock_nanosleep(a1: ClockId; a2: cint; a3: var Timespec; a4: var Timespec): cint {. importc, header: "<time.h>".}
proc clock_settime(a1: ClockId; a2: var Timespec): cint {.importc, header: "<time.h>".}
proc ctime(a1: var Time): cstring {.importc, header: "<time.h>".}
proc ctime_r(a1: var Time; a2: cstring): cstring {.importc, header: "<time.h>".}
proc difftime(a1, a2: Time): cdouble {.importc, header: "<time.h>".}
proc getdate(a1: cstring): ptr Tm {.importc, header: "<time.h>".}
proc gmtime(a1: var Time): ptr Tm {.importc, header: "<time.h>".}
proc gmtime_r(a1: var Time; a2: var Tm): ptr Tm {.importc, header: "<time.h>".}
proc localtime(a1: var Time): ptr Tm {.importc, header: "<time.h>".}
proc localtime_r(a1: var Time; a2: var Tm): ptr Tm {.importc, header: "<time.h>".}
proc mktime(a1: var Tm): Time {.importc, header: "<time.h>".}
proc timegm(a1: var Tm): Time {.importc, header: "<time.h>".}
proc nanosleep(a1, a2: var Timespec): cint {.importc, header: "<time.h>".}
proc strftime(a1: cstring; a2: int; a3: cstring; a4: var Tm): int {.importc, header: "<time.h>".}
proc strptime(a1, a2: cstring; a3: var Tm): cstring {.importc, header: "<time.h>".}
proc time(a1: var Time): Time {.importc, header: "<time.h>".}
proc timer_create(a1: ClockId; a2: var SigEvent; a3: var Timer): cint {.importc, header: "<time.h>".}
proc timer_delete(a1: Timer): cint {.importc, header: "<time.h>".}
proc timer_gettime(a1: Timer; a2: var Itimerspec): cint {.importc, header: "<time.h>".}
proc timer_getoverrun(a1: Timer): cint {.importc, header: "<time.h>".}
proc timer_settime(a1: Timer; a2: cint; a3: var Itimerspec; a4: var Itimerspec): cint {. importc, header: "<time.h>".}
proc tzset() {.importc, header: "<time.h>".}
proc wait(a1: ptr cint): Pid {.importc, discardable, header: "<sys/wait.h>".}
proc waitid(a1: cint; a2: Id; a3: var SigInfo; a4: cint): cint {.importc, header: "<sys/wait.h>".}
proc waitpid(a1: Pid; a2: var cint; a3: cint): Pid {.importc, header: "<sys/wait.h>".}
proc bsd_signal(a1: cint; a2: proc (x: pointer) {.noconv.}) {.importc, header: "<signal.h>".}
proc kill(a1: Pid; a2: cint): cint {.importc, header: "<signal.h>".}
proc killpg(a1: Pid; a2: cint): cint {.importc, header: "<signal.h>".}
proc pthread_kill(a1: Pthread; a2: cint): cint {.importc, header: "<signal.h>".}
proc pthread_sigmask(a1: cint; a2, a3: var Sigset): cint {.importc, header: "<signal.h>".}
proc `raise`(a1: cint): cint {.importc, header: "<signal.h>".}
proc sigaction(a1: cint; a2, a3: var Sigaction): cint {.importc, header: "<signal.h>".}
proc sigaction(a1: cint; a2: var Sigaction; a3: ptr Sigaction = nil): cint {.importc, header: "<signal.h>".}
proc sigaddset(a1: var Sigset; a2: cint): cint {.importc, header: "<signal.h>".}
proc sigaltstack(a1, a2: var Stack): cint {.importc, header: "<signal.h>".}
proc sigdelset(a1: var Sigset; a2: cint): cint {.importc, header: "<signal.h>".}
proc sigemptyset(a1: var Sigset): cint {.importc, header: "<signal.h>".}
proc sigfillset(a1: var Sigset): cint {.importc, header: "<signal.h>".}
proc sighold(a1: cint): cint {.importc, header: "<signal.h>".}
proc sigignore(a1: cint): cint {.importc, header: "<signal.h>".}
proc siginterrupt(a1, a2: cint): cint {.importc, header: "<signal.h>".}
proc sigismember(a1: var Sigset; a2: cint): cint {.importc, header: "<signal.h>".}
proc signal(a1: cint; a2: Sighandler) {.importc, header: "<signal.h>".}
proc sigpause(a1: cint): cint {.importc, header: "<signal.h>".}
proc sigpending(a1: var Sigset): cint {.importc, header: "<signal.h>".}
proc sigprocmask(a1: cint; a2, a3: var Sigset): cint {.importc, header: "<signal.h>".}
proc sigqueue(a1: Pid; a2: cint; a3: SigVal): cint {.importc, header: "<signal.h>".}
proc sigrelse(a1: cint): cint {.importc, header: "<signal.h>".}
proc sigset(a1: int; a2: proc (x: cint) {.noconv.}) {.importc, header: "<signal.h>".}
proc sigsuspend(a1: var Sigset): cint {.importc, header: "<signal.h>".}
proc sigtimedwait(a1: var Sigset; a2: var SigInfo; a3: var Timespec): cint {.importc, header: "<signal.h>".}
proc sigwait(a1: var Sigset; a2: var cint): cint {.importc, header: "<signal.h>".}
proc sigwaitinfo(a1: var Sigset; a2: var SigInfo): cint {.importc, header: "<signal.h>".}
proc catclose(a1: Nl_catd): cint {.importc, header: "<nl_types.h>".}
proc catgets(a1: Nl_catd; a2, a3: cint; a4: cstring): cstring {.importc, header: "<nl_types.h>".}
proc catopen(a1: cstring; a2: cint): Nl_catd {.importc, header: "<nl_types.h>".}
proc sched_get_priority_max(a1: cint): cint {.importc, header: "<sched.h>".}
proc sched_get_priority_min(a1: cint): cint {.importc, header: "<sched.h>".}
proc sched_getparam(a1: Pid; a2: var Sched_param): cint {.importc, header: "<sched.h>".}
proc sched_getscheduler(a1: Pid): cint {.importc, header: "<sched.h>".}
proc sched_rr_get_interval(a1: Pid; a2: var Timespec): cint {.importc, header: "<sched.h>".}
proc sched_setparam(a1: Pid; a2: var Sched_param): cint {.importc, header: "<sched.h>".}
proc sched_setscheduler(a1: Pid; a2: cint; a3: var Sched_param): cint {.importc, header: "<sched.h>".}
proc sched_yield(): cint {.importc, header: "<sched.h>".}
proc strerror(errnum: cint): cstring {.importc, header: "<string.h>".}
proc hstrerror(herrnum: cint): cstring {.importc: "(char *)$1", header: "<netdb.h>".}
proc FD_CLR(a1: cint; a2: var TFdSet) {.importc, header: "<sys/select.h>".}
proc FD_ISSET(a1: cint | SocketHandle; a2: var TFdSet): cint {.importc, header: "<sys/select.h>".}
proc FD_SET(a1: cint | SocketHandle; a2: var TFdSet) {.importc: "FD_SET", header: "<sys/select.h>".}
proc FD_ZERO(a1: var TFdSet) {.importc, header: "<sys/select.h>".}
proc pselect(a1: cint; a2, a3, a4: ptr TFdSet; a5: ptr Timespec; a6: var Sigset): cint {. importc, header: "<sys/select.h>".}
proc select(a1: cint | SocketHandle; a2, a3, a4: ptr TFdSet; a5: ptr Timeval): cint {.importc, header: "<sys/select.h>".}
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>".}
proc posix_spawn_file_actions_addclose(a1: var Tposix_spawn_file_actions; a2: cint): cint {. importc, header: "<spawn.h>".}
proc posix_spawn_file_actions_adddup2(a1: var Tposix_spawn_file_actions; a2, a3: cint): cint {.importc, header: "<spawn.h>".}
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>".}
proc posix_spawn_file_actions_destroy(a1: var Tposix_spawn_file_actions): cint {. importc, header: "<spawn.h>".}
proc posix_spawn_file_actions_init(a1: var Tposix_spawn_file_actions): cint {. importc, header: "<spawn.h>".}
proc posix_spawnattr_destroy(a1: var Tposix_spawnattr): cint {.importc, header: "<spawn.h>".}
proc posix_spawnattr_getsigdefault(a1: var Tposix_spawnattr; a2: var Sigset): cint {. importc, header: "<spawn.h>".}
proc posix_spawnattr_getflags(a1: var Tposix_spawnattr; a2: var cshort): cint {.importc, header: "<spawn.h>".}
proc posix_spawnattr_getpgroup(a1: var Tposix_spawnattr; a2: var Pid): cint {.importc, header: "<spawn.h>".}
proc posix_spawnattr_getschedparam(a1: var Tposix_spawnattr; a2: var Sched_param): cint {. importc, header: "<spawn.h>".}
proc posix_spawnattr_getschedpolicy(a1: var Tposix_spawnattr; a2: var cint): cint {. importc, header: "<spawn.h>".}
proc posix_spawnattr_getsigmask(a1: var Tposix_spawnattr; a2: var Sigset): cint {. importc, header: "<spawn.h>".}
proc posix_spawnattr_init(a1: var Tposix_spawnattr): cint {.importc, header: "<spawn.h>".}
proc posix_spawnattr_setsigdefault(a1: var Tposix_spawnattr; a2: var Sigset): cint {. importc, header: "<spawn.h>".}
proc posix_spawnattr_setflags(a1: var Tposix_spawnattr; a2: cint): cint {.importc, header: "<spawn.h>".}
proc posix_spawnattr_setpgroup(a1: var Tposix_spawnattr; a2: Pid): cint {.importc, header: "<spawn.h>".}
proc posix_spawnattr_setschedparam(a1: var Tposix_spawnattr; a2: var Sched_param): cint {. importc, header: "<spawn.h>".}
proc posix_spawnattr_setschedpolicy(a1: var Tposix_spawnattr; a2: cint): cint {. importc, header: "<spawn.h>".}
proc posix_spawnattr_setsigmask(a1: var Tposix_spawnattr; a2: var Sigset): cint {. importc, header: "<spawn.h>".}
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>".}
proc getcontext(a1: var Ucontext): cint {.importc, header: "<ucontext.h>".}
proc makecontext(a1: var Ucontext; a4: proc () {.noconv.}; a3: cint) {.varargs, importc, header: "<ucontext.h>".}
proc setcontext(a1: var Ucontext): cint {.importc, header: "<ucontext.h>".}
proc swapcontext(a1, a2: var Ucontext): cint {.importc, header: "<ucontext.h>".}
proc readv(a1: cint; a2: ptr IOVec; a3: cint): int {.importc, header: "<sys/uio.h>".}
proc writev(a1: cint; a2: ptr IOVec; a3: cint): int {.importc, header: "<sys/uio.h>".}
proc CMSG_DATA(cmsg: ptr Tcmsghdr): cstring {.importc, header: "<sys/socket.h>".}
proc CMSG_NXTHDR(mhdr: ptr Tmsghdr; cmsg: ptr Tcmsghdr): ptr Tcmsghdr {.importc, header: "<sys/socket.h>".}
proc CMSG_FIRSTHDR(mhdr: ptr Tmsghdr): ptr Tcmsghdr {.importc, header: "<sys/socket.h>".}
proc `==`(x, y: SocketHandle): bool {.borrow.}
proc accept(a1: SocketHandle; a2: ptr SockAddr; a3: ptr Socklen): SocketHandle {.importc, header: "<sys/socket.h>".}
proc bindSocket(a1: SocketHandle; a2: ptr SockAddr; a3: Socklen): cint {.importc: "bind", header: "<sys/socket.h>".}
bind
, because bind
is a reserved word proc connect(a1: SocketHandle; a2: ptr SockAddr; a3: Socklen): cint {.importc, header: "<sys/socket.h>".}
proc getpeername(a1: SocketHandle; a2: ptr SockAddr; a3: ptr Socklen): cint {.importc, header: "<sys/socket.h>".}
proc getsockname(a1: SocketHandle; a2: ptr SockAddr; a3: ptr Socklen): cint {.importc, header: "<sys/socket.h>".}
proc getsockopt(a1: SocketHandle; a2, a3: cint; a4: pointer; a5: ptr Socklen): cint {. importc, header: "<sys/socket.h>".}
proc listen(a1: SocketHandle; a2: cint): cint {.importc, header: "<sys/socket.h>".}
proc recv(a1: SocketHandle; a2: pointer; a3: int; a4: cint): int {.importc, header: "<sys/socket.h>".}
proc recvfrom(a1: SocketHandle; a2: pointer; a3: int; a4: cint; a5: ptr SockAddr; a6: ptr Socklen): int {.importc, header: "<sys/socket.h>".}
proc recvmsg(a1: SocketHandle; a2: ptr Tmsghdr; a3: cint): int {.importc, header: "<sys/socket.h>".}
proc send(a1: SocketHandle; a2: pointer; a3: int; a4: cint): int {.importc, header: "<sys/socket.h>".}
proc sendmsg(a1: SocketHandle; a2: ptr Tmsghdr; a3: cint): int {.importc, header: "<sys/socket.h>".}
proc sendto(a1: SocketHandle; a2: pointer; a3: int; a4: cint; a5: ptr SockAddr; a6: Socklen): int {. importc, header: "<sys/socket.h>".}
proc setsockopt(a1: SocketHandle; a2, a3: cint; a4: pointer; a5: Socklen): cint {.importc, header: "<sys/socket.h>".}
proc shutdown(a1: SocketHandle; a2: cint): cint {.importc, header: "<sys/socket.h>".}
proc socket(a1, a2, a3: cint): SocketHandle {.importc, header: "<sys/socket.h>".}
proc sockatmark(a1: cint): cint {.importc, header: "<sys/socket.h>".}
proc socketpair(a1, a2, a3: cint; a4: var array[0 .. 1, cint]): cint {.importc, header: "<sys/socket.h>".}
proc if_nametoindex(a1: cstring): cint {.importc, header: "<net/if.h>".}
proc if_indextoname(a1: cint; a2: cstring): cstring {.importc, header: "<net/if.h>".}
proc if_nameindex(): ptr Tif_nameindex {.importc, header: "<net/if.h>".}
proc if_freenameindex(a1: ptr Tif_nameindex) {.importc, header: "<net/if.h>".}
proc IN6_IS_ADDR_UNSPECIFIED(a1: ptr In6Addr): cint {.importc, header: "<netinet/in.h>".}
proc IN6_IS_ADDR_LOOPBACK(a1: ptr In6Addr): cint {.importc, header: "<netinet/in.h>".}
proc IN6_IS_ADDR_MULTICAST(a1: ptr In6Addr): cint {.importc, header: "<netinet/in.h>".}
proc IN6_IS_ADDR_LINKLOCAL(a1: ptr In6Addr): cint {.importc, header: "<netinet/in.h>".}
proc IN6_IS_ADDR_SITELOCAL(a1: ptr In6Addr): cint {.importc, header: "<netinet/in.h>".}
proc IN6_IS_ADDR_V4MAPPED(a1: ptr In6Addr): cint {.importc, header: "<netinet/in.h>".}
proc IN6_IS_ADDR_V4COMPAT(a1: ptr In6Addr): cint {.importc, header: "<netinet/in.h>".}
proc IN6_IS_ADDR_MC_NODELOCAL(a1: ptr In6Addr): cint {.importc, header: "<netinet/in.h>".}
proc IN6_IS_ADDR_MC_LINKLOCAL(a1: ptr In6Addr): cint {.importc, header: "<netinet/in.h>".}
proc IN6_IS_ADDR_MC_SITELOCAL(a1: ptr In6Addr): cint {.importc, header: "<netinet/in.h>".}
proc IN6_IS_ADDR_MC_ORGLOCAL(a1: ptr In6Addr): cint {.importc, header: "<netinet/in.h>".}
proc IN6_IS_ADDR_MC_GLOBAL(a1: ptr In6Addr): cint {.importc, header: "<netinet/in.h>".}
proc endhostent() {.importc, header: "<netdb.h>".}
proc endnetent() {.importc, header: "<netdb.h>".}
proc endprotoent() {.importc, header: "<netdb.h>".}
proc endservent() {.importc, header: "<netdb.h>".}
proc freeaddrinfo(a1: ptr AddrInfo) {.importc, header: "<netdb.h>".}
proc gai_strerror(a1: cint): cstring {.importc: "(char *)$1", header: "<netdb.h>".}
proc getaddrinfo(a1, a2: cstring; a3: ptr AddrInfo; a4: var ptr AddrInfo): cint {.importc, header: "<netdb.h>".}
proc gethostbyaddr(a1: pointer; a2: Socklen; a3: cint): ptr Hostent {.importc, header: "<netdb.h>".}
proc gethostbyname(a1: cstring): ptr Hostent {.importc, header: "<netdb.h>".}
proc gethostent(): ptr Hostent {.importc, header: "<netdb.h>".}
proc getnameinfo(a1: ptr SockAddr; a2: Socklen; a3: cstring; a4: Socklen; a5: cstring; a6: Socklen; a7: cint): cint {.importc, header: "<netdb.h>".}
proc getnetbyaddr(a1: int32; a2: cint): ptr Tnetent {.importc, header: "<netdb.h>".}
proc getnetbyname(a1: cstring): ptr Tnetent {.importc, header: "<netdb.h>".}
proc getnetent(): ptr Tnetent {.importc, header: "<netdb.h>".}
proc getprotobyname(a1: cstring): ptr Protoent {.importc, header: "<netdb.h>".}
proc getprotobynumber(a1: cint): ptr Protoent {.importc, header: "<netdb.h>".}
proc getprotoent(): ptr Protoent {.importc, header: "<netdb.h>".}
proc getservbyname(a1, a2: cstring): ptr Servent {.importc, header: "<netdb.h>".}
proc getservbyport(a1: cint; a2: cstring): ptr Servent {.importc, header: "<netdb.h>".}
proc getservent(): ptr Servent {.importc, header: "<netdb.h>".}
proc sethostent(a1: cint) {.importc, header: "<netdb.h>".}
proc setnetent(a1: cint) {.importc, header: "<netdb.h>".}
proc setprotoent(a1: cint) {.importc, header: "<netdb.h>".}
proc setservent(a1: cint) {.importc, header: "<netdb.h>".}
proc poll(a1: ptr TPollfd; a2: Tnfds; a3: int): cint {.importc, header: "<poll.h>".}
proc realpath(name, resolved: cstring): cstring {.importc: "realpath", header: "<stdlib.h>".}
proc mkstemp(tmpl: cstring): cint {.importc, header: "<stdlib.h>".}
Create a temporary file.
Warning: The tmpl argument is written to by mkstemp and thus can't be a string literal. If in doubt copy the string before passing it.
proc utimes(path: cstring; times: ptr array[2, Timeval]): int {.importc: "utimes", header: "<sys/time.h>".}
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/.
template onSignal(signals: varargs[cint]; body: untyped)
© 2006–2017 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/posix.html