Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

intro(3C)

intro(3S)

intro(3F)

intro(3M)

intro(3N)

nm(1)

ld(1)

cc(1)

f77(1)

intro(2)

INTRO(3)  —  C LIBRARY FUNCTIONS

NAME

intro − introduction to library functions

DESCRIPTION

Section 3 describes library routines.  The main C library is /lib/libc.a, which contains all system call entry points described in section 2, as well as functions described in several subsections here. The primary functions are described in the main section 3. Functions associated with the “standard I/O library” used by many C programs are found in section 3S. The main C library also includes Internet network functions, described in section 3N, and routines providing compatibility with other UNIX systems, described in section 3C. 

Other sections are:

(3F) This section, for FORTRAN library routines and functions, is contained in the FORTRAN Programmer’s Guide.

(3M) The Math Library.  C declarations for the types of functions are be obtained from the include file <math.h>. To use these functions with C programs compile them with the −lm option with cc(1). They are automatically loaded as needed by the FORTRAN and Pascal compilers f77(1) and pc(1).

(3V) The System V Compatibility Library.  System V versions of functions that are not yet merged into the standard Sun libraries.  To use these functions, compile programs with /usr/5bin/cc , instead of /bin/cc. 

(3X) Various specialized libraries have not been given distinctive captions.  Files in which such libraries are found are named on appropriate pages if they don’t appear in the libc library. 

FILES

/lib/libc.aC Library ((2), (3), (3N) and (3C) routines)
/usr/lib/libc_p.aProfiling C library (for
gprof(1))
/usr/lib/libm.aMath Library −lm (see section 3M)
/usr/lib/libm_p.aProfiling version of −lm
/usr/lib/libcurses.ascreen management routines (see
curses(3X)
/usr/lib/libdbm.adata base management routines (see
dbm(3X))
/usr/lib/libmp.amultiple precision math library (see
mp(3X))
/usr/lib/libtermcap.aterminal handling routines (see
termcap(3X))
/usr/lib/libtermcap_p.a  "
/usr/lib/libtermlib(link to /usr/lib/libtermcap.a)
/usr/lib/libtermlib_p.a(link to /usr/lib/libtermcap_p.a)
/usr/lib/libplot∗.aplot routines (see
plot(3X))
/usr/lib/libresolv.aInternet name server routines (see
resolver(3X))

SEE ALSO

intro(3C), intro(3S), intro(3F), intro(3M), intro(3N), nm(1), ld(1), cc(1), f77(1), intro(2)

DIAGNOSTICS

Functions in the math library (section 3M) may return conventional values when the function is undefined for the given arguments or when the value is not representable.  In these cases the external variable errno (see intro(2)) is set to the value EDOM (domain error) or ERANGE (range error). The values of EDOM and ERANGE are defined in the include file <errno.h>.

LIST OF FUNCTIONS

NameAppears on PageDescription
 a64la64l(3)convert base-64 ASCII to long
abortabort(3)generate a fault
absabs(3)integer absolute value
acossin(3M)trigonometric functions
acoshasinh(3M)inverse hyperbolic function
addmntentgetmntent(3)get file system descriptor file entry
alarmalarm(3C)schedule signal after specified time
allocamalloc(3)memory allocator
alphasortscandir(3)scan a directory
asctimectime(3)convert date and time to ASCII
asinsin(3M)trigonometric functions
asinhasinh(3M)inverse hyperbolic function
assertassert(3)program verification
atansin(3M)trigonometric functions
atanhasinh(3M)inverse hyperbolic function
atofatof(3)convert ASCII to numbers
atoiatof(3)convert ASCII to numbers
atolatof(3)convert ASCII to numbers
bcmpbstring(3)bit and byte string operations
bcopybstring(3)bit and byte string operations
bsearchbsearch(3)binary search a sorted table
bzerobstring(3)bit and byte string operations
cabshypot(3M)Euclidean distance
callocmalloc(3)memory allocator
cbc_cryptdes_crypt(3)fast DES encryption
cbrtsqrt(3M)cube root
ceilfloor(3M)ceiling
cfreemalloc(3)memory allocator
clearerrferror(3S)stream status inquiries
clockclock(3C)report CPU time used
closedirdirectory(3)directory operations
closelogsyslog(3)control system log
copysignieee(3M)copysign remainder exponent manipulations
cossin(3M)trigonometric functions
coshsinh(3M)hyperbolic functions
cryptcrypt(3)DES encryption
ctermidctermid(3S)generate filename for terminal
ctimectime(3)convert date and time to ASCII
cuseridcuserid(3S)get character login name of user
des_cryptdes_crypt(3)fast DES encryption
des_setparitydes_crypt(3)fast DES encryption
dn_compresolver(3X) Internet name server routines
dn_expandresolver(3X)Internet name server routines
drand48drand48(3)generate uniformly distributed pseudo-random numbers
dremieee(3M)copysign remainder exponent manipulations
dysizectime(3)convert date and time to ASCII
ecb_cryptdes_crypt(3)fast DES encryption
ecvtecvt(3)output conversion
edataend(3)last locations in program
encryptcrypt(3)DES encryption
endend(3)last locations in program
endfsentgetfsent(3)get file system descriptor file entry
endgrentgetgrent(3)get group file entry
endhostentgethostent(3N)get network host entry
endmntentgetmntent(3)get file system descriptor file entry
endnetentgetnetent(3N)get network entry
endnetgrentgetnetgrent(3N)get network group entry
endprotoentgetprotoent(3N)get protocol entry
endpwentgetpwent(3)get password file entry
endserventgetservent(3N)get service entry
environexecl(3)execute a file
erand48drand48(3)generate uniformly distributed pseudo-random numbers
erferf(3M)error functions
errnoperror(3)system error messages
etextend(3)last locations in program
etherether(3R)monitor traffic on the Ethernet
ether_atonethers(3N)Ethernet address mapping
ether_hosttonethers(3N)Ethernet address mapping
ether_line(3N)ethersEthernet address mapping
ether_ntoaethers(3N)Ethernet address mapping
ether_ntohostethers(3N)Ethernet address mapping
execlexecl(3)execute a file
execleexecl(3)execute a file
execlpexecl(3)execute a file
execvexecl(3)execute a file
execvpexecl(3)execute a file
exitexit(3)terminate a process after performing cleanup
expexp(3M)exponential function
fabsfloor(3M)absolute value
fclosefclose(3S)close or flush a stream
fcvtecvt(3)output conversion
fdopenfopen(3S)open a stream
feofferror(3S)stream status inquiries
ferrorferror(3S)stream status inquiries
fflushfclose(3S)close or flush a stream
ffsbstring(3)bit and byte string operations
fgetcgetc(3S)get character or integer from stream
fgetsgets(3S)get a string from a stream
filenoferror(3S)stream status inquiries
finiteieee(3M)copysign remainder exponent manipulations
floorfloor(3M)floor function
fopenfopen(3S)open a stream
fprintfprintf(3S)formatted output conversion
fputcputc(3S)put character or word on a stream
fputsputs(3S)put a string on a stream
freadfread(3S)buffered binary input/output
freemalloc(3)memory allocator
freopenfopen(3S)open a stream
frexpfrexp(3)split into mantissa and exponent
fscanfscanf(3S)formatted input conversion
fseekfseek(3S)reposition a stream
ftellfseek(3S)reposition a stream
ftimetime(3C)get date and time
ftokftok(3)standard interprocess communication package
ftwftw(3)walk a file tree
fwritefread(3S)buffered binary input/output
gcvtecvt(3)output conversion
getcgetc(3S)get character or integer from stream
getchargetc(3S)get character or integer from stream
getcwdgetcwd(3)get pathname of current working directory
getenvgetenv(3)value for environment name
getfsentgetfsent(3)get file system descriptor file entry
getfsfilegetfsent(3)get file system descriptor file entry
getfsspecgetfsent(3)get file system descriptor file entry
getfstypegetfsent(3)get file system descriptor file entry
getgrentgetgrent(3)get group file entry
getgrgidgetgrent(3)get group file entry
getgrnamgetgrent(3)get group file entry
gethostbyaddrgethostent(3N)get network host entry
gethostbynamegethostent(3N)get network host entry
gethostentgethostent(3N)get network host entry
getlogingetlogin(3)get login name
getmntentgetmntent(3)get file system descriptor file entry
getnetbyaddrgetnetent(3N)get network entry
getnetbynamegetnetent(3N)get network entry
getnetentgetnetent(3N)get network entry
getnetgrentgetnetgrent(3N)get network group entry
getoptgetopt(3)get option letter from argv
getpassgetpass(3)read a password
getprotobynamegetprotoent(3N)get protocol entry
getprotobynumbergetprotoent(3N)get protocol entry
getprotoentgetprotoent(3N)get protocol entry
getpwgetpw(3)get name from uid
getpwentgetpwent(3)get password file entry
getpwnamgetpwent(3)get password file entry
getpwuidgetpwent(3)get password file entry
getrpcbynamegetrpcent(3N)get RPC entry
getrpcbynumbergetrpcent(3N)get RPC entry
getrpcentgetrpcent(3N)get RPC entry
getrpcportgetrpcport(3R)get RPC port number
getsgets(3S)get a string from a stream
getservbynamegetservent(3N)get service entry
getservbyportgetservent(3N)get service entry
getserventgetservent(3N)get service entry
getwgetc(3S)get character or integer from stream
getwdgetwd(3)get current working directory pathname
gmtimectime(3)convert date and time to ASCII
gsignalsignal(3)software signals
gttystty(3C)set and get terminal state
hasmntoptgetmntent(3)get file system descriptor file entry
havediskrstat(3R)get remote host performance data
hcreatehsearch(3)manage hash search tables
hdestroyhsearch(3)manage hash search tables
hsearchhsearch(3)manage hash search tables
htonlbyteorder(3N)convert values between host and network byte order
htonsbyteorder(3N)convert values between host and network byte order
hypothypot(3M)Euclidean distance
ieeeieee(3M)copysign remainder exponent manipulations
indexstring(3)string operations
inet_addrinet(3N)Internet address manipulation
inet_lnaofinet(3N)Internet address manipulation
inet_makeaddrinet(3N)Internet address manipulation
inet_netofinet(3N)Internet address manipulation
inet_networkinet(3N)Internet address manipulation
inet_ntoainet(3N)Internet address manipulation
initgroupsinitgroups(3)initialize group access list
initstaterandom(3)better random number generator
innetgrgetnetgrent(3N)get network group entry
insqueinsque(3)insert/remove element from a queue
isalnumctype(3)character classification and conversion macros
isalphactype(3)character classification and conversion macros
isasciictype(3)character classification and conversion macros
isattyttyname(3)find name of a terminal
iscntrlctype(3)character classification and conversion macros
isdigitctype(3)character classification and conversion macros
isgraphctype(3)character classification and conversion macros
isinfisinf(3)test for indeterminate floating point values
islowerctype(3)character classification and conversion macros
isnanisinf(3)test for indeterminate floating point values
isprintctype(3)character classification and conversion macros
ispunctctype(3)character classification and conversion macros
isspacectype(3)character classification and conversion macros
isupperctype(3)character classification and conversion macros
isxdigitctype(3)character classification and conversion macros
j0j0(3M)Bessel functions
j1j0(3M)Bessel functions
jnj0(3M)Bessel functions
jrand48drand48(3)generate uniformly distributed pseudo-random numbers
l64aa64l(3)convert long to base-64 ASCII
lcong48drand48(3)generate uniformly distributed pseudo-random numbers
ldexpfrexp(3)split into mantissa and exponent
lfind lsearch(3)linear search and update
lgammalgamma(3M)log gamma function
localtimectime(3)convert date and time to ASCII
lockflockf(3)advisory record locking on files
logexp(3M)exponential functions
log10exp(3M)exponential functions
logbieee(3M)copysign remainder exponent manipulations
longjmpsetjmp(3)non-local goto
lrand48drand48(3)generate uniformly distributed pseudo-random numbers
lsearchlsearch(3)linear search and update
mallocmalloc(3)memory allocator
malloc_debugmalloc(3)memory allocator
malloc_verifymalloc(3)memory allocator
matherr matherr(3M)math library error-handling function
memalignmalloc(3)memory allocator
memccpymemory(3)memory operations
memchrmemory(3)memory operations
memcmpmemory(3)memory operations
memcpymemory(3)memory operations
memset memory(3)memory operations
mkstempmktemp(3)make a unique file name
mktempmktemp(3)make a unique file name
modffrexp(3)split into mantissa and exponent
moncontrolmonitor(3)prepare execution profile
monitormonitor(3)prepare execution profile
monstartupmonitor(3)prepare execution profile
mrand48drand48(3)generate uniformly distributed pseudo-random numbers
nicenice(3C)set program priority
nlistnlist(3)get entries from name list
nrand48drand48(3)generate uniformly distributed pseudo-random numbers
ntohlbyteorder(3N)convert values between host and network byte order
ntohsbyteorder(3N)convert values between host and network byte order
on_exitonexit(3)name termination handler
opendirdirectory(3)directory operations
openlogsyslog(3)control system log
optarggetopt(3)get option letter from argv
optindgetopt(3)get option letter from argv
pausepause(3C)stop until signal
pclosepopen(3S)initiate I/O to/from a process
perrorperror(3)system error messages
popenpopen(3S)initiate I/O to/from a process
powexp(3M)exponential functions
printfprintf(3S)formatted output conversion
profprof(3)profile within a function
psignalpsignal(3)system signal messages
putcputc(3S)put character or word on a stream
putcharputc(3S)put character or word on a stream
putenv utenv(3)change or add value to environment
putpwentputpwent(3)write password file entry
putsputs(3S)put a string on a stream
putwputc(3S)put character or word on a stream
qsortqsort(3)quicker sort
randrand(3C)random number generator
randomrandom(3)better random number generator
rcmdrcmd(3N)routines for returning a stream to a remote command
re_compregex(3)regular expression handler
re_execregex(3)regular expression handler
readdirdirectory(3)directory operations
reallocmalloc(3)memory allocator
regexpregexp(3)regular expression compile and match routines
remqueinsque(3)insert/remove element from a queue
res_initresolver(3X)Internet name server routines
res_mkqueryresolver(3)Internet name server routines
res_sendresolver(3)Internet name server routines
rewindfseek(3S)reposition a stream
rewinddirdirectory(3)directory operations
rexrex(3R)remote execution protocol
rexecrexec(3N)return stream to a remote command
rindexstring(3)string operations
rintfloor(3M)round to nearest integer
rnusersrnusers(3R)return info about users on remote hosts
rquotarquota(3R)implement quotas on remote hosts
rresvportrcmd(3N)routines for returning a stream to a remote command
rstatrstat(3R)get remote host performance data
ruserokrcmd(3N)routines for returning a stream to a remote command
rusersrnusers(3R)return info about users on remote hosts
rwallrwall(3R)write to remote host
scalbieee(3M)copysign remainder exponent manipulations
scandirscandir(3)scan a directory
scanfscanf(3S)formatted input conversion
seed48drand48(3)generate uniformly distributed pseudo-random numbers
seekdirdirectory(3)directory operations
setbufsetbuf(3S)assign buffering to a stream
setbuffersetbuf(3S)assign buffering to a stream
setegidsetuid(3)set user and group ID
seteuidsetuid(3)set user and group ID
setfsentgetfsent(3)get file system descriptor file entry
setgidsetuid(3)set user and group ID
setgrentgetgrent(3)get group file entry
sethostentgethostent(3N)get network host entry
setjmpsetjmp(3)non-local goto
setkeycrypt(3)DES encryption
setlinebufsetbuf(3S)assign buffering to a stream
setlinebufsetbuf(3S)assign buffering to a stream
setmntentgetmntent(3)get file system descriptor file entry
setnetentgetnetent(3N)get network entry
setnetgrentgetnetgrent(3N)get network group entry
setprotoentgetprotoent(3N)get protocol entry
setpwentgetpwent(3)get password file entry
setrgidsetuid(3)set user and group ID
setruidsetuid(3)set user and group ID
setserventgetservent(3N)get service entry
setstaterandom(3)better random number generator
setuidsetuid(3)set user and group ID
setvbufsetbuf(3S)assign buffering to a stream
siginterruptsiginterrupt(3)allow signals to interrupt system calls
signalsignal(3)simplified software signal facilities
sinsin(3M)trigonometric functions
sinhsinh(3M)hyperbolic functions
sleepsleep(3)suspend execution for interval
sprayspray(3R)scatter packets to check network
sprintfprintf(3S)formatted output conversion
sqrtsqrt(3M)square root
srandrand(3C)random number generator
srand48drand48(3)generate uniformly distributed pseudo-random numbers
srandomrandom(3)better random number generator
sscanfscanf(3S)formatted input conversion
ssignalssignal(3)software signals
stdiointro(3S)standard buffered input/output package
strcatstring(3)string operations
strcmpstring(3)string operations
strcpystring(3)string operations
strlenstring(3)string operations
strncatstring(3)string operations
strncmpstring(3)string operations
strncpystring(3)string operations
strtodstrtod(3)convert string to double-precision number
strtolstrtol(3)convert string to integer
sttystty(3C)set and get terminal state
swabswab(3)swap bytes
sys_errlistperror(3)system error messages
sys_nerrperror(3)system error messages
sys_siglistpsignal(3)system signal messages
syslogsyslog(3)control system log
systemsystem(3)issue a shell command
tansin(3M)trigonometric functions
tanhsinh(3M)hyperbolic functions
tdeletetsearch(3)manage binary search trees
telldirdirectory(3)directory operations
tfindtsearch(3)manage binary search trees
timetime(3C)get date and time
timestimes(3C)get process times
timezonectime(3)convert date and time to ASCII
tmpfiletmpfile(3S)create a temporary file
tmpnamtmpnam(3S)create a name for a temporary file
toasciictype(3)character classification and conversion macros
tolowerctype(3)character classification and conversion macros
toupperctype(3)character classification and conversion macros
tsearchtsearch(3)manage binary search trees
ttynamettyname(3)find name of a terminal
ttyslotttyname(3)find name of a terminal
twalktsearch(3)manage binary search trees
ualarmualarm(3)schedule signal after microsecond interval
ulimitulimit(3C)get and set user limits
ungetcungetc(3S)push character back into input stream
usleepusleep(3S)suspend execution for micorsecond interval
utimeutime(3C)set file times
vallocvalloc(3)aligned memory allocator
valuesvalues(3)machine-dependent values
varargsvarargs(3)variable argument list
vfprintfvprintf(3S)print formatted output of a varargs argument list
vlimitvlimit(3C)control maximum system resource consumption
vprintfvprintf(3S)print formatted output of a varargs argument list
vsprintfvprintf(3S)print formatted output of a varargs argument list
vtimesvtimes(3C)get information about resource utilization
y0j0(3M)Bessel functions
y1j0(3M)Bessel functions
ynj0(3M)Bessel functions
yp_allypclnt(3N)YP client interface routines
yp_bindypclnt(3N)YP client interface routines
yp_firstypclnt(3N)YP client interface routines
yp_get_default_domainypclnt(3N)YP client interface routines
yp_masterypclnt(3N)YP client interface routines
yp_matchypclnt(3N)YP client interface routines
yp_nextypclnt(3N)YP client interface routines
yp_orderypclnt(3N)YP client interface routines
yp_unbindypclnt(3N)YP client interface routines
ypclntypclnt(3N)YP client interface routines
yperr_stringypclnt(3N)YP client interface routines
yppasswdyppasswd(3R)update user YP password
ypprot_errypclnt(3N)YP client interface routines
 

Sun Release 3.2  —  Last change: 11 June 1986

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