xref: /freebsd/share/man/man3/intro.3 (revision adf376485712c8fffbf3be330d505a969647f479)
1.\" Copyright (c) 1980, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"     @(#)intro.3	8.1 (Berkeley) 6/5/93
29.\" $FreeBSD$
30.\"
31.Dd December 18, 2021
32.Dt INTRO 3
33.Os
34.Sh NAME
35.Nm intro
36.Nd introduction to the C libraries
37.Sh SYNOPSIS
38.Nm cc
39.Op Ar flags
40.Ar
41.Op Fl llibrary
42.Sh DESCRIPTION
43This section provides an overview of the C
44library functions, their error returns and other
45common definitions and concepts.
46Most of these functions are available from the C library,
47.Em libc .
48Other libraries, such as the math library,
49.Em libm ,
50must be indicated at compile time with the
51.Fl l
52option of the compiler.
53.Pp
54The various libraries (followed by the loader flag):
55.Bl -tag -width "libbluetooth"
56.It Em libbluetooth
57.Pq Fl l Ns Ar bluetooth
58The bluetooth library.
59See
60.Xr bluetooth 3 .
61.It Em libc
62.Pq Fl l Ns Ar c
63Standard C library functions.
64When using the C compiler
65.Xr cc 1 ,
66it is not necessary
67to supply the loader flag
68.Fl l Ns Ar c
69for these functions.
70There are several `libraries' or groups of functions included inside of
71.Em libc :
72.Bl -tag -width "XXXXXX"
73.It standard I/O routines
74see
75.Xr stdio 3
76.It database routines
77see
78.Xr db 3
79.It bit operators
80see
81.Xr bitstring 3
82.It string operators
83see
84.Xr string 3
85.It character tests and character operators
86.It storage allocation
87see
88.Xr mpool 3
89.It regular-expressions
90see
91.Xr regex 3
92.It remote procedure calls (RPC)
93see
94.Xr rpc 3
95.It time functions
96see
97.Xr time 3
98.It signal handling
99see
100.Xr signal 3
101.El
102.It Em libcalendar
103.Pq Fl l Ns Ar calendar
104The calendar arithmetic library.
105See
106.Xr calendar 3 .
107.It Em libcam
108.Pq Fl l Ns Ar cam
109The common access method user library.
110See
111.Xr cam 3 .
112.It Em libcrypt
113.Pq Fl l Ns Ar crypt
114The crypt library.
115See
116.Xr crypt 3 .
117.It Em libcurses
118.Pq Fl l Ns Ar curses Fl l Ns Ar termcap
119Terminal independent screen management routines
120for two dimensional non-bitmap display terminals.
121See
122.Xr ncurses 3 .
123.It Em libcuse
124.Pq Fl l Ns Ar cuse
125The userland character device library.
126See
127.Xr cuse 3 .
128.It Em libcompat
129.Pq Fl l Ns Ar compat
130Functions which are obsolete but are available for compatibility with
131.Bx 4.3 .
132In particular,
133a number of system call interfaces provided in previous releases of
134.Bx
135have been included for source code compatibility.
136Use of these routines should, for the most part, be avoided.
137The manual page entry for each compatibility routine
138indicates the proper interface to use.
139.It Em libdevinfo
140.Pq Fl l Ns Ar devinfo
141The Device and Resource Information Utility library.
142See
143.Xr devinfo 3 .
144.It Em libdevstat
145.Pq Fl l Ns Ar devstat
146The Device Statistics library.
147See
148.Xr devstat 3 .
149.It Em libdwarf
150.Pq Fl l Ns Ar dwarf
151The DWARF access library.
152See
153.Xr dwarf 3 .
154.It Em libelf
155.Pq Fl l Ns Ar elf
156The ELF access library.
157See
158.Xr elf 3 .
159.It Em libfetch
160.Pq Fl l Ns Ar fetch
161The file transfer library.
162See
163.Xr fetch 3 .
164.It Em libfigpar
165.Pq Fl l Ns Ar figpar
166The configuration file parsing library.
167See
168.Xr figpar 3 .
169.It Em libgpio
170.Pq Fl l Ns Ar gpio
171The general-purpose input output library (GPIO).
172See
173.Xr gpio 3 .
174.It Em libgssapi
175.Pq Fl l Ns Ar gssapi
176The generic security service application programming
177interface.
178See
179.Xr gssapi 3 .
180.It Em libjail
181.Pq Fl l Ns Ar jail
182The jail library.
183See
184.Xr jail 3 .
185.It Em libkvm
186.Pq Fl l Ns Ar kvm
187Functions used to access kernel memory are in this library.
188They can be used
189against both a running system and a crash dump.
190See
191.Xr kvm 3 .
192.It Em libl
193.Pq Fl l Ns Ar l
194The library for
195.Xr lex 1 .
196.It Em libm
197.Pq Fl l Ns Ar m
198The math library.
199See
200.Xr math 3 .
201.It Em libmd
202.Pq Fl l Ns Ar md
203The message digest library.
204See
205.Xr md4 3 ,
206.Xr md5 3 ,
207.Xr sha 3 ,
208.Xr sha256 3 ,
209.Xr sha512 3 ,
210.Xr ripemd 3 ,
211.Xr skein 3 .
212.It Em libmp
213.Pq Fl l Ns Ar mp
214.It Em libpam
215.Pq Fl l Ns Ar pam
216The pluggable authentication module library.
217See
218.Xr pam 3 .
219.It Em libpcap
220.Pq Fl l Ns Ar pcap
221The packet capture library.
222See
223.Xr pcap 3 .
224.It Em libpmc
225.Pq Fl l Ns Ar pmc
226The performance counters library.
227See
228.Xr pmc 3 .
229.It Em libpthread
230.Pq Fl l Ns Ar pthread
231The POSIX threads library.
232See
233.Xr pthread 3 .
234.It Em libsysdecode
235.Pq Fl l Ns Ar sysdecode
236The system argument decoding library.
237See
238.Xr sysdecode 3 .
239.It Em libtermcap
240.Pq Fl l Ns Ar termcap
241The terminal independent operation library package.
242See
243.Xr termcap 3 .
244.It Em libusb
245.Pq Fl l Ns Ar usb
246The USB access library.
247See
248.Xr usb 3 .
249.It Em libvgl
250.Pq Fl l Ns Ar vgl
251The video graphics library.
252See
253.Xr vgl 3 .
254.It Em liby
255.Pq Fl l Ns Ar y
256The library for
257.Xr yacc 1 .
258.It Em libz
259.Pq Fl l Ns Ar z
260The general-purpose data compression library.
261See
262.Xr zlib 3 .
263.El
264.Sh FILES
265.Bl -tag -width /usr/lib/libm_p.a -compact
266.It Pa /usr/lib/libc.a
267the C library
268.It Pa /usr/lib/libc_p.a
269the C library compiled for profiling
270.It Pa /usr/lib/libm.a
271the math library
272.It Pa /usr/lib/libm_p.a
273the math library compiled for profiling
274.El
275.Sh SEE ALSO
276.Xr cc 1 ,
277.Xr ld 1 ,
278.Xr nm 1 ,
279.Xr intro 2 ,
280.Xr math 3 ,
281.Xr stdio 3
282.Sh HISTORY
283An
284.Nm
285manual appeared in
286.At v7 .
287