INTRO(3) — SUBROUTINES
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) All functions callable from FORTRAN. These manual pages are reproduced in the FORTRAN manual. These functions perform the same jobs as the straight “3” functions do for C programmers. There are in fact three FORTRAN libraries, namely −lU77 which contains the system interface routines, −lI77 which is the I/O interface library, and −lF77 which is everything not contained in the other two. These libraries are searched automatically by the loader when loading FORTRAN programs.
(3M) The math library. C declarations for the types of functions may be obtained from the include file <math.h>. To use these functions with C programs use a −lm option with cc(1). They are automatically loaded as needed by the Fortran and Pascal compilers f77(1) and pc(1).
(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/libU77.aFORTRAN system interface (see section 3F)
/usr/lib/libI77.aFORTRAN I/O (see section 3F)
/usr/lib/libF77.aFORTRAN everything else (see section 3F)
/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 "
/usr/lib/libtermlib_p.a "
/usr/lib/libplot.aplot routines (see
plot(3X))
/usr/lib/lib300.a "
/usr/lib/lib300s.a "
/usr/lib/lib4014.a "
/usr/lib/lib450.a "
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
abortabort.3generate a fault
absabs.3integer absolute value
addmntentgetmntent.3get file system descriptor file entry
alarmalarm.3cschedule signal after specified time
alphasortscandir.3scan a directory
asctimectime.3convert date and time to ASCII
assertassert.3program verification
atofatof.3convert ASCII to numbers
atoiatof.3convert ASCII to numbers
atolatof.3convert ASCII to numbers
bcmpbstring.3bit and byte string operations
bcopybstring.3bit and byte string operations
bzerobstring.3bit and byte string operations
clearerrferror.3sstream status inquiries
closedirdirectory.3directory operations
closelogsyslog.3control system log
cryptcrypt.3DES encryption
ctimectime.3convert date and time to ASCII
dysizectime.3convert date and time to ASCII
ecvtecvt.3output conversion
edataend.3last locations in program
encryptcrypt.3DES encryption
endend.3last locations in program
endfsentgetfsent.3get file system descriptor file entry
endgrentgetgrent.3get group file entry
endhostentgethostent.3nget network host entry
endmntentgetmntent.3get file system descriptor file entry
endnetentgetnetent.3nget network entry
endprotoentgetprotoent.3nget protocol entry
endpwentgetpwent.3get password file entry
endserventgetservent.3nget service entry
environexecl.3execute a file
errnoperror.3system error messages
etextend.3last locations in program
execlexecl.3execute a file
execleexecl.3execute a file
execlpexecl.3execute a file
execvexecl.3execute a file
execvpexecl.3execute a file
exitexit.3terminate a process after performing cleanup
fclosefclose.3sclose or flush a stream
fcvtecvt.3output conversion
fdopenfopen.3sopen a stream
feofferror.3sstream status inquiries
ferrorferror.3sstream status inquiries
fflushfclose.3sclose or flush a stream
ffsbstring.3bit and byte string operations
fgetcgetc.3sget character or integer from stream
fgetsgets.3sget a string from a stream
filenoferror.3sstream status inquiries
fopenfopen.3sopen a stream
fprintfprintf.3sformatted output conversion
fputcputc.3sput character or word on a stream
fputsputs.3sput a string on a stream
freadfread.3sbuffered binary input/output
freopenfopen.3sopen a stream
frexpfrexp.3split into mantissa and exponent
fscanfscanf.3sformatted input conversion
fseekfseek.3sreposition a stream
ftellfseek.3sreposition a stream
ftimetime.3cget date and time
fwritefread.3sbuffered binary input/output
gcvtecvt.3output conversion
getcgetc.3sget character or integer from stream
getchargetc.3sget character or integer from stream
getdategetdate.3convert time and date from ASCII
getenvgetenv.3value for environment name
getfsentgetfsent.3get file system descriptor file entry
getfsfilegetfsent.3get file system descriptor file entry
getfsspecgetfsent.3get file system descriptor file entry
getfstypegetfsent.3get file system descriptor file entry
getgrentgetgrent.3get group file entry
getgrgidgetgrent.3get group file entry
getgrnamgetgrent.3get group file entry
gethostbyaddrgethostent.3nget network host entry
gethostbynamegethostent.3nget network host entry
gethostentgethostent.3nget network host entry
getlogingetlogin.3get login name
getmntentgetmntent.3get file system descriptor file entry
getnetbyaddrgetnetent.3nget network entry
getnetbynamegetnetent.3nget network entry
getnetentgetnetent.3nget network entry
getoptgetopt.3cget option letter from argv
getpassgetpass.3read a password
getprotobynamegetprotoent.3nget protocol entry
getprotobynumbergetprotoent.3nget protocol entry
getprotoentgetprotoent.3nget protocol entry
getpwgetpw.3get name from uid
getpwentgetpwent.3get password file entry
getpwnamgetpwent.3get password file entry
getpwuidgetpwent.3get password file entry
getsgets.3sget a string from a stream
getservbynamegetservent.3nget service entry
getservbyportgetservent.3nget service entry
getserventgetservent.3nget service entry
getwgetc.3sget character or integer from stream
getwdgetwd.3get current working directory pathname
gmtimectime.3convert date and time to ASCII
gttystty.3cset and get terminal state
hasmntoptgetmntent.3get file system descriptor file entry
htonlbyteorder.3nconvert values between host and network byte order
htonsbyteorder.3nconvert values between host and network byte order
indexstring.3string operations
inet_addrinet.3nInternet address manipulation
inet_lnaofinet.3nInternet address manipulation
inet_makeaddrinet.3nInternet address manipulation
inet_netofinet.3nInternet address manipulation
inet_networkinet.3nInternet address manipulation
inet_ntoainet.3nInternet address manipulation
initgroupsinitgroups.3initialize group access list
initstaterandom.3better random number generator; routines for changing generators
insqueinsque.3insert/remove element from a queue
isalnumctype.3character classification and conversion macros
isalphactype.3character classification and conversion macros
isasciictype.3character classification and conversion macros
isattyttyname.3find name of a terminal
iscntrlctype.3character classification and conversion macros
isdigitctype.3character classification and conversion macros
isgraphctype.3character classification and conversion macros
isinfisinf.3test for indeterminate floating point values
islowerctype.3character classification and conversion macros
isnanisinf.3test for indeterminate floating point values
isprintctype.3character classification and conversion macros
ispunctctype.3character classification and conversion macros
isspacectype.3character classification and conversion macros
isupperctype.3character classification and conversion macros
isxdigitctype.3character classification and conversion macros
ldexpfrexp.3split into mantissa and exponent
localtimectime.3convert date and time to ASCII
longjmpsetjmp.3non-local goto
mktempmktemp.3make a unique file name
modffrexp.3split into mantissa and exponent
moncontrolmonitor.3prepare execution profile
monitormonitor.3prepare execution profile
monstartupmonitor.3prepare execution profile
nicenice.3cset program priority
nlistnlist.3get entries from name list
ntohlbyteorder.3nconvert values between host and network byte order
ntohsbyteorder.3nconvert values between host and network byte order
on_exitonexit.3name termination handler
opendirdirectory.3directory operations
openlogsyslog.3control system log
optarggetopt.3cget option letter from argv
optindgetopt.3cget option letter from argv
pausepause.3cstop until signal
pclosepopen.3sinitiate I/O to/from a process
perrorperror.3system error messages
popenpopen.3sinitiate I/O to/from a process
printfprintf.3sformatted output conversion
psignalpsignal.3system signal messages
putcputc.3sput character or word on a stream
putcharputc.3sput character or word on a stream
putsputs.3sput a string on a stream
putwputc.3sput character or word on a stream
qsortqsort.3quicker sort
randrand.3crandom number generator
randomrandom.3better random number generator; routines for changing generators
rcmdrcmd.3nroutines for returning a stream to a remote command
re_compregex.3regular expression handler
re_execregex.3regular expression handler
readdirdirectory.3directory operations
remqueinsque.3insert/remove element from a queue
rewindfseek.3sreposition a stream
rewinddirdirectory.3directory operations
rexecrexec.3nreturn stream to a remote command
rindexstring.3string operations
rresvportrcmd.3nroutines for returning a stream to a remote command
ruserokrcmd.3nroutines for returning a stream to a remote command
scandirscandir.3scan a directory
scanfscanf.3sformatted input conversion
seekdirdirectory.3directory operations
setbufsetbuf.3sassign buffering to a stream
setbuffersetbuf.3sassign buffering to a stream
setegidsetuid.3set user and group ID
seteuidsetuid.3set user and group ID
setfsentgetfsent.3get file system descriptor file entry
setgidsetuid.3set user and group ID
setgrentgetgrent.3get group file entry
sethostentgethostent.3nget network host entry
setjmpsetjmp.3non-local goto
setkeycrypt.3DES encryption
setlinebufsetbuf.3sassign buffering to a stream
setmntentgetmntent.3get file system descriptor file entry
setnetentgetnetent.3nget network entry
setprotoentgetprotoent.3nget protocol entry
setpwentgetpwent.3get password file entry
setrgidsetuid.3set user and group ID
setruidsetuid.3set user and group ID
setserventgetservent.3nget service entry
setstaterandom.3better random number generator; routines for changing generators
setuidsetuid.3set user and group ID
signalsignal.3simplified software signal facilities
sleepsleep.3suspend execution for interval
sprintfprintf.3sformatted output conversion
srandrand.3crandom number generator
srandomrandom.3better random number generator; routines for changing generators
sscanfscanf.3sformatted input conversion
stdiointro.3sstandard buffered input/output package
strcatstring.3string operations
strcmpstring.3string operations
strcpystring.3string operations
strlenstring.3string operations
strncatstring.3string operations
strncmpstring.3string operations
strncpystring.3string operations
sttystty.3cset and get terminal state
swabswab.3swap bytes
sys_errlistperror.3system error messages
sys_nerrperror.3system error messages
sys_siglistpsignal.3system signal messages
syslogsyslog.3control system log
systemsystem.3issue a shell command
telldirdirectory.3directory operations
timetime.3cget date and time
timestimes.3cget process times
timezonectime.3convert date and time to ASCII
tmpnamtmpnam.3ccreate a name for a temporary file
toasciictype.3character classification and conversion macros
tolowerctype.3character classification and conversion macros
toupperctype.3character classification and conversion macros
ttynamettyname.3find name of a terminal
ttyslotttyname.3find name of a terminal
ulimitulimit.3cget and set user limits
ungetcungetc.3spush character back into input stream
utimeutime.3cset file times
vallocvalloc.3aligned memory allocator
varargsvarargs.3variable argument list
vlimitvlimit.3ccontrol maximum system resource consumption
vtimesvtimes.3cget information about resource utilization
Sun Release 2.0 — Last change: 15 May 1985