From: CSRG Date: Wed, 21 Jul 1993 14:52:34 +0000 (-0800) Subject: BSD 4_4 development X-Git-Tag: BSD-4_4~75 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/be8ee4f021b43684944d8fe26d3d979714531f2b BSD 4_4 development Work on file usr/share/man/cat3/curses.0 Work on file usr/share/man/cat3/stty.0 Work on file usr/share/man/cat3/lsearch.0 Work on file usr/share/man/cat3/gtty.0 Work on file usr/share/man/cat3/gcvt.0 Work on file usr/share/man/cat3/fcvt.0 Work on file usr/share/man/cat3/vtimes.0 Work on file usr/share/man/cat3/getpw.0 Work on file usr/share/man/cat3/remque.0 Work on file usr/share/man/cat3/insque.0 Work on file usr/share/man/cat3/vlimit.0 Work on file usr/share/man/cat3/ftime.0 Work on file usr/share/man/cat3/ecvt.0 Work on file usr/share/man/cat3/re_exec.0 Work on file usr/share/man/cat3/rexec.0 Work on file usr/share/man/cat3/regexp.0 Work on file usr/share/man/cat3/regerror.0 Work on file usr/share/man/cat3/regcomp.0 Work on file usr/share/man/cat3/regexec.0 Work on file usr/share/man/cat3/regsub.0 Work on file usr/share/man/cat3/re_comp.0 Work on file usr/share/man/cat3/kvm_getfiles.0 Work on file usr/share/man/cat3/kvm.0 Work on file usr/share/man/cat3/kvm_geterr.0 Work on file usr/share/man/cat3/kvm_getloadavg.0 Work on file usr/share/man/cat3/kvm_read.0 Work on file usr/share/man/cat3/kvm_close.0 Work on file usr/share/man/cat3/kvm_open.0 Work on file usr/share/man/cat3/kvm_getprocs.0 Work on file usr/share/man/cat3/kvm_write.0 Work on file usr/share/man/cat3/kvm_openfiles.0 Work on file usr/share/man/cat3/kvm_getenvv.0 Work on file usr/share/man/cat3/kvm_nlist.0 Work on file usr/share/man/cat3/kvm_getargv.0 Work on file usr/share/man/cat3/atan.0 Work on file usr/share/man/cat3/asin.0 Work on file usr/share/man/cat3/atanh.0 Work on file usr/share/man/cat3/acos.0 Work on file usr/share/man/cat3/asinh.0 Work on file usr/share/man/cat3/atan2.0 Work on file usr/share/man/cat3/acosh.0 Work on file usr/share/man/cat3/fmod.0 Work on file usr/share/man/cat3/cabs.0 Work on file usr/share/man/cat3/erfc.0 Work on file usr/share/man/cat3/log1p.0 Work on file usr/share/man/cat3/log10.0 Work on file usr/share/man/cat3/fabs.0 Work on file usr/share/man/cat3/erf.0 Work on file usr/share/man/cat3/cos.0 Work on file usr/share/man/cat3/log.0 Work on file usr/share/man/cat3/pow.0 Work on file usr/share/man/cat3/expm1.0 Work on file usr/share/man/cat3/hypot.0 Work on file usr/share/man/cat3/floor.0 Work on file usr/share/man/cat3/ceil.0 Work on file usr/share/man/cat3/exp.0 Work on file usr/share/man/cat3/cosh.0 Work on file usr/share/man/cat3/j0.0 Work on file usr/share/man/cat3/sinh.0 Work on file usr/share/man/cat3/j1.0 Work on file usr/share/man/cat3/copysign.0 Work on file usr/share/man/cat3/lgamma.0 Work on file usr/share/man/cat3/jn.0 Work on file usr/share/man/cat3/drem.0 Work on file usr/share/man/cat3/ieee.0 Work on file usr/share/man/cat3/yn.0 Work on file usr/share/man/cat3/rint.0 Work on file usr/share/man/cat3/math.0 Work on file usr/share/man/cat3/logb.0 Work on file usr/share/man/cat3/finite.0 Work on file usr/share/man/cat3/y1.0 Work on file usr/share/man/cat3/scalb.0 Work on file usr/share/man/cat3/gamma.0 Work on file usr/share/man/cat3/y0.0 Work on file usr/share/man/cat3/infnan.0 Work on file usr/share/man/cat3/sin.0 Work on file usr/share/man/cat3/tan.0 Work on file usr/share/man/cat3/sqrt.0 Work on file usr/share/man/cat3/tanh.0 Synthesized-from: CSRG/cd3/4.4 --- diff --git a/usr/share/man/cat3/acos.0 b/usr/share/man/cat3/acos.0 new file mode 100644 index 0000000000..2b87912c7b --- /dev/null +++ b/usr/share/man/cat3/acos.0 @@ -0,0 +1,33 @@ +ACOS(3) BSD Programmer's Manual ACOS(3) + +NNAAMMEE + aaccooss - arc cosine function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + aaccooss(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The aaccooss() function computes the principal value of the arc cosine of _x. + A domain error occurs for arguments not in the range [-1, +1]. For a + discussion of error due to roundoff, see math(3). + +RREETTUURRNN VVAALLUUEESS + The aaccooss() function returns the arc cosine in the range [0, pi] radians. + On the VAX and Tahoe, if: + + |_x| > 1, + + aaccooss(_x) sets the global variable _e_r_r_n_o to EDOM and a reserved operand + fault is generated. + +SSEEEE AALLSSOO + sin(3), cos(3), tan(3), asin(3), atan(3), atan2(3), sinh(3), + cosh(3), tanh(3), math(3), + +SSTTAANNDDAARRDDSS + The aaccooss() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/acosh.0 b/usr/share/man/cat3/acosh.0 new file mode 100644 index 0000000000..4365615496 --- /dev/null +++ b/usr/share/man/cat3/acosh.0 @@ -0,0 +1,27 @@ +ACOSH(3) BSD Programmer's Manual ACOSH(3) + +NNAAMMEE + aaccoosshh - inverse hyperbolic cosine function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + aaccoosshh(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The aaccoosshh() function computes the inverse hyperbolic cosine of the real + argument _x. For a discussion of error due to roundoff, see math(3). + +RREETTUURRNN VVAALLUUEESS + The aaccoosshh() function returns the inverse hyperbolic cosine of _x. On the + VAX and Tahoe, if the argument is less than one aaccoosshh() sets the global + variable _e_r_r_n_o to EDOM and causes a reserved operand fault. + +SSEEEE AALLSSOO + asinh(3), atanh(3), exp(3), infnan(3) math(3), + +HHIISSTTOORRYY + The aaccoosshh() function appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/asin.0 b/usr/share/man/cat3/asin.0 new file mode 100644 index 0000000000..1f716f1374 --- /dev/null +++ b/usr/share/man/cat3/asin.0 @@ -0,0 +1,33 @@ +ASIN(3) BSD Programmer's Manual ASIN(3) + +NNAAMMEE + aassiinn - arc sine function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + aassiinn(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The aassiinn() function computes the principal value of the arc sine of _x. A + domain error occurs for arguments not in the range [-1, +1]. For a dis- + cussion of error due to roundoff, see math(3). + +RREETTUURRNN VVAALLUUEESS + The aassiinn() function returns the arc sine in the range [-pi/2, +pi/2] ra- + dians. On the VAX, and Tahoe , if: + + |_x| > 1 + + the global variable _e_r_r_n_o is set to EDOM and a reserved operand fault + generated. + +SSEEEE AALLSSOO + acos(3), atan(3), atan2(3), cos(3), cosh(3), sin(3), sinh(3), + tan(3), tanh(3), math(3), + +SSTTAANNDDAARRDDSS + The aassiinn() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/asinh.0 b/usr/share/man/cat3/asinh.0 new file mode 100644 index 0000000000..468eba50ea --- /dev/null +++ b/usr/share/man/cat3/asinh.0 @@ -0,0 +1,25 @@ +ASINH(3) BSD Programmer's Manual ASINH(3) + +NNAAMMEE + aassiinnhh - inverse hyperbolic sine function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + aassiinnhh(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The aassiinnhh() function computes the inverse hyperbolic sine of the real ar- + gument _x. For a discussion of error due to roundoff, see math(3). + +RREETTUURRNN VVAALLUUEESS + The aassiinnhh() function returns the inverse hyperbolic sine of _x. + +SSEEEE AALLSSOO + acosh(3), atanh(3), exp(3), infnan(3) math(3), + +HHIISSTTOORRYY + The aassiinnhh() function appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/atan.0 b/usr/share/man/cat3/atan.0 new file mode 100644 index 0000000000..804e03f804 --- /dev/null +++ b/usr/share/man/cat3/atan.0 @@ -0,0 +1,27 @@ +ATAN(3) BSD Programmer's Manual ATAN(3) + +NNAAMMEE + aattaann - arc tangent function of one variable + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + aattaann(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The aattaann() function computes the principal value of the arc tangent of _x. + For a discussion of error due to roundoff, see math(3). + +RREETTUURRNN VVAALLUUEESS + The aattaann() function returns the arc tangent in the range [-pi/2, +pi/2] + radians. + +SSEEEE AALLSSOO + acos(3), asin(3), atan2(3), cos(3), cosh(3), sin(3), sinh(3), + tan(3), tanh(3), math(3), + +SSTTAANNDDAARRDDSS + The aattaann() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/atan2.0 b/usr/share/man/cat3/atan2.0 new file mode 100644 index 0000000000..e0ae7e3bd5 --- /dev/null +++ b/usr/share/man/cat3/atan2.0 @@ -0,0 +1,63 @@ +ATAN2(3) BSD Programmer's Manual ATAN2(3) + +NNAAMMEE + aattaann22 - arc tangent function of two variables + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + aattaann22(_d_o_u_b_l_e _y, _d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The atan2 function computes the principal value of the arc tangent of + _y_/_x, using the signs of both arguments to determine the quadrant of the + return value. + +RREETTUURRNN VVAALLUUEESS + The atan2 function, if successful, returns the arc tangent of _y_/_x in the + range [-pi, +pi] radians. If both _x and _y are zero, the global variable + _e_r_r_n_o is set to EDOM. On the VAX: + + aattaann22(_y, _x):= aattaann(_y_/_x) if _x > 0, + sign(_y)*(pi - aattaann(|_y_/_x|)) if _x < 0, + 0 if x = y = 0, or + sign(_y)*pi/2 if _x = 0 _y. + +NNOOTTEESS + The function aattaann22() defines "if x > 0," aattaann22(_0, _0) = 0 on a VAX despite + that previously aattaann22(_0, _0) may have generated an error message. The + reasons for assigning a value to aattaann22(_0, _0) are these: + + 1. Programs that test arguments to avoid computing aattaann22(_0, _0) + must be indifferent to its value. Programs that require it to + be invalid are vulnerable to diverse reactions to that inva- + lidity on diverse computer systems. + + 2. The aattaann22() function is used mostly to convert from rectangu- + lar (x,y) to polar (r,theta) coordinates that must satisfy x = + r*cos theta and y = r*sin theta. These equations are satis- + fied when (x=0,y=0) is mapped to (r=0,theta=0) on a VAX. In + general, conversions to polar coordinates should be computed + thus: + + r := hypot(x,y); ... := sqrt(x*x+y*y) + theta := atan2(y,x). + + 3. The foregoing formulas need not be altered to cope in a rea- + sonable way with signed zeros and infinities on a machine that + conforms to IEEE 754; the versions of hypot(3) and aattaann22() + provided for such a machine are designed to handle all cases. + That is why aattaann22(_+_-_0, _-_0) = +-pi for instance. In general + the formulas above are equivalent to these: + + r := sqrt(x*x+y*y); if r = 0 then x := copysign(1,x); + +SSEEEE AALLSSOO + acos(3), asin(3), atan(3), cos(3), cosh(3), sin(3), sinh(3), + tan(3), tanh(3), math(3), + +SSTTAANNDDAARRDDSS + The aattaann22() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/atanh.0 b/usr/share/man/cat3/atanh.0 new file mode 100644 index 0000000000..6198a62bf1 --- /dev/null +++ b/usr/share/man/cat3/atanh.0 @@ -0,0 +1,28 @@ +ATANH(3) BSD Programmer's Manual ATANH(3) + +NNAAMMEE + aattaannhh - inverse hyperbolic tangent function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + aattaannhh(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The aattaannhh() function computes the inverse hyperbolic tangent of the real + argument _x. For a discussion of error due to roundoff, see math(3). + +RREETTUURRNN VVAALLUUEESS + The aattaannhh() function returns the inverse hyperbolic tangent of _x if suc- + cessful. On the VAX and Tahoe, if the argument has absolute value bigger + than or equal to 1, aattaannhh() sets the global variable _e_r_r_n_o to EDOM and a + reserved operand fault is generated. + +SSEEEE AALLSSOO + acosh(3), asinh(3), exp(3), infnan(3) math(3), + +HHIISSTTOORRYY + The aattaannhh() function appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/cabs.0 b/usr/share/man/cat3/cabs.0 new file mode 100644 index 0000000000..4fa57f8624 --- /dev/null +++ b/usr/share/man/cat3/cabs.0 @@ -0,0 +1,52 @@ +HYPOT(3) BSD Programmer's Manual HYPOT(3) + +NNAAMMEE + hhyyppoott, ccaabbss - euclidean distance and complex absolute value functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + hhyyppoott(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + + ssttrruucctt {{ddoouubbllee xx,, yy;;}} zz;; + + _d_o_u_b_l_e + ccaabbss(_z); + +DDEESSCCRRIIPPTTIIOONN + The hhyyppoott() and ccaabbss() functions computes the sqrt(x*x+y*y) in such a way + that underflow will not happen, and overflow occurs only if the final re- + sult deserves it. + + hhyyppoott(_i_n_f_i_n_i_t_y, _v) = hhyyppoott(_v, _i_n_f_i_n_i_t_y) = +infinity for all _v, including + _N_a_N. + +EERRRROORR ((dduuee ttoo RRoouunnddooffff,, eettcc..)) + Below 0.97 _u_l_p_s. Consequently hhyyppoott(_5_._0, _1_2_._0) = 13.0 exactly; in gener- + al, hypot and cabs return an integer whenever an integer might be expect- + ed. + + The same cannot be said for the shorter and faster version of hypot and + cabs that is provided in the comments in cabs.c; its error can exceed 1.2 + _u_l_p_s. + +NNOOTTEESS + As might be expected, hhyyppoott(_v, _N_a_N) and hhyyppoott(_N_a_N, _v) are _N_a_N for all + _f_i_n_i_t_e _v; with "reserved operand" in place of "_N_a_N", the same is true on + a VAX. But programmers on machines other than a VAX (if has no infinity) + might be surprised at first to discover that hhyyppoott(_+_-_i_n_f_i_n_i_t_y, _N_a_N) = + +infinity. This is intentional; it happens because hhyyppoott(_i_n_f_i_n_i_t_y, _v) = + +infinity for _a_l_l _v, finite or infinite. Hence hhyyppoott(_i_n_f_i_n_i_t_y, _v) is in- + dependent of _v. Unlike the reserved operand fault on a VAX, the IEEE _N_a_N + is designed to disappear when it turns out to be irrelevant, as it does + in hhyyppoott(_i_n_f_i_n_i_t_y, _N_a_N). + +SSEEEE AALLSSOO + math(3), sqrt(3) + +HHIISSTTOORRYY + Both a hhyyppoott() function and a ccaabbss() function appeared in Version 7 AT&T + UNIX. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/ceil.0 b/usr/share/man/cat3/ceil.0 new file mode 100644 index 0000000000..4e581f7954 --- /dev/null +++ b/usr/share/man/cat3/ceil.0 @@ -0,0 +1,25 @@ +CEIL(3) BSD Programmer's Manual CEIL(3) + +NNAAMMEE + cceeiill - smallest integral value not greater than x + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + cceeiill(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The cceeiill() function computes the smallest integral value not less than _x. + +RREETTUURRNN VVAALLUUEESS + The cceeiill() function returns the smallest integral value expressed as a + double. + +SSEEEE AALLSSOO + abs(3), fabs(3), floor(3), rint(3), ieee(3), math.3 + +SSTTAANNDDAARRDDSS + The cceeiill() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/copysign.0 b/usr/share/man/cat3/copysign.0 new file mode 100644 index 0000000000..4edd4cf673 --- /dev/null +++ b/usr/share/man/cat3/copysign.0 @@ -0,0 +1,87 @@ +IEEE(3) BSD Programmer's Manual IEEE(3) + +NNAAMMEE + ccooppyyssiiggnn, ddrreemm, ffiinniittee, llooggbb, ssccaallbb - IEEE 754 floating point support + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + ccooppyyssiiggnn(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + + _d_o_u_b_l_e + ddrreemm(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + + _i_n_t + ffiinniittee(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + llooggbb(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + ssccaallbb(_d_o_u_b_l_e _x, _i_n_t _n); + +DDEESSCCRRIIPPTTIIOONN + These functions are required for, or recommended by the IEEE standard 754 + for floating-point arithmetic. + + The ccooppyyssiiggnn() function returns _x with its sign changed to _y's. + + The ddrreemm() function returns the remainder _r := _x - _n_*_y where _n is the in- + teger nearest the exact value of _x/_y; moreover if |_n - _x/_y| = 1/2 then _n + is even. Consequently the remainder is computed exactly and |_r| <= + |_y|/2. But ddrreemm(_x, _0) is exceptional. (See below under _D_I_A_G_N_O_S_T_I_C_S.) + + The ffiinniittee() function returns the value 1 just when -infinity < _x < +in- + finity; otherwise a zero is returned (when |_x| = infinity or _x is _N_a_N or + is the VAX's reserved operand). + + The llooggbb() function returns _x's exponent _n, a signed integer converted to + double-precision floating-point and so chosen that 1 (<= |_x|2**_n < 2 un- + less _x = 0 or (only on machines that conform to IEEE 754) |_x| = infinity + or _x lies between 0 and the Underflow Threshold. (See below under _B_U_G_S.) + + The ssccaallbb() function returns _x*(2**_n) computed, for integer n, without + first computing 2*_n. + +RREETTUURRNN VVAALLUUEESS + The IEEE standard 754 defines ddrreemm(_x, _0) and ddrreemm(_i_n_f_i_n_i_t_y, _y) to be in- + valid operations that produce a _N_a_N. On the VAX, ddrreemm(_x, _0) generates a + reserved operand fault. No infinity exists on a VAX. + + IEEE 754 defines llooggbb(_+_-_i_n_f_i_n_i_t_y) = infinity and llooggbb(_0) = -infinity, and + requires the latter to signal Division-by-Zero. But on a VAX, llooggbb(_0) = + 1.0 - 2.0**31 = -2,147,483,647.0. And if the correct value of ssccaallbb() + would overflow on a VAX, it generates a reserved operand fault and sets + the global variable _e_r_r_n_o to ERANGE. + +SSEEEE AALLSSOO + floor(3), math(3), infnan(3) + +HHIISSTTOORRYY + The iieeeeee functions appeared in 4.3BSD. + +BBUUGGSS + Should ddrreemm(_x, _0) and llooggbb(_0) on a VAX signal invalidity by setting _e_r_r_n_o + = EDOM ? Should llooggbb(_0) return -1.7e38? + + IEEE 754 currently specifies that llooggbb(_d_e_n_o_r_m_a_l_i_z_e_d _n_o_.) = llooggbb(_t_i_n_i_e_s_t + _n_o_r_m_a_l_i_z_e_d _n_o_. _> _0) but the consensus has changed to the specification in + the new proposed IEEE standard p854, namely that llooggbb(_x) satisfy + + 1 <= ssccaallbb(|_x|, _-_l_o_g_b_(_x_)) < Radix ... = 2 for IEEE 754 + + for every x except 0, infinity and _N_a_N. Almost every program that as- + sumes 754's specification will work correctly if llooggbb() follows 854's + specification instead. + + IEEE 754 requires ccooppyyssiiggnn(_x, _N_a_N_)) = +-_x but says nothing else about the + sign of a _N_a_N. A _N_a_N _(_Not _a _Number) is similar in spirit to the VAX's + reserved operand, but very different in important details. Since the + sign bit of a reserved operand makes it look negative, + + ccooppyyssiiggnn(_x, _r_e_s_e_r_v_e_d _o_p_e_r_a_n_d) = -_x; + + should this return the reserved operand instead? + +4.3 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/cos.0 b/usr/share/man/cat3/cos.0 new file mode 100644 index 0000000000..0c179f9747 --- /dev/null +++ b/usr/share/man/cat3/cos.0 @@ -0,0 +1,27 @@ +COS(3) BSD Programmer's Manual COS(3) + +NNAAMMEE + ccooss - cosine function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + ccooss(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The ccooss() function computes the cosine of _x (measured in radians). A + large magnitude argument may yield a result with little or no signifi- + cance. For a discussion of error due to roundoff, see math(3). + +RREETTUURRNN VVAALLUUEESS + The ccooss() function returns the cosine value. + +SSEEEE AALLSSOO + sin(3), tan(3), asin(3), acos(3), atan(3), atan2(3), sinh(3), + cosh(3), tanh(3), math(3), + +SSTTAANNDDAARRDDSS + The aaccooss() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/cosh.0 b/usr/share/man/cat3/cosh.0 new file mode 100644 index 0000000000..24abf9af54 --- /dev/null +++ b/usr/share/man/cat3/cosh.0 @@ -0,0 +1,27 @@ +COSH(3) BSD Programmer's Manual COSH(3) + +NNAAMMEE + ccoosshh - hyperbolic cosine function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + ccoosshh(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The ccoosshh() function computes the hyperbolic cosine of _x. + +RREETTUURRNN VVAALLUUEESS + The ccoosshh() function returns the hyperbolic cosine unless the magnitude of + _x is too large; in this event, the global variable _e_r_r_n_o is set to + ERANGE. + +SSEEEE AALLSSOO + acos(3), asin(3), atan(3), atan2(3), cos(3), sin(3), sinh(3), + tan(3), tanh(3), math(3), + +SSTTAANNDDAARRDDSS + The ccoosshh() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/curses.0 b/usr/share/man/cat3/curses.0 new file mode 100644 index 0000000000..cb2f404f45 --- /dev/null +++ b/usr/share/man/cat3/curses.0 @@ -0,0 +1,115 @@ +CURSES(3) BSD Programmer's Manual CURSES(3) + +NNAAMMEE + ccuurrsseess - screen functions with ``optimal'' cursor motion + +SSYYNNOOPPSSIISS + cccc [_f_l_a_g_s] _f_i_l_e_s --llccuurrsseess --lltteerrmmccaapp [_l_i_b_r_a_r_i_e_s] + +DDEESSCCRRIIPPTTIIOONN + These routines give the user a method of updating screens with reasonable + optimization. They keep an image of the current screen, and the user + sets up an image of a new one. Then the rreeffrreesshh() tells the routines to + make the current screen look like the new one. In order to initialize + the routines, the routine iinniittssccrr() must be called before any of the oth- + er routines that deal with windows and screens are used. The routine + eennddwwiinn() should be called before exiting. + +SSEEEE AALLSSOO + ioctl(2), getenv(3), tty(4), termcap(5) + + Ken Arnold, _S_c_r_e_e_n _U_p_d_a_t_i_n_g _a_n_d _C_u_r_s_o_r _M_o_v_e_m_e_n_t _O_p_t_i_m_i_z_a_t_i_o_n_: _A _L_i_b_r_a_r_y + _P_a_c_k_a_g_e. + +AAUUTTHHOORR + Ken Arnold + +FFUUNNCCTTIIOONNSS + addch(ch) add a character to _s_t_d_s_c_r + addstr(str) add a string to _s_t_d_s_c_r + box(win,vert,hor) draw a box around a window + cbreak() set cbreak mode + clear() clear _s_t_d_s_c_r + clearok(scr,boolf) set clear flag for _s_c_r + clrtobot() clear to bottom on _s_t_d_s_c_r + clrtoeol() clear to end of line on + _s_t_d_s_c_r + delch() delete a character + deleteln() delete a line + delwin(win) delete _s_t_d_s_c_r + echo() set echo mode + endwin() end window modes + erase() erase _s_t_d_s_c_r + flusok(win,boolf) set flush-on-refresh flag + for _w_i_n + getch() get a char through _s_t_d_s_c_r + getcap(name) get terminal capability _n_a_m_e + getstr(str) get a string through _s_t_d_s_c_r + gettmode() get tty modes + getyx(win,y,x) get (y,x) co-ordinates + inch() get char at current (y,x) + co-ordinates + initscr() initialize screens + insch(c) insert a char + insertln() insert a line + leaveok(win,boolf) set leave flag for _s_t_d_s_c_r + longname(termbuf,name) get long name from _t_e_r_m_b_u_f + move(y,x) move to (y,x) on _s_t_d_s_c_r + mvcur(lasty,lastx,newy,newx) actually move cursor + newwin(lines,cols,begin_y,begin_x) create a new window + nl() set newline mapping + nocbreak() unset cbreak mode + noecho() unset echo mode + nonl() unset newline mapping + + + noraw() unset raw mode + overlay(win1,win2) overlay win1 on win2 + overwrite(win1,win2) overwrite win1 on top of + win2 + printw(fmt,arg1,arg2,...) printf on _s_t_d_s_c_r + raw() set raw mode + refresh() make current screen look + like _s_t_d_s_c_r + resetty() reset tty flags to stored + value + savetty() stored current tty flags + scanw(fmt,arg1,arg2,...) scanf through _s_t_d_s_c_r + scroll(win) scroll _w_i_n one line + scrollok(win,boolf) set scroll flag + setterm(name) set term variables for name + standend() end standout mode + standout() start standout mode + subwin(win,lines,cols,begin_y,begin_x) create a subwindow + touchline(win,y,sx,ex) mark line _y _s_x through _s_y as + changed + touchoverlap(win1,win2) mark overlap of _w_i_n_1 on _w_i_n_2 + as changed + touchwin(win) change all of _w_i_n + unctrl(ch) printable version of _c_h + waddch(win,ch) add char to _w_i_n + waddstr(win,str) add string to _w_i_n + wclear(win) clear _w_i_n + wclrtobot(win) clear to bottom of _w_i_n + wclrtoeol(win) clear to end of line on _w_i_n + wdelch(win,c) delete char from _w_i_n + wdeleteln(win) delete line from _w_i_n + werase(win) erase _w_i_n + wgetch(win) get a char through _w_i_n + wgetstr(win,str) get a string through _w_i_n + winch(win) get char at current (y,x) in + _w_i_n + winsch(win,c) insert char into _w_i_n + winsertln(win) insert line into _w_i_n + wmove(win,y,x) set current (y,x) co- + ordinates on _w_i_n + wprintw(win,fmt,arg1,arg2,...) printf on _w_i_n + wrefresh(win) make screen look like _w_i_n + wscanw(win,fmt,arg1,arg2,...) scanf through _w_i_n + wstandend(win) end standout mode on _w_i_n + wstandout(win) start standout mode on _w_i_n + +HHIISSTTOORRYY + The ccuurrsseess package appeared in 4.0BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/drem.0 b/usr/share/man/cat3/drem.0 new file mode 100644 index 0000000000..4edd4cf673 --- /dev/null +++ b/usr/share/man/cat3/drem.0 @@ -0,0 +1,87 @@ +IEEE(3) BSD Programmer's Manual IEEE(3) + +NNAAMMEE + ccooppyyssiiggnn, ddrreemm, ffiinniittee, llooggbb, ssccaallbb - IEEE 754 floating point support + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + ccooppyyssiiggnn(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + + _d_o_u_b_l_e + ddrreemm(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + + _i_n_t + ffiinniittee(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + llooggbb(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + ssccaallbb(_d_o_u_b_l_e _x, _i_n_t _n); + +DDEESSCCRRIIPPTTIIOONN + These functions are required for, or recommended by the IEEE standard 754 + for floating-point arithmetic. + + The ccooppyyssiiggnn() function returns _x with its sign changed to _y's. + + The ddrreemm() function returns the remainder _r := _x - _n_*_y where _n is the in- + teger nearest the exact value of _x/_y; moreover if |_n - _x/_y| = 1/2 then _n + is even. Consequently the remainder is computed exactly and |_r| <= + |_y|/2. But ddrreemm(_x, _0) is exceptional. (See below under _D_I_A_G_N_O_S_T_I_C_S.) + + The ffiinniittee() function returns the value 1 just when -infinity < _x < +in- + finity; otherwise a zero is returned (when |_x| = infinity or _x is _N_a_N or + is the VAX's reserved operand). + + The llooggbb() function returns _x's exponent _n, a signed integer converted to + double-precision floating-point and so chosen that 1 (<= |_x|2**_n < 2 un- + less _x = 0 or (only on machines that conform to IEEE 754) |_x| = infinity + or _x lies between 0 and the Underflow Threshold. (See below under _B_U_G_S.) + + The ssccaallbb() function returns _x*(2**_n) computed, for integer n, without + first computing 2*_n. + +RREETTUURRNN VVAALLUUEESS + The IEEE standard 754 defines ddrreemm(_x, _0) and ddrreemm(_i_n_f_i_n_i_t_y, _y) to be in- + valid operations that produce a _N_a_N. On the VAX, ddrreemm(_x, _0) generates a + reserved operand fault. No infinity exists on a VAX. + + IEEE 754 defines llooggbb(_+_-_i_n_f_i_n_i_t_y) = infinity and llooggbb(_0) = -infinity, and + requires the latter to signal Division-by-Zero. But on a VAX, llooggbb(_0) = + 1.0 - 2.0**31 = -2,147,483,647.0. And if the correct value of ssccaallbb() + would overflow on a VAX, it generates a reserved operand fault and sets + the global variable _e_r_r_n_o to ERANGE. + +SSEEEE AALLSSOO + floor(3), math(3), infnan(3) + +HHIISSTTOORRYY + The iieeeeee functions appeared in 4.3BSD. + +BBUUGGSS + Should ddrreemm(_x, _0) and llooggbb(_0) on a VAX signal invalidity by setting _e_r_r_n_o + = EDOM ? Should llooggbb(_0) return -1.7e38? + + IEEE 754 currently specifies that llooggbb(_d_e_n_o_r_m_a_l_i_z_e_d _n_o_.) = llooggbb(_t_i_n_i_e_s_t + _n_o_r_m_a_l_i_z_e_d _n_o_. _> _0) but the consensus has changed to the specification in + the new proposed IEEE standard p854, namely that llooggbb(_x) satisfy + + 1 <= ssccaallbb(|_x|, _-_l_o_g_b_(_x_)) < Radix ... = 2 for IEEE 754 + + for every x except 0, infinity and _N_a_N. Almost every program that as- + sumes 754's specification will work correctly if llooggbb() follows 854's + specification instead. + + IEEE 754 requires ccooppyyssiiggnn(_x, _N_a_N_)) = +-_x but says nothing else about the + sign of a _N_a_N. A _N_a_N _(_Not _a _Number) is similar in spirit to the VAX's + reserved operand, but very different in important details. Since the + sign bit of a reserved operand makes it look negative, + + ccooppyyssiiggnn(_x, _r_e_s_e_r_v_e_d _o_p_e_r_a_n_d) = -_x; + + should this return the reserved operand instead? + +4.3 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/ecvt.0 b/usr/share/man/cat3/ecvt.0 new file mode 100644 index 0000000000..38e3d532cd --- /dev/null +++ b/usr/share/man/cat3/ecvt.0 @@ -0,0 +1,66 @@ + + + +ECVT(3) BSD Programmer's Manual ECVT(3) + + +NNAAMMEE + ecvt, fcvt, gcvt - output conversion + +SSYYNNOOPPSSIISS + cchhaarr **eeccvvtt((vvaalluuee,, nnddiiggiitt,, ddeeccpptt,, ssiiggnn)) + ddoouubbllee vvaalluuee;; + iinntt nnddiiggiitt,, **ddeeccpptt,, **ssiiggnn;; + + cchhaarr **ffccvvtt((vvaalluuee,, nnddiiggiitt,, ddeeccpptt,, ssiiggnn)) + ddoouubbllee vvaalluuee;; + iinntt nnddiiggiitt,, **ddeeccpptt,, **ssiiggnn;; + + cchhaarr **ggccvvtt((vvaalluuee,, nnddiiggiitt,, bbuuff)) + ddoouubbllee vvaalluuee;; + cchhaarr **bbuuff;; + +DDEESSCCRRIIPPTTIIOONN + TThheessee iinntteerrffaacceess aarree oobbssoolleetteedd bbyy pprriinnttff((33)).. + TThheeyy aarree aavvaaiillaabbllee ffrroomm tthhee ccoommppaattiibbiilliittyy lliibbrraarryy,, lliibbccoomm-- + ppaatt.. + + _E_c_v_t converts the _v_a_l_u_e to a null-terminated string of + _n_d_i_g_i_t ASCII digits and returns a pointer thereto. The + position of the decimal point relative to the beginning of + the string is stored indirectly through _d_e_c_p_t (negative + means to the left of the returned digits). If the sign of + the result is negative, the word pointed to by _s_i_g_n is + non-zero, otherwise it is zero. The low-order digit is + rounded. + + _F_c_v_t is identical to _e_c_v_t, except that the correct digit + has been rounded for Fortran F-format output of the number + of digits specified by _n_d_i_g_i_t_s. + + _G_c_v_t converts the _v_a_l_u_e to a null-terminated ASCII string + in _b_u_f and returns a pointer to _b_u_f_. It attempts to pro- + duce _n_d_i_g_i_t significant digits in Fortran F format if pos- + sible, otherwise E format, ready for printing. Trailing + zeros may be suppressed. + +SSEEEE AALLSSOO + printf(3) + +BBUUGGSS + The return values point to static data whose content is + overwritten by each call. + + + + + + + + +7th Edition May 28, 1992 1 + + + + + diff --git a/usr/share/man/cat3/erf.0 b/usr/share/man/cat3/erf.0 new file mode 100644 index 0000000000..47d511872c --- /dev/null +++ b/usr/share/man/cat3/erf.0 @@ -0,0 +1,32 @@ +ERF(3) BSD Programmer's Manual ERF(3) + +NNAAMMEE + eerrff, eerrffcc - error function operators + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + eerrff(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + eerrffcc(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + These functions calculate the error function of _x. + + The eerrff() calculates the error function of x; where + + erf(x) = 2/sqrt(pi)*integral from 0 to x of exp(-t*t) dt. + + The eerrffcc() function calculates the complementary error function of _x; + that is eerrffcc() subtracts the result of the error function eerrff(_x) from + 1.0. This is useful, since for large _x places disappear. + +SSEEEE AALLSSOO + math(3) + +HHIISSTTOORRYY + The eerrff() and eerrffcc() functions appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/erfc.0 b/usr/share/man/cat3/erfc.0 new file mode 100644 index 0000000000..47d511872c --- /dev/null +++ b/usr/share/man/cat3/erfc.0 @@ -0,0 +1,32 @@ +ERF(3) BSD Programmer's Manual ERF(3) + +NNAAMMEE + eerrff, eerrffcc - error function operators + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + eerrff(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + eerrffcc(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + These functions calculate the error function of _x. + + The eerrff() calculates the error function of x; where + + erf(x) = 2/sqrt(pi)*integral from 0 to x of exp(-t*t) dt. + + The eerrffcc() function calculates the complementary error function of _x; + that is eerrffcc() subtracts the result of the error function eerrff(_x) from + 1.0. This is useful, since for large _x places disappear. + +SSEEEE AALLSSOO + math(3) + +HHIISSTTOORRYY + The eerrff() and eerrffcc() functions appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/exp.0 b/usr/share/man/cat3/exp.0 new file mode 100644 index 0000000000..9283be7d56 --- /dev/null +++ b/usr/share/man/cat3/exp.0 @@ -0,0 +1,118 @@ +EXP(3) BSD Programmer's Manual EXP(3) + +NNAAMMEE + eexxpp, eexxppmm11, lloogg, lloogg1100, lloogg11pp, ppooww - exponential, logarithm, power func- + tions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + eexxpp(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + eexxppmm11(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + lloogg(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + lloogg1100(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + lloogg11pp(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + ppooww(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + +DDEESSCCRRIIPPTTIIOONN + The eexxpp() function computes the exponential value of the given argument + _x. + + The eexxppmm11() function computes the value exp(x)-1 accurately even for tiny + argument _x. + + The lloogg() function computes the value for the natural logarithm of the + argument x. + + The lloogg1100() function computes the value for the logarithm of argument _x + to base 10. + + The lloogg11pp() function computes the value of log(1+x) accurately even for + tiny argument _x. + + The ppooww() computes the value of _x to the exponent _y. + +EERRRROORR ((dduuee ttoo RRoouunnddooffff eettcc..)) + exp(x), log(x), expm1(x) and log1p(x) are accurate to within an _u_p, and + log10(x) to within about 2 _u_p_s; an _u_p is one _U_n_i_t in the _L_a_s_t _P_l_a_c_e. The + error in ppooww(_x, _y) is below about 2 _u_p_s when its magnitude is moderate, + but increases as ppooww(_x, _y) approaches the over/underflow thresholds until + almost as many bits could be lost as are occupied by the floating-point + format's exponent field; that is 8 bits for VAX D and 11 bits for IEEE + 754 Double. No such drastic loss has been exposed by testing; the worst + errors observed have been below 20 _u_p_s for VAX D, 300 _u_p_s for IEEE 754 + Double. Moderate values of ppooww() are accurate enough that ppooww(_i_n_t_e_g_e_r, + _i_n_t_e_g_e_r) is exact until it is bigger than 2**56 on a VAX, 2**53 for IEEE + 754. + +RREETTUURRNN VVAALLUUEESS + These functions will return the approprate computation unless an error + occurs or an argument is out of range. The functions eexxpp(), eexxppmm11() and + ppooww() detect if the computed value will overflow, set the global variable + _e_r_r_n_o _t_o RANGE and cause a reserved operand fault on a VAX or Tahoe. The + function ppooww(_x, _y) checks to see if _x < 0 and _y is not an integer, in the + event this is true, the global variable _e_r_r_n_o is set to EDOM and on the + VAX and Tahoe generate a reserved operand fault. On a VAX and Tahoe, + _e_r_r_n_o is set to EDOM and the reserved operand is returned by log unless _x + > 0, by lloogg11pp() unless _x > -1. + +NNOOTTEESS + The functions exp(x)-1 and log(1+x) are called expm1 and logp1 in BASIC + on the Hewlett-Packard HP-71B and APPLE Macintosh, EXP1 and LN1 in Pas- + cal, exp1 and log1 in C on APPLE Macintoshes, where they have been pro- + vided to make sure financial calculations of ((1+x)**n-1)/x, namely + expm1(n*log1p(x))/x, will be accurate when x is tiny. They also provide + accurate inverse hyperbolic functions. + + The function ppooww(_x, _0) returns x**0 = 1 for all x including x = 0, Infin- + ity (not found on a VAX), and _N_a_N (the reserved operand on a VAX). + Previous implementations of pow may have defined x**0 to be undefined in + some or all of these cases. Here are reasons for returning x**0 = 1 al- + ways: + + 1. Any program that already tests whether x is zero (or infinite or + _N_a_N) before computing x**0 cannot care whether 0**0 = 1 or not. + Any program that depends upon 0**0 to be invalid is dubious any- + way since that expression's meaning and, if invalid, its conse- + quences vary from one computer system to another. + + 2. Some Algebra texts (e.g. Sigler's) define x**0 = 1 for all x, in- + cluding x = 0. This is compatible with the convention that ac- + cepts a[0] as the value of polynomial + + p(x) = a[0]*x**0 + a[1]*x**1 + a[2]*x**2 +...+ a[n]*x**n + + at x = 0 rather than reject a[0]*0**0 as invalid. + + 3. Analysts will accept 0**0 = 1 despite that x**y can approach any- + thing or nothing as x and y approach 0 independently. The reason + for setting 0**0 = 1 anyway is this: + + If x(z) and y(z) are _a_n_y functions analytic (expandable in + power series) in z around z = 0, and if there x(0) = y(0) = + 0, then x(z)**y(z) -> 1 as z -> 0. + + 4. If 0**0 = 1, then infinity**0 = 1/0**0 = 1 too; and then _N_a_N**0 = + 1 too because x**0 = 1 for all finite and infinite x, i.e., inde- + pendently of x. + +SSEEEE AALLSSOO + math(3), infnan(3) + +HHIISSTTOORRYY + A eexxpp(), lloogg() and ppooww() function appeared in Version 6 AT&T UNIX. A + lloogg1100() function appeared in Version 7 AT&T UNIX. The lloogg11pp() and + eexxppmm11() functions appeared in 4.3BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/expm1.0 b/usr/share/man/cat3/expm1.0 new file mode 100644 index 0000000000..9283be7d56 --- /dev/null +++ b/usr/share/man/cat3/expm1.0 @@ -0,0 +1,118 @@ +EXP(3) BSD Programmer's Manual EXP(3) + +NNAAMMEE + eexxpp, eexxppmm11, lloogg, lloogg1100, lloogg11pp, ppooww - exponential, logarithm, power func- + tions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + eexxpp(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + eexxppmm11(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + lloogg(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + lloogg1100(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + lloogg11pp(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + ppooww(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + +DDEESSCCRRIIPPTTIIOONN + The eexxpp() function computes the exponential value of the given argument + _x. + + The eexxppmm11() function computes the value exp(x)-1 accurately even for tiny + argument _x. + + The lloogg() function computes the value for the natural logarithm of the + argument x. + + The lloogg1100() function computes the value for the logarithm of argument _x + to base 10. + + The lloogg11pp() function computes the value of log(1+x) accurately even for + tiny argument _x. + + The ppooww() computes the value of _x to the exponent _y. + +EERRRROORR ((dduuee ttoo RRoouunnddooffff eettcc..)) + exp(x), log(x), expm1(x) and log1p(x) are accurate to within an _u_p, and + log10(x) to within about 2 _u_p_s; an _u_p is one _U_n_i_t in the _L_a_s_t _P_l_a_c_e. The + error in ppooww(_x, _y) is below about 2 _u_p_s when its magnitude is moderate, + but increases as ppooww(_x, _y) approaches the over/underflow thresholds until + almost as many bits could be lost as are occupied by the floating-point + format's exponent field; that is 8 bits for VAX D and 11 bits for IEEE + 754 Double. No such drastic loss has been exposed by testing; the worst + errors observed have been below 20 _u_p_s for VAX D, 300 _u_p_s for IEEE 754 + Double. Moderate values of ppooww() are accurate enough that ppooww(_i_n_t_e_g_e_r, + _i_n_t_e_g_e_r) is exact until it is bigger than 2**56 on a VAX, 2**53 for IEEE + 754. + +RREETTUURRNN VVAALLUUEESS + These functions will return the approprate computation unless an error + occurs or an argument is out of range. The functions eexxpp(), eexxppmm11() and + ppooww() detect if the computed value will overflow, set the global variable + _e_r_r_n_o _t_o RANGE and cause a reserved operand fault on a VAX or Tahoe. The + function ppooww(_x, _y) checks to see if _x < 0 and _y is not an integer, in the + event this is true, the global variable _e_r_r_n_o is set to EDOM and on the + VAX and Tahoe generate a reserved operand fault. On a VAX and Tahoe, + _e_r_r_n_o is set to EDOM and the reserved operand is returned by log unless _x + > 0, by lloogg11pp() unless _x > -1. + +NNOOTTEESS + The functions exp(x)-1 and log(1+x) are called expm1 and logp1 in BASIC + on the Hewlett-Packard HP-71B and APPLE Macintosh, EXP1 and LN1 in Pas- + cal, exp1 and log1 in C on APPLE Macintoshes, where they have been pro- + vided to make sure financial calculations of ((1+x)**n-1)/x, namely + expm1(n*log1p(x))/x, will be accurate when x is tiny. They also provide + accurate inverse hyperbolic functions. + + The function ppooww(_x, _0) returns x**0 = 1 for all x including x = 0, Infin- + ity (not found on a VAX), and _N_a_N (the reserved operand on a VAX). + Previous implementations of pow may have defined x**0 to be undefined in + some or all of these cases. Here are reasons for returning x**0 = 1 al- + ways: + + 1. Any program that already tests whether x is zero (or infinite or + _N_a_N) before computing x**0 cannot care whether 0**0 = 1 or not. + Any program that depends upon 0**0 to be invalid is dubious any- + way since that expression's meaning and, if invalid, its conse- + quences vary from one computer system to another. + + 2. Some Algebra texts (e.g. Sigler's) define x**0 = 1 for all x, in- + cluding x = 0. This is compatible with the convention that ac- + cepts a[0] as the value of polynomial + + p(x) = a[0]*x**0 + a[1]*x**1 + a[2]*x**2 +...+ a[n]*x**n + + at x = 0 rather than reject a[0]*0**0 as invalid. + + 3. Analysts will accept 0**0 = 1 despite that x**y can approach any- + thing or nothing as x and y approach 0 independently. The reason + for setting 0**0 = 1 anyway is this: + + If x(z) and y(z) are _a_n_y functions analytic (expandable in + power series) in z around z = 0, and if there x(0) = y(0) = + 0, then x(z)**y(z) -> 1 as z -> 0. + + 4. If 0**0 = 1, then infinity**0 = 1/0**0 = 1 too; and then _N_a_N**0 = + 1 too because x**0 = 1 for all finite and infinite x, i.e., inde- + pendently of x. + +SSEEEE AALLSSOO + math(3), infnan(3) + +HHIISSTTOORRYY + A eexxpp(), lloogg() and ppooww() function appeared in Version 6 AT&T UNIX. A + lloogg1100() function appeared in Version 7 AT&T UNIX. The lloogg11pp() and + eexxppmm11() functions appeared in 4.3BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/fabs.0 b/usr/share/man/cat3/fabs.0 new file mode 100644 index 0000000000..4fa52312d3 --- /dev/null +++ b/usr/share/man/cat3/fabs.0 @@ -0,0 +1,25 @@ +FABS(3) BSD Programmer's Manual FABS(3) + +NNAAMMEE + ffaabbss - floating-point absolute value function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + ffaabbss(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The ffaabbss() function computes the absolute value of a floating-point num- + ber _x. + +RREETTUURRNN VVAALLUUEESS + The ffaabbss() function returns the absolute value of _x. + +SSEEEE AALLSSOO + abs(3), ceil(3), floor(3), rint(3), ieee(3), math.3 + +SSTTAANNDDAARRDDSS + The ffaabbss() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/fcvt.0 b/usr/share/man/cat3/fcvt.0 new file mode 100644 index 0000000000..38e3d532cd --- /dev/null +++ b/usr/share/man/cat3/fcvt.0 @@ -0,0 +1,66 @@ + + + +ECVT(3) BSD Programmer's Manual ECVT(3) + + +NNAAMMEE + ecvt, fcvt, gcvt - output conversion + +SSYYNNOOPPSSIISS + cchhaarr **eeccvvtt((vvaalluuee,, nnddiiggiitt,, ddeeccpptt,, ssiiggnn)) + ddoouubbllee vvaalluuee;; + iinntt nnddiiggiitt,, **ddeeccpptt,, **ssiiggnn;; + + cchhaarr **ffccvvtt((vvaalluuee,, nnddiiggiitt,, ddeeccpptt,, ssiiggnn)) + ddoouubbllee vvaalluuee;; + iinntt nnddiiggiitt,, **ddeeccpptt,, **ssiiggnn;; + + cchhaarr **ggccvvtt((vvaalluuee,, nnddiiggiitt,, bbuuff)) + ddoouubbllee vvaalluuee;; + cchhaarr **bbuuff;; + +DDEESSCCRRIIPPTTIIOONN + TThheessee iinntteerrffaacceess aarree oobbssoolleetteedd bbyy pprriinnttff((33)).. + TThheeyy aarree aavvaaiillaabbllee ffrroomm tthhee ccoommppaattiibbiilliittyy lliibbrraarryy,, lliibbccoomm-- + ppaatt.. + + _E_c_v_t converts the _v_a_l_u_e to a null-terminated string of + _n_d_i_g_i_t ASCII digits and returns a pointer thereto. The + position of the decimal point relative to the beginning of + the string is stored indirectly through _d_e_c_p_t (negative + means to the left of the returned digits). If the sign of + the result is negative, the word pointed to by _s_i_g_n is + non-zero, otherwise it is zero. The low-order digit is + rounded. + + _F_c_v_t is identical to _e_c_v_t, except that the correct digit + has been rounded for Fortran F-format output of the number + of digits specified by _n_d_i_g_i_t_s. + + _G_c_v_t converts the _v_a_l_u_e to a null-terminated ASCII string + in _b_u_f and returns a pointer to _b_u_f_. It attempts to pro- + duce _n_d_i_g_i_t significant digits in Fortran F format if pos- + sible, otherwise E format, ready for printing. Trailing + zeros may be suppressed. + +SSEEEE AALLSSOO + printf(3) + +BBUUGGSS + The return values point to static data whose content is + overwritten by each call. + + + + + + + + +7th Edition May 28, 1992 1 + + + + + diff --git a/usr/share/man/cat3/finite.0 b/usr/share/man/cat3/finite.0 new file mode 100644 index 0000000000..4edd4cf673 --- /dev/null +++ b/usr/share/man/cat3/finite.0 @@ -0,0 +1,87 @@ +IEEE(3) BSD Programmer's Manual IEEE(3) + +NNAAMMEE + ccooppyyssiiggnn, ddrreemm, ffiinniittee, llooggbb, ssccaallbb - IEEE 754 floating point support + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + ccooppyyssiiggnn(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + + _d_o_u_b_l_e + ddrreemm(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + + _i_n_t + ffiinniittee(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + llooggbb(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + ssccaallbb(_d_o_u_b_l_e _x, _i_n_t _n); + +DDEESSCCRRIIPPTTIIOONN + These functions are required for, or recommended by the IEEE standard 754 + for floating-point arithmetic. + + The ccooppyyssiiggnn() function returns _x with its sign changed to _y's. + + The ddrreemm() function returns the remainder _r := _x - _n_*_y where _n is the in- + teger nearest the exact value of _x/_y; moreover if |_n - _x/_y| = 1/2 then _n + is even. Consequently the remainder is computed exactly and |_r| <= + |_y|/2. But ddrreemm(_x, _0) is exceptional. (See below under _D_I_A_G_N_O_S_T_I_C_S.) + + The ffiinniittee() function returns the value 1 just when -infinity < _x < +in- + finity; otherwise a zero is returned (when |_x| = infinity or _x is _N_a_N or + is the VAX's reserved operand). + + The llooggbb() function returns _x's exponent _n, a signed integer converted to + double-precision floating-point and so chosen that 1 (<= |_x|2**_n < 2 un- + less _x = 0 or (only on machines that conform to IEEE 754) |_x| = infinity + or _x lies between 0 and the Underflow Threshold. (See below under _B_U_G_S.) + + The ssccaallbb() function returns _x*(2**_n) computed, for integer n, without + first computing 2*_n. + +RREETTUURRNN VVAALLUUEESS + The IEEE standard 754 defines ddrreemm(_x, _0) and ddrreemm(_i_n_f_i_n_i_t_y, _y) to be in- + valid operations that produce a _N_a_N. On the VAX, ddrreemm(_x, _0) generates a + reserved operand fault. No infinity exists on a VAX. + + IEEE 754 defines llooggbb(_+_-_i_n_f_i_n_i_t_y) = infinity and llooggbb(_0) = -infinity, and + requires the latter to signal Division-by-Zero. But on a VAX, llooggbb(_0) = + 1.0 - 2.0**31 = -2,147,483,647.0. And if the correct value of ssccaallbb() + would overflow on a VAX, it generates a reserved operand fault and sets + the global variable _e_r_r_n_o to ERANGE. + +SSEEEE AALLSSOO + floor(3), math(3), infnan(3) + +HHIISSTTOORRYY + The iieeeeee functions appeared in 4.3BSD. + +BBUUGGSS + Should ddrreemm(_x, _0) and llooggbb(_0) on a VAX signal invalidity by setting _e_r_r_n_o + = EDOM ? Should llooggbb(_0) return -1.7e38? + + IEEE 754 currently specifies that llooggbb(_d_e_n_o_r_m_a_l_i_z_e_d _n_o_.) = llooggbb(_t_i_n_i_e_s_t + _n_o_r_m_a_l_i_z_e_d _n_o_. _> _0) but the consensus has changed to the specification in + the new proposed IEEE standard p854, namely that llooggbb(_x) satisfy + + 1 <= ssccaallbb(|_x|, _-_l_o_g_b_(_x_)) < Radix ... = 2 for IEEE 754 + + for every x except 0, infinity and _N_a_N. Almost every program that as- + sumes 754's specification will work correctly if llooggbb() follows 854's + specification instead. + + IEEE 754 requires ccooppyyssiiggnn(_x, _N_a_N_)) = +-_x but says nothing else about the + sign of a _N_a_N. A _N_a_N _(_Not _a _Number) is similar in spirit to the VAX's + reserved operand, but very different in important details. Since the + sign bit of a reserved operand makes it look negative, + + ccooppyyssiiggnn(_x, _r_e_s_e_r_v_e_d _o_p_e_r_a_n_d) = -_x; + + should this return the reserved operand instead? + +4.3 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/floor.0 b/usr/share/man/cat3/floor.0 new file mode 100644 index 0000000000..1c2e140b68 --- /dev/null +++ b/usr/share/man/cat3/floor.0 @@ -0,0 +1,26 @@ +FLOOR(3) BSD Programmer's Manual FLOOR(3) + +NNAAMMEE + fflloooorr - largest integral value not greater than x + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + fflloooorr(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The fflloooorr() function computes the largest integral value not greater than + _x. + +RREETTUURRNN VVAALLUUEESS + The fflloooorr() function returns the largest integral value expressed as a + double. + +SSEEEE AALLSSOO + abs(3), ieee(3), fabs(3), floor(3), rint(3), math(3) + +SSTTAANNDDAARRDDSS + The fflloooorr() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/fmod.0 b/usr/share/man/cat3/fmod.0 new file mode 100644 index 0000000000..c838e86146 --- /dev/null +++ b/usr/share/man/cat3/fmod.0 @@ -0,0 +1,27 @@ +FMOD(3) BSD Programmer's Manual FMOD(3) + +NNAAMMEE + ffmmoodd - floating-point remainder function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + ffmmoodd(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + +DDEESSCCRRIIPPTTIIOONN + The ffmmoodd() function computes the floating-point remainder of _x/ _y. + +RREETTUURRNN VVAALLUUEESS + The ffmmoodd() function returns the value _x_-_i_*_y, for some integer _i such + that, if _y is non-zero, the result has the same sign as _x and magnitude + less than the magnitude of _y. If _y is zero, whether a domain error occurs + or the ffmmoodd() function returns zero is implementation-defined. + +SSEEEE AALLSSOO + math(3) + +SSTTAANNDDAARRDDSS + The ffmmoodd() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/ftime.0 b/usr/share/man/cat3/ftime.0 new file mode 100644 index 0000000000..8090c98790 --- /dev/null +++ b/usr/share/man/cat3/ftime.0 @@ -0,0 +1,44 @@ +FTIME(3) BSD Programmer's Manual FTIME(3) + +NNAAMMEE + ffttiimmee - get date and time + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _s_t_r_u_c_t _t_i_m_e_b _* + ffttiimmee(_s_t_r_u_c_t _t_i_m_e_b _*_t_p); + +DDEESSCCRRIIPPTTIIOONN + TThhiiss iinntteerrffaaccee iiss oobbssoolleetteedd bbyy ggeettttiimmeeooffddaayy((22)).. + + IItt iiss aavvaaiillaabbllee ffrroomm tthhee ccoommppaattiibbiilliittyy lliibbrraarryy,, lliibbccoommppaatt.. + + The ffttiimmee() routine fills in a structure pointed to by its argument, as + defined by <_s_y_s_/_t_i_m_e_b_._h>: + + /* + * Structure returned by ftime system call + */ + struct timeb + { + time_t time; + unsigned short millitm; + short timezone; + short dstflag; + }; + + The structure contains the time since the epoch in seconds, up to 1000 + milliseconds of more-precise interval, the local time zone (measured in + minutes of time westward from Greenwich), and a flag that, if nonzero, + indicates that Daylight Saving time applies locally during the appropri- + ate part of the year. + +SSEEEE AALLSSOO + gettimeofday(2), settimeofday(2), time(2), ctime(3) + +HHIISSTTOORRYY + The ffttiimmee function appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/gamma.0 b/usr/share/man/cat3/gamma.0 new file mode 100644 index 0000000000..7032cd90ec --- /dev/null +++ b/usr/share/man/cat3/gamma.0 @@ -0,0 +1,51 @@ +LGAMMA(3) BSD Programmer's Manual LGAMMA(3) + +NNAAMMEE + llggaammmmaa ggaammmmaa - log gamma function, gamma function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _e_x_t_e_r_n _i_n_t _s_i_g_n_g_a_m; + + _d_o_u_b_l_e + llggaammmmaa(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + ggaammmmaa(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN _ + LLggaammmmaa(_x) returns ln|| (x)|. + _ + The external integer _s_i_g_n_g_a_m returns the sign of | (x). + _ + GGaammmmaa(_x) returns | (x), with no effect on _s_i_g_n_g_a_m. + +IIDDIIOOSSYYNNCCRRAASSIIEESS + Do_ not use the expression ``signgam*exp(lgamma(x))'' to compute g := + | (x). Instead use a program like this (in C): + + lg = lgamma(x); g = signgam*exp(lg); + + Only after llggaammmmaa() has returned can signgam be correct. + + For arguments in its range, ggaammmmaa() is preferred, as for positive argu- + ments it is accurate to within one unit in the last place. Exponentia- + tion of llggaammmmaa() will lose up to 10 significant bits. + +RREETTUURRNN VVAALLUUEESS + GGaammmmaa() and llggaammmmaa() return appropriate values unless an arguent is out + of range. Overflow will occur for sufficiently large positive values, + and non-positive integers. On the VAX, the reserved operator is re- + turned, and _e_r_r_n_o is set to ERANGE For large non-integer negative values, + ggaammmmaa() will underflow. + +SSEEEE AALLSSOO + math(3), infnan(3) + +HHIISSTTOORRYY + The llggaammmmaa function appeared in 4.3BSD. The ggaammmmaa function appeared in + 4.4BSD. The name ggaammmmaa() was originally dedicated to the llggaammmmaa() func- + tion, so some old code may no longer be compatible. + +4.3 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/gcvt.0 b/usr/share/man/cat3/gcvt.0 new file mode 100644 index 0000000000..38e3d532cd --- /dev/null +++ b/usr/share/man/cat3/gcvt.0 @@ -0,0 +1,66 @@ + + + +ECVT(3) BSD Programmer's Manual ECVT(3) + + +NNAAMMEE + ecvt, fcvt, gcvt - output conversion + +SSYYNNOOPPSSIISS + cchhaarr **eeccvvtt((vvaalluuee,, nnddiiggiitt,, ddeeccpptt,, ssiiggnn)) + ddoouubbllee vvaalluuee;; + iinntt nnddiiggiitt,, **ddeeccpptt,, **ssiiggnn;; + + cchhaarr **ffccvvtt((vvaalluuee,, nnddiiggiitt,, ddeeccpptt,, ssiiggnn)) + ddoouubbllee vvaalluuee;; + iinntt nnddiiggiitt,, **ddeeccpptt,, **ssiiggnn;; + + cchhaarr **ggccvvtt((vvaalluuee,, nnddiiggiitt,, bbuuff)) + ddoouubbllee vvaalluuee;; + cchhaarr **bbuuff;; + +DDEESSCCRRIIPPTTIIOONN + TThheessee iinntteerrffaacceess aarree oobbssoolleetteedd bbyy pprriinnttff((33)).. + TThheeyy aarree aavvaaiillaabbllee ffrroomm tthhee ccoommppaattiibbiilliittyy lliibbrraarryy,, lliibbccoomm-- + ppaatt.. + + _E_c_v_t converts the _v_a_l_u_e to a null-terminated string of + _n_d_i_g_i_t ASCII digits and returns a pointer thereto. The + position of the decimal point relative to the beginning of + the string is stored indirectly through _d_e_c_p_t (negative + means to the left of the returned digits). If the sign of + the result is negative, the word pointed to by _s_i_g_n is + non-zero, otherwise it is zero. The low-order digit is + rounded. + + _F_c_v_t is identical to _e_c_v_t, except that the correct digit + has been rounded for Fortran F-format output of the number + of digits specified by _n_d_i_g_i_t_s. + + _G_c_v_t converts the _v_a_l_u_e to a null-terminated ASCII string + in _b_u_f and returns a pointer to _b_u_f_. It attempts to pro- + duce _n_d_i_g_i_t significant digits in Fortran F format if pos- + sible, otherwise E format, ready for printing. Trailing + zeros may be suppressed. + +SSEEEE AALLSSOO + printf(3) + +BBUUGGSS + The return values point to static data whose content is + overwritten by each call. + + + + + + + + +7th Edition May 28, 1992 1 + + + + + diff --git a/usr/share/man/cat3/getpw.0 b/usr/share/man/cat3/getpw.0 new file mode 100644 index 0000000000..84a2159cc3 --- /dev/null +++ b/usr/share/man/cat3/getpw.0 @@ -0,0 +1,31 @@ +GETPW(3) BSD Programmer's Manual GETPW(3) + +NNAAMMEE + ggeettppww - get name from uid + +SSYYNNOOPPSSIISS + ggeettppww(_u_i_d, _c_h_a_r _*_b_u_f); + +DDEESSCCRRIIPPTTIIOONN + TThhee ggeettppww ffuunnccttiioonn iiss mmaaddee oobbssoolleettee bbyy ggeettppwwuuiidd((33)).. + IItt iiss aavvaaiillaabbllee ffrroomm tthhee ccoommppaattiibbiilliittyy lliibbrraarryy,, lliibbccoommppaatt.. + + The ggeettppww() function reads the file _/_e_t_c_/_p_a_s_s_w_d, and if it finds the + specified _u_i_d, copies the password entry line into the string pointed to + by _b_u_f. the null terminated entry line from the password database, and + appends the NUL character. + +RREETTUURRNN VVAALLUUEESS + The ggeettppww() function returns the zero if successful, otherwise a non-zero + if the entry does not exist. + +FFIILLEESS + /etc/passwd + +SSEEEE AALLSSOO + getpwent(3), passwd(5) + +HHIISSTTOORRYY + A ggeettppww() function appeared in Version 6 AT&T UNIX. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/gtty.0 b/usr/share/man/cat3/gtty.0 new file mode 100644 index 0000000000..d17cebf90b --- /dev/null +++ b/usr/share/man/cat3/gtty.0 @@ -0,0 +1,35 @@ +STTY(3) BSD Programmer's Manual STTY(3) + +NNAAMMEE + ssttttyy, ggttttyy - set and get terminal state (defunct) + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + ssttttyy(_i_n_t _f_d, _s_t_r_u_c_t _s_g_t_t_y_b _*_b_u_f); + + ggttttyy(_i_n_t _f_d, _s_t_r_u_c_t _s_g_t_t_y_b _*_b_u_f); + +DDEESSCCRRIIPPTTIIOONN + TThheessee iinntteerrffaacceess aarree oobbssoolleetteedd bbyy iiooccttll((22)).. TThheeyy aarree aavvaaiillaabbllee ffrroomm tthhee + ccoommppaattiibbiilliittyy lliibbrraarryy,, lliibbccoommppaatt.. + + The ssttttyy() function sets the state of the terminal associated with _f_d. + The ggttttyy() function retrieves the state of the terminal associated with + _f_d. To set the state of a terminal the call must have write permission. + + The ssttttyy() call is actually `ioctl(fd, TIOCSETP, buf)', while the ggttttyy() + call is `ioctl(fd, TIOCGETP, buf)'. See ioctl(2) and tty(4) for an expla- + nation. + +DDIIAAGGNNOOSSTTIICCSS + If the call is successful 0 is returned, otherwise -1 is returned and the + global variable _e_r_r_n_o contains the reason for the failure. + +SSEEEE AALLSSOO + ioctl(2), tty(4) + +HHIISSTTOORRYY + The ssttttyy() and ggttttyy() functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/hypot.0 b/usr/share/man/cat3/hypot.0 new file mode 100644 index 0000000000..4fa57f8624 --- /dev/null +++ b/usr/share/man/cat3/hypot.0 @@ -0,0 +1,52 @@ +HYPOT(3) BSD Programmer's Manual HYPOT(3) + +NNAAMMEE + hhyyppoott, ccaabbss - euclidean distance and complex absolute value functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + hhyyppoott(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + + ssttrruucctt {{ddoouubbllee xx,, yy;;}} zz;; + + _d_o_u_b_l_e + ccaabbss(_z); + +DDEESSCCRRIIPPTTIIOONN + The hhyyppoott() and ccaabbss() functions computes the sqrt(x*x+y*y) in such a way + that underflow will not happen, and overflow occurs only if the final re- + sult deserves it. + + hhyyppoott(_i_n_f_i_n_i_t_y, _v) = hhyyppoott(_v, _i_n_f_i_n_i_t_y) = +infinity for all _v, including + _N_a_N. + +EERRRROORR ((dduuee ttoo RRoouunnddooffff,, eettcc..)) + Below 0.97 _u_l_p_s. Consequently hhyyppoott(_5_._0, _1_2_._0) = 13.0 exactly; in gener- + al, hypot and cabs return an integer whenever an integer might be expect- + ed. + + The same cannot be said for the shorter and faster version of hypot and + cabs that is provided in the comments in cabs.c; its error can exceed 1.2 + _u_l_p_s. + +NNOOTTEESS + As might be expected, hhyyppoott(_v, _N_a_N) and hhyyppoott(_N_a_N, _v) are _N_a_N for all + _f_i_n_i_t_e _v; with "reserved operand" in place of "_N_a_N", the same is true on + a VAX. But programmers on machines other than a VAX (if has no infinity) + might be surprised at first to discover that hhyyppoott(_+_-_i_n_f_i_n_i_t_y, _N_a_N) = + +infinity. This is intentional; it happens because hhyyppoott(_i_n_f_i_n_i_t_y, _v) = + +infinity for _a_l_l _v, finite or infinite. Hence hhyyppoott(_i_n_f_i_n_i_t_y, _v) is in- + dependent of _v. Unlike the reserved operand fault on a VAX, the IEEE _N_a_N + is designed to disappear when it turns out to be irrelevant, as it does + in hhyyppoott(_i_n_f_i_n_i_t_y, _N_a_N). + +SSEEEE AALLSSOO + math(3), sqrt(3) + +HHIISSTTOORRYY + Both a hhyyppoott() function and a ccaabbss() function appeared in Version 7 AT&T + UNIX. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/ieee.0 b/usr/share/man/cat3/ieee.0 new file mode 100644 index 0000000000..4edd4cf673 --- /dev/null +++ b/usr/share/man/cat3/ieee.0 @@ -0,0 +1,87 @@ +IEEE(3) BSD Programmer's Manual IEEE(3) + +NNAAMMEE + ccooppyyssiiggnn, ddrreemm, ffiinniittee, llooggbb, ssccaallbb - IEEE 754 floating point support + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + ccooppyyssiiggnn(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + + _d_o_u_b_l_e + ddrreemm(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + + _i_n_t + ffiinniittee(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + llooggbb(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + ssccaallbb(_d_o_u_b_l_e _x, _i_n_t _n); + +DDEESSCCRRIIPPTTIIOONN + These functions are required for, or recommended by the IEEE standard 754 + for floating-point arithmetic. + + The ccooppyyssiiggnn() function returns _x with its sign changed to _y's. + + The ddrreemm() function returns the remainder _r := _x - _n_*_y where _n is the in- + teger nearest the exact value of _x/_y; moreover if |_n - _x/_y| = 1/2 then _n + is even. Consequently the remainder is computed exactly and |_r| <= + |_y|/2. But ddrreemm(_x, _0) is exceptional. (See below under _D_I_A_G_N_O_S_T_I_C_S.) + + The ffiinniittee() function returns the value 1 just when -infinity < _x < +in- + finity; otherwise a zero is returned (when |_x| = infinity or _x is _N_a_N or + is the VAX's reserved operand). + + The llooggbb() function returns _x's exponent _n, a signed integer converted to + double-precision floating-point and so chosen that 1 (<= |_x|2**_n < 2 un- + less _x = 0 or (only on machines that conform to IEEE 754) |_x| = infinity + or _x lies between 0 and the Underflow Threshold. (See below under _B_U_G_S.) + + The ssccaallbb() function returns _x*(2**_n) computed, for integer n, without + first computing 2*_n. + +RREETTUURRNN VVAALLUUEESS + The IEEE standard 754 defines ddrreemm(_x, _0) and ddrreemm(_i_n_f_i_n_i_t_y, _y) to be in- + valid operations that produce a _N_a_N. On the VAX, ddrreemm(_x, _0) generates a + reserved operand fault. No infinity exists on a VAX. + + IEEE 754 defines llooggbb(_+_-_i_n_f_i_n_i_t_y) = infinity and llooggbb(_0) = -infinity, and + requires the latter to signal Division-by-Zero. But on a VAX, llooggbb(_0) = + 1.0 - 2.0**31 = -2,147,483,647.0. And if the correct value of ssccaallbb() + would overflow on a VAX, it generates a reserved operand fault and sets + the global variable _e_r_r_n_o to ERANGE. + +SSEEEE AALLSSOO + floor(3), math(3), infnan(3) + +HHIISSTTOORRYY + The iieeeeee functions appeared in 4.3BSD. + +BBUUGGSS + Should ddrreemm(_x, _0) and llooggbb(_0) on a VAX signal invalidity by setting _e_r_r_n_o + = EDOM ? Should llooggbb(_0) return -1.7e38? + + IEEE 754 currently specifies that llooggbb(_d_e_n_o_r_m_a_l_i_z_e_d _n_o_.) = llooggbb(_t_i_n_i_e_s_t + _n_o_r_m_a_l_i_z_e_d _n_o_. _> _0) but the consensus has changed to the specification in + the new proposed IEEE standard p854, namely that llooggbb(_x) satisfy + + 1 <= ssccaallbb(|_x|, _-_l_o_g_b_(_x_)) < Radix ... = 2 for IEEE 754 + + for every x except 0, infinity and _N_a_N. Almost every program that as- + sumes 754's specification will work correctly if llooggbb() follows 854's + specification instead. + + IEEE 754 requires ccooppyyssiiggnn(_x, _N_a_N_)) = +-_x but says nothing else about the + sign of a _N_a_N. A _N_a_N _(_Not _a _Number) is similar in spirit to the VAX's + reserved operand, but very different in important details. Since the + sign bit of a reserved operand makes it look negative, + + ccooppyyssiiggnn(_x, _r_e_s_e_r_v_e_d _o_p_e_r_a_n_d) = -_x; + + should this return the reserved operand instead? + +4.3 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/infnan.0 b/usr/share/man/cat3/infnan.0 new file mode 100644 index 0000000000..f123710cfd --- /dev/null +++ b/usr/share/man/cat3/infnan.0 @@ -0,0 +1,74 @@ +INFNAN(3) BSD Programmer's Manual INFNAN(3) + +NNAAMMEE + iinnffnnaann - signals invalid floating-point operations on a VAX (temporary) + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + iinnffnnaann(_i_n_t _i_a_r_g); + +DDEESSCCRRIIPPTTIIOONN + At some time in the future, some of the useful properties of the Infini- + ties and _N_a_Ns in the IEEE standard 754 for Binary Floating-Point Arith- + metic will be simulated in UNIX on the DEC VAX by using its Reserved + Operands. Meanwhile, the Invalid, Overflow and Divide-by-Zero exceptions + of the IEEE standard are being approximated on a VAX by calls to a proce- + dure iinnffnnaann() in appropriate places in libm(3). When better excep- + tion-handling is implemented in UNIX, only iinnffnnaann() among the codes in + libm will have to be changed. And users of libm can design their own + iinnffnnaann() now to insulate themselves from future changes. + + Whenever an elementary function code in libm has to simulate one of the + aforementioned IEEE exceptions, it calls iinnffnnaann(_i_a_r_g) with an appropriate + value of _i_a_r_g. Then a reserved operand fault stops computation. But + iinnffnnaann() could be replaced by a function with the same name that returns + some plausible value, assigns an apt value to the global variable _e_r_r_n_o, + and allows computation to resume. Alternatively, the Reserved Operand + Fault Handler could be changed to respond by returning that plausible + value, etc. instead of aborting. + + In the table below, the first two columns show various exceptions sig- + naled by the IEEE standard, and the default result it prescribes. The + third column shows what value is given to _i_a_r_g by functions in libm when + they invoke iinnffnnaann(_i_a_r_g) under analogous circumstances on a VAX. Current- + ly iinnffnnaann() stops computation under all those circumstances. The last + two columns offer an alternative; they suggest a setting for _e_r_r_n_o and a + value for a revised iinnffnnaann() to return. And a C program to implement + that suggestion follows. + + + IEEE Signal IEEE Default _i_a_r_g _e_r_r_n_o + iinnffnnaann() + Invalid _N_a_N EDOM EDOM 0 + Overflow +-infinity ERANGE ERANGE HUGE + Div-by-0 +-Infinity +-ERANGE ERANGE or + EDOM +-HUGE + (HUGE = 1.7e38 ... nearly 2.0**127) + + ALTERNATIVE iinnffnnaann(): + + #include + #include + extern int errno ; + double infnan(iarg) + int iarg ; + { + switch(iarg) { + case ERANGE: errno = ERANGE; return(HUGE); + case -ERANGE: errno = EDOM; return(-HUGE); + default: errno = EDOM; return(0); + } + } + +SSEEEE AALLSSOO + math(3), intro(2), signal(3). + + ERANGE and EDOM are defined in <_e_r_r_n_o_._h>. (See intro(2) for explanation + of EDOM and ERANGE.) + +HHIISSTTOORRYY + The iinnffnnaann() function appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/insque.0 b/usr/share/man/cat3/insque.0 new file mode 100644 index 0000000000..7f180ae0c7 --- /dev/null +++ b/usr/share/man/cat3/insque.0 @@ -0,0 +1,29 @@ +INSQUE(3) BSD Programmer's Manual INSQUE(3) + +NNAAMMEE + iinnssqquuee, rreemmqquuee - insert/remove element from a queue + +SSYYNNOOPPSSIISS + struct qelem { + struct qelem *q_forw; + struct qelem *q_back; + char q_data[]; + }; + + iinnssqquuee(_(_c_a_d_d_r___t_) _s_t_r_u_c_t _q_e_l_e_m _*_e_l_e_m, _(_c_a_d_d_r___t_) _s_t_r_u_c_t _q_e_l_e_m _*_p_r_e_d); + + rreemmqquuee(_(_c_a_d_d_r___t_) _s_t_r_u_c_t _q_e_l_e_m _*_e_l_e_m); + +DDEESSCCRRIIPPTTIIOONN + The iinnssqquuee() and rreemmqquuee() functions manipulate queues built from doubly + linked lists. Each element in the queue must in the form of ``struct + qelem''. The function iinnssqquuee() inserts _e_l_e_m in a queue immediately after + _p_r_e_d; rreemmqquuee() removes an entry _e_l_e_m from a queue. + +SSEEEE AALLSSOO + _V_A_X _A_r_c_h_i_t_e_c_t_u_r_e _H_a_n_d_b_o_o_k, pp. 228-235. + +HHIISSTTOORRYY + The iinnssqquuee() and rreemmqquuee() functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/j0.0 b/usr/share/man/cat3/j0.0 new file mode 100644 index 0000000000..4898077bd6 --- /dev/null +++ b/usr/share/man/cat3/j0.0 @@ -0,0 +1,51 @@ +J0(3) BSD Programmer's Manual J0(3) + +NNAAMMEE + jj00, jj11, jjnn, yy00, yy11, yynn - bessel functions of first and second kind + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + jj00(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + jj11(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + jjnn(_i_n_t _n, _d_o_u_b_l_e _x); + + _d_o_u_b_l_e + yy00(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + yy11(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + yynn(_i_n_t _n, _d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The functions jj00() and jj11() compute the _B_e_s_s_e_l _f_u_n_c_t_i_o_n _o_f _t_h_e _f_i_r_s_t _k_i_n_d + _o_f _t_h_e _o_r_d_e_r 0 and the _o_r_d_e_r 1, respectively, for the real value _x; the + function jjnn() computes the _B_e_s_s_e_l _f_u_n_c_t_i_o_n _o_f _t_h_e _f_i_r_s_t _k_i_n_d _o_f _t_h_e + _i_n_t_e_g_e_r Bessel0 _n for the real value _x. + + The functions yy00() and yy11() compute the linearly independent _B_e_s_s_e_l + _f_u_n_c_t_i_o_n _o_f _t_h_e _s_e_c_o_n_d _k_i_n_d _o_f _t_h_e _o_r_d_e_r 0 and the _o_r_d_e_r 1, respectively, + for the postive _i_n_t_e_g_e_r value _x (expressed as a double); the function + yynn() computes the _B_e_s_s_e_l _f_u_n_c_t_i_o_n _o_f _t_h_e _s_e_c_o_n_d _k_i_n_d _f_o_r _t_h_e _i_n_t_e_g_e_r + Bessel0 _n for the postive _i_n_t_e_g_e_r value _x (expressed as a double). + +RREETTUURRNN VVAALLUUEESS + If these functions are successful, the computed value is returned. On the + VAX and Tahoe architectures, a negative _x value results in an error; the + global variable _e_r_r_n_o is set to EDOM and a reserve operand fault is gen- + erated. + +SSEEEE AALLSSOO + math(3), infnan(3) + +HHIISSTTOORRYY + A set of these functions function appeared in Version 7 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/j1.0 b/usr/share/man/cat3/j1.0 new file mode 100644 index 0000000000..4898077bd6 --- /dev/null +++ b/usr/share/man/cat3/j1.0 @@ -0,0 +1,51 @@ +J0(3) BSD Programmer's Manual J0(3) + +NNAAMMEE + jj00, jj11, jjnn, yy00, yy11, yynn - bessel functions of first and second kind + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + jj00(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + jj11(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + jjnn(_i_n_t _n, _d_o_u_b_l_e _x); + + _d_o_u_b_l_e + yy00(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + yy11(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + yynn(_i_n_t _n, _d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The functions jj00() and jj11() compute the _B_e_s_s_e_l _f_u_n_c_t_i_o_n _o_f _t_h_e _f_i_r_s_t _k_i_n_d + _o_f _t_h_e _o_r_d_e_r 0 and the _o_r_d_e_r 1, respectively, for the real value _x; the + function jjnn() computes the _B_e_s_s_e_l _f_u_n_c_t_i_o_n _o_f _t_h_e _f_i_r_s_t _k_i_n_d _o_f _t_h_e + _i_n_t_e_g_e_r Bessel0 _n for the real value _x. + + The functions yy00() and yy11() compute the linearly independent _B_e_s_s_e_l + _f_u_n_c_t_i_o_n _o_f _t_h_e _s_e_c_o_n_d _k_i_n_d _o_f _t_h_e _o_r_d_e_r 0 and the _o_r_d_e_r 1, respectively, + for the postive _i_n_t_e_g_e_r value _x (expressed as a double); the function + yynn() computes the _B_e_s_s_e_l _f_u_n_c_t_i_o_n _o_f _t_h_e _s_e_c_o_n_d _k_i_n_d _f_o_r _t_h_e _i_n_t_e_g_e_r + Bessel0 _n for the postive _i_n_t_e_g_e_r value _x (expressed as a double). + +RREETTUURRNN VVAALLUUEESS + If these functions are successful, the computed value is returned. On the + VAX and Tahoe architectures, a negative _x value results in an error; the + global variable _e_r_r_n_o is set to EDOM and a reserve operand fault is gen- + erated. + +SSEEEE AALLSSOO + math(3), infnan(3) + +HHIISSTTOORRYY + A set of these functions function appeared in Version 7 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/jn.0 b/usr/share/man/cat3/jn.0 new file mode 100644 index 0000000000..4898077bd6 --- /dev/null +++ b/usr/share/man/cat3/jn.0 @@ -0,0 +1,51 @@ +J0(3) BSD Programmer's Manual J0(3) + +NNAAMMEE + jj00, jj11, jjnn, yy00, yy11, yynn - bessel functions of first and second kind + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + jj00(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + jj11(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + jjnn(_i_n_t _n, _d_o_u_b_l_e _x); + + _d_o_u_b_l_e + yy00(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + yy11(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + yynn(_i_n_t _n, _d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The functions jj00() and jj11() compute the _B_e_s_s_e_l _f_u_n_c_t_i_o_n _o_f _t_h_e _f_i_r_s_t _k_i_n_d + _o_f _t_h_e _o_r_d_e_r 0 and the _o_r_d_e_r 1, respectively, for the real value _x; the + function jjnn() computes the _B_e_s_s_e_l _f_u_n_c_t_i_o_n _o_f _t_h_e _f_i_r_s_t _k_i_n_d _o_f _t_h_e + _i_n_t_e_g_e_r Bessel0 _n for the real value _x. + + The functions yy00() and yy11() compute the linearly independent _B_e_s_s_e_l + _f_u_n_c_t_i_o_n _o_f _t_h_e _s_e_c_o_n_d _k_i_n_d _o_f _t_h_e _o_r_d_e_r 0 and the _o_r_d_e_r 1, respectively, + for the postive _i_n_t_e_g_e_r value _x (expressed as a double); the function + yynn() computes the _B_e_s_s_e_l _f_u_n_c_t_i_o_n _o_f _t_h_e _s_e_c_o_n_d _k_i_n_d _f_o_r _t_h_e _i_n_t_e_g_e_r + Bessel0 _n for the postive _i_n_t_e_g_e_r value _x (expressed as a double). + +RREETTUURRNN VVAALLUUEESS + If these functions are successful, the computed value is returned. On the + VAX and Tahoe architectures, a negative _x value results in an error; the + global variable _e_r_r_n_o is set to EDOM and a reserve operand fault is gen- + erated. + +SSEEEE AALLSSOO + math(3), infnan(3) + +HHIISSTTOORRYY + A set of these functions function appeared in Version 7 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/kvm.0 b/usr/share/man/cat3/kvm.0 new file mode 100644 index 0000000000..41adcd438a --- /dev/null +++ b/usr/share/man/cat3/kvm.0 @@ -0,0 +1,45 @@ +KVM(3) BSD Programmer's Manual KVM(3) + +NNAAMMEE + kkvvmm - kernel memory interface + +DDEESSCCRRIIPPTTIIOONN + The kvm(3) library provides a uniform interface for accessing kernel vir- + tual memory images, including live systems and crashdumps. Access to + live systems is via /dev/mem while crashdumps can be examined via the + core file generated by savecore(8). The interface behaves identically in + both cases. Memory can be read and written, kernel symbol addresses can + be looked up efficiently, and information about user processes can be + gathered. + + kkvvmm__ooppeenn() is first called to obtain a descriptor for all subsequent + calls. + +CCOOMMPPAATTIIBBIILLIITTYY + The kvm interface was first introduced in SunOS. A considerable number + of programs have been developed that use this interface, making backward + compatibility highly desirable. In most respects, the Sun kvm interface + is consistent and clean. Accordingly, the generic portion of the inter- + face (i.e., kkvvmm__ooppeenn(), kkvvmm__cclloossee(), kkvvmm__rreeaadd(), kkvvmm__wwrriittee(), and + kkvvmm__nnlliisstt()) has been incorporated into the BSD interface. Indeed, many + kvm applications (i.e., debuggers and statistical monitors) use only this + subset of the interface. + + The process interface was not kept. This is not a portability issue + since any code that manipulates processes is inherently machine depen- + dent. + + Finally, the Sun kvm error reporting semantics are poorly defined. The + library can be configured either to print errors to stderr automatically, + or to print no error messages at all. In the latter case, the nature of + the error cannot be determined. To overcome this, the BSD interface in- + cludes a routine, kvm_geterr(3), to return (not print out) the error + message corresponding to the most recent error condition on the given de- + scriptor. + +SSEEEE AALLSSOO + kvm_close(3), kvm_getargv(3), kvm_getenvv(3), kvm_geterr(3), + kvm_getloadavg(3), kvm_getprocs(3), kvm_nlist(3), kvm_open(3), + kvm_openfiles(3), kvm_read(3), kvm_write(3) + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/kvm_close.0 b/usr/share/man/cat3/kvm_close.0 new file mode 100644 index 0000000000..4a9815b28c --- /dev/null +++ b/usr/share/man/cat3/kvm_close.0 @@ -0,0 +1,82 @@ +KVM_OPEN(3) BSD Programmer's Manual KVM_OPEN(3) + +NNAAMMEE + kkvvmm__ooppeenn, kkvvmm__ooppeennffiilleess, kkvvmm__cclloossee - initialize kernel virtual memory ac- + cess + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _k_v_m___t _* + kkvvmm__ooppeenn(_c_o_n_s_t _c_h_a_r _*_e_x_e_c_f_i_l_e, _c_o_n_s_t _c_h_a_r _*_c_o_r_e_f_i_l_e, _c_h_a_r _*_s_w_a_p_f_i_l_e, + _i_n_t _f_l_a_g_s, _c_o_n_s_t _c_h_a_r _*_e_r_r_s_t_r); + + _k_v_m___t _* + kkvvmm__ooppeennffiilleess(_c_o_n_s_t _c_h_a_r _*_e_x_e_c_f_i_l_e, _c_o_n_s_t _c_h_a_r _*_c_o_r_e_f_i_l_e, _c_h_a_r _*_s_w_a_p_f_i_l_e, + _i_n_t _f_l_a_g_s, _c_h_a_r _*_e_r_r_b_u_f); + + _i_n_t + kkvvmm__cclloossee(_k_v_m___t _*_k_d); + +DDEESSCCRRIIPPTTIIOONN + The functions kkvvmm__ooppeenn() and kkvvmm__ooppeennffiilleess() return a descriptor used to + access kernel virtual memory via the kvm(3) library routines. Both ac- + tive kernels and crash dumps are accessible through this interface. + + _e_x_e_c_f_i_l_e is the executable image of the kernel being examined. This file + must contain a symbol table. If this argument is NULL, the currently + running system is assumed, which is indicated by _PATH_UNIX in . + + _c_o_r_e_f_i_l_e is the kernel memory device file. It can be either /dev/mem or + a crash dump core generated by savecore(8). If _c_o_r_e_f_i_l_e is NULL, the de- + fault indicated by _PATH_MEM from is used. + + _s_w_a_p_f_i_l_e should indicate the swap device. If NULL, _PATH_DRUM from + is used. + + The _f_l_a_g_s argument indicates read/write access as in open(2) and applies + to only the core file. Only O_RDONLY, O_WRONLY, and O_RDWR are permit- + ted. + + There are two open routines which differ only with respect to the error + mechanism. One provides backward compatibility with the SunOS kvm li- + brary, while the other provides an improved error reporting framework. + + The kkvvmm__ooppeenn() function is the Sun kvm compatible open call. Here, the + _e_r_r_s_t_r argument indicates how errors should be handled. If it is NULL, + no errors are reported and the application cannot know the specific na- + ture of the failed kvm call. If it is not NULL, errors are printed to + stderr with _e_r_r_s_t_r prepended to the message, as in perror(3). Normally, + the name of the program is used here. The string is assumed to persist + at least until the corresponding kkvvmm__cclloossee() call. + + The kkvvmm__ooppeennffiilleess() function provides BSD style error reporting. Here, + error messages are not printed out by the library. Instead, the applica- + tion obtains the error message corresponding to the most recent kvm li- + brary call using kkvvmm__ggeetteerrrr() (see kvm_geterr(3)). The results are unde- + fined if the most recent kvm call did not produce an error. Since + kkvvmm__ggeetteerrrr() requires a kvm descriptor, but the open routines return NULL + on failure, kkvvmm__ggeetteerrrr() cannot be used to get the error message if open + fails. Thus, kkvvmm__ooppeennffiilleess() will place any error message in the _e_r_r_b_u_f + argument. This buffer should be _POSIX2_LINE_MAX characters large (from + ). + +RREETTUURRNN VVAALLUUEESS + The kkvvmm__ooppeenn() and kkvvmm__ooppeennffiilleess() functions both return a descriptor to + be used in all subsequent kvm library calls. The library is fully re- + entrant. On failure, NULL is returned, in which case kkvvmm__ooppeennffiilleess() + writes the error message into _e_r_r_b_u_f. + + The kkvvmm__cclloossee() function returns 0 on sucess and -1 on failure. + +BBUUGGSS + There should not be two open calls. The ill-defined error semantics of + the Sun library and the desire to have a backward-compatible library for + BSD left little choice. + +SSEEEE AALLSSOO + open(2), kvm(3), kvm_getargv(3), kvm_getenvv(3), kvm_geterr(3), + kvm_getprocs(3), kvm_nlist(3), kvm_read(3), kvm_write(3) + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/kvm_getargv.0 b/usr/share/man/cat3/kvm_getargv.0 new file mode 100644 index 0000000000..1592f21a4c --- /dev/null +++ b/usr/share/man/cat3/kvm_getargv.0 @@ -0,0 +1,74 @@ +KVM_GETPROCS(3) BSD Programmer's Manual KVM_GETPROCS(3) + +NNAAMMEE + kkvvmm__ggeettpprrooccss, kkvvmm__ggeettaarrggvv, kkvvmm__ggeetteennvvvv - access user process state + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _s_t_r_u_c_t _k_i_n_f_o___p_r_o_c _* + kkvvmm__ggeettpprrooccss(_k_v_m___t _*_k_d, _i_n_t _o_p, _i_n_t _a_r_g, _i_n_t _*_c_n_t); + + _c_h_a_r _*_* + kkvvmm__ggeettaarrggvv(_k_v_m___t _*_k_d, _c_o_n_s_t _s_t_r_u_c_t _k_i_n_f_o___p_r_o_c _*_p, _i_n_t _n_c_h_r); + + _c_h_a_r _*_* + kkvvmm__ggeetteennvvvv(_k_v_m___t _*_k_d, _c_o_n_s_t _s_t_r_u_c_t _k_i_n_f_o___p_r_o_c _*_p, _i_n_t _n_c_h_r); + +DDEESSCCRRIIPPTTIIOONN + kkvvmm__ggeettpprrooccss() returns a (sub-)set of active processes in the kernel in- + dicated by _k_d_. The _o_p and _a_r_g arguments constitute a predicate which lim- + its the set of processes returned. The value of _o_p describes the filter- + ing predicate as follows: + + KKIINNFFOO__PPRROOCC__AALLLL all processes + KKIINNFFOO__PPRROOCC__PPIIDD processes with process id _a_r_g + KKIINNFFOO__PPRROOCC__PPGGRRPP processes with process group _a_r_g + KKIINNFFOO__PPRROOCC__SSEESSSSIIOONN processes with session _a_r_g + KKIINNFFOO__PPRROOCC__TTTTYY processes with tty _a_r_g + KKIINNFFOO__PPRROOCC__UUIIDD processes with effective user id _a_r_g + KKIINNFFOO__PPRROOCC__RRUUIIDD processes with real user id _a_r_g + + The number of processes found is returned in the reference parameter _c_n_t. + The processes are returned as a contiguous array of kinfo_proc struc- + tures. This memory is locally allocated, and subsequent calls to + kkvvmm__ggeettpprrooccss() and kkvvmm__cclloossee() will overwrite this storage. + + kkvvmm__ggeettaarrggvv() returns a null-terminated argument vector that corresponds + to the command line arguments passed to process indicated by _p. Most + likely, these arguments correspond to the values passed to exec(3) on + process creation. This information is, however, deliberately under con- + trol of the process itself. Note that the original command name can be + found, unaltered, in the p_comm field of the process structure returned + by kkvvmm__ggeettpprrooccss(). + + The _n_c_h_r argument indicates the maximum number of characters, including + null bytes, to use in building the strings. If this amount is exceeded, + the string causing the overflow is truncated and the partial result is + returned. This is handy for programs like ps(1) and w(1) that print only + a one line summary of a command and should not copy out large amounts of + text only to ignore it. If _n_c_h_r is zero, no limit is imposed and all ar- + gument strings are returned in their entirety. + + The memory allocated to the argv pointers and string storage is owned by + the kvm library. Subsequent kkvvmm__ggeettpprrooccss() and kvm_close(3) calls will + clobber this storage. + + The kkvvmm__ggeetteennvvvv() function is similar to kkvvmm__ggeettaarrggvv() but returns the + vector of environment strings. This data is also alterable by the pro- + cess. + +RREETTUURRNN VVAALLUUEESS + kkvvmm__ggeettpprrooccss(), kkvvmm__ggeettaarrggvv(), and kkvvmm__ggeetteennvvvv(), all return NULL on + failure. + +BBUUGGSS + These routines do not belong in the kvm interface. + +SSEEEE AALLSSOO + kvm(3), kvm_close(3), kvm_geterr(3), kvm_nlist(3), kvm_open(3), + kvm_openfiles(3), kvm_read(3), kvm_write(3) + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/kvm_getenvv.0 b/usr/share/man/cat3/kvm_getenvv.0 new file mode 100644 index 0000000000..1592f21a4c --- /dev/null +++ b/usr/share/man/cat3/kvm_getenvv.0 @@ -0,0 +1,74 @@ +KVM_GETPROCS(3) BSD Programmer's Manual KVM_GETPROCS(3) + +NNAAMMEE + kkvvmm__ggeettpprrooccss, kkvvmm__ggeettaarrggvv, kkvvmm__ggeetteennvvvv - access user process state + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _s_t_r_u_c_t _k_i_n_f_o___p_r_o_c _* + kkvvmm__ggeettpprrooccss(_k_v_m___t _*_k_d, _i_n_t _o_p, _i_n_t _a_r_g, _i_n_t _*_c_n_t); + + _c_h_a_r _*_* + kkvvmm__ggeettaarrggvv(_k_v_m___t _*_k_d, _c_o_n_s_t _s_t_r_u_c_t _k_i_n_f_o___p_r_o_c _*_p, _i_n_t _n_c_h_r); + + _c_h_a_r _*_* + kkvvmm__ggeetteennvvvv(_k_v_m___t _*_k_d, _c_o_n_s_t _s_t_r_u_c_t _k_i_n_f_o___p_r_o_c _*_p, _i_n_t _n_c_h_r); + +DDEESSCCRRIIPPTTIIOONN + kkvvmm__ggeettpprrooccss() returns a (sub-)set of active processes in the kernel in- + dicated by _k_d_. The _o_p and _a_r_g arguments constitute a predicate which lim- + its the set of processes returned. The value of _o_p describes the filter- + ing predicate as follows: + + KKIINNFFOO__PPRROOCC__AALLLL all processes + KKIINNFFOO__PPRROOCC__PPIIDD processes with process id _a_r_g + KKIINNFFOO__PPRROOCC__PPGGRRPP processes with process group _a_r_g + KKIINNFFOO__PPRROOCC__SSEESSSSIIOONN processes with session _a_r_g + KKIINNFFOO__PPRROOCC__TTTTYY processes with tty _a_r_g + KKIINNFFOO__PPRROOCC__UUIIDD processes with effective user id _a_r_g + KKIINNFFOO__PPRROOCC__RRUUIIDD processes with real user id _a_r_g + + The number of processes found is returned in the reference parameter _c_n_t. + The processes are returned as a contiguous array of kinfo_proc struc- + tures. This memory is locally allocated, and subsequent calls to + kkvvmm__ggeettpprrooccss() and kkvvmm__cclloossee() will overwrite this storage. + + kkvvmm__ggeettaarrggvv() returns a null-terminated argument vector that corresponds + to the command line arguments passed to process indicated by _p. Most + likely, these arguments correspond to the values passed to exec(3) on + process creation. This information is, however, deliberately under con- + trol of the process itself. Note that the original command name can be + found, unaltered, in the p_comm field of the process structure returned + by kkvvmm__ggeettpprrooccss(). + + The _n_c_h_r argument indicates the maximum number of characters, including + null bytes, to use in building the strings. If this amount is exceeded, + the string causing the overflow is truncated and the partial result is + returned. This is handy for programs like ps(1) and w(1) that print only + a one line summary of a command and should not copy out large amounts of + text only to ignore it. If _n_c_h_r is zero, no limit is imposed and all ar- + gument strings are returned in their entirety. + + The memory allocated to the argv pointers and string storage is owned by + the kvm library. Subsequent kkvvmm__ggeettpprrooccss() and kvm_close(3) calls will + clobber this storage. + + The kkvvmm__ggeetteennvvvv() function is similar to kkvvmm__ggeettaarrggvv() but returns the + vector of environment strings. This data is also alterable by the pro- + cess. + +RREETTUURRNN VVAALLUUEESS + kkvvmm__ggeettpprrooccss(), kkvvmm__ggeettaarrggvv(), and kkvvmm__ggeetteennvvvv(), all return NULL on + failure. + +BBUUGGSS + These routines do not belong in the kvm interface. + +SSEEEE AALLSSOO + kvm(3), kvm_close(3), kvm_geterr(3), kvm_nlist(3), kvm_open(3), + kvm_openfiles(3), kvm_read(3), kvm_write(3) + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/kvm_geterr.0 b/usr/share/man/cat3/kvm_geterr.0 new file mode 100644 index 0000000000..c3f9d539ec --- /dev/null +++ b/usr/share/man/cat3/kvm_geterr.0 @@ -0,0 +1,31 @@ +KVM_GETERR(3) BSD Programmer's Manual KVM_GETERR(3) + +NNAAMMEE + kkvvmm__ggeetteerrrr - get error message on kvm descriptor + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + kkvvmm__ggeetteerrrr(_k_v_m___t _*_k_d); + +DDEESSCCRRIIPPTTIIOONN + This function returns a string describing the most recent error condition + on the descriptor _k_d. The results are undefined if the most recent kvm(3) + library call did not produce an error. The string returned is stored in + memory owned by kvm(3) so the message should be copied out and saved + elsewhere if necessary. + +BBUUGGSS + This routine cannot be used to access error conditions due to a failed + kkvvmm__ooppeennffiilleess() call, since failure is indicated by returning a NULL de- + scriptor. Therefore, errors on open are output to the special error + buffer passed to kkvvmm__ooppeennffiilleess(). This option is not available to + kkvvmm__ooppeenn(). + +SSEEEE AALLSSOO + kvm(3), kvm_close(3), kvm_getargv(3), kvm_getenvv(3), + kvm_getprocs(3), kvm_nlist(3), kvm_open(3), kvm_openfiles(3), + kvm_read(3), kvm_write(3) + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/kvm_getfiles.0 b/usr/share/man/cat3/kvm_getfiles.0 new file mode 100644 index 0000000000..942d02523b --- /dev/null +++ b/usr/share/man/cat3/kvm_getfiles.0 @@ -0,0 +1,37 @@ +KVM_GETFILES(3) BSD Programmer's Manual KVM_GETFILES(3) + +NNAAMMEE + kkvvmm__ggeettffiilleess - survey open files + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##ddeeffiinnee KKEERRNNEELL + ##iinncclluuddee <> + ##uunnddeeff KKEERRNNEELL + + _c_h_a_r _* + kkvvmm__ggeettffiilleess(_k_v_m___t _*_k_d, _i_n_t _o_p, _i_n_t _a_r_g, _i_n_t _*_c_n_t); + +DDEESSCCRRIIPPTTIIOONN + kkvvmm__ggeettffiilleess() returns a (sub-)set of the open files in the kernel indi- + cated by _k_d_. The _o_p and _a_r_g arguments constitute a predicate which limits + the set of files returned. No predicates are currently defined. + + The number of processes found is returned in the reference parameter _c_n_t. + The files are returned as a contiguous array of file structures, preceed- + ed by the address of the first file entry in the kernel. This memory is + owned by kvm and is not guaranteed to be persistent across subsequent kvm + library calls. Data should be copied out if it needs to be saved. + +RREETTUURRNN VVAALLUUEESS + kkvvmm__ggeettffiilleess() will return NULL on failure. + +BBUUGGSS + This routine does not belong in the kvm interface. + +SSEEEE AALLSSOO + kvm(3), kvm_open(3), kvm_openfiles(3), kvm_close(3), kvm_read(3), + kvm_write(3), kvm_nlist(3), kvm_geterr(3) + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/kvm_getloadavg.0 b/usr/share/man/cat3/kvm_getloadavg.0 new file mode 100644 index 0000000000..53f22861a4 --- /dev/null +++ b/usr/share/man/cat3/kvm_getloadavg.0 @@ -0,0 +1,27 @@ +KVM_GETLOADAVG(3) BSD Programmer's Manual KVM_GETLOADAVG(3) + +NNAAMMEE + kkvvmm__ggeettllooaaddaavvgg - get error message on kvm descriptor + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + kkvvmm__ggeettllooaaddaavvgg(_k_v_m___t _*_k_d, _d_o_u_b_l_e _l_o_a_d_a_v_g_[_], _i_n_t _n_e_l_e_m); + +DDEESSCCRRIIPPTTIIOONN + The kkvvmm__ggeettllooaaddaavvgg() function returns the number of processes in the sys- + tem run queue of the kernel indicated by _k_d, averaged over various peri- + ods of time. Up to _n_e_l_e_m samples are retrieved and assigned to succes- + sive elements of _l_o_a_d_a_v_g[]. The system imposes a maximum of 3 samples, + representing averages over the last 1, 5, and 15 minutes, respectively. + +DDIIAAGGNNOOSSTTIICCSS + If the load average was unobtainable, -1 is returned; otherwise, the num- + ber of samples actually retrieved is returned. + +SSEEEE AALLSSOO + uptime(1), kvm(3), getloadavg(3) + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/kvm_getprocs.0 b/usr/share/man/cat3/kvm_getprocs.0 new file mode 100644 index 0000000000..1592f21a4c --- /dev/null +++ b/usr/share/man/cat3/kvm_getprocs.0 @@ -0,0 +1,74 @@ +KVM_GETPROCS(3) BSD Programmer's Manual KVM_GETPROCS(3) + +NNAAMMEE + kkvvmm__ggeettpprrooccss, kkvvmm__ggeettaarrggvv, kkvvmm__ggeetteennvvvv - access user process state + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _s_t_r_u_c_t _k_i_n_f_o___p_r_o_c _* + kkvvmm__ggeettpprrooccss(_k_v_m___t _*_k_d, _i_n_t _o_p, _i_n_t _a_r_g, _i_n_t _*_c_n_t); + + _c_h_a_r _*_* + kkvvmm__ggeettaarrggvv(_k_v_m___t _*_k_d, _c_o_n_s_t _s_t_r_u_c_t _k_i_n_f_o___p_r_o_c _*_p, _i_n_t _n_c_h_r); + + _c_h_a_r _*_* + kkvvmm__ggeetteennvvvv(_k_v_m___t _*_k_d, _c_o_n_s_t _s_t_r_u_c_t _k_i_n_f_o___p_r_o_c _*_p, _i_n_t _n_c_h_r); + +DDEESSCCRRIIPPTTIIOONN + kkvvmm__ggeettpprrooccss() returns a (sub-)set of active processes in the kernel in- + dicated by _k_d_. The _o_p and _a_r_g arguments constitute a predicate which lim- + its the set of processes returned. The value of _o_p describes the filter- + ing predicate as follows: + + KKIINNFFOO__PPRROOCC__AALLLL all processes + KKIINNFFOO__PPRROOCC__PPIIDD processes with process id _a_r_g + KKIINNFFOO__PPRROOCC__PPGGRRPP processes with process group _a_r_g + KKIINNFFOO__PPRROOCC__SSEESSSSIIOONN processes with session _a_r_g + KKIINNFFOO__PPRROOCC__TTTTYY processes with tty _a_r_g + KKIINNFFOO__PPRROOCC__UUIIDD processes with effective user id _a_r_g + KKIINNFFOO__PPRROOCC__RRUUIIDD processes with real user id _a_r_g + + The number of processes found is returned in the reference parameter _c_n_t. + The processes are returned as a contiguous array of kinfo_proc struc- + tures. This memory is locally allocated, and subsequent calls to + kkvvmm__ggeettpprrooccss() and kkvvmm__cclloossee() will overwrite this storage. + + kkvvmm__ggeettaarrggvv() returns a null-terminated argument vector that corresponds + to the command line arguments passed to process indicated by _p. Most + likely, these arguments correspond to the values passed to exec(3) on + process creation. This information is, however, deliberately under con- + trol of the process itself. Note that the original command name can be + found, unaltered, in the p_comm field of the process structure returned + by kkvvmm__ggeettpprrooccss(). + + The _n_c_h_r argument indicates the maximum number of characters, including + null bytes, to use in building the strings. If this amount is exceeded, + the string causing the overflow is truncated and the partial result is + returned. This is handy for programs like ps(1) and w(1) that print only + a one line summary of a command and should not copy out large amounts of + text only to ignore it. If _n_c_h_r is zero, no limit is imposed and all ar- + gument strings are returned in their entirety. + + The memory allocated to the argv pointers and string storage is owned by + the kvm library. Subsequent kkvvmm__ggeettpprrooccss() and kvm_close(3) calls will + clobber this storage. + + The kkvvmm__ggeetteennvvvv() function is similar to kkvvmm__ggeettaarrggvv() but returns the + vector of environment strings. This data is also alterable by the pro- + cess. + +RREETTUURRNN VVAALLUUEESS + kkvvmm__ggeettpprrooccss(), kkvvmm__ggeettaarrggvv(), and kkvvmm__ggeetteennvvvv(), all return NULL on + failure. + +BBUUGGSS + These routines do not belong in the kvm interface. + +SSEEEE AALLSSOO + kvm(3), kvm_close(3), kvm_geterr(3), kvm_nlist(3), kvm_open(3), + kvm_openfiles(3), kvm_read(3), kvm_write(3) + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/kvm_nlist.0 b/usr/share/man/cat3/kvm_nlist.0 new file mode 100644 index 0000000000..e4487f68e0 --- /dev/null +++ b/usr/share/man/cat3/kvm_nlist.0 @@ -0,0 +1,37 @@ +KVM_NLIST(3) BSD Programmer's Manual KVM_NLIST(3) + +NNAAMMEE + kkvvmm__nnlliisstt - retrieve symbol table names from a kernel image + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + kkvvmm__nnlliisstt(_k_v_m___t _*_k_d, _s_t_r_u_c_t _n_l_i_s_t _*_n_l); + +DDEESSCCRRIIPPTTIIOONN + kkvvmm__nnlliisstt() retrieves the symbol table entries indicated by the name list + argument _n_l. This argument points to an array of nlist structures, termi- + nated by an entry whose n_name field is NULL (see nlist(3)). Each symbol + is looked up using the n_name field, and if found, the corresponding + n_type and n_value fields are filled in. These fields are set to 0 if + the symbol is not found. + + The program kvm_mkdb(8) builds a database from the running kernel's + namelist. If the database matches the opened kernel, kkvvmm__nnlliisstt() uses it + to speed lookups. + +RREETTUURRNN VVAALLUUEESS + The kkvvmm__nnlliisstt() function returns the number of invalid entries found. If + the kernel symbol table was unreadable, -1 is returned. + +FFIILLEESS + /var/db/kvm_vmunix.db + +SSEEEE AALLSSOO + kvm(3), kvm_close(3), kvm_getargv(3), kvm_getenvv(3), kvm_geterr(3), + kvm_getprocs(3), kvm_open(3), kvm_openfiles(3), kvm_read(3), + kvm_write(3), kvm_mkdb(8) + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/kvm_open.0 b/usr/share/man/cat3/kvm_open.0 new file mode 100644 index 0000000000..4a9815b28c --- /dev/null +++ b/usr/share/man/cat3/kvm_open.0 @@ -0,0 +1,82 @@ +KVM_OPEN(3) BSD Programmer's Manual KVM_OPEN(3) + +NNAAMMEE + kkvvmm__ooppeenn, kkvvmm__ooppeennffiilleess, kkvvmm__cclloossee - initialize kernel virtual memory ac- + cess + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _k_v_m___t _* + kkvvmm__ooppeenn(_c_o_n_s_t _c_h_a_r _*_e_x_e_c_f_i_l_e, _c_o_n_s_t _c_h_a_r _*_c_o_r_e_f_i_l_e, _c_h_a_r _*_s_w_a_p_f_i_l_e, + _i_n_t _f_l_a_g_s, _c_o_n_s_t _c_h_a_r _*_e_r_r_s_t_r); + + _k_v_m___t _* + kkvvmm__ooppeennffiilleess(_c_o_n_s_t _c_h_a_r _*_e_x_e_c_f_i_l_e, _c_o_n_s_t _c_h_a_r _*_c_o_r_e_f_i_l_e, _c_h_a_r _*_s_w_a_p_f_i_l_e, + _i_n_t _f_l_a_g_s, _c_h_a_r _*_e_r_r_b_u_f); + + _i_n_t + kkvvmm__cclloossee(_k_v_m___t _*_k_d); + +DDEESSCCRRIIPPTTIIOONN + The functions kkvvmm__ooppeenn() and kkvvmm__ooppeennffiilleess() return a descriptor used to + access kernel virtual memory via the kvm(3) library routines. Both ac- + tive kernels and crash dumps are accessible through this interface. + + _e_x_e_c_f_i_l_e is the executable image of the kernel being examined. This file + must contain a symbol table. If this argument is NULL, the currently + running system is assumed, which is indicated by _PATH_UNIX in . + + _c_o_r_e_f_i_l_e is the kernel memory device file. It can be either /dev/mem or + a crash dump core generated by savecore(8). If _c_o_r_e_f_i_l_e is NULL, the de- + fault indicated by _PATH_MEM from is used. + + _s_w_a_p_f_i_l_e should indicate the swap device. If NULL, _PATH_DRUM from + is used. + + The _f_l_a_g_s argument indicates read/write access as in open(2) and applies + to only the core file. Only O_RDONLY, O_WRONLY, and O_RDWR are permit- + ted. + + There are two open routines which differ only with respect to the error + mechanism. One provides backward compatibility with the SunOS kvm li- + brary, while the other provides an improved error reporting framework. + + The kkvvmm__ooppeenn() function is the Sun kvm compatible open call. Here, the + _e_r_r_s_t_r argument indicates how errors should be handled. If it is NULL, + no errors are reported and the application cannot know the specific na- + ture of the failed kvm call. If it is not NULL, errors are printed to + stderr with _e_r_r_s_t_r prepended to the message, as in perror(3). Normally, + the name of the program is used here. The string is assumed to persist + at least until the corresponding kkvvmm__cclloossee() call. + + The kkvvmm__ooppeennffiilleess() function provides BSD style error reporting. Here, + error messages are not printed out by the library. Instead, the applica- + tion obtains the error message corresponding to the most recent kvm li- + brary call using kkvvmm__ggeetteerrrr() (see kvm_geterr(3)). The results are unde- + fined if the most recent kvm call did not produce an error. Since + kkvvmm__ggeetteerrrr() requires a kvm descriptor, but the open routines return NULL + on failure, kkvvmm__ggeetteerrrr() cannot be used to get the error message if open + fails. Thus, kkvvmm__ooppeennffiilleess() will place any error message in the _e_r_r_b_u_f + argument. This buffer should be _POSIX2_LINE_MAX characters large (from + ). + +RREETTUURRNN VVAALLUUEESS + The kkvvmm__ooppeenn() and kkvvmm__ooppeennffiilleess() functions both return a descriptor to + be used in all subsequent kvm library calls. The library is fully re- + entrant. On failure, NULL is returned, in which case kkvvmm__ooppeennffiilleess() + writes the error message into _e_r_r_b_u_f. + + The kkvvmm__cclloossee() function returns 0 on sucess and -1 on failure. + +BBUUGGSS + There should not be two open calls. The ill-defined error semantics of + the Sun library and the desire to have a backward-compatible library for + BSD left little choice. + +SSEEEE AALLSSOO + open(2), kvm(3), kvm_getargv(3), kvm_getenvv(3), kvm_geterr(3), + kvm_getprocs(3), kvm_nlist(3), kvm_read(3), kvm_write(3) + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/kvm_openfiles.0 b/usr/share/man/cat3/kvm_openfiles.0 new file mode 100644 index 0000000000..4a9815b28c --- /dev/null +++ b/usr/share/man/cat3/kvm_openfiles.0 @@ -0,0 +1,82 @@ +KVM_OPEN(3) BSD Programmer's Manual KVM_OPEN(3) + +NNAAMMEE + kkvvmm__ooppeenn, kkvvmm__ooppeennffiilleess, kkvvmm__cclloossee - initialize kernel virtual memory ac- + cess + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _k_v_m___t _* + kkvvmm__ooppeenn(_c_o_n_s_t _c_h_a_r _*_e_x_e_c_f_i_l_e, _c_o_n_s_t _c_h_a_r _*_c_o_r_e_f_i_l_e, _c_h_a_r _*_s_w_a_p_f_i_l_e, + _i_n_t _f_l_a_g_s, _c_o_n_s_t _c_h_a_r _*_e_r_r_s_t_r); + + _k_v_m___t _* + kkvvmm__ooppeennffiilleess(_c_o_n_s_t _c_h_a_r _*_e_x_e_c_f_i_l_e, _c_o_n_s_t _c_h_a_r _*_c_o_r_e_f_i_l_e, _c_h_a_r _*_s_w_a_p_f_i_l_e, + _i_n_t _f_l_a_g_s, _c_h_a_r _*_e_r_r_b_u_f); + + _i_n_t + kkvvmm__cclloossee(_k_v_m___t _*_k_d); + +DDEESSCCRRIIPPTTIIOONN + The functions kkvvmm__ooppeenn() and kkvvmm__ooppeennffiilleess() return a descriptor used to + access kernel virtual memory via the kvm(3) library routines. Both ac- + tive kernels and crash dumps are accessible through this interface. + + _e_x_e_c_f_i_l_e is the executable image of the kernel being examined. This file + must contain a symbol table. If this argument is NULL, the currently + running system is assumed, which is indicated by _PATH_UNIX in . + + _c_o_r_e_f_i_l_e is the kernel memory device file. It can be either /dev/mem or + a crash dump core generated by savecore(8). If _c_o_r_e_f_i_l_e is NULL, the de- + fault indicated by _PATH_MEM from is used. + + _s_w_a_p_f_i_l_e should indicate the swap device. If NULL, _PATH_DRUM from + is used. + + The _f_l_a_g_s argument indicates read/write access as in open(2) and applies + to only the core file. Only O_RDONLY, O_WRONLY, and O_RDWR are permit- + ted. + + There are two open routines which differ only with respect to the error + mechanism. One provides backward compatibility with the SunOS kvm li- + brary, while the other provides an improved error reporting framework. + + The kkvvmm__ooppeenn() function is the Sun kvm compatible open call. Here, the + _e_r_r_s_t_r argument indicates how errors should be handled. If it is NULL, + no errors are reported and the application cannot know the specific na- + ture of the failed kvm call. If it is not NULL, errors are printed to + stderr with _e_r_r_s_t_r prepended to the message, as in perror(3). Normally, + the name of the program is used here. The string is assumed to persist + at least until the corresponding kkvvmm__cclloossee() call. + + The kkvvmm__ooppeennffiilleess() function provides BSD style error reporting. Here, + error messages are not printed out by the library. Instead, the applica- + tion obtains the error message corresponding to the most recent kvm li- + brary call using kkvvmm__ggeetteerrrr() (see kvm_geterr(3)). The results are unde- + fined if the most recent kvm call did not produce an error. Since + kkvvmm__ggeetteerrrr() requires a kvm descriptor, but the open routines return NULL + on failure, kkvvmm__ggeetteerrrr() cannot be used to get the error message if open + fails. Thus, kkvvmm__ooppeennffiilleess() will place any error message in the _e_r_r_b_u_f + argument. This buffer should be _POSIX2_LINE_MAX characters large (from + ). + +RREETTUURRNN VVAALLUUEESS + The kkvvmm__ooppeenn() and kkvvmm__ooppeennffiilleess() functions both return a descriptor to + be used in all subsequent kvm library calls. The library is fully re- + entrant. On failure, NULL is returned, in which case kkvvmm__ooppeennffiilleess() + writes the error message into _e_r_r_b_u_f. + + The kkvvmm__cclloossee() function returns 0 on sucess and -1 on failure. + +BBUUGGSS + There should not be two open calls. The ill-defined error semantics of + the Sun library and the desire to have a backward-compatible library for + BSD left little choice. + +SSEEEE AALLSSOO + open(2), kvm(3), kvm_getargv(3), kvm_getenvv(3), kvm_geterr(3), + kvm_getprocs(3), kvm_nlist(3), kvm_read(3), kvm_write(3) + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/kvm_read.0 b/usr/share/man/cat3/kvm_read.0 new file mode 100644 index 0000000000..c26aa8837e --- /dev/null +++ b/usr/share/man/cat3/kvm_read.0 @@ -0,0 +1,34 @@ +KVM_READ(3) BSD Programmer's Manual KVM_READ(3) + +NNAAMMEE + kkvvmm__rreeaadd, kkvvmm__wwrriittee - read or write kernel virtual memory + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_s_i_z_e___t + kkvvmm__rreeaadd(_k_v_m___t _*_k_d, _u___l_o_n_g _a_d_d_r, _v_o_i_d _*_b_u_f, _s_i_z_e___t _n_b_y_t_e_s); + + _s_s_i_z_e___t + kkvvmm__wwrriittee(_k_v_m___t _*_k_d, _u___l_o_n_g _a_d_d_r, _c_o_n_s_t _v_o_i_d _*_b_u_f, _s_i_z_e___t _n_b_y_t_e_s); + +DDEESSCCRRIIPPTTIIOONN + The kkvvmm__rreeaadd() and kkvvmm__wwrriittee() functions are used to read and write ker- + nel virtual memory (or a crash dump file). See kkvvmm__ooppeenn(_3) or + kkvvmm__ooppeennffiilleess(_3) for information regarding opening kernel virtual memory + and crash dumps. + + The kkvvmm__rreeaadd() function transfers _n_b_y_t_e_s bytes of data from the kernel + space address _a_d_d_r to _b_u_f. Conversely, kkvvmm__wwrriittee() transfers data from + _b_u_f to _a_d_d_r. Unlike their SunOS counterparts, these functions cannot be + used to read or write process address spaces. + +RREETTUURRNN VVAALLUUEESS + Upon success, the number of bytes actually transferred is returned. Oth- + erwise, -1 is returned. + +SSEEEE AALLSSOO + kvm(3), kvm_close(3), kvm_getargv(3), kvm_getenvv(3), kvm_geterr(3), + kvm_getprocs(3), kvm_nlist(3), kvm_open(3), kvm_openfiles(3) + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/kvm_write.0 b/usr/share/man/cat3/kvm_write.0 new file mode 100644 index 0000000000..c26aa8837e --- /dev/null +++ b/usr/share/man/cat3/kvm_write.0 @@ -0,0 +1,34 @@ +KVM_READ(3) BSD Programmer's Manual KVM_READ(3) + +NNAAMMEE + kkvvmm__rreeaadd, kkvvmm__wwrriittee - read or write kernel virtual memory + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_s_i_z_e___t + kkvvmm__rreeaadd(_k_v_m___t _*_k_d, _u___l_o_n_g _a_d_d_r, _v_o_i_d _*_b_u_f, _s_i_z_e___t _n_b_y_t_e_s); + + _s_s_i_z_e___t + kkvvmm__wwrriittee(_k_v_m___t _*_k_d, _u___l_o_n_g _a_d_d_r, _c_o_n_s_t _v_o_i_d _*_b_u_f, _s_i_z_e___t _n_b_y_t_e_s); + +DDEESSCCRRIIPPTTIIOONN + The kkvvmm__rreeaadd() and kkvvmm__wwrriittee() functions are used to read and write ker- + nel virtual memory (or a crash dump file). See kkvvmm__ooppeenn(_3) or + kkvvmm__ooppeennffiilleess(_3) for information regarding opening kernel virtual memory + and crash dumps. + + The kkvvmm__rreeaadd() function transfers _n_b_y_t_e_s bytes of data from the kernel + space address _a_d_d_r to _b_u_f. Conversely, kkvvmm__wwrriittee() transfers data from + _b_u_f to _a_d_d_r. Unlike their SunOS counterparts, these functions cannot be + used to read or write process address spaces. + +RREETTUURRNN VVAALLUUEESS + Upon success, the number of bytes actually transferred is returned. Oth- + erwise, -1 is returned. + +SSEEEE AALLSSOO + kvm(3), kvm_close(3), kvm_getargv(3), kvm_getenvv(3), kvm_geterr(3), + kvm_getprocs(3), kvm_nlist(3), kvm_open(3), kvm_openfiles(3) + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/lgamma.0 b/usr/share/man/cat3/lgamma.0 new file mode 100644 index 0000000000..7032cd90ec --- /dev/null +++ b/usr/share/man/cat3/lgamma.0 @@ -0,0 +1,51 @@ +LGAMMA(3) BSD Programmer's Manual LGAMMA(3) + +NNAAMMEE + llggaammmmaa ggaammmmaa - log gamma function, gamma function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _e_x_t_e_r_n _i_n_t _s_i_g_n_g_a_m; + + _d_o_u_b_l_e + llggaammmmaa(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + ggaammmmaa(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN _ + LLggaammmmaa(_x) returns ln|| (x)|. + _ + The external integer _s_i_g_n_g_a_m returns the sign of | (x). + _ + GGaammmmaa(_x) returns | (x), with no effect on _s_i_g_n_g_a_m. + +IIDDIIOOSSYYNNCCRRAASSIIEESS + Do_ not use the expression ``signgam*exp(lgamma(x))'' to compute g := + | (x). Instead use a program like this (in C): + + lg = lgamma(x); g = signgam*exp(lg); + + Only after llggaammmmaa() has returned can signgam be correct. + + For arguments in its range, ggaammmmaa() is preferred, as for positive argu- + ments it is accurate to within one unit in the last place. Exponentia- + tion of llggaammmmaa() will lose up to 10 significant bits. + +RREETTUURRNN VVAALLUUEESS + GGaammmmaa() and llggaammmmaa() return appropriate values unless an arguent is out + of range. Overflow will occur for sufficiently large positive values, + and non-positive integers. On the VAX, the reserved operator is re- + turned, and _e_r_r_n_o is set to ERANGE For large non-integer negative values, + ggaammmmaa() will underflow. + +SSEEEE AALLSSOO + math(3), infnan(3) + +HHIISSTTOORRYY + The llggaammmmaa function appeared in 4.3BSD. The ggaammmmaa function appeared in + 4.4BSD. The name ggaammmmaa() was originally dedicated to the llggaammmmaa() func- + tion, so some old code may no longer be compatible. + +4.3 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/log.0 b/usr/share/man/cat3/log.0 new file mode 100644 index 0000000000..9283be7d56 --- /dev/null +++ b/usr/share/man/cat3/log.0 @@ -0,0 +1,118 @@ +EXP(3) BSD Programmer's Manual EXP(3) + +NNAAMMEE + eexxpp, eexxppmm11, lloogg, lloogg1100, lloogg11pp, ppooww - exponential, logarithm, power func- + tions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + eexxpp(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + eexxppmm11(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + lloogg(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + lloogg1100(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + lloogg11pp(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + ppooww(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + +DDEESSCCRRIIPPTTIIOONN + The eexxpp() function computes the exponential value of the given argument + _x. + + The eexxppmm11() function computes the value exp(x)-1 accurately even for tiny + argument _x. + + The lloogg() function computes the value for the natural logarithm of the + argument x. + + The lloogg1100() function computes the value for the logarithm of argument _x + to base 10. + + The lloogg11pp() function computes the value of log(1+x) accurately even for + tiny argument _x. + + The ppooww() computes the value of _x to the exponent _y. + +EERRRROORR ((dduuee ttoo RRoouunnddooffff eettcc..)) + exp(x), log(x), expm1(x) and log1p(x) are accurate to within an _u_p, and + log10(x) to within about 2 _u_p_s; an _u_p is one _U_n_i_t in the _L_a_s_t _P_l_a_c_e. The + error in ppooww(_x, _y) is below about 2 _u_p_s when its magnitude is moderate, + but increases as ppooww(_x, _y) approaches the over/underflow thresholds until + almost as many bits could be lost as are occupied by the floating-point + format's exponent field; that is 8 bits for VAX D and 11 bits for IEEE + 754 Double. No such drastic loss has been exposed by testing; the worst + errors observed have been below 20 _u_p_s for VAX D, 300 _u_p_s for IEEE 754 + Double. Moderate values of ppooww() are accurate enough that ppooww(_i_n_t_e_g_e_r, + _i_n_t_e_g_e_r) is exact until it is bigger than 2**56 on a VAX, 2**53 for IEEE + 754. + +RREETTUURRNN VVAALLUUEESS + These functions will return the approprate computation unless an error + occurs or an argument is out of range. The functions eexxpp(), eexxppmm11() and + ppooww() detect if the computed value will overflow, set the global variable + _e_r_r_n_o _t_o RANGE and cause a reserved operand fault on a VAX or Tahoe. The + function ppooww(_x, _y) checks to see if _x < 0 and _y is not an integer, in the + event this is true, the global variable _e_r_r_n_o is set to EDOM and on the + VAX and Tahoe generate a reserved operand fault. On a VAX and Tahoe, + _e_r_r_n_o is set to EDOM and the reserved operand is returned by log unless _x + > 0, by lloogg11pp() unless _x > -1. + +NNOOTTEESS + The functions exp(x)-1 and log(1+x) are called expm1 and logp1 in BASIC + on the Hewlett-Packard HP-71B and APPLE Macintosh, EXP1 and LN1 in Pas- + cal, exp1 and log1 in C on APPLE Macintoshes, where they have been pro- + vided to make sure financial calculations of ((1+x)**n-1)/x, namely + expm1(n*log1p(x))/x, will be accurate when x is tiny. They also provide + accurate inverse hyperbolic functions. + + The function ppooww(_x, _0) returns x**0 = 1 for all x including x = 0, Infin- + ity (not found on a VAX), and _N_a_N (the reserved operand on a VAX). + Previous implementations of pow may have defined x**0 to be undefined in + some or all of these cases. Here are reasons for returning x**0 = 1 al- + ways: + + 1. Any program that already tests whether x is zero (or infinite or + _N_a_N) before computing x**0 cannot care whether 0**0 = 1 or not. + Any program that depends upon 0**0 to be invalid is dubious any- + way since that expression's meaning and, if invalid, its conse- + quences vary from one computer system to another. + + 2. Some Algebra texts (e.g. Sigler's) define x**0 = 1 for all x, in- + cluding x = 0. This is compatible with the convention that ac- + cepts a[0] as the value of polynomial + + p(x) = a[0]*x**0 + a[1]*x**1 + a[2]*x**2 +...+ a[n]*x**n + + at x = 0 rather than reject a[0]*0**0 as invalid. + + 3. Analysts will accept 0**0 = 1 despite that x**y can approach any- + thing or nothing as x and y approach 0 independently. The reason + for setting 0**0 = 1 anyway is this: + + If x(z) and y(z) are _a_n_y functions analytic (expandable in + power series) in z around z = 0, and if there x(0) = y(0) = + 0, then x(z)**y(z) -> 1 as z -> 0. + + 4. If 0**0 = 1, then infinity**0 = 1/0**0 = 1 too; and then _N_a_N**0 = + 1 too because x**0 = 1 for all finite and infinite x, i.e., inde- + pendently of x. + +SSEEEE AALLSSOO + math(3), infnan(3) + +HHIISSTTOORRYY + A eexxpp(), lloogg() and ppooww() function appeared in Version 6 AT&T UNIX. A + lloogg1100() function appeared in Version 7 AT&T UNIX. The lloogg11pp() and + eexxppmm11() functions appeared in 4.3BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/log10.0 b/usr/share/man/cat3/log10.0 new file mode 100644 index 0000000000..9283be7d56 --- /dev/null +++ b/usr/share/man/cat3/log10.0 @@ -0,0 +1,118 @@ +EXP(3) BSD Programmer's Manual EXP(3) + +NNAAMMEE + eexxpp, eexxppmm11, lloogg, lloogg1100, lloogg11pp, ppooww - exponential, logarithm, power func- + tions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + eexxpp(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + eexxppmm11(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + lloogg(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + lloogg1100(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + lloogg11pp(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + ppooww(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + +DDEESSCCRRIIPPTTIIOONN + The eexxpp() function computes the exponential value of the given argument + _x. + + The eexxppmm11() function computes the value exp(x)-1 accurately even for tiny + argument _x. + + The lloogg() function computes the value for the natural logarithm of the + argument x. + + The lloogg1100() function computes the value for the logarithm of argument _x + to base 10. + + The lloogg11pp() function computes the value of log(1+x) accurately even for + tiny argument _x. + + The ppooww() computes the value of _x to the exponent _y. + +EERRRROORR ((dduuee ttoo RRoouunnddooffff eettcc..)) + exp(x), log(x), expm1(x) and log1p(x) are accurate to within an _u_p, and + log10(x) to within about 2 _u_p_s; an _u_p is one _U_n_i_t in the _L_a_s_t _P_l_a_c_e. The + error in ppooww(_x, _y) is below about 2 _u_p_s when its magnitude is moderate, + but increases as ppooww(_x, _y) approaches the over/underflow thresholds until + almost as many bits could be lost as are occupied by the floating-point + format's exponent field; that is 8 bits for VAX D and 11 bits for IEEE + 754 Double. No such drastic loss has been exposed by testing; the worst + errors observed have been below 20 _u_p_s for VAX D, 300 _u_p_s for IEEE 754 + Double. Moderate values of ppooww() are accurate enough that ppooww(_i_n_t_e_g_e_r, + _i_n_t_e_g_e_r) is exact until it is bigger than 2**56 on a VAX, 2**53 for IEEE + 754. + +RREETTUURRNN VVAALLUUEESS + These functions will return the approprate computation unless an error + occurs or an argument is out of range. The functions eexxpp(), eexxppmm11() and + ppooww() detect if the computed value will overflow, set the global variable + _e_r_r_n_o _t_o RANGE and cause a reserved operand fault on a VAX or Tahoe. The + function ppooww(_x, _y) checks to see if _x < 0 and _y is not an integer, in the + event this is true, the global variable _e_r_r_n_o is set to EDOM and on the + VAX and Tahoe generate a reserved operand fault. On a VAX and Tahoe, + _e_r_r_n_o is set to EDOM and the reserved operand is returned by log unless _x + > 0, by lloogg11pp() unless _x > -1. + +NNOOTTEESS + The functions exp(x)-1 and log(1+x) are called expm1 and logp1 in BASIC + on the Hewlett-Packard HP-71B and APPLE Macintosh, EXP1 and LN1 in Pas- + cal, exp1 and log1 in C on APPLE Macintoshes, where they have been pro- + vided to make sure financial calculations of ((1+x)**n-1)/x, namely + expm1(n*log1p(x))/x, will be accurate when x is tiny. They also provide + accurate inverse hyperbolic functions. + + The function ppooww(_x, _0) returns x**0 = 1 for all x including x = 0, Infin- + ity (not found on a VAX), and _N_a_N (the reserved operand on a VAX). + Previous implementations of pow may have defined x**0 to be undefined in + some or all of these cases. Here are reasons for returning x**0 = 1 al- + ways: + + 1. Any program that already tests whether x is zero (or infinite or + _N_a_N) before computing x**0 cannot care whether 0**0 = 1 or not. + Any program that depends upon 0**0 to be invalid is dubious any- + way since that expression's meaning and, if invalid, its conse- + quences vary from one computer system to another. + + 2. Some Algebra texts (e.g. Sigler's) define x**0 = 1 for all x, in- + cluding x = 0. This is compatible with the convention that ac- + cepts a[0] as the value of polynomial + + p(x) = a[0]*x**0 + a[1]*x**1 + a[2]*x**2 +...+ a[n]*x**n + + at x = 0 rather than reject a[0]*0**0 as invalid. + + 3. Analysts will accept 0**0 = 1 despite that x**y can approach any- + thing or nothing as x and y approach 0 independently. The reason + for setting 0**0 = 1 anyway is this: + + If x(z) and y(z) are _a_n_y functions analytic (expandable in + power series) in z around z = 0, and if there x(0) = y(0) = + 0, then x(z)**y(z) -> 1 as z -> 0. + + 4. If 0**0 = 1, then infinity**0 = 1/0**0 = 1 too; and then _N_a_N**0 = + 1 too because x**0 = 1 for all finite and infinite x, i.e., inde- + pendently of x. + +SSEEEE AALLSSOO + math(3), infnan(3) + +HHIISSTTOORRYY + A eexxpp(), lloogg() and ppooww() function appeared in Version 6 AT&T UNIX. A + lloogg1100() function appeared in Version 7 AT&T UNIX. The lloogg11pp() and + eexxppmm11() functions appeared in 4.3BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/log1p.0 b/usr/share/man/cat3/log1p.0 new file mode 100644 index 0000000000..9283be7d56 --- /dev/null +++ b/usr/share/man/cat3/log1p.0 @@ -0,0 +1,118 @@ +EXP(3) BSD Programmer's Manual EXP(3) + +NNAAMMEE + eexxpp, eexxppmm11, lloogg, lloogg1100, lloogg11pp, ppooww - exponential, logarithm, power func- + tions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + eexxpp(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + eexxppmm11(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + lloogg(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + lloogg1100(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + lloogg11pp(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + ppooww(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + +DDEESSCCRRIIPPTTIIOONN + The eexxpp() function computes the exponential value of the given argument + _x. + + The eexxppmm11() function computes the value exp(x)-1 accurately even for tiny + argument _x. + + The lloogg() function computes the value for the natural logarithm of the + argument x. + + The lloogg1100() function computes the value for the logarithm of argument _x + to base 10. + + The lloogg11pp() function computes the value of log(1+x) accurately even for + tiny argument _x. + + The ppooww() computes the value of _x to the exponent _y. + +EERRRROORR ((dduuee ttoo RRoouunnddooffff eettcc..)) + exp(x), log(x), expm1(x) and log1p(x) are accurate to within an _u_p, and + log10(x) to within about 2 _u_p_s; an _u_p is one _U_n_i_t in the _L_a_s_t _P_l_a_c_e. The + error in ppooww(_x, _y) is below about 2 _u_p_s when its magnitude is moderate, + but increases as ppooww(_x, _y) approaches the over/underflow thresholds until + almost as many bits could be lost as are occupied by the floating-point + format's exponent field; that is 8 bits for VAX D and 11 bits for IEEE + 754 Double. No such drastic loss has been exposed by testing; the worst + errors observed have been below 20 _u_p_s for VAX D, 300 _u_p_s for IEEE 754 + Double. Moderate values of ppooww() are accurate enough that ppooww(_i_n_t_e_g_e_r, + _i_n_t_e_g_e_r) is exact until it is bigger than 2**56 on a VAX, 2**53 for IEEE + 754. + +RREETTUURRNN VVAALLUUEESS + These functions will return the approprate computation unless an error + occurs or an argument is out of range. The functions eexxpp(), eexxppmm11() and + ppooww() detect if the computed value will overflow, set the global variable + _e_r_r_n_o _t_o RANGE and cause a reserved operand fault on a VAX or Tahoe. The + function ppooww(_x, _y) checks to see if _x < 0 and _y is not an integer, in the + event this is true, the global variable _e_r_r_n_o is set to EDOM and on the + VAX and Tahoe generate a reserved operand fault. On a VAX and Tahoe, + _e_r_r_n_o is set to EDOM and the reserved operand is returned by log unless _x + > 0, by lloogg11pp() unless _x > -1. + +NNOOTTEESS + The functions exp(x)-1 and log(1+x) are called expm1 and logp1 in BASIC + on the Hewlett-Packard HP-71B and APPLE Macintosh, EXP1 and LN1 in Pas- + cal, exp1 and log1 in C on APPLE Macintoshes, where they have been pro- + vided to make sure financial calculations of ((1+x)**n-1)/x, namely + expm1(n*log1p(x))/x, will be accurate when x is tiny. They also provide + accurate inverse hyperbolic functions. + + The function ppooww(_x, _0) returns x**0 = 1 for all x including x = 0, Infin- + ity (not found on a VAX), and _N_a_N (the reserved operand on a VAX). + Previous implementations of pow may have defined x**0 to be undefined in + some or all of these cases. Here are reasons for returning x**0 = 1 al- + ways: + + 1. Any program that already tests whether x is zero (or infinite or + _N_a_N) before computing x**0 cannot care whether 0**0 = 1 or not. + Any program that depends upon 0**0 to be invalid is dubious any- + way since that expression's meaning and, if invalid, its conse- + quences vary from one computer system to another. + + 2. Some Algebra texts (e.g. Sigler's) define x**0 = 1 for all x, in- + cluding x = 0. This is compatible with the convention that ac- + cepts a[0] as the value of polynomial + + p(x) = a[0]*x**0 + a[1]*x**1 + a[2]*x**2 +...+ a[n]*x**n + + at x = 0 rather than reject a[0]*0**0 as invalid. + + 3. Analysts will accept 0**0 = 1 despite that x**y can approach any- + thing or nothing as x and y approach 0 independently. The reason + for setting 0**0 = 1 anyway is this: + + If x(z) and y(z) are _a_n_y functions analytic (expandable in + power series) in z around z = 0, and if there x(0) = y(0) = + 0, then x(z)**y(z) -> 1 as z -> 0. + + 4. If 0**0 = 1, then infinity**0 = 1/0**0 = 1 too; and then _N_a_N**0 = + 1 too because x**0 = 1 for all finite and infinite x, i.e., inde- + pendently of x. + +SSEEEE AALLSSOO + math(3), infnan(3) + +HHIISSTTOORRYY + A eexxpp(), lloogg() and ppooww() function appeared in Version 6 AT&T UNIX. A + lloogg1100() function appeared in Version 7 AT&T UNIX. The lloogg11pp() and + eexxppmm11() functions appeared in 4.3BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/logb.0 b/usr/share/man/cat3/logb.0 new file mode 100644 index 0000000000..4edd4cf673 --- /dev/null +++ b/usr/share/man/cat3/logb.0 @@ -0,0 +1,87 @@ +IEEE(3) BSD Programmer's Manual IEEE(3) + +NNAAMMEE + ccooppyyssiiggnn, ddrreemm, ffiinniittee, llooggbb, ssccaallbb - IEEE 754 floating point support + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + ccooppyyssiiggnn(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + + _d_o_u_b_l_e + ddrreemm(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + + _i_n_t + ffiinniittee(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + llooggbb(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + ssccaallbb(_d_o_u_b_l_e _x, _i_n_t _n); + +DDEESSCCRRIIPPTTIIOONN + These functions are required for, or recommended by the IEEE standard 754 + for floating-point arithmetic. + + The ccooppyyssiiggnn() function returns _x with its sign changed to _y's. + + The ddrreemm() function returns the remainder _r := _x - _n_*_y where _n is the in- + teger nearest the exact value of _x/_y; moreover if |_n - _x/_y| = 1/2 then _n + is even. Consequently the remainder is computed exactly and |_r| <= + |_y|/2. But ddrreemm(_x, _0) is exceptional. (See below under _D_I_A_G_N_O_S_T_I_C_S.) + + The ffiinniittee() function returns the value 1 just when -infinity < _x < +in- + finity; otherwise a zero is returned (when |_x| = infinity or _x is _N_a_N or + is the VAX's reserved operand). + + The llooggbb() function returns _x's exponent _n, a signed integer converted to + double-precision floating-point and so chosen that 1 (<= |_x|2**_n < 2 un- + less _x = 0 or (only on machines that conform to IEEE 754) |_x| = infinity + or _x lies between 0 and the Underflow Threshold. (See below under _B_U_G_S.) + + The ssccaallbb() function returns _x*(2**_n) computed, for integer n, without + first computing 2*_n. + +RREETTUURRNN VVAALLUUEESS + The IEEE standard 754 defines ddrreemm(_x, _0) and ddrreemm(_i_n_f_i_n_i_t_y, _y) to be in- + valid operations that produce a _N_a_N. On the VAX, ddrreemm(_x, _0) generates a + reserved operand fault. No infinity exists on a VAX. + + IEEE 754 defines llooggbb(_+_-_i_n_f_i_n_i_t_y) = infinity and llooggbb(_0) = -infinity, and + requires the latter to signal Division-by-Zero. But on a VAX, llooggbb(_0) = + 1.0 - 2.0**31 = -2,147,483,647.0. And if the correct value of ssccaallbb() + would overflow on a VAX, it generates a reserved operand fault and sets + the global variable _e_r_r_n_o to ERANGE. + +SSEEEE AALLSSOO + floor(3), math(3), infnan(3) + +HHIISSTTOORRYY + The iieeeeee functions appeared in 4.3BSD. + +BBUUGGSS + Should ddrreemm(_x, _0) and llooggbb(_0) on a VAX signal invalidity by setting _e_r_r_n_o + = EDOM ? Should llooggbb(_0) return -1.7e38? + + IEEE 754 currently specifies that llooggbb(_d_e_n_o_r_m_a_l_i_z_e_d _n_o_.) = llooggbb(_t_i_n_i_e_s_t + _n_o_r_m_a_l_i_z_e_d _n_o_. _> _0) but the consensus has changed to the specification in + the new proposed IEEE standard p854, namely that llooggbb(_x) satisfy + + 1 <= ssccaallbb(|_x|, _-_l_o_g_b_(_x_)) < Radix ... = 2 for IEEE 754 + + for every x except 0, infinity and _N_a_N. Almost every program that as- + sumes 754's specification will work correctly if llooggbb() follows 854's + specification instead. + + IEEE 754 requires ccooppyyssiiggnn(_x, _N_a_N_)) = +-_x but says nothing else about the + sign of a _N_a_N. A _N_a_N _(_Not _a _Number) is similar in spirit to the VAX's + reserved operand, but very different in important details. Since the + sign bit of a reserved operand makes it look negative, + + ccooppyyssiiggnn(_x, _r_e_s_e_r_v_e_d _o_p_e_r_a_n_d) = -_x; + + should this return the reserved operand instead? + +4.3 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/lsearch.0 b/usr/share/man/cat3/lsearch.0 new file mode 100644 index 0000000000..01752aa9c3 --- /dev/null +++ b/usr/share/man/cat3/lsearch.0 @@ -0,0 +1,40 @@ +LSEARCH(3) BSD Programmer's Manual LSEARCH(3) + +NNAAMMEE + llsseeaarrcchh, llffiinndd,, - linear searching routines + +SSYYNNOOPPSSIISS + _c_h_a_r _* + llsseeaarrcchh(_c_o_n_s_t _v_o_i_d _*_k_e_y, _c_o_n_s_t _v_o_i_d _*_b_a_s_e, _s_i_z_e___t _*_n_e_l_p, _s_i_z_e___t _w_i_d_t_h, + _i_n_t _(_*_c_o_m_p_a_r_)_(_v_o_i_d _*_, _v_o_i_d _*_)); + + _c_h_a_r _* + llffiinndd(_c_o_n_s_t _v_o_i_d _*_k_e_y, _c_o_n_s_t _v_o_i_d _*_b_a_s_e, _s_i_z_e___t _*_n_e_l_p, _s_i_z_e___t _w_i_d_t_h, + _i_n_t _(_*_c_o_m_p_a_r_)_(_v_o_i_d _*_, _v_o_i_d _*_)); + +DDEESSCCRRIIPPTTIIOONN + TThhiiss iinntteerrffaaccee wwaass oobbssoolleettee bbeeffoorree iitt wwaass wwrriitttteenn.. IItt iiss aavvaaiillaabbllee ffrroomm + tthhee ccoommppaattiibbiilliittyy lliibbrraarryy,, lliibbccoommppaatt.. + + The functions llsseeaarrcchh(), and llffiinndd() provide basic linear searching func- + tionality. + + _B_a_s_e is the pointer to the beginning of an array. The argument _n_e_l_p is + the current number of elements in the array, where each element is _w_i_d_t_h + bytes long. The _c_o_m_p_a_r function is a comparison routine which is used to + compare two elements. It takes two arguments which point to the _k_e_y ob- + ject and to an array member, in that order, and must return an integer + less than, equivalent to, or greater than zero if the _k_e_y object is con- + sidered, respectively, to be less than, equal to, or greater than the ar- + ray member. + + The llsseeaarrcchh() and llffiinndd() functions return a pointer into the array ref- + erenced by _b_a_s_e where _k_e_y is located. If _k_e_y does not exist, llffiinndd() + will return a null pointer and llsseeaarrcchh() will add it to the array. When + an element is added to the array by llsseeaarrcchh() the location referenced by + the argument _n_e_l_p is incremented by one. + +SSEEEE AALLSSOO + bsearch(3), db(3) + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/math.0 b/usr/share/man/cat3/math.0 new file mode 100644 index 0000000000..b0694cc27f --- /dev/null +++ b/usr/share/man/cat3/math.0 @@ -0,0 +1,660 @@ + + + +MATH(3) BSD Programmer's Manual MATH(3) + + +NNAAMMEE + math - introduction to mathematical library functions + +DDEESSCCRRIIPPTTIIOONN + These functions constitute the C math library, _l_i_b_m_. The + link editor searches this library under the "-lm" option. + Declarations for these functions may be obtained from the + include file <_m_a_t_h_._h>. The Fortran math library is + described in ``man 3f intro''. + +LLIISSTT OOFF FFUUNNCCTTIIOONNSS + _N_a_m_e _A_p_p_e_a_r_s _o_n _P_a_g_e _D_e_s_c_r_i_p_t_i_o_n _E_r_r_o_r _B_o_u_n_d _(_U_L_P_s_) + acos sin.3m inverse trigonometric function 3 + acosh asinh.3m inverse hyperbolic function 3 + asin sin.3m inverse trigonometric function 3 + asinh asinh.3m inverse hyperbolic function 3 + atan sin.3m inverse trigonometric function 1 + atanh asinh.3m inverse hyperbolic function 3 + atan2 sin.3m inverse trigonometric function 2 + cabs hypot.3m complex absolute value 1 + cbrt sqrt.3m cube root 1 + ceil floor.3m integer no less than 0 + copysign ieee.3m copy sign bit 0 + cos sin.3m trigonometric function 1 + cosh sinh.3m hyperbolic function 3 + drem ieee.3m remainder 0 + erf erf.3m error function ??? + erfc erf.3m complementary error function ??? + exp exp.3m exponential 1 + expm1 exp.3m exp(x)-1 1 + fabs floor.3m absolute value 0 + floor floor.3m integer no greater than 0 + hypot hypot.3m Euclidean distance 1 + infnan infnan.3m signals exceptions + j0 j0.3m bessel function ??? + j1 j0.3m bessel function ??? + jn j0.3m bessel function ??? + lgamma lgamma.3m log gamma function; (formerly gamma.3m) + log exp.3m natural logarithm 1 + logb ieee.3m exponent extraction 0 + log10 exp.3m logarithm to base 10 3 + log1p exp.3m log(1+x) 1 + pow exp.3m exponential x**y 60-500 + rint floor.3m round to nearest integer 0 + scalb ieee.3m exponent adjustment 0 + sin sin.3m trigonometric function 1 + sinh sinh.3m hyperbolic function 3 + sqrt sqrt.3m square root 1 + tan sin.3m trigonometric function 3 + tanh sinh.3m hyperbolic function 3 + y0 j0.3m bessel function ??? + + + +4th Berkeley Distribution June 4, 1993 1 + + + + + + + + +MATH(3) BSD Programmer's Manual MATH(3) + + + y1 j0.3m bessel function ??? + yn j0.3m bessel function ??? + +NNOOTTEESS + In 4.3 BSD, distributed from the University of California + in late 1985, most of the foregoing functions come in two + versions, one for the double-precision "D" format in the + DEC VAX-11 family of computers, another for dou- + ble-precision arithmetic conforming to the IEEE Standard + 754 for Binary Floating-Point Arithmetic. The two ver- + sions behave very similarly, as should be expected from + programs more accurate and robust than was the norm when + UNIX was born. For instance, the programs are accurate to + within the numbers of _u_l_ps tabulated above; an _u_l_p is one + _Unit in the _Last _Place. And the programs have been cured + of anomalies that afflicted the older math library _l_i_b_m in + which incidents like the following had been reported: + sqrt(-1.0) = 0.0 and log(-1.0) = -1.7e38. + cos(1.0e-11) > cos(0.0) > 1.0. + pow(x,1.0) != x when x = 2.0, 3.0, 4.0, ..., 9.0. + pow(-1.0,1.0e10) trapped on Integer Overflow. + sqrt(1.0e30) and sqrt(1.0e-30) were very slow. + However the two versions do differ in ways that have to be + explained, to which end the following notes are provided. + + DDEECC VVAAXX--1111 DD__ffllooaattiinngg--ppooiinntt:: + + This is the format for which the original math library + _l_i_b_m was developed, and to which this manual is still + principally dedicated. It is _t_h_e double-precision format + for the PDP-11 and the earlier VAX-11 machines; VAX-11s + after 1983 were provided with an optional "G" format + closer to the IEEE double-precision format. The earlier + DEC MicroVAXs have no D format, only G double-precision. + (Why? Why not?) + + Properties of D_floating-point: + Wordsize: 64 bits, 8 bytes. Radix: Binary. + Precision: 56 sig. bits, roughly like 17 sig. + decimals. + If x and x' are consecutive positive + D_floating-point numbers (they differ by 1 + _u_l_p), then + 1.3e-17 < 0.5**56 < (x'-x)/x <= 0.5**55 < + 2.8e-17. + Range: Overflow threshold = 2.0**127 = 1.7e38. + Underflow threshold = 0.5**128 = 2.9e-39. + NOTE: THIS RANGE IS COMPARATIVELY NARROW. + Overflow customarily stops computation. + Underflow is customarily flushed quietly to + zero. + + + +4th Berkeley Distribution June 4, 1993 2 + + + + + + + + +MATH(3) BSD Programmer's Manual MATH(3) + + + CAUTION: + It is possible to have x != y and + yet x-y = 0 because of underflow. + Similarly x > y > 0 cannot prevent + either x*y = 0 or y/x = 0 from hap- + pening without warning. + Zero is represented ambiguously. + Although 2**55 different representations of + zero are accepted by the hardware, only the + obvious representation is ever produced. + There is no -0 on a VAX. + Infinity is not part of the VAX architecture. + Reserved operands: + of the 2**55 that the hardware recognizes, + only one of them is ever produced. Any + floating-point operation upon a reserved + operand, even a MOVF or MOVD, customarily + stops computation, so they are not much + used. + Exceptions: + Divisions by zero and operations that over- + flow are invalid operations that customarily + stop computation or, in earlier machines, + produce reserved operands that will stop + computation. + Rounding: + Every rational operation (+, -, *, /) on a + VAX (but not necessarily on a PDP-11), if + not an over/underflow nor division by zero, + is rounded to within half an _u_l_p, and when + the rounding error is exactly half an _u_l_p + then rounding is away from 0. + + Except for its narrow range, D_floating-point is one of + the better computer arithmetics designed in the 1960's. + Its properties are reflected fairly faithfully in the ele- + mentary functions for a VAX distributed in 4.3 BSD. They + over/underflow only if their results have to lie out of + range or very nearly so, and then they behave much as any + rational arithmetic operation that over/underflowed would + behave. Similarly, expressions like log(0) and atanh(1) + behave like 1/0; and sqrt(-3) and acos(3) behave like 0/0; + they all produce reserved operands and/or stop computa- + tion! The situation is described in more detail in manual + pages. + _T_h_i_s _r_e_s_p_o_n_s_e _s_e_e_m_s _e_x_c_e_s_s_i_v_e_l_y _p_u_n_i_t_i_v_e_, _s_o + _i_t _i_s _d_e_s_t_i_n_e_d _t_o _b_e _r_e_p_l_a_c_e_d _a_t _s_o_m_e _t_i_m_e _i_n + _t_h_e _f_o_r_e_s_e_e_a_b_l_e _f_u_t_u_r_e _b_y _a _m_o_r_e _f_l_e_x_i_b_l_e _b_u_t + _s_t_i_l_l _u_n_i_f_o_r_m _s_c_h_e_m_e _b_e_i_n_g _d_e_v_e_l_o_p_e_d _t_o _h_a_n_d_l_e + _a_l_l _f_l_o_a_t_i_n_g_-_p_o_i_n_t _a_r_i_t_h_m_e_t_i_c _e_x_c_e_p_t_i_o_n_s + _n_e_a_t_l_y_. _S_e_e _i_n_f_n_a_n_(_3_M_) _f_o_r _t_h_e _p_r_e_s_e_n_t _s_t_a_t_e + + + +4th Berkeley Distribution June 4, 1993 3 + + + + + + + + +MATH(3) BSD Programmer's Manual MATH(3) + + + _o_f _a_f_f_a_i_r_s_. + + How do the functions in 4.3 BSD's new _l_i_b_m for UNIX com- + pare with their counterparts in DEC's VAX/VMS library? + Some of the VMS functions are a little faster, some are a + little more accurate, some are more puritanical about + exceptions (like pow(0.0,0.0) and atan2(0.0,0.0)), and + most occupy much more memory than their counterparts in + _l_i_b_m. The VMS codes interpolate in large table to achieve + speed and accuracy; the _l_i_b_m codes use tricky formulas + compact enough that all of them may some day fit into a + ROM. + + More important, DEC regards the VMS codes as proprietary + and guards them zealously against unauthorized use. But + the _l_i_b_m codes in 4.3 BSD are intended for the public + domain; they may be copied freely provided their prove- + nance is always acknowledged, and provided users assist + the authors in their researches by reporting experience + with the codes. Therefore no user of UNIX on a machine + whose arithmetic resembles VAX D_floating-point need use + anything worse than the new _l_i_b_m. + + IIEEEEEE SSTTAANNDDAARRDD 775544 FFllooaattiinngg--PPooiinntt AArriitthhmmeettiicc:: + + This standard is on its way to becoming more widely + adopted than any other design for computer arithmetic. + VLSI chips that conform to some version of that standard + have been produced by a host of manufacturers, among them + ... + Intel i8087, i80287 National Semiconductor 32081 + Motorola 68881 Weitek WTL-1032, ... , -1165 + Zilog Z8070 Western Electric (AT&T) WE32106. + Other implementations range from software, done thoroughly + in the Apple Macintosh, through VLSI in the + Hewlett-Packard 9000 series, to the ELXSI 6400 running ECL + at 3 Megaflops. Several other companies have adopted the + formats of IEEE 754 without, alas, adhering to the stan- + dard's way of handling rounding and exceptions like + over/underflow. The DEC VAX G_floating-point format is + very similar to the IEEE 754 Double format, so similar + that the C programs for the IEEE versions of most of the + elementary functions listed above could easily be con- + verted to run on a MicroVAX, though nobody has volunteered + to do that yet. + + The codes in 4.3 BSD's _l_i_b_m for machines that conform to + IEEE 754 are intended primarily for the National Semi. + 32081 and WTL 1164/65. To use these codes with the Intel + or Zilog chips, or with the Apple Macintosh or ELXSI 6400, + is to forego the use of better codes provided (perhaps + + + +4th Berkeley Distribution June 4, 1993 4 + + + + + + + + +MATH(3) BSD Programmer's Manual MATH(3) + + + freely) by those companies and designed by some of the + authors of the codes above. Except for _a_t_a_n, _c_a_b_s, _c_b_r_t, + _e_r_f, _e_r_f_c, _h_y_p_o_t, _j_0_-_j_n, _l_g_a_m_m_a, _p_o_w and _y_0_-_y_n, the + Motorola 68881 has all the functions in _l_i_b_m on chip, and + faster and more accurate; it, Apple, the i8087, Z8070 and + WE32106 all use 64 sig. bits. The main virtue of 4.3 + BSD's _l_i_b_m codes is that they are intended for the public + domain; they may be copied freely provided their prove- + nance is always acknowledged, and provided users assist + the authors in their researches by reporting experience + with the codes. Therefore no user of UNIX on a machine + that conforms to IEEE 754 need use anything worse than the + new _l_i_b_m. + + Properties of IEEE 754 Double-Precision: + Wordsize: 64 bits, 8 bytes. Radix: Binary. + Precision: 53 sig. bits, roughly like 16 sig. + decimals. + If x and x' are consecutive positive Dou- + ble-Precision numbers (they differ by 1 + _u_l_p), then + 1.1e-16 < 0.5**53 < (x'-x)/x <= 0.5**52 < + 2.3e-16. + Range: Overflow threshold = 2.0**1024 = 1.8e308 + Underflow threshold = 0.5**1022 = 2.2e-308 + Overflow goes by default to a signed Infin- + ity. + Underflow is _G_r_a_d_u_a_l_, rounding to the near- + est integer multiple of 0.5**1074 = + 4.9e-324. + Zero is represented ambiguously as +0 or -0. + Its sign transforms correctly through multi- + plication or division, and is preserved by + addition of zeros with like signs; but x-x + yields +0 for every finite x. The only + operations that reveal zero's sign are divi- + sion by zero and copysign(x,+-0). In par- + ticular, comparison (x > y, x >= y, etc.) + cannot be affected by the sign of zero; but + if finite x = y then Infinity = 1/(x-y) != + -1/(y-x) = -Infinity. + Infinity is signed. + it persists when added to itself or to any + finite number. Its sign transforms cor- + rectly through multiplication and division, + and (finite)/+-Infinity = +-0 (nonzero)/0 = + +-Infinity. But Infinity-Infinity, Infin- + ity*0 and Infinity/Infinity are, like 0/0 + and sqrt(-3), invalid operations that pro- + duce _N_a_N. ... + Reserved operands: + + + +4th Berkeley Distribution June 4, 1993 5 + + + + + + + + +MATH(3) BSD Programmer's Manual MATH(3) + + + there are 2**53-2 of them, all called _N_a_N + (_Not _a _Number). Some, called Signaling + _N_a_Ns, trap any floating-point operation per- + formed upon them; they are used to mark + missing or uninitialized values, or nonexis- + tent elements of arrays. The rest are Quiet + _N_a_Ns; they are the default results of + Invalid Operations, and propagate through + subsequent arithmetic operations. If x != x + then x is _N_a_N; every other predicate (x > y, + x = y, x < y, ...) is FALSE if _N_a_N is + involved. + NOTE: Trichotomy is violated by _N_a_N. + Besides being FALSE, predicates that + entail ordered comparison, rather + than mere (in)equality, signal + Invalid Operation when _N_a_N is + involved. + Rounding: + Every algebraic operation (+, -, *, /, sqrt) + is rounded by default to within half an _u_l_p, + and when the rounding error is exactly half + an _u_l_p then the rounded value's least sig- + nificant bit is zero. This kind of rounding + is usually the best kind, sometimes provably + so; for instance, for every x = 1.0, 2.0, + 3.0, 4.0, ..., 2.0**52, we find (x/3.0)*3.0 + == x and (x/10.0)*10.0 == x and ... despite + that both the quotients and the products + have been rounded. Only rounding like IEEE + 754 can do that. But no single kind of + rounding can be proved best for every cir- + cumstance, so IEEE 754 provides rounding + towards zero or towards +Infinity or towards + -Infinity at the programmer's option. And + the same kinds of rounding are specified for + Binary-Decimal Conversions, at least for + magnitudes between roughly 1.0e-10 and + 1.0e37. + Exceptions: + IEEE 754 recognizes five kinds of float- + ing-point exceptions, listed below in + declining order of probable importance. + Exception Default Result + __________________________________________ + Invalid Operation _N_a_N, or FALSE + Overflow +-Infinity + Divide by Zero +-Infinity + Underflow Gradual Underflow + Inexact Rounded value + NOTE: An Exception is not an Error unless + + + +4th Berkeley Distribution June 4, 1993 6 + + + + + + + + +MATH(3) BSD Programmer's Manual MATH(3) + + + handled badly. What makes a class of excep- + tions exceptional is that no single default + response can be satisfactory in every + instance. On the other hand, if a default + response will serve most instances satisfac- + torily, the unsatisfactory instances cannot + justify aborting computation every time the + exception occurs. + + For each kind of floating-point exception, IEEE 754 + provides a Flag that is raised each time its excep- + tion is signaled, and stays raised until the pro- + gram resets it. Programs may also test, save and + restore a flag. Thus, IEEE 754 provides three ways + by which programs may cope with exceptions for + which the default result might be unsatisfactory: + + 1) Test for a condition that might cause an excep- + tion later, and branch to avoid the exception. + + 2) Test a flag to see whether an exception has + occurred since the program last reset its flag. + + 3) Test a result to see whether it is a value that + only an exception could have produced. + CAUTION: The only reliable ways to discover + whether Underflow has occurred are to test + whether products or quotients lie closer to + zero than the underflow threshold, or to test + the Underflow flag. (Sums and differences can- + not underflow in IEEE 754; if x != y then x-y + is correct to full precision and certainly + nonzero regardless of how tiny it may be.) + Products and quotients that underflow gradually + can lose accuracy gradually without vanishing, + so comparing them with zero (as one might on a + VAX) will not reveal the loss. Fortunately, if + a gradually underflowed value is destined to be + added to something bigger than the underflow + threshold, as is almost always the case, digits + lost to gradual underflow will not be missed + because they would have been rounded off any- + way. So gradual underflows are usually _p_r_o_v_- + _a_b_l_y ignorable. The same cannot be said of + underflows flushed to 0. + + At the option of an implementor conforming to IEEE + 754, other ways to cope with exceptions may be pro- + vided: + + 4) ABORT. This mechanism classifies an exception + + + +4th Berkeley Distribution June 4, 1993 7 + + + + + + + + +MATH(3) BSD Programmer's Manual MATH(3) + + + in advance as an incident to be handled by + means traditionally associated with + error-handling statements like "ON ERROR GO TO + ...". Different languages offer different + forms of this statement, but most share the + following characteristics: + + -- No means is provided to substitute a value for + the offending operation's result and resume + computation from what may be the middle of an + expression. An exceptional result is aban- + doned. + + -- In a subprogram that lacks an error-handling + statement, an exception causes the subprogram + to abort within whatever program called it, and + so on back up the chain of calling subprograms + until an error-handling statement is encoun- + tered or the whole task is aborted and memory + is dumped. + + 5) STOP. This mechanism, requiring an interactive + debugging environment, is more for the program- + mer than the program. It classifies an excep- + tion in advance as a symptom of a programmer's + error; the exception suspends execution as near + as it can to the offending operation so that + the programmer can look around to see how it + happened. Quite often the first several excep- + tions turn out to be quite unexceptionable, so + the programmer ought ideally to be able to + resume execution after each one as if execution + had not been stopped. + + 6) ... Other ways lie beyond the scope of this + document. + + The crucial problem for exception handling is the problem + of Scope, and the problem's solution is understood, but + not enough manpower was available to implement it fully in + time to be distributed in 4.3 BSD's _l_i_b_m. Ideally, each + elementary function should act as if it were indivisible, + or atomic, in the sense that ... + + i) No exception should be signaled that is not deserved + by the data supplied to that function. + + ii) Any exception signaled should be identified with + that function rather than with one of its subrou- + tines. + + + + +4th Berkeley Distribution June 4, 1993 8 + + + + + + + + +MATH(3) BSD Programmer's Manual MATH(3) + + + iii) The internal behavior of an atomic function should + not be disrupted when a calling program changes from + one to another of the five or so ways of handling + exceptions listed above, although the definition of + the function may be correlated intentionally with + exception handling. + + Ideally, every programmer should be able _c_o_n_v_e_n_i_e_n_t_l_y to + turn a debugged subprogram into one that appears atomic to + its users. But simulating all three characteristics of an + atomic function is still a tedious affair, entailing hosts + of tests and saves-restores; work is under way to amelio- + rate the inconvenience. + + Meanwhile, the functions in _l_i_b_m are only approximately + atomic. They signal no inappropriate exception except + possibly ... + Over/Underflow + when a result, if properly computed, might + have lain barely within range, and + Inexact in _c_a_b_s, _c_b_r_t, _h_y_p_o_t, _l_o_g_1_0 and _p_o_w + when it happens to be exact, thanks to for- + tuitous cancellation of errors. + Otherwise, ... + Invalid Operation is signaled only when + any result but _N_a_N would probably be mis- + leading. + Overflow is signaled only when + the exact result would be finite but beyond + the overflow threshold. + Divide-by-Zero is signaled only when + a function takes exactly infinite values at + finite operands. + Underflow is signaled only when + the exact result would be nonzero but tinier + than the underflow threshold. + Inexact is signaled only when + greater range or precision would be needed + to represent the exact result. + +BBUUGGSS + When signals are appropriate, they are emitted by certain + operations within the codes, so a subroutine-trace may be + needed to identify the function with its signal in case + method 5) above is in use. And the codes all take the + IEEE 754 defaults for granted; this means that a decision + to trap all divisions by zero could disrupt a code that + would otherwise get correct results despite division by + zero. + + + + + +4th Berkeley Distribution June 4, 1993 9 + + + + + + + + +MATH(3) BSD Programmer's Manual MATH(3) + + +SSEEEE AALLSSOO + An explanation of IEEE 754 and its proposed extension p854 + was published in the IEEE magazine MICRO in August 1984 + under the title "A Proposed Radix- and + Word-length-independent Standard for Floating-point Arith- + metic" by W. J. Cody et al. The manuals for Pascal, C and + BASIC on the Apple Macintosh document the features of IEEE + 754 pretty well. Articles in the IEEE magazine COMPUTER + vol. 14 no. 3 (Mar. 1981), and in the ACM SIGNUM Newslet- + ter Special Issue of Oct. 1979, may be helpful although + they pertain to superseded drafts of the standard. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +4th Berkeley Distribution June 4, 1993 10 + + + + + diff --git a/usr/share/man/cat3/pow.0 b/usr/share/man/cat3/pow.0 new file mode 100644 index 0000000000..9283be7d56 --- /dev/null +++ b/usr/share/man/cat3/pow.0 @@ -0,0 +1,118 @@ +EXP(3) BSD Programmer's Manual EXP(3) + +NNAAMMEE + eexxpp, eexxppmm11, lloogg, lloogg1100, lloogg11pp, ppooww - exponential, logarithm, power func- + tions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + eexxpp(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + eexxppmm11(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + lloogg(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + lloogg1100(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + lloogg11pp(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + ppooww(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + +DDEESSCCRRIIPPTTIIOONN + The eexxpp() function computes the exponential value of the given argument + _x. + + The eexxppmm11() function computes the value exp(x)-1 accurately even for tiny + argument _x. + + The lloogg() function computes the value for the natural logarithm of the + argument x. + + The lloogg1100() function computes the value for the logarithm of argument _x + to base 10. + + The lloogg11pp() function computes the value of log(1+x) accurately even for + tiny argument _x. + + The ppooww() computes the value of _x to the exponent _y. + +EERRRROORR ((dduuee ttoo RRoouunnddooffff eettcc..)) + exp(x), log(x), expm1(x) and log1p(x) are accurate to within an _u_p, and + log10(x) to within about 2 _u_p_s; an _u_p is one _U_n_i_t in the _L_a_s_t _P_l_a_c_e. The + error in ppooww(_x, _y) is below about 2 _u_p_s when its magnitude is moderate, + but increases as ppooww(_x, _y) approaches the over/underflow thresholds until + almost as many bits could be lost as are occupied by the floating-point + format's exponent field; that is 8 bits for VAX D and 11 bits for IEEE + 754 Double. No such drastic loss has been exposed by testing; the worst + errors observed have been below 20 _u_p_s for VAX D, 300 _u_p_s for IEEE 754 + Double. Moderate values of ppooww() are accurate enough that ppooww(_i_n_t_e_g_e_r, + _i_n_t_e_g_e_r) is exact until it is bigger than 2**56 on a VAX, 2**53 for IEEE + 754. + +RREETTUURRNN VVAALLUUEESS + These functions will return the approprate computation unless an error + occurs or an argument is out of range. The functions eexxpp(), eexxppmm11() and + ppooww() detect if the computed value will overflow, set the global variable + _e_r_r_n_o _t_o RANGE and cause a reserved operand fault on a VAX or Tahoe. The + function ppooww(_x, _y) checks to see if _x < 0 and _y is not an integer, in the + event this is true, the global variable _e_r_r_n_o is set to EDOM and on the + VAX and Tahoe generate a reserved operand fault. On a VAX and Tahoe, + _e_r_r_n_o is set to EDOM and the reserved operand is returned by log unless _x + > 0, by lloogg11pp() unless _x > -1. + +NNOOTTEESS + The functions exp(x)-1 and log(1+x) are called expm1 and logp1 in BASIC + on the Hewlett-Packard HP-71B and APPLE Macintosh, EXP1 and LN1 in Pas- + cal, exp1 and log1 in C on APPLE Macintoshes, where they have been pro- + vided to make sure financial calculations of ((1+x)**n-1)/x, namely + expm1(n*log1p(x))/x, will be accurate when x is tiny. They also provide + accurate inverse hyperbolic functions. + + The function ppooww(_x, _0) returns x**0 = 1 for all x including x = 0, Infin- + ity (not found on a VAX), and _N_a_N (the reserved operand on a VAX). + Previous implementations of pow may have defined x**0 to be undefined in + some or all of these cases. Here are reasons for returning x**0 = 1 al- + ways: + + 1. Any program that already tests whether x is zero (or infinite or + _N_a_N) before computing x**0 cannot care whether 0**0 = 1 or not. + Any program that depends upon 0**0 to be invalid is dubious any- + way since that expression's meaning and, if invalid, its conse- + quences vary from one computer system to another. + + 2. Some Algebra texts (e.g. Sigler's) define x**0 = 1 for all x, in- + cluding x = 0. This is compatible with the convention that ac- + cepts a[0] as the value of polynomial + + p(x) = a[0]*x**0 + a[1]*x**1 + a[2]*x**2 +...+ a[n]*x**n + + at x = 0 rather than reject a[0]*0**0 as invalid. + + 3. Analysts will accept 0**0 = 1 despite that x**y can approach any- + thing or nothing as x and y approach 0 independently. The reason + for setting 0**0 = 1 anyway is this: + + If x(z) and y(z) are _a_n_y functions analytic (expandable in + power series) in z around z = 0, and if there x(0) = y(0) = + 0, then x(z)**y(z) -> 1 as z -> 0. + + 4. If 0**0 = 1, then infinity**0 = 1/0**0 = 1 too; and then _N_a_N**0 = + 1 too because x**0 = 1 for all finite and infinite x, i.e., inde- + pendently of x. + +SSEEEE AALLSSOO + math(3), infnan(3) + +HHIISSTTOORRYY + A eexxpp(), lloogg() and ppooww() function appeared in Version 6 AT&T UNIX. A + lloogg1100() function appeared in Version 7 AT&T UNIX. The lloogg11pp() and + eexxppmm11() functions appeared in 4.3BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/re_comp.0 b/usr/share/man/cat3/re_comp.0 new file mode 100644 index 0000000000..9bf99a7bd0 --- /dev/null +++ b/usr/share/man/cat3/re_comp.0 @@ -0,0 +1,56 @@ +RE_COMP(3) BSD Programmer's Manual RE_COMP(3) + +NNAAMMEE + rree__ccoommpp, rree__eexxeecc - regular expression handler + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + rree__ccoommpp(_c_o_n_s_t _c_h_a_r _*_s); + + _i_n_t + rree__eexxeecc(_c_o_n_s_t _c_h_a_r _*_s); + +DDEESSCCRRIIPPTTIIOONN + This interface is made obsolete by regex(3). + + The rree__ccoommpp() function compiles a string into an internal form suitable + for pattern matching. The rree__eexxeecc() function checks the argument string + against the last string passed to rree__ccoommpp(). + + The rree__ccoommpp() function returns 0 if the string _s was compiled successful- + ly; otherwise a string containing an error message is returned. If + rree__ccoommpp() is passed 0 or a null string, it returns without changing the + currently compiled regular expression. + + The rree__eexxeecc() function returns 1 if the string _s matches the last com- + piled regular expression, 0 if the string _s failed to match the last com- + piled regular expression, and -1 if the compiled regular expression was + invalid (indicating an internal error). + + The strings passed to both rree__ccoommpp() and rree__eexxeecc() may have trailing or + embedded newline characters; they are terminated by NULs. The regular ex- + pressions recognized are described in the manual entry for ed(1), given + the above difference. + +DDIIAAGGNNOOSSTTIICCSS + The rree__eexxeecc() function returns -1 for an internal error. + + The rree__ccoommpp() function returns one of the following strings if an error + occurs: + + No previous regular expression, + Regular expression too long, + unmatched \(, + missing ], + too many \(\) pairs, + unmatched \). + +SSEEEE AALLSSOO + ed(1), ex(1), egrep(1), fgrep(1), grep(1), regex(3) + +HHIISSTTOORRYY + The rree__ccoommpp() and rree__eexxeecc() functions appeared in 4.0BSD. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/re_exec.0 b/usr/share/man/cat3/re_exec.0 new file mode 100644 index 0000000000..9bf99a7bd0 --- /dev/null +++ b/usr/share/man/cat3/re_exec.0 @@ -0,0 +1,56 @@ +RE_COMP(3) BSD Programmer's Manual RE_COMP(3) + +NNAAMMEE + rree__ccoommpp, rree__eexxeecc - regular expression handler + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + rree__ccoommpp(_c_o_n_s_t _c_h_a_r _*_s); + + _i_n_t + rree__eexxeecc(_c_o_n_s_t _c_h_a_r _*_s); + +DDEESSCCRRIIPPTTIIOONN + This interface is made obsolete by regex(3). + + The rree__ccoommpp() function compiles a string into an internal form suitable + for pattern matching. The rree__eexxeecc() function checks the argument string + against the last string passed to rree__ccoommpp(). + + The rree__ccoommpp() function returns 0 if the string _s was compiled successful- + ly; otherwise a string containing an error message is returned. If + rree__ccoommpp() is passed 0 or a null string, it returns without changing the + currently compiled regular expression. + + The rree__eexxeecc() function returns 1 if the string _s matches the last com- + piled regular expression, 0 if the string _s failed to match the last com- + piled regular expression, and -1 if the compiled regular expression was + invalid (indicating an internal error). + + The strings passed to both rree__ccoommpp() and rree__eexxeecc() may have trailing or + embedded newline characters; they are terminated by NULs. The regular ex- + pressions recognized are described in the manual entry for ed(1), given + the above difference. + +DDIIAAGGNNOOSSTTIICCSS + The rree__eexxeecc() function returns -1 for an internal error. + + The rree__ccoommpp() function returns one of the following strings if an error + occurs: + + No previous regular expression, + Regular expression too long, + unmatched \(, + missing ], + too many \(\) pairs, + unmatched \). + +SSEEEE AALLSSOO + ed(1), ex(1), egrep(1), fgrep(1), grep(1), regex(3) + +HHIISSTTOORRYY + The rree__ccoommpp() and rree__eexxeecc() functions appeared in 4.0BSD. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/regcomp.0 b/usr/share/man/cat3/regcomp.0 new file mode 100644 index 0000000000..e8ddcfb025 --- /dev/null +++ b/usr/share/man/cat3/regcomp.0 @@ -0,0 +1,147 @@ +REGEXP(3) BSD Programmer's Manual REGEXP(3) + +NNAAMMEE + rreeggccoommpp, rreeggeexxeecc, rreeggssuubb, rreeggeerrrroorr - regular expression handlers + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _r_e_g_e_x_p _* + rreeggccoommpp(_c_o_n_s_t _c_h_a_r _*_e_x_p); + + _i_n_t + rreeggeexxeecc(_c_o_n_s_t _r_e_g_e_x_p _*_p_r_o_g, _c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g); + + _v_o_i_d + rreeggssuubb(_c_o_n_s_t _r_e_g_e_x_p _*_p_r_o_g, _c_o_n_s_t _c_h_a_r _*_s_o_u_r_c_e, _c_h_a_r _*_d_e_s_t); + +DDEESSCCRRIIPPTTIIOONN + This interface is made obsolete by regex(3). + + The rreeggccoommpp(), rreeggeexxeecc(), rreeggssuubb(), and rreeggeerrrroorr() functions implement + egrep(1)-style regular expressions and supporting facilities. + + The rreeggccoommpp() function compiles a regular expression into a structure of + type regexp, and returns a pointer to it. The space has been allocated + using malloc(3) and may be released by free. + + The rreeggeexxeecc() function matches a NUL-terminated _s_t_r_i_n_g against the com- + piled regular expression in _p_r_o_g. It returns 1 for success and 0 for + failure, and adjusts the contents of _p_r_o_g's _s_t_a_r_t_p and _e_n_d_p (see below) + accordingly. + + The members of a regexp structure include at least the following (not + necessarily in order): + + char *startp[NSUBEXP]; + char *endp[NSUBEXP]; + + where NSUBEXP is defined (as 10) in the header file. Once a successful + rreeggeexxeecc() has been done using the rreeggeexxpp(), each _s_t_a_r_t_p- _e_n_d_p pair de- + scribes one substring within the _s_t_r_i_n_g, with the _s_t_a_r_t_p pointing to the + first character of the substring and the _e_n_d_p pointing to the first char- + acter following the substring. The 0th substring is the substring of + _s_t_r_i_n_g that matched the whole regular expression. The others are those + substrings that matched parenthesized expressions within the regular ex- + pression, with parenthesized expressions numbered in left-to-right order + of their opening parentheses. + + The rreeggssuubb() function copies _s_o_u_r_c_e to _d_e_s_t, making substitutions accord- + ing to the most recent rreeggeexxeecc() performed using _p_r_o_g. Each instance of + `&' in _s_o_u_r_c_e is replaced by the substring indicated by _s_t_a_r_t_p[] and + _e_n_d_p[]. Each instance of `\_n', where _n is a digit, is replaced by the + substring indicated by _s_t_a_r_t_p[_n] and _e_n_d_p[_n]. To get a literal `&' or + `\_n' into _d_e_s_t, prefix it with `\'; to get a literal `\' preceding `&' or + `\_n', prefix it with another `\'. + + The rreeggeerrrroorr() function is called whenever an error is detected in + rreeggccoommpp(), rreeggeexxeecc(), or rreeggssuubb(). The default rreeggeerrrroorr() writes the + string _m_s_g, with a suitable indicator of origin, on the standard error + output and invokes exit(2). The rreeggeerrrroorr() function can be replaced by + the user if other actions are desirable. + +RREEGGUULLAARR EEXXPPRREESSSSIIOONN SSYYNNTTAAXX + A regular expression is zero or more _b_r_a_n_c_h_e_s, separated by `|'. It + matches anything that matches one of the branches. + + A branch is zero or more _p_i_e_c_e_s, concatenated. It matches a match for + the first, followed by a match for the second, etc. + + A piece is an _a_t_o_m possibly followed by `*', `+', or `?'. An atom fol- + lowed by `*' matches a sequence of 0 or more matches of the atom. An + atom followed by `+' matches a sequence of 1 or more matches of the atom. + An atom followed by `?' matches a match of the atom, or the null string. + + An atom is a regular expression in parentheses (matching a match for the + regular expression), a _r_a_n_g_e (see below), `.' (matching any single char- + acter), `^' (matching the null string at the beginning of the input + string), `$' (matching the null string at the end of the input string), a + `\' followed by a single character (matching that character), or a single + character with no other significance (matching that character). + + A _r_a_n_g_e is a sequence of characters enclosed in `[]'. It normally match- + es any single character from the sequence. If the sequence begins with + `^', it matches any single character _n_o_t from the rest of the sequence. + If two characters in the sequence are separated by `-', this is shorthand + for the full list of ASCII characters between them (e.g. `[0-9]' matches + any decimal digit). To include a literal `]' in the sequence, make it + the first character (following a possible `^'). To include a literal + `-', make it the first or last character. + +AAMMBBIIGGUUIITTYY + If a regular expression could match two different parts of the input + string, it will match the one which begins earliest. If both begin in + the same place but match different lengths, or match the same length in + different ways, life gets messier, as follows. + + In general, the possibilities in a list of branches are considered in + left-to-right order, the possibilities for `*', `+', and `?' are consid- + ered longest-first, nested constructs are considered from the outermost + in, and concatenated constructs are considered leftmost-first. The match + that will be chosen is the one that uses the earliest possibility in the + first choice that has to be made. If there is more than one choice, the + next will be made in the same manner (earliest possibility) subject to + the decision on the first choice. And so forth. + + For example, `(ab|a)b*c' could match `abc' in one of two ways. The first + choice is between `ab' and `a'; since `ab' is earlier, and does lead to a + successful overall match, it is chosen. Since the `b' is already spoken + for, the `b*' must match its last possibility--the empty string--since it + must respect the earlier choice. + + In the particular case where no `|'s are present and there is only one + `*', `+', or `?', the net effect is that the longest possible match will + be chosen. So `ab*', presented with `xabbbby', will match `abbbb'. Note + that if `ab*', is tried against `xabyabbbz', it will match `ab' just af- + ter `x', due to the begins-earliest rule. (In effect, the decision on + where to start the match is the first choice to be made, hence subsequent + choices must respect it even if this leads them to less-preferred alter- + natives.) + +RREETTUURRNN VVAALLUUEESS + The rreeggccoommpp() function returns NULL for a failure (rreeggeerrrroorr() permit- + ting), where failures are syntax errors, exceeding implementation limits, + or applying `+' or `*' to a possibly-null operand. + +SSEEEE AALLSSOO + ed(1), ex(1), expr(1), egrep(1), fgrep(1), grep(1), regex(3) + +HHIISSTTOORRYY + Both code and manual page for rreeggccoommpp(), rreeggeexxeecc(), rreeggssuubb(), and + rreeggeerrrroorr() were written at the University of Toronto and appeared in + 4.3BSD-Tahoe. They are intended to be compatible with the Bell V8 + regexp(3), but are not derived from Bell code. + +BBUUGGSS + Empty branches and empty regular expressions are not portable to V8. + + The restriction against applying `*' or `+' to a possibly-null operand is + an artifact of the simplistic implementation. + + Does not support egrep's newline-separated branches; neither does the V8 + regexp(3), though. + + Due to emphasis on compactness and simplicity, it's not strikingly fast. + It does give special attention to handling simple cases quickly. + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat3/regerror.0 b/usr/share/man/cat3/regerror.0 new file mode 100644 index 0000000000..e8ddcfb025 --- /dev/null +++ b/usr/share/man/cat3/regerror.0 @@ -0,0 +1,147 @@ +REGEXP(3) BSD Programmer's Manual REGEXP(3) + +NNAAMMEE + rreeggccoommpp, rreeggeexxeecc, rreeggssuubb, rreeggeerrrroorr - regular expression handlers + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _r_e_g_e_x_p _* + rreeggccoommpp(_c_o_n_s_t _c_h_a_r _*_e_x_p); + + _i_n_t + rreeggeexxeecc(_c_o_n_s_t _r_e_g_e_x_p _*_p_r_o_g, _c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g); + + _v_o_i_d + rreeggssuubb(_c_o_n_s_t _r_e_g_e_x_p _*_p_r_o_g, _c_o_n_s_t _c_h_a_r _*_s_o_u_r_c_e, _c_h_a_r _*_d_e_s_t); + +DDEESSCCRRIIPPTTIIOONN + This interface is made obsolete by regex(3). + + The rreeggccoommpp(), rreeggeexxeecc(), rreeggssuubb(), and rreeggeerrrroorr() functions implement + egrep(1)-style regular expressions and supporting facilities. + + The rreeggccoommpp() function compiles a regular expression into a structure of + type regexp, and returns a pointer to it. The space has been allocated + using malloc(3) and may be released by free. + + The rreeggeexxeecc() function matches a NUL-terminated _s_t_r_i_n_g against the com- + piled regular expression in _p_r_o_g. It returns 1 for success and 0 for + failure, and adjusts the contents of _p_r_o_g's _s_t_a_r_t_p and _e_n_d_p (see below) + accordingly. + + The members of a regexp structure include at least the following (not + necessarily in order): + + char *startp[NSUBEXP]; + char *endp[NSUBEXP]; + + where NSUBEXP is defined (as 10) in the header file. Once a successful + rreeggeexxeecc() has been done using the rreeggeexxpp(), each _s_t_a_r_t_p- _e_n_d_p pair de- + scribes one substring within the _s_t_r_i_n_g, with the _s_t_a_r_t_p pointing to the + first character of the substring and the _e_n_d_p pointing to the first char- + acter following the substring. The 0th substring is the substring of + _s_t_r_i_n_g that matched the whole regular expression. The others are those + substrings that matched parenthesized expressions within the regular ex- + pression, with parenthesized expressions numbered in left-to-right order + of their opening parentheses. + + The rreeggssuubb() function copies _s_o_u_r_c_e to _d_e_s_t, making substitutions accord- + ing to the most recent rreeggeexxeecc() performed using _p_r_o_g. Each instance of + `&' in _s_o_u_r_c_e is replaced by the substring indicated by _s_t_a_r_t_p[] and + _e_n_d_p[]. Each instance of `\_n', where _n is a digit, is replaced by the + substring indicated by _s_t_a_r_t_p[_n] and _e_n_d_p[_n]. To get a literal `&' or + `\_n' into _d_e_s_t, prefix it with `\'; to get a literal `\' preceding `&' or + `\_n', prefix it with another `\'. + + The rreeggeerrrroorr() function is called whenever an error is detected in + rreeggccoommpp(), rreeggeexxeecc(), or rreeggssuubb(). The default rreeggeerrrroorr() writes the + string _m_s_g, with a suitable indicator of origin, on the standard error + output and invokes exit(2). The rreeggeerrrroorr() function can be replaced by + the user if other actions are desirable. + +RREEGGUULLAARR EEXXPPRREESSSSIIOONN SSYYNNTTAAXX + A regular expression is zero or more _b_r_a_n_c_h_e_s, separated by `|'. It + matches anything that matches one of the branches. + + A branch is zero or more _p_i_e_c_e_s, concatenated. It matches a match for + the first, followed by a match for the second, etc. + + A piece is an _a_t_o_m possibly followed by `*', `+', or `?'. An atom fol- + lowed by `*' matches a sequence of 0 or more matches of the atom. An + atom followed by `+' matches a sequence of 1 or more matches of the atom. + An atom followed by `?' matches a match of the atom, or the null string. + + An atom is a regular expression in parentheses (matching a match for the + regular expression), a _r_a_n_g_e (see below), `.' (matching any single char- + acter), `^' (matching the null string at the beginning of the input + string), `$' (matching the null string at the end of the input string), a + `\' followed by a single character (matching that character), or a single + character with no other significance (matching that character). + + A _r_a_n_g_e is a sequence of characters enclosed in `[]'. It normally match- + es any single character from the sequence. If the sequence begins with + `^', it matches any single character _n_o_t from the rest of the sequence. + If two characters in the sequence are separated by `-', this is shorthand + for the full list of ASCII characters between them (e.g. `[0-9]' matches + any decimal digit). To include a literal `]' in the sequence, make it + the first character (following a possible `^'). To include a literal + `-', make it the first or last character. + +AAMMBBIIGGUUIITTYY + If a regular expression could match two different parts of the input + string, it will match the one which begins earliest. If both begin in + the same place but match different lengths, or match the same length in + different ways, life gets messier, as follows. + + In general, the possibilities in a list of branches are considered in + left-to-right order, the possibilities for `*', `+', and `?' are consid- + ered longest-first, nested constructs are considered from the outermost + in, and concatenated constructs are considered leftmost-first. The match + that will be chosen is the one that uses the earliest possibility in the + first choice that has to be made. If there is more than one choice, the + next will be made in the same manner (earliest possibility) subject to + the decision on the first choice. And so forth. + + For example, `(ab|a)b*c' could match `abc' in one of two ways. The first + choice is between `ab' and `a'; since `ab' is earlier, and does lead to a + successful overall match, it is chosen. Since the `b' is already spoken + for, the `b*' must match its last possibility--the empty string--since it + must respect the earlier choice. + + In the particular case where no `|'s are present and there is only one + `*', `+', or `?', the net effect is that the longest possible match will + be chosen. So `ab*', presented with `xabbbby', will match `abbbb'. Note + that if `ab*', is tried against `xabyabbbz', it will match `ab' just af- + ter `x', due to the begins-earliest rule. (In effect, the decision on + where to start the match is the first choice to be made, hence subsequent + choices must respect it even if this leads them to less-preferred alter- + natives.) + +RREETTUURRNN VVAALLUUEESS + The rreeggccoommpp() function returns NULL for a failure (rreeggeerrrroorr() permit- + ting), where failures are syntax errors, exceeding implementation limits, + or applying `+' or `*' to a possibly-null operand. + +SSEEEE AALLSSOO + ed(1), ex(1), expr(1), egrep(1), fgrep(1), grep(1), regex(3) + +HHIISSTTOORRYY + Both code and manual page for rreeggccoommpp(), rreeggeexxeecc(), rreeggssuubb(), and + rreeggeerrrroorr() were written at the University of Toronto and appeared in + 4.3BSD-Tahoe. They are intended to be compatible with the Bell V8 + regexp(3), but are not derived from Bell code. + +BBUUGGSS + Empty branches and empty regular expressions are not portable to V8. + + The restriction against applying `*' or `+' to a possibly-null operand is + an artifact of the simplistic implementation. + + Does not support egrep's newline-separated branches; neither does the V8 + regexp(3), though. + + Due to emphasis on compactness and simplicity, it's not strikingly fast. + It does give special attention to handling simple cases quickly. + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat3/regexec.0 b/usr/share/man/cat3/regexec.0 new file mode 100644 index 0000000000..e8ddcfb025 --- /dev/null +++ b/usr/share/man/cat3/regexec.0 @@ -0,0 +1,147 @@ +REGEXP(3) BSD Programmer's Manual REGEXP(3) + +NNAAMMEE + rreeggccoommpp, rreeggeexxeecc, rreeggssuubb, rreeggeerrrroorr - regular expression handlers + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _r_e_g_e_x_p _* + rreeggccoommpp(_c_o_n_s_t _c_h_a_r _*_e_x_p); + + _i_n_t + rreeggeexxeecc(_c_o_n_s_t _r_e_g_e_x_p _*_p_r_o_g, _c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g); + + _v_o_i_d + rreeggssuubb(_c_o_n_s_t _r_e_g_e_x_p _*_p_r_o_g, _c_o_n_s_t _c_h_a_r _*_s_o_u_r_c_e, _c_h_a_r _*_d_e_s_t); + +DDEESSCCRRIIPPTTIIOONN + This interface is made obsolete by regex(3). + + The rreeggccoommpp(), rreeggeexxeecc(), rreeggssuubb(), and rreeggeerrrroorr() functions implement + egrep(1)-style regular expressions and supporting facilities. + + The rreeggccoommpp() function compiles a regular expression into a structure of + type regexp, and returns a pointer to it. The space has been allocated + using malloc(3) and may be released by free. + + The rreeggeexxeecc() function matches a NUL-terminated _s_t_r_i_n_g against the com- + piled regular expression in _p_r_o_g. It returns 1 for success and 0 for + failure, and adjusts the contents of _p_r_o_g's _s_t_a_r_t_p and _e_n_d_p (see below) + accordingly. + + The members of a regexp structure include at least the following (not + necessarily in order): + + char *startp[NSUBEXP]; + char *endp[NSUBEXP]; + + where NSUBEXP is defined (as 10) in the header file. Once a successful + rreeggeexxeecc() has been done using the rreeggeexxpp(), each _s_t_a_r_t_p- _e_n_d_p pair de- + scribes one substring within the _s_t_r_i_n_g, with the _s_t_a_r_t_p pointing to the + first character of the substring and the _e_n_d_p pointing to the first char- + acter following the substring. The 0th substring is the substring of + _s_t_r_i_n_g that matched the whole regular expression. The others are those + substrings that matched parenthesized expressions within the regular ex- + pression, with parenthesized expressions numbered in left-to-right order + of their opening parentheses. + + The rreeggssuubb() function copies _s_o_u_r_c_e to _d_e_s_t, making substitutions accord- + ing to the most recent rreeggeexxeecc() performed using _p_r_o_g. Each instance of + `&' in _s_o_u_r_c_e is replaced by the substring indicated by _s_t_a_r_t_p[] and + _e_n_d_p[]. Each instance of `\_n', where _n is a digit, is replaced by the + substring indicated by _s_t_a_r_t_p[_n] and _e_n_d_p[_n]. To get a literal `&' or + `\_n' into _d_e_s_t, prefix it with `\'; to get a literal `\' preceding `&' or + `\_n', prefix it with another `\'. + + The rreeggeerrrroorr() function is called whenever an error is detected in + rreeggccoommpp(), rreeggeexxeecc(), or rreeggssuubb(). The default rreeggeerrrroorr() writes the + string _m_s_g, with a suitable indicator of origin, on the standard error + output and invokes exit(2). The rreeggeerrrroorr() function can be replaced by + the user if other actions are desirable. + +RREEGGUULLAARR EEXXPPRREESSSSIIOONN SSYYNNTTAAXX + A regular expression is zero or more _b_r_a_n_c_h_e_s, separated by `|'. It + matches anything that matches one of the branches. + + A branch is zero or more _p_i_e_c_e_s, concatenated. It matches a match for + the first, followed by a match for the second, etc. + + A piece is an _a_t_o_m possibly followed by `*', `+', or `?'. An atom fol- + lowed by `*' matches a sequence of 0 or more matches of the atom. An + atom followed by `+' matches a sequence of 1 or more matches of the atom. + An atom followed by `?' matches a match of the atom, or the null string. + + An atom is a regular expression in parentheses (matching a match for the + regular expression), a _r_a_n_g_e (see below), `.' (matching any single char- + acter), `^' (matching the null string at the beginning of the input + string), `$' (matching the null string at the end of the input string), a + `\' followed by a single character (matching that character), or a single + character with no other significance (matching that character). + + A _r_a_n_g_e is a sequence of characters enclosed in `[]'. It normally match- + es any single character from the sequence. If the sequence begins with + `^', it matches any single character _n_o_t from the rest of the sequence. + If two characters in the sequence are separated by `-', this is shorthand + for the full list of ASCII characters between them (e.g. `[0-9]' matches + any decimal digit). To include a literal `]' in the sequence, make it + the first character (following a possible `^'). To include a literal + `-', make it the first or last character. + +AAMMBBIIGGUUIITTYY + If a regular expression could match two different parts of the input + string, it will match the one which begins earliest. If both begin in + the same place but match different lengths, or match the same length in + different ways, life gets messier, as follows. + + In general, the possibilities in a list of branches are considered in + left-to-right order, the possibilities for `*', `+', and `?' are consid- + ered longest-first, nested constructs are considered from the outermost + in, and concatenated constructs are considered leftmost-first. The match + that will be chosen is the one that uses the earliest possibility in the + first choice that has to be made. If there is more than one choice, the + next will be made in the same manner (earliest possibility) subject to + the decision on the first choice. And so forth. + + For example, `(ab|a)b*c' could match `abc' in one of two ways. The first + choice is between `ab' and `a'; since `ab' is earlier, and does lead to a + successful overall match, it is chosen. Since the `b' is already spoken + for, the `b*' must match its last possibility--the empty string--since it + must respect the earlier choice. + + In the particular case where no `|'s are present and there is only one + `*', `+', or `?', the net effect is that the longest possible match will + be chosen. So `ab*', presented with `xabbbby', will match `abbbb'. Note + that if `ab*', is tried against `xabyabbbz', it will match `ab' just af- + ter `x', due to the begins-earliest rule. (In effect, the decision on + where to start the match is the first choice to be made, hence subsequent + choices must respect it even if this leads them to less-preferred alter- + natives.) + +RREETTUURRNN VVAALLUUEESS + The rreeggccoommpp() function returns NULL for a failure (rreeggeerrrroorr() permit- + ting), where failures are syntax errors, exceeding implementation limits, + or applying `+' or `*' to a possibly-null operand. + +SSEEEE AALLSSOO + ed(1), ex(1), expr(1), egrep(1), fgrep(1), grep(1), regex(3) + +HHIISSTTOORRYY + Both code and manual page for rreeggccoommpp(), rreeggeexxeecc(), rreeggssuubb(), and + rreeggeerrrroorr() were written at the University of Toronto and appeared in + 4.3BSD-Tahoe. They are intended to be compatible with the Bell V8 + regexp(3), but are not derived from Bell code. + +BBUUGGSS + Empty branches and empty regular expressions are not portable to V8. + + The restriction against applying `*' or `+' to a possibly-null operand is + an artifact of the simplistic implementation. + + Does not support egrep's newline-separated branches; neither does the V8 + regexp(3), though. + + Due to emphasis on compactness and simplicity, it's not strikingly fast. + It does give special attention to handling simple cases quickly. + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat3/regexp.0 b/usr/share/man/cat3/regexp.0 new file mode 100644 index 0000000000..e8ddcfb025 --- /dev/null +++ b/usr/share/man/cat3/regexp.0 @@ -0,0 +1,147 @@ +REGEXP(3) BSD Programmer's Manual REGEXP(3) + +NNAAMMEE + rreeggccoommpp, rreeggeexxeecc, rreeggssuubb, rreeggeerrrroorr - regular expression handlers + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _r_e_g_e_x_p _* + rreeggccoommpp(_c_o_n_s_t _c_h_a_r _*_e_x_p); + + _i_n_t + rreeggeexxeecc(_c_o_n_s_t _r_e_g_e_x_p _*_p_r_o_g, _c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g); + + _v_o_i_d + rreeggssuubb(_c_o_n_s_t _r_e_g_e_x_p _*_p_r_o_g, _c_o_n_s_t _c_h_a_r _*_s_o_u_r_c_e, _c_h_a_r _*_d_e_s_t); + +DDEESSCCRRIIPPTTIIOONN + This interface is made obsolete by regex(3). + + The rreeggccoommpp(), rreeggeexxeecc(), rreeggssuubb(), and rreeggeerrrroorr() functions implement + egrep(1)-style regular expressions and supporting facilities. + + The rreeggccoommpp() function compiles a regular expression into a structure of + type regexp, and returns a pointer to it. The space has been allocated + using malloc(3) and may be released by free. + + The rreeggeexxeecc() function matches a NUL-terminated _s_t_r_i_n_g against the com- + piled regular expression in _p_r_o_g. It returns 1 for success and 0 for + failure, and adjusts the contents of _p_r_o_g's _s_t_a_r_t_p and _e_n_d_p (see below) + accordingly. + + The members of a regexp structure include at least the following (not + necessarily in order): + + char *startp[NSUBEXP]; + char *endp[NSUBEXP]; + + where NSUBEXP is defined (as 10) in the header file. Once a successful + rreeggeexxeecc() has been done using the rreeggeexxpp(), each _s_t_a_r_t_p- _e_n_d_p pair de- + scribes one substring within the _s_t_r_i_n_g, with the _s_t_a_r_t_p pointing to the + first character of the substring and the _e_n_d_p pointing to the first char- + acter following the substring. The 0th substring is the substring of + _s_t_r_i_n_g that matched the whole regular expression. The others are those + substrings that matched parenthesized expressions within the regular ex- + pression, with parenthesized expressions numbered in left-to-right order + of their opening parentheses. + + The rreeggssuubb() function copies _s_o_u_r_c_e to _d_e_s_t, making substitutions accord- + ing to the most recent rreeggeexxeecc() performed using _p_r_o_g. Each instance of + `&' in _s_o_u_r_c_e is replaced by the substring indicated by _s_t_a_r_t_p[] and + _e_n_d_p[]. Each instance of `\_n', where _n is a digit, is replaced by the + substring indicated by _s_t_a_r_t_p[_n] and _e_n_d_p[_n]. To get a literal `&' or + `\_n' into _d_e_s_t, prefix it with `\'; to get a literal `\' preceding `&' or + `\_n', prefix it with another `\'. + + The rreeggeerrrroorr() function is called whenever an error is detected in + rreeggccoommpp(), rreeggeexxeecc(), or rreeggssuubb(). The default rreeggeerrrroorr() writes the + string _m_s_g, with a suitable indicator of origin, on the standard error + output and invokes exit(2). The rreeggeerrrroorr() function can be replaced by + the user if other actions are desirable. + +RREEGGUULLAARR EEXXPPRREESSSSIIOONN SSYYNNTTAAXX + A regular expression is zero or more _b_r_a_n_c_h_e_s, separated by `|'. It + matches anything that matches one of the branches. + + A branch is zero or more _p_i_e_c_e_s, concatenated. It matches a match for + the first, followed by a match for the second, etc. + + A piece is an _a_t_o_m possibly followed by `*', `+', or `?'. An atom fol- + lowed by `*' matches a sequence of 0 or more matches of the atom. An + atom followed by `+' matches a sequence of 1 or more matches of the atom. + An atom followed by `?' matches a match of the atom, or the null string. + + An atom is a regular expression in parentheses (matching a match for the + regular expression), a _r_a_n_g_e (see below), `.' (matching any single char- + acter), `^' (matching the null string at the beginning of the input + string), `$' (matching the null string at the end of the input string), a + `\' followed by a single character (matching that character), or a single + character with no other significance (matching that character). + + A _r_a_n_g_e is a sequence of characters enclosed in `[]'. It normally match- + es any single character from the sequence. If the sequence begins with + `^', it matches any single character _n_o_t from the rest of the sequence. + If two characters in the sequence are separated by `-', this is shorthand + for the full list of ASCII characters between them (e.g. `[0-9]' matches + any decimal digit). To include a literal `]' in the sequence, make it + the first character (following a possible `^'). To include a literal + `-', make it the first or last character. + +AAMMBBIIGGUUIITTYY + If a regular expression could match two different parts of the input + string, it will match the one which begins earliest. If both begin in + the same place but match different lengths, or match the same length in + different ways, life gets messier, as follows. + + In general, the possibilities in a list of branches are considered in + left-to-right order, the possibilities for `*', `+', and `?' are consid- + ered longest-first, nested constructs are considered from the outermost + in, and concatenated constructs are considered leftmost-first. The match + that will be chosen is the one that uses the earliest possibility in the + first choice that has to be made. If there is more than one choice, the + next will be made in the same manner (earliest possibility) subject to + the decision on the first choice. And so forth. + + For example, `(ab|a)b*c' could match `abc' in one of two ways. The first + choice is between `ab' and `a'; since `ab' is earlier, and does lead to a + successful overall match, it is chosen. Since the `b' is already spoken + for, the `b*' must match its last possibility--the empty string--since it + must respect the earlier choice. + + In the particular case where no `|'s are present and there is only one + `*', `+', or `?', the net effect is that the longest possible match will + be chosen. So `ab*', presented with `xabbbby', will match `abbbb'. Note + that if `ab*', is tried against `xabyabbbz', it will match `ab' just af- + ter `x', due to the begins-earliest rule. (In effect, the decision on + where to start the match is the first choice to be made, hence subsequent + choices must respect it even if this leads them to less-preferred alter- + natives.) + +RREETTUURRNN VVAALLUUEESS + The rreeggccoommpp() function returns NULL for a failure (rreeggeerrrroorr() permit- + ting), where failures are syntax errors, exceeding implementation limits, + or applying `+' or `*' to a possibly-null operand. + +SSEEEE AALLSSOO + ed(1), ex(1), expr(1), egrep(1), fgrep(1), grep(1), regex(3) + +HHIISSTTOORRYY + Both code and manual page for rreeggccoommpp(), rreeggeexxeecc(), rreeggssuubb(), and + rreeggeerrrroorr() were written at the University of Toronto and appeared in + 4.3BSD-Tahoe. They are intended to be compatible with the Bell V8 + regexp(3), but are not derived from Bell code. + +BBUUGGSS + Empty branches and empty regular expressions are not portable to V8. + + The restriction against applying `*' or `+' to a possibly-null operand is + an artifact of the simplistic implementation. + + Does not support egrep's newline-separated branches; neither does the V8 + regexp(3), though. + + Due to emphasis on compactness and simplicity, it's not strikingly fast. + It does give special attention to handling simple cases quickly. + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat3/regsub.0 b/usr/share/man/cat3/regsub.0 new file mode 100644 index 0000000000..e8ddcfb025 --- /dev/null +++ b/usr/share/man/cat3/regsub.0 @@ -0,0 +1,147 @@ +REGEXP(3) BSD Programmer's Manual REGEXP(3) + +NNAAMMEE + rreeggccoommpp, rreeggeexxeecc, rreeggssuubb, rreeggeerrrroorr - regular expression handlers + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _r_e_g_e_x_p _* + rreeggccoommpp(_c_o_n_s_t _c_h_a_r _*_e_x_p); + + _i_n_t + rreeggeexxeecc(_c_o_n_s_t _r_e_g_e_x_p _*_p_r_o_g, _c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g); + + _v_o_i_d + rreeggssuubb(_c_o_n_s_t _r_e_g_e_x_p _*_p_r_o_g, _c_o_n_s_t _c_h_a_r _*_s_o_u_r_c_e, _c_h_a_r _*_d_e_s_t); + +DDEESSCCRRIIPPTTIIOONN + This interface is made obsolete by regex(3). + + The rreeggccoommpp(), rreeggeexxeecc(), rreeggssuubb(), and rreeggeerrrroorr() functions implement + egrep(1)-style regular expressions and supporting facilities. + + The rreeggccoommpp() function compiles a regular expression into a structure of + type regexp, and returns a pointer to it. The space has been allocated + using malloc(3) and may be released by free. + + The rreeggeexxeecc() function matches a NUL-terminated _s_t_r_i_n_g against the com- + piled regular expression in _p_r_o_g. It returns 1 for success and 0 for + failure, and adjusts the contents of _p_r_o_g's _s_t_a_r_t_p and _e_n_d_p (see below) + accordingly. + + The members of a regexp structure include at least the following (not + necessarily in order): + + char *startp[NSUBEXP]; + char *endp[NSUBEXP]; + + where NSUBEXP is defined (as 10) in the header file. Once a successful + rreeggeexxeecc() has been done using the rreeggeexxpp(), each _s_t_a_r_t_p- _e_n_d_p pair de- + scribes one substring within the _s_t_r_i_n_g, with the _s_t_a_r_t_p pointing to the + first character of the substring and the _e_n_d_p pointing to the first char- + acter following the substring. The 0th substring is the substring of + _s_t_r_i_n_g that matched the whole regular expression. The others are those + substrings that matched parenthesized expressions within the regular ex- + pression, with parenthesized expressions numbered in left-to-right order + of their opening parentheses. + + The rreeggssuubb() function copies _s_o_u_r_c_e to _d_e_s_t, making substitutions accord- + ing to the most recent rreeggeexxeecc() performed using _p_r_o_g. Each instance of + `&' in _s_o_u_r_c_e is replaced by the substring indicated by _s_t_a_r_t_p[] and + _e_n_d_p[]. Each instance of `\_n', where _n is a digit, is replaced by the + substring indicated by _s_t_a_r_t_p[_n] and _e_n_d_p[_n]. To get a literal `&' or + `\_n' into _d_e_s_t, prefix it with `\'; to get a literal `\' preceding `&' or + `\_n', prefix it with another `\'. + + The rreeggeerrrroorr() function is called whenever an error is detected in + rreeggccoommpp(), rreeggeexxeecc(), or rreeggssuubb(). The default rreeggeerrrroorr() writes the + string _m_s_g, with a suitable indicator of origin, on the standard error + output and invokes exit(2). The rreeggeerrrroorr() function can be replaced by + the user if other actions are desirable. + +RREEGGUULLAARR EEXXPPRREESSSSIIOONN SSYYNNTTAAXX + A regular expression is zero or more _b_r_a_n_c_h_e_s, separated by `|'. It + matches anything that matches one of the branches. + + A branch is zero or more _p_i_e_c_e_s, concatenated. It matches a match for + the first, followed by a match for the second, etc. + + A piece is an _a_t_o_m possibly followed by `*', `+', or `?'. An atom fol- + lowed by `*' matches a sequence of 0 or more matches of the atom. An + atom followed by `+' matches a sequence of 1 or more matches of the atom. + An atom followed by `?' matches a match of the atom, or the null string. + + An atom is a regular expression in parentheses (matching a match for the + regular expression), a _r_a_n_g_e (see below), `.' (matching any single char- + acter), `^' (matching the null string at the beginning of the input + string), `$' (matching the null string at the end of the input string), a + `\' followed by a single character (matching that character), or a single + character with no other significance (matching that character). + + A _r_a_n_g_e is a sequence of characters enclosed in `[]'. It normally match- + es any single character from the sequence. If the sequence begins with + `^', it matches any single character _n_o_t from the rest of the sequence. + If two characters in the sequence are separated by `-', this is shorthand + for the full list of ASCII characters between them (e.g. `[0-9]' matches + any decimal digit). To include a literal `]' in the sequence, make it + the first character (following a possible `^'). To include a literal + `-', make it the first or last character. + +AAMMBBIIGGUUIITTYY + If a regular expression could match two different parts of the input + string, it will match the one which begins earliest. If both begin in + the same place but match different lengths, or match the same length in + different ways, life gets messier, as follows. + + In general, the possibilities in a list of branches are considered in + left-to-right order, the possibilities for `*', `+', and `?' are consid- + ered longest-first, nested constructs are considered from the outermost + in, and concatenated constructs are considered leftmost-first. The match + that will be chosen is the one that uses the earliest possibility in the + first choice that has to be made. If there is more than one choice, the + next will be made in the same manner (earliest possibility) subject to + the decision on the first choice. And so forth. + + For example, `(ab|a)b*c' could match `abc' in one of two ways. The first + choice is between `ab' and `a'; since `ab' is earlier, and does lead to a + successful overall match, it is chosen. Since the `b' is already spoken + for, the `b*' must match its last possibility--the empty string--since it + must respect the earlier choice. + + In the particular case where no `|'s are present and there is only one + `*', `+', or `?', the net effect is that the longest possible match will + be chosen. So `ab*', presented with `xabbbby', will match `abbbb'. Note + that if `ab*', is tried against `xabyabbbz', it will match `ab' just af- + ter `x', due to the begins-earliest rule. (In effect, the decision on + where to start the match is the first choice to be made, hence subsequent + choices must respect it even if this leads them to less-preferred alter- + natives.) + +RREETTUURRNN VVAALLUUEESS + The rreeggccoommpp() function returns NULL for a failure (rreeggeerrrroorr() permit- + ting), where failures are syntax errors, exceeding implementation limits, + or applying `+' or `*' to a possibly-null operand. + +SSEEEE AALLSSOO + ed(1), ex(1), expr(1), egrep(1), fgrep(1), grep(1), regex(3) + +HHIISSTTOORRYY + Both code and manual page for rreeggccoommpp(), rreeggeexxeecc(), rreeggssuubb(), and + rreeggeerrrroorr() were written at the University of Toronto and appeared in + 4.3BSD-Tahoe. They are intended to be compatible with the Bell V8 + regexp(3), but are not derived from Bell code. + +BBUUGGSS + Empty branches and empty regular expressions are not portable to V8. + + The restriction against applying `*' or `+' to a possibly-null operand is + an artifact of the simplistic implementation. + + Does not support egrep's newline-separated branches; neither does the V8 + regexp(3), though. + + Due to emphasis on compactness and simplicity, it's not strikingly fast. + It does give special attention to handling simple cases quickly. + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat3/remque.0 b/usr/share/man/cat3/remque.0 new file mode 100644 index 0000000000..7f180ae0c7 --- /dev/null +++ b/usr/share/man/cat3/remque.0 @@ -0,0 +1,29 @@ +INSQUE(3) BSD Programmer's Manual INSQUE(3) + +NNAAMMEE + iinnssqquuee, rreemmqquuee - insert/remove element from a queue + +SSYYNNOOPPSSIISS + struct qelem { + struct qelem *q_forw; + struct qelem *q_back; + char q_data[]; + }; + + iinnssqquuee(_(_c_a_d_d_r___t_) _s_t_r_u_c_t _q_e_l_e_m _*_e_l_e_m, _(_c_a_d_d_r___t_) _s_t_r_u_c_t _q_e_l_e_m _*_p_r_e_d); + + rreemmqquuee(_(_c_a_d_d_r___t_) _s_t_r_u_c_t _q_e_l_e_m _*_e_l_e_m); + +DDEESSCCRRIIPPTTIIOONN + The iinnssqquuee() and rreemmqquuee() functions manipulate queues built from doubly + linked lists. Each element in the queue must in the form of ``struct + qelem''. The function iinnssqquuee() inserts _e_l_e_m in a queue immediately after + _p_r_e_d; rreemmqquuee() removes an entry _e_l_e_m from a queue. + +SSEEEE AALLSSOO + _V_A_X _A_r_c_h_i_t_e_c_t_u_r_e _H_a_n_d_b_o_o_k, pp. 228-235. + +HHIISSTTOORRYY + The iinnssqquuee() and rreemmqquuee() functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/rexec.0 b/usr/share/man/cat3/rexec.0 new file mode 100644 index 0000000000..cc1e348955 --- /dev/null +++ b/usr/share/man/cat3/rexec.0 @@ -0,0 +1,48 @@ +REXEC(3) BSD Programmer's Manual REXEC(3) + +NNAAMMEE + rreexxeecc - return stream to a remote command + +SSYYNNOOPPSSIISS + _i_n_t + rreexxeecc(_a_h_o_s_t, _i_n_t _i_n_p_o_r_t, _c_h_a_r _*_u_s_e_r, _c_h_a_r _*_p_a_s_s_w_d, _c_h_a_r _*_c_m_d, _i_n_t _*_f_d_2_p); + +DDEESSCCRRIIPPTTIIOONN + TThhiiss iinntteerrffaaccee iiss oobbssoolleetteedd bbyy kkrrccmmdd((33)).. IItt iiss aavvaaiillaabbllee ffrroomm tthhee ccoomm-- + ppaattiibbiilliittyy lliibbrraarryy,, lliibbccoommppaatt.. + + The rreexxeecc() function looks up the host _*_a_h_o_s_t using gethostbyname(3), + returning -1 if the host does not exist. Otherwise _*_a_h_o_s_t is set to the + standard name of the host. If a username and password are both speci- + fied, then these are used to authenticate to the foreign host; otherwise + the environment and then the user's _._n_e_t_r_c file in his home directory are + searched for appropriate information. If all this fails, the user is + prompted for the information. + + The port _i_n_p_o_r_t specifies which well-known DARPA Internet port to use for + the connection; the call `getservbyname("exec", "tcp")' (see + getservent(3)) will return a pointer to a structure, which contains the + necessary port. The protocol for connection is described in detail in + rexecd(8). + + If the connection succeeds, a socket in the Internet domain of type + SOCK_STREAM is returned to the caller, and given to the remote command as + _s_t_d_i_n and _s_t_d_o_u_t. If _f_d_2_p is non-zero, then an auxiliary channel to a + control process will be setup, and a descriptor for it will be placed in + _*_f_d_2_p. The control process will return diagnostic output from the command + (unit 2) on this channel, and will also accept bytes on this channel as + being UNIX signal numbers, to be forwarded to the process group of the + command. The diagnostic information returned does not include remote au- + thorization failure, as the secondary connection is set up after autho- + rization has been verified. If _f_d_2_p is 0, then the _s_t_d_e_r_r (unit 2 of the + remote command) will be made the same as the _s_t_d_o_u_t and no provision is + made for sending arbitrary signals to the remote process, although you + may be able to get its attention by using out-of-band data. + +SSEEEE AALLSSOO + rcmd(3), rexecd(8) + +HHIISSTTOORRYY + The rreexxeecc() function appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/rint.0 b/usr/share/man/cat3/rint.0 new file mode 100644 index 0000000000..9277fe8dde --- /dev/null +++ b/usr/share/man/cat3/rint.0 @@ -0,0 +1,41 @@ +RINT(3) BSD Programmer's Manual RINT(3) + +NNAAMMEE + rriinntt - and round-to-closest integer functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + rriinntt(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The rriinntt() function finds the integer (represented as a double precision + number) nearest to _x in the direction of the prevailing rounding mode. + +NNOOTTEESS + On a VAX, rriinntt(_x) is equivalent to adding half to the magnitude and then + rounding towards zero. + + In the default rounding mode, to nearest, on a machine that conforms to + IEEE 754, rriinntt(_x) is the integer nearest _x with the additional stipula- + tion that if |rint(x)-x|=1/2 then rriinntt(_x) is even. Other rounding modes + can make rriinntt() act like fflloooorr(), or like cceeiill(), or round towards zero. + + Another way to obtain an integer near _x is to declare (in C) + + double x; int k; k = x; + + Most C compilers round _x towards 0 to get the integer _k, but some do oth- + erwise. If in doubt, use fflloooorr(), cceeiill(), or rriinntt() first, whichever you + intend. Also note that, if x is larger than _k can accommodate, the value + of _k and the presence or absence of an integer overflow are hard to pre- + dict. + +SSEEEE AALLSSOO + abs(3), fabs(3), ceil(3), floor(3), ieee(3), math(3) + +HHIISSTTOORRYY + A rriinntt() function appeared in Version 6 AT&T UNIX. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/scalb.0 b/usr/share/man/cat3/scalb.0 new file mode 100644 index 0000000000..4edd4cf673 --- /dev/null +++ b/usr/share/man/cat3/scalb.0 @@ -0,0 +1,87 @@ +IEEE(3) BSD Programmer's Manual IEEE(3) + +NNAAMMEE + ccooppyyssiiggnn, ddrreemm, ffiinniittee, llooggbb, ssccaallbb - IEEE 754 floating point support + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + ccooppyyssiiggnn(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + + _d_o_u_b_l_e + ddrreemm(_d_o_u_b_l_e _x, _d_o_u_b_l_e _y); + + _i_n_t + ffiinniittee(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + llooggbb(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + ssccaallbb(_d_o_u_b_l_e _x, _i_n_t _n); + +DDEESSCCRRIIPPTTIIOONN + These functions are required for, or recommended by the IEEE standard 754 + for floating-point arithmetic. + + The ccooppyyssiiggnn() function returns _x with its sign changed to _y's. + + The ddrreemm() function returns the remainder _r := _x - _n_*_y where _n is the in- + teger nearest the exact value of _x/_y; moreover if |_n - _x/_y| = 1/2 then _n + is even. Consequently the remainder is computed exactly and |_r| <= + |_y|/2. But ddrreemm(_x, _0) is exceptional. (See below under _D_I_A_G_N_O_S_T_I_C_S.) + + The ffiinniittee() function returns the value 1 just when -infinity < _x < +in- + finity; otherwise a zero is returned (when |_x| = infinity or _x is _N_a_N or + is the VAX's reserved operand). + + The llooggbb() function returns _x's exponent _n, a signed integer converted to + double-precision floating-point and so chosen that 1 (<= |_x|2**_n < 2 un- + less _x = 0 or (only on machines that conform to IEEE 754) |_x| = infinity + or _x lies between 0 and the Underflow Threshold. (See below under _B_U_G_S.) + + The ssccaallbb() function returns _x*(2**_n) computed, for integer n, without + first computing 2*_n. + +RREETTUURRNN VVAALLUUEESS + The IEEE standard 754 defines ddrreemm(_x, _0) and ddrreemm(_i_n_f_i_n_i_t_y, _y) to be in- + valid operations that produce a _N_a_N. On the VAX, ddrreemm(_x, _0) generates a + reserved operand fault. No infinity exists on a VAX. + + IEEE 754 defines llooggbb(_+_-_i_n_f_i_n_i_t_y) = infinity and llooggbb(_0) = -infinity, and + requires the latter to signal Division-by-Zero. But on a VAX, llooggbb(_0) = + 1.0 - 2.0**31 = -2,147,483,647.0. And if the correct value of ssccaallbb() + would overflow on a VAX, it generates a reserved operand fault and sets + the global variable _e_r_r_n_o to ERANGE. + +SSEEEE AALLSSOO + floor(3), math(3), infnan(3) + +HHIISSTTOORRYY + The iieeeeee functions appeared in 4.3BSD. + +BBUUGGSS + Should ddrreemm(_x, _0) and llooggbb(_0) on a VAX signal invalidity by setting _e_r_r_n_o + = EDOM ? Should llooggbb(_0) return -1.7e38? + + IEEE 754 currently specifies that llooggbb(_d_e_n_o_r_m_a_l_i_z_e_d _n_o_.) = llooggbb(_t_i_n_i_e_s_t + _n_o_r_m_a_l_i_z_e_d _n_o_. _> _0) but the consensus has changed to the specification in + the new proposed IEEE standard p854, namely that llooggbb(_x) satisfy + + 1 <= ssccaallbb(|_x|, _-_l_o_g_b_(_x_)) < Radix ... = 2 for IEEE 754 + + for every x except 0, infinity and _N_a_N. Almost every program that as- + sumes 754's specification will work correctly if llooggbb() follows 854's + specification instead. + + IEEE 754 requires ccooppyyssiiggnn(_x, _N_a_N_)) = +-_x but says nothing else about the + sign of a _N_a_N. A _N_a_N _(_Not _a _Number) is similar in spirit to the VAX's + reserved operand, but very different in important details. Since the + sign bit of a reserved operand makes it look negative, + + ccooppyyssiiggnn(_x, _r_e_s_e_r_v_e_d _o_p_e_r_a_n_d) = -_x; + + should this return the reserved operand instead? + +4.3 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/sin.0 b/usr/share/man/cat3/sin.0 new file mode 100644 index 0000000000..2dd9398fd8 --- /dev/null +++ b/usr/share/man/cat3/sin.0 @@ -0,0 +1,26 @@ +SIN(3) BSD Programmer's Manual SIN(3) + +NNAAMMEE + ssiinn - sine function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + ssiinn(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The ssiinn() function computes the sine of _x (measured in radians). A large + magnitude argument may yield a result with little or no significance. + +RREETTUURRNN VVAALLUUEESS + The ssiinn() function returns the sine value. + +SSEEEE AALLSSOO + acos(3), asin(3), atan(3), atan2(3), cos(3), cosh(3), sinh(3), + tan(3), tanh(3), math(3), + +SSTTAANNDDAARRDDSS + The ssiinn() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/sinh.0 b/usr/share/man/cat3/sinh.0 new file mode 100644 index 0000000000..78c813523e --- /dev/null +++ b/usr/share/man/cat3/sinh.0 @@ -0,0 +1,27 @@ +SINH(3) BSD Programmer's Manual SINH(3) + +NNAAMMEE + ssiinnhh - hyperbolic sine function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + ssiinnhh(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The ssiinnhh() function computes the hyperbolic sine of _x. + +RREETTUURRNN VVAALLUUEESS + The ssiinnhh() function returns the hyperbolic sine value unless the magni- + tude of _x is too large; in this event, the global variable _e_r_r_n_o is set + to ERANGE. + +SSEEEE AALLSSOO + acos(3), asin(3), atan(3), atan2(3), cos(3), cosh(3), sin(3), + tan(3), tanh(3), math(3), + +SSTTAANNDDAARRDDSS + The ssiinnhh() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/sqrt.0 b/usr/share/man/cat3/sqrt.0 new file mode 100644 index 0000000000..538895268e --- /dev/null +++ b/usr/share/man/cat3/sqrt.0 @@ -0,0 +1,45 @@ +SQRT(3) BSD Programmer's Manual SQRT(3) + +NNAAMMEE + ccbbrrtt, ssqqrrtt - cube root and square root functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + ccbbrrtt(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + ssqqrrtt(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The ccbbrrtt() function computes the cube root of _x. + + The ssqqrrtt() computes the non-negative square root of x. + +RREETTUURRNN VVAALLUUEESS + The ccbbrrtt() function returns the requested cube root. The ssqqrrtt() function + returns the requested square root unless an error occurs. On the VAX or + Tahoe processor an attempt to take the ssqqrrtt() of negative _x causes an er- + ror; in this event, the global variable _e_r_r_n_o is set to EDOM and a re- + served operand fault is generated. + +EERRRROORR ((dduuee ttoo RRoouunnddooffff eettcc..)) + The ccbbrrtt() function is accurate to within 0.7 _u_l_p_s. + + The ssqqrrtt() function on a VAX is accurate to within 0.501 _u_l_p_s. Sqrt on a + machine that conforms to IEEE 754 is correctly rounded in accordance with + the rounding mode in force; the error is less than half an _u_l_p in the de- + fault mode (round-to-nearest). An _u_l_p is one _Unit in the _Last _Place car- + ried. + +SSEEEE AALLSSOO + math(3), infnan(3) + +SSTTAANNDDAARRDDSS + The ssqqrrtt function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The ccbbrrtt function appeared in 4.3BSD. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/stty.0 b/usr/share/man/cat3/stty.0 new file mode 100644 index 0000000000..d17cebf90b --- /dev/null +++ b/usr/share/man/cat3/stty.0 @@ -0,0 +1,35 @@ +STTY(3) BSD Programmer's Manual STTY(3) + +NNAAMMEE + ssttttyy, ggttttyy - set and get terminal state (defunct) + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + ssttttyy(_i_n_t _f_d, _s_t_r_u_c_t _s_g_t_t_y_b _*_b_u_f); + + ggttttyy(_i_n_t _f_d, _s_t_r_u_c_t _s_g_t_t_y_b _*_b_u_f); + +DDEESSCCRRIIPPTTIIOONN + TThheessee iinntteerrffaacceess aarree oobbssoolleetteedd bbyy iiooccttll((22)).. TThheeyy aarree aavvaaiillaabbllee ffrroomm tthhee + ccoommppaattiibbiilliittyy lliibbrraarryy,, lliibbccoommppaatt.. + + The ssttttyy() function sets the state of the terminal associated with _f_d. + The ggttttyy() function retrieves the state of the terminal associated with + _f_d. To set the state of a terminal the call must have write permission. + + The ssttttyy() call is actually `ioctl(fd, TIOCSETP, buf)', while the ggttttyy() + call is `ioctl(fd, TIOCGETP, buf)'. See ioctl(2) and tty(4) for an expla- + nation. + +DDIIAAGGNNOOSSTTIICCSS + If the call is successful 0 is returned, otherwise -1 is returned and the + global variable _e_r_r_n_o contains the reason for the failure. + +SSEEEE AALLSSOO + ioctl(2), tty(4) + +HHIISSTTOORRYY + The ssttttyy() and ggttttyy() functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/tan.0 b/usr/share/man/cat3/tan.0 new file mode 100644 index 0000000000..d56143482a --- /dev/null +++ b/usr/share/man/cat3/tan.0 @@ -0,0 +1,27 @@ +TAN(3) BSD Programmer's Manual TAN(3) + +NNAAMMEE + ttaann - tangent function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + ttaann(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The ttaann() function computes the tangent of _x (measured in radians). A + large magnitude argument may yield a result with little or no signifi- + cance. For a discussion of error due to roundoff, see math(3). + +RREETTUURRNN VVAALLUUEESS + The ttaann() function returns the tangent value. + +SSEEEE AALLSSOO + acos(3), asin(3), atan(3), atan2(3), cos(3), cosh(3), sin(3), + sinh(3), tanh(3), math(3), + +SSTTAANNDDAARRDDSS + The ttaann() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/tanh.0 b/usr/share/man/cat3/tanh.0 new file mode 100644 index 0000000000..add1ad42fb --- /dev/null +++ b/usr/share/man/cat3/tanh.0 @@ -0,0 +1,26 @@ +TANH(3) BSD Programmer's Manual TANH(3) + +NNAAMMEE + ttaannhh - hyperbolic tangent function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + ttaannhh(_d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The ttaannhh() function computes the hyperbolic tangent of _x. For a discus- + sion of error due to roundoff, see math(3). + +RREETTUURRNN VVAALLUUEESS + The ttaannhh() function returns the hyperbolic tangent value. + +SSEEEE AALLSSOO + acos(3), asin(3), atan(3), atan2(3), cos(3), cosh(3), sin(3), + sinh(3), tan(3), math(3), + +SSTTAANNDDAARRDDSS + The ttaannhh() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/vlimit.0 b/usr/share/man/cat3/vlimit.0 new file mode 100644 index 0000000000..68b1cc5f71 --- /dev/null +++ b/usr/share/man/cat3/vlimit.0 @@ -0,0 +1,66 @@ +VLIMIT(3) BSD Programmer's Manual VLIMIT(3) + +NNAAMMEE + vvlliimmiitt - control maximum system resource consumption + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + vvlliimmiitt(_r_e_s_o_u_r_c_e, _v_a_l_u_e); + +DDEESSCCRRIIPPTTIIOONN + TThhiiss iinntteerrffaaccee iiss oobbssoolleetteedd bbyy ggeettrrlliimmiitt((22)).. IItt iiss aavvaaiillaabbllee ffrroomm tthhee + ccoommppaattiibbiilliittyy lliibbrraarryy,, lliibbccoommppaatt.. + + Limits the consumption by the current process and each process it creates + to not individually exceed _v_a_l_u_e on the specified _r_e_s_o_u_r_c_e. If _v_a_l_u_e is + specified as -1, then the current limit is returned and the limit is un- + changed. The resources which are currently controllable are: + + LIM_NORAISE A pseudo-limit; if set non-zero then the limits may not be + raised. Only the super-user may remove the _n_o_r_a_i_s_e restric- + tion. + + LIM_CPU the maximum number of cpu-seconds to be used by each process + + LIM_FSIZE the largest single file which can be created + + LIM_DATA the maximum growth of the data+stack region via sbrk(2) be- + yond the end of the program text + + LIM_STACK the maximum size of the automatically-extended stack region + + LIM_CORE the size of the largest core dump that will be created. + + LIM_MAXRSS a soft limit for the amount of physical memory (in bytes) to + be given to the program. If memory is tight, the system + will prefer to take memory from processes which are exceed- + ing their declared LIM_MAXRSS. + + Because this information is stored in the per-process information this + system call must be executed directly by the shell if it is to affect all + future processes created by the shell; limit is thus a built-in command + to csh(1). + + The system refuses to extend the data or stack space when the limits + would be exceeded in the normal way; a break(2) call fails if the data + space limit is reached, or the process is killed when the stack limit is + reached (since the stack cannot be extended, there is no way to send a + signal!). + + A file I/O operation which would create a file which is too large will + cause a signal SIGXFSZ to be generated, this normally terminates the pro- + cess, but may be caught. When the cpu time limit is exceeded, a signal + SIGXCPU is sent to the offending process; to allow it time to process the + signal it is given 5 seconds grace by raising the CPU time limit. + +SSEEEE AALLSSOO + csh(1) + +HHIISSTTOORRYY + The vvlliimmiitt() function appeared in 4.2BSD. + +BBUUGGSS + LIM_NORAISE no longer exists. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/vtimes.0 b/usr/share/man/cat3/vtimes.0 new file mode 100644 index 0000000000..2a99e60748 --- /dev/null +++ b/usr/share/man/cat3/vtimes.0 @@ -0,0 +1,64 @@ +VTIMES(3) BSD Programmer's Manual VTIMES(3) + +NNAAMMEE + vvttiimmeess - get information about resource utilization + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + vvttiimmeess(_s_t_r_u_c_t _v_t_i_m_e_s _*_p_a_r___v_m, _s_t_r_u_c_t _v_t_i_m_e_s _*_c_h___v_m); + +DDEESSCCRRIIPPTTIIOONN + TThhiiss iinntteerrffaaccee iiss oobbssoolleetteedd bbyy ggeettrruussaaggee((22)).. IItt iiss aavvaaiillaabbllee ffrroomm tthhee + ccoommppaattiibbiilliittyy lliibbrraarryy,, lliibbccoommppaatt.. + + The vvttiimmeess() function returns accounting information for the current pro- + cess and for the terminated child processes of the current process. Ei- + ther _p_a_r___v_m or _c_h___v_m or both may be 0, in which case only the information + for the pointers which are non-zero is returned. + + After the call, each buffer contains information as defined by the con- + tents of the include file _/_u_s_r_/_i_n_c_l_u_d_e_/_s_y_s_/_v_t_i_m_e_s_._h: + + struct vtimes { + int vm_utime; /* user time (*HZ) */ + int vm_stime; /* system time (*HZ) */ + /* divide next two by utime+stime to get averages */ + unsigned vm_idsrss; /* integral of d+s rss */ + unsigned vm_ixrss; /* integral of text rss */ + int vm_maxrss; /* maximum rss */ + int vm_majflt; /* major page faults */ + int vm_minflt; /* minor page faults */ + int vm_nswap; /* number of swaps */ + int vm_inblk; /* block reads */ + int vm_oublk; /* block writes */ + }; + + The _v_m___u_t_i_m_e and _v_m___s_t_i_m_e fields give the user and system time respec- + tively in 60ths of a second (or 50ths if that is the frequency of wall + current in your locality.) The _v_m___i_d_r_s_s and _v_m___i_x_r_s_s measure memory us- + age. They are computed by integrating the number of memory pages in use + each over CPU time. They are reported as though computed discretely, + adding the current memory usage (in 512 byte pages) each time the clock + ticks. If a process used 5 core pages over 1 cpu-second for its data and + stack, then _v_m___i_d_s_r_s_s would have the value 5*60, where _v_m___u_t_i_m_e_+_v_m___s_t_i_m_e + would be the 60. The _V_m___i_d_s_r_s_s argument integrates data and stack seg- + ment usage, while _v_m___i_x_r_s_s integrates text segment usage. The _V_m___m_a_x_r_s_s + function reports the maximum instantaneous sum of the text+data+stack + core-resident page count. + + The _v_m___m_a_j_f_l_t field gives the number of page faults which resulted in + disk activity; the _v_m___m_i_n_f_l_t field gives the number of page faults in- + curred in simulation of reference bits; _v_m___n_s_w_a_p is the number of swaps + which occurred. The number of file system input/output events are re- + ported in _v_m___i_n_b_l_k and _v_m___o_u_b_l_k These numbers account only for real I/O; + data supplied by the caching mechanism is charged only to the first pro- + cess to read or write the data. + +SSEEEE AALLSSOO + time(2), wait3(2), getrusage(2) + +HHIISSTTOORRYY + The vvlliimmiitt() function appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/y0.0 b/usr/share/man/cat3/y0.0 new file mode 100644 index 0000000000..4898077bd6 --- /dev/null +++ b/usr/share/man/cat3/y0.0 @@ -0,0 +1,51 @@ +J0(3) BSD Programmer's Manual J0(3) + +NNAAMMEE + jj00, jj11, jjnn, yy00, yy11, yynn - bessel functions of first and second kind + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + jj00(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + jj11(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + jjnn(_i_n_t _n, _d_o_u_b_l_e _x); + + _d_o_u_b_l_e + yy00(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + yy11(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + yynn(_i_n_t _n, _d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The functions jj00() and jj11() compute the _B_e_s_s_e_l _f_u_n_c_t_i_o_n _o_f _t_h_e _f_i_r_s_t _k_i_n_d + _o_f _t_h_e _o_r_d_e_r 0 and the _o_r_d_e_r 1, respectively, for the real value _x; the + function jjnn() computes the _B_e_s_s_e_l _f_u_n_c_t_i_o_n _o_f _t_h_e _f_i_r_s_t _k_i_n_d _o_f _t_h_e + _i_n_t_e_g_e_r Bessel0 _n for the real value _x. + + The functions yy00() and yy11() compute the linearly independent _B_e_s_s_e_l + _f_u_n_c_t_i_o_n _o_f _t_h_e _s_e_c_o_n_d _k_i_n_d _o_f _t_h_e _o_r_d_e_r 0 and the _o_r_d_e_r 1, respectively, + for the postive _i_n_t_e_g_e_r value _x (expressed as a double); the function + yynn() computes the _B_e_s_s_e_l _f_u_n_c_t_i_o_n _o_f _t_h_e _s_e_c_o_n_d _k_i_n_d _f_o_r _t_h_e _i_n_t_e_g_e_r + Bessel0 _n for the postive _i_n_t_e_g_e_r value _x (expressed as a double). + +RREETTUURRNN VVAALLUUEESS + If these functions are successful, the computed value is returned. On the + VAX and Tahoe architectures, a negative _x value results in an error; the + global variable _e_r_r_n_o is set to EDOM and a reserve operand fault is gen- + erated. + +SSEEEE AALLSSOO + math(3), infnan(3) + +HHIISSTTOORRYY + A set of these functions function appeared in Version 7 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/y1.0 b/usr/share/man/cat3/y1.0 new file mode 100644 index 0000000000..4898077bd6 --- /dev/null +++ b/usr/share/man/cat3/y1.0 @@ -0,0 +1,51 @@ +J0(3) BSD Programmer's Manual J0(3) + +NNAAMMEE + jj00, jj11, jjnn, yy00, yy11, yynn - bessel functions of first and second kind + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + jj00(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + jj11(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + jjnn(_i_n_t _n, _d_o_u_b_l_e _x); + + _d_o_u_b_l_e + yy00(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + yy11(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + yynn(_i_n_t _n, _d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The functions jj00() and jj11() compute the _B_e_s_s_e_l _f_u_n_c_t_i_o_n _o_f _t_h_e _f_i_r_s_t _k_i_n_d + _o_f _t_h_e _o_r_d_e_r 0 and the _o_r_d_e_r 1, respectively, for the real value _x; the + function jjnn() computes the _B_e_s_s_e_l _f_u_n_c_t_i_o_n _o_f _t_h_e _f_i_r_s_t _k_i_n_d _o_f _t_h_e + _i_n_t_e_g_e_r Bessel0 _n for the real value _x. + + The functions yy00() and yy11() compute the linearly independent _B_e_s_s_e_l + _f_u_n_c_t_i_o_n _o_f _t_h_e _s_e_c_o_n_d _k_i_n_d _o_f _t_h_e _o_r_d_e_r 0 and the _o_r_d_e_r 1, respectively, + for the postive _i_n_t_e_g_e_r value _x (expressed as a double); the function + yynn() computes the _B_e_s_s_e_l _f_u_n_c_t_i_o_n _o_f _t_h_e _s_e_c_o_n_d _k_i_n_d _f_o_r _t_h_e _i_n_t_e_g_e_r + Bessel0 _n for the postive _i_n_t_e_g_e_r value _x (expressed as a double). + +RREETTUURRNN VVAALLUUEESS + If these functions are successful, the computed value is returned. On the + VAX and Tahoe architectures, a negative _x value results in an error; the + global variable _e_r_r_n_o is set to EDOM and a reserve operand fault is gen- + erated. + +SSEEEE AALLSSOO + math(3), infnan(3) + +HHIISSTTOORRYY + A set of these functions function appeared in Version 7 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/yn.0 b/usr/share/man/cat3/yn.0 new file mode 100644 index 0000000000..4898077bd6 --- /dev/null +++ b/usr/share/man/cat3/yn.0 @@ -0,0 +1,51 @@ +J0(3) BSD Programmer's Manual J0(3) + +NNAAMMEE + jj00, jj11, jjnn, yy00, yy11, yynn - bessel functions of first and second kind + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + jj00(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + jj11(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + jjnn(_i_n_t _n, _d_o_u_b_l_e _x); + + _d_o_u_b_l_e + yy00(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + yy11(_d_o_u_b_l_e _x); + + _d_o_u_b_l_e + yynn(_i_n_t _n, _d_o_u_b_l_e _x); + +DDEESSCCRRIIPPTTIIOONN + The functions jj00() and jj11() compute the _B_e_s_s_e_l _f_u_n_c_t_i_o_n _o_f _t_h_e _f_i_r_s_t _k_i_n_d + _o_f _t_h_e _o_r_d_e_r 0 and the _o_r_d_e_r 1, respectively, for the real value _x; the + function jjnn() computes the _B_e_s_s_e_l _f_u_n_c_t_i_o_n _o_f _t_h_e _f_i_r_s_t _k_i_n_d _o_f _t_h_e + _i_n_t_e_g_e_r Bessel0 _n for the real value _x. + + The functions yy00() and yy11() compute the linearly independent _B_e_s_s_e_l + _f_u_n_c_t_i_o_n _o_f _t_h_e _s_e_c_o_n_d _k_i_n_d _o_f _t_h_e _o_r_d_e_r 0 and the _o_r_d_e_r 1, respectively, + for the postive _i_n_t_e_g_e_r value _x (expressed as a double); the function + yynn() computes the _B_e_s_s_e_l _f_u_n_c_t_i_o_n _o_f _t_h_e _s_e_c_o_n_d _k_i_n_d _f_o_r _t_h_e _i_n_t_e_g_e_r + Bessel0 _n for the postive _i_n_t_e_g_e_r value _x (expressed as a double). + +RREETTUURRNN VVAALLUUEESS + If these functions are successful, the computed value is returned. On the + VAX and Tahoe architectures, a negative _x value results in an error; the + global variable _e_r_r_n_o is set to EDOM and a reserve operand fault is gen- + erated. + +SSEEEE AALLSSOO + math(3), infnan(3) + +HHIISSTTOORRYY + A set of these functions function appeared in Version 7 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 1