This chapter includes the following:
Here are the categories:
We've organized the functions in the C library into the following categories:
- Asynchronous I/O functions
- Asynchronous read, write, and other I/O operations.
- Atomic functions
- Thread-safe integer manipulation functions.
- Character manipulation functions
- Single-character functions for upper/lowercase conversions.
- Conversion functions
- Convert values from one representation to another (e.g. numeric values to strings).
- Directory functions
- Directory services (change, open, close, etc.).
- Dispatch interface functions
- Handle different event types, including messages, pulse codes, and signals.
- File manipulation functions
- File operations (change permissions, delete, rename, etc.)
- IPC functions
- Traditional InterProcess Communication functions.
- Hardware functions
- These functions work with PCI and other devices.
- Math functions
- Perform computations such as the common trigonometric calculations.
These functions operate with floating-point values.
- Memory allocation functions
- Allocate and deallocate memory.
- Memory manipulation functions
- Manipulate blocks of memory.
- Message queue functions
- Nonblocking message-passing facilities.
- Multibyte character functions
- ANSI C functions for processing multibyte and wide characters.
- QNX 6-specific IPC functions
- Native message-passing and related functions.
- Operating system I/O functions
- POSIX functions for performing
I/O at a lower level than the C Language stream I/O functions (e.g.
fopen(),
fread(),
fwrite(),
and
fclose()
).
- PC Card functions
- Native PC Card functions.
- Platform-specific functions
- Invoke Intel 80x86 and other processor-related functions directly from a program.
- Process environment functions
- For process identification,
user identification, process groups, system identification,
system time and process time, environment variables,
terminal identification,
and configurable system variables.
- Process manipulation functions
- For process creation, execution, and
termination; signal handling; and timer operations.
- Realtime timer functions
- Rich set of "inexpensive" timer functions that are quick to create and manipulate.
- Resource manager functions
- These functions help you create resource managers.
- Searching and sorting functions
- Perform various search and sort operations (do a binary
search on a sorted array, find one string inside another, etc.).
- Shared-memory functions
- Create and manipulate shared-memory regions.
- Signal functions
- Rich set of functions for handling and sending signals.
- Stream I/O functions
- The "standard" functions to read and
write files. Data can be transmitted under format control or
as characters, strings, or blocks of memory.
- String manipulation functions
- Manipulate a character string, i.e. an array of zero or more adjacent characters
followed by a NUL character (\0) that marks the end
of the string.
- System database functions
- Allow an application to access group and user database
information.
- System message log functions
- This set of functions controls the system log.
- TCP/IP functions
- Handle TCP/IP network communications and the TCP/IP database files.
- Terminal control functions
- Set and control terminal attributes (baud rate, float control, etc.).
- Thread functions
- Operate on threads and the objects used to synchronize threads.
- Time functions
- Obtain and manipulate times and dates.
- Variable-length argument
list functions
- Process a variable number of arguments to a function.
- Wide-character functions
- Wide-character versions of functions from other function summary categories.
The following subsections describe these function categories
in more detail. Each function is noted with a brief
description of its purpose.
These functions perform asynchronous read, write,
and other I/O operations.
 |
Asynchronous I/O operations aren't currently supported. |
The following functions are defined:
- aio_cancel()
- Cancel an asynchronous I/O operation
- aio_error()
- Get the error status for an asynchronous I/O operation
- aio_fsync()
- Asynchronously synchronize a file
- aio_read()
- Asynchronously read from a file
- aio_return()
- Get the return status for an asynchronous I/O operation
- aio_suspend()
- Wait for asynchronous I/O operations to complete
- aio_write()
- Asynchronously write to a file
These functions manipulate an integer in a thread-safe way. On a
multiprocessor system, even a simple:
/* Assuming x is an unsigned variable shared between two
or more threads or a thread and an interrupt handler.*/
x ^= 0xdeadbeef;
may cause x to be in an undefined state if multiple threads running
simultaneously on multiple processors execute this code at the same time.
Use the atomic*() functions to ensure that your integer
operations are carried out properly:
atomic_toggle( &x, 0xdeadbeef );
- atomic_add()
- Safely add to a variable
- atomic_add_value()
- Safely add to a variable
- atomic_clr()
- Safely clear a variable
- atomic_clr_value()
- Safely clear a variable
- atomic_set()
- Safely set bits in a variable
- atomic_set_value()
- Safely set bits in a variable
- atomic_sub()
- Safely subtract from a variable
- atomic_sub_value()
- Safely subtract from a variable
- atomic_toggle()
- Safely toggle a variable
- atomic_toggle_value()
- Safely toggle a variable
These functions operate on single characters of type char.
The functions test characters in various ways and convert them between
upper and lowercase. (Some of these functions have wide-character versions in the
"Wide-character functions"
section of the function summary.)
- isalnum()
- Test a character to see if it's alphanumeric
- isalpha()
- Test to see if a character is a letter
- isascii()
- Test for a character in the range 0 to 127
- iscntrl()
- Test a character to see if it's a control character
- isdigit()
- Test for any decimal digit
- isgraph()
- Test for any printable character except space
- isinf(), isinff()
- Test for infinity
- islower()
- Test for any lowercase letter
- isnan(), isnanf()
- Test for NAN
- isprint()
- Test for any printable character, including space
- ispunct()
- Test for any punctuation character
- isspace()
- Test for a whitespace character
- isupper()
- Test for any uppercase letter
- isxdigit()
- Test for any hexadecimal digit
- tolower()
- Convert a character to lowercase
- toupper()
- Convert a character to uppercase
These functions perform conversions between objects of various types
and strings.
- atof()
- Convert a string to a double representation
- atoh()
- Convert a string to unsigned representation
- atoi()
- Convert a string to integer representation
- atol(), atoll()
- Convert a string to long integer representation
- ENDIAN_BE16()
- Return a big-endian 16-bit value in native format
- ENDIAN_BE32()
- Return a big-endian 32-bit value in native format
- ENDIAN_BE64()
- Return a big-endian 64-bit value in native format
- ENDIAN_LE16()
- Return a little-endian 16-bit value in native format
- ENDIAN_LE32()
- Return a little-endian 32-bit value in native format
- ENDIAN_LE64()
- Return a little-endian 64-bit value in native format
- ENDIAN_RET16()
- Return an endian-swapped 16-bit value
- ENDIAN_RET32()
- Return an endian-swapped 32-bit value
- ENDIAN_RET64()
- Return an endian-swapped 64-bit value
- ENDIAN_SWAP16()
- Endian-swap a 16-bit value in place
- ENDIAN_SWAP32()
- Endian-swap a 32-bit value in place
- ENDIAN_SWAP64()
- Endian-swap a 64-bit value in place
- htonl()
- Convert host-byte order value
- htons()
- Convert host-byte order value
- itoa()
- Convert a binary integer to a string, in a given base
- ltoa(), lltoa()
- Convert a binary integer value to a string in a given base
- nsec2timespec()
- Convert nanoseconds to a timespec structure
- ntohl()
- Convert network-byte order value
- ntohs()
- Convert network-byte order value
- strtod()
- Convert a string to a double
- strtol(), strtoll()
- Convert a string to a long integer
- strtoul(), strtoull()
- Convert a string to an unsigned long integer
- timespec2nsec()
- Convert a timespec structure to nanoseconds
- ultoa(), ulltoa()
- Convert an unsigned binary integer to a string
- UNALIGNED_PUT16()
- Write a misaligned 16-bit value safely
- UNALIGNED_PUT32()
- Write a misaligned 32-bit value safely
- UNALIGNED_PUT64()
- Write a misaligned 64-bit value safely
- UNALIGNED_RET16()
- Access a misaligned 16-bit value safely
- UNALIGNED_RET32()
- Access a misaligned 32-bit value safely
- UNALIGNED_RET64()
- Access a misaligned 64-bit value safely
- utoa()
- Convert an unsigned binary integer to a string
- wordexp()
- Perform word expansions
- wordfree()
- Free a word expansion buffer
See also the following functions, which convert the cases of characters and
strings:
These functions pertain to directory manipulation:
- alphasort()
- Sort directory entries
- chdir()
- Change the current working directory
- chroot()
- Change the root directory
- closedir()
- Close a directory
- dirname()
- Report the parent directory name of a file pathname
- getcwd()
- Get the name of the current working directory
- getwd()
- Get current working directory pathname
- glob()
- Find paths matching a pattern
- globfree()
- Free storage allocated by a call to glob()
- mkdir()
- Create a subdirectory
- mount()
- Mount a filesystem
- mount_parse_generic_args()
- Strip off common mount arguments
- opendir()
- Open a directory file
- pathfind(), pathfind_r()
- Search for a file in a list of directories
- readdir()
- Get information about the next matching filename
- readdir_r()
- Get information about the next matching filename
- realpath()
- Resolve a pathname
- rewinddir()
- Reset the position of a directory stream to the start of the
directory
- rmdir()
- Delete an empty directory
- scandir()
- Scan a directory
- umount()
- Unmount a filesystem
These functions make up the dispatch interface where you can
handle different event types including messages, pulse codes, and signals.
The functions cover dispatch contexts, attaching events, attaching pathnames
and file descriptors to dispatch contexts, thread pools, etc.
- dispatch_block()
- Block while waiting for an event
- dispatch_context_alloc()
- Return a dispatch context
- dispatch_context_free()
- Free a dispatch context
- dispatch_create()
- Allocate a dispatch handle
- dispatch_destroy()
- Destroy a dispatch handle
- dispatch_handler()
- Handle events received by dispatch_block()
- dispatch_timeout()
- Set a timeout
- message_attach()
- Attach a message range
- message_connect()
- Create a connection to a channel
- message_detach()
- Detach a message range
- name_attach()
- Register a name in the namespace and create a channel
- name_detach()
- Remove a name from the namespace and destroy the channel
- pulse_attach()
- Attach a pulse code
- pulse_detach()
- Detach a pulse code
- resmgr_attach()
- Attach a path to a pathname space
- resmgr_block()
- Block wait for a message
- resmgr_context_alloc()
- Allocate a context
- resmgr_context_free()
- Free a context
- resmgr_detach()
- Remove a pathname from the pathname space
- resmgr_devino()
- Get the device and inode number
- resmgr_handler()
- Handle resource manager messages
- resmgr_msgread()
- Read a message from a client
- resmgr_msgreadv()
- Read a message from a client
- resmgr_msgwrite()
- Write a message to a client
- resmgr_msgwritev()
- Write a message to a client
- _RESMGR_NPARTS()
- Get a given number of parts from the ctp->iov structure
- resmgr_open_bind()
- Associate an OCB with an open request
- resmgr_pathname()
- Return the pathname associated with an ID
- _RESMGR_PTR()
- Get one part from the ctp->iov structure and fill in its fields
- _RESMGR_STATUS()
- Set ctp->status
- resmgr_unbind()
- Remove an OCB
- select_attach()
- Attach a file descriptor to a file handle
- select_detach()
- Detach a file descriptor
- select_query()
- Decode the last select event
- thread_pool_create()
- Create a thread pool handle
- thread_pool_control()
- Control the thread pool behaviour
- thread_pool_destroy()
- Free the memory allocated to a thread pool
- thread_pool_limits()
- Wrapper function for thread_pool_control()
- thread_pool_start()
- Start a thread pool
These functions operate directly with files. The following functions are defined:
- access()
- Check to see if a file or directory can be accessed
- chmod()
- Change the permissions for a file
- chown()
- Change the user ID and group ID of a file
- eaccess()
- Check to see if a file or directory can be accessed (extended version)
- glob()
- Find paths matching a pattern
- globfree()
- Free storage allocated by a call to glob()
- fchmod()
- Change the permissions for a file
- fchown()
- Change the user ID and group ID of a file
- fpathconf()
- Return the value of a configurable limit associated with a file or directory
- ftruncate(), ftruncate64()
- Truncate a file
- futime()
- Record the modification time for a file
- lchown()
- Change the user ID and group ID of a file or symbolic link
- lstat(), lstat64()
- Get information about a file or directory
- ltrunc()
- Truncate a file at a given position
- mkfifo()
- Create a FIFO special file
- mkstemp()
- Make a unique temporary filename, and open the file
- mktemp()
- Make a unique temporary filename
- pathconf()
- Return the value of a configurable limit
- pclose()
- Close a pipe
- pwrite(), pwrite64()
- Write into a file without changing the file pointer
- remove()
- Delete a file
- rename()
- Rename a file
- stat(), stat64()
- Get information about a file or directory
- statvfs(), statvfs64()
- Get filesystem information
- sync()
- Synchronize filesystem updates
- tempnam()
- Create a name for a temporary file
- truncate()
- Truncate a file to a specified length
- tmpnam()
- Generate a unique string for use as a filename
- unlink()
- Delete a file
- utime()
- Record the modification time for a file or directory
- utimes()
- Set file access and modification times
These functions deal with InterProcess Communications.
- flock()
- Apply or remove an advisory lock on an open file
- lockf()
- Record locking on files
- mlock()
- Lock a buffer in physical memory
- mlockall()
- Lock a process's address space
- mmap(), mmap64()
- Map a memory region into a process address space
- mprotect()
- Change memory protection
- msync()
- Synchronize memory with physical storage
- munlock()
- Unlock a buffer
- munlockall()
- Unlock a process's address space
- munmap()
- Unmap previously mapped addresses
- pthread_barrier_destroy()
- Destroy a barrier object
- pthread_barrier_init()
- Initialize a barrier object
- pthread_barrier_wait()
- Synchronize at a barrier
- pthread_barrierattr_destroy()
- Destroy barrier attributes object
- pthread_barrierattr_getpshared()
- Get process-shared attribute of barrier attributes object
- pthread_barrierattr_init()
- Initialize barrier attributes object
- pthread_barrierattr_setpshared()
- Set process-shared attribute of barrier attributes object
- pthread_cond_broadcast()
- Unblock threads waiting on a condition
- pthread_cond_destroy()
- Destroy the condition variable
- pthread_cond_init()
- Initialize the condition variable
- pthread_cond_signal()
- Unblock the thread waiting on condition variable
- pthread_cond_timedwait()
- Timed wait on the condition variable
- pthread_cond_wait()
- Wait on the condition variable
- pthread_condattr_destroy()
- Destroy the condition variable attribute object
- pthread_condattr_getclock()
- Get the clock selection condition variable attribute
- pthread_condattr_getpshared()
- Get the process-shared attribute from a condition variable
attribute object
- pthread_condattr_init()
- Initialize the condition variable attribute object
- pthread_condattr_setclock()
- Set the clock selection condition variable attribute
- pthread_condattr_setpshared()
- Set the process-shared attribute in a condition variable
attribute object
- pthread_mutex_destroy()
- Destroy the mutex
- pthread_mutex_getprioceiling()
- Get a mutexes priority ceiling
- pthread_mutex_init()
- Initialize the mutex
- pthread_mutex_lock()
- Lock the mutex
- pthread_mutex_setprioceiling()
- Set a mutexes priority ceiling
- pthread_mutex_timedlock()
- Lock a mutex
- pthread_mutex_trylock()
- Attempt to lock a mutex
- pthread_mutex_unlock()
- Unlock the mutex
- pthread_mutexattr_destroy()
- Destroy the mutex attribute object
- pthread_mutexattr_getprioceiling()
- Get the priority ceiling of a mutex attribute object
- pthread_mutexattr_getprotocol()
- Get a mutexes scheduling protocol
- pthread_mutexattr_getpshared()
- Get the process-shared attribute from a mutex attribute object
- pthread_mutexattr_getrecursive()
- Get the recursive attribute from a mutex attribute object
- pthread_mutexattr_gettype()
- Get a mutex type
- pthread_mutexattr_init()
- Initialize the mutex attribute object
- pthread_mutexattr_setprioceiling()
- Set the priority ceiling of a mutex attribute object
- pthread_mutexattr_setprotocol()
- Set a mutexes scheduling protocol
- pthread_mutexattr_setpshared()
- Set the process-shared attribute in mutex attribute object
- pthread_mutexattr_setrecursive()
- Set the recursive attribute in mutex attribute object
- pthread_mutexattr_settype()
- Set a mutex type
- pthread_once()
- Dynamic package initialization
- pthread_rwlock_destroy()
- Destroy a read/write lock
- pthread_rwlock_init()
- Initialize a read/write lock
- pthread_rwlock_rdlock()
- Acquire a shared read lock on a read/write lock
- pthread_rwlock_timedrdlock()
- Lock a read-write lock for writing
- pthread_rwlock_timedwrlock()
- Attempt to acquire an exclusive write lock on a read/write lock
- pthread_rwlock_tryrdlock()
- Attempt to acquire a shared read lock on a read/write lock
- pthread_rwlock_trywrlock()
- Attempt to acquire an exclusive write lock on a read/write lock
- pthread_rwlock_unlock()
- Unlock a read/write lock
- pthread_rwlock_wrlock()
- Acquire an exclusive write lock on a read/write lock
- pthread_rwlockattr_destroy()
- Destroy a read-write lock attribute object
- pthread_rwlockattr_getpshared()
- Get the process-shared attribute of a read-write lock attribute object
- pthread_rwlockattr_init()
- Create a read-write lock attribute object
- pthread_rwlockattr_setpshared()
- Set the process-shared attribute of a read-write lock attribute object
- pthread_spin_destroy()
- Destroy a thread spinlock
- pthread_spin_init()
- Initialize a thread spinlock
- pthread_spin_lock()
- Lock a thread spinlock
- pthread_spin_trylock()
- Try locking a thread spinlock
- pthread_spin_unlock()
- Unlock a thread spinlock
- readcond()
- Read data from a terminal device
- sem_close()
- Close a named semaphore
- sem_destroy()
- Destroy a semaphore
- sem_getvalue()
- Get the value of a semaphore (named or unnamed)
- sem_init()
- Initialize a semaphore
- sem_open()
- Create/access a named semaphore
- sem_post()
- Increment a semaphore
- sem_timedwait()
- Lock a semaphore
- sem_trywait()
- Wait on a semaphore, but don't block
- sem_unlink()
- Destroy a named semaphore
- sem_wait()
- Wait on a semaphore
- sync()
- Synchronize filesystem updates
These functions work with PCI and other devices for
operations such as determining whether or not a PCI BIOS is
present, attaching a driver to a PCI device, and so on.
The following functions are defined:
- pci_attach()
- Connect to the PCI server
- pci_attach_device()
- Attach a driver to a PCI device
- pci_detach()
- Disconnect from the PCI server
- pci_detach_device()
- Detach a driver from a PCI device
- pci_find_class()
- Find devices that have a specific Class Code
- pci_find_device()
- Find the PCI device with a given device ID and vendor ID
- pci_irq_routing_options()
- Retrieve PCI IRQ routing information
- pci_map_irq()
- Map an interrupt pin to an IRQ
- pci_present()
- Determine whether or not PCI BIOS is present
- pci_read_config()
- Read from the configuration space of a PCI device
- pci_read_config8()
- Read a byte from the configuration space of a device
- pci_read_config16()
- Read 16-bit values from the configuration space of a device
- pci_read_config32()
- Read 32-bit values from the configuration space of a device
- pci_rescan_bus()
- Rescan the PCI bus for added or removed devices
- pci_write_config()
- Write to the configuration space of a PCI device
- pci_write_config8()
- Write bytes to the configuration space of a PCI device
- pci_write_config16()
- Write 16-bit values to the configuration space of a device
- pci_write_config32()
- Write 32-bit values to the configuration space of a device
The following floating-point functions are defined:
- abs()
- Return the absolute value of an integer
- acos(), acosf()
- Compute the arccosine of an angle
- acosh(), acoshf()
- Compute the inverse hyperbolic cosine
- asin(), asinf()
- Compute the arcsine of an angle
- asinh(), asinhf()
- Compute the inverse hyperbolic sine
- atan(), atanf()
- Compute the arctangent of an angle
- atan2(), atan2f()
- Compute the arctangent, determining the quadrant
- atanh(), atanhf()
- Compute the inverse hyperbolic tangent
- cabs(), cabsf()
- Compute the absolute value of a complex number
- cbrt(), cbrtf()
- Compute the cube root of a number
- ceil(), ceilf()
- Round up a value to the next integer
- copysign(), copysignf()
- Copy sign bit
- cos(), cosf()
- Compute the cosine of an angle
- cosh(), coshf()
- Compute the hyperbolic cosine
- div()
- Calculate quotient and remainder of a division operation
- drand48()
- Generate a pseudo-random double integer
- drem(), dremf()
- Compute the remainder of two numbers
- erand48()
- Generate a pseudo-random double integer
- erf(), erff()
- Compute the error function of a number
- erfc(), erfcf()
- Complementary error function
- exp(), expf()
- Compute the exponential function of a number
- expm1(), expm1f()
- Compute the exponential of a number, then subtract 1
- fabs(), fabsf()
- Compute the absolute value of a double number
- finite(), finitef()
- Determine if a number is a finite number
- floor(), floorf()
- Round down a value to the next integer
- fmod(), fmodf()
- Compute a floating-point modulus
- fp_exception_mask()
- Return the current exception mask
- fp_exception_value()
- Get the value of the current exception registers
- fp_precision()
- Set or get the current precision
- fp_rounding()
- Set or get the current rounding
- frexp(), frexpf()
- Break a floating-point number into a normalized fraction and an
integral power of 2
- gamma(), gamma_r(), gammaf(), gammaf_r()
- log gamma function
- hypot(), hypotf()
- Calculate the length of the hypotenuse for a right-angled triangle
- ilogb(), ilogbf()
- Exponent extraction
- initstate()
- Initialize a pseudo-random number generator
- j0(), j0f()
- Compute a Bessel function of the first kind
- j1(), j1f()
- Compute a Bessel function of the first kind
- jn(), jnf()
- Compute a Bessel function of the first kind
- jrand48()
- Generate a pseudo-random signed long integer
- labs()
- Calculate the absolute value of a long integer
- lcong48()
- Initialize a sequence of pseudo-random numbers
- ldexp(), ldexpf()
- Multiply a floating-point number by an integral power of 2
- ldiv()
- Perform division on long integers
- lgamma(), lgamma_r(), lgammaf(), lgammaf_r()
- log gamma function
- log(), logf()
- Compute the natural logarithm of a number
- log1p(), log1pf()
- log(1+x)
- logb(), logbf()
- Compute the radix-independent exponent
- log10(), log10f()
- Compute the logarithm (base 10) of a number
- lrand48()
- Generate a pseudo-random long integer
- max()
- Return the greater of two numbers
- min()
- Return the lesser of two numbers
- modf(), modff()
- Break a number into integral and fractional parts
- mrand48()
- Generate a pseudo-random signed long integer
- nextafter(), nextafterf()
- Compute the next representable double-precision floating-point number
- nrand48()
- Generate a pseudo-random long integer
- pow(), powf()
- Raise a number to a given power
- rand()
- Compute a sequence of pseudo-random integers
- random()
- Generate a pseudo-random number from the default state
- rand_r()
- Compute a sequence of pseudo-random integers
- remainder(), remainderf()
- Compute the floating point remainder
- rint(), rintf()
- Round to the nearest integral value
- scalb(), scalbf()
- load exponent of a radix-independent floating-point number
- scalbn(), scalbnf()
- Compute the exponent of a radix-independent floating-point number
- seed48()
- Initialize a sequence of pseudo-random numbers
- setstate()
- Reset the state of a pseudo-random number generator
- significand(), significandf()
- Computes sig
- sin(), sinf()
- Calculate the sine of an angle
- sinh(), sinhf()
- Compute the hyperbolic sine
- sqrt(), sqrtf()
- Calculate the nonnegative square root of a number
- srand()
- Start a new sequence of pseudo-random integers
- srand48()
- Initialize a sequence of pseudo-random numbers
- srandom()
- Set the seed for a pseudo-random number generator
- tan(), tanf()
- Calculate the tangent of an angle
- tanh(), tanhf()
- Calculate the hyperbolic tangent
- y0(), y0f()
- Compute a Bessel function of the second kind
- y1(), y1f()
- Compute a Bessel function of the second kind
- yn(), ynf()
- Compute a Bessel function of the second kind
These functions allocate and deallocate blocks of memory.
- alloca()
- Allocate automatic space from the stack
- calloc()
- Allocate space for an array
- cfree()
- Free allocated memory
- free()
- Deallocate a block of memory
- ftw()
- Walk a file tree
- longjmp()
- Restore the environment saved by setjmp()
- malloc()
- Allocate memory
- realloc()
- Allocate, reallocate or free a block of memory
- sbrk()
- Set the allocation break value for a program
- _scalloc()
- Allocate space for an array
- setjmp()
- Save the calling environment, for use by longjmp()
- siglongjmp()
- Restore the signal mask for a process, if one was saved
- sigsetjmp()
- Save the environment, including the signal mask
- _sfree()
- Deallocate a block of memory
- _smalloc()
- Allocate memory
- _srealloc()
- Allocate, reallocate or free a block of memory
These functions manipulate blocks of memory.
In each case, the address of the memory block and its size is passed
to the function.(Some of these functions have wide-character versions in the
"Wide-character functions"
section of the function summary.)
- brk()
- Change the amount of space allocated for the calling process's data segment
- bzero()
- Set the first part of an object to null bytes
- ffs()
- Find the first bit set in a bit string
- index()
- Find a character in a string
- memccpy()
- Copy bytes until a given character is found
- memchr()
- Locate the first occurrence of a character in a buffer
- memcmp()
- Compare a given number of characters in two objects
- memcpy()
- Copy a number of characters from one buffer to another
- memcpyv()
- Copy a given number of structures
- memicmp()
- Compare a given number of characters of two objects, without case
sensitivity
- mem_offset(), mem_offset64()
- Find offset of a mapped typed memory block
- memmove()
- Copy a number of characters from one buffer to another
- memset()
- Set the first part of an object to a given value
- mlock()
- Lock a buffer in physical memory
- mlockall()
- Lock a process's address space
- mmap(), mmap64()
- Map a memory region into a process address space
- mmap_device_io()
- Gain access to a device's registers
- mmap_device_memory()
- Map a device's physical memory into a process's address space
- msync()
- Synchronize memory with physical storage
- munlock()
- Unlock a buffer
- munlockall()
- Unlock a process's address space
- munmap_device_io()
- Free access to a device's registers
- munmap_device_memory()
- Unmap previously mapped addresses
- posix_mem_offset(), posix_mem_offset64()
- Find offset and length of a mapped typed memory block
- rindex()
- Find a character in a string
- shm_ctl()
- Give special attributes to a shared memory object
- swab()
- Swap bytes
See the section
"String manipulation functions"
for descriptions of functions that manipulate strings of data.
These functions deal with message queues:
- mq_close()
- Close a message queue
- mq_getattr()
- Get a message queues attributes
- mq_notify()
- Ask to be notified when there's a message in the queue
- mq_open()
- Open a message queue
- mq_receive()
- Receive a message from a queue
- mq_send()
- Send a message to a queue
- mq_setattr()
- Set a queue's attributes
- mq_timedreceive()
- Receive a message from a message queue
- mq_timedsend()
- Send a message to a message queue
- mq_unlink()
- Remove a queue
These ANSI C functions provide capabilities for processing multibyte characters.
(Some of these functions have wide-character versions in the
"Wide-character functions"
section of the function summary.)
- mblen()
- Determine the number of bytes comprising a multibyte
character
- mbrlen()
- Get the number of bytes in a character
- mbrtowc()
- Convert a character to a wide-character code
- mbsinit()
- Determine conversion object status
- mbsrtowcs()
- Convert a character string to a wide-character string
- mbstowcs()
- Convert multibyte characters to wide characters
- mbtowc()
- Convert a multibyte character to a wide character
- wcstombs()
- Convert wide characters to multibyte characters
- wctomb()
- Convert a wide character to a multibyte character
The following functions are defined:
- ChannelCreate(), ChannelCreate_r()
- Create a communications channel
- ChannelDestroy(), ChannelDestroy_r()
- Destroy a communications channel
- MsgDeliverEvent(), MsgDeliverEvent_r()
- Deliver an event through a channel
- MsgError(), MsgError_r()
- Unblock a client and set its errno
- MsgInfo(), MsgInfo_r()
- Get additional information about a message
- MsgKeyData(), MsgKeyData_r()
- Pass data through a common client
- MsgRead(), MsgRead_r()
- Read data from a message
- MsgReadv(), MsgReadv_r()
- Read data from a message
- MsgReceive(), MsgReceive_r()
- Wait for a message or pulse on a channel
- MsgReceivePulse(), MsgReceivePulse_r()
- Receive a pulse on a channel
- MsgReceivePulsev(), MsgReceivePulsev_r()
- Receive a pulse on a channel
- MsgReceivev(), MsgReceivev_r()
- Wait for a message or pulse on a channel
- MsgReply(), MsgReply_r()
- Reply with a message
- MsgReplyv(), MsgReplyv_r()
- Reply with a message
- MsgSend(), MsgSend_r()
- Send a message to a channel
- MsgSendnc(), MsgSendnc_r()
- Send a message to a channel
- MsgSendPulse(), MsgSendPulse_r()
- Send a pulse to a channel
- MsgSendsv(), MsgSendsv_r()
- Send a message to a channel
- MsgSendsvnc(), MsgSendsvnc_r()
- Send a message to a channel
- MsgSendv(), MsgSendv_r()
- Send a message to a channel
- MsgSendvnc(), MsgSendvnc_r()
- Send a message to a channel
- MsgSendvs(), MsgSendvs_r()
- Send a message to a channel
- MsgSendvsnc(), MsgSendvsnc_r()
- Send a message to a channel
- MsgVerifyEvent(), MsgVerifyEvent_r()
- Check the validity of a receive ID and an event configuration
- MsgWrite(), MsgWrite_r()
- Write a reply
- MsgWritev(), MsgWritev_r()
- Write a reply
- name_close()
- Close the filedes obtained with name_open()
- name_open()
- Open a name for a server connection
- sigevent
- Structure that describes an event
- SyncTypeCreate(), SyncTypeCreate_r()
- Create a synchronization object
These functions operate at the operating-system level, and
are included for compatibility with other C implementations.
For new programs, we recommended that you use the functions in the section
"File manipulation functions",
functions are defined portably and are part of the ANSI standard for the C language.
The functions in this section reference opened files and devices using a
file descriptor that's returned when the file is opened.
The file descriptor is passed to the other functions.
The following functions are defined:
- chsize()
- Change the size of a file
- cfgopen()
- Open a configuration file
- close()
- Close a file at the operating system level
- _cmdfd()
- Return a file descriptor for the executable file
- _cmdname()
- Find the path used to invoke the current process
- creat(), creat64()
- Create and open a file at the operating system level
- devctl()
- Control a device
- dup()
- Duplicate a file descriptor
- dup2()
- Duplicate a file descriptor
- eof()
- Determine if the end-of-file has been reached
- fcfgopen()
- Open a configuration file
- fcntl()
- Provide control over an open file
- fdatasync()
- Write queued file data to disk
- fileno()
- Return the number of the file descriptor for a stream
- flink()
- Assign a pathname to a file descriptor
- flockfile()
- Acquire ownership of a file
- fstat(), fstat64()
- Obtain information about an open file
- fstatvfs(), fstatvfs64()
- Get filesystem information
- fsync()
- Write queued file and filesystem data to disk
- ftrylockfile()
- Acquire ownership of a FILE object
- funlockfile()
- Release ownership of a file
- GETIOVBASE()
- Get the base member of an iov_t structure
- GETIOVLEN()
- Get the length member of an iov_t structure
- getdtablesize()
- Get the size of the file descriptor table
- getrusage()
- Get information about resource utilization
- in8()
- Read an 8-bit value from a port
- in8s()
- Read 8-bit values from a port
- in16(), inbe16(), inle16()
- Read a 16-bit value from a port
- in16s()
- Read 16-bit values from a port
- in32(), inbe32(), inle32()
- Read a 32-bit value from a port
- in32s()
- Read 32-bit values from a port
- ioctl()
- Control device
- link()
- Create a link to an existing file
- lseek(), lseek64()
- Set the current file position at the OS level
- lio_listio()
- Initiate a list of I/O requests
- mknod()
- Make a new filesystem entry point
- modem_open()
- Open a serial port
- modem_read()
- Read bytes from a file descriptor
- modem_script()
- Run a script on a device
- modem_write()
- Write a string to a device
- name_close()
- Close the filedes obtained with name_open()
- name_open()
- Open a name for a server connection
- open(), open64()
- Open a file
- openfd()
- Reserve a file descriptor
- out8()
- Write an 8-bit value to a port
- out8s()
- Write 8-bit values to a port
- out16(), outbe16(), outle16()
- Write a 16-bit value to a port
- out16s()
- Write 16-bit values to a port
- out32(), outbe32(), outle32()
- Write a 32-bit value to a port
- out32s()
- Write 32-bit values to a port
- pathmgr_symlink()
- Create a symlink in the process manager
- pathmgr_unlink()
- Remove the link created by pathmgr_symlink()
- pipe()
- Create a pipe
- popen()
- Execute a command, creating a pipe to it
- pread(), pread64()
- Read from a file without moving the file pointer
- rdchk()
- Check to see if a read is likely to succeed
- read()
- Read bytes from a file
- readblock()
- Read blocks of data from a file
- readcond()
- Read data from a terminal device
- readlink()
- Place the contents of a symbolic link into a buffer
- readv()
- Read bytes from a file
- select()
- Check for files that are ready for reading or writing
- SETIOV()
- Fill in the fields of an iov_t structure
- sopen()
- Open a file for shared access
- sopenfd()
- Open for shared access a file associated with a given descriptor
- symlink()
- Create a symbolic link to a path
- tcischars()
- Determine the number of characters waiting to be read
- tell(), tell64()
- Determine the current file position
- umask()
- Set the file mode creation mask for the process
- uname()
- Get information about the operating system
- unlink()
- Delete a file
- write()
- Write bytes to a file
- writeblock()
- Write blocks of data to a file
- writev()
- Write bytes to a file
The following functions are defined:
- pccard_arm()
- Arm the devp-pccard server
- pccard_attach()
- Attach to the devp-pccard server
- pccard_detach()
- Detach from the devp-pccard server
- pccard_info()
- Obtain socket information from the devp-pccard server
- pccard_lock()
- Lock the window of the card in the selected socket
- pccard_raw_read()
- Read the raw CIS data from the PC Card
- pccard_unlock()
- Unlock the window of the card in the selected socket
These functions are for invoking Intel 80x86 and other
processor-related functions directly from a program.
Functions that apply to the Intel 8086 CPU apply to that
family including the 80286, 80386, 80486 and Pentium processors.
You'll also find endian-related functions listed here.
The following functions are defined:
- ENDIAN_BE16()
- Return a big-endian 16-bit value in native format
- ENDIAN_BE32()
- Return a big-endian 32-bit value in native format
- ENDIAN_BE64()
- Return a big-endian 64-bit value in native format
- ENDIAN_LE16()
- Return a little-endian 16-bit value in native format
- ENDIAN_LE32()
- Return a little-endian 32-bit value in native format
- ENDIAN_LE64()
- Return a little-endian 64-bit value in native format
- ENDIAN_RET16()
- Return an endian-swapped 16-bit value
- ENDIAN_RET32()
- Return an endian-swapped 32-bit value
- ENDIAN_RET64()
- Return an endian-swapped 64-bit value
- ENDIAN_SWAP16()
- Endian-swap a 16-bit value in place
- ENDIAN_SWAP32()
- Endian-swap a 32-bit value in place
- ENDIAN_SWAP64()
- Endian-swap a 64-bit value in place
- _intr_v86()
- Execute a real-mode software interrupt
- offsetof()
- Return the offset of an element in a structure
- sysmgr_reboot()
- Reboot a QNX 6 system
These functions deal with process identification, user identification,
process groups, system identification, system time and process time,
environment variables, terminal identification, and configurable
system variables.
The following functions are defined:
- clearenv()
- Clear the process environment area
- confstr()
- Get configuration-defined string values
- ctermid()
- Generate the pathname of the current controlling terminal
- endutent()
- Close the current user-information file
- environ
- Pointer to the process's environment variables
- err(), errx()
- Formatted error message
- errno
- Global errno variable
- getegid()
- Get the effective group ID
- getenv()
- Get the value of an environment variable
- geteuid()
- Get the effective user ID
- getgid()
- Get the group ID
- getgrouplist()
- Determine the group access list for a user
- getgroups()
- Get the supplementary group IDs of the calling process
- getlogin()
- Get the user name associated with the calling process
- getlogin_r()
- Get the user name associated with the calling process
- getopt()
- Parse options from a command line
- getpgid()
- Get a process's group ID
- getpgrp()
- Get the process group
- getpid()
- Get the process ID
- getppid()
- Get the parent process ID
- getsid()
- Get the session ID of a process
- getuid()
- Get the user ID
- getutent()
- Read the next entry from the user-information file
- getutid()
- Search for an entry in the user-information file
- getutline()
- Get an entry from the user-information file
- initgroups()
- Initialize the supplementary group access list
- isatty()
- Test to see if a file descriptor is associated with a terminal
- login_tty()
- Prepare for a login in a tty
- main()
- The function where program execution begins
- ND_NODE_CMP()
- Compare two node descriptor IDs
- netmgr_ndtostr()
- Convert a node descriptor to a string
- netmgr_remote_nd()
- Get the node descriptor of the client
- netmgr_strtond()
- Convert a string to a node descriptor
- putenv()
- Add, change, or delete an environment variable
- pututline()
- Write an entry in the user-information file
- searchenv()
- Search the directories listed in an environment variable
- setegid()
- Set the effective group ID for a process
- setenv()
- Set one or more environment variables
- seteuid()
- Set the effective user ID
- setgid()
- Set the real, effective and saved group IDs
- setgroups()
- Set supplementary group IDs
- setlocale()
- Set a program's locale.
- setpgid()
- Join or create a process group
- setpgrp()
- Set the process group
- setregid()
- Set real and effective group IDs
- setreuid()
- Set real and effect user IDs
- setsid()
- Create a new session
- setuid()
- Set the real, effective and saved user IDs
- setutent()
- Return to the beginning of the user-information file
- strerror()
- Map an error number to an error message
- sysconf()
- Return the value of a configurable system limit
- ttyname()
- Get a fully qualified pathname for a file
- ttyname_r()
- Get a fully qualified pathname for a file
- unsetenv()
- Remove an environment variable
- utmpname()
- Change the name of the user-information file
- verr(), verrx()
- Formatted error message
- vwarn(), vwarnx()
- Formatted error message
- warn(), warnx()
- Formatted error message
These functions deal with process creation, execution, and termination;
signal handling; and timer operations.
When a new process is started, it replaces the existing process in the
following cases:
- P_OVERLAY is specified with the spawn*() functions
- the exec*() routines are invoked
The existing process may be suspended while the new process
executes (control continues at the point following the place where the
new process was started) in the following situations:
- P_WAIT is specified with the spawn*() functions
- system() is used
The following functions are defined:
- abort()
- Raise the SIGABRT signal to terminate program execution
- alarm()
- Schedule an alarm
- assert()
- Print a diagnostic message and optionally terminate the
program
- atexit()
- Register functions to be called when the program terminates
normally
- ConnectAttach(), ConnectAttach_r()
- Establish a connection between a process and a channel
- ConnectClientInfo(), ConnectClientInfo_r()
- Store information about a client connection
- ConnectDetach(), ConnectDetach_r()
- Break a connection between a process and a channel
- ConnectFlags(), ConnectFlags_r()
- Modify flags associated with fd
- ConnectServerInfo(), ConnectServerInfo_r()
- Store information about a connection
- daemon()
- Run a program in the background
- DebugBreak()
- Enter the process debugger
- DebugKDBreak()
- Enter the kernel debugger
- DebugKDOutput()
- Print text with the kernel debugger
- delay()
- Suspend a process for a given length of time
- dladdr()
- Translate an address to symbolic information
- dlclose()
- Close a shared object
- dlerror()
- Get dynamic loading diagnostic information
- dlopen()
- Gain access to an executable object file
- dlsym()
- Get the address of a symbol in a shared object
- execl()
- Execute a file
- execle()
- Execute a file
- execlp()
- Execute a file
- execlpe()
- Execute a file
- execv()
- Execute a file
- execve()
- Execute a file
- execvp()
- Execute a file
- execvpe()
- Execute a file
- _exit()
- Terminate the program
- exit()
- Terminate the program
- fork()
- Create a new process
- forkpty()
- Create a new process operating in a pseudo-tty
- getrlimit(), getrlimit64()
- Get the limit on a system resource
- getprio()
- Get the priority of a given process
- getpriority()
- Get the program scheduling priority
- InterruptAttach(), InterruptAttach_r()
- Attach an interrupt handler to an interrupt source
- InterruptAttachEvent(), InterruptAttachEvent_r()
- Attach an event to an interrupt source
- InterruptDetach(), InterruptDetach_r()
- Detach an interrupt handler by ID
- InterruptDisable()
- Disable hardware interrupts
- InterruptEnable()
- Enable hardware interrupts
- InterruptHookIdle()
- Attach an "idle" interrupt handler
- InterruptHookTrace()
- Attach the pseudo interrupt handler that's used by the instrumented module
- InterruptLock()
- Protect critical sections of an interrupt handler
- InterruptMask()
- Disable a hardware interrupt
- InterruptUnlock()
- Release a critical section locked with InterruptLock()
- InterruptUnmask()
- Enable a hardware interrupt
- InterruptWait(), InterruptWait_r()
- Wait for a hardware interrupt
- _intr_v86()
- Execute a real-mode software interrupt
- kill()
- Send a signal to a process or a group of processes
- killpg()
- Send a signal to a process group
- nap()
- Sleep for ms milliseconds
- napms()
- Sleep for ms milliseconds
- nice()
- Change the priority of a process
- openpty()
- Find an available pseudo-tty
- pause()
- Suspend the process until delivery of a signal
- procmgr_daemon()
- Run a process in the background
- procmgr_event_notify()
- Notify us of system-wide events
- procmgr_event_trigger()
- Trigger a global system event
- procmgr_guardian()
- Let a daemon process takeover as parent = guardian
- raise()
- Signal an exceptional condition
- SchedGet(), SchedGet_r()
- Get the scheduling policy for a thread
- SchedInfo(), SchedInfo_r()
- Get scheduler information
- SchedSet(), SchedSet_r()
- Set the scheduling policy for a thread
- SchedYield(), SchedYield_r()
- Yield to other threads
- setitimer()
- Set the value of an interval timer
- setprio()
- Set the priority of a process
- setpriority()
- Set the program scheduling priority
- setrlimit(), setrlimit64()
- Set the limit on a system resource
- sigaction()
- Examine or specify the action associated with a signal
- sigaddset()
- Add a signal to a set
- sigblock()
- Block signals
- sigdelset()
- Delete a signal from a set
- sigemptyset()
- Initialize a set to contain no signals
- sigfillset()
- Initialize a set to contain all signals
- sigismember()
- See if a given signal is in a given set
- sigmask()
- Construct a mask for a signal number
- signal()
- Set handling for exceptional conditions
- SignalAction(), SignalAction_r()
- Examine and/or specify actions for signals
- SignalKill(), SignalKill_r()
- Send a signal to a process group, process or thread
- SignalProcmask(), SignalProcmask_r()
- Modify or examine the signal blocked mask of a thread
- SignalSuspend(), SignalSuspend_r()
- Suspend a process until a signal is received
- SignalWaitinfo(), SignalWaitinfo_r()
- Select a pending signal
- sigpause()
- Wait for a signal
- sigpending()
- Examine the set of pending, masked signals for a process
- sigprocmask()
- Examine or change the signal mask for a process
- sigqueue()
- Queue a signal to a process
- sigsetmask()
- Block signals
- sigsuspend()
- Replace the signal mask, and then suspend the process
- sigtimedwait()
- Wait for a signal or a timeout
- sigunblock()
- Unblock signals
- sigwait()
- Wait for a pending signal
- sigwaitinfo()
- Wait for a pending signal and get its information
- sleep()
- Suspend a process for a given length of time
- spawn()
- Create and execute a new child process
- spawnl()
- Create and execute a new child process
- spawnle()
- Create and execute a new child process
- spawnlp()
- Create and execute a new child process
- spawnlpe()
- Create and execute a new child process
- spawnp()
- Create and execute a new child process
- spawnv()
- Create and execute a new child process
- spawnve()
- Create and execute a new child process
- spawnvp()
- Create and execute a new child process
- spawnvpe()
- Create and execute a new child process
- SyncCondvarSignal(), SyncCondvarSignal_r()
- Wake threads block on a synchronization object
- SyncCondvarWait(), SyncCondvarWait_r()
- Block a thread on a synchronization object
- SyncCtl(), SyncCtl_r()
- Perform an operation on a synchronization object
- SyncDestroy(), SyncDestroy_r()
- Destroy a synchronization object
- SyncMutexEvent(), SyncMutexEvent_r()
- Attach an event to a mutex
- SyncMutexLock(), SyncMutexLock_r()
- Lock a mutex synchronization object
- SyncMutexUnlock(), SyncMutexUnlock_r()
- Unlock a mutex synchronization object
- SyncMutexRevive(), SyncMutexRevive_r()
- Revive a mutex
- SyncSemPost(), SyncSemPost_r()
- Increment a semaphore
- SyncSemWait(), SyncSemWait_r()
- Wait on a semaphore
- system()
- Execute a system command
- SYSPAGE_CPU_ENTRY()
- Return a CPU-specific entry from the system page
- SYSPAGE_ENTRY()
- Return an entry from the system page
- ThreadCancel(), ThreadCancel_r()
- Cancel a thread
- ThreadCreate(), ThreadCreate_r()
- Create a new thread
- ThreadCtl(), ThreadCtl_r()
- Control a thread
- ThreadDestroy(), ThreadDestroy_r()
- Destroy a thread immediately
- ThreadDetach(), ThreadDetach_r()
- Detach a thread from a process
- ThreadJoin(), ThreadJoin_r()
- Block until a thread terminates
- TraceEvent()
- Trace kernel events
- ualarm()
- Schedule an alarm
- usleep()
- Suspend a thread for a given time
- vfork()
- Spawn a new process and block the parent
- wait()
- Suspend execution of the calling process
- wait3()
- Wait for a child process to change state
- wait4()
- Wait for a child process to terminate or stop
- waitid()
- Wait for a child process to change state
- waitpid()
- Suspend the calling process
There are eight spawn...*() and exec...*()
functions each. The "..." is one to three letters, where:
- l or v (one is required) -- indicates the way the process parameters are passed
- p (optional) -- indicates that the PATH environment variable is searched to locate the program for the process
- e (optional) -- indicates that the environment variables are being passed
These functions provide realtime timer capabilities:
- clock_getres()
- Get the resolution of the clock
- clock_gettime()
- Get the current time of a clock
- clock_nanosleep()
- High resolution sleep with specifiable clock
- clock_settime()
- Set a clock
- getitimer()
- Get the value of an interval timer
- nanosleep()
- Suspend process until a timeout or signal occurs
- nanospin()
- Busy-wait without blocking for a period of time
- nanospin_calibrate()
- Calibrate before calling nanospin*()
- nanospin_count()
- Busy-wait without blocking for a number of iterations
- nanospin_ns()
- Busy-wait without blocking for a period of time
- nanospin_ns_to_count()
- Busy-wait without blocking for a number of iterations
- sched_getparam()
- Get the current priority of a process
- sched_get_priority_max()
- Get the maximum value for the scheduling policy
- sched_get_priority_min()
- Get the minimum value for the scheduling policy
- sched_getscheduler()
- Get the current scheduling policy for a process
- sched_rr_get_interval()
- Get the execution time limit of a process
- sched_setparam()
- Change the priority of a process
- sched_setscheduler()
- Change the priority and scheduling policy of a process
- sched_yield()
- Yield to other READY processes at the same priority
- timer_create()
- Create a timer
- timer_delete()
- Delete a timer
- timer_getexpstatus()
- Get the expiry status of a timer
- timer_getoverrun()
- Return the number of timer overruns
- timer_gettime()
- Get the amount of time left on a timer
- timer_settime()
- Set the expiration time for a timer
These functions help you create resource managers.
- iofdinfo()
- Retrieve server attributes
- iofunc_attr_init()
- Initialize the default attribute structure
- iofunc_attr_lock()
- Lock the attribute structure
- iofunc_attr_trylock()
- Try to lock the attribute structure
- iofunc_attr_unlock()
- Unlock the attribute structure
- iofunc_check_access()
- Check access permissions
- iofunc_chmod()
- Handle an _IO_CHMOD message
- iofunc_chmod_default()
- Default handler for _IO_CHMOD messages
- iofunc_chown()
- Handle an _IO_CHOWN message
- iofunc_chown_default()
- Default handler for _IO_CHOWN messages
- iofunc_client_info()
- Return information about a client connection
- iofunc_close_dup()
- Frees all locks allocated for the client process
- iofunc_close_dup_default()
- Default handler for _IO_CLOSE messages
- iofunc_close_ocb()
- Return the memory allocated for an OCB
- iofunc_close_ocb_default()
- Return the memory allocated for an OCB
- iofunc_devctl()
- Handle an _IO_DEVCTL message
- iofunc_devctl_default()
- Default handler for _IO_DEVCTL messages
- iofunc_fdinfo()
- Handle an _IO_FDINFO message
- iofunc_fdinfo_default()
- Default handler for _IO_FDINFO messages
- iofunc_func_init()
- Initialize default POSIX-layer tables
- iofunc_link()
- Link two directories
- iofunc_lock()
- Lock a resource
- iofunc_lock_calloc()
- Allocate memory to lock structures
- iofunc_lock_default()
- Default handler for _IO_LOCK messages
- iofunc_lock_free()
- Return memory allocated for lock structures
- iofunc_lock_ocb_default()
- Default handler for the lock_ocb callout
- iofunc_lseek()
- Handle an _IO_LSEEK message
- iofunc_lseek_default()
- Default handler for _IO_LSEEK message
- iofunc_mknod()
- Verify a client's ability to make a new filesystem entry point
- iofunc_mmap()
- Handle an IO_MMAP message
- iofunc_mmap_default()
- Default handler for IO_MMAP messages
- iofunc_notify()
- Install, poll, or remove a notification handler
- iofunc_notify_remove()
- Remove notification entries from list
- iofunc_notify_trigger()
- Send notifications to queued clients
- iofunc_ocb_attach()
- Initialize an Open Control Block
- iofunc_ocb_calloc()
- Allocate an iofunc OCB
- iofunc_ocb_detach()
- Release OCB resources
- iofunc_ocb_free()
- Deallocate an iofunc OCBs memory
- iofunc_open()
- Verify a client's ability to open a resource
- iofunc_open_default()
- Default handler for _IO_CONNECT messages
- iofunc_openfd()
- Increment count and locking flags
- iofunc_openfd_default()
- Default handler for _IO_OPENFD messages
- iofunc_pathconf()
- Support pathconf() requests
- iofunc_pathconf_default()
- Default handler for _IO_PATHCONF messages
- iofunc_read_default()
- Default handler for _IO_READ messages
- iofunc_readlink()
- Verify a client's ability to read a symbolic link
- iofunc_read_verify()
- Verify a client's read access to a resource
- iofunc_rename()
- Do permission checks for the _IO_CONNECT message
- iofunc_space_verify()
- Do permission checks for _IO_SPACE message
- iofunc_stat()
- Populate a stat structure
- iofunc_stat_default()
- Default handler for _IO_STAT messages
- iofunc_sync()
- Indicate if synchronization is needed
- iofunc_sync_default()
- Default handler for _IO_SYNC messages
- iofunc_sync_verify()
- Verify permissions to sync
- iofunc_time_update()
- Update time stamps
- iofunc_unblock()
- Unblock OCBs
- iofunc_unblock_default()
- Default unblock handler
- iofunc_unlink()
- Verify that an entry can be unlinked
- iofunc_unlock_ocb_default()
- Default handler for the unlock_ocb callout
- iofunc_utime()
- Update time stamps
- iofunc_utime_default()
- Default handler for _IO_UTIME messages
- iofunc_write_default()
- Default handler for _IO_WRITE messages
- iofunc_write_verify()
- Verify a client's write access to a resource
- ionotify()
- Arm a resource manager
- mount()
- Mount a filesystem
- mount_parse_generic_args()
- Strip off common mount arguments
- resmgr_devino()
- Get the device and inode number
- resmgr_open_bind()
- Associate an OCB with a process
- rsrcdbmgr_attach()
- Reserve a system resource for a process
- rsrcdbmgr_create()
- Create a system resource
- rsrcdbmgr_destroy()
- Destroy a system resource
- rsrcdbmgr_detach()
- Return a system resource to the resource database
- rsrcdbmgr_devno_attach()
- Get a major and minor number
- rsrcdbmgr_devno_detach()
- Detach a major and minor number
- rsrcdbmgr_query()
- Query the resource database
- umount()
- Unmount a filesystem
These functions provide searching and sorting capabilities (Some of these functions have wide-character versions in the "Wide-character functions" section of the function summary.):
- alphasort()
- Sort directory entries
- bsearch()
- Perform a binary search on a sorted array
- ffs()
- Find the first bit set in a bit string
- hcreate()
- Create a hash search table
- hdestroy()
- Destroy the hash search table
- hsearch()
- Search the hash search table
- index()
- Find a character in a string
- lfind()
- Find entry in a linear search table
- lsearch()
- Linear search and update
- pathfind(), pathfind_r()
- Search for a file in a list of directories
- qsort()
- Sort an array, using a modified Quicksort algorithm
- re_comp()
- Compile a regular expression
- re_exec()
- Execute a regular expression
- regcomp()
- Compile a regular expression
- regerror()
- Explain a regular expression error code
- regexec()
- Compare a string with a compiled regular expression
- regfree()
- Release memory allocated for a regular expression
- rindex()
- Find a character in a string
- strcspn()
- Get the number of string characters not from a given set of
characters
- strstr()
- Find one string inside another
These functions provide memory mapping capabilities:
- mmap(), mmap64()
- Map a memory region into a process address space
- mprotect()
- Change memory protection
- munmap()
- Unmap previously mapped addresses
- shm_ctl()
- Give special attributes to a shared memory object
- shm_open()
- Open a shared memory object
- shm_unlink()
- Remove a shared memory object
These functions deal with handling and sending signals.
- DebugBreak()
- Enter the process debugger
- DebugKDBreak()
- Enter the kernel debugger
- DebugKDOutput()
- Print text with the kernel debugger
- kill()
- Send a signal to a process or a group of processes
- killpg()
- Send a signal to a process group
- pause()
- Suspend the process until delivery of a signal
- raise()
- Signal an exceptional condition
- sigaction()
- Examine or specify the action associated with a signal
- sigaddset()
- Add a signal to a set
- sigdelset()
- Delete a signal from a set
- sigemptyset()
- Initialize a set to contain no signals
- sigfillset()
- Initialize a set to contain all signals
- sigismember()
- See if a given signal is in a given set
- signal()
- Set handling for exceptional conditions
- SignalAction(), SignalAction_r()
- Examine and/or specify actions for signals
- SignalKill(), SignalKill_r()
- Send a signal to a process group, process, or thread
- SignalProcmask(), SignalProcmask_r()
- Modify or examine the signal blocked mask of a thread
- SignalSuspend(), SignalSuspend_r()
- Suspend a process until a signal is received
- SignalWaitinfo(), SignalWaitinfo_r()
- Select a pending signal
- sigpending()
- Examine the set of pending, masked signals for a process
- sigprocmask()
- Examine or change the signal mask for a process
- sigqueue()
- Queue a signal to a process
- sigsuspend()
- Replace the signal mask, and then suspend the process
- sigtimedwait()
- Wait for a signal or a timeout
- sigwait()
- Wait for a pending signal
- sigwaitinfo()
- Wait for a pending signal and get its information
- strsignal()
- Return the description of a signal
A stream is the name given to a file or device that has been opened
for data transmission. When a stream is opened, a pointer to a
FILE structure is returned. This pointer is used to reference
the stream when other functions are subsequently invoked.
When a program begins execution, a number of streams are
already open for use:
- stderr --
- Standard Error: output to the console (used for error messages)
- stdin --
- Standard Input: input from the console
- stdout --
- Standard Output: output to the console
These standard streams may be redirected by using the
freopen() function.
See also the section
"File manipulation functions"
for other functions that operate on files.
The functions in the section
"Operating system I/O functions"
may also be invoked (use the
fileno() function to
get the file descriptor). Since the stream functions may
buffer input and output, use these functions with caution to
avoid unexpected results.
(Some of these functions have wide-character versions in the
"Wide-character functions"
section of the function summary.)
- clearerr()
- Clear the end-of-file and error indicators for a stream
- fclose()
- Close a stream
- fcloseall()
- Close all open stream files, except stdin,
stdout and stderr
- fdopen()
- Associate a stream with a file descriptor
- feof()
- Test the end-of-file indicator
- ferror()
- Test the error indicator for a stream
- fflush()
- Flush the input or output buffer for a stream
- fgetc()
- Get the next character from a file stream
- fgetchar()
- Get a character from stdin
- fgetpos()
- Store the current position of a stream
- fgets()
- Get a string of characters from a stream
- flushall()
- Clear all input buffers and write all output buffers
- fopen()
- Open a stream
- fprintf()
- Write output to a stream
- fputc()
- Write a character to an output stream
- fputchar()
- Write a character to stdout
- fputs()
- Write a character string to an output stream
- fread()
- Read elements of a given size from a stream
- freopen()
- Reopen a stream
- fscanf()
- Scan input from a stream
- fseek(), fseeko()
- Change the read/write position of a stream
- fsetpos()
- Set the current stream position
- ftell(), ftello()
- Return the current read/write position of a stream
- fwrite()
- Write a number of elements into a stream
- getc()
- Get the next character from a stream
- getchar()
- Get a character from stdin
- getchar_unlocked()
- Get a character from stdin
- getc_unlocked()
- Get the next character from a stream
- gets()
- Get a string of characters from a stream
- getw()
- Get a word from a stream
- perror()
- Print, in stderr, the message associated with the value of
errno
- printf()
- Write formatted output on stdout
- putc()
- Write a character to an output stream
- putchar()
- Write a character to stdout
- putchar_unlocked()
- Write a character to stdout
- putc_unlocked()
- Write a character to an output stream
- puts()
- Write a string to stdout
- putw()
- Put a word on a stream
- rewind()
- Set the file position indicator to the beginning of the stream
- scanf()
- Scan formatted input from a stream
- setbuf()
- Associate a buffer with a stream
- setbuffer()
- Assign block buffering to a stream
- setlinebuf()
- Assign line buffering to a stream
- setvbuf()
- Associate a buffer with a stream
- snprintf()
- Write formatted output to a character array, up to a given max number of characters
- tmpfile()
- Create a temporary binary file
- ungetc()
- Push a character back onto an input stream
- vfprintf()
- Write formatted output to a file stream
- vfscanf()
- Scan input from a file stream
- vprintf()
- Write formatted output to a file stream
- vscanf()
- Scan input from a file
See the section "Directory
functions" for functions that are related to directories.
A string is an array of characters (with type char)
that is terminated with an extra null character (\0).
Functions are passed only the address of the string, since the size
can be determined by searching for the terminating character. (Some of these functions have wide-character versions in the "Wide-character functions" section of the function summary.)
- basename()
- Find the part of a string after the last "/"
- bcmp()
- Compare a given number of characters in two strings
- bcopy()
- Copy a number of characters in one string to another
- fnmatch()
- Check to see if a string matches a pattern
- getsubopt()
- Parse suboptions from a string
- index()
- Find a character in a string
- input_line()
- Get a string of characters from a file
- localeconv()
- Set numeric formatting according to the current locale
- re_comp()
- Compile a regular expression
- re_exec()
- Execute a regular expression
- regcomp()
- Compile a regular expression
- regerror()
- Explain a regular expression error code
- regexec()
- Compare a string with a compiled regular expression
- regfree()
- Release memory allocated for a regular expression
- rindex()
- Find a character in a string
- sprintf()
- Print formatted output into a string
- sscanf()
- Scan input from a character string
- straddstr()
- Concatenate one string on to the end of another
- strcasecmp()
- Case-insensitive string comparison
- strcat()
- Concatenate two strings
- strchr()
- Locate the first occurrence of a given character in a string
- strcmp()
- Compare two strings
- strcmpi()
- Compare two strings, ignoring case
- strcoll()
- Compare two strings, using the locale's collating sequence
- strcpy()
- Copy a string
- strcspn()
- Get the number of string characters not from a given set of
characters
- strdup()
- Create a duplicate of a string
- strerror()
- Map an error number to an error message
- stricmp()
- Compare two strings, ignoring case
- strlen()
- Compute the length of a string
- strlwr()
- Convert a string to lowercase
- strncasecmp()
- Case-insensitive string comparison, up to a given length
- strncat()
- Concatenate two strings, up to a maximum length
- strncmp()
- Compare two strings, up to a given length
- strncpy()
- Copy a string, to a maximum length
- strnicmp()
- Compare to strings up to a given length, ignoring case
- strnset()
- Fill a string with a given character, to a given length
- strpbrk()
- Locate an occurrence of one string in another
- strrchr()
- Find the last occurrence of a character in a string
- strrev()
- Reverse a string
- strsep()
- Separate strings
- strset()
- Fill a string with a given character
- strspn()
- Find one string inside another
- strstr()
- Find one string inside another
- strtok()
- Break a string into tokens
- strtok_r()
- Break a string into tokens
- strupr()
- Convert a string to uppercase
- strxfrm()
- Transform one string into another, to a given length
- vsprintf()
- Write formatted output to a buffer
- vsnprintf()
- Write formatted output to a character array, up to a given max number of characters
- vsscanf()
- Scan input from a string
For related functions see these sections:
The following functions are defined:
- crypt()
- Encrypt a password
- encrypt()
- Encrypt a string
- endgrent()
- Close the group database file
- endpwent()
- Close the password database file
- endspent()
- Close the shadow password database file
- fgetspent()
- Get an entry from the password database
- getgrent()
- Return an entry from the group database
- getgrgid()
- Get information about the group with a given ID
- getgrgid_r()
- Get information about the group with a given ID
- getgrnam()
- Get information about the group with a given name
- getgrnam_r()
- Get information about the group with a given name
- getpass()
- Prompt for and read a password
- getpwent()
- Get an entry from the password database
- getpwnam()
- Get information about the user with a given name
- getpwnam_r()
- Get information about the user with a given name
- getpwuid()
- Get information about the user with a given ID
- getpwuid_r()
- Get information about the user with a given ID
- getspent(), getspent_r()
- Get an entry from the shadow password database
- getspnam(), getspnam_r()
- Get information about a user with a given name
- putspent()
- Put an entry into the password database
- qnx_crypt()
- Encrypt a password (QNX 4)
- setkey()
- Set the key used in encryption
- setgrent()
- Rewind to the start of the group database file
- setpwent()
- Rewind the password database file
- setspent()
- Rewind the shadow password database file
The following functions are defined:
- closelog()
- Close the system log
- openlog()
- Open the system log
- setlogmask()
- Set the system log priority mask
- slogb()
- Send a message to the system logger
- slogf()
- Send a formatted message to the system logger
- slogi()
- Send a message to the system logger
- syslog()
- Write a message to the system log
- vslogf()
- Send a formatted message to the system logger
- vsyslog()
- Control system log
These functions, prototypes and structures deal with TCP/IP network communications, database files,
and the data server.
- accept()
- Accept a connection on a socket
- bind()
- Bind a name to a socket
- bindresvport()
- Bind a socket to a privileged IP port
- connect()
- Initiate connection on a socket
- dn_comp()
- Compress an Internet domain name
- dn_expand()
- Expand a compressed Internet domain name
- ds_clear()
- Delete a data server variable
- ds_create()
- Create a data server variable
- ds_deregister()
- Deregister an application with the data server
- ds_flags()
- Set the flags for a data server variable
- ds_get()
- Retrieve a data server variable
- ds_register()
- Register an application with the data server
- ds_set()
- Set a data server variable
- endhostent()
- Close the TCP connection and the hosts file
- endnetent()
- Close the network database
- endprotoent()
- Close protocol name database file
- endservent()
- Close network services database file
- gethostbyaddr()
- Get a network host entry, given an Internet address
- gethostbyaddr_r()
- Get a network host entry
- gethostbyname()
- Get a network host entry, given a name
- gethostbyname_r()
- Get a network host entry by name
- gethostent()
- Get the next entry from the host database
- gethostent_r()
- Get the next entry from the host database
- gethostname()
- Get name of current host
- getnetbyaddr()
- Get network entry
- getnetbyname()
- Get network entry
- getnetent()
- Get an entry from the network database
- getpeername()
- Get name of connected peer
- getprotobyname()
- Get protocol entry
- getprotobynumber()
- Get protocol entry by number
- getprotoent()
- Read next line of protocol name database file
- getservbyname()
- Get service entry
- getservbyport()
- Get service entry for a port
- getservent()
- Read the next line of network services database file
- getsockname()
- Get socket name
- getsockopt()
- Get options on socket name
- h_errno
- Host error variable
- herror()
- Print the message associated with the value of
h_errno to standard error
- hostent
- Structure that describes an Internet host
- hstrerror()
- Get error message string associated with the error return status
- htonl()
- Convert host-byte order value
- htons()
- Convert host-byte order value
- ICMP
- Internet Control Message Protocol
- inet_addr()
- Convert a string into an Internet address
- inet_aton()
- Convert a string into an Internet address
- inet_lnaof()
- Convert an Internet address into a local network address
- inet_makeaddr()
- Convert a network number and a local network address into an
Internet address
- inet_netof()
- Convert Internet address into a network number
- inet_network()
- Convert a string into an Internet network number
- inet_ntoa()
- Convert an Internet address into a string
- inet_ntoa_r()
- Convert an Internet address into a string
- inet_ntop()
- Convert a numeric network address to a string
- inet_pton()
- Convert a text host address to a numeric network address
- IP
- Internet Protocol
- isfdtype()
- Determine whether a file descriptor refers to a socket
- listen()
- Listen for connections on a socket
- nbaconnect()
- Initiate connection on a socket
- nbaconnect_result()
- Get status of nbaconnect() call
- netent
- Structure for information from the network database
- ntohl()
- Convert network-byte order value
- ntohs()
- Convert network-byte order value
- protoent
- Structure for information from the protocol database
- Raccept()
- Accept a connection on a socket (via a SOCKS server)
- Rbind()
- Bind a name to a socket (via a SOCKS server)
- rcmd()
- Execute a command on a remote host
- Rconnect()
- Initiate a connection on a socket (via a SOCKS server)
- read_main_config_file()
- Read the snmpd.conf file
- recv()
- Receive a message from a socket
- recvfrom()
- Receive a message from a socket
- recvmsg()
- Receive a message from a socket
- res_init()
- Initialize the Internet domain name resolver routines
- res_mkquery()
- Construct an Internet domain name query
- res_query()
- Make an Internet domain name query
- res_querydomain()
- Query the local Internet domain name server
- res_search()
- Make an Internet domain name search
- res_send()
- Send a preformatted Internet domain name query
- Rgetsockname()
- Get the name of a socket (via a SOCKS server)
- Rlisten()
- Listen for connections on a socket (via a SOCKS server)
- ROUTE
- System packet forwarding database
- Rrcmd()
- Execute a command on a remote host (via a SOCKS server)
- rresvport()
- Obtain a socket with a privileged address
- Rselect()
- Check for descriptors that are ready for reading or writing (via a SOCKS server)
- ruserok()
- Check the identity of a remote host
- send()
- Send a message to a socket
- sendmsg()
- Send a message to a socket
- sendto()
- Send a message to a socket
- servent
- Structure for information from the services database
- sethostent()
- Set the local hosts entry
- sethostname()
- Set the name of the current host
- setnetent()
- Open the network database
- setprotoent()
- Open protocol name database file
- setservent()
- Open network services database file
- setsockopt()
- Set options on socket name
- shutdown()
- Shut down part of a full-duplex connection
- snmp_close()
- Close an SNMP session
- snmp_free_pdu()
- Free an SNMP message structure
- snmp_open()
- Open an SNMP session
- snmp_pdu
- Structure that describes an SNMP transaction
- snmp_pdu_create()
- Create an SNMP message structure
- snmp_read()
- Read an SNMP message
- snmp_select_info()
- Position to a block within an SNMP message structure
- snmp_send()
- Send SNMP messages
- snmp_session
- Structure that defines a set of transactions with similar transport characteristics
- snmp_timeout()
- Timeout during an SNMP session
- sockatmark()
- Determine whether a socket is at the out-of-band mark
- socket()
- Create an endpoint for communication
- socketpair()
- Create a pair of connected sockets
- SOCKSinit()
- Initialize a connection with a SOCKS server
- sysctl()
- Get or set the system information
- TCP
- Internet Transmission Control Protocol
- UDP
- Internet User Datagram Protocol
- UNIX
- UNIX-domain protocol family
The following functions are defined:
- cfgetispeed()
- Return the input baud rate that is stored in a termios
structure
- cfgetospeed()
- Return the output baud rate that is stored in a termios
structure
- cfmakeraw()
- Set terminal attributes
- cfsetispeed()
- Set the input baud rate in a termios structure
- cfsetospeed()
- Set the output baud rate in a termios structure
- tcdrain()
- Wait until all output has been transmitted to a device
- tcdropline()
- Disconnect a communications line
- tcflow()
- Perform a flow-control operation on a data stream
- tcflush()
- Flush the input and/or output stream
- tcgetattr()
- Get the current terminal control settings
- tcgetpgrp()
- Get the process group ID associated with a device
- tcgetsid()
- Get the process group ID of the session leader for a controlling terminal
- tcgetsize()
- Get the size of a character device
- tcinject()
- Inject characters into a devices input buffer
- tcischars()
- Determine the number of characters waiting to be read
- tcsendbreak()
- Assert a break condition over a communications line
- tcsetattr()
- Change the terminal control settings for a device
- tcsetpgrp()
- Set the process group ID for a device
- tcsetsize()
- Set the size of a character device
These functions deal with threads and the objects used to synchronize threads:
- pthread_abort()
- Unconditionally terminate the target thread
- pthread_atfork()
- Register fork handlers
- pthread_attr_destroy()
- Destroy the thread attribute object
- pthread_attr_getdetachstate()
- Get the thread detach state attribute
- pthread_attr_getguardsize()
- Get the thread guardsize attribute
- pthread_attr_getinheritsched()
- Get the thread inherit scheduling attribute
- pthread_attr_getschedparam()
- Get the thread scheduling parameters attribute
- pthread_attr_getschedpolicy()
- Get the thread scheduling policy attribute
- pthread_attr_getscope()
- Get the thread contention scope attribute
- pthread_attr_getstackaddr()
- Get the thread stack address attribute
- pthread_attr_getstacklazy()
- Get thread stack attribute
- pthread_attr_getstacksize()
- Get the thread stack size attribute
- pthread_attr_init()
- Initialize thread attribute object
- pthread_attr_setdetachstate()
- Set the thread detach state attribute
- pthread_attr_setguardsize()
- Set the thread guardsize attribute
- pthread_attr_setinheritsched()
- Set the thread inherit scheduling attribute
- pthread_attr_setschedparam()
- Set the thread scheduling parameters attribute
- pthread_attr_setschedpolicy()
- Set the thread scheduling policy attribute
- pthread_attr_setscope()
- Set the thread contention scope attribute
- pthread_attr_setstackaddr()
- Set the thread stack address attribute
- pthread_attr_setstacklazy()
- Set thread stack attribute
- pthread_attr_setstacksize()
- Set the thread stack size attribute
- pthread_barrierattr_destroy()
- Destroy barrier attributes object
- pthread_barrierattr_getpshared()
- Get process-shared attribute of barrier attributes object
- pthread_barrierattr_init()
- Initialize barrier attributes object
- pthread_barrierattr_setpshared()
- Set process-shared attribute of barrier attributes object
- pthread_barrier_destroy()
- Destroy a barrier object
- pthread_barrier_init()
- Initialize a barrier object
- pthread_barrier_wait()
- Synchronize at a barrier
- pthread_cancel()
- Cancel thread
- pthread_cleanup_pop()
- Pop the cancellation cleanup handler
- pthread_cleanup_push()
- Push the cancellation cleanup handler
- pthread_condattr_destroy()
- Destroy the condition variable attribute object
- pthread_condattr_getclock()
- Get the clock selection condition variable attribute
- pthread_condattr_getpshared()
- Get the process-shared attribute from a condition variable
attribute object
- pthread_condattr_init()
- Initialize the condition variable attribute object
- pthread_condattr_setclock()
- Set the clock selection condition variable attribute
- pthread_condattr_setpshared()
- Set the process-shared attribute in a condition variable
attribute object
- pthread_cond_broadcast()
- Unblock threads waiting on a condition
- pthread_cond_destroy()
- Destroy the condition variable
- pthread_cond_init()
- Initialize the condition variable
- pthread_cond_signal()
- Unblock the thread waiting on condition variable
- pthread_cond_timedwait()
- Timed wait on the condition variable
- pthread_cond_wait()
- Wait on the condition variable
- pthread_create()
- Create the thread
- pthread_detach()
- Detach the thread
- pthread_equal()
- Compare the thread IDs
- pthread_exit()
- Terminate the thread
- pthread_getconcurrency()
- Get the level of thread concurrency
- pthread_getcpuclockid()
- Return the clock ID of the CPU-time clock from a specified thread
- pthread_getschedparam()
- Get the thread scheduling parameters
- pthread_getspecific()
- Get the thread specific data value
- pthread_join()
- Join the thread
- pthread_key_create()
- Create the thread-specific data key
- pthread_key_delete()
- Delete the thread-specific data key
- pthread_kill()
- Send a signal to a thread
- pthread_mutexattr_destroy()
- Destroy the mutex attribute object
- pthread_mutexattr_getprioceiling()
- Get the priority ceiling of a mutex attribute object
- pthread_mutexattr_getprotocol()
- Get a mutexes scheduling protocol
- pthread_mutexattr_getpshared()
- Get the process-shared attribute from a mutex attribute object
- pthread_mutexattr_getrecursive()
- Get the recursive attribute from a mutex attribute object
- pthread_mutexattr_gettype()
- Get a mutex type
- pthread_mutexattr_init()
- Initialize the mutex attribute object
- pthread_mutexattr_setprioceiling()
- Set the priority ceiling of a mutex attribute object
- pthread_mutexattr_setprotocol()
- Set a mutexes scheduling protocol
- pthread_mutexattr_setpshared()
- Set the process-shared attribute in mutex attribute object
- pthread_mutexattr_setrecursive()
- Set the recursive attribute in mutex attribute object
- pthread_mutexattr_settype()
- Set a mutex type
- pthread_mutex_destroy()
- Destroy the mutex
- pthread_mutex_getprioceiling()
- Get a mutexes priority ceiling
- pthread_mutex_init()
- Initialize the mutex
- pthread_mutex_lock()
- Lock the mutex
- pthread_mutex_setprioceiling()
- Set a mutexes priority ceiling
- pthread_mutex_timedlock()
- Lock a mutex
- pthread_mutex_trylock()
- Attempt to lock a mutex
- pthread_mutex_unlock()
- Unlock the mutex
- pthread_once()
- Dynamic package initialization
- pthread_sleepon_timedwait()
- Make a thread sleep while waiting
- pthread_timedjoin()
- Join a thread, with a time limit
- pthread_rwlockattr_destroy()
- Destroy a read-write lock attribute object
- pthread_rwlockattr_getpshared()
- Get the process-shared attribute of a read-write lock attribute object
- pthread_rwlockattr_init()
- Create a read-write lock attribute object
- pthread_rwlockattr_setpshared()
- Set the process-shared attribute of a read-write lock attribute object
- pthread_rwlock_destroy()
- Destroy a read/write lock
- pthread_rwlock_init()
- Initialize a read/write lock
- pthread_rwlock_rdlock()
- Acquire a shared read lock on a read/write lock
- pthread_rwlock_timedrdlock()
- Lock a read-write lock for writing
- pthread_rwlock_timedwrlock()
- Attempt to acquire an exclusive write lock on a read/write lock
- pthread_rwlock_tryrdlock()
- Attempt to acquire a shared read lock on a read/write lock
- pthread_rwlock_trywrlock()
- Attempt to acquire an exclusive write lock on a read/write lock
- pthread_rwlock_unlock()
- Unlock a read/write lock
- pthread_rwlock_wrlock()
- Acquire an exclusive write lock on a read/write lock
- pthread_self()
- Get the calling thread's ID
- pthread_setcancelstate()
- Set a threads cancellation state
- pthread_setcanceltype()
- Set a threads cancellation type
- pthread_setconcurrency()
- Set the concurrency level for a thread
- pthread_setschedparam()
- Set the thread scheduling parameters
- pthread_setspecific()
- Set the thread specific data value
- pthread_sigmask()
- Examine and change blocked signals
- pthread_sleepon_broadcast()
- Unblock waiting threads
- pthread_sleepon_lock()
- Lock the pthread_sleepon*() functions
- pthread_sleepon_signal()
- Signal a sleeping thread
- pthread_sleepon_unlock()
- Unlock the pthread_sleepon*() functions
- pthread_sleepon_wait()
- Make a thread sleep while waiting
- pthread_spin_destroy()
- Destroy a thread spinlock
- pthread_spin_init()
- Initialize a thread spinlock
- pthread_spin_lock()
- Lock a thread spinlock
- pthread_spin_trylock()
- Try locking a thread spinlock
- pthread_spin_unlock()
- Unlock a thread spinlock
- pthread_testcancel()
- Test the thread cancellation
These functions are concerned with dates and times. (Some of these functions have wide-character versions in the "Wide-character functions" section of the function summary.)
- asctime(), asctime_r()
- Convert time information to a string
- clock()
- Return the number of clock ticks used by the program
- ClockAdjust(), ClockAdjust_r()
- Adjust the time of a clock
- ClockCycles()
- Get the number of clock cycles
- clock_getcpuclockid()
- Return the clock ID of the CPU-time clock from a specified process
- ClockId(), ClockId_r()
- Return an integer to be used as a clockid_t
- ClockPeriod(), ClockPeriod_r()
- Get or set a clock period
- ClockTime(), ClockTime_r()
- Get or set a clock
- ctime(), ctime_r()
- Convert calendar time to local time
- difftime()
- Calculate the difference between two times
- ftime()
- Get the current time, and store it in a structure
- gettimeofday()
- Get the current time
- gmtime()
- Convert calendar time to a broken-down time
- gmtime_r()
- Convert calendar time to a broken-down time
- localtime()
- Convert calendar time to local time
- localtime_r()
- Convert calendar time to local time
- mktime()
- Convert local time to calendar time
- settimeofday()
- Set the time and date
- strftime()
- Format the time into a string
- time()
- Determine the current calendar time
- TimerAlarm(), TimerAlarm_r()
- Send an alarm signal
- TimerCreate(), TimerCreate_r()
- Create a timer for a process
- TimerDestroy(), TimerDestroy_r()
- Destroy a process timer
- TimerInfo(), TimerInfo_r()
- Get information about a timer
- TimerSettime(), TimerSettime_r()
- Set the expiration time for a timer
- timer_timeout(), timer_timeout_r()
- Set a timeout on a blocking state
- TimerTimeout(), TimerTimeout_r()
- Set a timeout on a blocking state
- times()
- Get time-accounting information
- tm
- Structure that describes calendar time
- tzset()
- Set the time according to the TZ environment variable
Variable-length argument lists are used when a function doesn't have a fixed
number of arguments. These macros provide the capability to access these arguments:
- va_arg()
- Get the next item in a list of variable arguments
- va_end()
- Finish getting items from a variable argument list
- va_start()
- Start getting items from a variable argument list
Wide-character functions are the wide-character versions of many functions from the following function summary categories:
The functions are:
- btowc()
- Convert a single-byte character to a wide character
- fgetwc()
- Read a wide character from a stream
- fgetws()
- Read a string of wide characters from a stream
- fputwc()
- Write a wide character to a stream
- fputws()
- Write a wide character string to an output stream
- fwide()
- Set the stream orientation
- fwprintf()
- Write output to a stream
- fwscanf()
- Scan input from a stream
- getwc()
- Read a wide character from a stream
- getwchar()
- Read a wide character from a stream
- iswalnum()
- Test for an alphabetic or a decimal digit wide character
- iswalpha()
- Test for an alphabetic wide character
- iswcntrl()
- Test for a control wide character
- iswctype()
- Test for an alphabetic or a decimal digit wide character
- iswdigit()
- Test for a decimal digit wide character
- iswgraph()
- Test for any graphical wide character
- iswlower()
- Test for a lowercase letter wide character
- iswprint()
- Test for a printable wide character
- iswpunct()
- Test for any punctuation wide character
- iswspace()
- Test for a whitespace wide character
- iswupper()
- Test for an uppercase wide character
- iswxdigit()
- Test for any hexadecimal digit wide character
- putwc()
- Write a wide character to a stream
- putwchar()
- Write a wide character to a stdout
- swprintf()
- Print formatted output into a string
- swscanf()
- Scan input from a wide character string
- towctrans()
- Convert wide characters (esp. transliteration to uppercase or lowercase)
- towlower()
- Convert wide character to lowercase
- towupper()
- Convert wide character to uppercase
- ungetwc()
- Push a wide character back onto an input stream
- vfwprintf()
- Write formatted output to a file
- vfwscanf()
- Scan input from a file
- vswprintf()
- Write formatted output to a buffer
- vswscanf()
- Scan input from a string
- vwprintf()
- Write formatted output to a file
- vwscanf()
- Scan input from a file
- wcrtomb()
- Convert a wide-character code to a character
- wcscat()
- Concatenate two wide-character strings
- wcschr()
- Find the first occurrence of a wide character in a string
- wcscmp()
- Compare two wide-character strings
- wcscoll()
- Compare two wide-character strings using the locale's collating sequence
- wcscpy()
- Copy a wide-character string
- wcscspn()
- Count string wide characters not in a wide-character set
- wcsftime()
- Format the time into a string
- wcslen()
- Compute the length of a wide-character string
- wcsncat()
- Concatenate two wide-character strings, up to a maximum length
- wcsncmp()
- Compare two wide-character strings, up to a given length
- wcsncpy()
- Copy a wide-character string, to a maximum length
- wcspbrk()
- Locate an occurrence of one wide-character string inside another
- wcsrtombs()
- Convert a wide-character string to a character string
- wcsrchr()
- Find the last occurrence of a wide character in a string
- wcsspn()
- Find one wide-character string inside another
- wcsstr()
- Find one wide-character string inside another
- wcstod(), wcstof(), wcstold()
- Convert a wide-character string to a double, float or long double
- wcstok()
- Break a wide-character string into tokens
- wcstol(), wcstoll()
- Convert a wide-character string to a long or long long
- wcstoul(), wcstoull()
- Convert a wide-character string to an unsigned long integer or unsigned long long
- wcsxfrm()
- Transform two wide-character strings
- wctob()
- Convert a wide character to a single-byte code
- wctomb()
- Convert a wide character to a multibyte character
- wctrans()
- Define wide-character mapping
- wctype()
- Define wide-character class
- wmemchr()
- Locate the first occurrence of a wide character in a buffer
- wmemcmp()
- Compare wide characters in two buffers
- wmemcpy()
- Copy wide characters from one buffer to another
- wmemmove()
- Copy wide characters from one buffer to another
- wmemset()
- Set wide characters in memory
- wprintf()
- Write formatted output to stdout
- wscanf()
- Scan formatted input from stdin
Each description contains the following subsections:
This subsection gives the header files that should be included within
a source file that references the function or macro.
It also shows an appropriate declaration for the function or for a
function that could be substituted for a macro.
This declaration isn't included in your program; only the header
file(s) should be included.
When a pointer argument is passed to a function that doesn't
modify the item indicated by that pointer, the argument is
shown with const before the argument. For
example, the following indicates that the array pointed at
by string isn't changed:
const char *string
This subsection describes the function or macro.
This subsection gives the return value (if any) for the function or macro.
This subsection shows the possible values that the
function might assign to the global variable
errno.
This optional subsection provides a list of related
functions or macros as well as pertinent docs to look for
more information.
This optional subsection gives one or more examples of the
use of the function. The examples are often just code
snippets, not complete programs.
This subsection tells where the function or macro is
commonly found, which may be helpful when porting code from
one environment to another. Here are the classes:
- ANSI
- These functions or macros are defined by the ANSI C standard.
- Large-file support
- These functions support 64-bit offsets.
- POSIX 1003.1
- These functions are specified in the document
Information technology -- Portable Operating System Interface
(IEEE Std 1003.1, 1996 Edition). The document is a part of the IEEE Std. 1003.1-200x draft.
 |
For an up-to-date status of the many POSIX drafts/standards
documents, see the PASC (Portable Applications Standards
Committee of the IEEE Computer Society) report at
http://www.pasc.org/standing/sd11.html.
|
- POSIX 1003.1 (Realtime Extensions)
- This portion of POSIX defines optional sets of systems
interfaces to support the source portability of applications
with realtime requirements. Facilities include an efficient
process creation mechanism, additional realtime scheduling
policies, interfaces for execution time monitoring,
for interacting with special devices, for improving I/O performance, and timeouts for blocking
functions. The scope is to take existing realtime OS
practice and add it to the base standard. The document is a part of the IEEE Std. 1003.1-200x draft.
- POSIX 1003.1 (Threads)
- This portion provides the POSIX base standard with interfaces
and functionality to support the multiple flows of control, called threads, within
a process. The facilities provided represent a small set of syntactic and semantic extensions to
POSIX.1 in order to support a convenient interface for multithreading functions.
The document is a part of the IEEE Std. 1003.1-200x draft.
- POSIX 1003.1a
- Some of these functions are described in the appendix
to 1003.2 (Shell and Utilities), others are in
the System Application Program Interface (API) [C Language] -- Amendment (POSIX 1003.1a Draft 15).
The document is a part of the IEEE Std. 1003.1-200x draft.
- POSIX 1003.1d (IEEE Approved Draft: Additional Realtime Extensions)
- This portion extends the system interfaces defined by 1003.1
(Realtime Extensions). The document is a part of the IEEE Std. 1003.1-200x draft.
- POSIX 1003.1g (Draft: Protocol Independent Interfaces)
- This portion defines a programmatic interface for network
process-to-process communication, such that the application
may be independent of the underlying protocols.
- POSIX 1003.1j (IEEE Approved Draft: Advanced Realtime Extensions)
- This portion extends the POSIX interfaces to provide
C-language bindings for additional realtime functions for
Typed Memory, Absolute Nanosleep, Barrier Synchronization,
Reader/Writer Lock, Monotonic Clock, and Synchronized Clock.
The document is a part of the IEEE Std. 1003.1-200x draft.
- QNX 4
- These functions or macros are neither ANSI nor POSIX.
They perform a function related to the QNX OS version 4.
They may be found in other implementations of C for personal computers with the QNX 4 OS.
Use these functions with caution if portability is a consideration.
 |
Any QNX 4 functions in the C library are provided
only to make it easier to port QNX 4 programs.
Don't use these in QNX 6 programs.
|
- QNX 6
- These functions or macros are neither ANSI nor POSIX.
They perform a function related to the QNX OS version 6.
They may be found in other implementations of C for personal computers with the QNX OS.
Use these functions with caution if portability is a consideration.
- SNMP
-
Simple Network Management Protocol is a network-management protocol
whose base document is RFC 1067. It's used to query and
modify network device states.
- SOCKS
- These functions are part of the SOCKS package consisting of a proxy server, client
programs (rftp and rtelnet), and a
library (libsocks) for adapting
other applications into new client programs. For more information, see the
appendix SOCKS -- A Basic Firewall.
- Unix
- These Unix-class functions reside on some Unix systems, but are outside of the
POSIX or ANSI standards.
We've created the following Unix categories to differentiate:
- Legacy Unix
- Functions included for backwards compatibility only. New applications shouldn't implement these functions.
- Standard Unix
- Functions that match XOPEN specifications. These functions are part of the IEEE Std. 1003.1-200x draft.
- Unix
- Unix functions that don't fall into the above two categories. ;-)
This subsection summarizes whether or not it's safe to use the C library
functions in certain situations:
- Cancellation point
- Indicates whether calling a function may or may not cause the
thread to be terminated if a cancellation is pending.
- Interrupt handler
- An interrupt-safe function behaves as documented even if used in an
interrupt handler. Functions flagged as interrupt-unsafe shouldn't
be used in interrupt handlers.
- Signal handler
- A signal-safe function behaves as documented even if called from a
signal handler even if the signal interrupts a signal-unsafe function.
Some of the signal-safe functions modify errno on failure.
If you use any of these in a signal handler, asynchronous signals may
have the side effect of modifying errno in an unpredictable way.
If any of the code that can be interrupted checks the value
of errno (this also applies to library calls,
so you should assume that most library calls may
internally check errno), make sure that your
signal handler saves errno on entry and restores
it on exit.
All of the above also applies to signal-unsafe functions,
with one exception: if a signal handler calls a
signal-unsafe function, make sure that signal doesn't
interrupt a signal-unsafe function.
- Thread
- A thread-safe function behaves as documented even if
called in a multi-threaded environment.
Most functions in the QNX 6 libraries are thread-safe.
Even for those that aren't, there are still ways to call
them safely in a multi-threaded program (e.g. by protecting
the calls with a mutex). Such cases are explained in each
function's description.
 |
The "safety" designations documented in this manual are valid for the
this release and could change in future versions.
Floating-point functions aren't safe to use in interrupt handlers or signal handlers.
|