Research V7 development
[unix-history] / usr / man / man3 / intro.3
CommitLineData
b8ea98e1
DR
1.TH INTRO 3
2.SH NAME
3intro \- introduction to library functions
4.SH SYNOPSIS
5.B #include <stdio.h>
6.PP
7.B #include <math.h>
8.SH DESCRIPTION
9This section describes functions that may be found
10in various libraries, other than those functions
11that directly invoke UNIX system primitives,
12which are described in section 2.
13Functions are divided into various libraries distinguished
14by the section number at the top of the page:
15.TP 6n
16(3)
17These functions, together with those of section 2 and those
18marked (3S), constitute library
19.I libc,
20which is automatically loaded by the C compiler
21.IR cc (1)
22and the Fortran compiler
23.IR f77 (1).
24The link editor
25.IR ld (1)
26searches this library under the `\-lc' option.
27Declarations for some of these functions may be obtained
28from include files indicated on the appropriate pages.
29.TP
30(3M)
31These functions constitute the math library,
32.I libm.
33They are automatically loaded as needed by the Fortran compiler
34.IR f77 (1).
35The link editor searches this library under the `\-lm' option.
36Declarations for these functions may be obtained from
37the include file <math.h>.
38.TP
39(3S)
40These functions constitute the
41`standard I/O package',
42see
43.IR stdio (3).
44These functions are in the library
45.I libc
46already mentioned.
47Declarations for these functions may be obtained from
48the include file <stdio.h>.
49.TP
50(3X)
51Various
52specialized libraries have not been given distinctive
53captions.
54The files in which these libraries are found are named
55on the appropriate pages.
56.SH FILES
57/lib/libc.a
58.br
59/lib/libm.a, /usr/lib/libm.a (one or the other)
60.SH SEE ALSO
61stdio(3),
62nm(1), ld(1), cc(1), f77(1), intro(2)
63.SH DIAGNOSTICS
64Functions in the math library (3M) may return
65conventional values when the function is undefined for the
66given arguments or when the value is not representable.
67In these cases the external variable
68.I errno
69(see
70.IR intro (2))
71is set to the value EDOM
72or ERANGE.
73The values of EDOM and ERANGE are defined in
74the include file
75.I <math.h>.
76.SH ASSEMBLER
77In assembly language these functions may be accessed
78by simulating the C calling sequence.
79For example,
80.IR ecvt (3)
81might be called this way:
82.IP ""
83.globl _ecvt
84.nf
85setd
86mov $sign,\-(sp)
87mov $decpt,\-(sp)
88mov ndigit,\-(sp)
89movf value,\-(sp)
90jsr pc,_ecvt
91add $14.,sp
92.fi