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