sanos home

Sanos API



 

File Input/Output

 

Function Header Library Conformance Description
         
cputs conio.h libc.lib MSVC Write string to console
getch conio.h libc.lib MSVC Read character from console
kbhit conio.h libc.lib MSVC Checks the console for keyboard input
putch conio.h libc.lib MSVC Write character to console
closedir dirent.h libc.lib POSIX Close directory
creat fcntl.h,io.h,os.h os.lib POSIX Create a file
open fcntl.h,io.h,os.h os.lib POSIX Open a file
sopen io.h,os.h os.lib MSVC Open a stream with file sharing
tell io.h,os.h os.lib POSIX Get current file pointer
umask io.h,os.h os.lib POSIX Set the default file permission mask
canonicalize os.h os.lib   Return canonical file name representation
ftruncate unistd.h,os.h os.lib POSIX Change the file size
ftruncate64 unistd.h,os.h os.lib POSIX Change the file size
fsync unistd.h,os.h os.lib POSIX Flush a file
fstatfs os.h os.lib   Get file system statistics for an open file
futime utime.h,os.h os.lib   Set modification time on an open file
getfsstat os.h os.lib   Get information about mounted file systems
ioctl os.h os.lib   Control device
mkfs os.h os.lib   Create and format file system on device
mount os.h os.lib   Mount a file system
opendir dirent.h libc.lib POSIX Open directory for listing
readdir dirent.h libc.lib POSIX Read directory entry
readv uio.h,os.h os.lib POSIX Read a vector
realpath stdlib.h libc.lib POSIX Resolve a pathname
writev uio.h,os.h os.lib POSIX Write a vector
setmode os.h os.lib MSVC Set the file translation mode
statfs os.h os.lib   Get file system statistics for path
tell64 os.h os.lib   Get the position of the file pointer
umount os.h os.lib   Unmount a file system
utime utime.h,os.h os.lib POSIX Set the file modification time
readline stdlib.h libc.lib   Read line from console with command line editing and history
chmod sys/stat.h,os.h os.lib POSIX Change file permissions
fchmod sys/stat.h,os.h os.lib POSIX Change permissions for an open file
chown unistd.h,os.h os.lib POSIX Change owner and group of a file
fchown unistd.h,os.h os.lib POSIX Change owner and group for an open file
fstat sys/stat.h,os.h os.lib POSIX Get information about an open file
fstat64 sys/stat.h,os.h os.lib MSVC Get information about an open file
filelength io.h,os.h os.lib MSVC Return length of file
filelength64 io.h,os.h os.lib   Return length of file
mkdir sys/stat.h,os.h os.lib POSIX Create a new directory
stat sys/stat.h,os.h os.lib POSIX Get information about a file
stat64 sys/stat.h,os.h os.lib MSVC Get information about a file
access unistd.h,io.h,os.h os.lib POSIX Determine file access permission
close unistd.h,io.h,os.h os.lib POSIX Close a file
dup unistd.h,io.h,os.h os.lib POSIX Duplicate a file handle
dup2 unistd.h,io.h,os.h os.lib POSIX Reassign a handle to a file
lseek unistd.h,io.h,os.h os.lib POSIX Reposition file pointer to a given location
pread unistd.h,os.h os.lib POSIX Positional read from a file
pwrite unistd.h,os.h os.lib POSIX Positional write to a file
read unistd.h,io.h,os.h os.lib POSIX Read data from a file
rewinddir dirent.h libc.lib POSIX Rewind directory
write unistd.h,io.h,os.h os.lib POSIX Write data to a file
chdir unistd.h,os.h os.lib POSIX Change the current directory
getcwd unistd.h,os.h os.lib POSIX Get the current working directory
link unistd.h,os.h os.lib POSIX Make a new name for a file
lseek64 unistd.h,os.h os.lib MSVC Move a file pointer to the specified location
pipe unistd.h,os.h os.lib POSIX Create a pipe for reading and writing
rmdir unistd.h,os.h os.lib POSIX Remove a directory
unlink unistd.h,os.h os.lib POSIX Delete a name and possibly the file it refers to
_opendir os.h os.lib   Low-level open directory
_readdir os.h os.lib   Low-level read directory
poll poll.h,os.h os.lib POSIX Wait for events on set of file descriptors
mktemp stdlib.h clib.lib POSIX Make a unique filename
mkdtemp stdlib.h clib.lib POSIX Create temporary directory
mkstemp stdlib.h clib.lib POSIX Create temporary file
mkstemps stdlib.h clib.lib POSIX Create temporary file with suffix

 

Thread Control and Synchronization

 

Function Header Library Conformance Description
         
atomic_add atomic.h     Atomically add to a variable
atomic_decrement atomic.h     Atomically decrement a variable
atomic_exchange atomic.h     Atomically exchange value of a variable
atomic_increment atomic.h     Atomically increment a variable
beginthread os.h os.lib   Create new thread
csfree os.h os.lib   Delete critical section
dispatch os.h os.lib   Add handle to I/O multiplexer for later dispatching on handle event
endthread os.h os.lib   Terminate current thread
enter os.h os.lib   Enter critical section
epulse os.h os.lib   Pulse event
ereset os.h os.lib   Reset event
eset os.h os.lib   Set event
getcontext os.h os.lib   Get context for thread
getprio os.h os.lib   Get thread priority
getthreadblock os.h os.lib   Get thread information block for a thread
getjobhandle os.h os.lib   Get handle for a job
gettib os.h os.lib   Get thread information block for current thread
gettid os.h os.lib   Get thread id
getpid unistd.h,os.h os.lib POSIX Get job id
getppid unistd.h,os.h os.lib POSIX Get parent job id
leave os.h os.lib   Leave critical section
mkcs os.h os.lib   Create new critical section
mkevent os.h os.lib   Create event object
mkiomux os.h os.lib   Create I/O multiplexer object
mkmutex os.h os.lib   Create mutex object
mksem os.h os.lib   Create semaphore object
mutexrel os.h os.lib   Release ownership of a mutex
pthread_attr_init pthread.h libc.lib POSIX Initialize thread attributes object
pthread_attr_destroy pthread.h libc.lib POSIX Destroy thread attributes object
pthread_attr_getdetachstate pthread.h libc.lib POSIX Get detachstate attribute
pthread_attr_setdetachstate pthread.h libc.lib POSIX Set detachstate attribute
pthread_attr_getstackaddr pthread.h libc.lib POSIX Get stackaddr attribute
pthread_attr_setstackaddr pthread.h libc.lib POSIX Set stackaddr attribute
pthread_attr_getstacksize pthread.h libc.lib POSIX Get stacksize attribute
pthread_attr_setstacksize pthread.h libc.lib POSIX Set stacksize attribute
pthread_attr_getschedparam pthread.h libc.lib POSIX Get schedparam attribute
pthread_attr_setschedparam pthread.h libc.lib POSIX Set schedparam attribute
pthread_attr_getschedpolicy pthread.h libc.lib POSIX Get schedpolicy attribute
pthread_attr_setschedpolicy pthread.h libc.lib POSIX Set schedpolicy attribute
pthread_attr_getinheritsched pthread.h libc.lib POSIX Get inheritsched attribute
pthread_attr_setinheritsched pthread.h libc.lib POSIX Set inheritsched attribute
pthread_attr_getscope pthread.h libc.lib POSIX Get scope attribute
pthread_attr_setscope pthread.h libc.lib POSIX Set scope attribute
pthread_create pthread.h libc.lib POSIX Thread creation
pthread_detach pthread.h libc.lib POSIX Detach a thread
pthread_equal pthread.h libc.lib POSIX Compare thread IDs
pthread_exit pthread.h libc.lib POSIX Thread termination
pthread_join pthread.h libc.lib POSIX Wait for thread termination
pthread_self pthread.h libc.lib POSIX Get calling thread's ID
pthread_cancel pthread.h libc.lib POSIX Cancel execution of a thread
pthread_setcancelstate pthread.h libc.lib POSIX Set cancelability state
pthread_setcanceltype pthread.h libc.lib POSIX Set cancelability type
pthread_testcancel pthread.h libc.lib POSIX Create a cancellation point in the calling thread
pthread_once pthread.h libc.lib POSIX Dynamic package initialization
pthread_setschedparam pthread.h libc.lib POSIX Set thread scheduling policy
pthread_getschedparam pthread.h libc.lib POSIX Get thread scheduling policy
pthread_setconcurrency pthread.h libc.lib POSIX Set level of concurrency
pthread_getconcurrency pthread.h libc.lib POSIX Get level of concurrency
pthread_key_create pthread.h libc.lib POSIX Thread-specific data key creation
pthread_key_delete pthread.h libc.lib POSIX Thread-specific data key deletion
pthread_setspecific pthread.h libc.lib POSIX Set thread-specific value for key
pthread_getspecific pthread.h libc.lib POSIX Get thread-specific value for key
pthread_mutexattr_init pthread.h libc.lib POSIX Initialize mutex attributes object
pthread_mutexattr_destroy pthread.h libc.lib POSIX Destroy mutex attributes object
pthread_mutexattr_getpshared pthread.h libc.lib POSIX Get pshared attribute
pthread_mutexattr_setpshared pthread.h libc.lib POSIX Set pshared attribute
pthread_mutexattr_gettype pthread.h libc.lib POSIX Get type attribute
pthread_mutexattr_settype pthread.h libc.lib POSIX Set type attribute
pthread_mutex_init pthread.h libc.lib POSIX Initialize a mutex
pthread_mutex_destroy pthread.h libc.lib POSIX Destroy a mutex
pthread_mutex_lock pthread.h libc.lib POSIX Lock a mutex
pthread_mutex_timedlock pthread.h libc.lib POSIX Lock a mutex with timeout
pthread_mutex_trylock pthread.h libc.lib POSIX Try to lock a mutex
pthread_mutex_unlock pthread.h libc.lib POSIX Unlock a mutex
pthread_condattr_init pthread.h libc.lib POSIX Initialize condition variable attributes object
pthread_condattr_destroy pthread.h libc.lib POSIX Destroy condition variable attributes object
pthread_condattr_getpshared pthread.h libc.lib POSIX Get pshared attribute
pthread_condattr_setpshared pthread.h libc.lib POSIX Set pshared attribute
pthread_cond_init pthread.h libc.lib POSIX Initialize a condition variable
pthread_cond_destroy pthread.h libc.lib POSIX Destroy a condition variable
pthread_cond_wait pthread.h libc.lib POSIX Wait on condition
pthread_cond_timedwait pthread.h libc.lib POSIX Wait on condition with timeout
pthread_cond_signal pthread.h libc.lib POSIX Signal a condition
pthread_cond_broadcast pthread.h libc.lib POSIX Broadcast a condition
pthread_barrierattr_init pthread.h libc.lib POSIX Initialize barrier attributes object
pthread_barrierattr_destroy pthread.h libc.lib POSIX Destroy barrier attributes object
pthread_barrierattr_getpshared pthread.h libc.lib POSIX Get pshared attribute
pthread_barrierattr_setpshared pthread.h libc.lib POSIX Set pshared attribute
pthread_barrier_init pthread.h libc.lib POSIX Initialize a barrier object
pthread_barrier_destroy pthread.h libc.lib POSIX Destroy a barrier object
pthread_barrier_wait pthread.h libc.lib POSIX Synchronize at a barrier
pthread_rwlockattr_init pthread.h libc.lib POSIX Initialize read-write lock attributes object
pthread_rwlockattr_destroy pthread.h libc.lib POSIX Destroy read-write lock attributes object
pthread_rwlockattr_getpshared pthread.h libc.lib POSIX Get pshared attribute
pthread_rwlockattr_setpshared pthread.h libc.lib POSIX Set pshared attribute
pthread_rwlock_init pthread.h libc.lib POSIX Initialize a read-write lock object
pthread_rwlock_destroy pthread.h libc.lib POSIX Destroy a read-write lock object
pthread_rwlock_tryrdlock pthread.h libc.lib POSIX Try to lock a read-write lock for reading
pthread_rwlock_trywrlock pthread.h libc.lib POSIX Try to lock a read-write lock for writing
pthread_rwlock_rdlock pthread.h libc.lib POSIX Lock a read-write lock for reading
pthread_rwlock_timedrdlock pthread.h libc.lib POSIX Lock a read-write lock for reading with timeout
pthread_rwlock_wrlock pthread.h libc.lib POSIX Lock a read-write lock for write
pthread_rwlock_timedwrlock pthread.h libc.lib POSIX Lock a read-write lock for write with timeout
pthread_rwlock_unlock pthread.h libc.lib POSIX Unlock a read-write lock
pthread_spin_init pthread.h libc.lib POSIX Initialize a spin lock object
pthread_spin_destroy pthread.h libc.lib POSIX Destroy a spin lock object
pthread_spin_lock pthread.h libc.lib POSIX Lock a spin lock
pthread_spin_trylock pthread.h libc.lib POSIX Try to lock a spin lock
pthread_spin_unlock pthread.h libc.lib POSIX Unlock a spin lock
resume os.h os.lib   Resume execution of thread
sched_get_priority_min sched.h libc.lib POSIX Get minimum thread priority
sched_get_priority_max sched.h libc.lib POSIX Get maximum thread priority
sched_getscheduler sched.h libc.lib POSIX Get scheduler
sched_setscheduler sched.h libc.lib POSIX Set scheduler
sched_yield sched.h libc.lib POSIX Yield processor
self os.h os.lib   Return thread handle for current thread
semrel os.h os.lib   Release semaphore
sem_close semaphore.h libc.lib POSIX Close semaphore
sem_destroy semaphore.h libc.lib POSIX Destroy semaphore
sem_getvalue semaphore.h libc.lib POSIX Get the value of a semaphore
sem_init semaphore.h libc.lib POSIX Initialize a semaphore
sem_open semaphore.h libc.lib POSIX Open a semaphore
sem_post semaphore.h libc.lib POSIX Unlock a semaphore
sem_post_multiple semaphore.h libc.lib POSIX Unlock a semaphore multiple times
sem_timedwait semaphore.h libc.lib POSIX Lock a semaphore with timeout
sem_trywait semaphore.h libc.lib POSIX Try to lock a semaphore
sem_unlink semaphore.h libc.lib POSIX Remove semapore
sem_wait semaphore.h libc.lib POSIX Lock a semaphore
setcontext os.h os.lib   Set context for thread
setprio os.h os.lib   Set thread priority
sleep unistd.h,os.h os.lib POSIX Sleep for a number of seconds
msleep os.h os.lib   Sleep for a number of milliseconds
usleep unistd.h libc.lib POSIX Sleep for a number of microseconds
nanosleep time.h libc.lib POSIX Sleep for a number of nanoseconds
spawn os.h os.lib   Load application and spawn new job
spawnv os.h os.lib   Spawn new job with argument array
spawnl os.h os.lib   Spawn new job with argument list
spawnve os.h os.lib   Spawn new job with arguments and environment
suspend os.h os.lib   Suspend execution of thread
tlsalloc os.h os.lib   Allocate thread local storage index
threadtimes sys/times.h,os.h os.lib   Get CPU time for thread
times sys/times.h,os.h os.lib POSIX Get CPU time for current thread
tlsfree os.h os.lib   Free threads local storage index
tlsget os.h os.lib   Get value for thread local storage
tlsset os.h os.lib   Set value for thread local storage
waitone os.h os.lib   Wait for object to become signaled
waitall os.h os.lib   Wait for a number of objects to become signaled
waitany os.h os.lib   Wait for one of a number of objects to become signaled
longjmp setjmp.h libc.lib ANSI Perform non-local jump
setjmp setjmp.h libc.lib ANSI Saves stack environment for longjmp return
sigsetjmp setjmp.h libc.lib ANSI Saves stack environment and signal mask for longjmp return
siglongjmp setjmp.h libc.lib ANSI Restore signal mask and perform non-local jump
atexit stdlib.h libc.lib ANSI Register a function for execution at exit
system stdlib.h libc.lib ANSI Execute operating system command
exit stdlib.h,os.h os.lib ANSI Exit process
_exit stdlib.h,os.h os.lib POSIX Exit process without running exit handlers
vfork unistd.h libc.lib POSIX Create a new process, share virtual memory
execve unistd.h libc.lib POSIX Execute a file with arguments and environment
execv unistd.h libc.lib POSIX Execute a file with argument array
execl unistd.h libc.lib POSIX Execute a file with argument list
waitpid sys/wait.h libc.lib POSIX Wait for a job to terminate
wait sys/wait.h libc.lib POSIX Wait for a child job to terminate

 

Signal Handling

 

Function Header Library Conformance Description
         
alarm unistd.h,os.h os.lib POSIX Schedule an alarm signal
strsignal string.h,os.h os.lib   Return string describing signal
sendsig os.h os.lib   Send a signal to a thread
sigexit os.h os.lib   Exit signal handler
kill signal.h,os.h os.lib POSIX Send a signal to a job
raise signal.h,os.h os.lib ANSI Raise signal
signal signal.h,os.h os.lib ANSI Set signal handler
sigemptyset signal.h,os.h os.lib POSIX Initialize and empty a signal set
sigfillset signal.h,os.h os.lib POSIX Initialize and fill a signal set
sigaddset signal.h,os.h os.lib POSIX Add a signal to a signal set
sigdelset signal.h,os.h os.lib POSIX Delete a signal from a signal set
sigismember signal.h,os.h os.lib POSIX Test for a signal in a signal set
sigaction signal.h,os.h os.lib POSIX Examine and change signal action
sigprocmask signal.h,os.h os.lib POSIX Examine and change blocked signals
sigpending signal.h,os.h os.lib POSIX Examine pending signals
sigsuspend signal.h,os.h os.lib POSIX Wait for a signal

 

Dynamic Loadable Modules

 

Function Header Library Conformance Description
         
exec os.h os.lib   Execute main entry point for module
getmodpath os.h os.lib   Get path for module
getmodule os.h os.lib   Find module by name
getresdata os.h os.lib   Get resource data in module
getreslen os.h os.lib   Get resource data size
getverinfo os.h os.lib   Get version information for module
getvervalue os.h os.lib   Get value from version resource
dlopen dlfcn.h,os.h os.lib POSIX Load module
dlsym dlfcn.h,os.h os.lib POSIX Find entry point in loadable module
dlclose dlfcn.h,os.h os.lib POSIX Unload module

 

Network Communication

 

Function Header Library Conformance Description
         
accept sys/socket.h,os.h os.lib BSD Accept a new connection on a socket
bind sys/socket.h,os.h os.lib BSD Associate a local address with a socket
connect sys/socket.h,os.h os.lib BSD Establish a connection to a specified socket
dn_comp os.h os.lib BSD Compress an Internet domain name
dn_expand os.h os.lib BSD Expand a compressed Internet domain name
gethostbyaddr netdb.h,os.h os.lib BSD Get a network host entry, given an Internet address
gethostbyname netdb.h,os.h os.lib BSD Get a network host entry, given a name
gethostname os.h os.lib BSD Get the name of the current host
getpeername sys/socket.h,os.h os.lib BSD Retrieve the name of the peer to which a socket is connected
getprotobyname netdb.h,os.h os.lib BSD Get a protocol entry, given a name
getprotobynumber netdb.h,os.h os.lib BSD Get a protocol entry, given a number
getservbyname netdb.h,os.h os.lib BSD Get a service entry, given a name
getservbyport netdb.h,os.h os.lib BSD Get a service entry, given a port
getsockname sys/socket.h,os.h os.lib BSD Retrieve the local name for a socket
getsockopt sys/socket.h,os.h os.lib BSD Retrieve a socket option
inet_addr arpa/inet.h,os.h os.lib BSD Convert a string into an Internet address
inet_ntoa arpa/inet.h,os.h os.lib BSD Convert an Internet address into a string
listen sys/socket.h,os.h os.lib BSD Place a socket in a state where it is listening for an incoming connection
recv sys/socket.h,os.h os.lib BSD Receive data from a connected or bound socket
recvfrom sys/socket.h,os.h os.lib BSD Receive a datagram and store the source address
recvmsg sys/socket.h,os.h os.lib BSD Receive a message on a socket
res_mkquery os.h os.lib BSD Construct an Internet domain name query
res_query os.h os.lib BSD Query the domain name server
res_querydomain os.h os.lib BSD Query the local Internet domain name server
res_search os.h os.lib BSD Query a DNS server, using search options
res_send os.h os.lib BSD Send a preformatted Internet domain name query
select sys/select.h,os.h os.lib BSD Determine the status of one or more sockets, waiting if necessary, to perform synchronous I/O
send sys/socket.h,os.h os.lib BSD Send data on a connected socket
sendmsg sys/socket.h,os.h os.lib BSD Send a message on a socket
sendto sys/socket.h,os.h os.lib BSD Send data to a specific destination
setsockopt sys/socket.h,os.h os.lib BSD Set a socket option
shutdown sys/socket.h,os.h os.lib BSD Disable sends or receives on a socket
socket sys/socket.h,os.h os.lib BSD Create a new socket

 

Data Conversion

 

Function Header Library Conformance Description
         
tolower ctype.h libc.lib ANSI Convert character to upper case
toupper ctype.h libc.lib ANSI Convert character to lower case
htonl arpa/inet.h,os.h   BSD Convert unsigned long from host to network byte order
htons arpa/inet.h,os.h   BSD Convert unsigned short from host to network byte order
ntohl arpa/inet.h,os.h   BSD Convert unsigned long from network to host byte order
ntohs arpa/inet.h,os.h   BSD Convert unsigned short from network to host byte order
atoi stdlib.h libc.lib ANSI Convert string to int
atol stdlib.h libc.lib ANSI Convert string to long
ecvt stdlib.h libc.lib MSVC Convert double number to string
ecvtbuf stdlib.h libc.lib   Convert double number to string using buffer
fcvt stdlib.h libc.lib MSVC Convert floating-point number to string
fcvtbuf stdlib.h libc.lib   Convert floating-point number to string using buffer
itoa stdlib.h libc.lib MSVC Convert integer to string
ltoa stdlib.h libc.lib MSVC Convert long to string
strtod stdlib.h libc.lib ANSI Convert string to double
strtof stdlib.h libc.lib ISO Convert string to float
strtol stdlib.h libc.lib POSIX Convert string to long
strtoul stdlib.h libc.lib POSIX Convert string to unsigned long
strtoll stdlib.h libc.lib POSIX Convert string to 64-bit integer
strtoull stdlib.h libc.lib POSIX Convert string to unsigned 64-bit integer
strtoimax inttypes.h libc.lib POSIX Convert string to largest integer type
strtoumax inttypes.h libc.lib POSIX Convert string to largest unsigned integer type
ultoa stdlib.h libc.lib MSVC Convert unsigned long to string
atof stdlib.h,math.h libc.lib ANSI Convert string to float

 

Error Handling

 

Function Header Library Conformance Description
         
assert assert.h libc.lib ANSI Assert that expression if true, terminate the job if false
errno errno.h,stddef.h,

os.h

os.lib ANSI Return the current error number
eof io.h,os.h os.lib MSVC Test for end of file
panic os.h os.lib   Emergency shutdown
syslog syslog.h,os.h os.lib POSIX Log entry to syslog
vsyslog syslog.h,os.h os.lib   Log entry to syslog using va_list
openlog syslog.h,os.h os.lib POSIX Configure syslog features for job
closelog syslog.h,os.h os.lib POSIX Close logging
setlogmask syslog.h,os.h os.lib POSIX Set log priority mask
strerror string.h,os.h os.lib ANSI Get the system defined error message

 

Character Classification

 

Function Header Library Conformance Description
         
isalnum ctype.h libc.lib ANSI Test for alphanumeric character
isalpha ctype.h libc.lib ANSI Test for alphabetic character
iscntrl ctype.h libc.lib ANSI Test for control character
isdigit ctype.h libc.lib ANSI Test for decimal digit
isgraph ctype.h libc.lib ANSI Test for printable character except space
isleadbyte ctype.h libc.lib ANSI Test for lead byte character in multi byte character set
islower ctype.h libc.lib ANSI Test for lower case character
isprint ctype.h libc.lib ANSI Test for printable character
ispunct ctype.h libc.lib ANSI Test for punctuation character
isspace ctype.h libc.lib ANSI Test for whitespace character
isupper ctype.h libc.lib ANSI Test for upper case character
isxdigit ctype.h libc.lib ANSI Test for hexadecimal digit

 

Math Functions

 

Function Header Library Conformance Description
         
acos math.h libc.lib ANSI Floating point arc cosine of x
asin math.h libc.lib ANSI Floating point arc sine of x
atan math.h libc.lib ANSI Floating point arc tangent of x
atan2 math.h libc.lib ANSI Floating point arc tangentcof y/x
ceil math.h libc.lib ANSI Floating point ceiling of x
cos math.h libc.lib ANSI Floating point cosine of x
cosh math.h libc.lib ANSI Floating point hyperbolic cosine of x
exp math.h libc.lib ANSI Floating point exponent of x
fabs math.h libc.lib ANSI Floating point absolute value of x
floor math.h libc.lib ANSI Floating point floor of x
fmod math.h libc.lib ANSI Floating point remainder of x/y
frexp math.h libc.lib ANSI Split x into normalized fraction and power of 2
hypot math.h libc.lib POSIX Euclidean distance function
isfinite math.h libc.lib ANSI Test for finite value
isinf math.h libc.lib ANSI Test for infinite value
isnan math.h libc.lib ANSI Test for a NaN
ldexp math.h libc.lib ANSI The value of x * 2**n
log math.h libc.lib ANSI Natural log of x
log10 math.h libc.lib ANSI Log base 10 of x
modf math.h libc.lib ANSI Split x into integral and fractional parts, each with the same sign as x
pow math.h libc.lib ANSI The value of x**y
sin math.h libc.lib ANSI Floating point sine of x
sinh math.h libc.lib ANSI Floating point hyperbolic sine of x
sqrt math.h libc.lib ANSI Floating point square root of x
tan math.h libc.lib ANSI Floating point tangent of x
tanh math.h libc.lib ANSI Floating point hyperbolic tangent of x
abs stdlib.h libc.lib ANSI Absolute value of integer
div stdlib.h libc.lib ANSI Divide signed integers giving quotient and remainder
labs stdlib.h libc.lib ANSI Absolute value of long
ldiv stdlib.h libc.lib ANSI Divide long integers giving quotient and remainder

 

Memory Management

 

Function Header Library Conformance Description
         
alloca alloca.h libc.lib MSVC Allocate memory on the stack
calloc stdlib.h,malloc.h,

os.h

os.lib ANSI Allocate memory block with size fill
free stdlib.h,malloc.h,

os.h

os.lib ANSI Free memory block
getpagesize unistd.h os.lib POSIX Get memory page size
malloc stdlib.h,malloc.h,

os.h

os.lib ANSI Allocate memory block
realloc stdlib.h,malloc.h,

os.h

os.lib ANSI Re-size memory block
mmap stat/mman.h libc.lib POSIX Map file into memory
munmap stat/mman.h libc.lib POSIX Unmap file from memory
msync stat/mman.h libc.lib POSIX Synchronize a file with mapped memory
mprotect stat/mman.h libc.lib POSIX Set protection on a region of memory
mallinfo os.h os.lib   Get heap allocation statistics
malloc_usable_size stdlib.h,malloc.h,

os.h

os.lib   Returns the usable size of the allocation
vmlock os.h os.lib   Lock memory (NYI)
vmalloc os.h os.lib   Reserve and commit virtual memory
vmprotect os.h os.lib   Protect memory region
vmrealloc os.h os.lib   Reallocate virtual memory (NYI)
vmunlock os.h os.lib   Unlock memory (NYI)
vmfree os.h os.lib   Deallocate and decommit virtual memory
vmmap os.h os.lib   Map file into virtual memory
vmsync os.h os.lib   Synchronize a file with mapped memory

 

Buffer Manipulation

 

Function Header Library Conformance Description
         
memccpy string.h,memory.h libc.lib MSVC Copies characters until character or number of characters has been copied
memchr string.h,memory.h libc.lib POSIX Return a pointer to the first occurrence, within a specified number of characters
memcmp string.h,memory.h libc.lib ANSI Compare a specified number of characters from two memory locations
memcpy string.h,memory.h libc.lib ANSI Copy characters from a buffer
memicpy string.h,memory.h libc.lib MSVC Compare a specified number of characters from two memory locations without regard to case
memmove string.h,memory.h libc.lib ANSI Copy a specified number of characters from one memory location to another
memset string.h,memory.h libc.lib ISO Set a region of memory to a specified character

 

String Manipulation

 

Function Header Library Conformance Description
         
strcasestr string.h libc.lib GNU Find the first occurrence of a string in another string ignoring case
stpcpy string.h libc.lib POSIX Copy a string and return a pointer to the end of the result
strcat string.h libc.lib ANSI Concatenate two strings
strchr string.h libc.lib ANSI Find the first occurrence of a given character in a string
strcmp string.h libc.lib ANSI Compare two strings
strcpy string.h libc.lib ANSI Copy one string to another
strcspn string.h libc.lib ANSI Find any one of a set of characters in a string
strdup string.h libc.lib MSVC Duplicate a string
stricmp string.h libc.lib MSVC Compare two strings without regard to case
strlen string.h libc.lib ANSI Get the length of a string
strlwr string.h libc.lib MSVC Convert a string to lower case
strncat string.h libc.lib ANSI Concatenate the specified number of characters from one string to another
strncmp string.h libc.lib ANSI Compare the specified number of characters in two strings
strncpy string.h libc.lib ANSI Copy the specified number of characters from one string to another
strnicmp string.h libc.lib MSVC Compare the specified number of characters in two strings without regard to case
strnset string.h libc.lib MSVC Set the specified number of characters in a string to a given character
strpbrk string.h libc.lib ANSI Find the first occurrence of a character from one string in another
strrchr string.h libc.lib ANSI Find the last occurrence of a character in a string
strrev string.h libc.lib MSVC Reverse a string
strsep string.h libc.lib BSD Extract token from string
strset string.h libc.lib MSVC Set all characters in a string to a given character
strspn string.h libc.lib ANSI Find the first substring from a given character set in a string
strstr string.h libc.lib ANSI Find the first occurrence of a string in another string
strtok string.h libc.lib ANSI Find the next token in a string
strtok_r string.h libc.lib POSIX Split strings into tokens
strupr string.h libc.lib MSVC Convert a string to upper case
strcasecmp string.h libc.lib POSIX Compare two strings without regard to case
strncasecmp string.h libc.lib POSIX Compare the specified number of characters in two strings without regard to case
regcomp regex.h libc.lib POSIX Compile regular expression
regexec regex.h libc.lib POSIX Regular expression matching
regerror regex.h libc.lib POSIX Get error message for regular expression
regfree regex.h libc.lib POSIX Free regular expression

 

Stream Input/Output

 

Function Header Library Conformance Description
         
clearerr stdio.h libc.lib ANSI Clear the error indicator for a stream
fclose stdio.h libc.lib ANSI Close a stream
fdopen stdio.h libc.lib POSIX Associate a stream with an open file handle
feof stdio.h   ANSI Tests for end of file on a stream
ferror stdio.h   ANSI Tests for error on a stream
fflush stdio.h libc.lib ANSI Flush a stream
fgetc stdio.h libc.lib ANSI Read a character from a stream
fgetpos stdio.h libc.lib ANSI Get position indicator for a stream
fgets stdio.h libc.lib ANSI Read a string from a stream
fileno stdio.h   ANSI Gets the file handle associated with a stream
fopen stdio.h libc.lib ANSI Open a stream
fprintf stdio.h libc.lib ANSI Write formatted data to a stream
fputc stdio.h libc.lib ANSI Write a character to a stream
fputs stdio.h libc.lib ANSI Write a string to a stream
fread stdio.h libc.lib ANSI Read unformatted data from a stream
fready stdio.h libc.lib   Check if input data is available
freopen stdio.h libc.lib ANSI Reassign a stream with a new file
fscanf stdio.h libc.lib ANSI Read formatted data from a stream
fseek stdio.h libc.lib ANSI Move file position to a given location
fsetpos stdio.h libc.lib ANSI Set the position indicator of a stream
ftell stdio.h libc.lib ANSI Get current file position
fwrite stdio.h libc.lib ANSI Write unformatted data to a stream
getc stdio.h   ANSI Read a character from a stream
getchar stdio.h   ANSI Read a character from stdin
gets stdio.h libc.lib ANSI Read a string from stdin
perror stdio.h libc.lib ANSI Print string and error message to stderr
pclose stdio.h libc.lib POSIX Close a pipe stream to or from a job
popen stdio.h libc.lib POSIX Initiate pipe streams to or from a job
printf stdio.h libc.lib ANSI Write formatted data to stdout
putc stdio.h   ANSI Write a character to a stream
putchar stdio.h   ANSI Write a character to stdout
puts stdio.h libc.lib ANSI Write a string to stdout
remove stdio.h libc.lib ANSI Delete a file
rewind stdio.h libc.lib ANSI Move file pointer to beginning of stream
scanf stdio.h libc.lib ANSI Read formatted data from stdin
setbuf stdio.h libc.lib ANSI Control stream buffering
setvbuf stdio.h libc.lib ANSI Control stream buffering and buffer size
snprintf stdio.h libc.lib ISO Write formatted data to buffer
sprintf stdio.h libc.lib ANSI Write formatted data to string
sscanf stdio.h libc.lib ANSI Read formatted data from a string
tempnam stdio.h libc.lib POSIX Create a name for a temporary file
tmpfile stdio.h libc.lib ANSI Create a temporary file
tmpnam stdio.h libc.lib ANSI Create a temporary file name
ungetc stdio.h libc.lib ANSI Remove a character from a stream
vfprintf stdio.h libc.lib ANSI Write formatted data to file using va_list
vfscanf stdio.h libc.lib ANSI Read formatted data from a stream using va_list
vprintf stdio.h libc.lib ANSI Write formatted data to stdout using va_list
vscanf stdio.h libc.lib ANSI Read formatted data from stdin using va_list
vsnprintf stdio.h libc.lib ISO Write formatted data to buffer using va_list
vsprintf stdio.h libc.lib ANSI Write formatted data to string using va_list
vsscanf stdio.h libc.lib ANSI Read formatted data from string using va_list
rename stdio.h,os.h os.lib ANSI Rename a file

 

Time Management

 

Function Header Library Conformance Description
         
gettimeofday sys/time.h,os.h os.lib POSIX Get time
settimeofday os.h os.lib   Set time
asctime time.h libc.lib ANSI Convert the time to a string
ctime time.h libc.lib ANSI Convert a time value to a string and adjust for local time zone settings
difftime time.h   ANSI Compute difference between two times
gmtime time.h libc.lib ANSI Convert time from type time_t to struct tm
localtime time.h libc.lib ANSI Convert time from type time_t to struct tm with local correction
mktime time.h libc.lib ANSI Convert time to calendar value
strftime time.h libc.lib ANSI Convert the time and date information into a formatted string
clock time.h,os.h os.lib ANSI Return the processor time since the beginning of execution
time time.h,os.h os.lib ANSI Return the current calendar time

 

User Management

 

Function Header Library Conformance Description
         
getuid unistd.h,os.h os.lib POSIX Get real user id
getgid unistd.h,os.h os.lib POSIX Get real group id
setuid unistd.h,os.h os.lib POSIX Set real user id
setgid unistd.h,os.h os.lib POSIX Set real group id
geteuid unistd.h,os.h os.lib POSIX Get effective user id
getegid unistd.h,os.h os.lib POSIX Get effective group id
seteuid unistd.h,os.h os.lib POSIX Set effective user id
setegid unistd.h,os.h os.lib POSIX Set effective group id
getgroups unistd.h,os.h os.lib POSIX Get supplementary group ids
setgroups grp.h,os.h os.lib SYSV Set supplementary group ids
initgroups grp.h,os.h os.lib BSD Initialize supplementary group access list
getgrnam grp.h,os.h os.lib POSIX Search group database for a name
getgrgid grp.h,os.h os.lib POSIX Get group database entry for a group id
getpwnam pwd.h,os.h os.lib POSIX Search user database for a name
getpwuid pwd.h,os.h os.lib POSIX Get user database entry for a user id

 

Random Number Generation

 

Function Header Library Conformance Description
         
initstate stdlib.h libc.lib BSD Initialize state array for use by random()
rand stdlib.h libc.lib ANSI Generate a pseudo random number
random stdlib.h libc.lib BSD Generate random number using a non-linear additive feedback random number generator
setstate stdlib.h libc.lib BSD Change the state array used by random()
srand stdlib.h libc.lib ANSI Set random number seed
srandom stdlib.h libc.lib BSD Initialize the random number generator based on the given seed
srandomdev stdlib.h libc.lib BSD Initialize the random number generator based on system generated seed

 

Utility Functions

 

Function Header Library Conformance Description
         
clear_bit bitops.h libc.lib   Clear bit in bit vector
find_first_zero_bit bitops.h libc.lib   Find first zero bit in bit vector
find_next_zero_bit bitops.h libc.lib   Find next zero bit in bit vector after position
set_bit bitops.h libc.lib   Set bit in bit vector
set_bits bitops.h libc.lib   Set a number of bits in bit vector
test_bit bitops.h libc.lib   Test bit in bit vector
hash_alloc hash.h libc.lib   Allocate new hash table
hash_foreach hash.h libc.lib   Iterate over all elements in hash table
hash_insert hash.h libc.lib   Insert element in hash table
hash_lookup hash.h libc.lib   Lookup element in hash table
hash_size hash.h libc.lib   Return number of elements in hash table
find_property inifile.h libc.lib   Find named property in section
find_section inifile.h libc.lib   Find named section
free_properties inifile.h libc.lib   Release sections
get_numeric_property inifile.h libc.lib   Get numeric value for property in section
get_property inifile.h libc.lib   Get value for property in section
get_section_size inifile.h libc.lib   Return number of properties in section
list_properties inifile.h libc.lib   List properties to stdout
parse_properties inifile.h libc.lib   Parse properties in string buffer
read_properties inifile.h libc.lib   Read properties from file
rmap_alloc rmap.h libc.lib   Allocate free region in resource map
rmap_alloc_align rmap.h libc.lib   Allocate free aligned region in resource map
rmap_free rmap.h libc.lib   Free region in resource map
rmap_init rmap.h libc.lib   Initialize resource map
rmap_reserve rmap.h libc.lib   Reserve a specified region in resource map
rmap_status rmap.h libc.lib   Determine whether a region is free or allocated in resource map
bsearch stdlib.h libc.lib ANSI Perform a binary search on an array
get_num_option stdlib.h libc.lib   Get numeric option from option string
get_option stdlib.h libc.lib   Get option in option string
max stdlib.h   MSVC Return maximum of a and b
min stdlib.h   MSVC Return minimum of a and b
qsort stdlib.h libc.lib ANSI Perform a quick sort on an array
crypt unistd.h,os.h os.lib POSIX Encrypt string
crypt_r os.h os.lib GNU Encrypt string (reentrant)
getopt unistd.h,getopt.h libc.lib POSIX Parse command options
getopt_long getopt.h libc.lib GNU Parse long command options
dirname libgen.h libc.lib POSIX Get the parent directory name of a file pathname
basename libgen.h libc.lib POSIX Get the last component of a pathname

 

Miscellaneous

 

Function Header Library Conformance Description
         
dbgbreak os.h os.lib   Signal debugger to make a breakpoint exception
exitos os.h os.lib   Shutdown operating system
syscall os.h os.lib   Call kernel function
sysinfo os.h os.lib   Return system information about cpu, memory and load
va_arg stdarg.h   ANSI Get next argument in argument list
va_end stdarg.h   ANSI Reset argument list
va_start stdarg.h   ANSI Set argument list to start of optional arguments
offsetof stddef.h   ANSI Retrieve the offset of a member from the beginning of its parent structure
getenv stdlib.h os.lib POSIX Get value of an environment variable
setenv stdlib.h os.lib POSIX Add or change environment variable
unsetenv stdlib.h os.lib POSIX Remove an environment variable
putenv stdlib.h os.lib POSIX Change or add a value to an environment
uname sys/utsname.h,

os.h

os.lib POSIX Get name of the current system