NAME
libc - standard C library functions

SYNOPSIS
cc [ flags ] files [ libraries -lc ]

DESCRIPTION
The standard C library, libc, is comprised of the functions
invoking UNIX system primitives (described in section 2), and
numerous functions supporting buffered file I/O, directory
management, byte and string operations, network access, process
control, and more (described in section 3). libc 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.

FILES
/usr/lib/libc.a -lc

SEE ALSO
stdio(3), intro(2), intro(3), cc(1), ld(1), nm(1)

LIST OF FUNCTIONS
Functions marked with a * 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.

Name Appears on Page Description

abort abort(3) generate a fault
abs abs(3) integer absolute value
addmntent getnetent(3) get file system descriptor file
entry
alarm* alarm(3) schedule signal after specified
time
alloca malloc(3) memory allocator
alphasort scandir(3) scan a directory
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
bzero bstring(3) bit and byte string operations
calloc malloc(3) memory allocator
clearerr ferror(3) stream status inquiries
closedir directory(3) directory operations
closelog syslog(3) control system log
crypt crypt(3) DES encryption
ctime ctime(3) convert date and time to ASCII
dn_comp resolver(3) resolver routines
dn_expand resolver(3) resolver routines
edata end(3) last locations in program
encrypt crypt(3) DES 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(3) get network host entry
endmntent getnetent(3) get file system descriptor file
entry
endnetent getnetent(3) get network entry
endprotoent getprotoent(3) get protocol entry
endpwent getpwent(3) get password file entry
endservent getservent(3) get service entry
endttyent getttyent(3) get ttys file entry
endusershell getusershell(3) get legal user shells
environ execl(3) execute a file
etext end(3) last locations in program
execl execl(3) execute a file
execle execl(3) execute a file
execlp execl(3) execute a file
execv execl(3) execute a file
execvp execl(3) execute a file
exit exit(3) terminate a process after flushing
any pending output
fclose fclose(3) close or flush a stream
fdopen fopen(3) open a stream
feof ferror(3) stream status inquiries
ferror ferror(3) stream status inquiries
fflush fclose(3) close or flush a stream
ffs bstring(3) bit and byte string operations
fgetc getc(3) get character or word from stream
fgets gets(3) get a string from a stream
fileno ferror(3) stream status inquiries
fopen fopen(3) open a stream
fprintf printf(3) formatted output conversion
fputc putc(3) put character or word on a stream
fputs puts(3) put a string on a stream
fread fread(3) buffered binary input/output
free malloc(3) memory allocator
frexp frexp(3) split into mantissa and exponent
fscanf scanf(3) formatted input conversion
fseek fseek(3) reposition a stream
ftell fseek(3) reposition a stream
ftime* time(3) get date and time
fwrite fread(3) buffered binary input/output
getc getc(3) get character or word from stream
getchar getc(3) 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(3) get network host entry
gethostbyname gethostbyname(3) get network host entry
gethostent gethostbyname(3) get network host entry
getlogin getlogin(3) get login name
getmntent getnetent(3) get file system descriptor file
entry
getnetbyaddr getnetent(3) get network entry
getnetbyname getnetent(3) get network entry
getnetent getnetent(3) get network entry
getpass getpass(3) read a password
getprotobyname getprotoent(3) get protocol entry
getprotobynumber getprotoent(3) get protocol entry
getprotoent getprotoent(3) get protocol entry
getpw getpw(3) 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(3) get a string from a stream
getservbyname getservent(3) get service entry
getservbyport getservent(3) get service entry
getservent getservent(3) 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(3) 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(3) set and get terminal state
(defunct)
hasmntopt getnetent(3) get file system descriptor file
entry
herror gethostbyname(3) get network host entry
htonl byteorder(3) convert values between host and
network byte order
htons byteorder(3) convert values between host and
network byte order
index string(3) string operations
inet_addr inet(3) Internet address manipulation
routines
inet_lnaof inet(3) Internet address manipulation
routines
inet_makeaddr inet(3) Internet address manipulation
routines
inet_netof inet(3) Internet address manipulation
routines
inet_network inet(3) Internet address manipulation
routines
inet_ntoa inet(3) Internet address manipulation
routines
initgroups initgroups(3) initialize group access list
initstate random(3) better random number generator
insque insque(3) insert/remove element from a queue
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
localtime ctime(3) convert date and time to ASCII
longjmp setjmp(3) non-local goto
malloc malloc(3) memory allocator
mkstemp mktemp(3) make a unique file name
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
nice* nice(3) set program priority
nlist nlist(3) get entries from name list
ntohl byteorder(3) convert values between host and
network byte order
ntohs byteorder(3) convert values between host and
network byte order
opendir directory(3) directory operations
openlog syslog(3) control system log
pause* pause(3) stop until signal
pclose popen(3) initiate I/O to/from a process
perror perror(3) system error messages
popen popen(3) initiate I/O to/from a process
printf printf(3) formatted output conversion
psignal psignal(3) system signal messages
putc putc(3) put character or word on a stream
putchar putc(3) put character or word on a stream
puts puts(3) put a string on a stream
putw putc(3) put character or word on a stream
qsort qsort(3) quicker sort
rand* rand(3) 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
regcomp regexp(3) regular expression handler
regerror regexp(3) regular expression handler
regexec regexp(3) regular expression handler
regsub regexp(3) regular expression handler
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(3) reposition a stream
rewinddir directory(3) directory operations
rexec rexec(3) return stream to a remote command
rindex string(3) string operations
rresvport rcmd(3) routines for returning a stream to
a remote command
ruserok rcmd(3) routines for returning a stream to
a remote command
scandir scandir(3) scan a directory
scanf scanf(3) formatted input conversion
seekdir directory(3) directory operations
setbuf setbuf(3) assign buffering to a stream
setbuffer setbuf(3) assign buffering to a stream
setegid setuid(3) set user and group ID
setenv getenv(3) value for environment name
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
setgrfile getgrent(3) get group file entry
sethostent gethostbyname(3) get network host entry
setjmp setjmp(3) non-local goto
setkey crypt(3) DES encryption
setlinebuf setbuf(3) assign buffering to a stream
setlogmask syslog(3) control system log
getmntent getnetent(3) get file system descriptor file
entry
setnetent getnetent(3) get network entry
setprotoent getprotoent(3) 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
setruid setuid(3) set user and group ID
setservent getservent(3) get service entry
setstate random(3) better random number generator
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 calls
signal signal(3) simplified software signal
facilities
sleep sleep(3) suspend execution for interval
sprintf printf(3) formatted output conversion
srand rand(3) random number generator
srandom random(3) better random number generator
sscanf scanf(3) formatted input conversion
stdio stdio(3) standard buffered input/output
package
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(3) 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
telldir directory(3) directory operations
time* time(3) get date and time
times* times(3) 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
ttyname ttyname(3) find name of a terminal
ttyslot ttyname(3) find name of a terminal
tzset ttyname(3) find name of a terminal
ualarm ualarm(3) schedule signal after specified
time
ungetc ungetc(3) push character back into input
stream
unsetenv getenv(3) value for environment name
usleep usleep(3) suspend execution for interval
utime* utime(3) set file times
valloc valloc(3) aligned memory allocator
varargs varargs(3) variable argument list
vlimit* vlimit(3) control maximum system resource
consumption
vtimes* vtimes(3) get information about resource
utilization