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