1INTRO(3) Library Functions Manual INTRO(3)
2
3
4
6 intro - introduction to C library functions
7
9 This section describes functions that may be found in various
10 libraries. The library functions are those other than the functions
11 which directly invoke UNIX system primitives, described in section 2.
12 Most of these functions are accessible from the C library, libc, which
13 is automatically loaded by the C compiler cc(1), and the Pascal com‐
14 piler pc(1). The link editor ld(1) searches this library under the
15 `-lc' option. The C library also includes all the functions described
16 in section 2.
17
18 A subset of these functions are available from Fortran; they are
19 described separately in intro(3F).
20
21 The functions described in this section are grouped into various sec‐
22 tions:
23
24 (3) The straight ``3'' functions are the standard C library func‐
25 tions.
26
27 (3N) These functions constitute the internet network library.
28
29 (3S) These functions constitute the `standard I/O package', see
30 stdio(3S) for more details. Declarations for these functions
31 may be obtained from the include file <stdio.h>.
32
33 (3C) These routines are included for compatibility with other sys‐
34 tems. In particular, a number of system call interfaces pro‐
35 vided in previous releases of 4BSD have been included for source
36 code compatibility. Use of these routines should, for the most
37 part, be avoided. The manual page entry for each compatibility
38 routine indicates the proper interface to use.
39
40 (3M) These functions constitute the math library, libm. When func‐
41 tions in the math library (see math(3M)) are passed values that
42 are undefined or would generate answers that are out of range,
43 they call the infnan routine. By default this routine returns
44 the VAX reserved floating point value which causes the process
45 to get a floating point exception (see sigvec(2)). Programs
46 that wish to take other action should define their own version
47 of infnan (see infnan(3M) for details). The math library is
48 loaded as needed by the Pascal compiler pc(1). C programs that
49 wish to use this library need to specify the ``-lm'' option.
50
51 (3X) These functions constitute minor libraries and other miscella‐
52 neous run-time facilities. Most are available only when pro‐
53 gramming in C. These functions include libraries that provide
54 device independent plotting functions, terminal independent
55 screen management routines for two dimensional non-bitmap dis‐
56 play terminals, and functions for managing data bases with
57 inverted indexes. These functions are located in separate
58 libraries indicated in each manual entry.
59
61 /lib/libc.a the C library
62 /usr/lib/libm.a the math library
63 /usr/lib/libc_p.a the C library compiled for profiling
64 /usr/lib/libm_p.a the math library compiled for profiling
65
67 stdio(3S), math(3M), intro(2), cc(1), ld(1), nm(1)
68
70 Name Appears on Page Description
71 abort abort.3 generate a fault
72 abs abs.3 integer absolute value
73 acos sin.3m inverse trigonometric function
74 acosh asinh.3m inverse hyperbolic function
75 alarm alarm.3c schedule signal after specified time
76 alloca malloc.3 memory allocator
77 arc plot.3x graphics interface
78 asctime ctime.3 convert date and time to ASCII
79 asin sin.3m inverse trigonometric function
80 asinh asinh.3m inverse hyperbolic function
81 assert assert.3x program verification
82 atan sin.3m inverse trigonometric function
83 atanh asinh.3m inverse hyperbolic function
84 atan2 sin.3m inverse trigonometric function
85 atof atof.3 convert ASCII to numbers
86 atoi atof.3 convert ASCII to numbers
87 atol atof.3 convert ASCII to numbers
88 bcmp bstring.3 bit and byte string operations
89 bcopy bstring.3 bit and byte string operations
90 bzero bstring.3 bit and byte string operations
91 cabs hypot.3m complex absolute value
92 calloc malloc.3 memory allocator
93 cbrt sqrt.3m cube root
94 ceil floor.3m integer no less than
95 circle plot.3x graphics interface
96 clearerr ferror.3s stream status inquiries
97 closedir directory.3 directory operations
98 closelog syslog.3 control system log
99 closepl plot.3x graphics interface
100 cont plot.3x graphics interface
101 copysign ieee.3m copy sign bit
102 cos sin.3m trigonometric function
103 cosh sinh.3m hyperbolic function
104 crypt crypt.3 DES encryption
105 ctime ctime.3 convert date and time to ASCII
106 curses curses.3x screen functions with ``optimal'' cursor motion
107 dbminit dbm.3x data base subroutines
108 delete dbm.3x data base subroutines
109 drem ieee.3m remainder
110 ecvt ecvt.3 output conversion
111 edata end.3 last locations in program
112 encrypt crypt.3 DES encryption
113 end end.3 last locations in program
114 endfsent getfsent.3x get file system descriptor file entry
115 endgrent getgrent.3 get group file entry
116 endhostent gethostbyname.3n get network host entry
117 endnetent getnetent.3n get network entry
118 endprotoent getprotoent.3n get protocol entry
119 endpwent getpwent.3 get password file entry
120 endservent getservent.3n get service entry
121 environ execl.3 execute a file
122 erase plot.3x graphics interface
123 erf erf.3m error function
124 erfc erf.3m complementary error function
125 etext end.3 last locations in program
126 exec execl.3 execute a file
127 exece execl.3 execute a file
128 execl execl.3 execute a file
129 execle execl.3 execute a file
130 execlp execl.3 execute a file
131 exect execl.3 execute a file
132 execv execl.3 execute a file
133 execvp execl.3 execute a file
134 exit exit.3 terminate a process after flushing any pending output
135 exp exp.3m exponential
136 expm1 exp.3m exp(x)-1
137 fabs floor.3m absolute value
138 fclose fclose.3s close or flush a stream
139 fcvt ecvt.3 output conversion
140 feof ferror.3s stream status inquiries
141 ferror ferror.3s stream status inquiries
142 fetch dbm.3x data base subroutines
143 fflush fclose.3s close or flush a stream
144 ffs bstring.3 bit and byte string operations
145 fgetc getc.3s get character or word from stream
146 fgets gets.3s get a string from a stream
147 fileno ferror.3s stream status inquiries
148 firstkey dbm.3x data base subroutines
149 floor floor.3m integer no greater than
150 fopen fopen.3s open a stream
151 fprintf printf.3s formatted output conversion
152 fputc putc.3s put character or word on a stream
153 fputs puts.3s put a string on a stream
154 fread fread.3s buffered binary input/output
155 free malloc.3 memory allocator
156 frexp frexp.3 split into mantissa and exponent
157 fscanf scanf.3s formatted input conversion
158 fseek fseek.3s reposition a stream
159 ftell fseek.3s reposition a stream
160 ftime time.3c get date and time
161 fwrite fread.3s buffered binary input/output
162 gcvt ecvt.3 output conversion
163 getc getc.3s get character or word from stream
164 getchar getc.3s get character or word from stream
165 getdiskbyname getdisk.3x get disk description by its name
166 getenv getenv.3 value for environment name
167 getfsent getfsent.3x get file system descriptor file entry
168 getfsfile getfsent.3x get file system descriptor file entry
169 getfsspec getfsent.3x get file system descriptor file entry
170 getfstype getfsent.3x get file system descriptor file entry
171 getgrent getgrent.3 get group file entry
172 getgrgid getgrent.3 get group file entry
173 getgrnam getgrent.3 get group file entry
174 gethostbyaddr gethostbyname.3n get network host entry
175 gethostbyname gethostbyname.3n get network host entry
176 gethostent gethostbyname.3n get network host entry
177 getlogin getlogin.3 get login name
178 getnetbyaddr getnetent.3n get network entry
179 getnetbyname getnetent.3n get network entry
180 getnetent getnetent.3n get network entry
181 getpass getpass.3 read a password
182 getprotobyname getprotoent.3n get protocol entry
183 getprotobynumber getprotoent.3n get protocol entry
184 getprotoent getprotoent.3n get protocol entry
185 getpw getpw.3 get name from uid
186 getpwent getpwent.3 get password file entry
187 getpwnam getpwent.3 get password file entry
188 getpwuid getpwent.3 get password file entry
189 gets gets.3s get a string from a stream
190 getservbyname getservent.3n get service entry
191 getservbyport getservent.3n get service entry
192 getservent getservent.3n get service entry
193 getw getc.3s get character or word from stream
194 getwd getwd.3 get current working directory pathname
195 gmtime ctime.3 convert date and time to ASCII
196 gtty stty.3c set and get terminal state (defunct)
197 htonl byteorder.3n convert values between host and network byte order
198 htons byteorder.3n convert values between host and network byte order
199 hypot hypot.3m Euclidean distance
200 index string.3 string operations
201 inet_addr inet.3n Internet address manipulation routines
202 inet_lnaof inet.3n Internet address manipulation routines
203 inet_makeaddr inet.3n Internet address manipulation routines
204 inet_netof inet.3n Internet address manipulation routines
205 inet_network inet.3n Internet address manipulation routines
206 infnan infnan.3m signals exceptions
207 initgroups initgroups.3x initialize group access list
208 initstate random.3 better random number generator
209 insque insque.3 insert/remove element from a queue
210 isalnum ctype.3 character classification macros
211 isalpha ctype.3 character classification macros
212 isascii ctype.3 character classification macros
213 isatty ttyname.3 find name of a terminal
214 iscntrl ctype.3 character classification macros
215 isdigit ctype.3 character classification macros
216 islower ctype.3 character classification macros
217 isprint ctype.3 character classification macros
218 ispunct ctype.3 character classification macros
219 isspace ctype.3 character classification macros
220 isupper ctype.3 character classification macros
221 j0 j0.3m bessel function
222 j1 j0.3m bessel function
223 jn j0.3m bessel function
224 label plot.3x graphics interface
225 ldexp frexp.3 split into mantissa and exponent
226 lgamma lgamma.3m log gamma function; (formerly gamma.3m)
227 lib2648 lib2648.3x subroutines for the HP 2648 graphics terminal
228 line plot.3x graphics interface
229 linemod plot.3x graphics interface
230 localtime ctime.3 convert date and time to ASCII
231 log exp.3m natural logarithm
232 logb ieee.3m exponent extraction
233 log10 exp.3m logarithm to base 10
234 log1p exp.3m log(1+x)
235 longjmp setjmp.3 non-local goto
236 malloc malloc.3 memory allocator
237 mktemp mktemp.3 make a unique file name
238 modf frexp.3 split into mantissa and exponent
239 moncontrol monitor.3 prepare execution profile
240 monitor monitor.3 prepare execution profile
241 monstartup monitor.3 prepare execution profile
242 move plot.3x graphics interface
243 nextkey dbm.3x data base subroutines
244 nice nice.3c set program priority
245 nlist nlist.3 get entries from name list
246 ntohl byteorder.3n convert values between host and network byte order
247 ntohs byteorder.3n convert values between host and network byte order
248 opendir directory.3 directory operations
249 openlog syslog.3 control system log
250 openpl plot.3x graphics interface
251 pause pause.3c stop until signal
252 pclose popen.3 initiate I/O to/from a process
253 perror perror.3 system error messages
254 point plot.3x graphics interface
255 popen popen.3 initiate I/O to/from a process
256 pow exp.3m exponential x**y
257 printf printf.3s formatted output conversion
258 psignal psignal.3 system signal messages
259 putc putc.3s put character or word on a stream
260 putchar putc.3s put character or word on a stream
261 puts puts.3s put a string on a stream
262 putw putc.3s put character or word on a stream
263 qsort qsort.3 quicker sort
264 rand rand.3c random number generator
265 random random.3 better random number generator
266 rcmd rcmd.3x routines for returning a stream to a remote command
267 re_comp regex.3 regular expression handler
268 re_exec regex.3 regular expression handler
269 readdir directory.3 directory operations
270 realloc malloc.3 memory allocator
271 remque insque.3 insert/remove element from a queue
272 rewind fseek.3s reposition a stream
273 rewinddir directory.3 directory operations
274 rexec rexec.3x return stream to a remote command
275 rindex string.3 string operations
276 rint floor.3m round to nearest integer
277 rresvport rcmd.3x routines for returning a stream to a remote command
278 ruserok rcmd.3x routines for returning a stream to a remote command
279 scalb ieee.3m exponent adjustment
280 scandir scandir.3 scan a directory
281 scanf scanf.3s formatted input conversion
282 seekdir directory.3 directory operations
283 setbuf setbuf.3s assign buffering to a stream
284 setbuffer setbuf.3s assign buffering to a stream
285 setegid setuid.3 set user and group ID
286 seteuid setuid.3 set user and group ID
287 setfsent getfsent.3x get file system descriptor file entry
288 setgid setuid.3 set user and group ID
289 setgrent getgrent.3 get group file entry
290 sethostent gethostbyname.3n get network host entry
291 setjmp setjmp.3 non-local goto
292 setkey crypt.3 DES encryption
293 setlinebuf setbuf.3s assign buffering to a stream
294 setnetent getnetent.3n get network entry
295 setprotoent getprotoent.3n get protocol entry
296 setpwent getpwent.3 get password file entry
297 setrgid setuid.3 set user and group ID
298 setruid setuid.3 set user and group ID
299 setservent getservent.3n get service entry
300 setstate random.3 better random number generator
301 setuid setuid.3 set user and group ID
302 signal signal.3 simplified software signal facilities
303 sin sin.3m trigonometric function
304 sinh sinh.3m hyperbolic function
305 sleep sleep.3 suspend execution for interval
306 space plot.3x graphics interface
307 sprintf printf.3s formatted output conversion
308 sqrt sqrt.3m square root
309 srand rand.3c random number generator
310 srandom random.3 better random number generator
311 sscanf scanf.3s formatted input conversion
312 stdio intro.3s standard buffered input/output package
313 store dbm.3x data base subroutines
314 strcat string.3 string operations
315 strcmp string.3 string operations
316 strcpy string.3 string operations
317 strlen string.3 string operations
318 strncat string.3 string operations
319 strncmp string.3 string operations
320 strncpy string.3 string operations
321 stty stty.3c set and get terminal state (defunct)
322 swab swab.3 swap bytes
323 sys_errlist perror.3 system error messages
324 sys_nerr perror.3 system error messages
325 sys_siglist psignal.3 system signal messages
326 syslog syslog.3 control system log
327 system system.3 issue a shell command
328 tan sin.3m trigonometric function
329 tanh sinh.3m hyperbolic function
330 telldir directory.3 directory operations
331 tgetent termcap.3x terminal independent operation routines
332 tgetflag termcap.3x terminal independent operation routines
333 tgetnum termcap.3x terminal independent operation routines
334 tgetstr termcap.3x terminal independent operation routines
335 tgoto termcap.3x terminal independent operation routines
336 time time.3c get date and time
337 times times.3c get process times
338 timezone ctime.3 convert date and time to ASCII
339 tputs termcap.3x terminal independent operation routines
340 ttyname ttyname.3 find name of a terminal
341 ttyslot ttyname.3 find name of a terminal
342 ungetc ungetc.3s push character back into input stream
343 utime utime.3c set file times
344 valloc valloc.3 aligned memory allocator
345 varargs varargs.3 variable argument list
346 vlimit vlimit.3c control maximum system resource consumption
347 vtimes vtimes.3c get information about resource utilization
348 y0 j0.3m bessel function
349 y1 j0.3m bessel function
350 yn j0.3m bessel function
351
352
353
3544th Berkeley Distribution May 27, 1986 INTRO(3)