Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cc(1)

ld(1)

nm(1)

intro(2)

math(3M)

matherr(3M)

stdio(3S)

INTRO(3)                             BSD                              INTRO(3)



NAME
     intro - introduction to C library functions

DESCRIPTION
     This section describes functions that can be found in various libraries.
     The library functions are those other than the functions that directly
     invoke UNIX system primitives, described in Section 2.  Most of these
     functions are accessible from the C library, libc.  The C library also
     includes all the functions described in Section 2.

     A subset of these functions is available from FORTRAN; they are described
     separately in intro(3F).

     The functions described in this section are grouped into various
     sections:

     (3)  The straight "3" functions are the standard C library functions.

     (3N) These functions constitute the internet network library.

     (3S) These functions constitute the package,"standard"I/O see stdio(3S)
          for more details.  Declarations for these functions can be obtained
          from the include file <stdio.h>.

     (3C) These routines are included for compatibility with other systems.
          In particular, a number of system call interfaces provided in
          previous releases have been included for source code compatibility.
          Use of these routines should, for the most part, be avoided.  The
          manual page entry for each compatibility routine indicates the
          proper interface to use.

     (3M) These math functions are a part of /lib/libc.  Declarations for
          these functions may be obtained from the include file <math.h>.
          When one of these functions detects an error, it invokes
          matherr(3M).

          Domain C supports "built-in code" for the following math routines:
          abs(), sin(), cos(), tan(), log(), exp(), atan(), atan2(), and
          sqrt().  If you specify -D_BUILTINS on the cc(1) command line, or
          #include <apollo/builtins.h> in your source file, then the compiler
          will insert object code for these functions wherever they are
          invoked.  While this results in somewhat longer object files, it can
          produce much faster executable code, particularly when double-
          precision math functions are used heavily.

          However, do not use the built-in functions if your programs rely on
          matherr(3M) error handling.  They do not support it.

     (3X) These functions constitute minor libraries and other miscellaneous
          run-time facilities.  Most are available only when programming in C.
          These functions include libraries that provide device independent
          plotting functions, terminal-independent screen management routines
          for two dimensional non-bitmap display terminals, and functions for
          managing data bases with inverted indexes.  These functions are
          located in separate libraries indicated in each manual entry.

FILES
     /lib/libc      the C library

SEE ALSO
     cc(1), ld(1), nm(1) intro(2), math(3M), matherr(3M), stdio(3S).
     The DOMAIN C Language Reference.

LIST OF FUNCTIONS
      Name        Appears on Page                  Description

abort            abort(3)          generate a fault
abs              abs(3)            integer absolute value
acos             sin(3M)           trigonometric functions and their inverses
acosh            asinh(3M)         inverse hyperbolic functions
alarm            alarm(3C)         schedule signal after specified time
alloca           malloc(3)         memory allocator
alloca           malloc.dbg(3)     memory allocator with debugging
                                   support
alphasort        scandir(3)        scan a directory
arc              plot(3X)          graphics interface
asctime          ctime(3)          convert date and time to ASCII
asin             sin(3M)           trigonometric functions and their inverses
asinh            asinh(3M)         inverse hyperbolic functions
assert           assert(3)         program verification
atan2            sin(3M)           trigonometric functions and their inverses
atan             sin(3M)           trigonometric functions and their inverses
atanh            asinh(3M)         inverse hyperbolic functions
atof             atof(3)           convert ASCII to numbers
atoi             atof(3)           convert ASCII to numbers
atol             atof(3)           convert ASCII to numbers
bcmp             bstring(3)        bit and byte string operations
bcopy            bstring(3)        bit and byte string operations
bzero            bstring(3)        bit and byte string operations
cabs             hypot(3M)         Euclidean distance, complex absolute
                                   value
calloc           malloc(3)         memory allocator
calloc           malloc.dbg(3)     memory allocator with debugging
                                   support
cbrt             sqrt(3M)          cube root, square root
ceil             floor(3M)         absolute value, floor, ceiling, and
                                   round-to-nearest
circle           plot(3X)          graphics interface
clearerr         ferror(3S)        stream status inquiries
closedir         directory(3)      directory operations
closelog         syslog(3)         control system log
closepl          plot(3X)          graphics interface
cont             plot(3X)          graphics interface
copysign         ieee(3M)          copysign, remainder, exponent manipulations
cos              sin(3M)           trigonometric functions and their inverses
cosh             sinh(3M)          hyperbolic functions
crypt            crypt(3)          generate hashing encryption
ctime            ctime(3)          convert date and time to ASCII
curses           curses(3X)        screen functions with optimal cursor
                                   motion
dbm_clearerr     ndbm(3)           data base subroutines
dbm_close        ndbm(3)           data base subroutines
dbm_delete       ndbm(3)           data base subroutines
dbm_error        ndbm(3)           data base subroutines
dbm_fetch        ndbm(3)           data base subroutines
dbm_firstkey     ndbm(3)           data base subroutines
dbm_nextkey      ndbm(3)           data base subroutines
dbm_open         ndbm(3)           data base subroutines
dbm_store        ndbm(3)           data base subroutines
dbminit          dbm(3X)           data base subroutines
delete           dbm(3X)           data base subroutines
dn_comp          resolver(3)       resolver routines
dn_expand        resolver(3)       resolver routines
drem             ieee(3M)          copysign, remainder, exponent manipulations
ecvt             ecvt(3)           output conversion
edata            end(3)            last locations in program
encrypt          crypt(3)          generate hashing encryption
end              end(3)            last locations in program
endfsent         getfsent(3)       get file system descriptor file
                                   entry
endgrent         getgrent(3)       get group file entry
endhostent       gethostbyname(3N) get network host entry
endnetent        getnetent(3N)     get network entry
endorgent        getorgent(3)      get organization file entry
endprotoent      getprotoent(3N)   get protocol entry
endpwent         getpwent(3)       get password file entry
endservent       getservent(3N)    get service entry
endttyent        getttyent(3)      get ttys file entry
endusershell     getusershell(3)   get legal user shells
environ          execl(3)          execute a file
erase            plot(3X)          graphics interface
erf              erf(3M)           error functions
erfc             erf(3M)           error functions
etext            end(3)            last locations in program
exec             execl(3)          execute a file
execl            execl(3)          execute a file
execle           execl(3)          execute a file
execlp           execl(3)          execute a file
exect            execl(3)          execute a file
execv            execl(3)          execute a file
execve           execl(3)          execute a file
execvp           execl(3)          execute a file
exit             exit(3)           terminate a process after flushing any
                                   pending
exp              exp(3M)           exponential, logarithm, power
expm1            exp(3M)           exponential, logarithm, power
fabs             floor(3M)         absolute value, floor, ceiling, and
                                   round-to-nearest
fclose           fclose(3S)        close or flush a stream
fcvt             ecvt(3)           output conversion
fdopen           fopen(3S)         open a stream
feof             ferror(3S)        stream status inquiries
ferror           ferror(3S)        stream status inquiries
fetch            dbm(3X)           data base subroutines
fflush           fclose(3S)        close or flush a stream
ffs              bstring(3)        bit and byte string operations
fgetc            getc(3S)          get character or word from stream
fgets            gets(3S)          get a string from a stream
fileno           ferror(3S)        stream status inquiries
finite           ieee(3M)          copysign, remainder, exponent manipulations
firstkey         dbm(3X)           data base subroutines
floor            floor(3M)         absolute value, floor, ceiling, and
                                   round-to-nearest
fmin             mp(3X)            multiple precision integer arithmetic
fmout            mp(3X)            multiple precision integer arithmetic
fopen            fopen(3S)         open a stream
fprintf          printf(3S)        formatted output conversion
fputc            putc(3S)          put character or word on a stream
fputs            puts(3S)          put a string on a stream
fread            fread(3S)         buffered binary input/output
free             malloc(3)         memory allocator
free             malloc.dbg(3)     memory allocator with debugging
                                   support
freopen          fopen(3S)         open a stream
frexp            frexp(3)          split into mantissa and exponent
fscanf           scanf(3S)         formatted input conversion
fseek            fseek(3S)         reposition a stream
ftell            fseek(3S)         reposition a stream
ftime            time(3C)          get date and time
fwrite           fread(3S)         buffered binary input/output
gcd              mp(3X)            multiple precision integer arithmetic
gcvt             ecvt(3)           output conversion
getc             getc(3S)          get character or word from stream
getchar          getc(3S)          get character or word from stream
getenv           getenv(3)         value for environment name
getfsent         getfsent(3)       get file system descriptor file
                                   entry
getfsfile        getfsent(3)       get file system descriptor file
                                   entry
getfsspec        getfsent(3)       get file system descriptor file
                                   entry
getfstype        getfsent(3)       get file system descriptor file
                                   entry
getgrent         getgrent(3)       get group file entry
getgrgid         getgrent(3)       get group file entry
getgrnam         getgrent(3)       get group file entry
gethostbyaddr    gethostbyname(3N) get network host entry
gethostbyname    gethostbyname(3N) get network host entry
gethostent       gethostbyname(3N) get network host entry
getlogin         getlogin(3)       get login name
getnetbyaddr     getnetent(3N)     get network entry
getnetbyname     getnetent(3N)     get network entry
getnetent        getnetent(3N)     get network entry
getopt           getopt(3)         get option letter from argv
getorgent        getorgent(3)      get organization file entry
getorgid         getorgent(3)      get organization file entry
getorgnam        getorgent(3)      get organization file entry
getpass          getpass(3)        read a password
getprotobyname   getprotoent(3N)   get protocol entry
getprotobynumber getprotoent(3N)   get protocol entry
getprotoent      getprotoent(3N)   get protocol entry
getpw            getpw(3C)         get name from uid
getpwent         getpwent(3)       get password file entry
getpwnam         getpwent(3)       get password file entry
getpwuid         getpwent(3)       get password file entry
gets             gets(3S)          get a string from a stream
getservbyname    getservent(3N)    get service entry
getservbyport    getservent(3N)    get service entry
getservent       getservent(3N)    get service entry
getttyent        getttyent(3)      get ttys file entry
getttynam        getttyent(3)      get ttys file entry
getusershell     getusershell(3)   get legal user shells
getw             getc(3S)          get character or word from stream
getwd            getwd(3)          get current working directory pathname
gmtime           ctime(3)          convert date and time to ASCII
gtty             stty(3C)          set and get terminal state (defunct)
htonl            byteorder(3N)     convert values between host and
                                   network byte
htons            byteorder(3N)     convert values between host and
                                   network byte
hypot            hypot(3M)         Euclidean distance, complex absolute
                                   value
index            string(3)         string operations
inet_addr        inet(3N)          Internet address manipulation routines
inet_lnaof       inet(3N)          Internet address manipulation routines
inet_makeaddr    inet(3N)          Internet address manipulation
                                   routines
inet_netof       inet(3N)          Internet address manipulation routines
inet_network     inet(3N)          Internet address manipulation
                                   routines
inet_ntoa        inet(3N)          Internet address manipulation routines
initgroups       initgroups(3)     initialize group access list
initstate        random(3)         better random number generator;
                                   routines for changing
insque           insque(3)         insert/remove element from a queue
invert           mp(3X)            multiple precision integer arithmetic
isalnum          ctype(3)          character classification macros
isalpha          ctype(3)          character classification macros
isascii          ctype(3)          character classification macros
isatty           ttyname(3)        find name of a terminal
iscntrl          ctype(3)          character classification macros
isdigit          ctype(3)          character classification macros
isgraph          ctype(3)          character classification macros
islower          ctype(3)          character classification macros
isprint          ctype(3)          character classification macros
ispunct          ctype(3)          character classification macros
isspace          ctype(3)          character classification macros
isupper          ctype(3)          character classification macros
isxdigit         ctype(3)          character classification macros
itom             mp(3X)            multiple precision integer arithmetic
j0               j0(3M)            bessel functions
j1               j0(3M)            bessel functions
jn               j0(3M)            bessel functions
label            plot(3X)          graphics interface
ldaclose         ldclose(3X)       close a common object file
ldahread         ldahread(3X)      read the archive header of a
                                   member of an archive
ldaopen          ldopen(3X)        open a common object file for reading
ldclose          ldclose(3X)       close a common object file
ldexp            frexp(3)          split into mantissa and exponent
ldfhread         ldfhread(3X)      read the file header of a common
                                   object
ldgetname        ldgetname(3X)     retrieve symbol name for common
                                   object file symbol table
ldlinit          ldlread(3X)       manipulate line number entries
                                   of a common object file
ldlitem          ldlread(3X)       manipulate line number entries
                                   of a common object file
ldlread          ldlread(3X)       manipulate line number entries
                                   of a common object file
ldlseek          ldlseek(3X)       seek to line number entries of
                                   a section of a common object
ldnlseek         ldlseek(3X)       seek to line number entries of
                                   a section of a common object
ldnrseek         ldrseek(3X)       seek to relocation entries of
                                   a section of a common object
ldnshread        ldshread(3X)      read an indexed/named section
                                   header of a common object
ldnsseek         ldsseek(3X)       seek to an indexed/named section
                                   of a common object
ldohseek         ldohseek(3X)      seek to the optional file header
                                   of a common object
ldopen           ldopen(3X)        open a common object file for reading
ldrseek          ldrseek(3X)       seek to relocation entries of a
                                   section of a common object
ldsgetarname     ldsgetarname(3X)  retrieve the filename
                                   of a member of an archive
ldsgetname       ldsgetname(3X)    retrieve section name for
                                   common object file
ldsgetstring     ldsgetstring(3X)  retrieve string from
                                   common object file string
ldshread         ldshread(3X)      read an indexed/named section
                                   header of a common object
ldsseek          ldsseek(3X)       seek to an indexed/named section
                                   of a common object
ldtbindex        ldtbindex(3X)     compute the index of a symbol
                                   table entry of a common object
ldtbread         ldtbread(3X)      read an indexed symbol table
                                   entry of a common object
ldtbseek         ldtbseek(3X)      seek to the symbol table of a
                                   common object
lgamma           lgamma(3M)        log gamma function
line             plot(3X)          graphics interface
linemod          plot(3X)          graphics interface
localtime        ctime(3)          convert date and time to ASCII
log10            exp(3M)           exponential, logarithm, power
log1p            exp(3M)           exponential, logarithm, power
log              exp(3M)           exponential, logarithm, power
logb             ieee(3M)          copysign, remainder, exponent manipulations
longjmp          setjmp(3)         non-local goto
m_in             mp(3X)            multiple precision integer arithmetic
m_out            mp(3X)            multiple precision integer arithmetic
madd             mp(3X)            multiple precision integer arithmetic
madvise          madvise(3)        advise the system of a process'
                                   expected paging
malloc           malloc(3)         memory allocator
malloc           malloc.dbg(3)     memory allocator with debugging
                                   support
math             math(3M)          introduction to mathematical library
                                   functions
mclear           mset(3)           set and clear semaphores for processes
                                   mapped in virtual
mcmp             mp(3X)            multiple precision integer arithmetic
mdiv             mp(3X)            multiple precision integer arithmetic
min              mp(3X)            multiple precision integer arithmetic
mincore          madvise(3)        advise the system of a process'
                                   expected paging
mkstemp          mktemp(3)         make a unique filename
mktemp           mktemp(3)         make a unique filename
mmap             mmap(3)           map file system object into virtual memory
modf             frexp(3)          split into mantissa and exponent
moncontrol       monitor(3)        prepare execution profile
monitor          monitor(3)        prepare execution profile
monstartup       monitor(3)        prepare execution profile
mout             mp(3X)            multiple precision integer arithmetic
move             mp(3X)            multiple precision integer arithmetic
move             plot(3X)          graphics interface
mprotect         mprotect(3)       assign protection to region mapped
                                   in virtual
mset             mset(3)           set and clear semaphores for processes
                                   mapped in virtual
msqrt            mp(3X)            multiple precision integer arithmetic
msub             mp(3X)            multiple precision integer arithmetic
msync            mmap(3)           map file system object into virtual memory
mult             mp(3X)            multiple precision integer arithmetic
munmap           mmap(3)           map file system object into virtual
                                   memory
nextkey          dbm(3X)           data base subroutines
nice             nice(3C)          set program priority
nlist            nlist(3)          get entries from name list
ntohl            byteorder(3N)     convert values between host and
                                   network byte
ntohs            byteorder(3N)     convert values between host and
                                   network byte
omin             mp(3X)            multiple precision integer arithmetic
omout            mp(3X)            multiple precision integer arithmetic
opendir          directory(3)      directory operations
openlog          syslog(3)         control system log
openpl           plot(3X)          graphics interface
pause            pause(3C)         stop until signal
pclose           popen(3)          initiate I/O to/from a process
perror           perror(3)         system error messages
plot             plot(3X)          graphics interface
point            plot(3X)          graphics interface
popen            popen(3)          initiate I/O to/from a process
pow              exp(3M)           exponential, logarithm, power
pow              mp(3X)            multiple precision integer arithmetic
printf           printf(3S)        formatted output conversion
psignal          psignal(3)        system signal messages
putc             putc(3S)          put character or word on a stream
putchar          putc(3S)          put character or word on a stream
puts             puts(3S)          put a string on a stream
putw             putc(3S)          put character or word on a stream
qsort            qsort(3)          quicker sort
rand             rand(3C)          random number generator
random           random(3)         better random number generator; routines
                                   for changing
rcmd             rcmd(3)           routines for returning a stream to a remote
                                   command
re_comp          regex(3)          regular expression handler
re_exec          regex(3)          regular expression handler
readdir          directory(3)      directory operations
realloc          malloc(3)         memory allocator
realloc          malloc.dbg(3)     memory allocator with debugging
                                   support
remque           insque(3)         insert/remove element from a queue
res_init         resolver(3)       resolver routines
res_mkquery      resolver(3)       resolver routines
res_send         resolver(3)       resolver routines
rewind           fseek(3S)         reposition a stream
rewinddir        directory(3)      directory operations
rexec            rexec(3)          return stream to a remote command
rindex           string(3)         string operations
rint             floor(3M)         absolute value, floor, ceiling, and
                                   round-to-nearest
rpow             mp(3X)            multiple precision integer arithmetic
rresvport        rcmd(3)           routines for returning a stream to
                                   a remote
ruserok          rcmd(3)           routines for returning a stream to
                                   a remote
scalb            ieee(3M)          copysign, remainder, exponent manipulations
scandir          scandir(3)        scan a directory
scanf            scanf(3S)         formatted input conversion
sdiv             mp(3X)            multiple precision integer arithmetic
seekdir          directory(3)      directory operations
setbuf           setbuf(3S)        assign buffering to a stream
setbuffer        setbuf(3S)        assign buffering to a stream
setegid          setuid(3)         set user and group ID
seteoid          setoid(3)         set organization ID
seteuid          setuid(3)         set user and group ID
setfsent         getfsent(3)       get file system descriptor file
                                   entry
setgid           setuid(3)         set user and group ID
setgrent         getgrent(3)       get group file entry
sethostent       gethostbyname(3N) get network host entry
setjmp           setjmp(3)         non-local goto
setkey           crypt(3)          generate hashing encryption
setlinebuf       setbuf(3S)        assign buffering to a stream
setlogmask       syslog(3)         control system log
setnetent        getnetent(3N)     get network entry
setoid           setoid(3)         set organization ID
setorgent        getorgent(3)      get organization file entry
setprotoent      getprotoent(3N)   get protocol entry
setpwent         getpwent(3)       get password file entry
setpwfile        getpwent(3)       get password file entry
setrgid          setuid(3)         set user and group ID
setroid          setoid(3)         set organization ID
setruid          setuid(3)         set user and group ID
setservent       getservent(3N)    get service entry
setstate         random(3)         better random number generator;
                                   routines for changing
setttyent        getttyent(3)      get ttys file entry
setuid           setuid(3)         set user and group ID
setusershell     getusershell(3)   get legal user shells
siginterrupt     siginterrupt(3)   allow signals to interrupt
                                   system
signal           signal(3C)        simplified software signal facilities
sin              sin(3M)           trigonometric functions and their inverses
sinh             sinh(3M)          hyperbolic functions
sleep            sleep(3)          suspend execution for interval
space            plot(3X)          graphics interface
sprintf          printf(3S)        formatted output conversion
sqrt             sqrt(3M)          cube root, square root
srand            rand(3C)          random number generator
srandom          random(3)         better random number generator; routines
                                   for changing
sscanf           scanf(3S)         formatted input conversion
stdio            stdio(3S)         standard buffered input/output package
store            dbm(3X)           data base subroutines
strcat           string(3)         string operations
strcmp           string(3)         string operations
strcpy           string(3)         string operations
strlen           string(3)         string operations
strncat          string(3)         string operations
strncmp          string(3)         string operations
strncpy          string(3)         string operations
stty             stty(3C)          set and get terminal state (defunct)
swab             swab(3)           swap bytes
sys_errlist      perror(3)         system error messages
sys_nerr         perror(3)         system error messages
sys_siglist      psignal(3)        system signal messages
syslog           syslog(3)         control system log
system           system(3)         issue a shell command
tan              sin(3M)           trigonometric functions and their inverses
tanh             sinh(3M)          hyperbolic functions
telldir          directory(3)      directory operations
tgetent          termcap(3X)       terminal independent operation
                                   routines
tgetflag         termcap(3X)       terminal independent operation
                                   routines
tgetnum          termcap(3X)       terminal independent operation
                                   routines
tgetstr          termcap(3X)       terminal independent operation
                                   routines
tgoto            termcap(3X)       terminal independent operation routines
time             time(3C)          get date and time
times            times(3C)         get process times
timezone         ctime(3)          convert date and time to ASCII
toascii          ctype(3)          character classification macros
tolower          ctype(3)          character classification macros
toupper          ctype(3)          character classification macros
tputs            termcap(3X)       terminal independent operation routines
ttyname          ttyname(3)        find name of a terminal
ttyslot          ttyname(3)        find name of a terminal
ualarm           ualarm(3)         schedule signal after specified time
ungetc           ungetc(3S)        push character back into input stream
usleep           usleep(3)         suspend execution for interval
utime            utime(3C)         set file times
valloc           valloc(3C)        aligned memory allocator
varargs          varargs(3)        variable argument list
vfprintf         vprintf(3S)       print formatted output of a varargs
                                   argument
vprintf          vprintf(3S)       print formatted output of a varargs
                                   argument
vsprintf         vprintf(3S)       print formatted output of a varargs
                                   argument
y0               j0(3M)            bessel functions
y1               j0(3M)            bessel functions
yn               j0(3M)            bessel functions

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026