1 '\" te
2 .\" Copyright 2017 Peter Tribble
3 .\" Copyright 2015 Joyent, Inc.
4 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
5 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
6 .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
7 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
8 .TH INTRO 3 "Nov 26, 2017"
9 .SH NAME
10 Intro, intro \- introduction to functions and libraries
11 .SH DESCRIPTION
12 .LP
13 This section describes functions found in various Solaris libraries, other than
14 those functions described in Section 2 of this manual that directly invoke UNIX
15 system primitives. Function declarations can be obtained from the
16 \fB#include\fR files indicated on each page. Pages are grouped by library and
17 are identified by the library name (or an abbreviation of the library name)
18 after the section number. Collections of related libraries are grouped into
19 volumes as described below. The first volume contains pages describing the
20 contents of each shared library and each header used by the functions, macros,
21 and external variables described in the remaining volumes.
22 .SS "Library Interfaces and Headers"
23 .LP
24 This volume describes the contents of each shared library and each header used
25 by functions, macros, and external variables described in the remaining
26 volumes.
27 .sp
28 .ne 2
29 .na
30 \fB(3LIB)\fR
31 .ad
32 .sp .6
33 .RS 4n
34 The libraries described in this section are implemented as shared objects.
35 .sp
36 Descriptions of shared objects can include a definition of the global symbols
37 that define the shared objects' public interface, for example \fBSUNW_1.1\fR.
38 Other interfaces can exist within the shared object, for example
39 \fBSUNWprivate.1.1\fR. The public interface provides a stable, committed set of
40 symbols for application development. The private interfaces are for internal
41 use only, and could change at any time.
42 .RE
43
44 .sp
45 .ne 2
46 .na
47 \fB(3HEAD)\fR
48 .ad
49 .sp .6
50 .RS 4n
51 The headers described in this section are used by functions, macros, and
52 external variables. Headers contain function prototypes, definitions of
53 symbolic constants, common structures, preprocessor macros, and defined types.
54 Each function described in the remaining five volumes specifies the headers
55 that an application must include in order to use that function. In most cases
56 only one header is required. These headers are present on an application
57 development system; they do have to be present on the target execution system.
58 .RE
59
60 .SS "Basic Library Functions"
61 .LP
62 The functions described in this volume are the core C library functions that
63 are basic to application development.
64 .sp
65 .ne 2
66 .na
67 \fB(3C)\fR
68 .ad
69 .sp .6
70 .RS 4n
71 These functions, together with those of Section 2, constitute the standard C
72 library, \fBlibc\fR, which is automatically linked by the C compilation system.
73 The standard C library is implemented as a shared object, \fBlibc.so\fR. See
74 \fBlibc\fR(3LIB) and the "C Compilation System" chapter of the \fIANSI C
75 Programmer's Guide\fR for a discussion. Some functions behave differently in
76 standard-conforming environments. This behavior is noted on the individual
77 manual pages. See \fBstandards\fR(5).
78 .sp
79 The \fBlibpthread\fR and \fBlibthread\fR libraries are filter libraries on
80 \fBlibc\fR that are used for building multithreaded applications:
81 \fBlibpthread\fR implements the POSIX (see \fBstandards\fR(5)) threads
82 interface, whereas \fBlibthread\fR implements the Solaris threads interface.
83 See \fBMULTITHREADED APPLICATIONS\fR, below.
84 .RE
85
86 .sp
87 .ne 2
88 .na
89 \fB(3C_DB)\fR
90 .ad
91 .sp .6
92 .RS 4n
93 These functions constitute the threads debugging library, \fBlibc_db\fR. This
94 library is implemented as a shared object, \fBlibc_db.so\fR, but is not
95 automatically linked by the C compilation system. Specify \fB-lc_db\fR on the
96 \fBcc\fR command line to link with this library. See \fBlibc_db\fR(3LIB).
97 .RE
98
99 .sp
100 .ne 2
101 .na
102 \fB(3MALLOC)\fR
103 .ad
104 .sp .6
105 .RS 4n
106 These functions constitute the various memory allocation libraries:
107 \fBlibmalloc\fR, \fBlibbsdmalloc\fR, \fBlibmapmalloc\fR, \fBlibmtmalloc\fR, and
108 \fBlibumem\fR. Each of these libraries is implemented as a shared object
109 (\fBlibmalloc.so\fR, \fBlibbsdmalloc.so\fR, \fBlibmapmalloc.so\fR,
110 \fBlibmtmalloc.so\fR, and \fBlibumem.so\fR). These libraries are not
111 automatically linked by the C compilation system. Specify \fB-lmalloc\fR,
112 \fB-lbsdmalloc\fR, \fB-lmapmalloc\fR, \fB-lmtmalloc\fR, and \fB-lumem\fR to
113 link with, respectively, \fBlibmalloc\fR, \fBlibbsdmalloc\fR,
114 \fBlibmapmalloc\fR, \fBlibmtmalloc\fR, and \fBlibumem\fR. See
115 \fBlibmalloc\fR(3LIB), \fBlibbsdmalloc\fR(3LIB), \fBlibmapmalloc\fR(3LIB),
116 \fBlibmtmalloc\fR(3LIB), and \fBlibumem\fR(3LIB).
117 .RE
118
119 .SS "Networking Library Functions"
120 .LP
121 The functions described in this volume comprise the various networking
122 libraries.
123 .sp
124 .ne 2
125 .na
126 \fB(3COMMPUTIL)\fR
127 .ad
128 .sp .6
129 .RS 4n
130 These functions constitute the communication protocol parser utilities library,
131 \fBlibcommputil\fR. This library is implemented as a shared object,
132 \fBlibcommputil.so\fR, but it is not automatically linked by the C compilation
133 system. Specify \fB-lcommputil\fR on the \fBcc\fR command line to link with
134 this library. See \fBlibcommputil\fR(3LIB).
135 .RE
136
137 .sp
138 .ne 2
139 .na
140 \fB(3DLPI)\fR
141 .ad
142 .sp .6
143 .RS 4n
144 These functions constitute the data link provider interface library,
145 \fBlibdlpi\fR. This library is implemented as a shared object,
146 \fBlibdlpi.so\fR, but it is not automatically linked by the C compilation
147 system. Specify \fB-ldlpi\fR on the \fBcc\fR command line to link with this
148 library. See \fBlibdlpi\fR(3LIB).
149 .RE
150
151 .sp
152 .ne 2
153 .na
154 \fB(3DNS_SD)\fR
155 .ad
156 .sp .6
157 .RS 4n
158 These functions constitute the DNS service discovery library, \fBlibdns_sd\fR.
159 This library is implemented as a shared object, \fBlibdns_sd.so\fR, but it is
160 not automatically linked by the C compilation system. Specify \fB-ldns_sd\fR on
161 the \fBcc\fR command line to link with this library. See \fBlibdns_sd\fR(3LIB).
162 .RE
163
164 .sp
165 .ne 2
166 .na
167 \fB(3GSS)\fR
168 .ad
169 .sp .6
170 .RS 4n
171 These functions constitute the generic security services library. This library
172 is implemented as a shared object, \fBlibgss.so\fR, but it is not automatically
173 linked by the C compilation system. Specify \fB-lgss\fR on the \fBcc\fR command
174 line to link with this library. See \fBlibgss\fR(3LIB).
175 .RE
176
177 .sp
178 .ne 2
179 .na
180 \fB(3LDAP)\fR
181 .ad
182 .sp .6
183 .RS 4n
184 These functions constitute the lightweight directory access protocol library,
185 \fBlibldap\fR. This library is implemented as a shared object,
186 \fBlibldap.so\fR, but is not automatically linked by the C compilation system.
187 Specify \fB-lldap\fR on the \fBcc\fR command line to link with this library.
188 See \fBldap\fR(3LDAP).
189 .RE
190
191 .sp
192 .ne 2
193 .na
194 \fB(3NSL)\fR
195 .ad
196 .sp .6
197 .RS 4n
198 These functions constitute the network service library, \fBlibnsl\fR. This
199 library is implemented as a shared object, \fBlibnsl.so\fR, but is not
200 automatically linked by the C compilation system. Specify \fB-lnsl\fR on the
201 \fBcc\fR command line to link with this library. See \fBlibnsl\fR(3LIB).
202 .sp
203 Many base networking functions are also available in the X/Open networking
204 interfaces library, \fBlibxnet\fR. See section (3XNET) below for more
205 information on the \fBlibxnet\fR interfaces.
206 .RE
207
208 .sp
209 .ne 2
210 .na
211 \fB(3RESOLV)\fR
212 .ad
213 .sp .6
214 .RS 4n
215 These functions constitute the resolver library, \fBlibresolv\fR. This library
216 is implemented as a shared object, \fBlibresolv.so\fR, but is not automatically
217 linked by the C compilation system. Specify \fB-lresolv\fR on the \fBcc\fR
218 command line to link with this library. See \fBlibresolv\fR(3LIB).
219 .RE
220
221 .sp
222 .ne 2
223 .na
224 \fB(3RPC)\fR
225 .ad
226 .sp .6
227 .RS 4n
228 These functions constitute the remote procedure call libraries, \fBlibrpcsvc\fR
229 and \fBlibrpcsoc\fR. The latter is provided for compatibility only; new
230 applications should not link to it. Both libraries are implemented as shared
231 objects, \fBlibrpcsvc.so\fR and \fBlibrpcsoc.so\fR, respectively. Neither
232 library is automatically linked by the C compilation system. Specify
233 \fB-lrpcsvc\fR or \fB-lrpcsoc\fR on the \fBcc\fR command line to link with
234 these libraries. See \fBlibrpcsvc\fR(3LIB).
235 .RE
236
237 .sp
238 .ne 2
239 .na
240 \fB(3SASL)\fR
241 .ad
242 .sp .6
243 .RS 4n
244 These functions constitute the simple authentication and security layer
245 library, \fBlibsasl\fR. This library is implemented as a shared object,
246 \fBlibsasl.so\fR, but it is not automatically linked by the C compilation
247 system. Specify \fB-lsasl\fR on the \fBcc\fR command line to link with this
248 library. See \fBlibsasl\fR(3LIB).
249 .RE
250
251 .sp
252 .ne 2
253 .na
254 \fB(3SIP)\fR
255 .ad
256 .sp .6
257 .RS 4n
258 These functions constitute the session initiation protocol library,
259 \fBlibsip\fR. This library is implemented as a shared object, \fBlibsip.so\fR,
260 but it is not automatically linked by the C compilation system. Specify
261 \fB-lsip\fR on the \fBcc\fR command line to link with this library. See
262 \fBlibsip\fR(3LIB).
263 .RE
264
265 .sp
266 .ne 2
267 .na
268 \fB(3SLP)\fR
269 .ad
270 .sp .6
271 .RS 4n
272 These functions constitute the service location protocol library, \fBlibslp\fR.
273 This library is implemented as a shared object, \fBlibslp.so\fR, but it is not
274 automatically linked by the C compilation system. Specify \fB-lslp\fR on the
275 \fBcc\fR command line to link with this library. See \fBlibslp\fR(3LIB).
276 .RE
277
278 .sp
279 .ne 2
280 .na
281 \fB(3SOCKET)\fR
282 .ad
283 .sp .6
284 .RS 4n
285 These functions constitute the sockets library, \fBlibsocket\fR. This library
286 is implemented as a shared object, \fBlibsocket.so\fR, but is not automatically
287 linked by the C compilation system. Specify \fB-lsocket\fR on the \fBcc\fR
288 command line to link with this library. See \fBlibsocket\fR(3LIB).
289 .RE
290
291 .sp
292 .ne 2
293 .na
294 \fB(3XNET)\fR
295 .ad
296 .sp .6
297 .RS 4n
298 These functions constitute X/Open networking interfaces which comply with the
299 X/Open CAE Specification, Networking Services, Issue 4 (September, 1994). This
300 library is implemented as a shared object, \fBlibxnet.so\fR, but is not
301 automatically linked by the C compilation system. Specify \fB-lxnet\fR on the
302 \fBcc\fR command line to link with this library. See \fBlibxnet\fR(3LIB) and
303 \fBstandards\fR(5) for compilation information.
304 .RE
305
306 .sp
307 .LP
308 Under all circumstances, the use of the Sockets API is recommended over the XTI
309 and TLI APIs. If portability to other XPGV4v2 (see \fBstandards\fR(5)) systems
310 is a requirement, the application must use the \fBlibxnet\fR interfaces. If
311 portability is not required, the sockets interfaces in \fBlibsocket\fR and
312 \fBlibnsl\fR are recommended over those in \fBlibxnet\fR. Between the XTI and
313 TLI APIs, the \fBXTI\fR interfaces (available with \fBlibxnet\fR) are
314 recommended over the \fBTLI\fR interfaces (available with \fBlibnsl\fR).
315 .SS "Curses Library Functions"
316 .LP
317 The functions described in this volume comprise the libraries that provide
318 graphics and character screen updating capabilities.
319 .sp
320 .ne 2
321 .na
322 \fB(3CURSES)\fR
323 .ad
324 .sp .6
325 .RS 4n
326 The functions constitute the following libraries:
327 .sp
328 .ne 2
329 .na
330 \fB\fBlibcurses\fR\fR
331 .ad
332 .sp .6
333 .RS 4n
334 These functions constitute the curses library, \fBlibcurses\fR. This library is
335 implemented as a shared object, \fBlibcurses.so\fR, but is not automatically
336 linked by the C compilation system. Specify \fB-lcurses\fR on the \fBcc\fR
337 command line to link with this library. See \fBlibcurses\fR(3LIB).
338 .RE
339
340 .sp
341 .ne 2
342 .na
343 \fB\fBlibform\fR\fR
344 .ad
345 .sp .6
346 .RS 4n
347 These functions constitute the forms library, \fBlibform\fR. This library is
348 implemented as a shared object, \fBlibform.so\fR, but is not automatically
349 linked by the C compilation system. Specify \fB-lform\fR on the \fBcc\fR
350 command line to link with this library. See \fBlibform\fR(3LIB).
351 .RE
352
353 .sp
354 .ne 2
355 .na
356 \fB\fBlibmenu\fR\fR
357 .ad
358 .sp .6
359 .RS 4n
360 These functions constitute the menus library, \fBlibmenu\fR. This library is
361 implemented as a shared object, \fBlibmenu.so\fR, but is not automatically
362 linked by the C compilation system. Specify \fB-lmenu\fR on the \fBcc\fR
363 command line to link with this library. See \fBlibmenu\fR(3LIB).
364 .RE
365
366 .sp
367 .ne 2
368 .na
369 \fB\fBlibpanel\fR\fR
370 .ad
371 .sp .6
372 .RS 4n
373 These functions constitute the panels library, \fBlibpanel\fR. This library is
374 implemented as a shared object, \fBlibpanel.so\fR, but is not automatically
375 linked by the C compilation system. Specify \fB-lpanel\fR on the \fBcc\fR
376 command line to link with this library. See \fBlibpanel\fR(3LIB).
377 .RE
378
379 .RE
380
381 .sp
382 .ne 2
383 .na
384 \fB(3XCURSES)\fR
385 .ad
386 .sp .6
387 .RS 4n
388 These functions constitute the X/Open curses library, located in
389 \fB/usr/xpg4/lib/libcurses.so\fR. This library provides a set of
390 internationalized functions and macros for creating and modifying input and
391 output to a terminal screen. Included in this library are functions for
392 creating windows, highlighting text, writing to the screen, reading from user
393 input, and moving the cursor. X/Open Curses is designed to optimize screen
394 update activities. The X/Open Curses library conforms fully with Issue 4 of the
395 X/Open Extended Curses specification. See \fBlibcurses\fR(3XCURSES).
396 .RE
397
398 .SS "Extended Library Functions"
399 .LP
400 The functions described in this volume comprise the following specialized
401 libraries:
402 .sp
403 .ne 2
404 .na
405 \fB(3BSM)\fR
406 .ad
407 .sp .6
408 .RS 4n
409 These functions constitute the auditing library, \fBlibbsm\fR. This
410 library is implemented as a shared object, \fBlibbsm.so\fR, but is not
411 automatically linked by the C compilation system. Specify \fB-lbsm\fR on the
412 \fBcc\fR command line to link with this library. See \fBlibbsm\fR(3LIB).
413 .RE
414
415 .sp
416 .ne 2
417 .na
418 \fB(3CFGADM)\fR
419 .ad
420 .sp .6
421 .RS 4n
422 These functions constitute the configuration administration library,
423 \fBlibcfgadm\fR. This library is implemented as a shared object,
424 \fBlibcfgadm.so\fR, but is not automatically linked by the C compilation
425 system. Specify \fB-lcfgadm\fR on the \fBcc\fR command line to link with this
426 library. See \fBlibcfgadm\fR(3LIB).
427 .RE
428
429 .sp
430 .ne 2
431 .na
432 \fB(3CONTRACT)\fR
433 .ad
434 .sp .6
435 .RS 4n
436 These functions constitute the contract management library, \fBlibcontract\fR.
437 This library is implemented as a shared object, \fBlibcontract.so\fR, but is
438 not automatically linked by the C compilation system. Specify \fB-lcontract\fR
439 on the \fBcc\fR command line to link with this library. See
440 \fBlibcontract\fR(3LIB).
441 .RE
442
443 .sp
444 .ne 2
445 .na
446 \fB(3CPC)\fR
447 .ad
448 .sp .6
449 .RS 4n
450 These functions constitute the CPU performance counter library, \fBlibcpc\fR,
451 and the process context library, \fBlibpctx\fR. These libraries are implemented
452 as shared objects, \fBlibcpc.so\fR and \fBlibpctx.so\fR, respectively, but are
453 not automatically linked by the C compilation system. Specify \fB-lcpc\fR or
454 \fB-lpctx\fR on the \fBcc\fR command line to link with these libraries. See
455 \fBlibcpc\fR(3LIB) and \fBlibpctx\fR(3LIB).
456 .RE
457
458 .sp
459 .ne 2
460 .na
461 \fB(3DAT)\fR
462 .ad
463 .sp .6
464 .RS 4n
465 These functions constitute the direct access transport library, \fBlibdat\fR.
466 This library is implemented as a shared object, \fBlibdat.so\fR, but is not
467 automatically linked by the C compilation system. Specify \fB-ldat\fR on the
468 \fBcc\fR command line to link with this library. See \fBlibdat\fR(3LIB).
469 .RE
470
471 .sp
472 .ne 2
473 .na
474 \fB(3DEVID)\fR
475 .ad
476 .sp .6
477 .RS 4n
478 These functions constitute the device \fBID\fR library, \fBlibdevid\fR. This
479 library is implemented as a shared object, \fBlibdevid.so\fR, but is not
480 automatically linked by the C compilation system. Specify \fB-ldevid\fR on the
481 \fBcc\fR command line to link with this library. See \fBlibdevid\fR(3LIB).
482 .RE
483
484 .sp
485 .ne 2
486 .na
487 \fB(3DEVINFO)\fR
488 .ad
489 .sp .6
490 .RS 4n
491 These functions constitute the device information library, \fBlibdevinfo\fR.
492 This library is implemented as a shared object, \fBlibdevinfo.so\fR, but is not
493 automatically linked by the C compilation system. Specify \fB-ldevinfo\fR on
494 the \fBcc\fR command line to link with this library. See
495 \fBlibdevinfo\fR(3LIB).
496 .RE
497
498 .sp
499 .ne 2
500 .na
501 \fB(3ELF)\fR
502 .ad
503 .sp .6
504 .RS 4n
505 These functions constitute the ELF access library, \fBlibelf\fR, (Extensible
506 Linking Format). This library provides the interface for the creation and
507 analyses of "elf" files; executables, objects, and shared objects. \fBlibelf\fR
508 is implemented as a shared object, \fBlibelf.so\fR, but is not automatically
509 linked by the C compilation system. Specify \fB-lelf\fR on the \fBcc\fR command
510 line to link with this library. See \fBlibelf\fR(3LIB).
511 .RE
512
513 .sp
514 .ne 2
515 .na
516 \fB(3EXACCT)\fR
517 .ad
518 .sp .6
519 .RS 4n
520 These functions constitute the extended accounting access library,
521 \fBlibexacct\fR, and the project database access library, \fBlibproject\fR.
522 These libraries are implemented as shared objects, \fBlibexacct.so\fR and
523 \fBlibproject.so\fR, respectively, but are not automatically linked by the C
524 compilation system. Specify \fB-lexacct\fR or \fB-lproject\fR on the \fBcc\fR
525 command line to link with these libraries. See \fBlibexacct\fR(3LIB) and
526 \fBlibproject\fR(3LIB).
527 .RE
528
529 .sp
530 .ne 2
531 .na
532 \fB(3FCOE)\fR
533 .ad
534 .sp .6
535 .RS 4n
536 These functions constitute the Fibre Channel over Ethernet port management
537 library. This library is implemented as a shared object, \fBlibfcoe.so\fR, but
538 is not automatically linked by the C compilation system. Specify \fB-lfcoe\fR
539 on the \fBcc\fR command line to link with this library. See
540 \fBlibfcoe\fR(3LIB).
541 .RE
542
543 .sp
544 .ne 2
545 .na
546 \fB(3FSTYP)\fR
547 .ad
548 .sp .6
549 .RS 4n
550 These functions constitute the file system type identification library. This
551 library is implemented as a shared object, \fBlibfstyp.so\fR, but is not
552 automatically linked by the C compilation system. Specify \fB-lfstyp\fR on the
553 \fBcc\fR command line to link with this library. See \fBlibfstyp\fR(3LIB).
554 .RE
555
556 .sp
557 .ne 2
558 .na
559 \fB(3GEN)\fR
560 .ad
561 .sp .6
562 .RS 4n
563 These functions constitute the string pattern-matching and pathname
564 manipulation library, \fBlibgen\fR. This library is implemented as a shared
565 object, \fBlibgen.so\fR, but is not automatically linked by the C compilation
566 system. Specify \fB-lgen\fR on the \fBcc\fR command line to link with this
567 library. See \fBlibgen\fR(3LIB).
568 .RE
569
570 .sp
571 .ne 2
572 .na
573 \fB(3HBAAPI)\fR
574 .ad
575 .sp .6
576 .RS 4n
577 These functions constitute the common fibre channel HBA information library,
578 \fBlibhbaapi\fR. This library is implemented as a shared object,
579 \fBlibhbaapi.so\fR, but is not automatically linked by the C compilation
580 system. Specify \fB-lhbaapi\fR on the \fBcc\fR command line to link with this
581 library. See \fBlibhbaapi\fR(3LIB).
582 .RE
583
584 .sp
585 .ne 2
586 .na
587 \fB(3ISCSIT)\fR
588 .ad
589 .sp .6
590 .RS 4n
591 These functions constitute the iSCSI Management library, \fBlibiscsit\fR. This
592 library is implemented as a shared object, \fBlibiscsit.so\fR, but is not
593 automatically linked by the C compilation system. Specify \fB-liscsit\fR on the
594 \fBcc\fR command line to link with this library. See \fBlibiscsit\fR(3LIB).
595 .RE
596
597 .sp
598 .ne 2
599 .na
600 \fB(3KSTAT)\fR
601 .ad
602 .sp .6
603 .RS 4n
604 These functions constitute the kernel statistics library, which is implemented
605 as a shared object, \fBlibkstat.so\fR, but is not automatically linked by the C
606 compilation system. Specify \fB-lkstat\fR on the \fBcc\fR command line to link
607 with this library. See \fBlibkstat\fR(3LIB).
608 .RE
609
610 .sp
611 .ne 2
612 .na
613 \fB(3KVM)\fR
614 .ad
615 .sp .6
616 .RS 4n
617 These functions allow access to the kernel's virtual memory library, which is
618 implemented as a shared object, \fBlibkvm.so\fR, but is not automatically
619 linked by the C compilation system. Specify \fB-lkvm\fR on the \fBcc\fR command
620 line to link with this library. See \fBlibkvm\fR(3LIB).
621 .RE
622
623 .sp
624 .ne 2
625 .na
626 \fB(3LGRP)\fR
627 .ad
628 .sp .6
629 .RS 4n
630 These functions constitute the locality group library, which is implemented as
631 a shared object, \fBliblgrp.so\fR, but is not automatically linked by the C
632 compilation system. Specify \fB-llgrp\fR on the \fBcc\fR command line to link
633 with this library. See \fBliblgrp\fR(3LIB).
634 .RE
635
636 .sp
637 .ne 2
638 .na
639 \fB(3M)\fR
640 .ad
641 .sp .6
642 .RS 4n
643 These functions constitute the mathematical library, \fBlibm\fR. This library
644 is implemented as a shared object, \fBlibm.so\fR, but is not automatically
645 linked by the C compilation system. Specify \fB-lm\fR on the \fBcc\fR command
646 line to link with this library. See \fBlibm\fR(3LIB).
647 .RE
648
649 .sp
650 .ne 2
651 .na
652 \fB(3MAIL)\fR
653 .ad
654 .sp .6
655 .RS 4n
656 These functions constitute the user mailbox management library, \fBlibmail\fR.
657 This library is implemented as a shared object, \fBlibmail.so\fR, but is not
658 automatically linked by the C compilation system. Specify \fB-lmail\fR on the
659 \fBcc\fR command line to link with this library. See \fBlibmail\fR(3LIB).
660 .RE
661
662 .sp
663 .ne 2
664 .na
665 \fB(3MP)\fR
666 .ad
667 .sp .6
668 .RS 4n
669 These functions constitute the integer mathematical library, \fBlibmp\fR. This
670 library is implemented as a shared object, \fBlibmp.so\fR, but is not
671 automatically linked by the C compilation system. Specify \fB-lmp\fR on the
672 \fBcc\fR command line to link with this library. See \fBlibmp\fR(3LIB).
673 .RE
674
675 .sp
676 .ne 2
677 .na
678 \fB(3MPAPI)\fR
679 .ad
680 .sp .6
681 .RS 4n
682 These functions constitute the Common Multipath Management library,
683 \fBlibMPAPI\fR. This library is implemented as a shared object,
684 \fBlibMPAPI.so\fR, but is not automatically linked by the C compilation system.
685 Specify \fB-lMPAPI\fR on the \fBcc\fR command line to link with this library.
686 See \fBlibMPAPI\fR(3LIB).
687 .RE
688
689 .sp
690 .ne 2
691 .na
692 \fB(3MVEC)\fR
693 .ad
694 .sp .6
695 .RS 4n
696 These functions constitute the vector mathematical library, \fBlibmvec\fR. This
697 library is implemented as a shared object, \fBlibmvec.so\fR, but is not
698 automatically linked by the C compilation system. Specify \fB-lmvec\fR on the
699 \fBcc\fR command line to link with this library. See \fBlibmvec\fR(3LIB).
700 .RE
701
702 .sp
703 .ne 2
704 .na
705 \fB(3NVPAIR)\fR
706 .ad
707 .sp .6
708 .RS 4n
709 These functions constitute the name-value pair library, \fBlibnvpair\fR. This
710 library is implemented as a shared object, \fBlibnvpair.so\fR, but is not
711 automatically linked by the C compilation system. Specify \fB-lnvpair\fR on the
712 \fBcc\fR command line to link with this library. See \fBlibnvpair\fR(3LIB).
713 .RE
714
715 .sp
716 .ne 2
717 .na
718 \fB(3PAM)\fR
719 .ad
720 .sp .6
721 .RS 4n
722 These functions constitute the pluggable authentication module library,
723 \fBlibpam\fR. This library is implemented as a shared object, \fBlibpam.so\fR,
724 but is not automatically linked by the C compilation system. Specify
725 \fB-lpam\fR on the \fBcc\fR command line to link with this library. See
726 \fBlibpam\fR(3LIB).
727 .RE
728
729 .sp
730 .ne 2
731 .na
732 \fB(3PAPI)\fR
733 .ad
734 .sp .6
735 .RS 4n
736 These functions constitute the Free Standards Group Open Printing API (PAPI)
737 library, \fBlibpapi\fR. This library is implemented as a shared object,
738 \fBlibpapi.so\fR, but is not automatically linked by the C compilation system.
739 Specify \fB-lpapi\fR on the \fBcc\fR command line to link with this library.
740 See \fBlibpapi\fR(3LIB).
741 .RE
742
743 .sp
744 .ne 2
745 .na
746 \fB(3PICL)\fR
747 .ad
748 .sp .6
749 .RS 4n
750 These functions constitute the PICL library, \fBlibpicl\fR. This library is
751 implemented as a shared object, \fBlibpicl.so\fR, but is not automatically
752 linked by the C compilation system. Specify \fB-lpicl\fR on the \fBcc\fR
753 command line to link with this library. See \fBlibpicl\fR(3LIB) and
754 \fBlibpicl\fR(3PICL).
755 .RE
756
757 .sp
758 .ne 2
759 .na
760 \fB(3PICLTREE)\fR
761 .ad
762 .sp .6
763 .RS 4n
764 These functions constitute the PICL plug-in library, \fBlibpicltree\fR. This
765 library is implemented as a shared object, \fBlibpicltree.so\fR, but is not
766 automatically linked by the C compilation system. Specify \fB-lpicltree\fR on
767 the \fBcc\fR command line to link with this library. See
768 \fBlibpicltree\fR(3LIB) and \fBlibpicltree\fR(3PICLTREE).
769 .RE
770
771 .sp
772 .ne 2
773 .na
774 \fB(3POOL)\fR
775 .ad
776 .sp .6
777 .RS 4n
778 These functions constitute the pool configuration manipulation library,
779 \fBlibpool\fR. This library is implemented as a shared object,
780 \fBlibpool.so\fR, but is not automatically linked by the C compilation system.
781 Specify \fB-lpool\fR on the \fBcc\fR command line to link with this library.
782 See \fBlibpool\fR(3LIB).
783 .RE
784
785 .sp
786 .ne 2
787 .na
788 \fB(3PROC)\fR
789 .ad
790 .sp .6
791 .RS 4n
792 These functions constitute the process manipulation library,
793 \fBlibproc\fR. This library is implemented as a shared object,
794 \fBlibproc.so\fR, but it is not automatically linked by the C compilation
795 system. Specify \fB-lproc\fR on the \fBcc\fR command line to link with this
796 library. See \fBlibproc\fR(3LIB).
797 .RE
798
799 .sp
800 .ne 2
801 .na
802 \fB(3PROJECT)\fR
803 .ad
804 .sp .6
805 .RS 4n
806 These functions constitute the project database access library,
807 \fBlibproject\fR. This library is implemented as a shared object,
808 \fBlibproject.so\fR, but is not automatically linked by the C compilation
809 system. Specify \fB-lproject\fR on the \fBcc\fR command line to link with this
810 library. See \fBlibproject\fR(3LIB).
811 .RE
812
813 .sp
814 .ne 2
815 .na
816 \fB(3RSM)\fR
817 .ad
818 .sp .6
819 .RS 4n
820 These functions constitute the remote shared memory library, \fBlibrsm\fR. This
821 library is implemented as a shared object, \fBlibrsm.so\fR, but is not
822 automatically linked by the C compilation system. Specify \fB-lrsm\fR on the
823 \fBcc\fR command line to link with this library. See \fBlibrsm\fR(3LIB).
824 .RE
825
826 .sp
827 .ne 2
828 .na
829 \fB(3SCF)\fR
830 .ad
831 .sp .6
832 .RS 4n
833 These functions constitute the object-caching memory allocation library,
834 \fBlibscf\fR. This library is implemented as a shared object, \fBlibscf.so\fR,
835 but is not automatically linked by the C compilation system. Specify
836 \fB-lscf\fR on the \fBcc\fR command line to link with this library. See
837 \fBlibscf\fR(3LIB).
838 .RE
839
840 .sp
841 .ne 2
842 .na
843 \fB(3SEC)\fR
844 .ad
845 .sp .6
846 .RS 4n
847 These functions constitute the file access control library, \fBlibsec\fR. This
848 library is implemented as a shared object, \fBlibsec.so\fR, but is not
849 automatically linked by the C compilation system. Specify \fB-lsec\fR on the
850 \fBcc\fR command line to link with this library. See \fBlibsec\fR(3LIB).
851 .RE
852
853 .sp
854 .ne 2
855 .na
856 \fB(3SECDB)\fR
857 .ad
858 .sp .6
859 .RS 4n
860 These functions constitute the security attributes database library,
861 \fBlibsecdb\fR. This library is implemented as a shared object,
862 \fBlibsecdb.so\fR, but is not automatically linked by the C compilation system.
863 Specify \fB-lsecdb\fR on the \fBcc\fR command line to link with this library.
864 See \fBlibsecdb\fR(3LIB).
865 .RE
866
867 .sp
868 .ne 2
869 .na
870 \fB(3STMF)\fR
871 .ad
872 .sp .6
873 .RS 4n
874 These functions constitute the SCSI Target Mode Framework library,
875 \fBlibstmf\fR. This library is implemented as a shared object,
876 \fBlibstmf.so\fR, but is not automatically linked by the C compilation system.
877 Specify \fB-lstmf\fR on the \fBcc\fR command line to link with this library.
878 See \fBlibstmf\fR(3LIB).
879 .RE
880
881 .sp
882 .ne 2
883 .na
884 \fB(3SYSEVENT)\fR
885 .ad
886 .sp .6
887 .RS 4n
888 These functions constitute the system event library, \fBlibsysevent\fR. This
889 library is implemented as a shared object, \fBlibsysevent.so\fR, but is not
890 automatically linked by the C compilation system. Specify \fB-lsysevent\fR on
891 the \fBcc\fR command line to link with this library. See
892 \fBlibsysevent\fR(3LIB).
893 .RE
894
895 .sp
896 .ne 2
897 .na
898 \fB(3TECLA)\fR
899 .ad
900 .sp .6
901 .RS 4n
902 These functions constitute the interactive command-line input library,
903 \fBlibtecla\fR. This library is implemented as a shared object,
904 \fBlibtecla.so\fR, but is not automatically linked by the C compilation system.
905 Specify \fB-ltecla\fR on the \fBcc\fR command line to link with this library.
906 See \fBlibtecla\fR(3LIB).
907 .RE
908
909 .sp
910 .ne 2
911 .na
912 \fB(3TNF)\fR
913 .ad
914 .sp .6
915 .RS 4n
916 These functions constitute the TNF libraries, \fBlibtnf\fR, \fBlibtnfctl\fR,
917 and \fBlibtnfprobe\fR. These libraries are implemented as shared objects,
918 \fBlibtnf.so\fR, \fBlibtnfctl.so\fR, and \fBlibtnfprobe.so\fR, respectively,
919 but are not automatically linked by the C compilation system. Specify
920 \fB-ltnf\fR, \fB-ltnfctl\fR, or \fB-ltnfprobe\fR on the \fBcc\fR command line
921 to link with these libraries. See \fBlibtnfctl\fR(3TNF) and
922 \fBlibtnfctl\fR(3LIB).
923 .RE
924
925 .sp
926 .ne 2
927 .na
928 \fB(3TSOL)\fR
929 .ad
930 .sp .6
931 .RS 4n
932 These functions constitute the Trusted Extensions library, \fBlibtsol\fR, and
933 the Trusted Extensions network library, \fBlibtsnet\fR. These libraries are
934 implemented as shared objects, \fBlibtsol.so\fR and \fBlibtsnet.so\fR, but are
935 not automatically linked by the C compilation system. Specify \fB-ltsol\fR or
936 \fB-ltsnet\fR on the \fBcc\fR command line to link with these libraries. See
937 \fBlibtsol\fR(3LIB) and \fBlibtsnet\fR(3LIB).
938 .RE
939
940 .sp
941 .ne 2
942 .na
943 \fB(3UUID)\fR
944 .ad
945 .sp .6
946 .RS 4n
947 These functions constitute the universally unique identifier library,
948 \fBlibuuid\fR. This library is implemented as a shared object,
949 \fBlibuuid.so\fR, but is not automatically linked by the C compilation system.
950 Specify \fB-luuid\fR on the \fBcc\fR command line to link with this library.
951 See \fBlibuuid\fR(3LIB).
952 .RE
953
954 .sp
955 .ne 2
956 .na
957 \fB(3VOLMGT)\fR
958 .ad
959 .sp .6
960 .RS 4n
961 These functions constitute the volume management library, \fBlibvolmgt\fR. This
962 library is implemented as a shared object, \fBlibvolmgt.so\fR, but is not
963 automatically linked by the C compilation system. Specify \fB-lvolmgt\fR on the
964 \fBcc\fR command line to link with this library. See \fBlibvolmgt\fR(3LIB).
965 .RE
966
967 .SH DEFINITIONS
968 .LP
969 A character is any bit pattern able to fit into a byte on the machine. In some
970 international languages, however, a "character" might require more than one
971 byte, and is represented in multi-bytes.
972 .sp
973 .LP
974 The null character is a character with value 0, conventionally represented in
975 the C language as \fB\e\|0\fR\&. A character array is a sequence of characters.
976 A null-terminated character array (a \fIstring\fR) is a sequence of characters,
977 the last of which is the null character. The null string is a character array
978 containing only the terminating null character. A null pointer is the value
979 that is obtained by casting \fB0\fR into a pointer. C guarantees that this
980 value will not match that of any legitimate pointer, so many functions that
981 return pointers return \fINULL\fR to indicate an error. The macro \fINULL\fR is
982 defined in <\fBstdio.h\fR>. Types of the form \fBsize_t\fR are defined in the
983 appropriate headers.
984 .SH MULTITHREADED APPLICATIONS
985 .LP
986 Both POSIX threads and Solaris threads can be used within the same application.
987 Their implementations are completely compatible with each other; however, only
988 POSIX threads guarantee portability to other POSIX-conforming environments.
989 .sp
990 .LP
991 The \fBlibpthread\fR(3LIB) and \fBlibthread\fR(3LIB) libraries are implemented
992 as filters on \fBlibc\fR(3LIB).
993 .sp
994 .LP
995 When compiling a multithreaded application, the \fB-mt\fR option must be
996 specified on the command line.
997 .sp
998 .LP
999 There is no need for a multithreaded application to link with \fB-lthread\fR.
1000 An application must link with \fB-lpthread\fR only when POSIX semantics for
1001 \fBfork\fR(2) are desired. When an application is linked with \fB-lpthread\fR,
1002 a call to \fBfork()\fR assumes the behavior \fBfork1\fR(2) rather than the
1003 default behavior that forks all threads.
1004 .sp
1005 .LP
1006 When compiling a POSIX-conforming application, either the \fB_POSIX_C_SOURCE\fR
1007 or \fB_POSIX_PTHREAD_SEMANTICS\fR option must be specified on the command line.
1008 For POSIX.1c-conforming applications, define the \fB_POSIX_C_SOURCE\fR flag to
1009 be >= 199506L:
1010 .sp
1011 .in +2
1012 .nf
1013 \fBcc\fR \fB-mt\fR [ \fIflag\fR... ] \fIfile\fR... \fB-D_POSIX_C_SOURCE=199506L\fR \fB-lpthread\fR
1014 .fi
1015 .in -2
1016
1017 .sp
1018 .LP
1019 For POSIX behavior with the Solaris \fBfork()\fR and \fBfork1()\fR distinction,
1020 compile as follows:
1021 .sp
1022 .in +2
1023 .nf
1024 \fBcc\fR \fB-mt\fR [ \fIflag\fR... ] \fIfile\fR... \fB-D_POSIX_PTHREAD_SEMANTICS\fR
1025 .fi
1026 .in -2
1027
1028 .sp
1029 .LP
1030 For Solaris threads behavior, compile as follows:
1031 .sp
1032 .in +2
1033 .nf
1034 \fBcc\fR \fB-mt\fR [ \fIflag\fR... ] \fIfile\fR...
1035 .fi
1036 .in -2
1037
1038 .sp
1039 .LP
1040 Unsafe interfaces should be called only from the main thread to ensure the
1041 application's safety.
1042 .sp
1043 .LP
1044 MT-Safe interfaces are denoted in the \fBATTRIBUTES\fR section of the functions
1045 and libraries manual pages (see \fBattributes\fR(5)). If a manual page does not
1046 state explicitly that an interface is MT-Safe, the user should assume that the
1047 interface is unsafe.
1048 .SH REALTIME APPLICATIONS
1049 .LP
1050 The environment variable \fBLD_BIND_NOW\fR must be set to a non-null value to
1051 enable early binding. Refer to the "When Relocations are Processed" chapter in
1052 \fILinker and Libraries Guide\fR for additional information.
1053 .SH FILES
1054 .ne 2
1055 .na
1056 \fB\fIINCDIR\fR\fR
1057 .ad
1058 .RS 15n
1059 usually \fB/usr/include\fR
1060 .RE
1061
1062 .sp
1063 .ne 2
1064 .na
1065 \fB\fILIBDIR\fR\fR
1066 .ad
1067 .RS 15n
1068 usually either \fB/lib\fR or \fB/usr/lib\fR (32-bit) or either \fB/lib/64\fR or
1069 \fB/usr/lib/64\fR (64-bit)
1070 .RE
1071
1072 .sp
1073 .ne 2
1074 .na
1075 \fB\fILIBDIR\fR\fB/*.so\fR\fR
1076 .ad
1077 .RS 15n
1078 shared libraries
1079 .RE
1080
1081 .SH ACKNOWLEDGMENTS
1082 .LP
1083 Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to
1084 reproduce portions of its copyrighted documentation. Original documentation
1085 from The Open Group can be obtained online at
1086 http://www.opengroup.org/bookstore/\&.
1087 .sp
1088 .LP
1089 The Institute of Electrical and Electronics Engineers and The Open Group, have
1090 given us permission to reprint portions of their documentation.
1091 .sp
1092 .LP
1093 In the following statement, the phrase ``this text'' refers to portions of the
1094 system documentation.
1095 .sp
1096 .LP
1097 Portions of this text are reprinted and reproduced in electronic form in the
1098 SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for
1099 Information Technology -- Portable Operating System Interface (POSIX), The Open
1100 Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of
1101 Electrical and Electronics Engineers, Inc and The Open Group. In the event of
1102 any discrepancy between these versions and the original IEEE and The Open Group
1103 Standard, the original IEEE and The Open Group Standard is the referee
1104 document. The original Standard can be obtained online at
1105 http://www.opengroup.org/unix/online.html\&.
1106 .sp
1107 .LP
1108 This notice shall appear on any product containing this material.
1109 .SH SEE ALSO
1110 .LP
1111 \fBar\fR(1), \fBld\fR(1), \fBfork\fR(2), \fBstdio\fR(3C), \fBattributes\fR(5),
1112 \fBstandards\fR(5)
1113 .sp
1114 .LP
1115 \fILinker and Libraries Guide\fR
1116 .sp
1117 .LP
1118 \fIPerformance Profiling Tools\fR
1119 .sp
1120 .LP
1121 \fIANSI C Programmer's Guide\fR
1122 .SH DIAGNOSTICS
1123 .LP
1124 For functions that return floating-point values, error handling varies
1125 according to compilation mode. Under the \fB-Xt\fR (default) option to
1126 \fBcc\fR, these functions return the conventional values \fB0\fR,
1127 \fB\(+-HUGE\fR, or \fBNaN\fR when the function is undefined for the given
1128 arguments or when the value is not representable. In the \fB-Xa\fR and
1129 \fB-Xc\fR compilation modes, \fB\(+-HUGE_VAL\fR is returned instead of
1130 \fB\(+-HUGE\fR\&. (\fBHUGE_VAL\fR and \fBHUGE\fR are defined in \fBmath.h\fR to
1131 be infinity and the largest-magnitude single-precision number, respectively.)
1132 .SH NOTES
1133 .LP
1134 None of the functions, external variables, or macros should be redefined in the
1135 user's programs. Any other name can be redefined without affecting the behavior
1136 of other library functions, but such redefinition might conflict with a
1137 declaration in an included header.
1138 .sp
1139 .LP
1140 The headers in \fIINCDIR\fR provide function prototypes (function declarations
1141 including the types of arguments) for most of the functions listed in this
1142 manual. Function prototypes allow the compiler to check for correct usage of
1143 these functions in the user's program. The \fBlint\fR program checker can also
1144 be used and will report discrepancies even if the headers are not included with
1145 \fB#include\fR statements. Definitions for Sections 2 and 3C are checked
1146 automatically. Other definitions can be included by using the \fB-l\fR option
1147 to \fBlint\fR. (For example, \fB-lm\fR includes definitions for \fBlibm\fR.)
1148 Use of \fBlint\fR is highly recommended. See the \fBlint\fR chapter in
1149 \fIPerformance Profiling Tools\fR
1150 .sp
1151 .LP
1152 Users should carefully note the difference between STREAMS and \fIstream\fR.
1153 STREAMS is a set of kernel mechanisms that support the development of network
1154 services and data communication drivers. It is composed of utility routines,
1155 kernel facilities, and a set of data structures. A \fIstream\fR is a file with
1156 its associated buffering. It is declared to be a pointer to a type \fBFILE\fR
1157 defined in \fB<stdio.h>\fR.
1158 .sp
1159 .LP
1160 In detailed definitions of components, it is sometimes necessary to refer to
1161 symbolic names that are implementation-specific, but which are not necessarily
1162 expected to be accessible to an application program. Many of these symbolic
1163 names describe boundary conditions and system limits.
1164 .sp
1165 .LP
1166 In this section, for readability, these implementation-specific values are
1167 given symbolic names. These names always appear enclosed in curly brackets to
1168 distinguish them from symbolic names of other implementation-specific constants
1169 that are accessible to application programs by headers. These names are not
1170 necessarily accessible to an application program through a header, although
1171 they can be defined in the documentation for a particular system.
1172 .sp
1173 .LP
1174 In general, a portable application program should not refer to these symbolic
1175 names in its code. For example, an application program would not be expected to
1176 test the length of an argument list given to a routine to determine if it was
1177 greater than {\fBARG_MAX\fR}.