INTRO(3-BSD) RISC/os Reference Manual INTRO(3-BSD)
NAME
intro - introduction to C library functions
DESCRIPTION
This section describes functions that may be found in vari-
ous libraries. The library functions are those other than
the functions which directly invoke UNIX system primitives,
described in section (2).
Functions that are available for both -systype sysv and
-systype bsd43 are also included here and in volume II of
this book, without the designation (-SYSV) or (-BSD) follow-
ing the section number and letter.
Most of these functions are accessible from the C library,
libc, which is automatically loaded by the C compiler cc(1),
and the Pascal compiler pc(1). The link editor ld(1)
searches this library under the `-lc' option. The C library
also includes all the functions described in section 2.
A subset of these functions are available from Fortran; they
are described separately in intro(3F-SysV).
Section 3R, the RPC service library functions, are described
separately in intro(3R).
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 `standard I/O package';
see stdio(3S) for more details. Declarations for these
functions may 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 of 4BSD 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.
(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
Printed 1/15/91 Page 1
INTRO(3-BSD) RISC/os Reference Manual INTRO(3-BSD)
functions, terminal independent screen management rou-
tines 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
/usr/lib/libc.a the C library
/usr/lib/libm.a the math library
SEE ALSO
intro(2), intro(3-SysV), intro(3R), stdio(3S), math(3M-
SysV), math(5-SysV).
cc(1), ld(1), nm(1) in the User's Reference Manual.
LIST OF FUNCTIONS
Name Appears on Page Description
_fbss end(3) first locations in program
_fdata end(3) first locations in program
_ftext end(3) first locations in program
_procedure_string_table end(3) runtime procedure table
_procedure_table end(3) runtime procedure table
_procedure_table_size end(3) runtime procedure table
abort abort(3) generate a fault
abs abs(3) integer absolute value
addexportent exportent(3) get exported file system information
addmntent getmntent(3) get file system descriptor file entry
alarm alarm(3C) schedule signal after specified time
alloca malloc(3) memory allocator
alphasort scandir(3) scan a directory
arc plot(3X) graphics interface
asctime ctime(3) convert date and time to ASCII
assert assert(3) program verification
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
bindresvport bindresvport(3N) bind a socket to a privileged IP port
bzero bstring(3) bit and byte string operations
calloc malloc(3) memory allocator
cbc_crypt des_crypt(3) fast DES encryption
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
crypt crypt(3) DES 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
Page 2 Printed 1/15/91
INTRO(3-BSD) RISC/os Reference Manual INTRO(3-BSD)
dbm_error ndbm(3) data base subroutines
dbm_nextkey ndbm(3) data base subroutines
dbminit dbm(3X) data base subroutines
delete dbm(3X) data base subroutines
des_crypt des_crypt(3) fast DES encryption
des_setparity des_crypt(3) fast DES encryption
dn_comp resolver(3) resolver routines
dn_expand resolver(3) resolver routines
ecb_crypt des_crypt(3) fast DES encryption
ecvt ecvt(3) output conversion
edata end(3) last locations in program
emulate_branch emulate_branch(3) MIPS branch emulation
encrypt crypt(3) DES encryption
end end(3) last locations in program
endexportent exportent(3) get exported file system information
endfsent getfsent(3) get file system descriptor file entry
endgrent getgrent(3) get group file entry
endhostent gethostbyname(3N) get network host entry
endmntent getmntent(3) get file system descriptor file entry
endnetent getnetent(3N) get network entry
endnetgrent getnetgrent(3N) get network group 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
eprol end(3) first locations in program
erase plot(3X) graphics interface
etext end(3) last locations in program
ether_aton ethers(3N) Ethernet address mapping operations
ether_hostton ethers(3N) Ethernet address mapping operations
ether_line ethers(3N) Ethernet address mapping operations
ether_ntoa ethers(3N) Ethernet address mapping operations
ether_ntohost ethers(3N) Ethernet address mapping operations
ethers ethers(3N) Ethernet address mapping operations
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 output
exportent exportent(3) get exported file system information
fclose fclose(3S) close 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
Printed 1/15/91 Page 3
INTRO(3-BSD) RISC/os Reference Manual INTRO(3-BSD)
fflush fclose(3S) 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
firstkey dbm(3X) data base subroutines
fmin mp(3X) multiple precision integer arithmetic
fmout mp(3X) multiple precision integer arithmetic
fopen fopen(3S) open a stream
fp_class fp_class(3) classes of IEEE floating-point values
fpc fpc(3) floating-point control registers
fpi fpi(3) floating-point interrupt analysis
fprintf printf(3S) formatted output conversion
fputc putc(3S) put character on a stream
fputs puts(3S) put a string on a stream
fread fread(3S) buffered binary input
free malloc(3) memory allocator
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 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
getdiskbyname getdiskbyname(3) get disk description by its name
getenv getenv(3) manipulate environmental variables
getexportent exportent(3) get exported file system information
getexportopt exportent(3) get exported file system information
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
getmntent getmntent(3) get file system descriptor file entry
getnetbyaddr getnetent(3N) get network entry
getnetbyname getnetent(3N) get network entry
getnetent getnetent(3N) get network entry
getnetgrent getnetgrent(3N) get network group 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
Page 4 Printed 1/15/91
INTRO(3-BSD) RISC/os Reference Manual INTRO(3-BSD)
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
getrpcbyname getrpcent(3N) get RPC entry
getrpcbynumber getrpcent(3N) get RPC entry
getrpcent getrpcent(3N) get RPC 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) get terminal state
handle_unaligned_traps unaligned(3) gather statistics on unaligned references
hasmntopt getmntent(3) get file system descriptor file entry
htonl byteorder(3N) convert values between host and network byte order
htons byteorder(3N) convert values between host and network byte order
index string(3) string operations
inet_addr inet(3N) Internet address manipulation
inet_lnaof inet(3N) Internet address manipulation
inet_makeaddr inet(3N) Internet address manipulation
inet_netof inet(3N) Internet address manipulation
inet_network inet(3N) Internet address manipulation
inet_ntoa inet(3N) Internet address manipulation
initgroups initgroups(3) initialize group access list
initstate random(3) routines for changing generators
innetgr getnetgrent(3N) get network group entry
insque insque(3) insert element from a queue
intro intro(3) introduction to C library functions
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
label plot(3X) graphics interface
ldexp frexp(3) split into mantissa and exponent
lib2648 lib2648(3X) subroutines for the HP 2648 graphics terminal
Printed 1/15/91 Page 5
INTRO(3-BSD) RISC/os Reference Manual INTRO(3-BSD)
line plot(3X) graphics interface
linemod plot(3X) graphics interface
localtime ctime(3) convert date and time to ASCII
lockf lockf(3) advisory record locking on files
m_in mp(3X) multiple precision integer arithmetic
m_out mp(3X) multiple precision integer arithmetic
madd mp(3X) multiple precision integer arithmetic
malloc malloc(3) memory allocator
mcmp mp(3X) multiple precision integer arithmetic
mdiv mp(3X) multiple precision integer arithmetic
memccpy memory(3) memory operation
memchr memory(3) memory operation
memcmp memory(3) memory operation
memcpy memory(3) memory operation
memset memory(3) memory operation
min mp(3X) multiple precision integer arithmetic
mktemp mktemp(3) make a unique file name
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
msqrt mp(3X) multiple precision integer arithmetic
msub mp(3X) multiple precision integer arithmetic
mult mp(3X) multiple precision integer arithmetic
nextkey dbm(3X) data base subroutines
nice nice(3C) set program priority
ns_addr ns(3N) Xerox NS(tm) address conversion routines
ns_ntoa ns(3N) Xerox NS(tm) address conversion routines
ntohl byteorder(3N) convert values between host and network byte order
ntohs byteorder(3N) convert values between host and network byte order
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 from a process
perror perror(3) system error messages
point plot(3X) graphics interface
popen popen(3) initiate I/O to a process
pow mp(3X) multiple precision integer arithmetic
print_unaligned_summary unaligned(3) gather statistics on unaligned references
printf printf(3S) formatted output conversion
psignal psignal(3) system signal messages
putc putc(3S) put character on a stream
putchar putc(3S) put character on a stream
puts puts(3S) put a string on a stream
putw putc(3S) put word on a stream
qsort qsort(3) quicker sort
Page 6 Printed 1/15/91
INTRO(3-BSD) RISC/os Reference Manual INTRO(3-BSD)
rand rand(3C) random number generator
random random(3) better random number generator
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
realpath realpath(3) returns the real file name
remexportent exportent(3) get exported file system information
remque insque(3) 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
rpc rpc(3N) library routines for remote procedure calls
rpow mp(3X) multiple precision integer arithmetic
rresvport rcmd(3) routines for returning a stream to a remote command
rtime rtime(3N) get remote time
ruserok rcmd(3) routines for returning a stream to a remote command
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 group ID
setenv getenv(3) manipulate environmental variables
seteuid setuid(3) set user ID
setexportent exportent(3) get exported file system information
setfsent getfsent(3) get file system descriptor file entry
setgid setuid(3) set group ID
setgrent getgrent(3) get group file entry
setgrfile getgrent(3) get group file entry
sethostent gethostbyname(3N) get network host entry
setkey crypt(3) DES encryption
setlinebuf setbuf(3S) assign buffering to a stream
setlogmask syslog(3) control system log
setmntent getmntent(3) get file system descriptor file entry
setnetent getnetent(3N) get network entry
setnetgrent getnetgrent(3N) get network group 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 group ID
setruid setuid(3) set user ID
setservent getservent(3N) get service entry
setstate random(3) routines for changing generators
setttyent getttyent(3) get ttys file entry
setuid setuid(3) set user ID
Printed 1/15/91 Page 7
INTRO(3-BSD) RISC/os Reference Manual INTRO(3-BSD)
setusershell getusershell(3) get legal user shells
siginterrupt siginterrupt(3) allow signals to interrupt system calls
signal signal(3C) simplified software signal facilities
sleep sleep(3) suspend execution for interval
space plot(3X) graphics interface
sprintf printf(3S) formatted output conversion
srand rand(3C) random number generator
srandom random(3) better random number generator
sscanf scanf(3S) formatted input conversion
stdio stdio(3S) standard buffered input/output package
store dbm(3X) data base subroutines
stprint stprint(3) routines to print the symbol table
strcasecmp string(3) string operations
strcat string(3) string operations
strchr string(3) string operations
strcmp string(3) string operations
strcpy string(3) string operations
strcspn string(3) string operations
strlen string(3) string operations
strncasecmp string(3) string operations
strncat string(3) string operations
strncmp string(3) string operations
strncpy string(3) string operations
strpbrk string(3) string operations
strrchr string(3) string operations
strspn string(3) string operations
strtok string(3) string operations
stty stty(3C) set terminal state
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
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
timezone timezone(3) supply timezone string
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
tzset ctime(3) convert date and time to ASCII
ualarm ualarm(3) schedule signal after specified time
Page 8 Printed 1/15/91
INTRO(3-BSD) RISC/os Reference Manual INTRO(3-BSD)
ungetc ungetc(3S) push character back into input stream
unsetenv getenv(3) manipulate environmental variables
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
vlimit vlimit(3C) control maximum system resource consumption
vtimes vtimes(3C) get information about resource utilization
xdr xdr(3N) library routines for external data representation
yp_all ypclnt(3Y) Network Information Service client interface
yp_bind ypclnt(3Y) Network Information Service client interface
yp_first ypclnt(3Y) Network Information Service client interface
yp_get_default_domain ypclnt(3Y) Network Information Service client interface
yp_master ypclnt(3Y) Network Information Service client interface
yp_match ypclnt(3Y) Network Information Service client interface
yp_next ypclnt(3Y) Network Information Service client interface
yp_order ypclnt(3Y) Network Information Service client interface
yp_unbind ypclnt(3Y) Network Information Service client interface
ypclnt ypclnt(3Y) Network Information Service client interface
yperr_string ypclnt(3Y) Network Information Service client interface
ypprot_err ypclnt(3Y) Network Information Service client interface
Printed 1/15/91 Page 9