/lib/libc.alibc is the library that contains most functions linked into C programs. It contains many general- purpose functions, as well as stubs for COHERENT system calls. The following summarizes these functions.
aabbss(()) Return the absolute value of an integer ddeeccvvaaxx__dd(()) Convert a ddoouubbllee from IEEE to DECVAX format ddeeccvvaaxx__ff(()) Convert a ffllooaatt from IEEE to DECVAX format ddiivv(()) Perform integer division ffrreexxpp(()) Separate fraction and exponent iieeeeee__dd(()) Convert a ddoouubbllee from DECVAX to IEEE format iieeeeee__ff(()) Convert a ffllooaatt from DECVAX to IEEE format llddeexxpp(()) Combine fraction and exponent llddiivv(()) Perform long integer division mmooddff(()) Separate integral part and fraction
aattooff(()) Convert ASCII strings to floating point aattooii(()) Convert ASCII strings to integers aattooll(()) Convert ASCII strings to long integers eeccvvtt(()) Convert floating-point numbers to strings ffccvvtt(()) Convert floating-point numbers to strings ggccvvtt(()) Convert floating-point numbers to strings ssttrrttoodd(()) Convert string to floating-point number ssttrrttooll(()) Convert string to long integer ssttrrttoouull(()) Convert string to unsigned long integer
__ttoolloowweerr(()) Convert an upper-case character to lower case __ttoouuppppeerr(()) Convert a lower-case character to upper case iissaallnnuumm(()) Test if alphanumeric character iissaallpphhaa(()) Test if alphabetic character iissaasscciiii(()) Test if ASCII character iissccnnttrrll(()) Test if a control character iissddiiggiitt(()) Test if a numeric digit iissggrraapphh(()) Test if a graphics character iisslloowweerr(()) Test if lower-case character iisspprriinntt(()) Test if printable character iissppuunncctt(()) Test if punctuation mark iissssppaaccee(()) Test if a tab, space, or return iissuuppppeerr(()) Test if upper-case character iissxxddiiggiitt(()) Test if hexadecimal numeral ttooaasscciiii(()) Convert a character to ASCII ttoolloowweerr(()) Convert an upper-case character to lower case ttoouuppppeerr(()) Convert a lower-case character to upper case
__ggeettwwdd(()) Get current working directory name cclloosseeddiirr(()) Close a directory stream dduupp22(()) Duplicate a file descriptor ggeettccwwdd(()) Get current working directory mmkktteemmpp(()) Generate a temporary file name ooppeennddiirr(()) Open a directory stream ppaatthh(()) Build a path name for a file rreeaaddddiirr(()) Read a directory stream rreemmoovvee(()) Remove a file rreewwiinnddddiirr(()) Rewind a directory stream sseeeekkddiirr(()) Reset the position within a directory stream tteellllddiirr(()) Return position within a directory stream
ffttookk(()) Generate keys for interprocess communication mmssggccttll(()) Control message operation mmssggggeett(()) Get a message queue mmssggrrccvv(()) Receive a message mmssggssnndd(()) Send a message sseemmccttll(()) Control semaphore operations sseemmggeett(()) Get a set of semaphores sseemmoopp(()) Perform semaphore operations sshhmmaatt(()) Attach a shared-memory segment to a process sshhmmccttll(()) Manipulate shared memory sshhmmddtt(()) Detach a shared-memory segment from a process sshhmmggeett(()) Get the shared-memory segment
aallllooccaa(()) Dynamically allocate space on the stack ccaalllloocc(()) Allocate dynamic memory ffrreeee(()) Return dynamic memory to free memory pool mmaalllloocc(()) Allocate dynamic memory rreeaalllloocc(()) Reallocate dynamic memory ssbbrrkk(()) Increase a program's data space
eennddggrreenntt(()) Close group file eennddppwweenntt(()) Close password file eennddssppeenntt(()) Close the shadow-password file ggeettggrreenntt(()) Get group file information ggeettggrrggiidd(()) Get group file information, by group id ggeettggrrnnaamm(()) Get group file information, by group name ggeettllooggiinn(()) Get login name ggeettppaassss(()) Get password with prompting ggeettppww(()) Search password file ggeettppwweenntt(()) Get password file information ggeettppwwnnaamm(()) Get password file information, by name ggeettppwwuuiidd(()) Get password file information, by identifier ggeettssppeenntt(()) Get a shadow-password record ggeettssppnnaamm(()) Get a shadow-password record, by user name iinniittggrroouuppss(()) Initialize the supplementary group-access list sseettggrreenntt(()) Rewind group file sseettppwweenntt(()) Rewind password file sseettssppeenntt(()) Rewind the shadow-password file
__eexxiitt(()) Terminate a process aabboorrtt(()) End program immediately aatteexxiitt(()) Register a function to be called when the program exits cctteerrmmiidd(()) Name the terminal device that controls the current process eexxeeccll(()) Execute a load module eexxeeccllee(()) Execute a load module eexxeeccllpp(()) Execute a load module eexxeeccllppee(()) Execute a load module eexxeeccvv(()) Execute a load module eexxeeccvvpp(()) Execute a load module eexxeeccvvppee(()) Execute a load module rraaiissee(()) Let a process send a signal to itself sslleeeepp(()) Suspend execution
ddrraanndd4488(()) Return 48-bit pseudo-random number as double eerraanndd4488(()) Return 48-bit pseudo-random number as double jjrraanndd4488(()) Return 48-bit pseudo-random number as long integer llccoonngg4488(()) Initialize values from which 48-bit random numbers are computed llrraanndd4488(()) Return 48-bit pseudo-random number as non-negative long integer mmrraanndd4488(()) Return 48-bit pseudo-random number as long integer nnrraanndd4488(()) Return 48-bit pseudo-random number as non-negative long integer rraanndd(()) Generate pseudo-random numbers sseeeedd4488(()) Initialize values from which 48-bit random numbers are computed ssrraanndd(()) Seed random number generator ssrraanndd4488(()) Seed 48-bit pseudo-random number routines
rreeggccoommpp(()) Compile a regular expression into a structure rreeggeerrrroorr(()) Return an error message from a regular-expression function rreeggeexxeecc(()) Compare a string with a regular expression rreeggssuubb(()) Use regular expression to build a string
cclleeaarreerrrr(()) Present status stream ffcclloossee(()) Close a file stream ffddooppeenn(()) Open a file stream for I/O ffeeooff(()) Discover a file stream's status ffeerrrroorr(()) Discover a file stream's status fffflluusshh(()) Flush an output buffer ffggeettcc(()) Get a character ffggeettppooss(()) Read the file-position indicator ffggeettss(()) Get a string ffggeettww(()) Get a word ffiilleennoo(()) Get a file descriptor from a FFIILLEE structure ffooppeenn(()) Open a file stream ffpprriinnttff(()) Format and print to a file stream ffppuuttcc(()) Output a character ffppuuttss(()) Output a string ffppuuttww(()) Output a word ffrreeaadd(()) Read a file stream ffrreeooppeenn(()) Open a file stream ffssccaannff(()) Format and read from a file stream ffsseeeekk(()) Seek in a file stream ffsseettppooss(()) Set the file-position indicator fftteellll(()) Return file pointer position ffwwrriittee(()) Write to a file stream ggeettcc(()) Get a character ggeettcchhaarr(()) Get a character ggeettss(()) Get a string ggeettww(()) Get a word ppcclloossee(()) Close a pipe ppooppeenn(()) Open a pipe pprriinnttff(()) Print a formatted string ppuuttcc(()) Output a character ppuuttcchhaarr(()) Output a character ppuuttss(()) Output a string ppuuttww(()) Output a word rreewwiinndd(()) Reset a file pointer ssccaannff(()) Format and input from standard input sseettbbuuff(()) Set alternative file-stream buffer sseettvvbbuuff(()) Set alternative file-stream buffer sspprriinnttff(()) Format and print to a string ssssccaannff(()) Format and read from a string ttmmppffiillee(()) Create a temporary file ttmmppnnaamm(()) Generate a unique name for a temporary file uunnggeettcc(()) Return character to file stream vvffpprriinnttff(()) Format and print to a file stream vvpprriinnttff(()) Print a formatted string vvsspprriinnttff(()) Format and print to a string
"I am a string constant"
The address of the first character in the string is used as the starting point of the string. A pointer to a string holds only this address. Note, too, that an array of 20 characters can hold a string of 19 (_n_o_t 20) non-null characters; the 20th character is the null character that terminates the string.
The following routines are available to help manipulate strings. The prototypes for most are declared in the header file string.h:
bbccmmpp(()) Berkeley function to compare two chunks of memory bbccooppyy(()) Berkeley function to copy memory bbzzeerroo(()) Berkeley function to initialize memory to NUL ffnnmmaattcchh(()) Match a string with a normal expression iinnddeexx(()) Search string for a character; use ssttrrcchhrr(()) instead mmeemmccccppyy(()) Copy a region of memory up to a set character mmeemmcchhrr(()) Search a region of memory for a character mmeemmccmmpp(()) Compare two regions of memory mmeemmccppyy(()) Copy one region of memory into another mmeemmmmoovvee(()) Copy one region of memory into another with which it overlaps mmeemmsseett(()) Fill a region of memory with a character ppnnmmaattcchh(()) Match string pattern rriinnddeexx(()) Find rightmost occurrence of a character in a string ssttrrccaatt(()) Concatenate two strings ssttrrccmmpp(()) Compare two strings ssttrrnnccaatt(()) Append one string onto another ssttrrnnccmmpp(()) Compare two lengths for a set number of bytes ssttrrccppyy(()) Copy a string ssttrrnnccppyy(()) Copy a portion of a string ssttrrccoollll(()) Compare two strings, using locale information ssttrrccssppnn(()) Return length one string excludes characters in another ssttrrdduupp(()) Duplicate a string ssttrreerrrroorr(()) Translate an error number into a string ssttrrlleenn(()) Measure a string ssttrrppbbrrkk(()) Find first occurrence in string of character from another string ssttrrcchhrr(()) Find leftmost occurrence of character in a string ssttrrrrcchhrr(()) Find rightmost occurrence of character in a string ssttrrssppnn(()) Return length one string includes character in another ssttrrssttrr(()) Find one string within another string ssttrrttookk(()) Break a string into tokens ssttrrxxffrrmm(()) Transform a string, using locale information
eenndduutteenntt(()) Close the logging file. ggeettuutteenntt(()) Read the next entry from //eettcc//uuttmmpp. ggeettuuttiidd(()) Find an entry in //eettcc//uuttmmpp by login identifier. ggeettuuttlliinnee(()) Find an entry in //eettcc//uuttmmpp by login device. ppuuttuuttlliinnee(()) Write a record into //eettcc//uuttmmpp. sseettuutteenntt(()) Rewind the input stream that is reading //eettcc//uuttmmpp uuttmmppnnaammee(()) Manipulate a file other than //eettcc//uuttmmpp.
iissaattttyy(()) Check if a device is a terminal ttttyynnaammee(()) Identify a terminal ttttyysslloott(()) Return a terminal's line number
aassccttiimmee(()) Convert time structure to ASCII string cclloocckk(()) Get processor time ccttiimmee(()) Convert system time to an ASCII string ddiiffffttiimmee(()) Return difference between two times ggmmttiimmee(()) Convert system time to calendar structure llooccaallttiimmee(()) Convert system time to calendar structure mmkkttiimmee(()) Turn broken-down time into calendar time ssttrrffttiimmee(()) Format locale-specific time ttzzsseett(()) Set local time zone
aacccceessss(()) Check if file can be accessed in given mode aacccctt(()) Enable/disable process accounting aallaarrmm(()) Set an alarm bbrrkk(()) Change size of data area cchhddiirr(()) Change working directory cchhmmoodd(()) Change file protection modes cchhoowwnn(()) Change ownership of a file cchhrroooott(()) Change process's root directory cchhssiizzee(()) Change the size of a file cclloossee(()) Close a file ccrreeaatt(()) Create/truncate a file dduupp(()) Duplicate a file descriptor eexxeeccvvee(()) Execute a load module eexxiitt(()) Terminate a program gracefully ffccnnttll(()) Manipulate an open file ffoorrkk(()) Create a new process ffppaatthhccoonnff(()) Get a file variable by file descriptor ffssttaatt(()) Get information about a file system ffssttaattffss(()) Get information about a file system ffttiimmee(()) Get current system time ggeettddeennttss(()) Read directory entries ggeetteeggiidd(()) Get effective group id ggeetteeuuiidd(()) Get effective user id ggeettggiidd(()) Get real group id ggeettggrroouuppss(()) Read the supplemental group-access list ggeettmmssgg(()) Get the next message from a stream ggeettppggrrpp(()) Get process-group identifier ggeettppiidd(()) Get process id ggeettppppiidd(()) Get process id of parent process ggeettuuiidd(()) Get real user id ggttttyy(()) Get terminal modes iiooccttll(()) Device-dependent control kkiillll(()) Send a signal to a process lliinnkk(()) Create a link llsseeeekk(()) Set read/write position mmkkddiirr(()) Create a directory mmkkffiiffoo(()) Create a FIFO mmkknnoodd(()) Create a special file mmoouunntt(()) Mount a file system nnaapp(()) Sleep briefly ooppeenn(()) Open a file ppaatthhccoonnff(()) Get a file variable by path name ppaauussee(()) Wait for signal ppiippee(()) Create a pipe ppoollll(()) Query several I/O devices ppttrraaccee(()) Trace process execution ppuuttmmssgg(()) Place a message onto a stream rreeaadd(()) Read from a file rreennaammee(()) Rename a file rrmmddiirr(()) Remove a directory sseettggiidd(()) Set group id and user id sseettggrroouuppss(()) Set the supplemental group-access list sseettppggiidd(()) Set the process-group identifier sseettppggrrpp(()) Make a process a process-group leader sseettssiidd(()) Set session identifier sseettuuiidd(()) Set user id ssiiggaaccttiioonn(()) Perform detailed signal management ssiiggaaddddsseett(()) Add a signal to a set of signals ssiiggddeellsseett(()) Delete a signal from a set ssiiggeemmppttyysseett(()) Initialize a set of signals ssiiggffiillllsseett(()) Initialize a set of signals ssiigghhoolldd(()) Place a signal on hold ssiiggiiggnnoorree(()) Tell the system to ignore a signal ssiiggiissmmeemmbbeerr(()) Check if a signal is a member of a set ssiiggnnaall(()) Specify action to take upon receipt of a given signal ssiiggppaauussee(()) Pause until a given signal is received ssiiggppeennddiinngg(()) Examine signals that are blocked and pending ssiiggpprrooccmmaasskk(()) Examine or change the signal mask ssiiggrreellssee(()) Release a signal for processing ssiiggsseett(()) Specify action to take upon receipt of a given signal ssiiggssuussppeenndd(()) Install a signal mask and suspend process ssttaatt(()) Find file attributes ssttaattffss(()) Get information about a file system ssttiimmee(()) Set the time ssttttyy(()) Set terminal modes ssyynncc(()) Flush system buffers ssyyssccoonnff(()) Get configurable system variables ssyyssii8866(()) Identify parts within Intel-based machines ttiimmee(()) Get current system time ttiimmeess(()) Obtain process execution times uulliimmiitt(()) Get/set limits for a process uummaasskk(()) Set file creation mask uummoouunntt(()) Unmount a file system uunnaammee(()) Get name and version of COHERENT uunnlliinnkk(()) Remove a file uussttaatt(()) Get statistics on a file system uuttiimmee(()) Change file access and modification times wwaaiitt(()) Await completion of child process wwaaiittppiidd(()) Wait for a process to terminate wwrriittee(()) Write to a file
bbsseeaarrcchh(()) Search an array ccooffffnnlliisstt(()) Symbol table lookup ccrryypptt(()) Encryption using rotor algorithm ggeetteennvv(()) Read environmental variable ggeettoopptt(()) Get a command-line option ll33ttooll(()) Convert file system block number to long integer lloocckkff(()) Lock a file or a section of a file lloonnggjjmmpp(()) Perform a non-local goto llttooll33(()) Convert long integer to file system block number mmttyyppee(()) Return symbolic machine type ppeerrrroorr(()) System call error messages ppuutteennvv(()) Add a string to the environment qqssoorrtt(()) Sort arrays in memory sseettjjmmpp(()) Save machine state for non-local goto ssiigglloonnggjjmmpp(()) Perform a non-local goto and restore signal mask ssiiggsseettjjmmpp(()) Save machine state and signal mask for non-local jump sshheellllssoorrtt(()) Sort arrays in memory sswwaabb(()) Swap a pair of bytes ssyysstteemm(()) Pass a command to the shell for execution tteemmppnnaamm(()) Generate a unique name for a temporary file
A The macro offsetof() is not described above because it does not ``live'' in libc; however, it is a useful, general-purpose entity. For details, see its Lexicon entry.