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 October 6, 2020 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 (-lbluetooth)" 56.It Em libbluetooth Pq Fl l Ns Ar bluetooth 57The bluetooth library. 58See 59.Xr bluetooth 3 . 60.It Em libc Pq Fl l Ns Ar c 61Standard C library functions. 62When using the C compiler 63.Xr cc 1 , 64it is not necessary 65to supply the loader flag 66.Fl l Ns Ar c 67for these functions. 68There are several `libraries' or groups of functions included inside of 69.Em libc : 70.Bl -tag -width "XXXXXX" 71.It standard I/O routines 72see 73.Xr stdio 3 74.It database routines 75see 76.Xr db 3 77.It bit operators 78see 79.Xr bitstring 3 80.It string operators 81see 82.Xr string 3 83.It character tests and character operators 84.It storage allocation 85see 86.Xr mpool 3 87.It regular-expressions 88see 89.Xr regex 3 90.It remote procedure calls (RPC) 91see 92.Xr rpc 3 93.It time functions 94see 95.Xr time 3 96.It signal handling 97see 98.Xr signal 3 99.El 100.It Em libcalendar Pq Fl l Ns Ar calendar 101The calendar arithmetic library. 102See 103.Xr calendar 3 . 104.It Em libcam Pq Fl l Ns Ar cam 105The common access method user library. 106See 107.Xr cam 3 . 108.It Em libcrypt Pq Fl l Ns Ar crypt 109The crypt library. 110See 111.Xr crypt 3 . 112.It Em libcurses Pq Fl l Ns Ar curses Fl l Ns Ar termcap 113Terminal independent screen management routines 114for two dimensional non-bitmap display terminals. 115See 116.Xr ncurses 3 . 117.It Em libcuse Pq Fl l Ns Ar cuse 118The userland character device library. 119See 120.Xr cuse 3 . 121.It Em libcompat Pq Fl l Ns Ar compat 122Functions which are obsolete but are available for compatibility with 123.Bx 4.3 . 124In particular, 125a number of system call interfaces provided in previous releases of 126.Bx 127have been included for source code compatibility. 128Use of these routines should, for the most part, be avoided. 129The manual page entry for each compatibility routine 130indicates the proper interface to use. 131.It Em libdevinfo Pq Fl l Ns Ar devinfo 132The Device and Resource Information Utility library. 133See 134.Xr devinfo 3 . 135.It Em libdevstat Pq Fl l Ns Ar devstat 136The Device Statistics library. 137See 138.Xr devstat 3 . 139.It Em libdwarf Pq Fl l Ns Ar dwarf 140The DWARF access library. 141See 142.Xr dwarf 3 . 143.It Em libelf Pq Fl l Ns Ar elf 144The ELF access library. 145See 146.Xr elf 3 . 147.It Em libfetch Pq Fl l Ns Ar fetch 148The file transfer library. 149See 150.Xr fetch 3 . 151.It Em libfigpar Pq Fl l Ns Ar figpar 152The configuration file parsing library. 153See 154.Xr figpar 3 . 155.It Em libgpio Pq Fl l Ns Ar gpio 156The general-purpose input output library (GPIO). 157See 158.Xr gpio 3 . 159.It Em libgssapi Pq Fl l Ns Ar gssapi 160The generic security service application programming 161interface. 162See 163.Xr gssapi 3 . 164.It Em libjail Pq Fl l Ns Ar jail 165The jail library. 166See 167.Xr jail 3 . 168.It Em libkvm Pq Fl l Ns Ar kvm 169Functions used to access kernel memory are in this library. 170They can be used 171against both a running system and a crash dump. 172See 173.Xr kvm 3 . 174.It Em libl Pq Fl l Ns Ar l 175The library for 176.Xr lex 1 . 177.It Em libm Pq Fl l Ns Ar m 178The math library. 179See 180.Xr math 3 . 181.It Em libmd Pq Fl l Ns Ar md 182The message digest library. 183See 184.Xr md4 3 , 185.Xr md5 3 , 186.Xr sha 3 , 187.Xr sha256 3 , 188.Xr sha512 3 , 189.Xr ripemd 3 , 190.Xr skein 3 . 191.It Em libmp Pq Fl l Ns Ar mp 192.It Em libpam Pq Fl l Ns Ar pam 193The pluggable authentication module library. 194See 195.Xr pam 3 . 196.It Em libpcap Pq Fl l Ns Ar pcap 197The packet capture library. 198See 199.Xr pcap 3 . 200.It Em libpmc Pq Fl l Ns Ar pmc 201The performance counters library. 202See 203.Xr pmc 3 . 204.It Em libpthread Pq Fl l Ns Ar pthread 205The POSIX threads library. 206See 207.Xr pthread 3 . 208.It Em libsysdecode Pq Fl l Ns Ar sysdecode 209The system argument decoding library. 210See 211.Xr sysdecode 3 . 212.It Em libtermcap Pq Fl l Ns Ar termcap 213The terminal independent operation library package. 214See 215.Xr termcap 3 . 216.It Em libusb Pq Fl l Ns Ar usb 217The USB access library. 218See 219.Xr usb 3 . 220.It Em libvgl Pq Fl l Ns Ar vgl 221The video graphics library. 222See 223.Xr vgl 3 . 224.It Em liby Pq Fl l Ns Ar y 225The library for 226.Xr yacc 1 . 227.It Em libz Pq Fl l Ns Ar z 228The general-purpose data compression library. 229See 230.Xr zlib 3 . 231.El 232.Sh FILES 233.Bl -tag -width /usr/lib/libm_p.a -compact 234.It Pa /usr/lib/libc.a 235the C library 236.It Pa /usr/lib/libc_p.a 237the C library compiled for profiling 238.It Pa /usr/lib/libm.a 239the math library 240.It Pa /usr/lib/libm_p.a 241the math library compiled for profiling 242.El 243.Sh SEE ALSO 244.Xr cc 1 , 245.Xr ld 1 , 246.Xr nm 1 , 247.Xr intro 2 , 248.Xr math 3 , 249.Xr stdio 3 250.Sh HISTORY 251An 252.Nm 253manual appeared in 254.At v7 . 255