IMD 1.17: 25/11/2014 15:04:39 Sn: 42359 (BATWINGS) MOTOROLA PHE:8503 (C) 1984 Motorola Inc. SYSTEM V/68 is a Trademark of Motorola Inc. M68000 SOFTWARE 82NNXBSV10 B* SYSTEM V68 OBJECT Release 1, Version 2.8 DISK 25 of 27 "on-line documentation"  ) 0420-,`>~ 77 >,>,>,A0>,>,>,A0>,>,>,A0>,>,>,A0>,>,>,A l+>,>,_>,_5 88>,5#88>,4&88>,7)88>,,/258;88>,6>88>,4A88>,6D88>,6G88>,4J88>,6M88>,PS88>,5V88>,9Y88>,Q\88>, =_88>, =b88>, :e88>, ;h88>,!sk88>,!4n88>,!8q88>,!5t88>,"w88>,"*z}88>,"688>,#B88>,#588>,#888>,#788>,$88>,$988>,$688>,%688>,%988>,%788>,%F88>,&688>,& :88>,&:88>,'688>,'688>,'g88>,'788>,(988>,(,88>,(888>,)!88>,)7$88>,) 5'*-88>,*036988>,*8<88>,*&?B88>,+5E88>,+H88>,+KN88>,+8Q88>,,pTW88>,, Z88>,,]88>,-`cf88>,-=i88>,-=o88>,.sr88>,. ux{88>,.~88>,/a8 8 >,/ 8 8 >,/=88>,0=88>,088>,0s88>,1:88>,1988>,1;88>,2588>,2888>,2;8 8 >,3;8#8#>,3<8%8%>,3 8'8'>,458(8(>,448*8*>,478,8,>,578-8->,588/8/>,56"8181>,5%8383>,65(8484>,6+.148686>,6978888>,79:8989>,79=8;8;>,7:@8<8<>,89C8>8>>,89F8@8@>,89I8B8B>,96L8C8C>,99O8E8E>,99R8F8F>,:9U8I8I>,:9X8K8K>,:9[8M8M>,;:^8R8R>,;5a8T8T>,;5d8U8U>,<5g8V8V>,<;j8X8X>,<_m8Z8Z>,<5p8[8[>,=;s8]8]>,=<v8_8_>,=y|8`8`>,>:8a8b>,>8c8c>,>78e8e>,?n8f8f>,?v8h8h>,@;8j8j>,@;8k8k>,@ l8m8m>,Am8o8o>,A <8q8q>,A<8r8r>,B>8t8t>,B<8u8u>,Bs8w8w>,C k8x8y>,C8z8z>,D88|8|>,Df8~8~>,D88>,E88>,EN88>,E88>,F;88>,F 88>,F388>,Gp88>,G588>,G:88>,H:88>,H; 88>,HA 88>,I788>,I788>,J ;88>,J!$'*88>,JK-088>,K4388>,K4688>,L988>,L:<88>,L9?88>,L9B88>,M9E88>,MHKN88>,N9Q88>,NHTW88>,N4Z88>,O4]88>,O`88>,Oc88>,P6f88>,Pil88>,Q;o88>,Q6r88>,Qux88>,R4{88>,R;~88>,R388>,S888>,S88>,T!88>,T88>,T388>,U-88>,U >88>,V888>,Vb88>,Wq88>,W;88>,W588>,X 88>,X 88>,X{88>,Y 688>,Y:88>,Z"%88>,Z8(88>,Z8.88>,[k188>,[7488>,[<7:=@CFIL88>,\:O88>,]RU88>,^=X88>,^![^88>,^8a88>,_=d88>,_:g88>,_ND and the item could not be found or the action is .SM .B ENTER and the table is full. .P .I Hcreate\^ returns zero if it cannot allocate sufficient space for the table. .SH BUGS Only one hash search table may be active at any given time. .\" @(#)hsearch.3c 1.5 ...usr .\" @(#)freopen.3s 1.2 .so /usr/man/u_man/man3/fopen.3s .TH HYPOT 3M .SH NAME hypot \- Euclidean distance function .SH SYNOPSIS .B #include .PP .BR "double hypot (" "x, y" ) .br .BR double " x, y" ; .SH DESCRIPTION .I Hypot\^ returns the following, taking precautions against unwarranted overflows: .PP .RS .B "sqrt(x \(** x + y \(** y)" .RE .SH DIAGNOSTICS When the correct value would overflow, .I hypot\^ returns .SM .B HUGE and sets .I errno\^ to .SM .B ERANGE. .PP These error-handling procedures may be changed with the function .IR matherr (3M). .SH SEE ALSO matherr(3M), sqrt(3F). .\" @(#)hypot.3m 1.4 ...man.TH FREXP 3C .SH NAME frexp, ldexp, modf \- manipulate parts of floating-point numbers .SH SYNOPSIS .nf .BR "double frexp (" "value, eptr" ) .BR double " value" ; .BR "int \(**" eptr ; .PP .BR "double ldexp (" "value, exp" ) .BR double " value" ; .BR int " exp ; .PP .BR "double modf (" "value, iptr" ) .BR double " value" ", \(**" iptr ; .SH DESCRIPTION Every non-zero number can be written uniquely as .IR x\| "\(** 2" \u\s-2n\s+2\d , where the ``mantissa'' (fraction) .I x\^ is in the range .RI "0.5 \(<= |" \|x\| "| < 1.0," and the ``exponent'' .I n\^ is an integer. .I Frexp\^ returns the mantissa of a double .IR value , and stores the exponent indirectly in the location pointed to by .IR eptr . .PP .I Ldexp\^ returns the quantity .IR value\| "\(** 2" \u\s-2exp\s+2\d . .PP .I Modf\^ returns the signed fractional part of .I value\^ and stores the integral part indirectly in the location pointed to by .IR iptr . .SH DIAGNOSTICS If .I ldexp\^ would cause overflow, .SM .B HUGE is returned and .I errno\^ is set t .\" @(#)iabs.3f 1.2 .so /usr/man/u_man/man3/abs.3f ...u_mano .SM .BR ERANGE\*S . .\" @(#)frexp.3c 1.3 .\" @(#)ichar.3f 1.2 .so /usr/man/u_man/man3/ftype.3f  ...man3.\" @(#)fscanf.3s 1.2 .so /usr/man/u_man/man3/scanf.3s .\" @(#)idint.3f 1.2 .so /usr/man/u_man/man3/ftype.3f ...dmax1.3fdmin1.3f dmod.3f dnint.3f drand48.3c dsign.3f dsin.3fdsinh.3fdsqrt.3fdtan.3fdtanh.3fecvt.3cedata.3cencrypt.3cend.3cendgrent.3cendpwent.3cendutent.3cerand48.3cerf.3merfc.3merrno.3cetext.3cexp.3fexp.3m fabs.3m!fclose.3s"fcvt.3c#fdopen.3s$feof.3s%ferror.3s&fflush.3s'fgetc.3s(fgets.3s)fileno.3s*float.3f+floor.3m,fmod.3m-fopen.3s.fprintf.3s/fputc.3s0fputs.3s1fread.3s2free.3c3freopen.3s4frexp.3c5fscanf.3s6fseek.3s7ftell.3s8ftw.3c9ftype.3f:fwrite.3s;gamma.3mgetc.3s?getchar.3s@getcwd.3cAgetenv.3cBgetenv.3fCgetgrent.3cDgetgrgid.3c .TH FSEEK 3S .SH NAME fseek, rewind, ftell \- reposition a file pointer in a stream .SH SYNOPSIS .B #include .PP .BR "int fseek (" "stream, offset, ptrname" ) .br .SM .BR "FILE\*S \(**" stream ; .br .BR long " offset" ; .br .BR int " ptrname" ; .PP .BR "void rewind (" stream ) .br .SM .BR "FILE\*S \(**" stream ; .PP .BR "long ftell (" stream ) .br .SM .BR "FILE\*S \(**" stream ; .SH DESCRIPTION .I Fseek\^ sets the position of the next input or output operation on the .IR stream . The new position is at the signed distance .I offset\^ bytes from the beginning, the current position, or the end of the file, when the value of .I ptrname\^ is 0, 1, or 2, respectively. .PP .IR Rewind ( stream ) is equivalent to .IR fseek ( stream ", 0L, 0)," except that no value is returned. .PP .I Fseek\^ and .I rewind\^ undo any effects of .IR ungetc (3S). .PP After .I fseek\^ or .IR rewind , the next operation on a file opened for update may be either input or output. .PP .I Ftell\^ returns the offset of the current by.\" @(#)idnint.3f 1.2 .so /usr/man/u_man/man3/round.3f .\" @(#)dmax1.3f 1.2 .so /usr/man/u_man/man3/max.3f te relative to the beginning of the file associated with the named .IR stream . .SH SEE ALSO lseek(2), fopen(3S). .SH DIAGNOSTICS .I Fseek\^ returns non-zero for improper seeks; otherwise it returns zero. An improper seek can be, for example, an .I fseek\^ done on a file that has not been opened via .IR fopen ; in particular, .I fseek\^ may not be used on a terminal or on a file opened via .IR popen (3S). .SH WARNING On \*(5) an offset returned by .I ftell\^ is measured in bytes, and it is permissible to seek to positions relative to that offset; however, portability to systems other than \*(5) requires that an offset be used by .I fseek\^ directly. Arithmetic may not meaningfully be performed on such an offset, which is not necessarily measured in bytes. .\" @(#)fseek.3s 1.5  .\" @(#)ifix.3f 1.2 .so /usr/man/u_man/man3/ftype.3f .\" @(#)dmin1.3f 1.2 .so /usr/man/u_man/man3/min.3f .\" @(#)ftell.3s 1.2 .so /usr/man/u_man/man3/fseek.3s .TH INDEX 3F .SH NAME index \- return location of FORTRAN substring .SH SYNOPSIS .nf .BR "character \(**N1" " ch1" .BR "character \(**N2" " ch2" .BR "integer" " i" .P .RB "i" " = index(" "ch1, ch2" ")" .SH DESCRIPTION .I Index\^ returns the location of substring .I ch2\^ in string .IR ch1 . The value returned is either the position at which substring .I ch2\^ starts or 0 if \fIch2\fP is not present in string .IR ch1 . .\" @(#)index.3f 1.5  .\" @(#)dmod.3f 1.2 .so /usr/man/u_man/man3/mod.3f .TH FTW 3C .SH NAME ftw \- walk a file tree .SH SYNOPSIS .B #include .PP .BR "int ftw (" "path, fn, depth" ) .br .BR "char \(**" path ; .br .BR "int (\(**" fn ") ( );" .br .BR int " depth" ; .SH DESCRIPTION .I Ftw\^ recursively descends the directory hierarchy rooted in .IR path . For each object in the hierarchy, .I ftw\^ calls .IR fn , passing it a pointer to a null-terminated character string containing the name of the object, a pointer to a .I stat structure (see .IR stat (2)) containing information about the object, and an integer. Possible values of the integer, defined in the \fB\fP header file, are \f3\s-1FTW_F\s+1\f1 for a file, \f3\s-1FTW_D\s+1\f1 for a directory, \f3\s-1FTW_DNR\s+1\f1 for a directory that cannot be read, and \f3\s-1FTW_NS\s+1\f1 for an object for which .I stat\^ could not be executed successfully. If the integer is \f3\s-1FTW_DNR\s+1\f1, descendants of that directory will not be processed. If the integer is \f3\s-1FTW_NS\s+1\f1, the .I stat structure will contain gar.\" @(#)int.3f 1.2 .so /usr/man/u_man/man3/ftype.3f .\" @(#)dnint.3f 1.2 .so /usr/man/u_man/man3/round.3f  bage. An example of an object that would cause \f3\s-1FTW_NS\s+1\f1 to be passed to .I fn\^ is a file in a directory with read permission but not execute (search) permission. .PP .I Ftw\^ visits a directory before visiting any of its descendants. .PP The tree traversal continues until the tree is exhausted, an invocation of .I fn\^ returns a nonzero value, or an error is detected within .I ftw\^ (such as an I/O error). If the tree is exhausted, .I ftw\^ returns zero. If .I fn\^ returns a nonzero value, .I ftw\^ stops its tree traversal and returns whatever value was returned by .IR fn . If .I ftw\^ detects an error, it returns \-1, and sets the error type in .IR errno . .PP .I Ftw\^ uses one file descriptor for each level in the tree. The .I depth\^ argument limits the number of file descriptors so used. If .I depth\^ is zero or negative, the effect is the same as if it were 1. .I Depth\^ must not be greater than the number of file descriptors currently available for use. .I Ftw\^ runs more quickly if .I dept.TH INTRO 3 .SH NAME intro \- introduction to subroutines and libraries .SH SYNOPSIS .B #include .PP .B #include .SH DESCRIPTION This section describes functions found in various libraries, other than those functions that directly invoke system primitives, which are described in Section\ 2 of this volume. Certain major collections are identified by a letter after the section number: .PP .PD 0 .TP 6n (3C) These functions, together with those of Section\ 2 and those marked (3S), constitute the Standard C Library, .BR libc , which is automatically loaded by the C compiler, .IR cc (1). The link editor .IR ld (1) searches this library under the .B \-lc option. Some functions require declarations that can be included in the program being compiled by adding the line .sp .BI "#include" "
" .sp The appropriate #include file is indicated in the SYNOPSIS part of a function description. .TP (3F) These functions constitute the .SM FORTRAN intrinsic function library, .BR libF77 . These f'\" e .if n .ll 79 .TH DRAND48 3C .EQ delim $$ .EN .SH NAME drand48, erand48, lrand48, nrand48, mrand48, jrand48, srand48, seed48, lcong48 \- generate uniformly distributed pseudo-random numbers .SH SYNOPSIS .nf .B double drand48 ( ) .PP .BR "double erand48 (" xsubi ) .BR "unsigned short" " xsubi" [3]; .PP .B long lrand48 ( ) .PP .BR "long nrand48 (" xsubi ) .BR "unsigned short" " xsubi" [3]; .PP .B long mrand48 ( ) .PP .BR "long jrand48 (" xsubi ) .BR "unsigned short" " xsubi" [3]; .PP .BR "void srand48 (" seedval ) .BR long " seedval" ; .PP .BR "unsigned short \(**seed48 (" seed16v ) .BR "unsigned short" " seed16v" [3]; .PP .BR "void lcong48 (" param ) .BR "unsigned short" " param" [7]; .SH DESCRIPTION This family of functions generates pseudo-random numbers using the well-known linear congruential algorithm and 48-bit integer arithmetic. .PP Functions .I drand48\^ and .I erand48\^ return non-negative double-precision floating-point values uniformly distributed over the interval $[0.0,~1.0).$ .PP Functionsh\^ is at least as large as the number of levels in the tree. .SH SEE ALSO stat(2), malloc(3C). .SH BUGS Because .I ftw\^ is recursive, it is possible for it to terminate with a memory fault when applied to very deep file structures. .br .I Ftw\^ could be made to run faster and use less storage on deep structures at the cost of considerable complexity. .br .I Ftw\^ uses .IR malloc (3C) to allocate dynamic storage during its operation. If .I ftw\^ is forcibly terminated, such as by .I longjmp\^ being executed by .I fn\^ or an interrupt routine, .I ftw\^ does not have a chance to free that storage, so it remains permanently allocated. A safe way to handle interrupts is to store the fact that an interrupt has occurred, and arrange to have .I fn\^ return a nonzero value at its next invocation. .\" @(#)ftw.3c 1.7  unctions are automatically available to the .SM FORTRAN programmer and require no special invocation of the compiler. .TP (3M) These functions constitute the Math Library, .BR libm . They are automatically loaded as needed by the .SM FORTRAN compiler .IR f\^77 (1). They are not automatically loaded by the C compiler, .IR cc (1); however, the link editor searches this library under the .B \-lm option. Declarations for these functions may be obtained from the .B #include file .BR . .TP (3S) These functions constitute the ``standard .SM I/O package''; an introduction to this package is provided in .IR stdio (3S). The functions are in the library .BR libc , already mentioned. Declarations should be obtained from the .B #include file .BR . .TP (3X) Various specialized libraries. The files in which these libraries are found are given on the appropriate pages. .sp For descriptions and examples of \f3#include\f1 files, refer to the ``Libraries'' section of the \*(5) Programming Guide. .PD .SH DEFI .I lrand48\^ and .I nrand48\^ return non-negative long integers uniformly distributed over the interval $[0,~2 sup 31 ).$ .PP Functions .I mrand48\^ and .I jrand48\^ return signed long integers uniformly distributed over the interval $[-2 sup 31 ,~2 sup 31 ).$ .PP Functions .I srand48, seed48, and .I lcong48\^ are initialization entry points, one of which should be invoked before .I drand48, lrand48, or .I mrand48\^ is called. (Although it is not recommended practice, constant default initializer values are supplied automatically if .I drand48, lrand48, or .I mrand48\^ is called without a prior call to an initialization entry point.) Functions .IR erand48 , .IR nrand48 , and .I jrand48\^ do not require an initialization entry point to be called first. .PP All the routines work by generating a sequence of 48-bit integer values, $X sub i ,$ according to the linear congruential formula .PP .ce .EQ I X sub{n+1}~=~(aX sub n^+^c) sub{roman mod~m}~~~~~~~~n>=0. .EN .PP The parameter $m^=^2 sup 48$; hence 48-bit inte.TH FTYPE 3F .SH NAME int, ifix, idint, real, float, sngl, dble, cmplx, dcmplx, ichar, char \- explicit FORTRAN type conversion .SH SYNOPSIS .nf .BR "integer" " i, j" .BR "real" " r, s" .BR "double precision" " dp, dq" .BR "complex" " cx" .BR "double complex" " dcx" .BR "character \(**" "1 ch" .P .nf .RB "i" " = int(" "r" ")" .RB "i" " = int(" "dp" ")" .RB "i" " = int(" "cx" ")" .RB "i" " = int(" "dcx" ")" .RB "i" " = ifix(" "r" ")" .RB "i" " = idint(" "dp" ")" .P .nf .RB "r" " = real(" "i" ")" .RB "r" " = real(" "dp" ")" .RB "r" " = real(" "cx" ")" .RB "r" " = real(" "dcx" ")" .RB "r" " = float(" "i" ")" .RB "r" " = sngl(" "dp" ")" .P .nf .RB "dp" " = dble(" "i" ")" .RB "dp" " = dble(" "r" ")" .RB "dp" " = dble(" "cx" ")" .RB "dp" " = dble(" "dcx" ")" .P .nf .RB "cx" " = cmplx(" "i" ")" .RB "cx" " = cmplx(" "i, j" ")" .RB "cx" " = cmplx(" "r" ")" .RB "cx" " = cmplx(" "r, s" ")" .RB "cx" " = cmplx(" "dp" ")" .RB "cx" " = cmplx(" "dp, dq" ")" .RB "cx" " = cmplx(" "dcx" ")" .P .nf .RB "dcx" " = dcmplx(" "i" ")"NITIONS A .I character\^ is any bit pattern able to fit into a byte on the machine. The .I null character\^ is a character with value 0, represented in the C language as '\e0'. A .I character array\^ is a sequence of characters. A .I "null-terminated character array" is a sequence of characters, the last of which is the .IR "null character" . A .I string\^ is a designation for a .IR "null-terminated character array" . The .I "null string"\^ is a character array containing only the null character. A .SM .B NULL pointer is the value that is obtained by casting .B 0 into a pointer. The C language guarantees that this value will not match that of any legitimate pointer, so many functions that return pointers return it to indicate an error. .SM .B NULL is defined as .B 0 in .BR ; the user can include his own definition if he is not using .BR . .PP Many groups of .SM FORTRAN intrinsic functions have .I generic\^ function names that do not require explicit or implicit type declaration. The type o ger arithmetic is performed. Unless .I lcong48\^ has been invoked, the multiplier value $a$ and the addend value $c$ are given by .PP .RS 6 .EQ I a~mark =~roman 5DEECE66D^sub 16~=~roman 273673163155^sub 8 .EN .br .EQ I c~lineup =~roman B^sub 16~=~roman 13^sub 8 . .EN .RE .PP The value returned by any of the functions .I drand48, erand48, lrand48, nrand48, mrand48, or .I jrand48\^ is computed by first generating the next 48-bit $X sub i$ in the sequence. Then the appropriate number of bits, according to the type of data item to be returned, are copied from the high-order (leftmost) bits of $X sub i$ and transformed into the returned value. .PP The functions .I drand48, lrand48, and .I mrand48\^ store the last 48-bit $X sub i$ generated in an internal buffer; that is why they must be initialized prior to being invoked. The functions .I erand48, nrand48, and .I jrand48\^ require the calling program to provide storage for the successive $X sub i$ values in the array specified as an argument when the functions are .RB "dcx" " = dcmplx(" "i, j" ")" .RB "dcx" " = dcmplx(" "r" ")" .RB "dcx" " = dcmplx(" "r, s" ")" .RB "dcx" " = dcmplx(" "dp" ")" .RB "dcx" " = dcmplx(" "dp, dq" ")" .RB "dcx" " = dcmplx(" "cx" ")" .P .nf .RB "i" " = ichar(" "ch" ")" .RB "ch" " = char(" "i" ")" .SH DESCRIPTION .P These functions perform conversion from one data type to another. .P .B Int\^ converts to \fIinteger\fP form its \fIreal\fP, \fIdouble precision\fP, \fIcomplex\fP, or \fIdouble complex\fP argument. If the argument is \fIreal\fP or \fIdouble precision\fP, .B int\^ returns the integer whose magnitude is the largest integer that does not exceed the magnitude of the argument and whose sign is the same as the sign of the argument (i.e., truncation). For complex types, the above rule is applied to the real part. .B Ifix\^ and .B idint\^ convert only \fIreal\fP and \fIdouble precision\fP arguments respectively. .P .B Real\^ converts to \fIreal\fP form an \fIinteger\fP, \fIdouble precision\fP, \fIcomplex\fP, or \fIdouble complex\fP argumenf the function is determined by the type of its argument(s). For example, the generic function .I max\^ returns an integer value if given integer arguments (\fImax0\fP), a real value if given real arguments (\fIamax1\fP), or a double-precision value if given double-precision arguments (\fIdmax1\fP). .SH FILES /lib/libc.a .br /usr/lib/libF77.a .br /lib/libm.a .SH SEE ALSO ar(1), cc(1), f77(1), ld(1), nm(1), intro(2), stdio(3S). .br .IR "\*(6) Programming Guide" . .SH DIAGNOSTICS Functions in the Math Library (3M) may return the conventional values .B 0 or .SM .B HUGE (the largest single-precision floating-point number) when the function is undefined for the given arguments or when the value is not representable. In these cases, the external variable .I errno\^ (see .IR intro (2)) is set to the value .SM EDOM or .SM ERANGE\*S. Because many of the .SM FORTRAN intrinsic functions use the routines found in the Math Library, the same conventions apply. .\" @(#)intro.3 1.10  invoked. That is why these routines do not have to be initialized; the calling program merely has to place the desired initial value of $X sub i$ into the array and pass it as an argument. By using different arguments, functions .I erand48, nrand48, and .I jrand48\^ allow separate modules of a large program to generate several .I independent\^ streams of pseudo-random numbers, i.e., the sequence of numbers in each stream does .I not\^ depend upon how many times the routines have been called to generate numbers for the other streams. .PP The initializer function .I srand48\^ sets the high-order 32 bits of $X sub i$ to the 32 bits contained in its argument. The low-order 16 bits of $X sub i$ are set to the arbitrary value $roman 330E sub 16 .$ .PP The initializer function .I seed48\^ sets the value of $X sub i$ to the 48-bit value specified in the argument array. The previous value of $X sub i$ is copied into a 48-bit internal buffer, used only by .I seed48. A pointer to this buffer is the value returned by .I t. If the argument is \fIdouble precision\fP or \fIdouble complex\fP, as much precision is kept as is possible. If the argument is one of the complex types, the real part is returned. .B Float\^ and .B sngl\^ convert only \fIinteger\fP and \fIdouble precision\fP arguments, respectively. .P .B Dble\^ converts any \fIinteger\fP, \fIreal\fP, \fIcomplex\fP, or \fIdouble complex\fP argument to \fIdouble precision\fP form. If the argument is of a complex type, the real part is returned. .P .B Cmplx\^ converts its \fIinteger\fP, \fIreal\fP, \fIdouble precision\fP, or \fIdouble complex\fP argument(s) to \fIcomplex\fP form. .P .B Dcmplx\^ converts its \fIinteger\fP, \fIreal\fP, \fIdouble precision\fP, or \fIcomplex\fP argument(s) to \fIdouble complex\fP form. .P Either one or two arguments may be supplied to .B cmplx\^ and .B dcmplx . If there is only one argument, it is taken as the real part of the complex type and a imaginary part of zero is supplied. If two arguments are supplied, the first is taken as the real pa.\" @(#)isalnum.3c 1.2 .so /usr/man/u_man/man3/ctype.3c  seed48.\^ The returned pointer, which can be ignored if not needed, is useful if a program is to be restarted from a given point at some future time. Use the pointer to get and store the last $X sub i$ value; then use this value to reinitialize via .I seed48\^ when the program is restarted. .PP The initialization function .I lcong48\^ allows the user to specify the initial $X sub i ,$ the multiplier value $a,$ and the addend value $c.$ Argument array elements .I param[0-2]\^ specify $X sub i ,$ elements .I param[3-5]\^ specify the multiplier $a,$ and .I param[6]\^ specifies the 16-bit addend $c.$ After .I lcong48\^ has been called, a subsequent call to either .I srand48\^ or .I seed48\^ will restore the ``standard'' multiplier and addend values, $a$ and $c,$ specified on the previous page. .SH NOTES The versions of these routines for the VAX-11 and PDP-11 are coded in assembly language for maximum speed. It requires approximately 80 \(*msec on a VAX-11/780 and 130 \(*msec on a PDP-11/70 to generate one pseurt and the second as the imaginary part. .P .B Ichar\^ converts from a character to an integer depending on the character's position in the collating sequence. .P .B Char\^ returns the character in the \fIi\fPth position in the processor collating sequence, where \fIi\fP is the supplied argument. .P For a processor capable of representing \fIn\fP characters, .DS .sp 1v \fBichar\fP(\fBchar\fP(i)) = i for 0 <= i < \fIn\fP, and .sp 1v \fBchar\fP(\fBichar\fP(ch)) = ch for any representable character \fIch\fP. .\" @(#)ftype.3f 1.6  .\" @(#)isalpha.3c 1.2 .so /usr/man/u_man/man3/ctype.3c do-random number. On other computers, currently including the M68000 processors, the routines are coded in portable C. The source code for the portable version can even be used on computers which do not have floating-point arithmetic. In such a situation, functions .IR drand48\^ " and " erand48\^ do not exist; instead, they are replaced by the following two functions: .PP .nf .B long irand48 (m) .B unsigned short m; .PP .B long krand48 (xsubi, m) .B unsigned short xsubi[3], m; .fi .PP .RI "Functions " irand48\^ " and " krand48\^ return non-negative long integers uniformly distributed over the interval $[0,~m-1 ].$ .SH SEE ALSO rand(3C). .\" @(#)drand48.3c 1.7 .\" @(#)fwrite.3s 1.2 .so /usr/man/u_man/man3/fread.3s .\" @(#)isascii.3c 1.2 .so /usr/man/u_man/man3/ctype.3c  .\" @(#)dsign.3f 1.2 .so /usr/man/u_man/man3/sign.3f '\" e .TH GAMMA 3M .SH NAME gamma \- log gamma function .SH SYNOPSIS .B #include .PP .B extern int signgam; .PP .BR "double gamma (" x ) .br .BR double " x" ; .SH DESCRIPTION .I Gamma\^ returns the natural log of gamma as a function of the absolute value of a given value. .EQ delim $$ .EN .I Gamma\^ returns $ln ( | GAMMA ( ^ x ) | )$, where $GAMMA ( ^ x )$ is defined as .sp 2 .RS $int from 0 to inf e sup { - t } t sup { x - 1 } dt$. .sp .RE The sign of .EQ GAMMA ( ^ x ) .EN is returned in the external integer .IR signgam . The argument .I x may not be a non-positive integer. .PP The following C program fragment might be used to calculate \(*G: .PP .RS .nf \f3if ((y = gamma(x)) > \s-1LOGHUGE\s+1)\f1 \f3error(\|);\f1 \f3y = signgam \(** exp(y);\f1 .fi .RE .PP where .SM LOGHUGE is the least value that causes .IR exp (3M) to return a range error. .SH DIAGNOSTICS For non-negative integer arguments .SM .B HUGE is returned, and .I errno\^ is set to .SM .BR EDOM . A message indicating \s-1DOMAIN\s+1 error i.\" @(#)isatty.3c 1.2 .so /usr/man/u_man/man3/ttyname.3c .\" @(#)dsin.3f 1.2 .so /usr/man/u_man/man3/sin.3f  s printed on the standard error output. .PP If the correct value would overflow, .I gamma\^ returns .SM .B HUGE and sets .I errno to .SM .BR ERANGE . .PP These error-handling procedures may be changed with the function .IR matherr (3M). .SH SEE ALSO exp(3M), matherr(3M). .\" @(#)gamma.3m 1.7 .\" @(#)iscntrl.3c 1.2 .so /usr/man/u_man/man3/ctype.3c .\" @(#)dsinh.3f 1.2 .so /usr/man/u_man/man3/sinh.3f .\" @(#)gcvt.3c 1.2 .so /usr/man/u_man/man3/ecvt.3c   .\" @(#)isdigit.3c 1.2 .so /usr/man/u_man/man3/ctype.3c .\" @(#)dsqrt.3f 1.2 .so /usr/man/u_man/man3/sqrt.3f .TH GETARG 3F .SH NAME getarg \- return FORTRAN command-line argument .SH SYNOPSIS .nf .BR "character\(**N" " c" .BR "integer" " i" .P .BR "getarg (" "i, c" ")" .SH DESCRIPTION .I Getarg\^ returns the .IR i -th command-line argument of the current process. Thus, if a program were invoked via .P .DS \f3foo\f2 arg1 arg2 arg3\f1 .DE .P .B getarg(2, c) would return the string \fIarg2\fP in the character variable .IR c . .SH SEE ALSO getopt(3C). .\" @(#)getarg.3f 1.6 .\" @(#)isgraph.3c 1.2 .so /usr/man/u_man/man3/ctype.3c   .\" @(#)dtan.3f 1.2 .so /usr/man/u_man/man3/tan.3f .TH GETC 3S .SH NAME getc, getchar, fgetc, getw \- get character or word from stream .SH SYNOPSIS .B #include .PP .BR "int getc (" stream ) .br .SM .BR "FILE\*S \(**" stream ; .PP .B int getchar (\|) .PP .BR "int fgetc (" stream ) .br .SM .BR "FILE\*S \(**" stream ; .PP .BR "int getw (" stream ) .br .SM .BR "FILE\*S \(**" stream ; .SH DESCRIPTION .I Getc\^ returns the next character (i.e., byte) from the named input .IR stream . It also moves the file pointer, if defined, ahead one character in .IR stream. .I Getc\^ is a macro and therefore cannot be used if a function is necessary; for example, one cannot have a function pointer point to it. .PP .I Getchar returns the next character from the standard input stream, .IR stdin. As in the case of .IR getc , .I getchar\^ is a macro. .PP .I Fgetc\^ performs the same function as .IR getc , but is a genuine function. .I Fgetc\^ runs more slowly than .IR getc , but takes less space per invocation. .PP .I Getw\^ returns the next word (i.e., integer) from th.\" @(#)isign.3f 1.2 .so /usr/man/u_man/man3/sign.3f .\" @(#)dtanh.3f 1.2 .so /usr/man/u_man/man3/tanh.3f   e named input .IR stream. The size of a word varies from machine to machine. It returns the constant .SM .B EOF upon end-of-file or error, but as that is a valid integer value, .I feof\^ and .IR ferror (3S) should be used to check the success of .IR getw . .I Getw\^ increments the associated file pointer, if defined, to point to the next word. .I Getw\^ assumes no special alignment in the file. .SH SEE ALSO fclose(3S), ferror(3S), fopen(3S), fread(3S), gets(3S), putc(3S), scanf(3S). .SH DIAGNOSTICS These functions return the integer constant .SM .B EOF at end-of-file or upon an error. .SH BUGS Because it is implemented as a macro, .I getc\^ treats incorrectly a .I stream\^ argument with side effects. In particular, .B getc(\(**f\(pl\(pl) doesn't work sensibly. .I Fgetc\^ should be used instead. .br Because of possible differences in word length and byte ordering, files written using .I putw\^ are machine-dependent, and may not be read using .I getw\^ on a different processor. .\" @(#)getc.3s 1.4 .\" @(#)islower.3c 1.2 .so /usr/man/u_man/man3/ctype.3c .TH ECVT 3C .SH NAME ecvt, fcvt, gcvt \- convert floating-point number to string .SH SYNOPSIS .BR "char \(**ecvt (" "value, ndigit, decpt, sign" ) .br .BR double " value" ; .br .BR int " ndigit" ", \(**" "decpt" , .BR \(** sign ; .PP .BR "char \(**fcvt (" "value, ndigit, decpt, sign" ) .br .BR double " value" ; .br .BR int " ndigit" ", \(**" "decpt" , .BR \(** sign ; .PP .BR "char \(**gcvt (" "value, ndigit, buf" ) .br .BR double " value" ; .br .BR "char \(**" buf ; .SH DESCRIPTION .I Ecvt\^ converts .I value\^ to a null-terminated string of .I ndigit\^ digits and returns a pointer to this string. The low-order digit is rounded. The position of the decimal point relative to the beginning of the string is stored indirectly through .I decpt\^ (negative means to the left of the returned digits). The decimal point is not included in the returned string. If the sign of the result is negative, the word pointed to by .IR sign "" is non-zero; otherwise it is zero. .PP .IR Fcvt " is identical to " "ecvt\fR, except t.\" @(#)getchar.3s 1.2 .so /usr/man/u_man/man3/getc.3s   .\" @(#)isprint.3c 1.2 .so /usr/man/u_man/man3/ctype.3c hat the correct digit" has been rounded for FORTRAN F-format output of the number of digits specified by .IR ndigit . .PP .I Gcvt\^ converts the .I value\^ to a null-terminated string in the array pointed to by .I buf\^ and returns .IR buf . It attempts to produce .I ndigit\^ significant digits in FORTRAN F-format, ready for printing; E-format is produced when F-format is not possible. A minus sign, if there is one, or a decimal point is included as part of the returned string. Trailing zeros are suppressed. .SH "SEE ALSO" printf(3S). .SH BUGS The return values point to static data whose content is overwritten by each call. .\" @(#)ecvt.3c 1.6 .TH GETCWD 3C .SH NAME getcwd \- get pathname of current working directory .SH SYNOPSIS .nf .BR "char \(**getcwd (" "buf, size" ) .BR "char \(**" buf ; .BR int " size" ; .fi .SH DESCRIPTION .I Getcwd\^ returns a pointer to the current directory pathname. The value of .I size must be at least two greater than the length of the pathname to be returned. .PP If .I buf is a .SM NULL pointer, .I getcwd obtains .I size bytes of space using .IR malloc (3C). In this case, the pointer returned by .I getcwd may be used as the argument in a subsequent call to .I free. .PP The function is implemented by using .IR popen (3S) to pipe the output of the .IR pwd (1) command into the specified string space. .SH EXAMPLE .RS .nf \f3char \(**cwd, \(**getcwd();\f1 \f3\&.\f1 \f3\&.\f1 \f3\&.\f1 \f3if ((cwd = getcwd((char \(**)NULL, 64)) == NULL) {\f1 .RS \f3perror(``pwd'');\f1 \f3exit(1);\f1 .RE \f3}\f1 \f3printf(``%s\en'', cwd);\f1 .fi .RE .SH "SEE ALSO" pwd(1), malloc(3C), popen(3S). .SH DIAGNOSTICS Returns .SM .B NULL with .I er.\" @(#)ispunct.3c 1.2 .so /usr/man/u_man/man3/ctype.3c   .\" @(#)edata.3c 1.2 .so /usr/man/u_man/man3/end.3c rno set if .I size is not large enough, or if an error occurs in a lower-level function. .\" @(#)getcwd.3c 1.5 .\" @(#)isspace.3c 1.2 .so /usr/man/u_man/man3/ctype.3c .\" @(#)encrypt.3c 1.2 .so /usr/man/u_man/man3/crypt.3c   .TH GETENV 3C .SH NAME getenv \- return value for environment name .SH SYNOPSIS .BR "char \(**getenv (" name ) .br .BR "char \(**" name ; .SH DESCRIPTION .I Getenv\^ .a searches the environment list (see .IR environ (5)) for a string of the form .IB name = value , and returns a pointer to the .I value\^ in the current environment if such a string is present; otherwise a .SM NULL pointer is returned. .SH SEE ALSO environ(5). .\" @(#)getenv.3c 1.4 .\" @(#)isupper.3c 1.2 .so /usr/man/u_man/man3/ctype.3c .TH END 3C .SH NAME end, etext, edata \- last locations in program .SH SYNOPSIS .B extern end; .br .B extern etext; .br .B extern edata; .SH DESCRIPTION These names refer neither to routines nor to locations with interesting contents. The address of .I etext\^ is the first address above the program text, .I edata\^ above the initialized data region, and .I end\^ above the uninitialized data region. .PP When execution begins, the program break (the first location beyond the data) coincides with .IR end , but the program break may be reset by the routines of .IR brk (2), .IR malloc (3C), standard input/output .RI ( stdio (3S)), the profile .RB ( \-p ) option of .IR cc (1), and others. Thus, the current value of the program break should be determined by .B sbrk(0) (see .IR brk (2)). .SH "SEE ALSO" brk(2), malloc(3C). .\" @(#)end.3c 1.3 .TH GETENV 3F .SH NAME getenv \- return FORTRAN environment variable .SH SYNOPSIS .BR "character \(**N" " c" .P .BR "getenv(" "\s-1TMPDIR\s+1, c" ) .SH DESCRIPTION .I Getenv\^ returns the character-string value of the environment variable represented by its first argument into the character variable of its second argument. If no such environment variable exists, all blanks are returned. .SH SEE ALSO getenv(3C), environ(5). .\" @(#)getenv.3f 1.5   .\" @(#)isxdigit.3c 1.2 .so /usr/man/u_man/man3/ctype.3c .\" @(#)endgrent.3c 1.2 .so /usr/man/u_man/man3/getgrent.3c '\" t .TH GETGRENT 3C .SH NAME getgrent, getgrgid, getgrnam, setgrent, endgrent \- obtain group file entry from a group file .SH SYNOPSIS .B #include .PP .B struct group \(**getgrent ( ) .PP .BR "struct group \(**getgrgid (" gid ) .br .BR int " gid" ; .PP .BR "struct group \(**getgrnam (" name ) .br .BR "char \(**" name ; .PP .B void setgrent ( ) .PP .B void endgrent ( ) .SH DESCRIPTION .IR Getgrent , .IR getgrgid, and .I getgrnam\^ each return pointers to an object with the following structure containing the broken-out fields of a line in the .B /etc/group file. Each line contains a group structure, defined in the .B \^ header file. .PP .TS l1 l1 l1 l. \f3struct group {\f1 \f3char \(**gr_name;\f1 /\(** the name of the group \(**/ \f3char \(**gr_passwd;\f1 /\(** the encrypted group password \(**/ \f3int gr_gid;\f1 /\(** the numerical group ID \(**/ \f3char \(**\(**gr_mem;\f1 /\(** vector of pointers to member names \(**/ \f3};\f1 .TE .PP When first called, .I getgrent\^ returns a pointer t.\" @(#)j0.3m 1.2 .so /usr/man/u_man/man3/bessel.3m   .\" @(#)endpwent.3c 1.2 .so /usr/man/u_man/man3/getpwent.3c o the first group structure in the file; thereafter, it returns a pointer to the next group structure in the file; therefore, successive calls may be used to search the entire file. .I Getgrgid\^ searches from the beginning of the file until a numerical group id matching .I gid\^ is found; it returns a pointer to the particular structure in which the match was found. .I Getgrnam\^ searches from the beginning of the file until a group name matching .I name\^ is found; it returns a pointer to the particular structure in which the match was found. If an end-of-file or an error is encountered on reading, these functions return a .SM NULL pointer. .PP A call to .I setgrent\^ has the effect of rewinding the group file to allow repeated searches. .I Endgrent\^ may be called to close the group file when processing is complete. .SH FILES /etc/group .SH "SEE ALSO" getlogin(3C), getpwent(3C), group(4). .SH DIAGNOSTICS A .SM .B NULL pointer is returned on .SM .B EOF or error. .SH WARNING The above routines use \fB\fP. This causes them to increase the size of programs not otherwise using standard I/O more than might be expected. .SH BUGS All information is contained in a static area, so it must be copied if it is to be saved. .\" @(#)getgrent.3c 1.5 .\" @(#)jn.3m 1.2 .so /usr/man/u_man/man3/bessel.3m .\" @(#)erand48.3c 1.2 .so /usr/man/u_man/man3/drand48.3c .\" @(#)getgrgid.3c 1.2 .so /usr/man/u_man/man3/getgrent.3c   .\" @(#)jrand48.3c 1.2 .so /usr/man/u_man/man3/drand48.3c '\" e .TH ERF 3M .SH NAME erf, erfc \- error function and complementary error function .SH SYNOPSIS .B #include .PP .BR "double erf (" x ) .br .BR double " x" ; .PP .BR "double erfc (" x ) .br .BR double " x" ; .SH DESCRIPTION .I Erf\^ returns the error function of .IR x , defined as .EQ {2 over sqrt pi} int from 0 to x e sup {- t sup 2} dt . .EN .PP .IR Erfc , which returns 1.0 \- .IR erf(x) , is provided because of the extreme loss of relative accuracy if .I erf(x) is called for large .I x and the result subtracted from 1.0 (e.g., for .I x = 5, 12 places are lost). .SH "SEE ALSO" exp(3M). .\" @(#)erf.3m 1.4 Egetgrnam.3cFgetlogin.3cGgetopt.3cHgetpass.3cIgetpw.3cJgetpwent.3cKgetpwnam.3cLgetpwuid.3cMgets.3sNgetut.3cOgetutent.3cPgetutid.3cQgetutline.3cRgetw.3sSgmtime.3cTgsignal.3cUhcreate.3cVhdestroy.3cWhsearch.3cXhypot.3mYiabs.3fZichar.3f[idint.3f\idnint.3f]ifix.3f^index.3f_int.3f`intro.3aisalnum.3cbisalpha.3ccisascii.3cdisatty.3ceiscntrl.3cfisdigit.3cgisgraph.3chisign.3fiislower.3cjisprint.3ckispunct.3clisspace.3cmisupper.3cnisxdigit.3coj0.3mpj1.3mqjn.3mrjrand48.3csl3tol.3ctl64a.3culcong48.3cvldaclose.3xwldahread.3xxldaopen.3xyldclose.3xzldexp.3c{ldfhread.3x|ldgetname.3x}ldlinit.3x~ldlitem.3xldlread.3xldlseek.3xldnlseek.3xldnrseek.3xldnshread.3xldnsseek.3x.TH L3TOL 3C .SH NAME l3tol, ltol3 \- convert between 3-byte integers and long integers .SH SYNOPSIS .BR "void l3tol (" "lp, cp, n" ) .br .BR "long \(**" lp ; .br .BR "char \(**" cp ; .br .BR int " n" ; .PP .BR "void ltol3 (" "cp, lp, n" ) .br .BR "char \(**" cp ; .br .BR "long \(**" lp ; .br .BR int " n" ; .SH DESCRIPTION .I L3tol\^ converts a list of .I n\^ 3-byte integers (packed into a character string pointed to by .IR cp ) into a list of long integers pointed to by .IR lp . .PP .I Ltol3\^ performs the reverse conversion from long integers .RI ( lp ) to 3-byte integers .RI ( cp ). .PP These functions are useful for file system maintenance where the block numbers are 3 bytes long. .SH SEE ALSO fs(4). .SH BUGS Because of possible differences in byte ordering, the numerical values of the long integers are machine-dependent. .\" @(#)l3tol.3c 1.4  .\" @(#)erfc.3m 1.2 .so /usr/man/u_man/man3/erf.3m .\" @(#)getgrnam.3c 1.2 .so /usr/man/u_man/man3/getgrent.3c .\" @(#)l64a.3c 1.2 .so /usr/man/u_man/man3/a64l.3c .\" @(#)errno.3c 1.2 .so /usr/man/u_man/man3/perror.3c  .TH GETLOGIN 3C .SH NAME getlogin \- get login name .SH SYNOPSIS .B char \(**getlogin ( ); .SH DESCRIPTION .I Getlogin\^ returns a pointer to the login name as found in .BR /etc/utmp . It may be used in conjunction with .I getpwnam\^ to locate the correct password file entry when the same user .SM ID is shared by several login names. .PP If .I getlogin\^ is called within a process that is not attached to a terminal, it returns a .SM .B NULL pointer. The correct procedure for determining the login name is to call .I cuserid\^ or .IR getlogin. If \fIgetlogin\fP fails, call .IR getpwuid . .SH FILES /etc/utmp .SH SEE ALSO cuserid(3S), getgrent(3C), getpwent(3C), utmp(4). .SH DIAGNOSTICS .I Getlogin\^ returns the .SM .B NULL pointer if .I name\^ is not found. .SH BUGS The return values point to static data whose content is overwritten by each call. .\" @(#)getlogin.3c 1.3 .\" @(#)lcong48.3c 1.2 .so /usr/man/u_man/man3/drand48.3c .\" @(#)etext.3c 1.2 .so /usr/man/u_man/man3/end.3c .TH GETOPT 3C .SH NAME getopt \- get option letter from argument vector .SH SYNOPSIS .BR "int getopt (" "argc, argv, optstring" ) .br .BR int " argc" ; .br .BR "char \(**\(**" argv ; .br .BR "char \(**" optstring ; .PP .B extern char \(**optarg; .br .B extern int optind; .br .SH DESCRIPTION .I Getopt\^ returns the next option letter in .I argv\^ that matches a letter in .IR optstring . .I Optstring\^ is a string of recognized option letters; if a letter is followed by a colon, the option is expected to have an argument that may or may not be separated from it by white space. .I Optarg\^ is set to point to the start of the option argument on return from .IR getopt . .PP .I Getopt\^ places in .I optind\^ the .I argv\^ index of the next argument to be processed. Because .I optind\^ is external, it is normally initialized to zero automatically before the first call to .IR getopt . .PP When all options have been processed (i.e., up to the first non-option argument), .I getopt\^ returns .SM .BR EOF . The special op .\" @(#)ldaclose.3x 1.2 .so /usr/man/u_man/man3/ldclose.3x .TH EXP 3F .SH NAME exp, dexp, cexp \- FORTRAN exponential intrinsic function .SH SYNOPSIS .nf .BR "real" " r1, r2" .BR "double precision" " dp1, dp2" .BR "complex" " cx1, cx2" .P .RB "r2" " = exp(" "r1" ")" .P .RB "dp2" " = dexp(" "dp1" ")" .RB "dp2" " = exp(" "dp1" ")" .P .RB "cx2" " = clog(" "cx1" ")" .RB "cx2" " = exp(" "cx1" ")" .SH DESCRIPTION .I Exp\^ returns the real exponential function .I e\u\s-2x\s0\d of its real argument. .I Dexp\^ returns the double-precision exponential function of its double-precision argument. .I Cexp\^ returns the complex exponential function of its complex argument. The generic function .I exp\^ becomes a call to .I dexp\^ or .IR cexp\^ , as required, depending on the type of its argument. .SH SEE ALSO exp(3M). .\" @(#)exp.3f 1.5 tion .B \-\^\- may be used to delimit the end of the options; .SM .B EOF will be returned, and .B \-\^\- will be skipped. .SH DIAGNOSTICS .I Getopt\^ prints an error message on .I stderr\^ and returns a question mark .RB ( ? ) when it encounters an option letter not included in .IR optstring . .SH WARNING The above routine uses \fB\fP. This causes the size of programs not otherwise using standard I/O to increase more than might be expected. .SH EXAMPLE The following code fragment shows how one might process the arguments for a command that can take the mutually exclusive options .B a and .BR b , and the options .B f and .BR o , both of which require arguments: .PP .RS .nf .ss 18 \f3main (argc, argv)\f1 \f3int argc;\f1 \f3char \(**\(**argv;\f1 \f3{\f1 \f3int c;\f1 \f3extern int optind;\f1 \f3extern char \(**optarg;\f1 .sp -.5v \&\f3.\fP .sp -.5v \&\f3.\fP .sp -.5v \&\f3.\fP \f3while ((c = getopt (argc, argv, "abf:o:")) != \s-1EOF\s+1)\f1 \f3switch (c) {\f1 \f3case \(fma\(fm:\f1 \f3if (b.TH LDAHREAD 3X .SH NAME ldahread \- read the archive header of a member of an archive file .SH SYNOPSIS .nf .ta \w'\s-1LDFILE\s+1\ \ \ 'u .B #include .B #include .ie '\*p'' \{\ .B #include .B #include \} .el \{\ .B #include "INCDIR\/filehdr.h" .B #include "INCDIR\/ldfcn.h" \} .PP .BR "int ldahread (" "ldptr, arhead" ) .BR "\s-1LDFILE\s+1 \(**" ldptr ; .BR "\s-1ARCHDR\s+1 \(**" arhead ; .fi .DT .SH DESCRIPTION If .BI \s-1TYPE\s+1( ldptr ) is the archive file magic number, .I ldahread reads the archive header of the common object file currently associated with .I ldptr into the area of memory beginning at .IR arhead . .PP .I Ldahread .RB "returns " \s-1SUCCESS\s+1 " or " \s-1FAILURE\s+1 . .I Ldahread fails if .BI \s-1TYPE\s+1( ldptr ) does not represent an archive file or if it cannot read the archive header. .PP The program must be loaded with the object file access routine library .ie '\*p'' \{\ .BR libld.a . \} .el \{\ .BR \s-1LIBDIR\s+1\/libld.a . \} .PP .ie !'\*p .TH EXP 3M .SH NAME exp, log, log10, pow, sqrt \- exponential, logarithm, power, square root functions .SH SYNOPSIS .nf .B #include .PP .BR "double exp (" x ) .BR double " x" ; .PP .BR "double log (" x ) .BR double " x" ; .PP .BR "double log10 (" x ) .BR double " x ; .PP .BR "double pow (" "x, y" ) .BR double " x, y" ; .PP .BR "double sqrt (" x ) .BR double " x" ; .SH DESCRIPTION .I Exp\^ returns .IR e\u\s8x\s10\d . .PP .I Log\^ returns the natural logarithm of .IR x . The value of .I x\^ must be positive. .PP .I Log10\^ returns the logarithm base ten of .IR x . The value of .I x\^ must be positive. .PP .I Pow\^ returns .IR x\u\s8y\s10\d . The values of .I x\^ and .I y\^ may not both be zero. If .I x\^ is non-positive, .I y\^ must be an integer. .PP .I Sqrt\^ returns the square root of .IR x . The value of .I x\^ may not be negative. .SH DIAGNOSTICS .I Exp\^ returns .SM .B HUGE when the correct value would overflow, and sets .I errno\^ to .SM .BR ERANGE\*S . .PP .I Log\^ and .I log10 return 0 and setflg)\f1 \f3errflg++;\f1 \f3else\f1 \f3aflg++;\f1 \f3break;\f1 \f3case \(fmb\(fm:\f1 \f3if (aflg)\f1 \f3errflg++;\f1 \f3else\f1 \f3bproc( );\f1 \f3break;\f1 \f3case \(fmf\(fm:\f1 \f3ifile = optarg;\f1 \f3break;\f1 \f3case \(fmo\(fm:\f1 \f3ofile = optarg;\f1 \f3bufsiza = 512;\f1 \f3break;\f1 \f3case \(fm?\(fm:\f1 \f3errflg++;\f1 \f3}\f1 \f3if (errflg) {\f1 \f3fprintf (stderr, "usage: . . . ");\f1 \f3exit (2);\f1 \f3}\f1 \f3for ( ; optind < argc; optind++) {\f1 \f3if (access (argv[optind], 4)) {\f1 .sp -.5v \&\f3.\fP .sp -.5v \&\f3.\fP .sp -.5v \&\f3.\fP \f3}\f1 .ss 12 .fi .RE .SH SEE ALSO getopt(1). .\" @(#)getopt.3c 1.5 '' \{\ .IR Intro (4) describes .BR \s-1LIBDIR\s+1 and \s-1INCDIR\s+1 . \} .SH SEE ALSO .ie !'\*p'' ldclose (3X), ldopen(3X), intro(4), ldfcn(4), path.h(4). .el ldclose(3X), ldopen(3X), ldfcn(4). .\" @(#)ldahread.3x 1.5  .I errno\^ to .SM .B EDOM when .I x\^ is non-positive. An error message is printed on the standard error output. .PP .I Pow\^ returns 0 and sets .I errno\^ to .SM .B EDOM when .I x\^ is non-positive and .I y\^ is not an integer, or when .I x\^ and .I y\^ are both zero. In these cases a message indicating \s-1DOMAIN\s+1 error is printed on the standard error output. When the correct value for .I pow\^ would overflow, .I pow\^ returns .SM .B HUGE and sets .I errno\^ to .SM .B ERANGE. .PP .I Sqrt\^ returns 0 and sets .I errno\^ to .SM .B EDOM when .I x\^ is negative. A message indicating \s-1DOMAIN\s+1 error is printed on the standard error output. .PP These error-handling procedures may be changed with the function .IR matherr (3M). .SH SEE ALSO hypot(3M), matherr(3M), sinh(3M). .\" @(#)exp.3m 1.3  .TH GETPASS 3C .SH NAME getpass \- read a password .SH SYNOPSIS .BR "char \(**getpass (" prompt ) .br .BR "char \(**" prompt ; .SH DESCRIPTION .I Getpass\^ reads up to a newline or .SM .B EOF\^ from the file .BR /dev/tty , after prompting on the standard error output with the null-terminated string .I prompt\^ and disabling echo. A pointer is returned to a null-terminated string of at most 8 characters. If .B /dev/tty cannot be opened, a .SM .B NULL pointer is returned. An interrupt terminates input and sends an interrupt signal to the calling program before returning. .SH FILES /dev/tty .SH "SEE ALSO" crypt(3C). .SH WARNING The above routine uses \f3\f1. This causes the size of programs not otherwise using standard I/O to increase more than might be expected. .SH BUGS The return value points to static data whose content is overwritten by each call. .\" @(#)getpass.3c 1.5 .\" @(#)ldaopen.3x 1.2 .so /usr/man/u_man/man3/ldopen.3x .\" @(#)fabs.3m 1.2 .so /usr/man/u_man/man3/floor.3m .TH GETPW 3C .SH NAME getpw \- get name from \s-1UID\s0 .SH SYNOPSIS .BR "int getpw (" "uid, buf" ) .br .BR int " uid" ; .br .BR "char \(**" buf ; .SH DESCRIPTION .I Getpw\^ searches the password file for a user id number that equals .IR uid , copies the line of the password file in which .I uid\^ was found into the array pointed to by .IR buf , and returns 0. .I Getpw\^ returns non-zero if .IR uid "" cannot be found. .PP This routine is included only for compatibility with prior systems and should not be used; see .IR getpwent (3C) for routines to use instead. .SH FILES /etc/passwd .SH "SEE ALSO" getpwent(3C), passwd(4). .SH DIAGNOSTICS .I Getpw\^ returns non-zero on error. .SH WARNING The above routine uses \f3\f1. Therefore, the size of programs not otherwise using standard I/O is increased more than might be expected. .\" @(#)getpw.3c 1.5  .TH LDCLOSE 3X .SH NAME ldclose, ldaclose \- close a common object file .SH SYNOPSIS .ft B .nf .ta \w'\s-1LDFILE\s+1\ \ \ 'u .B #include .ie '\*p'' \{\ .B #include .B #include \} .el \{\ .ft B #include "INCDIR\/filehdr.h" #include "INCDIR\/ldfcn.h" \} .PP .BR "int ldclose (" ldptr ) .BR "\s-1LDFILE\s+1 \(**" ldptr ; .PP .BR "int ldaclose (" ldptr ) .BR "\s-1LDFILE\s+1 \(**" ldptr ; .fi .ft R .DT .SH DESCRIPTION .IR Ldopen (3X) and .I ldclose are designed to provide uniform access to both simple object files and object files that are members of archive files. Thus an archive of common object files can be processed as if it were a series of simple common object files. .PP If .BI \s-1TYPE\s+1( ldptr ) does not represent an archive file, .I ldclose closes the file and frees the memory allocated to the .BR \s-1LDFILE\s+1 " structure" associated with .IR ldptr . If .BI \s-1TYPE\s+1( ldptr ) is the magic number of an archive file, and if there are any more files in the archive, .I ld.TH FCLOSE 3S .SH NAME fclose, fflush \- close or flush a stream .SH SYNOPSIS .B #include .PP .BR "int fclose (" stream ) .br .BR "\s-1FILE\s+1 \(**" stream ; .PP .BR "int fflush (" stream ) .br .BR "\s-1FILE\s+1 \(**" stream ; .SH DESCRIPTION .I Fclose\^ causes any buffered data for the named .I stream\^ to be written out and the .I stream\^ to be closed. .PP .I Fclose\^ is performed automatically for all open files upon calling .IR exit (2). .PP .I Fflush\^ causes any buffered data for the named .I stream\^ to be written to that file. The .I stream\^ remains open. .SH DIAGNOSTICS These functions return 0 for success, and .SM .B EOF if any error (such as trying to write to a file that has not been opened for writing) was detected. .SH "SEE ALSO" close(2), exit(2), fopen(3S), setbuf(3S). .\" @(#)fclose.3s 1.5 .TH GETPWENT 3C .SH NAME getpwent, getpwuid, getpwnam, setpwent, endpwent \- get password file entry .SH SYNOPSIS .B #include .PP .B struct passwd \(**getpwent ( ) .PP .BR "struct passwd \(**getpwuid (" uid ) .br .BR int " uid" ; .PP .BR "struct passwd \(**getpwnam (" name ) .br .BR "char \(**" name ; .PP .B void setpwent ( ) .PP .B void endpwent ( ) .SH DESCRIPTION .IR Getpwent , .IR getpwuid , and .I getpwnam\^ each return a pointer to an object with the following structure containing the broken-out fields of a line in the .B /etc/passwd file. Each line in the file contains a \fIpasswd\fP structure, declared in the .B header file: .RS .PP .nf \f3struct passwd {\f1 \f3char \(**pw_name;\f1 \f3char \(**pw_passwd;\f1 \f3int pw_uid;\f1 \f3int pw_gid;\f1 \f3char \(**pw_age;\f1 \f3char \(**pw_comment;\f1 \f3char \(**pw_gecos;\f1 \f3char \(**pw_dir;\f1 \f3char \(**pw_shell;\f1 \f3};\f1 \f3struct comment {\f1 \f3char \(**c_dept;\f1 \f3char \(**c_name;\f1 \f3char \(**c_acct;\f1 \f3char close reinitializes .BI \s-1OFFSET\s+1( ldptr ) to the file address of the next archive member and returns .BR \s-1FAILURE\s+1 . The .SM .B LDFILE structure is prepared for a subsequent .IR ldopen (3X). In all other cases, .I ldclose returns .BR \s-1SUCCESS\s+1 . .PP .I Ldaclose closes the file and frees the memory allocated to the .BR \s-1LDFILE\s+1 " structure" associated with .I ldptr regardless of the value of .BI \s-1TYPE\s+1 (ldptr). .I Ldaclose .RB "always returns " \s-1SUCCESS\s+1 . The function is often used in conjunction with .IR ldaopen . .PP The program must be loaded with the object file access routine library .ie '\*p'' \{\ .BR libld.a . \} .el \{\ LIBDIR\/libld.a . \} .PP .if !'\*p'' \{\ .IR Intro (4) describes .IR INCDIR " and " LIBDIR . \} .SH SEE ALSO .if !'\*p'' \{\ fclose(3S), ldopen(3X), intro(4), ldfcn(4), paths.h(4). \} .if '\*p'' \{\ fclose(3S), ldopen(3X), ldfcn(4). \} '\" \%W\% .\" @(#)ldclose.3x 1.4  .\" @(#)fcvt.3c 1.2 .so /usr/man/u_man/man3/ecvt.3c \(**c_bin;\f1 \f3};\f1 .fi .RE .PP Because this structure is declared in .BR , it is not necessary to redeclare it. .PP The .I pw_comment\^ field is unused; the others have meanings described in .IR passwd (4). .PP When first called, .I getpwent\^ returns a pointer to the first \fIpasswd\fP structure in the file; thereafter, it returns a pointer to the next \fIpasswd\fP structure in the file; therefore, successive calls can be used to search the entire file. .I Getpwuid\^ searches from the beginning of the file until a numerical user id matching .I uid\^ is found; it returns a pointer to the particular structure in which the match was found. .I Getpwnam\^ searches from the beginning of the file until a login name matching .I name\^ is found; it returns a pointer to the particular structure in which the match was found. If an end-of-file or an error is encountered on reading, these functions return a .SM NULL pointer. .PP A call to .I setpwent\^ has the effect of rewinding the password file to allow re.\" @(#)ldexp.3c 1.2 .so /usr/man/u_man/man3/frexp.3c .\" @(#)fdopen.3s 1.2 .so /usr/man/u_man/man3/fopen.3s  peated searches. .I Endpwent\^ may be called to close the password file when processing is complete. .SH FILES /etc/passwd .SH "SEE ALSO" getlogin(3C), getgrent(3C), passwd(4). .SH DIAGNOSTICS A .SM .B NULL pointer is returned on .SM .B EOF or error. .SH WARNING The above routines use \f3\f1. Therefore the size of programs not otherwise using standard I/O is increased more than might be expected. .SH BUGS All information is contained in a static area, so it must be copied if it is to be saved. .br .\" @(#)getpwent.3c 1.6 .TH LDFHREAD 3X .SH NAME ldfhread \- read the file header of a common object file .SH SYNOPSIS .nf .ta \w'LDFILE\ \ \ 'u .B #include .ie '\*p'' \{\ .B #include .B #include \} .el \{\ .B #include "\s-1INCDIR\s+1\/filehdr.h" .B #include "\s-1INCDIR\s+1\/ldfcn.h" \} .PP .BR "int ldfhread (" "ldptr, filehead" ) .BR "\s-1LDFILE\s+1 \(**" ldptr ; .BR "\s-1FILHDR\s+1 \(**" filehead ; .fi .DT .SH DESCRIPTION .I Ldfhread reads the file header of the common object file currently associated with .I ldptr into the area of memory beginning at .IR filehead . .PP .I Ldfhread .RB "returns " \s-1SUCCESS\s+1 " or " \s-1FAILURE\s+1 . .I Ldfhread fails if it cannot read the file header. .PP In most cases the use of .I ldfhread can be avoided by using the macro .BI \s-1HEADER\s+1\*S( ldptr ) defined in .B .RI (see " ldfcn" (4)). The information in any field, .IR fieldname , of the file header may be accessed using .SM .BI HEADER\*S( ldptr ). fieldname\c \&. .PP The program must be loade.\" @(#)feof.3s 1.2 .so /usr/man/u_man/man3/ferror.3s .\" @(#)getpwnam.3c 1.2 .so /usr/man/u_man/man3/getpwent.3c  d with the object file access routine library .ie '\*p'' \{\ .BR libld.a . \} .el \{\ .BR \s-1LIBDIR\s+1\/libld.a . \} .PP .if !'\*p'' \{\ .IR Intro (4) describes .IR \s-1INCDIR\s+1 and \s-1LIBDIR\s+1 . \} .SH SEE ALSO .ie '\*p'' \{\ ldclose(3X), ldopen(3X), ldfcn(4). \} .el \{\ ldclose(3X), ldopen(3X), intro(4), ldfcn(4), path.h(4). \} .\" @(#)ldfhread.3x 1.5 .TH FERROR 3S .SH NAME ferror, feof, clearerr, fileno \- stream status inquiries .SH SYNOPSIS .nf .B #include .PP .BR "int feof (" stream ) .BR "\s-1FILE\s+1 \(**" stream ; .PP .BR "int ferror (" stream ) .BR "\s-1FILE\s+1 \(**" stream ; .PP .BR "void clearerr (" stream ) .BR "\s-1FILE\s+1 \(**" stream ; .PP .BR "int fileno (" stream ) .BR "\s-1FILE\s+1 \(**" stream ; .SH DESCRIPTION .I Feof\^ returns non-zero when .SM .B EOF has previously been detected reading the named input .IR stream ; otherwise, it returns zero. .PP .I Ferror\^ returns non-zero when an I/O error has previously occurred reading from or writing to the named .IR stream ; otherwise, it returns zero. .PP .I Clearerr\^ resets the error indicator and .SM .B EOF indicator to zero on the named .IR stream . .PP .I Fileno\^ returns the integer file descriptor associated with the named .IR stream ; see .IR open (2). .SH NOTE All these functions are implemented as macros; they cannot be declared or redeclared. .SH SEE ALSO open(2), fopen(3.\" @(#)getpwuid.3c 1.2 .so /usr/man/u_man/man3/getpwent.3c .TH LDGETNAME 3X .SH NAME ldgetname \- retrieve symbol name for object file symbol table entry .SH SYNOPSIS .nf .B "#include " .B "#include " .B "#include " .B "#include " .fi .sp .nf .BR "char \**ldgetname (" "ldptr, symbol" ) .BR "LDFILE \**" ldptr ; .BR "SYMENT \**" symbol ; .fi .SH DESCRIPTION .I Ldgetname returns a pointer to the name associated with \fIsymbol\fP as a string. The string is contained in a static buffer local to \fIldgetname\fP. Because the buffer is overwritten by each call to \fIldgetname\fP, it must be copied by the caller if the name is to be saved. .PP The common object file format has been extended to handle arbitrary length symbol names with the addition of a ``string table''. \fILdgetname\fP returns the symbol name associated with a symbol table entry for either an object file or a pre-object file. Thus, \fIldgetname\fP can be used to retrieve names from object files without any backward compatibility problems. \fILdgetname\fP returns \fBNU S). .\" @(#)ferror.3s 1.4 .TH GETS 3S .SH NAME gets, fgets \- get a string from a stream .SH SYNOPSIS .B #include .PP .BR "char \(**gets (" s ) .br .BR "char \(**" s ; .PP .BR "char \(**fgets (" "s, n, stream" ) .br .BR "char \(**" s ; .br .BR int " n" ; .br .BR "\s-1FILE\s+1 \(**" stream ; .SH DESCRIPTION .I Gets\^ reads characters from the standard input stream, .IR stdin, into the array pointed to by .IR s , until a new-line character is read or an end-of-file condition is encountered. The new-line character is discarded and the string is terminated with a null character. .PP .I Fgets\^ reads characters from the .I stream\^ into the array pointed to by .I s\^ until .IR n \-1 characters are read, or a new-line character is read and transferred to .IR s , or an end-of-file condition is encountered. The string is then terminated with a null character. .SH SEE ALSO ferror(3S), fopen(3S), fread(3S), getc(3S), scanf(3S). .SH DIAGNOSTICS If end-of-file is encountered and no characters have been read, no characters are transferLL\fP (defined in \fB\fP) for an object file if the name cannot be retrieved. This occurs when: .sp .TP 8 \(bu The string table cannot be found. .TP 8 \(bu Not enough memory can be allocated for the string table. .TP 8 \(bu The string table appears not to be a string table (e.g., if an auxiliary entry is handed to \fIldgetname\fP that looks like a reference to a name in a non-existent string table). .TP 8 \(bu The name's offset into the string table is beyond the end of the string table. .sp .br .PP Typically, \fIldgetname\fP is called immediately after a successful call to \fIldtbread\fP to retrieve the name associated with the symbol table entry filled by \fIldtbread\fP. .PP The program must be loaded with the object file access routine library \fBlibld.a\fP. .SH "SEE ALSO" ldclose(3X), ldopen(3X), ldtbseek(3X), ldtbread(3X), ldfcn(4). .\" @(#)ldgetname.3x 1.9 .\" @(#)fflush.3s 1.2 .so /usr/man/u_man/man3/fclose.3s  red to .I s\^ and a .SM NULL pointer is returned. If a read error (e.g., trying to use these functions on a file that has not been opened for reading) occurs, a .SM NULL pointer is returned. Otherwise .I s\^ is returned. .\" @(#)gets.3s 1.4 .\" @(#)ldlinit.3x 1.2 .so /usr/man/u_man/man3/ldlread.3x .\" @(#)fgetc.3s 1.2 .so /usr/man/u_man/man3/getc.3s '\" t .TH GETUT 3C .SH NAME getutent, getutid, getutline, pututline, setutent, endutent, utmpname \- access utmp file entry .SH SYNOPSIS .nf .B #include .PP .B struct utmp \(**getutent ( ) .PP .BR "struct utmp \(**getutid (" id ) .BR "struct utmp \(**" id ; .PP .BR "struct utmp \(**getutline (" line ) .BR "struct utmp \(**" line ; .PP .BR "void pututline (" utmp ) .BR "struct utmp \(**" utmp ; .PP .B void setutent ( ) .PP .B void endutent ( ) .PP .BR "void utmpname (" file" ) .BR "char \(**" file ; .SH DESCRIPTION .IR Getutent , .IR getutid , and .I getutline\^ each return a pointer to a structure of the following type: .PP .TS l1 l1 l1 l. .tr ~ \f3struct utmp {\f1 \f3char ut_user[8];\f1 /\(** User login name \(**/ \f3char ut_id[4];\f1 /\(** /etc/inittab id (usually line #) \(**/ \f3char ut_line[12];\f1 /\(** device name (console, lnxx) \(**/ \f3short ut_pid;\f1 /\(** process id \(**/ \f3short ut_type;\f1 /\(** type of entry \(**/ \f3struct exit_status {\f1 \f3~~~~short ~~~~e_termination;\f1  .\" @(#)ldlitem.3x 1.2 .so /usr/man/u_man/man3/ldlread.3x .\" @(#)fgets.3s 1.2 .so /usr/man/u_man/man3/gets.3s /\(** Process termination status \(**/ \f3~~~~short ~~~~e_exit;\f1 /\(** Process exit status \(**/ \f3} ut_exit;\f1 /\(** The exit status of a process /\(** marked as \s-1DEAD_PROCESS\s+1. \(**/ \f3time_t ut_time;\f1 /\(** time entry was made \(**/ \f3};\f1 .tr ~~ .TE .PP .I Getutent\^ reads in the next entry from a .IR utmp -like file. If the file is not already open, it opens it. If it reaches the end of the file, it fails. .PP .I Getutid\^ searches forward from the current point in the .I utmp\^ file until it finds an entry with a .I ut_type\^ matching .I id\->ut_type\^ if the type specified is .SM \f3RUN_LVL\*S\f1, .SM \f3BOOT_TIME\*S\f1, .SM \f3OLD_TIME\*S\f1, or .SM \f3NEW_TIME\*S\f1. If the type specified in .I id\^ is .SM \f3INIT_PROCESS\*S\f1, .SM \f3LOGIN_PROCESS\*S\f1, .SM \f3USER_PROCESS\*S\f1, or .SM \f3DEAD_PROCESS\*S\f1, .I getutid\^ will return a pointer to the first entry whose type is one of these four and whose .I ut_id\^ field matches .IR id\->ut_id . .I Getutid\^ fails if the end.TH LDLREAD 3X .SH NAME ldlread, ldlinit, ldlitem \- manipulate line number entries of a common object file function .SH SYNOPSIS .nf .B #include .ie '\*p'' \{\ .B #include .B #include .B #include \} .el \{\ .B #include "\s-1INCDIR\s+1\/filehdr.h" .B #include "\s-1INCDIR\s+1\/linenum.h" .B #include "\s-1INCDIR\s+1\/ldfcn.h" \} .ft R .PP .BR "int ldlread (" "ldptr, fcnindx, linenum, linent" ) .BR "\s-1LDFILE\s+1 \(**" ldptr ; .BR long " fcnindx" ; .BR "unsigned short" " linenum" ; .BR "\s-1LINENO\s+1" " linent" ; .PP .BR "int ldlinit (" "ldptr, fcnindx" ) .BR "\s-1LDFILE\s+1 \(**" ldptr ; .BR long " fcnindx" ; .PP .BR "int ldlitem (" "ldptr, linenum, linent" ) .BR "\s-1LDFILE\s+1 \(**" ldptr ; .BR "unsigned short" " linenum" ; .BR "\s-1LINENO\s+1" " linent" ; .fi .DT .SH DESCRIPTION .I Ldlread searches the line number entries of the common object file currently associated with .IR ldptr . .I Ldlread begins its search with the line number entry for the beginning of a .\" @(#)fileno.3s 1.2 .so /usr/man/u_man/man3/ferror.3s  of file is reached without a match. .PP .I Getutline\^ searches forward from the current point in the .I utmp\^ file until it finds an entry of the type .SM \f3LOGIN_PROCESS\f1 or .SM \f3USER_PROCESS\f1 which also has a .I ut_line\^ string matching the .I line\->ut_line\^ string. If the end of file is reached without a match, it fails. .PP .I Pututline\^ writes out the supplied .I utmp\^ structure into the .I utmp\^ file. It uses .I getutid\^ to search forward for the proper place if it finds that it is not already at the proper place. It is assumed that the user of .I pututline\^ has searched for the proper entry using one of the .I getut\^ routines. If this has been done, .I pututline\^ will not search. If .I pututline\^ does not find a matching slot for the new entry, it will add a new entry to the end of the file. .PP .I Setutent\^ resets the input stream to the beginning of the file. This should be done before each search for a new entry if it is desired that the entire file be examined. .PP .I E function and confines its search to the line numbers associated with a single function. The function is identified by .IR fcnindx , the index of its entry in the object file symbol table. .IR Ldlread reads the entry with the smallest line number equal to or greater than .I linenum into .IR linent . .PP .IR Ldlinit and .IR ldlitem together perform exactly the same function as .I ldlread. After an initial call to .I ldlread or .I ldlinit, .I ldlitem may be used to retrieve a series of line number entries associated with a single function. .I Ldlinit simply locates the line number entries for the function identified by .I fcnindx. .I Ldlitem finds and reads the entry with the smallest line number equal to or greater than .I linenum into .IR linent . .PP .IR Ldlread , .IR ldlinit , and .I ldlitem each return either .B \s-1SUCCESS\s+1 or .BR \s-1FAILURE\s+1 . .I Ldlread fails if there are no line number entries in the object file, if .I fcnindx does not index a function entry in the symbol table, or if it finds.\" @(#)float.3f 1.2 .so /usr/man/u_man/man3/ftype.3f  ndutent\^ closes the currently open file. .PP .I Utmpname\^ allows the user to change the name of the file examined from .B /etc/utmp to any other filename. It is expected that most often this other file will be .BR /etc/wtmp . If the file doesn't exist, this will not be apparent until the first attempt to reference the file is made. .I Utmpname\^ does not open the file. It just closes the old file, if it is currently open, and saves the new filename. .SH FILES /etc/utmp .br /etc/wtmp .SH SEE ALSO ttyslot(3C), utmp(4). .SH DIAGNOSTICS A .SM .B NULL pointer is returned upon failure to read or write. Failure to read may be due to permissions or because end-of-file has been reached. .SH COMMENTS The most current entry is saved in a static structure. Multiple accesses require that it be copied before further accesses are made. Each call to either .I getutid\^ or .I getutline\^ sees the routine examine the static structure before performing more \s-1I/O\s+1. If the search of the static structure results in a  no line number equal to or greater than .IR linenum . .L .I Ldlinit fails if there are no line number entries in the object file or if .I fcnindx does not index a function entry in the symbol table. .I Ldlitem fails if it finds no line number equal to or greater than .IR linenum . .PP The programs must be loaded with the object file access routine library .ie '\*p'' \{\ .BR libld.a . \} .el \{\ .BR \s-1LIBDIR\s+1\/libld.a . \} .SH SEE ALSO .ie '\*p'' \{\ ldclose(3X), ldopen(3X), ldtbindex(3X), ldfcn(4). \} .el \{\ ldclose(3X), ldopen(3X), ldtbindex(3X), intro(4), ldfcn(4), paths.h(4). \} .\" @(#)ldlread.3x 1.5 .TH FLOOR 3M .SH NAME floor, ceil, fmod, fabs \- floor, ceiling, remainder, absolute value functions .SH SYNOPSIS .B #include .PP .BR "double floor (" "x" ")" .br .BR "double" " x" ";" .PP .BR "double ceil (" "x" ")" .br .BR "double" " x" ";" .PP .BR "double fmod (" "x, y" ")" .br .BR "double" " x, y" ";" .PP .BR "double fabs (" "x" ")" .br .BR "double" " x" ";" .SH DESCRIPTION .I Floor\^ returns the largest integer (as a double-precision number) not greater than .IR x . .PP .I Ceil\^ returns the smallest integer not less than .IR x . .PP .I Fmod\^ returns .I x\^ if .I y\^ is zero; otherwise, it returns the number .I f\^ with the same sign as .IR x , such that .I "x = iy + f" for some integer .IR i , and .RI | \|f\| "| < |" \|y\| |\|. .PP .I Fabs\^ returns .RI | \|x\| |\|. .SH SEE ALSO abs(3C). .\" @(#)floor.3m 1.5 match, no further search is performed. To use .I getutline\^ to search for multiple occurences, zero out the static structure after each success; otherwise .I getutline\^ will just return the same pointer over and over again. There is one exception to the rule about removing the structure before further reads are done. If the implicit read done by .I pututline\^ finds that it isn't already at the correct place in the file, the contents of the static structure returned by the .IR getutent , .IR getutid , or .I getutline\^ routines are not harmed, if the user has just modified those contents and passed the pointer back to .IR pututline . .PP These routines use buffered standard \s-1I/O\s+1 for input, but .I pututline\^ uses an unbuffered non-standard write to avoid race conditions between processes trying to modify the .I utmp\^ and .I wtmp\^ files. .\" @(#)getut.3c 1.7  .TH LDLSEEK 3X .SH NAME ldlseek, ldnlseek \- seek to line number entries of a section of a common object file .SH SYNOPSIS .nf .B #include .ie '\*p'' \{\ .B #include .B #include \} .el \{\ .B #include "\s-1INCDIR\s+1\/filehdr.h" .B #include "\s-1INCDIR\s+1\/ldfcn.h"\} .PP .BR "int ldlseek (" "ldptr, sectindx" ) .BR "\s-1LDFILE\s+1 \(**" ldptr ; .BR "unsigned short" " sectindx" ; .PP .BR "int ldnlseek (" "ldptr, sectname" ) .BR "\s-1LDFILE\s+1 \(**" ldptr ; .BR "char \(**" sectname ; .fi .SH DESCRIPTION .I Ldlseek seeks to the line number entries of the section specified by .I sectindx of the common object file currently associated with .IR ldptr . .PP .I Ldnlseek seeks to the line number entries of the section specified by .IR sectname . .PP .I Ldlseek and .I ldnlseek return .SM .B SUCCESS or .SM .BR FAILURE . .I Ldlseek fails if .I sectindx is greater than the number of sections in the object file; .I ldnlseek fails if there is no section name corresponding to .RI \(** sectna.\" @(#)fmod.3m 1.2 .so /usr/man/u_man/man3/floor.3m .\" @(#)getutent.3c 1.2 .so /usr/man/u_man/man3/getut.3c me . Either function fails if the specified section has no line number entries or if it cannot seek to the specified line number entries. .PP Note that the first section has an index of .IR one . .PP The program must be loaded with the object file access routine library .ie '\*p'' \{\ .BR libld.a . \} .el \{\ .BR \s-1LIBDIR\s+1\/libld.a . \} .if !'\*p'' \{\ .PP .IR Intro (4) describes .IR \s-1INCDIR\s+1 " and " \s-1LIBDIR\s+1 . \} .SH SEE ALSO .ie '\*p'' \{\ ldclose(3X), ldopen(3X), ldshread(3X), ldfcn(4). \} .el \{\ ldclose(3X), ldopen(3X), ldshread(3X), intro(4), ldfcn(4), path.h(4). \} .\" @(#)ldlseek.3x 1.5  .TH FOPEN 3S .SH NAME fopen, freopen, fdopen \- open a stream .SH SYNOPSIS .B #include .PP .BR "\s-1FILE\s+1 \(**fopen (" "filename, type " ")" .br .BR "char \(**" "filename," " \(**" "type" ";" .PP .BR "\s-1FILE\s+1 \(**freopen (" "filename, type, stream" ")" .br .BR "char \(**" "filename," " \(**" "type" ";" .br .BR "\s-1FILE\s+1 \(**" "stream" ";" .PP .BR "\s-1FILE\s+1 \(**fdopen (" "fildes, type" ")" .br .BR "int" " fildes" ";" .br .BR "char \(**" "type" ";" .SH DESCRIPTION .I Fopen\^ opens the file named by .I filename\^ and associates a .I stream\^ with it. .I Fopen\^ returns a pointer to the .SM FILE structure associated with the .IR stream . .I Filename\^ points to a character string that contains the name of the file to be opened. .PP .I Type\^ is a character string having one of the following values: .RS .TP 10 .B r open for reading .ns .TP 10 .B w truncate or create for writing .ns .TP 10 .B a append; open for writing at end of file, or create for writing .ns .TP 10 .B r+ open for update.\" @(#)getutid.3c 1.2 .so /usr/man/u_man/man3/getut.3c .\" @(#)ldnlseek.3x 1.2 .so /usr/man/u_man/man3/ldlseek.3x  (reading and writing) .ns .TP 10 .B w+ truncate or create for update .ns .TP 10 .B a+ append; open or create for update at end-of-file .RE .PP .I Freopen\^ substitutes the named file in place of the open .IR stream . The original .I stream\^ is closed, regardless of whether the open ultimately succeeds. .I Freopen\^ returns a pointer to the .SM FILE structure associated with .IR stream . .I Freopen\^ is typically used to attach the preopened .I streams\^ associated with .BR stdin , .BR stdout , and .BR stderr to other files. .PP .I Fdopen\^ associates a .I stream\^ with a file descriptor by formatting a file structure from the file descriptor. Thus, \fIfdopen\fP can be used to access the file descriptors returned by .IR open (2), .IR dup (2), .IR creat (2), or .IR pipe (2). (These calls open files but do not return pointers to a .SM FILE structure.) The .I type\^ of .I stream\^ must agree with the mode of the open file. .PP When a file is opened for update, both input and output may be done on the resulti .\" @(#)getutline.3c 1.2 .so /usr/man/u_man/man3/getut.3c .\" @(#)ldnrseek.3x 1.2 .so /usr/man/u_man/man3/ldrseek.3x ng .IR stream . However, output may not be directly followed by input without an intervening .I fseek\^ or .IR rewind , and input may not be directly followed by output without an intervening .IR fseek , .IR rewind , or an input operation which encounters end-of-file. .PP When a file is opened for append (i.e., when .I type\^ is "a" or "a+"), it is impossible to overwrite information already in the file. .I Fseek\^ may be used to reposition the file pointer to any position in the file, but when output is written to the file the current file pointer is disregarded. All output is written at the end of the file and causes the file pointer to be repositioned at the end of the output. If two separate processes open the same file for append, each process may write freely to the file without destroying output being written by the other. The output from the two processes is intermixed in the file in the order in which it is written. .SH "SEE ALSO" open(2), fclose(3S). .SH DIAGNOSTICS .I Fopen\^ and .I freopen\^ re.\" @(#)getw.3s 1.2 .so /usr/man/u_man/man3/getc.3s  .\" @(#)ldnshread.3x 1.2 .so /usr/man/u_man/man3/ldshread.3x turn a .SM NULL pointer on failure. .\" @(#)fopen.3s 1.8 .\" @(#)gmtime.3c 1.2 .so /usr/man/u_man/man3/ctime.3c .\" @(#)ldnsseek.3x 1.2 .so /usr/man/u_man/man3/ldsseek.3x  .\" @(#)fprintf.3s 1.2 .so /usr/man/u_man/man3/printf.3s .\" @(#)gsignal.3c 1.2 .so /usr/man/u_man/man3/ssignal.3c ldohseek.3xldopen.3xldrseek.3xldshread.3xldsseek.3xldtbindex.3xldtbread.3xldtbseek.3xlen.3flocaltime.3clog.3flog.3mlog10.3flog10.3mlogname.3xlongjmp.3clrand48.3clsearch.3clshift.3fltol3.3cmalloc.3cmatherr.3mmax.3fmax0.3fmax1.3fmclock.3fmemccpy.3cmemchr.3cmemcmp.3cmemcpy.3cmemory.3cmemset.3cmin.3fmin0.3fmin1.3fmktemp.3cmod.3fmodf.3cmonitor.3cmrand48.3cnint.3fnlist.3cnot.3fnrand48.3cor.3fpclose.3sperror.3cplot.3xpopen.3spow.3mprintf.3sputc.3sputchar.3sputpwent.3cputs.3spututline.3cputw.3sqsort.3crand.3crand.3freal.3frealloc.3cregcmp.3xregex.3x.\" @(#)fputc.3s 1.2 .so /usr/man/u_man/man3/putc.3s  .\" @(#)hcreate.3c 1.2 .so /usr/man/u_man/man3/hsearch.3c .TH LDOHSEEK 3X .SH NAME ldohseek \- seek to the optional file header of a common object file .SH SYNOPSIS .ft B .nf .ta \w'\s-1LDFILE\s+1\ \ \ 'u .B #include .ie '\*p'' \{\ .B #include .B #include \} .el \{\ .ft B #include "\s-1INCDIR\s+1\/filehdr.h" #include "\s-1INCDIR\s+1\/ldfcn.h" \} .ft R .PP .BR "int ldohseek (" ldptr ) .BR "\s-1LDFILE\s+1 \(**" ldptr ; .fi .DT .SH DESCRIPTION .I Ldohseek\^ seeks to the optional file header of the common object file currently associated with .IR ldptr . .PP .I Ldohseek\^ .RB "returns " \s-1SUCCESS\s+1 " or " \s-1FAILURE\s+1 . .I Ldohseek\^ fails if the object file has no optional header or if it cannot seek to the optional header. .PP The program must be loaded with the object file access routine library .ie '\*p'' \{\ .BR libld.a . \} .el \{\ .BR \s-1LIBDIR\s+1\/libld.a . \} .if !'\*p'' \{\ .PP .IR Intro (4) describes .IR \s-1INCDIR\s+1 " and " \s-1LIBDIR\s+1 . \} .SH SEE ALSO .ie '\*p'' \{\ ldclose(3X), ldopen(3X), ldfhread(3X), ldfc.\" @(#)fputs.3s 1.2 .so /usr/man/u_man/man3/puts.3s .\" @(#)hdestroy.3c 1.2 .so /usr/man/u_man/man3/hsearch.3c  n(4). \} .el \{\ ldclose(3X), ldopen(3X), ldfhread(3X), intro(4), ldfcn(4), path.h(4). \} .\" @(#)ldohseek.3x 1.4 .TH FREAD 3S .SH NAME fread, fwrite \- binary input/output .SH SYNOPSIS .B #include .PP .BR "int fread (" "ptr, size, nitems, stream" ")" .br .BR "char \(**" ptr ; .br .BR int " size, nitems" ; .br .BR "\s-1FILE\s+1 \(**" stream ; .PP .BR "int fwrite (" "ptr, size, nitems, stream" ")" .br .BR "char \(**" ptr ; .br .BR int " size, nitems" ; .br .BR "\s-1FILE\s+1 \(**" stream ; .SH DESCRIPTION .I Fread\^ copies .I nitems\^ items of data from the named input .IR stream into an array beginning at .IR ptr . An item of data is a sequence of bytes (not necessarily terminated by a null byte) of length .IR size . .I Fread\^ stops appending bytes if an end-of-file or error condition is encountered while reading .IR stream or if .I nitems\^ items have been read. .I Fread\^ leaves the file pointer in .IR stream , if defined, pointing to the byte following the last byte read if there is one. .I Fread\^ does not change the contents of .IR stream . .PP .I Fwrite\^ appends at most .I nitems\^ items of data from th.TH HSEARCH 3C .SH NAME hsearch, hcreate, hdestroy \- manage hash search tables .SH SYNOPSIS .B #include .PP .BR "\s-1ENTRY\s+1 \(**hsearch (" "item, action" ) .br .BR "\s-1ENTRY\s+1" " item" ; .br .BR "\s-1ACTION\s+1" " action" ; .PP .BR "int hcreate (" nel ) .br .BR unsigned " nel" ; .PP .B void hdestroy ( ) .SH DESCRIPTION .I Hsearch\^ is a hash-table search routine generalized from Knuth (6.4) Algorithm D. It returns a pointer into a hash table indicating the location at which an entry can be found. .I Item\^ is a structure of type .SM ENTRY (defined in the \f3\f1 header file) containing two pointers. .I Item.key\^ points to the comparison key and .I item.data\^ points to any other data to be associated with that key. (Pointers to types other than character should be cast to pointer-to-character.) .I Action\^ is a member of an enumeration type .SM ACTION\*S, indicating the disposition of the entry if it cannot be found in the table. .SM .B ENTER indicates that the item should be ins.TH LDOPEN 3X .SH NAME ldopen, ldaopen \- open a common object file for reading .SH SYNOPSIS .nf .ta \w'\s-1LDFILE\s+1\ \ \ 'u .B #include .ie '\*p'' \{\ .B #include .B #include \} .el \{\ .B #include "\s-1INCDIR\s+1\/filehdr.h" .B #include "\s-1INCDIR\s+1\/ldfcn.h" \} .PP .BR "\s-1LDFILE\s+1 \(**ldopen (" "filename, ldptr" ) .BR "char \(**" filename ; .BR "\s-1LDFILE\s+1 \(**" ldptr ; .PP .BR "\s-1LDFILE\s+1 \(**ldaopen (" "filename, oldptr" ) .BR "char \(**" filename ; .BR "\s-1LDFILE\s+1 \(**" oldptr ; .fi .DT .SH DESCRIPTION .I Ldopen and .ie '\*p'' \{\ .IR ldclose (3X) \} .el \{\ .IR ldclose (3L) \} are designed to provide uniform access to both simple object files and object files that are members of archive files. Thus, an archive of common object files can be processed as if it were a series of simple common object files. .PP If .I ldptr has the value .BR \s-1NUll\s+1\*S , .I ldopen opens .IR filename , allocates and initializes the .B \s-1LDFILE\s+1 structure, and ret e the array pointed to by .I ptr\^ to the named output .IR stream . .I Fwrite\^ stops appending when it has appended .I nitems\^ items of data or if an error condition is encountered on .IR stream . .I Fwrite\^ does not change the contents of the array pointed to by .IR ptr . .PP The variable .I size\^ is typically .I sizeof(\(**ptr)\^ where the pseudo-function .I sizeof\^ specifies the length of an item pointed to by .IR ptr . If .I ptr\^ points to a data type other than .I char\^ it should be cast into a pointer to .IR char . .SH "SEE ALSO" read(2), write(2), fopen(3S), getc(3S), gets(3S), printf(3S), putc(3S), puts(3S), scanf(3S). .SH DIAGNOSTICS .I Fread\^ and .I fwrite\^ return the number of items read or written. If .I nitems\^ is non-positive, no characters are read or written and 0 is returned by both .I fread\^ and .IR fwrite . .\" @(#)fread.3s 1.4 erted in the table at an appropriate point. .SM .B FIND indicates that no entry should be made. Unsuccessful resolution is indicated by the return of a .SM NULL pointer. .P .I Hcreate\^ allocates sufficient space for the table and must be called before .I hsearch\^ is used. .I Nel\^ is an estimate of the maximum number of entries that the table will contain. This number may be adjusted upward by the algorithm in order to obtain certain mathematically favorable circumstances. .P .I Hdestroy\^ destroys the search table and may be followed by another call to .IR hcreate . .SH NOTES .I Hsearch\^ uses .I open addressing\^ with a .I multiplicative\^ hash function. However, many other options are available in the source code. The user may select an option by compiling the .I hsearch\^ source with the following symbols defined to the preprocessor: .RS .TP \w'\s-1CHAINED\s+1\ \ 'u .B \s-1DIV\s+1 Use the .I remainder modulo table size\^ as the hash function instead of the multiplicative algorithm. .TP .B \s-1USCR\s+1urns a pointer to the structure to the calling program. .PP If .I ldptr is valid and .BI \s-1TYPE\s+1( ldptr ) is the archive magic number, .I ldopen reinitializes the .BR \s-1LDFILE\s+1 " structure" for the next archive member of .IR filename . .PP .I Ldopen and .I ldclose are designed to work in concert. .I Ldclose returns .B \s-1FAILURE\s+1 only when .BI \s-1TYPE\s+1( ldptr ) is the archive magic number and there is another file in the archive to be processed. Only then should .I ldopen be called with the current value of .IR ldptr . In all other cases, in particular whenever a new .I filename is opened, .I ldopen should be called with a .SM \fBNULL\fR .I ldptr argument. .PP The following is a prototype for the use of .I ldopen and .IR ldclose . .PP .nf .ne 12 .RS /\(** for each filename to be processed \(**/ .PP \f3ldptr = \s-1NULL\s+1;\f1 \f3do\f1 \f3if ( (ldptr = ldopen(filename, ldptr)) != \s-1NULL\s+1 )\f1 \f3{\f1 /\(** check magic number \(**/ /\(** process the file \(**/ \f3}\f1 \f3} while .\" @(#)free.3c 1.2 .so /usr/man/u_man/man3/malloc.3c   Use a User Supplied Comparison Routine for ascertaining table membership. The routine should be named .I hcompar\^ and should behave in a mannner similar to .I strcmp (see .IR string (3C)). .TP .B \s-1CHAINED\s+1 Use a linked list to resolve collisions. If this option is selected, the following other options become available. .RS .TP \w'\s-1SORTDOWN\s+1\ \ 'u .B \s-1START\s+1 Place new entries at the beginning of the linked list (default is at the end). .TP .B \s-1SORTUP\s+1 Keep the linked list sorted by key in ascending order. .TP .B \s-1SORTDOWN\s+1 Keep the linked list sorted by key in descending order. .RE .RE .P Additionally, there are preprocessor flags for obtaining a debugging printout .RB ( \-\s-1DDEBUG\s+1 ) and for including a test driver in the calling routine .RB ( \-\s-1DDRIVER\s+1 ). The source code should be consulted for further details. .SH "SEE ALSO" bsearch(3C), lsearch(3C), string(3C), tsearch(3C). .SH DIAGNOSTICS .I Hsearch\^ returns a .SM NULL pointer if either the action is .SM .B FI(ldclose(ldptr) == \s-1FAILURE\s+1 );\f1 .fi .RE .PP If the value of .I oldptr is not .BR \s-1NULL\s+1\*S , .I ldaopen opens .I filename anew and allocates and initializes a new .B \s-1LDFILE\s+1 structure, copying the .BR \s-1TYPE\s+1 ", " \s-1OFFSET\s+1 ", and " \s-1HEADER\s+1" fields from .IR oldptr . .I Ldaopen returns a pointer to the new .BR \s-1LDFILE\s+1 " structure." This new pointer is independent of the old pointer, .IR oldptr . The two pointers may be used concurrently to read separate parts of the object file. For example, one pointer may be used to step sequentially through the relocation information, while the other is used to read indexed symbol table entries. .PP Both .I ldopen and .I ldaopen open .I filename for reading. Both functions return .SM \fBNULL\fR if .I filename cannot be opened or if memory for the .B \s-1LDFILE\s+1 structure cannot be allocated. A successful open does not insure that the given file is a common object file or an archived object file. \} .PP The program must be loa)" . .PP .I Arc\^ draws an arc of a circle with center at the point .I "(x, y)" between the points .I "(x0, y0)" and .IR "(x1, y1)" . .PP String arguments to .I label\^ and .I linemod\^ are terminated by nulls and do not contain new-lines. .PP See .IR plot (4) for a description of the effect of the remaining functions. .PP The library files listed below provide several variations of these routines. .SH FILES /usr/lib/libplot\f3.\fPa produces output for .IR tplot (1G) filters .br /usr/lib/lib300\f3.\fPa for \s-1DASI\s+1 300 .br /usr/lib/lib300s\f3.\fPa for \s-1DASI\s+1 300s .br /usr/lib/lib450\f3.\fPa for \s-1DASI\s+1 450 .br /usr/lib/lib4014\f3.\fPa for Tektronix 4014 .SH WARNINGS To compile a program containing these functions in .IR file.c , use .BI cc file.c \-lplot\c \. .PP To execute it, use .BR "a.out | tplot" . .PP The above routines use \f3\f1. Therefore, the size of programs not otherwise using standard I/O is increased more than might be expected. .SH SEE ALSO graph(1G), stat(1G), tplot(1Gn an .I exec\^ is executed, but remains on in child and parent both after a .IR fork . Profiling is turned off if an update in .I buff\^ would cause a memory fault. .SH RETURN VALUE Not defined. .SH "SEE ALSO" prof(1), monitor(3C). .\" @(#)profil.2 1.5  ded with the object file access routine library .ie '\*p'' \{\ .BR libld.a . \} .el \{\ .BR \s-1LIBDIR\s+1\/libld.a \} .if !'\*p'' \{\ .PP .IR Intro (4) describes .BR \s-1INCDIR\s+1 and \s-1LIBDIR\s+1 . \} .SH SEE ALSO .ie '\*p'' \{\ fopen(3S), ldclose(3X), ldfcn(4). \} .el \{\ fopen(3S), ldclose(3X), intro(4), ldfcn(4), paths.h(4). \} .\" @(#)ldopen.3x 1.5 ), plot(4). .\" @(#)plot.3x 1.5 .TH PTRACE 2 .SH NAME ptrace \- process trace .SH SYNOPSIS .BR "int ptrace (" "request, pid, addr, data" ); .br .BR int " request, pid, addr, data" ; .SH DESCRIPTION .I Ptrace\^ provides a means by which a parent process may control the execution of a child process. Its primary use is for the implementation of breakpoint debugging; see .IR sdb (1). The child process behaves normally until it encounters a signal (see .IR signal (2) for a list of signals), at which time it enters a stopped state and its parent is notified via .IR wait (2). When the child is in the stopped state, its parent can examine and modify its ``core image'' using .IR ptrace . The parent also can cause the child either to terminate or continue, with the possibility of ignoring the signal that caused it to stop. .PP The .I request\^ argument determines the precise action to be taken by .I ptrace\^ and is one of the following: .RS .TP 5 .B 0 This request must be issued by the child process if it is to be traced by its parent. It turns on .TH LDRSEEK 3X .SH NAME ldrseek, ldnrseek \- seek to relocation entries of a section of a common object file .SH SYNOPSIS .nf .ta \w'unsigned\ 'u +\w'short\ \ 'u .B #include .ie '\*p'' \{\ .B #include .B #include \} .el \{\ .B #include "\s-1INCDIR\s+1\/filehdr.h" .B #include "\s-1INCDIR\s+1\/ldfcn.h" \} .ft R .PP .BR "int ldrseek (" "ldptr, sectindx" ) .BR "\s-1LDFILE\s+1 \(**" ldptr ; .BR "unsigned short" " sectindx" ; .PP .BR "int ldnrseek (" "ldptr, sectname" ) .BR "\s-1LDFILE\s+1 \(**" ldptr ; .BR "char \(**" sectname ; .DT .fi .SH DESCRIPTION .I Ldrseek seeks to the relocation entries of the section specified by .I sectindx of the common object file currently associated with .IR ldptr . .PP .I Ldnrseek seeks to the relocation entries of the section specified by .IR sectname . .PP .I Ldrseek and .I ldnrseek .RB "return " \s-1SUCCESS\s+1 " or " \s-1FAILURE\s+1 . .I Ldrseek fails if .I sectindx is greater than the number of sections in the object file; .I ldnrseek fails if  .TH POPEN 3S .SH NAME popen, pclose \- initiate pipe to/from a process .SH SYNOPSIS .B #include .PP .BR "\s-1FILE\s+1 \(**popen (" "command, type" ) .br .BR "char \(**" "command," " \(**" "type" ; .PP .BR "int pclose (" stream ) .br .BR "\s-1FILE\s+1 \(**" stream ; .SH DESCRIPTION The arguments to .I popen\^ are pointers to null-terminated strings; one string contains a shell command line and the other contains an I/O mode. The mode may be either .B "r" for reading or .B "w" for writing. .I Popen\^ creates a pipe between the calling program and the command to be executed. The value returned is a stream pointer. If the I/O mode is \fBw\fP, one can write to the standard input of the command by writing to the file .IR stream ; if the I/O mode is .BR "r" , one can read from the standard output of the command, by reading from the file .IR stream . .PP A stream opened by .I popen\^ should be closed by .IR pclose , which waits for the associated process to terminate and returns the exit status of the the child's trace flag that stipulates that the child should be left in a stopped state upon receipt of a signal rather than the state specified by the .I func\^ argument of .IR signal (2). The .IR pid ", " addr ", and " data arguments are ignored and a return value is not defined for this request. Peculiar results ensue if the parent does not expect to trace the child. .RE .PP The remainder of the requests can only be used by the parent process. For each, .I pid\^ is the process .SM ID of the child. The child must be in a stopped state before these requests are made. .RS .TP 5 .B 1, 2 With these requests, the word at location .I addr\^ in the address space of the child is returned to the parent process. If I and D space are separated, request .B 1 returns a word from I space, and request .B 2 returns a word from D space. If I and D space are not separated, either request .B 1 or request .B 2 may be used with equal results. The .I data\^ argument is ignored. These two requests fail if .I addr\^ is not the stathere is no section name corresponding with .IR sectname . Either function fails if the specified section has no relocation entries or if it cannot seek to the specified relocation entries. .PP Note that the first section has an index of .IR one . .PP The program must be loaded with the object file access routine library .ie '\*p'' \{\ .BR libld.a . \} .el \{\ .BR \s-1LIBDIR\s+1\/libld.a . \} .PP .if !'\*p'' \{\ .PP .IR Intro (4) describes .IR \s-1INCDIR\s+1 " and " \s-1LIBDIR\s+1 . \} .SH "SEE ALSO" .ie '\*p'' \{\ ldclose(3X), ldopen(3X), ldshread(3X), ldfcn(4). \} .el \{\ ldclose(3X), ldopen(3X), ldshread(3X), intro(4), ldfcn(4), paths.h(4). \} .\" @(#)ldrseek.3x 1.5 command. .PP Because open files are shared, a type .B "r" command may be used as an input filter and a type .B "w" as an output filter. .SH "SEE ALSO" pipe(2), wait(2), fclose(3S), fopen(3S), system(3S). .SH DIAGNOSTICS .I Popen\^ returns a .SM NULL pointer if files or processes cannot be created or if the shell cannot be accessed. .PP .I Pclose\^ returns \-1 if .I stream\^ is not associated with a command opened by .IR popen . .SH BUGS If the original processes and processes opened by .I popen\^ concurrently read or write a common file, neither should use buffered I/O, because the buffering gets all mixed up. Problems with an output filter may be forestalled by careful buffer flushing, e.g., by using .IR fflush ; see .IR fclose (3S). .\" @(#)popen.3s 1.5  rt address of a word, in which case a value of \-1 is returned to the parent process and the parent's .I errno\^ is set to .SM \%EIO. .TP 5 .B 3 With this request, the word at location .I addr\^ in the child's .SM USER area in the system's address space (see .B ) is returned to the parent process. Addresses in this area range from 0 to 1024 on the .SM PDP\*S-11s and 0 to 2048 on the .SM 3B20S\*S, .SM VAX\*S, and M68000. The .I data\^ argument is ignored. This request fails if .I addr\^ is not the start address of a word or is outside the .SM USER area, in which case a value of \-1 is returned to the parent process and the parent's .I errno\^ is set to .SM EIO. .TP 5 .B 4, 5 With these requests, the value given by the .I data\^ argument is written into the address space of the child at location .IR addr . If I and D space are separated, request 4 writes a word into I space and request 5 writes a word into D space. If I and D space are not separated, either request 4 or request 5 may be used with eq.TH LDSHREAD 3X .SH NAME ldshread, ldnshread \- read an indexed\/named section header of a common object file .SH SYNOPSIS .ta \w'unsigned\ 'u +\w'short\ \ 'u .nf .B #include .ie '\*p'' \{\ .B #include .B #include .B #include \} .el \{\ .B #include "\s-1INCDIR\s+1\/filehdr.h" .B #include "\s-1INCDIR\s+1\/scnhdr.h" .B #include "\s-1INCDIR\s+1\/ldfcn.h" \} .PP .BR "int ldshread (" "ldptr, sectindx, secthead" ) .BR "\s-1LDFILE\s+1 \(**" ldptr ; .BR "unsigned short" " sectindx" ; .BR "\s-1SCNHDR\s+1 \(**" secthead ; .PP .BR "int ldnshread (" "ldptr, sectname, secthead" ) .BR "\s-1LDFILE\s+1 \(**" ldptr ; .BR "char \(**" " sectname" ; .BR "\s-1SCNHDR\s+1 \(**" secthead ; .fi .DT .SH DESCRIPTION .I Ldshread\^ reads the section header specified by .I sectindx\^ of the common object file currently associated with .I ldptr\^ into the area of memory beginning at .IR secthead . .PP .I Ldnshread\^ reads the section header specified by .I sectname\^ into the area of memory beginn.\" @(#)pow.3m 1.2 .so /usr/man/u_man/man3/exp.3m ual results. Upon successful completion, the value written into the address space of the child is returned to the parent. These two requests fail if .I addr\^ is a location in a pure procedure space and another process is executing in that space, or if .I addr\^ is not the start address of a word. Upon failure a value of \-1 is returned to the parent process and the parent's .I errno\^ is set to .SM EIO\*S. .TP 5 .B 6 With this request, a few entries in the child's .SM USER area can be written. .I Data\^ gives the value that is to be written and .I addr\^ is the location of the entry. The few entries that can be written are: .RS .IP the general registers (i.e., registers 0\-11 on the .SM 3B20S, registers 0\-7 on .SM PDP\*S-11s, and registers 0\-15 on the .SM VAX\*S and M68000) .IP certain bits of the Processor Status Word on the M68000 and M68010 (i.e., bits 0\-4 and 15) .IP the condition codes of the Processor Status Word on the .SM 3B20S . .IP the floating point status register and six floating point regist ing at .IR secthead . .PP .I Ldshread\^ and .I ldnshread\^ return .BR \s-1SUCCESS\s+1 " or " \s-1FAILURE\s+1 . .I Ldshread \^ fails if .I sectindx\^ is greater than the number of sections in the object file; .I ldnshread\^ fails if there is no section name corresponding with .IR sectname . Either function fails if it cannot read the specified section header. .PP Note that the first section header has an index of .IR one . .PP The program must be loaded with the object file access routine library .ie '\*p'' \{\ .BR libld.a . \} .el \{\ .BR \s-1LIBDIR\s+1\/libld.a . \} .PP .if !'\*p'' \{\ .IR Intro (4) describes .IR \s-1INCDIR\s+1 " and " \s-1LIBDIR\s+1 . \} .SH SEE ALSO .ie '\*p'' \{\ ldclose(3X), ldopen(3X), ldfcn(4). \} .el \{\ ldclose(3X), ldopen(3X), intro(4), ldfcn(4), path.h(4). \} .\" @(#)ldshread.3x 1.5 .TH PRINTF 3S .SH NAME printf, fprintf, sprintf \- print formatted output .SH SYNOPSIS .B "#include " .PP .BR "int printf (" "format" " [ , " "arg" " ] .\|.\|. )" .br .BR "char \(**" "format" ";" .PP .BR "int fprintf (" "stream, format" " [ , " "arg" " ] .\|.\|. )" .br .BR "\s-1FILE\s+1 \(**" stream ; .br .BR "char \(**" "format" ";" .PP .BR "int sprintf (" "s, format" " [ ," " arg" " ] .\|.\|. )" .br .BR "char \(**" "s, format" ";" .SH DESCRIPTION .I Printf\^ places output on the standard output stream .IR stdout . .I Fprintf\^ places output on the named output .IR stream . .I Sprintf\^ places ``output'', followed by the null character .RB ( \e\|0 ) in consecutive bytes starting at .RI \(** s ; it is the user's responsibility to ensure that enough storage is available. Each function returns the number of characters transmitted (not including the .B \e\|0 in the case of .IR sprintf ), or a negative value if an output error was encountered. .PP Each of these functions converts, formats, and prints its2nkheb_\YVSPMJGDA>;852/,)&#  .TH LDSSEEK 3X .SH NAME ldsseek, ldnsseek \- seek to an indexed\/named section of a common object file .SH SYNOPSIS .ta \w'unsigned\ 'u +\w'short\ \ 'u .nf .B #include .ie '\*p'' \{\ .B #include .B #include \} .el \{\ .B #include "\s-1INCDIR\s+1\/filehdr.h" .B #include "\s-1INCDIR\s+1\/ldfcn.h" \} .PP .BR "int ldsseek (" "ldptr, sectindx" ) .BR "\s-1LDFILE\s+1 \(**" ldptr ; .BR "unsigned short" " sectindx" ; .PP .BR "int ldnsseek (" "ldptr, sectname" ) .BR "\s-1LDFILE\s+1 \(**" ldptr ; .BR "char \(**" sectname ; .DT .fi .SH DESCRIPTION .I Ldsseek\^ seeks to the section specified by .I sectindx\^ of the common object file currently associated with .IR ldptr . .PP .I Ldnsseek\^ seeks to the section specified by .IR sectname . .PP .I Ldsseek\^ and .I ldnsseek\^ .RB "return " \s-1SUCCESS\s+1 " or " \s-1FAILURE\s+1 . .I Ldsseek\^ fails if .I sectindx\^ is greater than the number of sections in the object file; .I ldnsseek\^ fails if there is no section name corresponding with .IR s  .IR arg s under control of the .IR format . The .I format\^ is a character string that contains two types of objects: plain characters, which are simply copied to the output stream, and conversion specifications, each of which results in fetching zero or more .IR arg s. The results are undefined if there are insufficient .IR arg s for the format. If the format is exhausted while .IR arg s remain, the excess .IR arg s are simply ignored. .PP Each conversion specification is introduced by the character .BR % . After the .BR % , the following appear in sequence: .PP .RS Zero or more .IR flags , which modify the meaning of the conversion specification. .PP An optional decimal digit string specifying a minimum .IR "field width" . If the converted value has fewer characters than the field width, it will be padded to the field width on the left (default) or right (if the left-adjustment flag has been given); see below for flag specification. .PP A .I precision\^ that gives the minimum number of digits to appear fosets the trace bit in the Processor Status Word of the child (i.e., bit 4 on .SM PDP\*S-11s; bit 30 on the .SM VAX\*S; bit 15 on the M68000) and then executes the same steps as listed above for request .BR 7 . The trace bit causes an interrupt upon completion of one machine instruction. This effectively allows single stepping of the child. On the .SM 3B20S there is no trace bit and this request returns an error. .br Note: the trace bit remains set after an interrupt on .SM PDP\*S-11s but is turned off after an interrupt on the .SM VAX\*S and M68000. .RE .PP To forestall possible fraud, .I ptrace\^ inhibits the set-user-id facility on subsequent .IR exec (2) calls. If a traced process calls .IR exec , it stops before executing the first instruction of the new image showing signal .SM .BR SIGTRAP . .SH GENERAL ERRORS .I Ptrace\^ in general fails if one or more of the following are true: .IP .I Request\^ is an illegal number. .SM \%[EIO] .IP .I Pid\^ identifies a child that does not exist or has not executed a ectname . Either function fails if there is no section data for the specified section or if it cannot seek to the specified section. .PP Note that the first section has an index of .IR one . .PP The program must be loaded with the object file access routine library .ie '\*p'' \{\ .BR libld.a . \} .el \{\ .BR \s-1LIBDIR\s+1\/libld.a . \} .if !'\*p'' \{\ .PP .IR Intro (4) describes .BR \s-1INCDIR\s+1 and \s-1LIBDIR\s+1 . \} .SH SEE ALSO .ie '\*p'' \{\ ldclose(3X), ldopen(3X), ldshread(3X), ldfcn(4). \} .el \{\ ldclose(3X), ldopen(3X), ldshread(3X), intro(4), ldfcn(4), paths.h(4). \} .\" @(#)ldsseek.3x 1.4 r the .BR d , .BR o , .BR u , .BR x , or .B X conversions, the number of digits to appear after the decimal point for the .B e and .B f conversions, the maximum number of significant digits for the .B g conversion, or the maximum number of characters to be printed from a string in .B s conversion. The format of the precision is a period .RB ( \&. ) followed by a decimal digit string; a null digit string is treated as zero. .PP An optional .B l specifying that a following .BR d , .BR o , .BR u , .BR x , or .B X conversion character applies to a long integer .IR arg . .PP A character that indicates the type of conversion to be applied. .RE .PP A field width or precision may be indicated by an asterisk .RB ( \(** ) instead of a digit string. In this case, an integer .I arg\^ supplies the field width or precision. The .I arg\^ that is actually converted is not fetched until the conversion letter is seen; therefore, the .IR arg s specifying field width or precision must appear .I before\^ the .I arg\^ (if any) to  .I ptrace\^ with request .BR 0 . .SM \%[ESRCH] .SH SEE ALSO sdb(1), exec(2), signal(2), wait(2). .\" @(#)ptrace.2 1.7 .TH LDTBINDEX 3X .SH NAME ldtbindex \- compute the index of a symbol table entry of a common object file .SH SYNOPSIS .nf .ta \w'LDFILE\ \ \ 'u .B #include .ie '\*p'' \{\ .B #include .B #include .B #include \} .el \{ .ft B #include "\s-1INCDIR\s+1\/filehdr.h" #include "\s-1INCDIR\s+1\/syms.h" #include "\s-1INCDIR\s+1\/ldfcn.h" \} .ft R .PP .BR "long ldtbindex (" ldptr ) .BR "\s-1LDFILE\s+1 \(**" ldptr ; .fi .DT .ft R .SH DESCRIPTION .I Ldtbindex\^ returns the .RB ( long ) index of the symbol table entry at the current position of the common object file associated with .IR ldptr . .PP The index returned by .I ldtbindex\^ may be used in subsequent calls to .IR ldtbread (3X). However, since .I ldtbindex\^ returns the index of the symbol table entry that begins at the current position of the object file, if .I ldtbindex\^ is called immediately after a particular symbol table entry has been read, it returns the index of the next entry. .PP .I Ldtbindex\^ fails if there abe converted. .PP The flag characters and their meanings are: .sp .PD 0 .TP 10 .B \- The result of the conversion will be left-justified within the field. .sp .TP .B + The result of a signed conversion will always begin with a sign .RB ( + or .BR \- ). .sp .TP blank If the first character of a signed conversion is not a sign, a blank will be prefixed to the result. This implies that if the blank and .B + flags both appear, the blank flag will be ignored. .sp .TP .B # This flag specifies that the value is to be converted to an ``alternate form.''\ For .BR c , .BR d , .BR s , and .B u conversions, the flag has no effect. For .B o conversion, it increases the precision to force the first digit of the result to be a zero. For .B x .RB ( X ) conversion, a non-zero result will have .B 0x .RB ( 0X ) prefixed to it. For .BR e , .BR E , .BR f , .BR g , and .B G conversions, the result will always contain a decimal point, even if no digits follow the point (normally, a decimal point appears in the result of these conv.TH READ 2 .SH NAME read \- read from file .SH SYNOPSIS .BR "int read (" "fildes, buf, nbyte" ) .br .BR int " fildes" ; .br .BR "char \(**" "buf" ; .br .BR unsigned " nbyte" ; .SH DESCRIPTION .I Fildes\^ is a file descriptor obtained from a .IR creat , .IR open , .IR dup , .IR fcntl , or .I pipe\^ system call. .PP .I Read\^ attempts to read .I nbyte\^ bytes from the file associated with .I fildes\^ into the buffer pointed to by .IR buf . .PP On devices capable of seeking, the .I read\^ starts at a position in the file given by the file pointer associated with .IR fildes . Upon return from .IR read , the file pointer is incremented by the number of bytes actually read. .PP Devices that are incapable of seeking always read from the current position. The value of a file pointer associated with such a file is undefined. .PP Upon successful completion, .I read\^ returns the number of bytes actually read and placed in the buffer; this number may be less than .I nbyte\^ if the file is associated with a communicatio re no symbols in the object file or if the object file is not positioned at the beginning of a symbol table entry. .PP Note that the first symbol in the symbol table has an index of .IR zero . .PP The program must be loaded with the object file access routine library .ie '\*p'' \{\ .BR libld.a . \} .el \{\ \s-1LIBDIR\s+1\/libld.a . \} .if !'\*p'' \{\ .PP .IR Intro (4) describes .IR \s-1INCDIR\s+1 " and " \s-1LIBDIR\s+1 . \} .SH SEE ALSO .ie '\*p'' \{\ ldclose(3X), ldopen(3X), ldtbread(3X), ldtbseek(3X), ldfcn(4). \} .el \{\ ldclose(3X), ldopen(3X), ldtbread(3X), ldtbseek(3X), intro(4), ldfcn(4), paths.h(4). \} .SH DIAGNOSTICS Upon failure, \f2ldtbindex\f1 returns \f3BADINDEX\f1. .\" @(#)ldtbindex.3x 1.6 ersions only if a digit follows it). For .B g and .B G conversions, trailing zeroes will .I not\^ be removed from the result (which they normally are). .PD .PP The conversion characters and their meanings are: .PP .PD 0 .TP 10 \f3d\fP,\f3o\fP,\f3u\fP,\f3x\fP,\f3X\fP The integer .I arg\^ is converted to signed decimal, unsigned octal, decimal, or hexadecimal notation .RB ( x and .BR X ), respectively; the letters .B abcdef are used for .B x conversion and the letters .SM .B ABCDEF for .B X conversion. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it will be expanded with leading zeroes. The default precision is 1. The result of converting a zero value with a precision of zero is a null string. .sp .TP .BR f The float or double .I arg\^ is converted to decimal notation in the style ``[\f3\-\fP]ddd\f3.\fPddd'', where the number of digits after the decimal point is equal to the precision specification. If the precision is missing, n line (see .IR ioctl (2) and .IR termio (7)), or if the number of bytes left in the file is less than .I nbyte\^ bytes. A value of 0 is returned when an end-of-file has been reached. .PP When attempting to read from an empty pipe (or .SM FIFO\*S): .IP If .SM .B O_NDELAY is set, the read returns a 0. .IP If .SM .B O_NDELAY is clear, the read blocks until data is written to the file or the file is no longer open for writing. .PP When attempting to read a file associated with a tty that has no data currently available: .IP If .SM .B O_NDELAY is set, the read returns a 0. .IP If .SM .B O_NDELAY is clear, the read blocks until data becomes available. .PP .I Read\^ fails if one or more of the following are true: .IP .I Fildes\^ is not a valid file descriptor open for reading. .SM \%[EBADF] .IP .I Buf\^ points outside the allocated address space. .SM \%[EFAULT] .SH "RETURN VALUE" Upon successful completion a non-negative integer is returned indicating the number of bytes actually read. Otherwise, a \-1 is returned .TH LDTBREAD 3X .SH NAME ldtbread \- read an indexed symbol table entry of a common object file .SH SYNOPSIS .ta \w'\s-1LDFILE\s+1\ \ \ 'u .nf .B #include .ie '\*p'' \{\ .B #include .B #include .B #include \} .el \{\ .B #include "\s-1INCDIR\s+1\/filehdr.h> .B #include "\s-1INCDIR\s+1\/syms.h" .B #include "\s-1INCDIR\s+1\/ldfcn.h" \} .PP .BR "int ldtbread (" "ldptr, symindex, symbol" ) .BR "\s-1LDFILE\s+1 \(**" ldptr ; .BR long " symindex" ; .BR "\s-1SYMENT\s+1 \(**" symbol ; .fi .DT .SH DESCRIPTION .I Ldtbread\^ reads the symbol table entry specified by .I symindex\^ of the common object file currently associated with .I ldptr\^ into the area of memory beginning at .IR symbol . .PP .I Ldtbread\^ returns .BR \s-1SUCCESS\s+1 " or " \s-1FAILURE\s+1 . .I Ldtbread\^ fails if .I symindex\^ is greater than the number of symbols in the object file or if it cannot read the specified symbol table entry. .PP Note that the first symbol in the symbol table has an index of .IR zero 6 digits are output; if the precision is explicitly 0, no decimal point appears. .sp .TP .BR e , E The float or double .I arg\^ is converted in the style ``[\f3\-\fP]d\f3.\fPddd\f3e\(+-\fPdd'', where there is one digit before the decimal point and the number of digits after it is equal to the precision; when the precision is missing, 6 digits are produced; if the precision is zero, no decimal point appears. The .B E format code produces a number with .B E instead of .B e introducing the exponent. The exponent always contains at least two digits. .sp .TP .BR g , G The float or double .I arg\^ is printed in style .BR f or .BR e (or in style .B E in the case of a .B G format code), with the precision specifying the number of significant digits. The style used depends on the value converted: style .B e is used only if the exponent resulting from the conversion is less than \-4 or greater than the precision. Trailing zeroes are removed from the result; a decimal point appears only if it is followed by a digit. .spand .I errno\^ is set to indicate the error. .SH "SEE ALSO" creat(2), dup(2), fcntl(2), ioctl(2), open(2), pipe(2), termio(7). .\" @(#)read.2 1.5  . .PP The program must be loaded with the object file access routine library .ie '\*p'' \{\ .BR libld.a . \} .el \{\ \s-1LIBDIR\s+1\/libld.a . \} .if !'\*p'' \{\ .PP .IR Intro (5) describes .IR \s-1INCDIR\s+1 and \s-1LIBDIR\s+1 . \} .SH SEE ALSO .ie '\*p'' \{\ ldclose(3X), ldgetname(3X), ldopen(3X), ldtbseek(3X), ldfcn(4). \} .el \{\ ldclose(3X), ldopen(3X), ldtbseek(3X), intro(4), ldfcn(4), paths.h(4). \} .\" @(#)ldtbread.3x 1.5  .TP .B c The character .I arg\^ is printed. .sp .TP .B s The .I arg\^ is taken to be a string (character pointer) and characters from the string are printed until a null character .RB ( \e\|0 ) is encountered or the number of characters indicated by the precision specification is reached. If the precision is missing, it is taken to be infinite, so all characters up to the first null character are printed. If the string pointer .I arg\^ has the value zero, the result is undefined. A .I null\^ arg yields undefined results. .sp .TP .B % Print a .BR % ; no argument is converted. .PD .PP In no case does a non-existent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field is simply expanded to contain the conversion result. Characters generated by .I printf\^ and .I fprintf\^ are printed as if .IR putc (3S) had been called. .SH EXAMPLES To print a date and time in the form ``Sunday, July 3, 10:02'', where .I weekday\^ and .I month\^ are pointers t .\" @(#)sbrk.2 1.2 .so /usr/man/u_man/man2/brk.2 .tr ~" .TH LDTBSEEK 3X .SH NAME ldtbseek \- seek to the symbol table of a common object file .SH SYNOPSIS .nf .B #include .ie '\*p'' \{\ .B #include .B #include \} .el \{\ .B #include ~\s-1INCDIR\s+1\/filehdr.h~ .B #include ~\s-1INCDIR\s+1\/ldfcn.h~\} .tr ~~ .PP .BR "int ldtbseek (" ldptr ) .BR "\s-1LDFILE\s+1 \(**" ldptr ; .fi .SH DESCRIPTION .I Ldtbseek\^ seeks to the symbol table of the \*N object file currently associated with .IR ldptr . .PP .I Ldtbseek\^ .RB "returns " \s-1SUCCESS\s+1 " or " \s-1FAILURE\s+1 . .I Ldtbseek\^ fails if the symbol table has been stripped from the object file or if it cannot seek to the symbol table. .PP The program must be loaded with the object file access routine library .ie '\*p'' \{\ .BR libld.a . \} .el \{\ .BR \s-1LIBDIR\s+1\/libld.a . \} .RE .if !'\*p'' \{\ .PP .IR Intro (4) describes .IR \s-1INCDIR\s+1 and \s-1LIBDIR\s+1 . \} .SH SEE ALSO .ie '\*p'' \{\ ldclose(3X), ldopen(3X), ldtbread(3X), ldfcn(4). \} .el \{\ ldclose(3X), ldopen(3o null-terminated strings: .nh .sp \f3printf("%s,\ %s\ %d,\ %.2d:%.2d",\ weekday,\ month,\ day,\ hour,\ min);\f1 .PP .hy 14 To print .I pi\^ to 5 decimal places: .RS .PP \f3printf("pi \|= \|%.5f", \|4\(**atan(1.0));\f1 .RE .SH SEE ALSO ecvt(3C), putc(3S), scanf(3S), stdio(3S). .\" @(#)printf.3s 1.7 .tr ~ .TH SEMCTL 2 .SH NAME semctl \- semaphore control operations .SH SYNOPSIS .B #include .br .B #include .br .B #include .PP .nf .BR "int semctl (" "semid, semnum, cmd, arg" ")" .BR int " semid, cmd" ; .BR int " semnum" ; .B union semun { .B ~~~~~int val; .B ~~~~~struct semid_ds \(**buf; .B ~~~~~ushort array[ ]; .B } arg; .fi .tr ~~ .SH DESCRIPTION .I Semctl provides a variety of semaphore control operations as specified by .IR cmd . .PP The following .IR cmd s are executed with respect to the semaphore specified by .IR semid " and " semnum (see \fIintro\fP(2) for definitions of values and permissions): .RS .TP \w'\fBIPC_RMID\fP\ \ \ 'u .SM .B GETVAL Return the value of \fIsemval\fP.\^\^\s-1{READ}\s+1 .TP \w'\fBIPC_RMID\fP\ \ \ 'u .SM .B SETVAL Set the value of \fIsemval\fP to .IR arg.val .\^\^\s-1{ALTER}\s+1 When this \fIcmd\fP is successfully executed, the semadj value (see \fIexit\fP(2)) corresponding to the specified semaphore in all processes is cleared. .TP \w'\ X), ldtbread(3X), intro(4), ldfcn(4), paths.h(4). \} .\" @(#)ldtbseek.3x 1.4 .TH PUTC 3S .SH NAME putc, putchar, fputc, putw \- put character or word on a stream .SH SYNOPSIS .B #include .PP .BR "int putc (" "c, stream" ) .br .BR char " c" ; .br .SM .BR "FILE\*S \(**" stream ; .PP .BR "int putchar (" c ) .br .BR char " c" ; .PP .BR "int fputc (" "c, stream" ) .br .BR char " c" ; .br .SM .BR "FILE\*S \(**" stream ; .PP .BR "int putw (" "w, stream" ) .br .BR int " w" ; .br .SM .BR "FILE\*S \(**" stream ; .SH DESCRIPTION .I Putc\^ writes the character .I c\^ onto the output .I stream\^ at the position where the file pointer, if defined, is pointing. .IR Putchar ( c ) is defined as .IR putc ( "c, stdout" ). .I Putc\^ and .I putchar\^ are macros. .PP .I Fputc\^ behaves like .IR putc , but is a function rather than a macro. .I Fputc\^ runs more slowly than .IR putc , but takes less space per invocation. .PP .I Putw\^ writes the word (i.e., integer) .I w\^ to the output .I stream\^ at the position at which the file pointer, if defined, is pointing. The size of a word is the size offBIPC_RMID\fP\ \ \ 'u .SM .B GETPID Return the value of \fIsempid\fP.\^\^\s-1{READ}\s+1 .TP \w'\fBIPC_RMID\fP\ \ \ 'u .SM .B GETNCNT Return the value of \fIsemncnt\fP.\^\^\s-1{READ}\s+1 .TP \w'\fBIPC_RMID\fP\ \ \ 'u .SM .B GETZCNT Return the value of \fIsemzcnt\fP.\^\^\s-1{READ}\s+1 .RE .PP The following .IR cmd s return and set, respectively, every \fIsemval\fP in the set of semaphores. .RS .TP \w'\fBIPC_RMID\fP\ \ \ 'u .SM .B GETALL Place \fIsemval\fPs into array pointed to by .IR arg.array .\^\^\s-1{READ}\s+1 .TP \w'\fBIPC_RMID\fP\ \ \ 'u .SM .B SETALL Set \fIsemval\fPs according to the array pointed to by .IR arg.array .\^\^\s-1{ALTER}\s+1 When this \fIcmd\fP is successfully executed, the semadj values corresponding to each specified semaphore in all processes are cleared. .RE .PP The following .IR cmd s are also available: .RS .TP \w'\fBIPC_RMID\fP\ \ \ 'u .SM .B IPC_STAT Place the current value of each member of the data structure associated with .I semid into the structure pointed to by .IR arg.buf . T.TH LEN 3F .SH NAME len \- return length of FORTRAN string .SH SYNOPSIS .nf .BR "character\(**N" " ch" .BR "integer" " i" .P .RB "i" " = len(" ch ) .SH DESCRIPTION .I Len\^ returns the length of string .IR ch . .\" @(#)len.3f 1.5   an integer and varies from machine to machine. .I Putw\^ neither assumes nor causes special alignment in the file. .PP Output streams, with the exception of the standard error stream .IR stderr , are by default buffered if the output refers to a file and line-buffered if the output refers to a terminal. The standard error output stream .I stderr\^ is by default unbuffered, but use of .IR freopen (see .IR fopen (3S)) causes it to become buffered or line-buffered. When an output stream is unbuffered information, it is queued for writing on the destination file or terminal as soon as written; when it is buffered, many characters are saved up and written as a block; when it is line-buffered, each line of output is queued for writing on the destination terminal as soon as the line is completed (i.e., as soon as a new-line character is written or terminal input is requested). .IR Setbuf (3S) may be used to change the stream's buffering strategy. .SH SEE ALSO fclose(3S), ferror(3S), fopen(3S), fread(3S), printf(3S)he contents of this structure are defined in .IR intro (2).\^\^\s-1{READ}\s+1 .TP \w'\fBIPC_RMID\fP\ \ \ 'u .SM .B IPC_SET Set the value of the following members of the data structure associated with .I semid to the corresponding value found in the structure pointed to by .IR arg.buf : .SP 1v .RS .nf .B sem_perm.uid .B sem_perm.gid .B "sem_perm.mode /\(** only low 9 bits \(**/" .fi .RE .IP This \fIcmd\fP can only be executed by a process that has an effective user .SM ID equal to either that of superuser or to the value of .I sem_perm.uid in the data structure associated with .IR semid . .TP \w'\fBIPC_RMID\fP\ \ \ 'u .SM .B IPC_RMID Remove the semaphore identifier specified by .I semid from the system and destroy the set of semaphores and data structure associated with it. This \fIcmd\fP can only be executed by a process that has an effective user .SM ID equal to either that of superuser or to the value of .I sem_perm.uid in the data structure associated with .IR semid . .PP .I Semctl fails if one or more of .\" @(#)localtime.3c 1.2 .so /usr/man/u_man/man3/ctime.3c , puts(3S), setbuf(3S). .SH DIAGNOSTICS On success, these functions each return the value they have written. On failure, they return the constant .SM .BR EOF . This occurs if the file .I stream\^ is not open for writing or if the output file cannot be grown. Because .SM .B EOF is a valid integer, .IR ferror (3S) should be used to detect .I putw\^ errors. .SH BUGS Because it is implemented as a macro, .I putc\^ treats incorrectly a .I stream\^ argument with side effects. In particular, .B putc(c, \(**f++); doesn't work sensibly. .I Fputc\^ should be used instead. .br Because of possible differences in word length and byte ordering, files written using .I putw\^ are machine-dependent and may not be read using .I getw\^ on a different processor. For this reason the use of .I putw\^ should be avoided. .\" @(#)putc.3s 1.4  the following are true: .IP .I Semid is not a valid semaphore identifier. .SM \%[EINVAL] .IP .I Semnum is less than zero or greater than .IR sem_nsems . .SM \%[EINVAL] .IP .I Cmd is not a valid command. .SM \%[EINVAL] .IP Operation permission is denied to the calling process (see .IR intro (2)). .SM \%[EACCES] .IP .I Cmd is .SM .B SETVAL or .SM .B SETALL and the value to which \fIsemval\fP is to be set is greater than the system imposed maximum. .SM \%[ERANGE] .IP .I Cmd is equal to .SM .B IPC_RMID or .SM .B IPC_SET and the effective user .SM ID of the calling process is not equal to that of superuser and is not equal to the value of .I sem_perm.uid in the data structure associated with .IR semid . .SM \%[EPERM] .IP .I Arg.buf points to an illegal address. .SM \%[EFAULT] .SH "RETURN VALUE" Upon successful completion, the value returned depends on .I cmd\^ as follows: .PD 0 .RS .TP 1.5i .SM .B GETVAL The value of \fIsemval\fP. .TP .SM .B GETPID The value of \fIsempid\fP. .TP .SM .B GETNCNT The value of \fIsemn.TH LOG 3F .SH NAME log, alog, dlog, clog \- FORTRAN natural logarithm intrinsic function .SH SYNOPSIS .nf .BR "real" " r1, r2" .BR "double precision" " dp1, dp2" .BR "complex" " cx1, cx2" .P .RB "r2" " = alog(" "r1" ")" .RB "r2" " = log(" "r1" ")" .P .RB "dp2" " = dlog(" "dp1" ")" .RB "dp2" " = log(" "dp1" ")" .P .RB "cx2" " = clog(" "cx1" ")" .RB "cx2" " = log(" "cx1" ")" .SH DESCRIPTION .I Alog\^ returns the real natural logarithm of its real argument. .I Dlog\^ returns the double-precision natural logarithm of its double-precision argument. .I Clog\^ returns the complex logarithm of its complex argument. The generic function .I log\^ becomes a call to .IR alog , .IR dlog , or .I clog\^ depending on the type of its argument. .SH SEE ALSO exp(3M). .\" @(#)log.3f 1.4 .\" @(#)putchar.3s 1.2 .so /usr/man/u_man/man3/putc.3s cnt\fP. .TP .SM .B GETZCNT The value of \fIsemzcnt\fP. .TP All others A value of 0. .RE .PP .PD When \fIsemctl\fP is unsuccessful, a value of \-1 is returned and .I errno\^ is set to indicate the error. .SH SEE ALSO semget(2), semop(2), intro(2), exit(2). .\" @(#)semctl.2 1.5  .\" @(#)log.3m 1.2 .so /usr/man/u_man/man3/exp.3m .TH PUTPWENT 3C .SH NAME putpwent \- write password file entry .SH SYNOPSIS .B #include .PP .BR "int putpwent (" "p, f" ) .br .BR "struct passwd \(**" p ; .br .BR "\s-1FILE\s+1 \(**" f ; .SH DESCRIPTION .I Putpwent\^ is the inverse of .IR getpwent (3C). Given a pointer to a .I passwd\^ structure created by .I getpwent\^ (or .I getpwuid or .IR getpwnam ), .I putpwuid\^ writes a line on the stream .I f\^ which matches the format of .BR /etc/passwd . .PP The \fB\fP header file is described in \fIgetpwent\fP(3C). .SH "SEE ALSO" getpwent(3C). .SH DIAGNOSTICS .I Putpwent\^ returns non-zero if an error was detected during its operation; otherwise it returns zero. .SH WARNING The above routine uses \f3\f1. Therefore, the size of programs not otherwise using standard I/O is increased more than might be expected. .\" @(#)putpwent.3c 1.5 .TH SEMGET 2 .SH NAME semget \- get set of semaphores .SH SYNOPSIS .B #include .br .B #include .br .B #include .PP .nf .BR "int semget (" "key, nsems, semflg" ) .BR key_t " key" ; .BR int " nsems, semflg" ; .fi .SH DESCRIPTION .I Semget returns the semaphore identifier associated with .IR key . .PP A semaphore identifier and associated data structure and set containing .I nsems semaphores (see .IR intro (2)) are created for .I key if one of the following is true: .IP .I Key is equal to .SM .BR IPC_PRIVATE . .IP .I Key does not already have a semaphore identifier associated with it, and .RI ( semflg " & " .SM .BR IPC_CREAT\*S ) is ``true''. .PP Upon creation, the data structure associated with the new semaphore identifier is initialized as follows: .IP .IR Sem_perm.cuid ", " sem_perm.uid , .IR sem_perm.cgid ", and " sem_perm.gid are set equal to the effective user .SM ID and effective group .SM ID\*S, respectively, of the calling process. .IP The low-order 9 bits of .I sem.TH LOG10 3F .SH NAME log10, alog10, dlog10 \- FORTRAN common logarithm intrinsic function .SH SYNOPSIS .nf .BR "real" " r1, r2" .BR "double precision" " dp1, dp2" .P .RB "r2" " = alog10(" "r1" ")" .RB "r2" " = log10(" "r1" ")" .P .RB "dp2" " = dlog10(" "dp1" ")" .RB "dp2" " = log10(" "dp1" ")" .SH DESCRIPTION .I Alog10\^ returns the real common logarithm of its real argument. .I Dlog\^ returns the double-precision common logarithm of its double-precision argument. The generic function .I log\^ becomes a call to .I alog\^ or .I dlog\^ depending on the type of its argument. .SH SEE ALSO exp(3M). .\" @(#)log10.3f 1.4   .TH PUTS 3S .SH NAME puts, fputs \- put a string on a stream .SH SYNOPSIS .B #include .PP .BR "int puts (" s ) .br .BR "char \(**" s ; .PP .BR "int fputs (" "s, stream" ) .br .BR "char \(**" s ; .br .BR "\s-1FILE\s+1 \(**" stream ; .SH DESCRIPTION .I Puts\^ writes the null-terminated string pointed to by .IR s , followed by a new-line character, to the standard output stream .IR stdout. .PP .I Fputs\^ writes the null-terminated string pointed to by .I s\^ to the named output .IR stream . .PP Neither function writes the terminating null character. .SH "SEE ALSO" ferror(3S), fopen(3S), fread(3S), printf(3S), putc(3S). .SH DIAGNOSTICS Both routines return .SM .B EOF on error. This occurs if the routines try to write on a file that has not been opened for writing. .SH NOTES .I Puts\^ appends a new-line character while .I \^fputs\^ does not. .\" @(#)puts.3s 1.4 _perm.mode are set equal to the low-order 9 bits of .IR semflg . .IP .I Sem_nsems is set equal to the value of .IR nsems . .IP .I Sem_otime is set equal to 0 and .I sem_ctime is set equal to the current time. .PP .I Semget fails if one or more of the following are true: .IP .I Nsems is either less than or equal to zero or greater than the system imposed limit. .SM \%[EINVAL] .IP A semaphore identifier exists for .I key but operation permission (see .IR intro (2)), as specified by the low-order 9 bits of .IR semflg , would not be granted. .SM \%[EACCES] .IP A semaphore identifier exists for .I key but the number of semaphores in the set associated with it is less than .IR nsems " and " nsems is not equal to zero. .SM \%[EINVAL] .IP A semaphore identifier does not exist for .I key and .RI ( semflg " &" .SM .BR IPC_CREAT\*S ) is ``false''. .SM \%[ENOENT] .IP A semaphore identifier is to be created but the system imposed limit on the maximum number of allowed semaphores system wide would be exceeded. .SM \%[ENOS.\" @(#)log10.3m 1.2 .so /usr/man/u_man/man3/exp.3m .\" @(#)pututline.3c 1.2 .so /usr/man/u_man/man3/getut.3c   PC] .IP A semaphore identifier exists for .I key but .RI "( (" semflg " & " .SM .BR IPC_CREAT\*S ") & (" .IR semflg " & " .SM .BR IPC_EXCL\*S ") )" is ``true''. .SM \%[EEXIST] .br .if \n()s .bp .SH "RETURN VALUE" Upon successful completion, a non-negative integer (i.e., a semaphore identifier) is returned. Otherwise, a value of \-1 is returned and .I errno\^ is set to indicate the error. .SH SEE ALSO semctl(2), semop(2). .\" @(#)semget.2 1.7 .TH LOGNAME 3X .SH NAME logname \- return login name of user .SH SYNOPSIS .B char \(**logname( ) .SH DESCRIPTION .I Logname\^ returns a pointer to the null-terminated login name; it extracts the \fB\s-1$LOGNAME\s+1\fP variable from the user's environment. .PP This routine is kept in .BR /lib/lib\s-1PW\s+1.a . .SH FILES /etc/profile .SH SEE ALSO env(1), login(1), profile(4), environ(5). .SH BUGS The return values point to static data whose content is overwritten by each call. .P This method of determining a login name is subject to forgery. .\" @(#)logname.3x 1.2 .\" @(#)putw.3s 1.2 .so /usr/man/u_man/man3/putc.3s .TH SEMOP 2 .SH NAME semop \- semaphore operations .SH SYNOPSIS .B #include .br .B #include .br .B #include .PP .nf .BR "int semop (" "semid, sops, nsops" ) .BR int " semid" ; .BR "struct sembuf (\(**" sops )[]; .BR int " nsops" ; .fi .SH DESCRIPTION .I Semop is used to atomically perform an array of semaphore operations on the set of semaphores associated with the semaphore identifier specified by .IR semid . .I Sops is a pointer to the array of semaphore-operation structures. .I Nsops is the number of such structures in the array. Each structure includes the following members: .PP .RS .ta 8n 20n .nf \f3short\f2 sem_num\f3;\f1 /\(** semaphore number \(**/ \f3short\f2 sem_op\f3;\f1 /\(** semaphore operation \(**/ \f3short\f2 sem_flg\f3;\f1 /\(** operation flags \(**/ .fi .RE .PP Each semaphore operation specified by .I sem_op is performed on the corresponding semaphore specified by .IR semid " and " sem_num . .PP .I Sem_op specifies one of three semaphore operations as fo! .\" @(#)longjmp.3c 1.2 .so /usr/man/u_man/man3/setjmp.3c .TH QSORT 3C .SH NAME qsort \- quicker sort .SH SYNOPSIS .BR "void qsort ((char \(**)" " base, nel, sizeof" " (\(**" "base" ")," " compar" ")" .br .BR "unsigned int" " nel" ; .br .BR "int (\(**" "compar" ")( );" .SH DESCRIPTION .I Qsort\^ is an implementation of the quicker-sort algorithm. It sorts a table of data in place. .PP .I Base\^ points to the element at the base of the table. .I Nel\^ is the number of elements in the table. .I Compar\^ is the name of the comparison function, which is called with two arguments that point to the elements being compared. Depending on whether the first argument is to be considered less than, equal to, or greater than the second argument, the \fIcompar\fP function must return an integer less than, equal to, or greater than zero. .SH NOTES The pointer to the base of the table should be of type pointer-to-element and cast to type pointer-to-character. .br The comparison function need not compare every byte, so arbitrary data may be contained in the elements in addition to llows (see semaphore data structure in .IR intro (2)): .PP .RS 8 If .I sem_op is a negative integer, one of the following occurs: .SM \%{ALTER} .IP If \fIsemval\fP is greater than or equal to the absolute value of .IR sem_op , the absolute value of .I sem_op is subtracted from \fIsemval\fP. Also, if .RI ( sem_flg " &" .SM .BR SEM_UNDO\*S ) is ``true'', the absolute value of .I sem_op is added to the calling process's semadj value (see .IR exit (2)) for the specified semaphore. .IP If \fIsemval\fP is less than the absolute value of .I sem_op and .RI ( sem_flg " &" .SM .BR IPC_NOWAIT\*S ) is ``true'', .I semop returns immediately. .IP If \fIsemval\fP is less than the absolute value of .I sem_op and .RI ( sem_flg " &" .SM .BR IPC_NOWAIT\*S ) is ``false'', .I semop increments the \fIsemncnt\fP associated with the specified semaphore and suspends execution of the calling process until one of the following occurs: .RS 8 .PP \fISemval\fP becomes greater than or equal to the absolute value of .IR sem_op . When this .\" @(#)lrand48.3c 1.2 .so /usr/man/u_man/man3/drand48.3c ! the values being compared. .br Although declared as type pointer-to-character, the value returned should be cast into type pointer-to-element. .SH SEE ALSO sort(1), bsearch(3C), lsearch(3C), string(3C). .\" @(#)qsort.3c 1.4 occurs, the value of \fIsemncnt\fP associated with the specified semaphore is decremented, the absolute value of .I sem_op is subtracted from \fIsemval\fP and, if .RI ( sem_flg " &" .SM .BR SEM_UNDO\*S ) is ``true'', the absolute value of .I sem_op is added to the calling process's semadj value for the specified semaphore. .PP The \fIsemid\fP for which the calling process is awaiting action is removed from the system (see .IR semctl (2)). When this occurs, .I errno is set equal to .SM EIDRM\*S and a value of \-1 is returned. .PP The calling process receives a signal that is to be caught. When this occurs, the value of \fIsemncnt\fP associated with the specified semaphore is decremented and the calling process resumes execution in the manner prescribed in .IR signal (2). .RE .PP If .I sem_op is a positive integer, the value of .I sem_op is added to \fIsemval\fP and, if .RI ( sem_flg " &" .SM .BR SEM_UNDO\*S ) is ``true'', the value of .I sem_op is subtracted from the calling process's semadj value for the spec.TH LSEARCH 3C .SH NAME lsearch \- linear search and update .SH SYNOPSIS .BR "char \(**lsearch ((char \(**)" "key,"\c .BR "(char \(**)" "base, nelp, sizeof" "(\(**" "key" ")," " compar" ) .br .BR "unsigned \(**" nelp ; .br .BR "int (\(**" "compar" ")( );" .SH DESCRIPTION .I Lsearch\^ is a linear search routine generalized from Knuth (6.1) Algorithm S. It returns a pointer into a table indicating where data may be found. If the data does not occur, it is added at the end of the table. .I Key\^ points to the data to be sought in the table. .I Base\^ points to the first element in the table. .I Nelp\^ points to an integer containing the current number of elements in the table. The integer is incremented if the data is added to the table. .I Compar\^ is the name of the comparison function which the user must supply .RI ( strcmp , for example). It is called with two arguments that point to the elements being compared. The function must return zero if the elements are equal and non-zero otherwise. .SH NOTES The p.TH RAND 3C .SH NAME rand, srand \- simple random-number generator .SH SYNOPSIS .B int rand ( ) .PP .BR "void srand (" "seed" ) .br .BR unsigned " seed" ; .SH DESCRIPTION .I Rand\^ uses a multiplicative congruential random-number generator with period 2\u\s-232\s0\d that returns successive pseudo-random numbers in the range from 0 to 2\u\s-215\s0\d\-1. .PP .I Srand can be called at any time to reset the random-number generator to a random starting point. The generator is initially seeded with a value of 1. .SH NOTE The spectral properties of .I rand\^ leave a great deal to be desired. .IR Drand48 (3C) provides a much better, though more elaborate, random-number generator. .SH SEE ALSO drand48(3C). .\" @(#)rand.3c 1.3 " ified semaphore. .SM \%{ALTER} .PP If .I sem_op is zero, one of the following occurs: .SM \%{READ} .IP If \fIsemval\fP is zero, .I semop returns immediately. .IP If \fIsemval\fP is not equal to zero and .RI ( sem_flg " &" .SM .BR IPC_NOWAIT\*S ) is ``true'', .I semop returns immediately. .IP If \fIsemval\fP is not equal to zero and .RI ( sem_flg " &" .SM .BR IPC_NOWAIT\*S ) is ``false'', .I semop increments the \fIsemzcnt\fP associated with the specified semaphore and suspends execution of the calling process until one of the following occurs: .RS 8 .PP \fISemval\fP becomes zero, at which time the value of \fIsemzcnt\fP associated with the specified semaphore is decremented. .PP The \fIsemid\fP for which the calling process is awaiting action is removed from the system. When this occurs, .I errno is set equal to .SM EIDRM\*S and a value of \-1 is returned. .PP The calling process receives a signal that is to be caught. When this occurs, the value of \fIsemzcnt\fP associated with the specified semaphore is decointers to the key and the element at the base of the table should be of type pointer-to-element and cast to type pointer-to-character. .br The comparison function need not compare every byte, so arbitrary data may be contained in the elements in addition to the values being compared. .br Although declared as type pointer-to-character, the value returned should be cast into type pointer-to-element. .SH "SEE ALSO" bsearch(3C), hsearch(3C), tsearch(3C). .SH BUGS Undefined results can occur if there is not enough room in the table to add a new item. .\" @(#)lsearch.3c 1.5 .TH RAND 3F .SH NAME srand, rand \- FORTRAN uniform random-number generator .SH SYNOPSIS .nf .BR "integer" " i, j" .P .BR "call srand(" i ) .RB "j" " = rand( )" .SH DESCRIPTION .I Srand\^ takes its integer argument as the seed of a random-number generator, the values of which are returned through successive invocations of .IR rand . .SH SEE ALSO rand(3C). .\" @(#)rand.3f 1.4 remented and the calling process resumes execution in the manner prescribed in .IR signal (2). .RE .RE .PP .I Semop fails if one or more of the following are true for any of the semaphore operations specified by .IR sops : .IP .I Semid is not a valid semaphore identifier. .SM \%[EINVAL] .IP .I Sem_num is less than zero or greater than or equal to the number of semaphores in the set associated with .IR semid . .SM \%[EFBIG] .IP .I Nsops is greater than the system imposed maximum. .SM \%[E2BIG] .IP Operation permission is denied to the calling process (see .IR intro (2)). .SM \%[EACCES] .IP The operation would result in suspension of the calling process but .RI ( sem_flg " &" .SM .BR IPC_NOWAIT\*S ) is ``true''. .SM \%[EAGAIN] .IP The limit on the number of individual processes requesting a .SM .B SEM_UNDO would be exceeded. .SM \%[ENOSPC] .IP The number of individual semaphores for which the calling process requests a .SM .B SEM_UNDO would exceed the limit. .SM \%[EINVAL] .IP An operation would cause a \fIsem" .\" @(#)lshift.3f 1.2 .so /usr/man/u_man/man3/bool.3f .\" @(#)real.3f 1.2 .so /usr/man/u_man/man3/ftype.3f val\fP to overflow the system imposed limit. .SM \%[ERANGE] .IP An operation would cause a semadj value to overflow the system imposed limit. .SM \%[ERANGE] .IP .I Sops points to an illegal address. .SM \%[EFAULT] .PP Upon successful completion, the value of \fIsempid\fP for each semaphore specified in the array pointed to by .I sops is set equal to the process .SM ID of the calling process. .SH RETURN VALUE .RI If " semop returns due to the receipt of a signal, a value of \-1 is returned to the calling process and .I errno is set to .SM \%EINTR\*S. If it returns due to the removal of a .I semid from the system, a value of \-1 is returned and .I errno is set to .SM \%EIDRM\*S. .PP Upon successful completion, the value of \fIsemval\fP at the time of the call for the last operation in the array pointed to by .I sops is returned. Otherwise, a value of \-1 is returned and .I errno is set to indicate the error. .SH SEE ALSO intro(2), exec(2), exit(2), fork(2), semctl(2), semget(2). .\" @(#)semop.2 1.5 .\" @(#)ltol3.3c 1.2 .so /usr/man/u_man/man3/l3tol.3c # .\" @(#)realloc.3c 1.2 .so /usr/man/u_man/man3/malloc.3c .\" @(#)setgid.2 1.2 .so /usr/man/u_man/man2/setuid.2 .TH MALLOC 3C .SH NAME malloc, free, realloc, calloc \- main memory allocator .SH SYNOPSIS .nf .BR "char \(**malloc (" size ) .BR unsigned " size" ; .PP .BR "void free (" ptr ) .BR "char \(**" ptr ; .PP .BR "char \(**realloc (" "ptr, size" ) .BR "char \(**" ptr ; .BR unsigned " size" ; .PP .BR "char \(**calloc (" "nelem, elsize" ) .BR unsigned " nelem, elsize" ; .SH DESCRIPTION .I Malloc\^ and .I free\^ provide a simple general-purpose memory allocation package. .I Malloc\^ returns a pointer to a block of at least .I size\^ bytes suitably aligned for any use. .PP The argument to .I free\^ is a pointer to a block previously allocated by .IR malloc ; after .I free\^ is performed this space is made available for further allocation, but its contents are left undisturbed. .PP Undefined results occur if the space assigned by .I malloc\^ is overrun or if some random number is handed to .IR free . .PP .I Malloc\^ allocates the first contiguous reach of free space of sufficient size found in a circular search from th.TH REGCMP 3X .SH NAME regcmp, regex \- compile and execute a regular expression .SH SYNOPSIS .BR "char \(**regcmp(" "string1" " [," " string2" ", .\|.\|.], 0)" .br .BR "char \(**" "string1," " \(**" "string2" ", .\|.\|.;" .PP .BR "char \(**regex(" "re, subject" "[," " ret0" ", .\|.\|.])" .br .BR "char \(**" "re" ", \(**" "subject, "\c .BR "\(**" "ret0" ", .\|.\|.;" .PP .B extern char \(**loc1; .SH DESCRIPTION .I Regcmp\^ compiles a regular expression and returns a pointer to the compiled form. .IR Malloc (3C) is used to create space for the vector. It is the user's responsibility to free unneeded space that has been allocated by \fImalloc\fP. A .SM NULL return from .I regcmp\^ indicates an incorrect argument. .IR Regcmp (1) has been written to generally preclude the need for this routine at execution time. .PP .I Regex\^ executes a compiled pattern against the subject string. Additional arguments are passed to receive values back. .I Regex\^ returns .SM NULL on failure or a pointer to the next unmatched char# .TH SETPGRP 2 .SH NAME setpgrp \- set process group \s-1ID\s+1 .SH SYNOPSIS .B int setpgrp (\|) .SH DESCRIPTION .I Setpgrp\^ sets the process group .SM ID of the calling process to the process .SM ID of the calling process and returns the new process group .SM ID\*S. .SH RETURN VALUE .I Setpgrp\^ returns the value of the new process group .SM ID\*S. .SH SEE ALSO exec(2), fork(2), getpid(2), intro(2), kill(2), signal(2). .\" @(#)setpgrp.2 1.2 e last block allocated or freed; it coalesces adjacent free blocks as it searches. It calls .I sbrk\^ (see .IR brk (2)) to get more memory from the system when there is no suitable space already free. .PP .I Realloc\^ changes the size of the block pointed to by .I ptr\^ to .I size\^ bytes and returns a pointer to the (possibly moved) block. The contents are unchanged up to the lesser of the new and old sizes. If no free block of .I size\^ bytes is available in the storage arena, .I realloc\^ asks .I malloc\^ to enlarge the arena by .I size\^ bytes and then moves the data to the new space. .PP .I Realloc\^ also works if .I ptr\^ points to a block freed since the last call of .IR malloc , .IR realloc , or .IR calloc ; thus sequences of .IR free , .IR malloc , and .I realloc\^ can exploit the search strategy of .I malloc\^ to do storage compaction. .PP .I Calloc\^ allocates space for an array of .I nelem\^ elements of size .IR elsize . The space is initialized to zeros. .PP Each of the allocation routines returacter on success. A global character pointer .I loc1\^ points to where the match began. .I Regcmp\^ and .I regex\^ were mostly borrowed from the editor, .IR ed (1); however, the syntax and semantics have been changed slightly. The following are the valid symbols and their associated meanings. .TP "\w'\fB(.\|.\|.\^)$n\fR\ \ \ 'u" .B [\|]\|*\|.^ These symbols retain their current meaning. .TP .B $ This symbol matches the end of the string; \fB\en\fP matches the new-line character. .TP .B \- Within brackets the minus means ``through''. For example, .B [\^a\-z\^] is equivalent to .BR [\^abcd\|.\|.\|.xyz\^] . The \fB\-\fP can appear as itself only if used as the last or first character. For example, the character class expression .B [\^]\-\^] matches the characters .BR ] \ and\ \- . .TP .B + A regular expression followed by \fB+\fP means ``one or more times''. For example, .B [0\-9]+ is equivalent to .BR [0\-9][0\-9]\(** . .TP .BI { m "} {" m, } .BI { m,u } Integer values enclosed in \fB{\|}\fP indicate the numbe.TH SETUID 2 .SH NAME setuid, setgid \- set user and group \s-1ID\s+1s .SH SYNOPSIS .BR "int setuid (" uid ) .br .BR int " uid" ; .PP .BR "int setgid (" gid ) .br .BR int " gid" ; .SH DESCRIPTION .IR Setuid " (" setgid ) is used to set the real user (group) .SM ID and effective user (group) .SM ID of the calling process. .PP If the effective user .SM ID of the calling process is superuser, the real user (group) .SM ID and effective user (group) .SM ID are set to .IR uid " (" gid ). .PP If the effective user .SM ID of the calling process is not superuser, but its real user (group) .SM ID is equal to .IR uid " (" gid ), the effective user (group) .SM ID is set to .IR uid " (" gid ). .PP .IR Setuid " (" setgid ) fails if the real user (group) .SM ID of the calling process is not equal to .IR uid " (" gid ) and its effective user .SM ID is not superuser. .SM \%[EPERM] .SH RETURN VALUE Upon successful completion, a value of 0 is returned. Otherwise, a value of \-1 is returned and .I errno\^ is set to indicate the$ ns a pointer to space suitably aligned (after possible pointer coercion) for storage of any type of object. .SH DIAGNOSTICS .IR Malloc , .IR realloc , and .I calloc\^ return a .SM NULL pointer if there is no available memory or if the arena has been detectably corrupted by storing outside the bounds of a block. When this happens the block pointed to by .I ptr\^ may be destroyed. .SH NOTE Search time increases when many objects have been allocated; i.e., if a program allocates space but never frees it, each successive allocation takes longer. .\" @(#)malloc.3c 1.5 r of times the preceding regular expression is to be applied. The minimum number is .I m\^ and the maximum number is .IR u , which must be less than 256. If only .I m\^ is present (e.g., \fB{\fIm\fB}\fR), it indicates the exact number of times the regular expression is to be applied. \fB{\fIm\fB,}\fR is analogous to \fB{\fIm,\fBinfinity}\fR. The plus (\fB+\fP) and star (\fB\(**\fP) operations are equivalent to \fB{1,\fP} and \fB{0,}\fP, respectively. .TP .B "( .\|.\|. )$\fIn\^\fP" The value of the enclosed regular expression is to be returned. The value will be stored in the .IR (n+1) th argument following the subject argument. At present, at most 10 enclosed regular expressions are allowed. .I Regex\^ makes its assignments unconditionally. .TP .B "( .\|.\|. )" Parentheses are used for grouping. An operator (e.g., .BR \(** ", " + ", " {\|} ) can work on a single character or a regular expression enclosed in parentheses. For example, \f3(a\(**(cb+)\(**)$0\f1. .PP By necessity, all the above defined symbols are error. .SH "SEE ALSO" getuid(2), intro(2). .\" @(#)setuid.2 1.4 '\" t .TH MATHERR 3M .SH NAME matherr \- error-handling function .SH SYNOPSIS .PP .B #include .PP .BR "int matherr (" x ) .br .BR "struct exception \(**" x ; .SH DESCRIPTION .I Matherr\^ is invoked by functions in the Math Library when errors are detected. Users may define their own procedures for handling errors by including a function named .I matherr\^ in their programs. .I Matherr\^ must be of the form described above. A pointer to the exception structure .I x\^ will be passed to the user-supplied .I matherr\^ function when an error occurs. This structure, which is defined in the .B \^ header file, is as follows: .RS .PP .nf \f3struct exception {\f1 \f3int type;\f1 \f3char \(**name;\f1 \f3double arg1, arg2, retval;\f1 \f3};\f1 .fi .RE .PP The element .I type\^ is an integer describing the type of error that has occurred; one of the following constants (defined in the header file) is used: .RS .PP .nf .ta \w'UNDERFLOW\ \ 'u \f3DOMAIN\f1 domain error \f3SING\f1 singularity \f3OVERFLOW\f1$  special. They must, therefore, be escaped to be used as themselves. .SH EXAMPLES Example 1: .RS .nf \f3char \(**cursor, \(**newcursor, \(**ptr;\f1 \f3\&.\|.\|.\f1 \f3newcursor = regex((ptr = regcmp("^\\n", 0)), cursor);\f1 \f3free(ptr);\f1 .fi .RE .PP This example will match a leading new-line character in the subject string pointed at by cursor. .PP Example 2: .RS .nf \f3char ret0[9];\f1 \f3char \(**newcursor, \(**name;\f1 \f3\&.\|.\|.\f1 \f3name = regcmp("([A\-Za\-z][A\-za\-z0\-9\_]{0,7})$0", 0);\f1 \f3newcursor = regex(name, "123Testing321", ret0);\f1 .fi .RE .PP This example will match through the string ``Testing3'' and will return the address of the character after the last matched character (cursor+11). The string ``Testing3'' will be copied to the character array .IR ret0 . .PP Example 3: .RS .nf \f3#include "file.i"\f1 \f3char \(**string, \(**newcursor;\f1 \f3\&.\|.\|.\f1 \f3newcursor = regex(name, string);\f1 .fi .RE .PP This example applies a precompiled regular expression in .B file.i (see .IR.TH SHMCTL 2 .SH NAME shmctl \- shared memory control operations .SH SYNOPSIS .B #include .br .B #include .br .B #include .PP .nf .BR "int shmctl (" "shmid, cmd, buf" ) .BR int " shmid, cmd" ; .BR "struct shmid_ds \(**" buf ; .fi .SH DESCRIPTION .I Shmctl provides a variety of shared memory control operations as specified by .IR cmd . The following .IR cmd s are available: .RS .TP \w'IPC_RMID\ \ \ 'u .SM .B IPC_STAT Place the current value of each member of the data structure associated with .I shmid into the structure pointed to by .IR buf . The contents of this structure are defined in .IR intro (2). .SM {READ} .TP .SM .B IPC_SET Set the value of the following members of the data structure associated with .I shmid to the corresponding value found in the structure pointed to by .IR buf : .nf .RS \f2shm_perm.uid\f1 \f2shm_perm.gid\f1 \f2shm_perm.mode\f1 /\(** only low 9 bits \(**/ .fi .RE .IP This \fIcmd\fP can only be executed by a process that has an effective user .SM  overflow \f3UNDERFLOW\f1 underflow \f3TLOSS\f1 total loss of significance \f3PLOSS\f1 partial loss of significance .DT .fi .RE .PP The element .I name\^ points to a string containing the name of the function that had the error. The variables .I arg1\^ and .I arg2\^ are the arguments to the function that had the error. .I Retval\^ is a double that is returned by the function having the error. If it supplies a return value, the user's .I matherr\^ must return non-zero. If the default error value is to be returned, the user's .I matherr\^ must return 0. .PP If .I matherr\^ is not supplied by the user, the default error-handling procedures, described with the math functions involved, will be invoked upon error. These procedures are summarized in the table following the example below. In every case, .I errno\^ is set to non-zero and the program continues. .SH EXAMPLE .nf .ta .5i 1.0i 1.5i \f3matherr(x)\f1 \f3register struct exception \(**x;\f1 \f3{\f1 \f3switch (x\->type) {\f1 \f3case DOMAIN:\f1 \f3case SING: regcmp (1)) against .IR string . .PP This routine is kept in .BR /lib/lib\s-1PW\s+1.a . .SH SEE ALSO ed(1), regcmp(1), malloc(3C). .SH BUGS The user program may run out of memory if .I regcmp\^ is called iteratively without freeing the vectors no longer required. The following user-supplied replacement for .IR malloc (3C) reuses the same vector, saving time and space: .PP .RS .nf /\(** \|user's \|program \|\(**/ \f3\&.\|.\|.\f1 \f3malloc(n) {\f1 \f3static int rebuf[256];\f1 \f3return rebuf;\f1 \f3}\f1 .fi .RE .\" @(#)regcmp.3x 1.8 % ID equal to either that of superuser or to the value of .I shm_perm.uid in the data structure associated with .IR shmid . .TP .SM .B IPC_RMID Remove the shared memory identifier specified by .I shmid from the system and destroy the shared memory segment and data structure associated with it. This \fIcmd\fP can only be executed by a process that has an effective user .SM ID equal to either that of superuser or to the value of .I shm_perm.uid in the data structure associated with .IR shmid . .PP .I Shmctl fails if one or more of the following are true: .IP .I Shmid is not a valid shared memory identifier. .SM \%[EINVAL] .IP .I Cmd is not a valid command. .SM \%[EINVAL] .IP .I Cmd is equal to .SM .B IPC_STAT and .SM {READ} operation permission is denied to the calling process (see .IR intro (2)). .SM \%[EACCES] .IP .I Cmd is equal to .SM .B IPC_RMID or .SM .B IPC_SET and the effective user .SM ID of the calling process is not equal to that of superuser and is not equal to the value of .I shm_perm.uid in the data\f1 /\(** print message and abort \(**/ \f3fprintf(stderr, "domain error in %s\en", x\->name);\f1 \f3abort( );\f1 \f3case OVERFLOW:\f1 \f3if (!strcmp("exp", x\->name)) {\f1 /\(** if exp, print message, return the argument \(**/ \f3fprintf(stderr, "exp of %f\en", x\->arg1);\f1 \f3x\->retval = x\->arg1;\f1 \f3} else if (!strcmp("sinh", x\->name)) {\f1 /\(** if sinh, set errno, return 0 \(**/ \f3errno = ERANGE;\f1 \f3x\->retval = 0;\f1 \f3} else\f1 /\(** otherwise, return HUGE \(**/ \f3x\->retval = HUGE;\f1 \f3break;\f1 \f3case UNDERFLOW:\f1 \f3return (0);\f1 /\(** execute default procedure \(**/ \f3case TLOSS:\f1 \f3case PLOSS:\f1 /\(** print message and return 0 \(**/ \f3fprintf(stderr, "loss of significance in %s\en", x\->name);\f1 \f3x\->retval = 0;\f1 \f3break;\f1 \f3}\f1 \f3return (1);\f1 \f3}\f1 .fi .PP .in 0 .TS center box; cB s s s s s s c | cI s s s s s c | c | c | c | c | c | c l | c | c | c | c | c | c . DEFAULT ERROR HANDLING PROCEDURES _ \& Types .\" @(#)regex.3x 1.2 .so /usr/man/u_man/man3/regcmp.3x  structure associated with .IR shmid . .SM \%[EPERM] .IP .I Buf points to an illegal address. .SM \%[EFAULT] .SH "RETURN VALUE" Upon successful completion, a value of 0 is returned. Otherwise, a value of \-1 is returned and .I errno\^ is set to indicate the error. .SH SEE ALSO shmget(2), shmop(2). .\" @(#)shmctl.2 1.5 % of Errors \& \& \& \& \& _ \& DOMAIN SING OVERFLOW UNDERFLOW TLOSS PLOSS _ BESSEL: \- \- H 0 \- \(** y0, y1, yn M, \-H \- \- \- \- \- (neg. no.) _ EXP: \- \- H 0 \- _ POW: \- \- H 0 \- \- (neg.)\(**\(**(non- M, 0 \- \- \- \- \- int.), 0\(**\(**0 _ LOG: log(0): \- M, \-H \- \- \- \- log(neg.): M, \-H \- \- \- \- \- _ SQRT: M, 0 \- \- \- \- \- _ GAMMA: \- M, H \- \- \- \- _ HYPOT: \- \- H \- \- \- _ SINH, COSH: \- \- H \- \- \- _ SIN, COS: \- \- \- \- M, 0 M, \(** _ TAN: \- \- H \- 0 \(** _ ACOS, ASIN: M, 0 \- \- \- \- \- .TE .PP .TS center box; cB s c l . ABBREVIATIONS \(** As much as possible of the value is returned. M Message is printed. H HUGE is returned. \-H \-HUGE is returned. 0 0 is returned. .TE .\" @(#)matherr.3m 1.6 rewind.3sround.3frshift.3fscanf.3sseed48.3csetbuf.3ssetgrent.3csetjmp.3csetkey.3csetpwent.3csetutent.3c.TH SHMGET 2 .SH NAME shmget \- get shared memory segment .SH SYNOPSIS .B #include .br .B #include .br .B #include .PP .nf .BR "int shmget (" "key, size, shmflg" ) .BR key_t " key" ; .BR int " size, shmflg" ; .fi .SH DESCRIPTION .I Shmget returns the shared memory identifier associated with .IR key . .PP A shared memory identifier and associated data structure and shared memory segment of .I size bytes (see .IR intro (2)) are created for .I key if one of the following is true: .IP .I Key is equal to .SM .BR IPC_PRIVATE . .IP .I Key does not already have a shared memory identifier associated with it, and .RI ( shmflg " & " .SM .BR IPC_CREAT\*S ) is ``true''. .PP Upon creation, the data structure associated with the new shared memory identifier is initialized as follows: .IP .IR Shm_perm.cuid ", " shm_perm.uid , .IR shm_perm.cgid ", and " shm_perm.gid are set equal to the effective user .SM ID and effective group .SM ID\*S, respectively, of the calling process. .IP The low-.TH MAX 3F .SH NAME max, max0, amax0, max1, amax1, dmax1 \- FORTRAN maximum-value functions .SH SYNOPSIS .nf .BR "integer" " i, j, k, l" .BR "real" " a, b, c, d" .BR "double precision" " dp1, dp2, dp3" .P .RB "l" " = max(" "i, j, k" ")" .RB "c" " = max(" "a, b" ")" .RB "dp" " = max(" "a, b, c" ")" .RB "k" " = max0(" "i, j" ")" .RB "a" " = amax0(" "i, j, k" ")" .RB "i" " = max1(" "a, b" ")" .RB "d" " = amax1(" "a, b, c" ")" .RB "dp3" " = dmax1(" "dp1, dp2" ")" .SH DESCRIPTION The maximum-value functions return the largest of their arguments; there may be any number of arguments. .I Max\^ is the generic form which can be used for all data types and takes its return type from that of its arguments. All arguments must be of the same type. .I Max0\^ returns the integer form of the maximum value of its integer arguments; .IR amax0 , the real form of its integer arguments; .IR max1 , the integer form of its real arguments; .IR amax1 , the real form of its real arguments; and .IR dmax1 , the double-precision form of& .\" @(#)rewind.3s 1.2 .so /usr/man/u_man/man3/fseek.3s order 9 bits of .I shm_perm.mode are set equal to the low-order 9 bits of .IR shmflg . .I Shm_segsz is set equal to the value of .IR size . .IP .IR Shm_lpid ", " shm_nattch ", .IR shm_atime ", and " shm_dtime " are set equal to 0. .IP .I Shm_ctime is set equal to the current time. .PP .I Shmget fails if one or more of the following are true: .IP .I Size is less than the system imposed minimum or greater than the system imposed maximum. .SM \%[EINVAL] .IP A shared memory identifier exists for .I key but operation permission (see .IR intro (2)), as specified by the low-order 9 bits of .IR shmflg , would not be granted. .SM \%[EACCES] .IP A shared memory identifier exists for .I key but the size of the segment associated with it is less than .I size and .I size is not equal to zero. .SM \%[EINVAL] .IP A shared memory identifier does not exist for .I key and .RI ( shmflg " &" .SM .BR IPC_CREAT\*S ) is ``false''. .SM \%[ENOENT] .IP A shared memory identifier is to be created but the system imposed limit on the ma its double-precision arguments. .SH SEE ALSO min(3F). .\" @(#)max.3f 1.5 .TH ROUND 3F .SH NAME anint, dnint, nint, idnint \- FORTRAN nearest integer functions .SH SYNOPSIS .nf .BR "integer" " i" .BR "real" " r1, r2" .BR "double precision" " dp1, dp2" .P .RB "r2" " = anint(" r1 ) .RB "i" " = nint(" r1 ) .P .RB "dp2" " = anint(" dp1 ) .RB "dp2" " = dnint(" dp1 ) .P .RB "i" " = nint(" dp1 ) .RB "i" " = idnint(" dp1 ) .SH DESCRIPTION .I Anint\^ returns the nearest whole real number to its real argument (i.e., \f3int(a+0.5)\f1 if \f3a \(>= 0\f1; \f3int(a\-0.5)\f1 otherwise). .I Dnint\^ does the same for its double-precision argment. .I Nint\^ returns the nearest integer to its real argument. .I Idnint\^ is the double-precision version. .I Anint\^ is the generic form of .I anint\^ and .IR dnint , performing the same operation and returning the data type of its argument. .I Nint\^ is also the generic form of .I idnint. .\" @(#)round.3f 1.6 & ximum number of allowed shared memory identifiers system-wide would be exceeded. .SM \%[ENOSPC] .IP A shared memory identifier and associated shared memory segment are to be created but the amount of available physical memory is not sufficient to fill the request. .SM \%[ENOMEM] .IP A shared memory identifier exists for .I key but .RI "( (" shmflg " & " .SM .BR IPC_CREAT\*S ) " & " ( .IR shmflg " & " .SM .BR IPC_EXCL\*S ") )" is ``true''. .SM \%[EEXIST] .br .ne 7v .SH "RETURN VALUE" Upon successful completion a non-negative integer, i.e., a shared memory identifier, is returned. Otherwise, a value of \-1 is returned and .I errno\^ is set to indicate the error. .SH SEE ALSO shmctl(2), shmop(2). .\" @(#)shmget.2 1.6 .\" @(#)max0.3f 1.2 .so /usr/man/u_man/man3/max.3f .\" @(#)rshift.3f 1.2 .so /usr/man/u_man/man3/bool.3f .TH SHMOP 2 .SH NAME shmat, shmdt \- shared memory operations .SH SYNOPSIS .B #include .br .B #include .br .B #include .PP .nf .BR "char \(**shmat (" "shmid, shmaddr, shmflg" ) .BR int " shmid" ; .BR "char \(**" shmaddr .BR int " shmflg" ; .PP .BR "int shmdt (" shmaddr ) .BR "char \(**" shmaddr .fi .SH DESCRIPTION .I Shmat attaches the shared memory segment associated with the shared memory identifier specified by .I shmid to the data segment of the calling process. The segment is attached at the address specified by one of the following criteria: .IP If .I shmaddr is equal to zero, the segment is attached at the first available address as selected by the system. .IP If .I shmaddr is not equal to zero and .RI ( shmflg " &" .SM .B SHM_RND\*S) is ``true'', the segment is attached at the address given by .RI ( shmaddr " -" .RI ( shmaddr " modulus" .SM .BR SHMLBA\*S "))." .IP If .I shmaddr is not equal to zero and .RI ( shmflg " &" .SM .B SHM_RND\*S) is ``false'', the segmen' .\" @(#)max1.3f 1.2 .so /usr/man/u_man/man3/max.3f .TH SCANF 3S .SH NAME scanf, fscanf, sscanf \- convert formatted input .SH SYNOPSIS .B #include .PP .BR "int scanf (" "format" " [ ," " pointer" " ] .\|.\|. )" .br .BR "char \(**" format ; .PP .BR "int fscanf (" "stream, format" " [ ," " pointer" " ] .\|.\|. )" .br .BR "\s-1FILE\s+1 \(**" stream ; .br .BR "char \(**" format ; .PP .BR "int sscanf (" "s, format" " [ ," " pointer" " ] .\|.\|. )" .br .BR "char \(**" "s" ", \(**" "format" ";" .SH DESCRIPTION .I Scanf\^ reads from the standard input stream .IR stdin . .I Fscanf\^ reads from the named input .IR stream . .I Sscanf\^ reads from the character string .IR s . Each function reads characters, interprets them according to \fIformat\fP, and stores the results in its arguments. Each function expects two arguments: a control string .I format\^ (described below) and a set of .I pointer\^ arguments indicating where the converted input should be stored. .PP The control string usually contains conversion specifications, which are used to direct interprett is attached at the address given by .IR shmaddr . .PP The segment is attached for reading if .RI ( shmflg " &" .SM .B SHM_RDONLY\*S) is ``true'' .SM \%{READ}\*S; otherwise it is attached for reading and writing .SM \%{READ/WRITE}\*S. .PP .I Shmat fails and does not attach the shared memory segment if one or more of the following are true: .IP .I Shmid is not a valid shared memory identifier. .SM \%[EINVAL] .IP Operation permission is denied to the calling process (see .IR intro (2)). .SM \% [EACCES] .IP The available data space is not large enough to accommodate the shared memory segment. .SM \%[ENOMEM] .IP .I Shmaddr is not equal to zero, and the value of .RI ( shmaddr " -" .RI ( shmaddr " modulus" .SM .BR SHMLBA\*S "))" is an illegal address. .SM \%[EINVAL] .IP .I Shmaddr is not equal to zero, .RI ( shmflg " &" .SM .B SHM_RND\*S) is ``false'', and the value of .I shmaddr is an illegal address. .SM \%[EINVAL] .IP The number of shared memory segments attached to the calling process would exceed the system.TH MCLOCK 3F .SH NAME mclock \- return FORTRAN time accounting .SH SYNOPSIS .BR "integer" " i" .P .RB "i" " = mclock( )" .SH DESCRIPTION .I Mclock\^ returns time accounting information about the current process and its child processes. The value returned is the sum of the current process's user time and the user and system times of all child processes. .SH SEE ALSO times(2), clock(3C), system(3F). .\" @(#)mclock.3f 1.4 ' ation of input sequences. The control string may contain: .PP .PD 0 .TP 3 1. White-space characters (blanks and tabs) which, except in two cases described below, cause input to be read up to the next non-white-space character. .TP 2. An ordinary character (not .BR % ), which must match the next character of the input stream. .TP 3. Conversion specifications, consisting of the character .BR % , an optional assignment suppression character .BR \(** , an optional numerical maximum field width, an optional .BR l or .BR h indicating the size of the receiving variable, and a conversion code. .PD .PP A conversion specification directs the conversion of the next input field; the result is placed in the variable pointed to by the corresponding argument, unless assignment suppression has been indicated by .BR \(** . The suppression of assignment provides a way of describing an input field which is to be skipped. An input field is defined as a string of non-white-space characters; it extends to the next inappropriate ch imposed limit. .SM \%[EMFILE] .PP .I Shmdt detaches from the calling process's data segment the shared memory segment located at the address specified by .IR shmaddr. .PP .I Shmdt fails and does not detach the shared memory segment if .I shmaddr is not the data segment start address of a shared memory segment. .SM \%[EINVAL] .SH RETURN VALUES Upon successful completion, the return value is as follows: .br .ne 8v .IP .I Shmat returns the data segment start address of the attached shared memory segment. .IP .I Shmdt returns a value of 0. .PP Otherwise, a value of \-1 is returned and .I errno is set to indicate the error. .SH SEE ALSO exec(2), exit(2), fork(2), shmctl(2), shmget(2). .\" @(#)shmop.2 1.5 .\" @(#)memccpy.3c 1.2 .so /usr/man/u_man/man3/memory.3c aracter or until the field width, if specified, is exhausted. .PP The conversion code indicates the interpretation of the input field; the corresponding pointer argument must usually be of a restricted type. For a suppressed field, no pointer argument should be given. The following conversion codes are legal: .PP .PD 0 .TP .B % A single .B % is expected in the input at this point; no assignment is done. .TP .B d A decimal integer is expected; the corresponding argument should be an integer pointer. .TP .B u An unsigned decimal integer is expected; the corresponding argument should be an unsigned integer pointer. .TP .B o An octal integer is expected; the corresponding argument should be an integer pointer. .TP .B x A hexadecimal integer is expected; the corresponding argument should be an integer pointer. .TP \f3e\fP,\f3f\fP,\f3g\fP A floating point number is expected; the next field is converted accordingly and stored through the corresponding argument, which should be a pointer to a .IR float . The input fo( .TH SIGNAL 2 .SH NAME signal \- specify what to do upon receipt of a signal .SH SYNOPSIS .B #include .PP .BR "int (\(**signal (" "sig, func" ))(\|) .br .BR int " sig" ; .br .BR "int (\(**" func )(\|); .SH DESCRIPTION .I Signal\^ allows the calling process to choose one of three ways in which it is possible to handle the receipt of a specific signal. .I Sig\^ specifies the signal and .I func\^ specifies the choice. .PP .I Sig\^ can be assigned any one of the following except .BR \s-1SIGKILL\s+1 : .PP .DS .TS l l l. \fB\s-1SIGHUP\s+1\fR 01 hangup \fB\s-1SIGINT\s+1\fR 02 interrupt \fB\s-1SIGQUIT\s+1\fR 03* quit \fB\s-1SIGILL\s+1\fR 04* illegal instruction (not reset when caught) \fB\s-1SIGTRAP\s+1\fR 05* trace trap (not reset when caught) \fB\s-1SIGIOT\s+1\fR 06* \s-1IOT\s+1 instruction \fB\s-1SIGEMT\s+1\fR 07* \s-1EMT\s+1 instruction \fB\s-1SIGFPE\s+1\fR 08* floating point exception \fB\s-1SIGKILL\s+1\fR 09 kill (cannot be caught or ignored) \fB\s-1SIGBUS\s+1\fR 10* bus error \fB\s-1SIGSEGV\s+1\.\" @(#)memchr.3c 1.2 .so /usr/man/u_man/man3/memory.3c rmat for floating point numbers is an optionally signed string of digits, possibly containing a decimal point, followed by an optional exponent field consisting of an .B E or an .BR e , followed by an optionally signed integer. .TP .B s A character string is expected; the corresponding argument should be a character pointer to an array of characters large enough to accept the string and a terminating .BR \e0 , which will be added automatically. The input field is terminated by a white-space character. .TP .B c A character is expected; the corresponding argument should be a character pointer. The normal skip over white space is suppressed in this case; to read the next non-space character, use .BR %1s . If a field width is given, the corresponding argument should refer to a character array; the indicated number of characters is read. .TP .B [ String data and the normal skip over leading white space is suppressed. The left bracket is followed by a set of characters (the .IR scanset ) and a right bracket; the ifR 11* segmentation violation \fB\s-1SIGSYS\s+1\fR 12* bad argument to system call \fB\s-1SIGPIPE\s+1\fR 13 write on a pipe with no one to read it \fB\s-1SIGALRM\s+1\fR 14 alarm clock \fB\s-1SIGTERM\s+1\fR 15 software termination signal \fB\s-1SIGUSR1\s+1\fR 16 user defined signal 1 \fB\s-1SIGUSR2\s+1\fR 17 user defined signal 2 \fB\s-1SIGCLD\s+1\fR 18 death of a child (see \fIWARNING\fR below) \fB\s-1SIGPWR\s+1\fR 19 power fail (see \fIWARNING\fR below) .TE .PP See below for the significance of the asterisk .RB ( \(** ) in the above list. .PP .I Func\^ is assigned one of three values: .BR \s-1SIG\(ruDFL\s+1 , .BR \s-1SIG\(ruIGN\s+1 , or a .IR "function address" . The actions prescribed by these values are as follows: .RS 2 .PP .SM .B SIG\(ruDFL \&\- terminate process upon receipt of a signal .RS 8 Upon receipt of the signal .IR sig , the receiving process is to be terminated with all of the consequences outlined in .IR exit (2); a ``core image'' is made in the current working directory of the receiving pro( .\" @(#)memcmp.3c 1.2 .so /usr/man/u_man/man3/memory.3c nput field is the maximal sequence of input characters consisting entirely of characters in the \fIscanset\fP. The circumflex, .RB ( \|^\| ), when it appears as the first character in the \fIscanset\fP, serves as a complement operator and redefines the \fIscanset\fP as the set of all characters .IR not contained in the remainder of the \fIscanset\fP string. There are some conventions used in the construction of the \fIscanset\fP. A range of characters may be represented by the construct .IR first-last ; thus, \fB[0123456789]\fP may be expressed \fB[0-9]\fP. Using this convention, .IR first must be lexically less than or equal to .IR last , or else the dash will stand for itself. The dash will also stand for itself whenever it is the first or the last character in the \fIscanset\fP. To include the right square bracket as an element of the \fIscanset\fP, it must appear as the first character (possibly preceded by a circumflex) of the \fIscanset\fP; otherwise it will be interpreted syntactically as the closingcess if .I sig\^ is one for which an asterisk appears in the above list and the following conditions are met: .RS 8 .PP The effective user .SM ID and the real user .SM ID of the receiving process are equal. .PP An ordinary file named .B core exists and is writable or can be created. If the file must be created, it will have the following properties: .RS 8 .PP a mode of 0666 modified by the file creation mask .RI (see " umask" (2)) .PP a file owner .SM ID that is the same as the effective user .SM ID of the receiving process .PP a file group .SM ID that is the same as the effective group .SM ID of the receiving process .RE .RE .RE .RE .PP .SM .B SIG\(ruIGN \&\- ignore signal .RS 8 The signal .I sig\^ is to be ignored. .PP Note: the signal .B .SM SIGKILL cannot be ignored. .RE .PP .I function address\^ \&\- catch signal .RS 8 Upon receipt of the signal .IR sig , the receiving process is to execute the signal-catching function pointed to by .IR func . The signal number .I sig\^ is passed as the first argume.\" @(#)memcpy.3c 1.2 .so /usr/man/u_man/man3/memory.3c )  bracket. The corresponding argument must point to a character array large enough to hold the data field and the terminating .BR \e0 , which will be added automatically. .PD .PP The conversion characters .BR d , .BR u , .BR o , and .B x may be preceded by .B l or .B h to indicate that a pointer to .B long or .BR short , rather than .BR int , is in the argument list. Similarly, the conversion characters .BR e , .BR f , and .B g may be preceded by .B l to indicate that a pointer to .BR double , rather than .BR float , is in the argument list. .PP .I Scanf\^ conversion terminates at .SM .BR EOF , at the end of the control string, or when an input character conflicts with the control string. In the latter case, the offending character is left unread in the input stream. .PP .I Scanf\^ returns the number of successfully matched and assigned input items; this number can be zero when an early conflict between an input character and the control string occurs. If the input ends before the first conflict or conversionnt to the signal-catching function. A second argument, \fIsig\(rucode\fP, is also passed to the function. \fISig\(rucode\fP has various contents, according to the value of \fIsig\fP. These values are provided in the table below. Before entering the signal-catching function, the value of .I func\^ for the caught signal is set to .SM .B SIG\(ruDFL unless the signal is .SM .BR SIGILL , .SM .BR SIGTRAP ", or" .SM .BR SIGPWR . .PP Upon return from the signal-catching function, the receiving process resumes execution at the point it was interrupted. See the WARNINGS section below. .PP When a signal that is to be caught occurs during a \fIread\fP(2), \fIwrite\fP(2), \fIopen\fP(2), or \fIioctl\fP(2) system call on a slow device (like a terminal; but not a file), during a .IR pause (2) system call, or during a .IR wait (2) system call that does not return immediately due to the existence of a previously stopped or zombie process, the signal catching function is executed; then the interrupted system call returns a.TH MEMORY 3C .SH NAME memccpy, memchr, memcmp, memcpy, memset \- memory operations .SH SYNOPSIS .nf .B #include .PP .BR "char \(**memccpy (" "s1, s2, c, n" ) .BR "char \(**" "s1, " "\(**" s2 ; .BR int " c, n" ; .PP .BR "char \(**memchr (" "s, c, n" ) .BR "char \(**" s ; .BR "int" " c, n" ; .PP .BR "int memcmp (" "s1, s2, n" ) .BR "char \(**" s1, " \(**" s2 ; .BR int " n" ; .PP .BR "char \(**memcpy (" "s1, s2, n" ) .BR "char \(**" s1, " \(**" s2 ; .BR int " n" ; .PP .BR "char \(**memset (" "s, c, n" ) .BR "char \(**" s ; .BR int " c, n" ; .fi .SH DESCRIPTION These functions operate efficiently on memory areas (arrays of characters bounded by a count, not terminated by a null character). They do not check for the overflow of any receiving memory area. .PP .I Memccpy\^ copies characters from memory area .I s2\^ into .IR s1 , stopping after the first occurrence of character .I c\^ has been copied or after .I n\^ characters have been copied, whichever comes first. It returns either a pointer to the cha, .SM .B EOF is returned. .SH EXAMPLES The call .PP .RS .B "int \|i; \|float \|x; \|char \|name[50];" .br .B scanf \|("%d%f%s", \|&i, \|&x, \|name); .RE .PP with the input line .PP .RS .B "25 \|54.32E\(mi1 \|thompson" .RE .PP will assign the value .B 25 to .IR i , and the value .B 5.432 to .IR x ; .I name\^ will contain .BR thompson\e0 . .sp The call .PP .RS .B "int \|i; \|float \|x; \|char \|name[50];" .br .B scanf \|("%2d%f%\(**d %[0-9]", \|&i, \|&x, \|name); .RE .PP with input .PP .RS .B "56789 \|0123 \|56a72" .RE .PP will assign .B 56 to .IR i , .B 789.0 to .IR x , skip .BR 0123 , and place the string .B 56\e0 in .IR name . The next call to .I getchar\^ (see .IR getc (3S)) will return .BR a . .SH SEE ALSO atof(3C), getc(3S), printf(3S), strtol(3C). .SH NOTE Trailing white space is left unread unless matched in the control string. .SH DIAGNOSTICS These functions return .SM .B EOF on end of input and a short count for missing or illegal data items. .SH BUGS The success of literal matches and suppressed assi)  \-1 to the calling process with .I errno\^ set to .SM EINTR\*S. .PP Note: the signal .B .SM SIGKILL cannot be caught. .RE .RE .PP A call to .I signal\^ cancels a pending signal .I sig\^ except for a pending .B \s-1SIGKILL\s+1 signal. .PP .I Signal\^ fails if one or more of the following are true: .IP .I Sig\^ is an illegal signal number, including .SM .BR SIGKILL . .SM \%[EINVAL] .IP .I Func\^ points to an illegal address. .SM \%[EFAULT] .PP The table below shows how \*(5) handles M68000 traps. Most traps result in signals being sent to the user process that caused the trap. All other traps are considered to be STRAYFT, spurious interrupts. .PP The following meanings apply to information in the "SIGNAL CODE" column of the table: .IP code \=\= address means the address causing the fault .IP code \=\= pc means the program counter value at the time of the trap .IP code \=\= (%d0) means the user parameter to the TRAP instruction .sp .in The definitions of KINTDIV, KINTOVF, and KSUBRNG are provided in the includracter after the copy of .I c\^ in .I s1\^ or a .SM NULL pointer if .I c\^ was not found in the first .I n\^ characters of .IR s2 . .PP .PP .I Memchr\^ returns either a pointer to the first occurrence of character .I c\^ in the first .I n\^ characters of memory area .I s or a .SM NULL pointer if .I c\^ does not occur. .PP .I Memcmp\^ compares its arguments, looking at the first .I n\^ characters only. It returns an integer less than, equal to, or greater than 0, depending on whether .I s1\^ is lexicographically less than, equal to, or greater than .IR s2 . .PP .I Memcpy\^ copies .I n\^ characters from memory area .I s2\^ to .IR s1 . It returns .IR s1 . .PP .I Memset\^ sets the first .I n\^ characters in memory area .I s\^ to the value of character .IR c . It returns .I s . .SH NOTE For user convenience, all these functions are declared in the optional .B header file. .SH BUGS .I Memcmp\^ uses native character comparison, which is signed on .SM PDP\*S-11s, unsigned on other machines. .PP Because cgnments is not directly determinable. .\" @(#)scanf.3s 1.5 e file \f3\f1. .DS .TS box center; l c l l l l c l l l l2 c2 l2 l2 l2. TRAP TRAP \& \& SIGNAL TYPE NO. ASSIGNMENT SIGNAL CODE = BUSERR 2 bus error SIGBUS address ADDRERR 3 address error SIGILL address INSTERR 4 illegal instruction SIGILL pc ZDVDERR 5 zero divide fault SIGFPE KINTDIV CHKTRAP 6 CHK instruction fault SIGFPE KSUBRNG TRAPVFT 7 TRAPV instruction fault SIGFPE KINTOVF PRIVFLT 8 T{ .nf privileged instruction fault .fi T} SIGILL pc TRCTRAP 9 trace trap SIGTRAP pc L1010FT 10 line 1010 emulator SIGILL pc L1111FT 11 line 1111 emulator SIGILL pc STRAYFT 24 spurious interrupt n/a n/a SYSCALL 32 TRAP 0 \- system call n/a (%d0) BPTFLT 33 TRAP 1 \- breakpoint SIGTRAP pc IOTTRAP 34 T{ .nf TRAP 2 \- simulate DEC IOT instruction .fi T} SIGIOT (%d0) EMTTRAP 35 T{ .nf TRAP 3 \- simulate DEC EMT instruction .fi T} SIGEMT (%d0) FPETRAP 36 T{ TRAP 4 \- floating point exception T} SIGFPE (%d0) .TE .DE .PD .PP .SH RETURN VALUE Upon successful completion, .I signal\^ returns the previous value of .I func\* haracter movement is performed differently in different implementations, overlapping moves may yield unexpected results. .\" @(#)memory.3c 1.6 .\" @(#)seed48.3c 1.2 .so /usr/man/u_man/man3/drand48.3c ^ for the specified signal .IR sig . Otherwise, a value of \-1 is returned and .I errno\^ is set to indicate the error. .SH SEE ALSO kill(1), kill(2), pause(2), ptrace(2), wait(2), setjmp(3C). .SH WARNINGS Two other signals that behave differently than the signals described above exist in this release of the system. They are: .PP .RS 8 .nf .ta \w'SIGMMMM 'u +\w'15\(** 'u .BR \s-1SIGCLD\s+1 " 18 death of a child (reset when caught)" .BR \s-1SIGPWR\s+1 " 19 power fail (not reset when caught)" .fi .RE .PP There is no guarantee that, in future releases of the .SM UNIX System, these signals will continue to behave as described below; they are included only for compatibility with other versions of the .SM UNIX System. Their use in new programs is strongly discouraged. .PP For these signals, .I func\^ is assigned one of three values: .BR \s-1SIG\(ruDFL\s+1 , .BR \s-1SIG\(ruIGN\s+1 , or a .IR "function address" . The actions prescribed by these values are as follows: .RS 2 .PP .SM .B SIG\(ruDFL - ignore signal .R.\" @(#)memset.3c 1.2 .so /usr/man/u_man/man3/memory.3c * .TH SETBUF 3S .SH NAME setbuf \- assign buffering to a stream .SH SYNOPSIS .B #include .PP .BR "void setbuf (" "stream, buf" ) .br .BR "\s-1FILE\s+1 \(**" stream ; .br .BR "char \(**" buf ; .SH DESCRIPTION .I Setbuf\^ is used after a stream has been opened but before it is read or written. It causes the character array pointed to by .I buf\^ to be used instead of an automatically allocated buffer. If .I buf\^ is a .SM NULL character pointer, input/output will be completely unbuffered. .PP A constant .SM .BR BUFSIZ , defined in the .B header file, tells how big an array is needed: .PP .RS .B "char buf [\s-1BUFSIZ\s0];" .RE .PP A buffer is normally obtained from .IR malloc (3C) at the time of the first .IR getc (3S) or .IR putc (3S) on the file, except that the standard error stream .I stderr\^ is normally not buffered. .PP Output streams directed to terminals are always line-buffered unless they are unbuffered. .SH "SEE ALSO" fopen(3S), getc(3S), malloc(3C), putc(3S). .SH NOTE A common soS 8 The signal is to be ignored. .RE .PP .SM .B SIG\(ruIGN - ignore signal .RS 8 The signal is to be ignored. If .I sig\^ is .SM .BR SIGCLD , the calling process's child processes do not create zombie processes when they terminate; see .IR exit (2). .RE .PP .I function address\^ - catch signal .RS 8 If the signal is .SM .BR SIGPWR , the action to be taken is the same as that described above for .I func\^ equal to .IR "function address" . The same is true if the signal is .SM .BR SIGCLD , except that, while the process is executing the signal-catching function, any received .SM .B SIGCLD signals are queued and the signal-catching function is continually reentered until the queue is empty. .RE .PP The .SM .B SIGCLD affects two other system calls .RI ( wait "(2) and " exit (2)) in the following ways: .TP 8 .I wait\^ If the .I func\^ value of .SM .B SIGCLD is set to .SM .B SIG\(ruIGN and a .I wait\^ is executed, the .I wait\^ blocks until all of the calling process's child processes terminate; it then returns a .TH MIN 3F .SH NAME min, min0, amin0, min1, amin1, dmin1 \- FORTRAN minimum-value functions .SH SYNOPSIS .nf .BR "integer" " i, j, k, l" .BR "real" " a, b, c, d" .BR "double precision" " dp1, dp2, dp3" .P .RB "l" " = min(" "i, j, k" ")" .RB "c" " = min(" "a, b" ")" .RB "dp" " = min(" "a, b, c" ")" .RB "k" " = min0(" "i, j" ")" .RB "a" " = amin0(" "i, j, k" ")" .RB "i" " = min1(" "a, b" ")" .RB "d" " = amin1(" "a, b, c" ")" .RB "dp3" " = dmin1(" "dp1, dp2" ")" .SH DESCRIPTION The minimum-value functions return the minimum of their arguments. There may be any number of arguments. .I Min\^ is the generic form which can be used for all data types. It takes its return type from that of its arguments, which must all be of the same type. .I Min0\^ returns the integer form of the minimum value of its integer arguments; .IR amin0 , the real form of its integer arguments; .IR min1 , the integer form of its real arguments; .IR amin1 , the real form of its real arguments; and .IR dmin1 , the double-precision form of iturce of error is allocating buffer space as an ``automatic'' variable in a code block and then failing to close the stream in the same block. .\" @(#)setbuf.3s 1.5 + value of \-1 with .I errno\^ set to .SM ECHILD. .TP 8 .I exit\^ If in the exiting process's parent process the .I func\^ value of .SM .B SIGCLD is set to .SM .BR SIG\(ruIGN , the exiting process does not create a zombie process. .PP When processing a pipeline, the shell makes the last process in the pipeline the parent of the preceding processes. A process that may be piped into in this manner (and thus become the parent of other processes) should take care not to set .SM .B SIGCLD to be caught. .sp The ability to resume execution upon return from the signal-catching function is machine-dependent. For the M68000, resumption cannot occur after faults requiring instruction recovery. These faults are bus errors and address errors. .\" @(#)signal.2 1.10 s double-precision arguments. .SH SEE ALSO max(3F). .\" @(#)min.3f 1.5 .\" @(#)setgrent.3c 1.2 .so /usr/man/u_man/man3/getgrent.3c .TH STAT 2 .SH NAME stat, fstat \- get file status .SH SYNOPSIS .B #include .br .B #include .PP .BR "int stat (" "path, buf" ) .br .BR "char \(**" path ; .br .BR "struct stat \(**" buf ; .PP .BR "int fstat (" "fildes, buf" ) .br .BR int " fildes" ; .br .BR "struct stat \(**" buf ; .SH DESCRIPTION .I Path\^ points to a pathname naming a file. Read, write or execute permission of the named file is not required, but all directories listed in the pathname leading to the file must be searchable. .I Stat\^ obtains information about the named file. .PP Similarly, .I fstat\^ obtains information about an open file known by the file descriptor .IR fildes , obtained from a successful .IR open (2), .IR creat (2), .IR dup (2), .IR fcntl (2), or .IR pipe (2) system call. .PP .I Buf\^ is a pointer to a .I stat\^ structure into which information is placed concerning the file. .PP The contents of the structure pointed to by .I buf\^ include the following members: .sp .RS .ta 8n 18n \f3ushort \f2st_m+ .\" @(#)min0.3f 1.2 .so /usr/man/u_man/man3/min.3f .TH SETJMP 3C .SH NAME setjmp, longjmp \- non-local goto .SH SYNOPSIS .nf .B #include .PP .BR "int setjmp (" env ) .BR "jmp_buf" " env" ; .PP .BR "void longjmp (" "env, val" ) .BR jmp_buf " env" ; .BR int " val" ; .SH DESCRIPTION These functions are useful for dealing with errors and interrupts encountered in a low-level subroutine of a program. .PP .I Setjmp\^ saves its stack environment in .I env\^ for later use by .IR longjmp . The environment type .I jmp_buf is defined in the .B \^ header file. .I Setjmp\^ returns the value 0. .PP .I Longjmp\^ restores the environment saved by the last call of .I setjmp with the corresponding .I env argument. After .I longjmp\^ is completed, program execution continues as if the corresponding call of .I setjmp\^ (which must not itself have returned in the interim) had just returned the value .IR val\^ . .I Longjmp\^ cannot cause .I setjmp\^ to return the value 0. If .I longjmp\^ is invoked with a second argument of 0, .I setjmp\^ will return 1. Allode\f3;\f1 /\(** File mode; see .IR mknod (2) \(**/ .br \f3ino_t\f2 st_ino\f3;\f1 /\(** Inode number \(**/ .br \f3dev_t\f2 st_dev\f3;\f1 /\(** .SM ID of device containing \(**/ .br /\(** a directory entry for this file \(**/ .br \f3dev_t\f2 st_rdev\f3;\f1 /\(** .SM ID of device \(**/ .br /\(** This entry is defined only for \(**/ .br /\(** character special or block \(**/ .br /\(** special files \(**/ .br \f3short\f2 st_nlink\f3;\f1 /\(** Number of links \(**/ .br \f3ushort\f2 st_uid\f3;\f1 /\(** User .SM ID of the file's owner \(**/ .br \f3ushort\f2 st_gid\f3;\f1 /\(** Group .SM ID of the file's group \(**/ .br \f3off_t\f2 st_size\f3;\f1 /\(** File size in bytes \(**/ .br \f3time_t\f2 st_atime\f3;\f1 /\(** Time of last access \(**/ .br \f3time_t\f2 st_mtime\f3;\f1 /\(** Time of last data modification \(**/ .br \f3time_t\f2 st_ctime\f3;\f1 /\(** Time of last file status change \(**/ .br /\(** Times measured in seconds since \(**/ .br /\(** 00:00:00 .SM GMT\*S, Jan. 1, 1970 \(**/ .RE .DT .PP \fISt.\" @(#)min1.3f 1.2 .so /usr/man/u_man/man3/min.3f ,  accessible data have values as of the time .I longjmp\^ was called. .SH SEE ALSO signal(2). .SH WARNING .I Longjmp\^ fails if it is called when .I env\^ was never primed by a call to .I setjmp\^ or when the last such call is in a function which has since returned. .\" @(#)setjmp.3c 1.7 _atime\fP, \fIst_mtime\fP, and \fIst_ctime\fP are changed by system calls as stated below. .sp .TP 10 .I st_atime Time when file data was last accessed. Changed by the following system calls: .IR creat (2), .IR mknod (2), .IR pipe (2), .IR utime (2), and .IR read (2). .TP 10 .I st_mtime Time when data was last modified. Changed by the following system calls: .IR creat (2), .IR mknod (2), .IR pipe (2), .IR utime (2), and .IR write (2). .TP 10 .I st_ctime Time when file status was last changed. Changed by the following system calls: .IR chmod (2), .IR chown (2), .IR creat (2), .IR link (2), .IR mknod (2), .IR pipe (2), .IR unlink (2), .IR utime (2), and .IR write (2). .PP .I Stat\^ fails if one or more of the following are true: .IP A component of the path prefix is not a directory. .SM \%[ENOTDIR] .IP The named file does not exist. .SM \%[ENOENT] .IP Search permission is denied for a component of the path prefix. .SM \%[EACCES] .IP .I Buf\^ or .I path\^ points to an invalid address. .SM \%[EFAULT] .PP .I Fstat.TH MKTEMP 3C .SH NAME mktemp \- make a unique filename .SH SYNOPSIS .BR "char \(**mktemp (" template ) .br .BR "char \(**" template ; .SH DESCRIPTION .I Mktemp\^ replaces the contents of the string pointed to by .I template\^ with a unique filename; it returns the address of .IR template . The string in .I template\^ should look like a filename with six trailing .BR X s; .I mktemp\^ replaces the .BR X s with a letter and the current process \s-1ID\s0. The letter is chosen so that the resulting name does not duplicate an existing file. .SH SEE ALSO getpid(2), tmpfile(3S), tmpnam(3S). .SH BUGS It is possible to run out of letters. .\" @(#)mktemp.3c 1.4 .\" @(#)setkey.3c 1.2 .so /usr/man/u_man/man3/crypt.3c , \^ fails if one or more of the following are true: .IP .I Fildes\^ is not a valid open file descriptor. .SM \%[EBADF] .IP .I Buf\^ points to an invalid address. .SM \%[EFAULT] .SH "RETURN VALUE" Upon successful completion a value of 0 is returned. Otherwise, a value of \-1 is returned and .I errno\^ is set to indicate the error. .SH "SEE ALSO" chmod(2), chown(2), creat(2), link(2), mknod(2), time(2), unlink(2). .\" @(#)stat.2 1.5 .TH MOD 3F .SH NAME mod, amod, dmod \- FORTRAN remaindering intrinsic functions .SH SYNOPSIS .nf .BR "integer" " i, j, k" .BR "real" " r1, r2, r3" .BR "double precision" " dp1, dp2, dp3" .P .RB "k" " = mod(" "i, j" ")" .P .RB "r3" " = amod(" "r1, r2" ")" .RB "r3" " = mod(" "r1, r2" ")" .P .RB "dp3" " = dmod(" "dp1, dp2" ")" .RB "dp3" " = mod(" "dp1, dp2" ")" .SH DESCRIPTION .I Mod\^ returns the integer remainder of its first argument divided by its second argument. .I Amod\^ and .I dmod\^ return, respectively, the real and double-precision whole number remainder of the integer division of their two arguments. The generic version .I mod\^ returns the data type of its arguments. .\" @(#)mod.3f 1.5 .\" @(#)setpwent.3c 1.2 .so /usr/man/u_man/man3/getpwent.3c .TH STIME 2 .SH NAME stime \- set time .SH SYNOPSIS .BR "int stime (" tp ) .br .BR "long \(**" tp ; .SH DESCRIPTION .I Stime\^ sets the system's idea of the time and date. .I Tp\^ points to the value of time as measured in seconds from 00:00:00 \s-1GMT\s0 January 1, 1970. .PP .I Stime\^ fails if the effective user .SM ID of the calling process is not superuser. .SM \%[EPERM] .SH RETURN VALUE Upon successful completion, a value of 0 is returned. Otherwise, a value of \-1 is returned and .I errno\^ is set to indicate the error. .SH "SEE ALSO" time(2). .\" @(#)stime.2 1.4 - .\" @(#)modf.3c 1.2 .so /usr/man/u_man/man3/frexp.3c .\" @(#)setutent.3c 1.2 .so /usr/man/u_man/man3/getut.3c sync.2sys3b.2time.2times.2ulimit.2umask.2umount.2uname.2unlink.2ustat.2utime.2wait.2write.2.TH MONITOR 3C .SH NAME monitor \- prepare execution profile .SH SYNOPSIS .nf .BR "void monitor (" "lowpc, highpc, buffer, bufsize, nfunc" ")" .BR "int (\(**" lowpc ")( ), (\(**" highpc ")( );" .BR "short \(**" buffer ; .BR int " bufsize, nfunc" ; .SH DESCRIPTION An executable program created by .B cc \-p automatically includes calls for .I monitor\^ with default parameters; .I monitor\^ needn't be called explicitly except to gain fine control over profiling. .PP .I Monitor\^ is an interface to .IR profil (2). .I Lowpc\^ and .I highpc\^ are the addresses of two functions; .I buffer\^ is the address of a (user supplied) array of .I bufsize\^ short integers. .I Monitor\^ arranges to record a histogram in the buffer. This histogram shows periodically sampled values of the program counter and counts of calls of certain functions. The lowest address sampled is that of .IR lowpc ; the highest address is just below .IR highpc . .I Lowpc\^ may not equal 0 for this use of .IR monitor . .I Nfunc\^ is the maximum numbe-  a valid message queue identifier. .SM \%[EINVAL] .IP Operation permission is denied to the calling process. .SM \%[EACCES] .IP .I Msgsz is less than 0. .SM \%[EINVAL] .IP .I Mtext\^ is greater than .I msgsz and .RI ( msgflg " &" .SM .BR MSG_NOERROR\*S ) is ``false''. .SM \%[E2BIG] .IP The queue does not contain a message of the desired type and .RI ( msgtyp " & " .SM .BR IPC_NOWAIT\*S ) is ``true''. .SM \%[ENOMSG] .IP .I Msgp points to an illegal address. .SM \%[EFAULT] .PP Upon successful completion, the following actions are taken with respect to the data structure associated with .IR msqid (see intro (2)). .IP .I Msg_qnum is decremented by 1. .IP .I Msg_lrpid is set equal to the process .SM ID of the calling process. .IP .I Msg_rtime is set equal to the current time. .SH RETURN VALUES .RI If " msgsnd " or " msgrcv" returns due to the receipt of a signal, a value of \-1 is returned to the calling process and .I errno is set to .SM \%EINTR\*S. If they return due to removal of .I msqid from the system, a val.TH SYNC 2 .SH NAME sync \- update super-block .SH SYNOPSIS .B void sync ( ) .SH DESCRIPTION .I Sync\^ causes all information in memory that should be on disk to be written out. This includes modified super-blocks, modified inodes, and delayed block I/O. .PP It should be used by programs which examine a file system, for example .IR fsck "(1M) and" .IR df (1M). It is mandatory before a boot. .PP The writing, although scheduled, is not necessarily complete upon return from .IR sync . .SH "SEE ALSO" .IR "\*(6) Administrator's Manual" . .\" @(#)sync.2 1.4 r of call counts that can be kept; only calls of functions compiled with the profiling option .B \-p of .IR cc (1) are recorded. (The C Library and Math Library supplied when .B cc -p is used also have call counts recorded.) For the results to be significant, especially where there are small, heavily used routines, it is suggested that the buffer be no more than a few times smaller than the range of locations sampled. .PP To profile the entire program, it is sufficient to use .PP \f3extern etext;\f1 .br \f3...\f1 .br \f3monitor ((int (\(**)())2, etext, buf, bufsize, nfunc);\f1 .PP .I Etext\^ lies just above all the program text; see .IR end (3C). .PP To stop execution monitoring and write the results on the file .BR mon.out , use .PP \f3monitor ((int (\(**)())NULL, 0, 0, 0, 0);\f1 .PP .IR Prof (1) can then be used to examine the results. .SH FILES mon.out .SH SEE ALSO cc(1), prof(1), profil(2), end(3C). .\" @(#)monitor.3c 1.5 ue of \-1 is returned and .I errno is set to .SM \%EIDRM\*S. .PP Upon successful completion, the return value is as follows: .IP .I Msgsnd returns a value of 0. .IP .I Msgrcv returns a value equal to the number of bytes actually placed into .IR mtext . .PP Otherwise, a value of \-1 is returned and .I errno is set to indicate the error. .SH SEE ALSO msgctl(2), msgget(2). .\" @(#)msgop.2 1.7 . 2}zwtq.\" @(#)mrand48.3c 1.2 .so /usr/man/u_man/man3/drand48.3c .TH NICE 2 .SH NAME nice \- change priority of a process .SH SYNOPSIS .BR "int nice (" "incr" ) .br .BR int " incr" ; .SH DESCRIPTION .I Nice\^ adds the value of .I incr\^ to the nice value of the calling process. A process's .I nice value\^ is a positive number for which a more positive value results in lower .SM CPU priority. .PP A maximum nice value of 39 and a minimum nice value of 0 are imposed by the system. Requests for values above or below these limits result in the nice value being set to the corresponding limit. .PP .I Nice\^ fails and does not change the nice value if .I incr\^ is negative and the effective user .SM ID of the calling process is not superuser. .SM \%[EPERM] .SH RETURN VALUE Upon successful completion, .I nice\^ returns the new nice value minus 20. Otherwise, a value of \-1 is returned and .I errno\^ is set to indicate the error. .SH SEE ALSO nice(1), exec(2). .\" @(#)nice.2 1.4 +1). .I Arg1 is used as a pointer to a 16 byte string to be converted to a \s-1PRM\s+1 and transmitted to the Emergency Action Interface (\s-1EAI\s+1). .TP 5 .B 7 Modify the System Status Register (\s-1SSR\s+1). Bits set in .I arg1 are set or cleared in the \s-1SSR\s+1 if .I arg2 is non-zero or zero, respectively. .TP 5 .B 8 Read \s-1EAI\s+1 Input Parameter Buffer. .I Arg1 is used as a location in user space where the current Input Parameter Buffer is to be placed. .TP 5 .B 9 Change default Field Test Set utility-id. .B 10 Change the floating point flag bits in the extended processor status word. .SH SEE ALSO fts(1M), ipb(1M), prm(1M), reboot(1M), setmrf(1M), ssr(1M), in the .IR "U\s-1NIX\s+1 System Administrator's Manual" . .\" @(#)sys3b.2 1.1 . .\" @(#)nint.3f 1.2 .so /usr/man/u_man/man3/round.3f .TH OPEN 2 .SH NAME open \- open for reading or writing .SH SYNOPSIS .B #include .br .BR "int open (" "path, oflag," " [" "mode" "] )" .br .BR "char \(**" "path" ; .br .BR int " oflag, mode" ; .SH DESCRIPTION .I Path\^ points to a pathname naming a file. .I Open\^ opens a file descriptor for the named file and sets the file status flags according to the value of .IR oflag . .I Oflag\^ values are constructed by or-ing flags from the following list (only one of the first three flags below may be used): .PP .TP .88i .SM .B O\(ruRDONLY Open for reading only. .TP .SM .B O\(ruWRONLY Open for writing only. .TP .SM .B O\(ruRDWR Open for reading and writing. .TP .SM .B O\(ruNDELAY This flag may affect subsequent reads and writes. See .IR read (2) and .IR write (2). .IP When opening a .SM FIFO with .SM \f3O\(ruRDONLY\f1 or .SM \f3O\(ruWRONLY\f1 set: .IP If .SM \f3O\\(ruNDELAY\f1 is set: .RS .IP An .I open\^ for reading-only returns without delay. An .I open\^ for writing-only returns an error if no process c.TH TIME 2 .SH NAME time \- get time .SH SYNOPSIS .B long time ((long \(**) 0) .PP .BR "long time (" tloc ) .br .BR "long \(**" tloc ; .SH DESCRIPTION .I Time\^ returns the value of time in seconds since 00:00:00 \s-1GMT\s0, January 1, 1970. .PP If .I tloc\^ (taken as an integer) is non-zero, the return value is also stored in the location to which .I tloc\^ points. .PP .I Time\^ fails if .I tloc\^ points to an illegal address. .SM \%[EFAULT] .SH RETURN VALUE Upon successful completion, .I time\^ returns the value of time. Otherwise, a value of \-1 is returned and .I errno\^ is set to indicate the error. .SH "SEE ALSO" stime(2). .\" @(#)time.2 1.4 .TH NLIST 3C .SH NAME nlist \- get entries from name list .SH SYNOPSIS .B #include .PP .BR "int nlist (" "filename, nl" ) .br .BR "char \(**" filename ; .br .BR "struct nlist " nl "[ ];" .SH DESCRIPTION .I Nlist\^ examines the name list in the executable file whose name is pointed to by .IR filename ; it selectively extracts a list of values and puts them in the array of \fInlist\fP structures pointed to by .IR nl . The name list .I nl\^ consists of an array of structures containing names of variables, types, and values. The list is terminated with a null name; i.e., a null string is in the name position of the structure. Each variable name is looked up in the name list of the file. If the name is found, the type and value of the name are inserted in the next two fields. If the name is not found, both entries are set to 0. See .IR a.out (4) for a discussion of the symbol table structure. .PP This subroutine is useful for examining the system name list kept in the file .BR /unix . In this way progra/ urrently has the file open for reading. .RE .IP If .SM \f3O\(ruNDELAY\f1 is clear: .RS .IP An .I open\^ for reading-only blocks until a process opens the file for writing. An .I open\^ for writing-only blocks until a process opens the file for reading. .RE .IP When opening a file associated with a communication line: .IP If .SM \f3O\(ruNDELAY\f1 is set: .RS .IP The \fIopen\fP returns without waiting for carrier. .RE .IP If .SM \f3O\(ruNDELAY\f1 is clear: .RS .IP The \fIopen\fP blocks until carrier is present. .RE .TP .SM .B O\(ruAPPEND If set, the file pointer is set to the end of the file prior to each write. .TP .SM .B O\(ruCREAT If the file exists, this flag has no effect. Otherwise, the file's owner .SM ID is set to the process's effective user .SM ID\*S, the file's group .SM ID is set to the process's effective group .SM ID\*S, and the low-order 12 bits of the file mode are set to the value of .I mode\^ modified as follows (see .IR creat (2)): .RS .IP All bits set in the process's file mode creation mask.TH TIMES 2 .SH NAME times \- get process and child process times .SH SYNOPSIS .B #include .br .B #include .PP .BR "long times (" buffer ) .br .BR "struct tms \(**" buffer ; .SH DESCRIPTION .I Times\^ fills the structure pointed to by .I buffer\^ with time-accounting information. Contents of the structure are: .PP .nf .ta .5i 1i 1.75i \f3struct tms {\f1 \f3time_t\f2 tms_utime\f3;\f1 \f3time_t\f2 tms_stime\f3;\f1 \f3time_t\f2 tms_cutime\f3;\f1 \f3time_t\f2 tms_cstime\f3;\f1 \f3};\f1 .fi .PP This information comes from the calling process and each of its terminated child processes for which it has executed a .IR wait . All times are in 60ths of a second. .PP .I Tms_utime\^ is the .SM CPU time used while executing instructions in the user space of the calling process. .PP .I Tms_stime\^ is the .SM CPU time used by the system on behalf of the calling process. .PP .I Tms_cutime\^ is the sum of the .IR "tms_utime"s and .IR "tms_cutime"s of the child processes. .PP .I Tms_cstime\^ isms can obtain system addresses that are up to date. .SH SEE ALSO a.out(4). .SH DIAGNOSTICS All type entries are set to 0 if the file cannot be read or if it doesn't contain a valid name list. .PP .I Nlist\^ returns \-1 upon error; otherwise it returns 0. .\" @(#)nlist.3c 1.5  are cleared. See .IR umask (2). .IP Mode bit 01000 (save text image after execution) is cleared. See .IR chmod (2). .RE .TP .SM .B O\(ruTRUNC If the file exists, its length is truncated to 0 and the mode and owner are unchanged. .TP .SM .B O\(ruEXCL If .SM .B O\(ruEXCL and .SM .B O\(ruCREAT are set, .I open\^ fails if the file exists. .PP Upon successful completion a non-negative integer, the file descriptor, is returned. .PP The file pointer used to mark the current position within the file is set to the beginning of the file. .PP The new file descriptor is set to remain open across .I exec\^ system calls. See .IR fcntl (2). .PP No process may have more than 20 file descriptors open simultaneously. .PP The named file is opened unless one or more of the following are true: .IP A component of the path prefix is not a directory. .SM \%[ENOTDIR] .IP .SM .B O\(ruCREAT is not set and the named file does not exist. .SM \%[ENOENT] .IP A component of the path prefix denies search permission. .SM \%[EACCES] .IP .I Of/  the sum of the .IR "tms_stime" s and .IR "tms_cstime" s of the child processes. .PP .I Times\^ fails if .I buffer\^ points to an illegal address. .SM \%[EFAULT] .SH RETURN VALUE Upon successful completion, .I times\^ returns the elapsed real time, in 60ths of a second, since an arbitrary point in the past (e.g., system start-up time). This point does not change from one invocation of .I times\^ to another. If .I times\^ fails, a \-1 is returned and .I errno\^ is set to indicate the error. .SH "SEE ALSO" exec(2), fork(2), time(2), wait(2). .\" @(#)times.2 1.5 .\" @(#)not.3f 1.2 .so /usr/man/u_man/man3/bool.3f lag\^ permission is denied for the named file. .SM \%[EACCES] .IP The named file is a directory and .I oflag\^ is write or read/write. .SM \%[EISDIR] .IP The named file resides on a read-only file system and .I oflag\^ is write or read/write. .SM \%[EROFS] .IP 20 file descriptors are currently open. .SM \%[EMFILE] .IP The named file is a character special or block special file, and the device associated with this special file does not exist. .SM \%[ENXIO] .IP The file is a pure procedure (shared text) file that is being executed and .I oflag\^ is write or read/write. .SM \%[ETXTBSY] .IP .I Path\^ points outside the process's allocated address space. .SM \%[EFAULT] .IP .SM .B O\(ruCREAT and .SM .B O\(ruEXCL are set and the named file exists. .SM \%[EEXIST] .IP .SM .B O\(ruNDELAY is set, the named file is a .SM FIFO\*S, .SM .B O\(ruWRONLY is set, and no process has the file open for reading. .SM \%[ENXIO] .SH "RETURN VALUE" Upon successful completion, a non-negative integer (i.e., a file descriptor) is returned.TH ULIMIT 2 .SH NAME ulimit \- get and set user limits .SH SYNOPSIS .BR "long ulimit (" "cmd, newlimit" ) .br .BR int " cmd" ; .br .BR long " newlimit" ; .SH DESCRIPTION This function provides for control over process limits. The .I cmd\^ values available are: .TP 5 .B 1 Get the process's file size limit. The limit is in units of 512-byte blocks and is inherited by child processes. Files of any size can be read. .TP 5 .B 2 Set the process's file size limit to the value of .IR newlimit . Any process may decrease this limit, but only a process with an effective user .SM ID of superuser may increase the limit. .I Ulimit\^ fails and the limit remains unchanged if a process with an effective user .SM ID other than superuser attempts to increase its file size limit. .SM \%[EPERM] .TP 5 .B 3 Get the maximum possible break value. See .IR brk (2). .SH "RETURN VALUE" Upon successful completion, a non-negative value is returned. Otherwise, a value of \-1 is returned and .I errno\^ is set to indicate the error. .SH SEE 0 .\" @(#)nrand48.3c 1.2 .so /usr/man/u_man/man3/drand48.3c ; otherwise, a value of \-1 is returned and .I errno\^ is set to indicate the error. .PP Refer to \fIfcntl\fR(5) for a list of the flag values contained in \fB\fR. .SH "SEE ALSO" close(2), creat(2), dup(2), fcntl(2), lseek(2), read(2), write(2), fcntl(5). .\" @(#)open.2 1.10 ALSO brk(2), write(2). .\" @(#)ulimit.2 1.4 .\" @(#)or.3f 1.2 .so /usr/man/u_man/man3/bool.3f 0 .TH PAUSE 2 .SH NAME pause \- suspend process until signal .SH SYNOPSIS .B pause (\|) .SH DESCRIPTION .I Pause\^ suspends the calling process until it receives a signal. The signal must be one that is not currently set to be ignored by the calling process. .PP If the signal causes termination of the calling process, .I pause\^ does not return. .PP If the signal is caught by the calling process and control is returned from the signal-catching function (see .IR signal (2)), the calling process resumes execution from the point of suspension. A value of \-1 is returned from .I pause\^ and .I errno\^ is set to .SM EINTR. .SH SEE ALSO alarm(2), kill(2), signal(2), wait(2). .\" @(#)pause.2 1.5 .TH UMASK 2 .SH NAME umask \- set and get file creation mask .SH SYNOPSIS .PP .BR "int umask (" cmask ) .br .BR int " cmask" ; .SH DESCRIPTION .I Umask\^ sets the process's file mode creation mask to .I cmask\^ and returns the previous value of the mask. Only the low-order 9 bits of .I cmask\^ and the file mode creation mask are used. .SH "RETURN VALUE" The previous value of the file mode creation mask is returned. .SH SEE ALSO mkdir(1), sh(1), chmod(2), creat(2), mknod(2), open(2). .\" @(#)umask.2 1.3 .\" @(#)pclose.3s 1.2 .so /usr/man/u_man/man3/popen.3s .TH PIPE 2 .SH NAME pipe \- create an interprocess channel .SH SYNOPSIS .BR "int pipe (" "fildes" ) .br .BR int " fildes" [2]; .SH DESCRIPTION .I Pipe\^ creates an I/O mechanism called a pipe and returns two file descriptors, .IR fildes [0] and .IR fildes [1]. .IR Fildes [0] is opened for reading and .IR fildes [1] is opened for writing. .PP Writes of up to 5,120 bytes of data are buffered by the pipe before the writing process is blocked. A read on .IR fildes [0] accesses the data written to .IR fildes [1] on a first-in-first-out basis. .PP No process may have more than 20 file descriptors open simultaneously. .PP .I Pipe\^ fails if 19 or more file descriptors are currently open. .SM \%[EMFILE] .SH "RETURN VALUE" Upon successful completion, a value of 0 is returned. Otherwise, a value of \-1 is returned and .I errno\^ is set to indicate the error. .SH "SEE ALSO" sh(1), read(2), write(2). .\" @(#)pipe.2 1.6 1 .TH UMOUNT 2 .SH NAME umount \- unmount a file system .SH SYNOPSIS .BR "int umount (" spec ) .br .BR "char \(**" spec ; .SH DESCRIPTION .I Umount\^ requests that a previously mounted file system contained on the block special device identified by .I spec\^ be unmounted. .I Spec\^ is a pointer to a pathname. After unmounting the file system, the directory upon which the file system was mounted reverts to its ordinary interpretation. .PP .I Umount\^ may be invoked only by the superuser. .PP .I Umount\^ fails if one or more of the following are true: .IP The process's effective user .SM ID is not superuser. .SM \%[EPERM] .IP .I Spec\^ does not exist. .SM \%[ENXIO] .IP .I Spec\^ is not a block special device. .SM \%[ENOTBLK] .IP .I Spec\^ is not mounted. .SM \%[EINVAL] .IP A file on .I spec\^ is busy. .SM \%[EBUSY] .IP .I Spec\^ points outside the process's allocated address space. .SM \%[EFAULT] .SH "RETURN VALUE" Upon successful completion a value of 0 is returned. Otherwise, a value of \-1 is returned and .I e.TH PERROR 3C .SH NAME perror, errno, sys_errlist, sys_nerr \- system error messages .SH SYNOPSIS .BR "void perror (" s ) .br .BR "char \(**" s ; .PP .B extern int errno; .PP .B extern char \(**sys_errlist[ ]; .PP .B extern int sys_nerr; .SH DESCRIPTION .I Perror\^ produces a message on the standard error output, describing the last error encountered during a call to a system or library function. The argument string .I s\^ is printed first, then a colon and a blank, then the message and a new-line. To be of most use, the argument string should include the name of the program that incurred the error. The error number is taken from the external variable .IR errno , which is set when errors occur but not cleared when non-erroneous calls are made. .PP To simplify variant formatting of messages, the array of message strings .I sys_errlist\^ is provided; .I errno\^ can be used as an index in this table to get the message string without the new-line. .I Sys_nerr\^ is the largest message number provided for in the t.TH PLOCK 2 .SH NAME plock \- lock process, text, or data in memory .SH SYNOPSIS .B #include .PP .BR "int plock (" "op" ) .br .BR int " op" ; .SH DESCRIPTION .I Plock allows the calling process to lock its text segment (text lock), its data segment (data lock), or both its text and data segments (process lock) into memory. Locked segments are immune to all routine swapping. .I Plock also allows these segments to be unlocked. The effective user \s-1ID\s+1 of the calling process must be superuser to use this call. .I Op specifies the following: .RS 8 .TP 14 .SM .B PROCLOCK lock text & data segments into memory (process lock) .TP .SM .B TXTLOCK lock text segment into memory (text lock) .TP .SM .B DATLOCK lock data segment into memory (data lock) .TP .SM .B UNLOCK remove locks .RE .PP .I Plock fails and does not perform the requested operation if one or more of the following are true: .IP The effective user \s-1ID\s+1 of the calling process is not superuser. .SM \%[EPERM] .IP .I Op is equal to .SM .Brrno\^ is set to indicate the error. .SH "SEE ALSO" mount(2). .\" @(#)umount.2 1.4 1 able; it should be checked because new error codes may be added to the system before they are added to the table. .SH SEE ALSO intro(2). .\" @(#)perror.3c 1.3  PROCLOCK and a process lock, a text lock, or a data lock already exists on the calling process. .SM \%[EINVAL] .IP .I Op is equal to .SM .B TXTLOCK and a text lock or a process lock already exists on the calling process. .SM \%[EINVAL] .IP .I Op is equal to .SM .B DATLOCK and a data lock or a process lock already exists on the calling process. .SM \%[EINVAL] .IP .I Op is equal to .SM .B UNLOCK and no type of lock exists on the calling process. .SM \%[EINVAL] .SH RETURN VALUE Upon successful completion, a value of 0 is returned to the calling process. Otherwise, a value of \-1 is returned and .I errno is set to indicate the error. .SH SEE ALSO exec(2), exit(2), fork(2). .\" @(#)plock.2 1.5 .TH UNAME 2 .SH NAME uname \- get name of current operating system .SH SYNOPSIS .B #include .PP .BR "int uname (" name ) .br .BR "struct utsname \(**" name ; .SH DESCRIPTION .I Uname\^ stores information identifying the current system in the structure pointed to by .IR name . .PP .I Uname\^ uses the structure defined in \f3\fP whose members are: .PP .RS \f3char\f2 sysname\f1[9]; .br \f3char\f2 nodename\f1[9]; .br \f3char\f2 release\f1[9]; .br \f3char\f2 version\f1[9]; .br \f3char\f2 machine\f1[9]; .RE .PP .I Uname\^ returns a null-terminated character string naming the current system in the character array .IR sysname . Similarly, .I nodename\^ contains the name that the system is known by on a communications network. .I Release\^ and .I version\^ further identify the operating system. .I Machine\^ contains a standard name that identifies the hardware that the system is running on. .PP .I Uname\^ fails if .I name\^ points to an invalid address. .SM \%[EFAULT] .SH "RETURN VALUE" .TH PLOT 3X .SH NAME plot \- graphics interface subroutines .SH SYNOPSIS .nf .B openpl (\^) .PP .B erase (\^) .PP .BR "label (" s ) .BR "char \(**" s ; .PP .BR "line (" "x1, y1, x2, y2" ) .BR int " x1, y1, x2, y2" ; .PP .BR "circle (" "x, y, r" ) .BR int " x, y, r" ; .PP .BR "arc (" "x, y, x0, y0, x1, y1" ")" .BR "int" " x, y, x0, y0, x1, y1" ";" .PP .BR "move (" "x, y" ) .BR int " x, y" ; .PP .BR "cont (" "x, y" ) .BR int " x, y" ; .PP .BR "point (" "x, y" ) .BR int " x, y" ; .PP .BR "linemod (" s ) .BR "char \(**" s ; .PP .BR "space (" "x0, y0, x1, y1" ) .BR int " x0, y0, x1, y1" ; .PP .B closepl (\^) .SH DESCRIPTION These subroutines generate graphic output in a relatively device-independent manner. .I Space\^ must be used before any of these functions to declare the amount of space necessary; see .IR plot (4). .I Openpl\^ must be used before any of the others to open the device for writing. .I Closepl\^ flushes the output. .PP .I Circle\^ draws a circle of radius .I r\^ with center at the point .IR "(x, y2 .TH PROFIL 2 .SH NAME profil \- execution time profile .SH SYNOPSIS .BR "void profil (" "buff, bufsiz, offset, scale" ) .br .BR "char \(**" "buff" ; .br .BR int " bufsiz, offset, scale" ; .SH DESCRIPTION .I Buff\^ points to an area of core whose length (in bytes) is given by .IR bufsiz . After this call, the user's program counter (pc) is examined each clock tick (60th second); .I offset\^ is subtracted from it and the result is multiplied by .IR scale . If the resulting number corresponds to a word inside .IR buff , that word is incremented. .PP The scale is interpreted as an unsigned, fixed-point fraction with binary point at the left: 0177777 (octal) gives a 1-1 mapping of pc's to words in .IR buff ; 077777 (octal) maps each pair of instruction words together. 02(8) maps all instructions onto the beginning of .I buff\^ (producing a non-interrupting core clock). .PP Profiling is turned off by giving a .I scale\^ of 0 or 1. It is rendered ineffective by giving a .I bufsiz\^ of 0. Profiling is turned off wheUpon successful completion, a non-negative value is returned. Otherwise, \-1 is returned and .I errno\^ is set to indicate the error. .SH SEE ALSO uname(1). .\" @(#)uname.2 1.5 .\" @(#)cos.3m 1.2 .so /usr/man/u_man/man3/trig.3m .TH PASTE 1 .SH NAME paste \- merge same lines of several files or subsequent lines of one file .SH SYNOPSIS \f3paste \fPfile1 file2 .\|.\|. .br \f3paste \-d\fP\|list file1 file2 .\|.\|. .br \f3paste \-s [\-d\fP\|list\|\f3] \fPfile1 file2 .\|.\|. .SH DESCRIPTION In the first two forms, .I paste\^ concatenates corresponding lines of the given input files .IR file1 , .IR file2 , etc. It treats each file as a column or columns of a table and pastes them together horizontally (parallel merging). .I Paste is the counterpart of .IR cat (1) which concatenates vertically, i.e., one file after the other. In the last form above, .I paste\^ subsumes the function of an older command with the same name by combining subsequent lines of the input file (serial merging). In all cases, lines are glued together with the .I tab\^ character, or with characters from an optionally specified .IR list . Output is to the standard output, so it can be used as the start of a pipe, or as a filter, if \f3\-\fP is used in place of a filena2 .TH UNLINK 2 .SH NAME unlink \- remove directory entry .SH SYNOPSIS .BR "int unlink (" path ) .br .BR "char \(**" path ; .SH DESCRIPTION .I Unlink\^ removes the directory entry named by the pathname pointed to by .IR path . .PP The named file is unlinked unless one or more of the following are true: .IP A component of the path prefix is not a directory. .SM \%[ENOTDIR] .IP The named file does not exist. .SM \%[ENOENT] .IP Search permission is denied for a component of the path prefix. .SM \%[EACCES] .IP Write permission is denied on the directory containing the link to be removed. .SM \%[EACCES] .IP The named file is a directory and the effective user .SM ID of the process is not superuser. .SM \%[EPERM] .IP The entry to be unlinked is the mount point for a mounted file system. .SM \%[EBUSY] .IP The entry to be unlinked is the last link to a pure procedure (shared text) file that is being executed. .SM \%[ETXTBSY] .IP The directory entry to be unlinked is part of a read-only file system. .SM \%[EROFS] .IP .I.TH COSH 3F .SH NAME cosh, dcosh \- FORTRAN hyperbolic cosine intrinsic function .SH SYNOPSIS .nf .BR "real" " r1, r2" .BR "double precision" " dp1, dp2" .P .RB "r2" " = cosh(" "r1" ")" .P .RB "dp2" " = dcosh(" "dp1" ")" .RB "dp2" " = cosh(" "dp1" ")" .SH DESCRIPTION .I Cosh\^ returns the real hyperbolic cosine of its real argument. .I Dcosh\^ returns the double-precision hyperbolic cosine of its double-precision argument. The generic form .I cosh\^ may be used to return the hyperbolic cosine in the type of its argument. .SH SEE ALSO sinh(3M). .\" @(#)cosh.3f 1.4 me. .PP The meanings of the options are: .TP .B "\-d" Replace the .I tab\^ character by one or more alternate characters specified in .IR list . Without this option, the new-line characters of each but the last file (or last line in case of the .B \-s option) are replaced by a .I tab\^ character. .TP .I "list\^" One or more characters immediately following .B \-d replace the default .I tab\^ as the line concatenation character. The list is used circularly; i.e., when exhausted, it is reused. In parallel merging (i.e., no .B \-s option), the lines from the last file are always terminated with a new-line character, not from the .IR list . The list may contain the special escape sequences: .B \e\|n (new line), .B \e\|t (tab), .B \e\e (backslash), and .B \e\|0 (empty string, not a null character). Quoting may be necessary if characters have special meaning to the shell (e.g., to get one backslash, use .B \-d\|``\e\e\e\e'' ). .TP .B "\-s" Merge subsequent lines rather than one from each input file. Use .I tab\^ fo Path\^ points outside the process's allocated address space. .SM \%[EFAULT] .PP When all links to a file have been removed and no process has the file open, the space occupied by the file is freed and the file ceases to exist. If one or more processes have the file open when the last link is removed, the removal is postponed until all references to the file have been closed. .SH "RETURN VALUE" Upon successful completion, a value of 0 is returned. Otherwise, a value of \-1 is returned and .I errno\^ is set to indicate the error. .SH "SEE ALSO" rm(1), close(2), link(2), open(2). .\" @(#)unlink.2 1.4 3 .\" @(#)cosh.3m 1.2 .so /usr/man/u_man/man3/sinh.3m r concatenation, unless a .I list\^ is specified with the .B \-d option. Regardless of the .IR list , the last character of the file is forced to be a new line. .TP .B "\-" May be used in place of any filename, to read a line from the standard input. (There is no prompting). .SH EXAMPLES .TP 15m \f3ls \|\(bv\| paste \|\-d``\|'' \|\-\f1 list directory in one column .TP \f3ls \|\(bv\| paste \|\- \|\- \|\- \|\-\f1 list directory in four columns .TP \f3paste \|\-s \|\-d``\e\|t\e\|n'' \|file\f1 combine pairs of lines into lines .SH "SEE ALSO" grep(1), cut(1), .br pr(1): .BR "pr \-t \-m" .\|.\|. works similarly, but creates extra blanks, tabs and new lines for a nice page layout. .SH DIAGNOSTICS .TP 17 .B "line too long\^" Output lines are restricted to 511 characters. .TP 17 .B "too many files\^" Except for the .B \-s option, no more than 12 input files may be specified. .\" @(#)paste.1 1.6 .TH USTAT 2 .SH NAME ustat \- get file system statistics .SH SYNOPSIS .B #include .br .B #include .sp .BR "int ustat (" "dev, buf" ) .br .BR int " dev" ; .br .BR "struct ustat \(**" buf ; .SH DESCRIPTION .I Ustat\^ returns information about a mounted file system. .I Dev\^ is a device number identifying a device containing a mounted file system. .I Buf\^ is a pointer to a .I ustat\^ structure that includes the following elements: .PP .RS .nf .ta 8n 25n 30n \f3daddr_t\f2 f_tfree\f3;\f1 /\(** Total free blocks \(**/ \f3ino_t\f2 f_tinode\f3;\f1 /\(** Number of free inodes \(**/ \f3char\f2 f_fname[6]\f3;\f1 /\(** Filsys name \(**/ \f3char\f2 f_fpack[6]\f3;\f1 /\(** Filsys pack name \(**/ .fi .RE .PP .I Ustat\^ fails if one or more of the following are true: .IP .I Dev\^ is not the device number of a device containing a mounted file system. .SM \%[EINVAL] .IP .I Buf\^ points outside the process's allocated address space. .SM \%[EFAULT] .SH "RETURN VALUE" Upon successful completion, a value o.TH CRYPT 3C .SH NAME crypt, encrypt \- a one way hashing encryption algorithm .SH SYNOPSIS .nf .BR "char \(**crypt (" "key, salt" ")" .BR "char \(**" "key," " \(**" "salt" ; .PP .BR "void encrypt (" "block" ) .BR "char \(**" "block" ; .SH DESCRIPTION .I Crypt\^ is the password encryption function. It is based on a one way hashing encryption algorithm with variations intended (among other things) to frustrate use of hardware implementations of a key search. .PP .I Key\^ is a user's typed password. .I Salt\^ is a two-character string chosen from the set [\f3a-zA-Z0-9./\fP]; this string is used to perturb the hashing algorithm in one of 4096 different ways, after which the password is used as the key to encrypt repeatedly a constant string. The returned value points to the encrypted password. The first two characters are the salt itself. .PP There is a character array of length 64 containing only the characters with numerical value 0 and 1. When this string is divided into groups of 8, the low-order bit in each3 .\" @(#)pcat.1 1.2 .so /usr/man/u_man/man1/pack.1 f 0 is returned. Otherwise, a value of \-1 is returned and .I errno\^ is set to indicate the error. .SH "SEE ALSO" stat(2), fs(4). .\" @(#)ustat.2 1.6  group is ignored; this gives a 56-bit key which is set into the machine by \f2crypt\f1. .PP The .I encrypt\^ entry provides (rather primitive) access to the actual hashing algorithm. The argument to the .I encrypt\^ entry is a character array of length 64 containing only the characters with numerical value of 0 and 1. The argument array is modified in place to a similar array representing the bits of the argument after having been subjected to the hashing algorithm using the key set by .IR crypt . .SH SEE ALSO getpass(3C), passwd(4), login(1), passwd(1). .SH BUGS The return value points to static data that are overwritten by each call. .\" @(#)encrypt.3c 1.1 of 12/15/83 .\" @(#)pcc.1 1.2 .so /usr/man/u_man/man1/cc.1 4 .TH UTIME 2 .SH NAME utime \- set file access and modification times .SH SYNOPSIS .B #include .br .BR "int utime (" "path, times" ) .br .BR "char \(**" path ; .br .BR "struct utimbuf \(**" times ; .SH DESCRIPTION .I Path\^ points to a pathname naming a file. .I Utime\^ sets the access and modification times of the named file. .PP If .I times\^ is .SM .BR NULL , the access and modification times of the file are set to the current time. A process must be the owner of the file or have write permission to use .I utime\^ in this manner. .PP If .I times\^ is not .SM .BR NULL , .I times\^ is interpreted as a pointer to a .I utimbuf\^ structure and the access and modification times are set to the values contained in the designated structure. Only the owner of the file or the superuser may use .I utime\^ this way. .PP The times in the following structure are measured in seconds since 00:00:00 .SM GMT\*S, Jan. 1, 1970. .PP .RS .nf .ta .5i 1i 1.75i 2.5i \f3struct\f2 utimbuf\f3 {\f1 \f3time_t\f2 actime\f3;.\" @(#)csin.3f 1.2 .so /usr/man/u_man/man3/sin.3f 2630-*'$!  \f1 /\(** access time \(**/ \f3time_t\f2 modtime\f3;\f1 /\(** modification time \(**/ \f3};\f1 .fi .RE .PP .PP .I Utime\^ fails if one or more of the following are true: .IP The named file does not exist. .SM \%[ENOENT] .IP A component of the path prefix is not a directory. .SM \%[ENOTDIR] .IP Search permission is denied by a component of the path prefix. .SM \%[EACCES] .IP The effective user .SM ID is not superuser and not the owner of the file and .I times\^ is not .SM .BR NULL . .SM \%[EPERM] .IP The effective user .SM ID is not superuser and not the owner of the file, .I times\^ is .SM .BR NULL , and write access is denied. .SM \%[EACCES] .IP The file system containing the file is mounted read-only. .SM \%[EROFS] .IP .I Times\^ is not .SM .B NULL and points outside the process's allocated address space. .SM \%[EFAULT] .IP .I Path\^ points outside the process's allocated address space. .SM \%[EFAULT] .SH "RETURN VALUE" Upon successful completion, a value of 0 is returned. Otherwise, a value of \-1 is retu4 .\" @(#)csqrt.3f 1.2 .so /usr/man/u_man/man3/sqrt.3f .TH PR 1 .SH NAME pr \- print files .SH SYNOPSIS .B pr [ options ] [ files ] .SH DESCRIPTION .I Pr\^ prints the named files on the standard output. If .I file\^ is .BR \- , or if no files are specified, the standard input is assumed. By default, the listing is separated into pages, each headed by the page number, a date and time, and the name of the file. .PP By default, columns are of equal width, separated by at least one space; lines which do not fit are truncated. If the .B \-s option is used, lines are not truncated and columns are separated by the separation character. .PP If the standard output is associated with a terminal, error messages are withheld until .I pr\^ has completed printing. .PP The \fIoptions\fP below may appear singly or be combined in any order: .TP .BI + k\^ Begin printing with page .I k\^ (default is 1). .TP .BI \- k\^ Produce .IR k -column output (default is 1). The options .B \-e and .B \-i are assumed for multi-column output. .TP .B \-a Print multi-column output across the page. rned and .I errno\^ is set to indicate the error. .SH "SEE ALSO" stat(2). .\" @(#)utime.2 1.6 .TH CTERMID 3S .SH NAME ctermid \- generate filename for terminal .SH SYNOPSIS .B #include .PP .BR "char \(**ctermid(" s ) .br .BR "char \(**" s ; .SH DESCRIPTION .I Ctermid\^ generates the pathname of the controlling terminal for the current process, and stores it in a string. .PP If .I s\^ is a .SM NULL pointer, the string is stored in an internal static area, the contents of which are overwritten at the next call to .IR ctermid , and the address of which is returned. Otherwise, .I s\^ is assumed to point to a character array of at least .B L_ctermid elements; the pathname is placed in this array and the value of .I s\^ is returned. The constant .B L_ctermid is defined in the .B header file. .SH NOTES The difference between .I ctermid\^ and .IR ttyname (3C) is that .I ttyname\^ must be handed a file descriptor and returns the actual name of the terminal associated with that file descriptor, while .I ctermid\^ returns a string .RB ( /dev/tty ) that refers to the terminal if used as a fil5 .TP .B \-m Merge and print all files simultaneously, one per column (overrides the \f3\-\fP\fIk\fP, and .B \-a options). .TP .B \-d Double-space the output. .TP .BI \-e ck\^ Expand .I input\^ tabs to character positions .IR k "+1, 2\(**" k "+1, 3\(**" k +1, etc. If .I k\^ is 0 or is omitted, default tab settings at every eighth position are assumed. Tab characters in the input are expanded into the appropriate number of spaces. If .I c\^ (any non-digit character) is given, it is treated as the input tab character (default for .I c\^ is the tab character). .TP .BI \-i ck\^ In .IR output , replace white space wherever possible by inserting tabs to character positions .IR k "+1, 2\(**" k "+1, 3\(**" k +1, etc. If .I k\^ is 0 or is omitted, default tab settings at every eighth position are assumed. If .I c\^ (any non-digit character) is given, it is treated as the output tab character (default for .I c\^ is the tab character). .TP .BI \-n ck\^ Provide .IR k -digit line numbering (default for .I k\^ is 5). The num.TH WAIT 2 .SH NAME wait \- wait for child process to stop or terminate .SH SYNOPSIS .BR "int wait (" stat_loc ) .br .BR "int \(**" stat_loc ; .PP .B int wait ((int \(**)0) .SH DESCRIPTION .I Wait\^ suspends the calling process until it receives a signal that is to be caught (see .IR signal (2)), or until any one of the calling process's child processes stops in a trace mode (see .IR ptrace (2)) or terminates. If a child process stopped or terminated prior to the call on .IR wait , return is immediate. .PP If .I stat_loc\^ (taken as an integer) is non-zero, 16 bits of information called \fIstatus\fP are stored in the low-order 16 bits of the location pointed to by .IR stat_loc . .I Status\^ can be used to differentiate between stopped and terminated child processes. If the child process terminated, \fIstatus\fP identifies the cause of termination and passes useful information to the parent. This is accomplished in the following manner: .IP If the child process stopped, the high-order 8 bits of \fIstatus\fP cename. For this reason, .I ttyname\^ is useful only if the process already has at least one file open to a terminal. .SH SEE ALSO ttyname(3C). .\" @(#)ctermid.3s 1.5 ber occupies the first .IR k +1 character positions of each column of normal output or each line of .B \-m output. If .I c\^ (any non-digit character) is given, it is appended to the line number to separate it from whatever follows (default for .I c\^ is a tab). .TP .BI \-w k\^ Set the width of a line to .I k\^ character positions (default is 72 for equal-width multi-column output, no limit otherwise). .TP .BI \-o k\^ Offset each line by .I k\^ character positions (default is 0). The number of character positions per line is the sum of the width and offset. .TP .BI \-l k\^ Set the length of a page to .I k\^ lines (default is 66). .TP .B \-h Use the next argument as the header to be printed instead of the filename. .TP .B \-p Pause before beginning each page if the output is directed to a terminal .RI ( pr\^ will ring the bell at the terminal and wait for a carriage return). .TP .B \-f Use form-feed character for new pages (default is to use a sequence of line feeds). Pause before beginning the first page if t5 ontain the number of the signal that caused the process to stop and the low-order 8 bits are set equal to 0177. .IP If the child process terminated due to an .I exit\^ call, the low-order 8 bits of \fIstatus\fP are zero and the high-order 8 bits contain the low-order 8 bits of the argument that the child process passed to .IR exit ; see .IR exit (2). .IP If the child process terminated due to a signal, the high-order 8 bits of \fIstatus\fP are zero and the low-order 8 bits contain the number of the signal that caused the termination. In addition, if the low-order seventh bit (i.e., bit 200) is set, a ``core image'' will have been produced; see .IR signal (2). .PP If a parent process terminates without waiting for its child processes to terminate, the parent process .SM ID of each child process is set to 1. This means the initialization process inherits the child processes; see .IR intro (2). .PP .PP .I Wait\^ fails and returns immediately if one or more of the following are true: .IP The calling process has n.TH CTIME 3C .SH NAME ctime, localtime, gmtime, asctime, tzset \- convert date and time to string .SH SYNOPSIS .nf .B #include .PP .BR "char \(**ctime (" clock ) .BR "long \(**" clock ; .PP .BR "struct tm \(**localtime (" clock ) .BR "long \(**" clock ; .PP .BR "struct tm \(**gmtime (" clock ) .BR "long \(**" clock ; .PP .BR "char \(**asctime (" tm ) .BR "struct tm \(**" tm ; .PP .B extern long timezone; .PP .B extern int daylight; .PP .B extern char \(**tzname[2]; .PP .B void tzset ( ) .SH DESCRIPTION .I Ctime\^ converts a long integer, pointed to by .IR clock , representing the time in seconds since 00:00:00 GMT, January 1, 1970, and returns a pointer to a 26-character string in the following form. All the fields have constant width. .PP .RS Sun Sep 16 01:03:52 1973\\n\\0 .RE .PP .I Localtime\^ and .I gmtime\^ return pointers to .I tm\^ structures, described below. .I Localtime\^ corrects for the time zone and possible Daylight Savings Time; .I gmtime\^ converts directly to Greenwich Mean Time (\s-he standard output is associated with a terminal. .TP .B \-r Print no diagnostic reports on failure to open files. .TP .B \-t Print neither the 5-line identifying header nor the 5-line trailer normally supplied for each page. Quit printing after the last line of each file without spacing to the end of the page. .TP .BI \-s c\^ Separate columns by the single character .I c\^ instead of by the appropriate number of spaces (default for .I c\^ is a tab). .SH EXAMPLES Print .B file1 and .B file2 as a double-spaced, three-column listing headed by ``file list'': .PP .RS .B "pr \|\-3dh \|"file \|list" \|file1 \|file2" .RE .PP Write .B file1 on .BR file2 , expanding tabs to columns 10, 19, 28, 37, .\|.\|. : .PP .RS .B "pr \|\-e9 \|\-t \|file2" .RE .SH FILES /dev/tty\(** to suspend messages .SH SEE ALSO cat(1). .\" @(#)pr.1 1.5 o existing unwaited-for child processes. .SM \%[ECHILD] .IP .I Stat_loc\^ points to an illegal address. .SM \%[EFAULT] .SH RETURN VALUE If .I wait\^ returns due to the receipt of a signal, a value of \-1 is returned to the calling process and .I errno\^ is set to .SM EINTR. If .I wait\^ returns due to a stopped or terminated child process, the process .SM ID of the child is returned to the calling process. Otherwise, a value of \-1 is returned and .I errno\^ is set to indicate the error. .SH "SEE ALSO" exec(2), exit(2), fork(2), pause(2), signal(2). .SH WARNING See .SM .I WARNING\^ in .IR signal (2). .\" @(#)wait.2 1.4 6 1GMT\s0), which is the time the system uses. .PP .I Asctime\^ converts a \fItm\fP structure to a 26-character string, as shown in the above example, and returns a pointer to the string. .PP Declarations of all the functions and externals, and the .I tm\^ structure, are in the .I \^ header file. The structure declaration is: .RS .PP .nf \f3struct tm {\f1 \f3int tm_sec;\f1 /\(** seconds (0 - 59) \(**/ \f3int tm_min;\f1 /\(** minutes (0 - 59) \(**/ \f3int tm_hour;\f1 /\(** hours (0 - 23) \(**/ \f3int tm_mday;\f1 /\(** day of month (1 - 31) \(**/ \f3int tm_mon;\f1 /\(** month of year (0 - 11) \(**/ \f3int tm_year;\f1 /\(** year \- 1900 \(**/ \f3int tm_wday;\f1 /\(** day of week (Sunday = 0) \(**/ \f3int tm_yday;\f1 /\(** day of year (0 - 365) \(**/ \f3int tm_isdst;\f1 \f3};\f1 .fi .RE .PP .I Tm_isdst\^ is non-zero if Daylight Savings Time is in effect. .PP The external .B long variable .I timezone\^ contains the difference,.TH PROF 1 .SH NAME prof \- display profile data .SH SYNOPSIS .B prof .RB [ \-tcan ] .RB [ \-ox ] .RB [ \-g ] .RB [ \-z ] .RB [ \-h ] .RB [ \-s ] .RB [ \-m "\ mdata]" [prog] .SH DESCRIPTION .I Prof\^ interprets the profile file produced by the .IR monitor (3C) function. The symbol table in the object file .I prog\^ .RB ( a.out by default) is read and correlated with the profile file .RB ( mon.out by default). For each external text symbol the percentage of time spent executing between the address of that symbol and the address of the next is printed, together with the number of times that function was called and the average number of milliseconds per call. .PP The mutually exclusive options .B t, c, a,\^ and .B n\^ determine the type of sorting of the output lines: .TP .B \-t Sort by decreasing percentage of total time (default). .TP .B \-c Sort by decreasing number of calls. .TP .B \-a Sort by increasing symbol address. .TP .B \-n Sort lexically by symbol name. .PP The mutually exclusive options .B o\^ and ..TH WRITE 2 .SH NAME write \- write on a file .SH SYNOPSIS .BR "int write (" "fildes, buf, nbyte" ) .br .BR int " fildes" ; .br .BR "char \(**" buf ; .br .BR unsigned " nbyte" ; .SH DESCRIPTION .I Fildes\^ is a file descriptor obtained from a .IR creat (2), .IR open (2), .IR dup (2), .IR fcntl (2), or .IR pipe (2) system call. .PP .I Write\^ attempts to write .I nbyte\^ bytes from the buffer pointed to by .I buf\^ to the file associated with the .IR fildes . .PP On devices capable of seeking, the actual writing of data proceeds from the position in the file indicated by the file pointer. Upon return from .IR write , the file pointer is incremented by the number of bytes actually written. .PP On devices incapable of seeking, writing always takes place starting at the current position. The value of a file pointer associated with such a device is undefined. .PP If the .SM .B O_APPEND file status flag is set, the file pointer is set to the end of the file prior to each write. .PP .I Write\^ fails and the file p in seconds, between \s-1GMT\s0 and local standard time (in \s-1EST\s0, .I timezone\^ is 5\(**60\(**60); the external variable .I daylight\^ is non-zero if, and only if, the standard \s-1U.S.A.\s+1 Daylight Savings Time conversion should be applied. The program knows about the peculiarities of this conversion in 1974 and 1975; if necessary, a table for these years can be extended. .PP If an environment variable named .SM .B TZ is present, .I asctime\^ uses the contents of the variable to override the default time zone. The value of .SM .B TZ must be a 3-letter time zone name, followed by a number representing the difference between local time and Greenwich Mean Time in hours, followed by an optional 3-letter name for a daylight time zone. For example, the setting for New Jersey would be .SM .BR EST5EDT . The effects of setting .SM .B TZ are thus to change the values of the external variables .I timezone\^ and .IR daylight ; in addition, the time zone names contained in the external variable .PP .B char \(**6 B x\^ specify the printing of the address of each symbol monitored: .TP .B \-o Print each symbol address (in octal) along with the symbol name. .TP .B \-x Print each symbol address (in hexadecimal) along with the symbol name. .PP The following options may be used in any combination: .TP .B \-g Include non-global symbols (static functions). .TP .B \-z Include all symbols in the profile range (see .IR monitor (3C)), even if associated with zero number of calls and zero time. .TP .B \-h Suppress the heading normally printed on the report. (This is useful if the report is to be processed further.) .TP .B \-s Print a summary of several of the monitoring parameters and statistics on the standard error output. .TP .BR \-m " mdata\^" Use file .I mdata\^ instead of .B mon.out for profiling data. .PP For the number of calls to a function to be tallied, the .B \-p option of .IR cc (1) must have been given when the file containing the function was compiled. This option to the .I cc\^ command also arranges for the object ointer remains unchanged if one or more of the following are true: .IP .I Fildes\^ is not a valid file descriptor open for writing. .SM \%[EBADF] .IP An attempt is made to write to a pipe that is not open for reading by any process. .SM \%[EPIPE and .SM SIGPIPE signal] .IP An attempt is made to write a file that exceeds the process's file size limit or the maximum file size. See .IR ulimit (2). .SM \%[EFBIG] .IP .I Buf\^ points outside the process's allocated address space. .SM \%[EFAULT] .PP If a .I write\^ requests that more bytes be written than there is room for (e.g., the .I ulimit\^ (see .IR ulimit (2)) or the physical end of a medium), only as many bytes as there is room for are written. For example, if there is space for 20 bytes more in a file before reaching a limit, a write of 512 bytes returns 20. The next write of a non-zero number of bytes gives a failure return (except as noted below). .PP If the file being written is a pipe (or .SM FIFO\*S), no partial writes are permitted. Thus, the write ftzname[2] = { "\s-1EST\s0", "\s-1EDT\s0" }; .PP are set from the environment variable .SM .BR TZ . The function .I tzset\^ sets these external variables from .SM .BR TZ ; .I tzset\^ is called by .I asctime\^ and may also be called explicitly by the user. .PP .PP Note that in most installations, .SM .B TZ is set by default when the user logs on, to a value in the local \f3/etc/profile\f1 file (see .IR profile (4)). .SH "SEE ALSO" time(2), getenv(3C), profile(4), environ(5). .SH BUGS The return values point to static data whose content is overwritten by each call. .\" @(#)ctime.3c 1.7 file to include a special profiling start-up function that calls .IR monitor (3C) at the beginning and end of execution. It is the call to .I monitor\^ at the end of execution that causes the .B mon.out file to be written. Thus, only programs that call .IR exit (2) or return from .I main\^ cause the .B mon.out file to be produced. .SH FILES .ta \w'mon.out 'u mon.out for profile .br a.out for namelist .SH "SEE ALSO" cc(1), nm(1), exit(2), profil(2), monitor(3C). .br .ne 6v .SH BUGS There is a limit of 600 functions that may have call counters established during program execution. If this limit is exceeded, other data is overwritten and the .B mon.out file is corrupted. The number of call counters used is reported automatically by the .I prof\^ command whenever the number exceeds 250. .\" @(#)prof.1 1.4 7 ails if a write of .I nbyte\^ bytes would exceed a limit. .PP If the file being written is a pipe (or .SM FIFO\*S) and the .SM .B O_NDELAY flag of the file flag word is set, then write to a full pipe (or .SM FIFO\*S) returns a count of 0. If .SM .B O_NDELAY is clear, writes to a full pipe (or .SM FIFO\*S) block until space becomes available. .SH "RETURN VALUE" Upon successful completion the number of bytes actually written is returned. Otherwise, \-1 is returned and .I errno\^ is set to indicate the error. .SH "SEE ALSO" creat(2), dup(2), lseek(2), open(2), pipe(2), ulimit(2). .\" @(#)write.2 1.5 .TH CTYPE 3C .SH NAME isalpha, isupper, islower, isdigit, isxdigit, isalnum, isspace, ispunct, isprint, isgraph, iscntrl, isascii \- classify characters .SH SYNOPSIS .B #include .PP .BR "int isalpha (" c ) .br .BR int " c" ; .PP .B . . . .SH DESCRIPTION These macros classify character-coded integer values by table lookup. Each is a predicate returning nonzero for true, zero for false. .I Isascii\^ is defined on all integer values; the rest are defined only where .I isascii\^ is true and on the single non-\s-1ASCII\s0 value .SM .B EOF (\-1); see .IR stdio (3S)). .TP 15n .I isalpha\^ .I c\^ is a letter. .TP .I isupper\^ .I c\^ is an uppercase letter. .TP .I islower\^ .I c\^ is a lowercase letter. .TP .I isdigit\^ .I c\^ is a digit [0-9]. .TP .I isxdigit\^ .I c\^ is a hexadecimal digit [0-9], [A-F] or [a-f]. .TP .I isalnum\^ .I c\^ is an alphanumeric (letter or digit). .TP .I isspace\^ .I c\^ is a space, tab, carriage return, new line, vertical tab, or form feed. .TP .I ispunct\^ .I c\^ is a punctuat'\" t .tr ~ .nr f 0 .bd S B 3 .de SP .if n .ul \%[\f3\-\\$1\fP\\c .if n .ul 0 \\$2\\$3 .. .de SF .if n .ul \%[\f3\-\\$1\fP] .if n .ul 0 .. .de AR .if \\nf \{ \ . RE . nr f 0 \} .PP .RS 5 .TP 15 \f3\-\\$1\\fP \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .nr f 1 .. .de A1 .if \\nf \{ \ . RE . nr f 0 \} .PP .RS 5 .TP 15 \f3\-\\$1\fP[\f2\\$2\^\fP] \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .nr f 1 .. .ds S) \s-1SCCS\s+1 .ds I) \s-1SID\s+1 .TH PRS 1 .SH NAME prs \- print an \s-1SCCS\s+1 file .SH SYNOPSIS .B prs .SP d [dataspec]] .SP r [\s-1SID\s+1]] .SF e .SF l .SF a files .SH DESCRIPTION .I Prs\^ prints, on the standard output, parts or all of an \*(S) file (see .IR sccsfile (4)) in a user supplied format. If a directory is named, .I prs\^ behaves as though each file in the directory were specified as a named file, except that non-\*(S) files (last component of the pathname does not begin with \f3s.\fP), and unreadable files are silently ignored. If a name of \f3\-\fP is given, the standard input is read; each l..._tolower.3c_toupper.3ca64l.3cabort.3cabort.3fabs.3cabs.3facos.3facos.3maimag.3faint.3falog.3falog10.3famax0.3famax1.3famin0.3famin1.3famod.3fand.3fanint.3fasctime.3casin.3fasin.3massert.3xatan.3fatan.3matan2.3fatan2.3matof.3catoi.3catol.3cbessel.3mbool.3fbsearch.3ccabs.3fcalloc.3cccos.3fceil.3mcexp.3fchar.3fclearerr.3sclock.3cclog.3fcmplx.3fconjg.3fconv.3ccos.3fcos.3mcosh.3fcosh.3mcrypt.3ccsin.3fcsqrt.3fctermid.3sctime.3cctype.3ccuserid.3sdabs.3fdacos.3fdasin.3fdatan.3fdatan2.3f7 ion character (neither control nor alphanumeric). .TP .I isprint\^ .I c\^ is a printing character, code 040 (space) through 0176 (tilde). .TP .I isgraph\^ .I c\^ is a printing character, similar to .I isprint\^ except false for space. .TP .I iscntrl\^ .I c\^ is a delete character (0177) or an ordinary control character (less than 040). .TP .I isascii\^ .I c\^ is an \s-1ASCII\s0 character, code less than 0200. .SH DIAGNOSTICS If the argument to any of these macros is not in the domain of the function, the result is undefined. .SH "SEE ALSO" ascii(5). .\" @(#)ctype.3c 1.5 ine of the standard input is taken to be the name of an \*(S) file or directory to be processed; non-\*(S) files and unreadable files are silently ignored. .PP Arguments to .IR prs , which may appear in any order, consist of .I keyletter\^ arguments, and filenames. .PP All the described .I keyletter\^ arguments apply independently to each named file: .A1 d dataspec Used to specify the output data specification. The .I dataspec\^ is a string consisting of \*(S) file .I "data keywords\^" (see .IR "\s-1DATA KEYWORDS\s+1" ) interspersed with optional user supplied text. .A1 r \s-1SID\s+1 Used to specify the .IR S "\s-1CCS\s+1 " ID entification (\*(I)) string of a delta for which information is desired. If no \*(I) is specified, the \*(I) of the most recently created delta is assumed. .AR e Requests information for all deltas created .I earlier\^ than and including the delta designated via the .B \-r keyletter. .AR l Requests information for all deltas created .I later\^ than and including the delta designated via.\" @(#)_tolower.3c 1.2 .so /usr/man/u_man/man3/conv.3c .TH CUSERID 3S .SH NAME cuserid \- get character login name of the user .SH SYNOPSIS .B #include .PP .BR "char \(**cuserid (" s ) .br .BR "char \(**" s ; .SH DESCRIPTION .I Cuserid\^ generates a character-string representation of the login name of the owner of the current process. If .I s\^ is a .SM NULL pointer, this representation is generated in an internal static area, the address of which is returned. Otherwise, .I s\^ is assumed to point to an array of at least .B L_cuserid characters; the representation is left in this array. The constant .B L_cuserid is defined in the .B header file. .SH DIAGNOSTICS If the login name cannot be found, .I cuserid\^ returns a .SM NULL pointer; if .I s\^ is not a .SM NULL pointer, a null character .B (\e0) is placed at .IR s[0] . .SH SEE ALSO getlogin(3C), getpwent(3C). .\" @(#)cuserid.3s 1.4 8  the .B \-r keyletter. .AR a Requests printing of information for both removed (i.e., delta type = .IR R ; (see .IR rmdel (1)) and existing (i.e., delta type = .IR D) deltas. If the .B \-a keyletter is not specified, information for existing deltas only is provided. .PP .i0 .SH "DATA KEYWORDS" Data keywords specify which parts of an \*(S) file are to be retrieved and output. All parts of an \*(S) file (see .IR sccsfile (4)) have an associated data keyword. There is no limit on the number of times a data keyword may appear in a .IR dataspec . .PP The information printed by .I prs\^ consists of: (1) the user supplied text; and (2) appropriate values (extracted from the \*(S) file) substituted for the recognized data keywords in the order of appearance in the \f2dataspec\^\fP. The format of a data keyword value is either .I Simple\^ (S), in which keyword substitution is direct, or .I "Multi-line\^" (M), in which keyword substitution is followed by a carriage return. .PP User supplied text is any text other tha.\" @(#)_toupper.3c 1.2 .so /usr/man/u_man/man3/conv.3c .\" @(#)dabs.3f 1.2 .so /usr/man/u_man/man3/abs.3f n recognized data keywords. A tab is specified by \f3\e\|t\fP and carriage return/new line is specified by \f3\e\|n\fP. .bp .ce SCCS FILES DATA KEYWORDS .DS .PD 0 .if t .vs -1p .if n .ll 66 .if t .ll 6.5i .TS center ; c c c c c c l c c c . .sp KEYWORD DATA ITEM FILE SECTION VALUE FORMAT _ \f3:\fPDt\f3:\fP Delta information Delta Table See below* S \f3:\fPDL\f3:\fP T{ Delta line statistics T} " \f3:\fPLi\f3:\fP/\f3:\fPLd\f3:\fP/\f3:\fPLu\f3:\fP S \f3:\fPLi\f3:\fP T{ .nf Lines inserted by Delta .fi T} " nnnnn S \f3:\fPLd\f3:\fP T{ Lines deleted by Delta T} " nnnnn S \f3:\fPLu\f3:\fP T{ .nf Lines unchanged by Delta .fi T} " nnnnn S \f3:\fPDT\f3:\fP Delta type " \f2D\^\fP~or~\f2R\^\fP S \f3:\fPI\f3:\fP T{ SCCS ID string (SID) T} " \f3:\fPR\f3:.:\fPL\f3:.:\fPB\f3:.:\fPS\f3:\fP S \f3:\fPR\f3:\fP Release number " nnnn S \f3:\fPL\f3:\fP Level number " nnnn S \f3:\fPB\f3:\fP Branch number " nnnn S \f3:\fPS\f3:\fP Sequence number " nnnn S \f3:\fPD\f3:\fP T{ Date Delta created T} " \f3:\fPDy\f3:\fP/\f3:\fPDm\f3:\fP/\f3:8 .TH A64L 3C .SH NAME a64l, l64a \- convert between long integer and base-64 \s-1ASCII\s0 string .SH SYNOPSIS .BR "long a64l (" s ) .br .BR "char \(**" s ; .PP .BR "char \(**l64a (" l ) .br .BR long " l" ; .SH DESCRIPTION These functions are used to maintain numbers stored in .I base-64\^ .SM ASCII characters. This is a notation by which long integers can be represented by up to 6 characters; each character represents a ``digit'' in a radix-64 notation. .PP The characters used to represent ``digits'' are .B . for 0, .B / for 1, .B 0 through .B 9 for 2\-11, .B A through .B Z for 12\-37, and .B a through .B z for 38\-63. .PP .I A64l\^ takes a pointer to a null-terminated base-64 representation and returns a corresponding .B long value. If the string pointed to by .I s\^ contains more than 6 characters, .I a64l\^ uses the first 6. .PP .I L64a\^ takes a .B long argument and returns a pointer to the corresponding base-64 representation. If the argument is 0, .I l64a\^ returns a pointer to a null string. .SH BUGS Th.\" @(#)dacos.3f 1.2 .so /usr/man/u_man/man3/acos.3f \fPDd\f3:\fP S \f3:\fPDy\f3:\fP T{ Year Delta created T} " nn S \f3:\fPDm\f3:\fP T{ Month Delta created T} " nn S \f3:\fPDd\f3:\fP T{ Day Delta created T} " nn S \f3:\fPT\f3:\fP T{ Time Delta created T} " \f3:\fPTh\f3:\fP\f3:\fP:Tm\f3:\fP\f3:\fP:Ts\f3:\fP S \f3:\fPTh\f3:\fP T{ Hour Delta created T} " nn S \f3:\fPTm\f3:\fP T{ Minutes Delta created T} " nn S \f3:\fPTs\f3:\fP T{ Seconds Delta created T} " nn S \f3:\fPP\f3:\fP T{ .nf Programmer who created Delta .fi T} " logname S \f3:\fPDS\f3:\fP T{ Delta seq. # T} " nnnn S \f3:\fPDP\f3:\fP T{ .nf Predecessor Delta seq. # .fi T} " nnnn S \f3:\fPDI\f3:\fP T{ Seq. # of deltas incl., excl., ignored T} " \f3:\fPDn\f3:\fP/\f3:\fPDx\f3:\fP/\f3:\fPDg\f3:\fP S \f3:\fPDn\f3:\fP T{ .nf Deltas included (seq. #) .fi T} " \f3:\fPDS\f3:\fP~\f3:\fPDS\f3:\fP\|\f3.\^.\^.\fP S \f3:\fPDx\f3:\fP T{ .nf Deltas excluded (seq. #) .fi T} " \f3:\fPDS\f3:\fP~\f3:\fPDS\f3:\fP\|\f3.\^.\^.\fP S \f3:\fPDg\f3:\fP T{ .nf Deltas ignored (seq. #) .fi T} " \f3:\fPDS\f3:\fP~\f3:\fPDS\f3:\fP\|\f3.\e value returned by .I l64a\^ is a pointer into a static buffer, the contents of which are overwritten by each call. .\" @(#)a64l.3c 1.4 9 .\" @(#)dasin.3f 1.2 .so /usr/man/u_man/man3/asin.3f ^.\^.\fP S \f3:\fPMR\f3:\fP MR numbers for delta " text M \f3:\fPC\f3:\fP Comments for delta " text M \f3:\fPUN\f3:\fP User names User Names text M \f3:\fPFL\f3:\fP Flag list Flags text M \f3:\fPY\f3:\fP Module type flag " text S \f3:\fPMF\f3:\fP T{ MR validation flag T} " \f2yes\^\fP~or~\f2no\^\fP S \f3:\fPMP\f3:\fP T{ .nf MR validation pgm name .fi T} " text S \f3:\fPKF\f3:\fP T{ .nf Keyword error/ warning flag .fi T} " \f2yes\^\fP~or~\f2no\^\fP S \f3:\fPBF\f3:\fP Branch flag " \f2yes\^\fP~or~\f2no\^\fP S \f3:\fPJ\f3:\fP Joint edit flag " \f2yes\^\fP~or~\f2no\^\fP S \f3:\fPLK\f3:\fP Locked releases " \f3:\fPR\f3:\fP\|\f3.\^.\^.\fP S \f3:\fPQ\f3:\fP User defined keyword " text S \f3:\fPM\f3:\fP Module name " text S \f3:\fPFB\f3:\fP Floor boundary " \f3:\fPR\f3:\fP S \f3:\fPCB\f3:\fP Ceiling boundary " \f3:\fPR\f3:\fP S \f3:\fPDs\f3:\fP Default SID " \f3:\fPI\f3:\fP S \f3:\fPND\f3:\fP Null delta flag " \f2yes\^\fP~or~\f2no\^\fP S \f3:\fPFD\f3:\fP T{ File descriptive text T} Comments text M \f3:\fPBD\f3:\fP Bo.TH ABORT 3C .SH NAME abort \- generate an \s-1IOT\s0 fault .SH SYNOPSIS .B int abort ( ) .SH DESCRIPTION .I Abort\^ causes an \s-1IOT\s0 signal to be sent to the process. This usually results in termination with a core dump. .PP It is possible for .I abort\^ to return control if .SM .B SIGIOT is caught or ignored, in which case the value returned is that of the .IR kill (2) system call. .SH "SEE ALSO" adb(1), exit(2), kill(2), signal(2). .SH DIAGNOSTICS If .SM .B SIGIOT is neither caught nor ignored, and the current directory is writable, a core dump is produced and the message .BR "abort \- core dumped" " is" written by the shell. .\" @(#)abort.3c 1.4 .\" @(#)datan.3f 1.2 .so /usr/man/u_man/man3/atan.3f 9 dy Body text M \f3:\fPGB\f3:\fP Gotten body " text M \f3:\fPW\f3:\fP T{ A form of \f2what\^\fP(1) string T} N/A \f3:\fPZ\f3:\fP\f3:\fPM\f3:\fP\e\|t\f3:\fPI\f3:\fP S \f3:\fPA\f3:\fP T{ A form of \f2what\^\fP(1) string T} N/A \f3:\fPZ\f3:\fP\f3:\fPY\f3:\fP~\f3:\fPM\f3:\fP~\f3:\fPI\f3:\fP\f3:\fPZ\f3:\fP S \f3:\fPZ\f3:\fP T{ \f2what\^\fP(1) string delimiter T} N/A @\&(#) S \f3:\fPF\f3:\fP SCCS filename N/A text S \f3:\fPPN\f3:\fP SCCS file pathname N/A text S .TE .sp .5v * \f3:\fPDt\f3:\fP~=~\f3:\fPDT\f3:\fP~\f3:\fPI\f3:\fP~\f3:\fPD\f3:\fP~\f3:\fPT\f3:\fP~\f3:\fPP\f3:\fP~\f3:\fPDS\f3:\fP~\f3:\fPDP\f3:\fP .DE .if t .ps +1 .if t .vs +1p .SH EXAMPLES The command .IP \f3prs \-d``Users and/or user \s-1ID\s+1s for :F: are:\e\|n:\s-1UN\s+1:'' s.file .PP may produce on the standard output: .PP .RS .nf \f3Users and/or user \s-1ID\s+1s for s.file are:\f1 \f3xyz\f1 \f3131\f1 \f3abc\f1 .fi .RE .PP The command .IP \f3prs \-d``Newest delta for pgm :M:: :I: Created :D: By :P:'' \-r s.file\f1 .PP may produce on the standard outp.TH ABORT 3F .SH NAME abort \- terminate FORTRAN program .SH SYNOPSIS .B "call abort ( )" .SH DESCRIPTION .I Abort\^ terminates the program which calls it, closing all open files, truncated to the current position of the file pointer. .SH DIAGNOSTICS When invoked, .I abort\^ prints .RB `` "Fortran abort routine called" '' on the standard error output. .SH SEE ALSO abort(3C). .\" @(#)abort.3f 1.5 .\" @(#)datan2.3f 1.2 .so /usr/man/u_man/man3/atan2.3f ut: .IP \f3Newest delta for pgm main.c: 3.7 Created 77/12/1 By cas\f1 .PP As a \f2special case:\^\fP .IP \f3prs s.file\f1 .PP may produce on the standard output: .PP .RS .nf \f3D 1.1 77/12/1 00:00:00 cas 1 000000/00000/00000\f1 \f3\s-1MR\s+1s:\f1 \f3bl78-12345\f1 \f3bl79-54321\f1 \f3\s-1COMMENTS\s+1:\f1 \f2this is the comment line for s.file initial delta\f1 .fi .RE .PP for each delta table entry of the ``D'' type. Only the .B \-a keyletter argument can be used with the .IR "special case" . .PP .SH FILES .RE .TP 10 /tmp/pr????? .i0 .SH "SEE ALSO" admin(1), delta(1), get(1), help(1), rmdel(1), sccsfile(4). .br ``Source Code Control System User's Guide'' in the .IR "\*(6) User's Guide" . .SH DIAGNOSTICS Use .IR help (1) for explanations. .tr ~~ .\" @(#)prs.1 1.12 : .TH ABS 3C .SH NAME abs \- return integer absolute value .SH SYNOPSIS .BR "int abs (" i ) .br .BR int " i" ; .SH DESCRIPTION .I Abs\^ returns the absolute value of its integer operand. .SH BUGS In two's-complement representation, the absolute value of the negative integer with largest magnitude is undefined. Some implementations trap this error, but others simply ignore it. .SH SEE ALSO floor(3M). .\" @(#)abs.3c 1.3 dble.3fdcmplx.3fdconjg.3fdcos.3fdcosh.3fdexp.3fdial.3cdimag.3fdint.3fdlog.3fdlog10.3f.TH PS 1 .SH NAME ps \- report process status .SH SYNOPSIS .B ps [ options ] .SH DESCRIPTION .I Ps\^ prints information about active processes. Without .IR options , information is printed about processes associated with the current terminal. Otherwise, the displayed information is controlled by the following .IR options : .PP .PD 0 .TP 15 .B \-e Print information about all processes. .TP .B \-d Print information about all processes, except process group leaders. .TP .B \-a Print information about all processes, except process group leaders and processes not associated with a terminal. .TP .B \-f Generate a .I full\^ listing. Normally, a short listing containing only process .SM ID\*S, terminal (``tty'') identifier, cumulative execution time, and the command name is printed. See below for meaning of columns in a full listing. .TP .B \-l Generate a .I long\^ listing. See below. .TP .BI \-c " corefile\^" Use the file .I corefile\^ in place of .BR /dev/mem . .TP .BI \-s " swapdev\^" Use the file .I swapdev\^ in.TH ABS 3F .SH NAME abs, iabs, dabs, cabs, zabs \- Fortran absolute value .SH SYNOPSIS .nf .BR "integer" " i1, i2" .BR "real" " r1, r2" .BR "double precision" " dp1, dp2" .BR "complex" " cx1, cx2" .BR "double complex" " dx1, dx2" .P .RB "r2" " = abs(" "r1" ")" .P .RB "i2" " = iabs(" "i1" ")" .RB "i2" " = abs(" "i1" ")" .P .RB "dp2" " = dabs(" "dp1" ")" .RB "dp2" " = abs(" "dp1" ")" .P .RB "cx2" " = cabs(" "cx1" ")" .RB "cx2" " = abs(" "cx1" ")" .P .RB "dx2" " = zabs(" "dx1" ")" .RB "dx2" " = abs(" "dx1" ")" .SH DESCRIPTION .I Abs\^ is the family of absolute value functions. .I Iabs\^ returns the integer absolute value of its integer argument. .I Dabs\^ returns the double-precision absolute value of its double-precision argument. .I Cabs\^ returns the complex absolute value of its complex argument. .I Zabs\^ returns the double-complex absolute value of its double-complex argument. The generic form .I abs\^ returns the type of its argument. .SH SEE ALSO floor(3M). .\" @(#)abs.3f 1.3 : 2VSPMJGDA>;852/,)&#   place of .BR /dev/swap . This is useful when examining a .IR corefile ; a .I swapdev\^ of .B /dev/null\^ causes the user block to be zeroed out. .TP .BI \-n " namelist\^" The argument is taken as the name of an alternate .I namelist\^ .RB ( /unix is the default). .TP .BI \-t " tlist\^" Restrict listing to data about the processes associated with the terminals given in .IR tlist , where .I tlist\^ can be in one of two forms: a list of terminal identifiers separated by commas, or a list of terminal identifiers enclosed in double quotes and separated by a comma and/or one or more spaces. .TP .BI \-p " plist\^" Restrict listing to data about processes whose process .SM ID numbers are given in .IR plist , where .I plist\^ is in the same format as .IR tlist . .TP .BI \-u " ulist\^" Restrict listing to data about processes whose user .SM ID numbers or login names are given in .IR ulist , where .I ulist\^ is in the same format as .IR tlist . In the listing, the numerical user .SM ID is printed unless the .B \-f opt.TH ACOS 3F .SH NAME acos, dacos \- Fortran arccosine intrinsic function .SH SYNOPSIS .nf .BR "real" " r1, r2" .BR "double precision" " dp1, dp2" .P .RB "r2" " = acos(" "r1" ")" .P .RB "dp2" " = dacos(" "dp1" ")" .RB "dp2" " = acos(" "dp1" ")" .SH DESCRIPTION .I Acos\^ returns the real arccosine of its real argument. .I Dacos\^ returns the double-precision arccosine of its double-precision argument. The generic form .I acos\^ may be used with impunity because its argument determines the type of the returned value. .SH SEE ALSO trig(3M). .\" @(#)acos.3f 1.4 .\" @(#)dcmplx.3f 1.2 .so /usr/man/u_man/man3/ftype.3f ; ion is used, in which case the login name is printed. .TP .BI \-g " glist\^" Restrict listing to data about processes whose process groups are given in .IR glist , where .I glist\^ is a list of process group leaders and is in the same format as .IR tlist . .PD .PP The column headings and the meaning of the columns in a .I ps\^ listing are given below; the letters .B f and .B l indicate the option .RI ( full\^ or .IR long ) that causes the corresponding heading to appear; .B all means that the heading always appears. Note that these two options only determine what information is provided for a process; they do .I not\^ determine which processes are to be listed. .ta .65i .ne 7 .PP .PD 0 .TP 16 .SM .BR F\*S " (l)" Flags (octal and additive) associated with the process: .RS 20 .TP 6 01 in core .TP 6 02 system process .TP 6 04 locked in core (e.g., for physical .SM I/O\*S) .TP 6 10 being swapped .TP 6 20 being traced by another process .TP 6 40 another tracing flag .RE .TP .SM .BR S\*S " (l)" The state of the pro.\" @(#)acos.3m 1.2 .so /usr/man/u_man/man3/trig.3m .\" @(#)dconjg.3f 1.2 .so /usr/man/u_man/man3/conjg.3f cess: .RS 20 .TP 6 0 non-existent .TP 6 S sleeping .TP 6 W waiting .TP 6 R running .TP 6 I intermediate .TP 6 Z terminated .TP 6 T stopped .TP 6 X growing .RE .br .ne 2 .TP .SM .BR UID\*S " (f,l)" The user .SM ID number of the process owner; the login name is printed under the .B \-f option. .TP .SM .BR PID\*S " (all)" The process .SM ID of the process; it is possible to kill a process if you know the \fBPID\fR. .TP .SM .BR PPID\*S " (f,l)" The process .SM ID of the parent process. .TP .SM .BR C\*S " (f,l)" Processor utilization for scheduling. .TP .SM .BR STIME\*S " (f)" Starting time of the process. .TP .SM .BR PRI\*S " (l)" The priority of the process; higher numbers mean lower priority. .TP .SM .BR NI\*S " (l)" Nice value; used in priority computation. .TP .SM .BR ADDR\*S " (l)" The memory address of the process (a pointer to the segment table array on the 3B20S), if resident; otherwise, the disk address. .TP .SM .BR SZ\*S " (l)" The size in blocks of the core image of the process. .TP .SM .BR WCHAN\*S " ; .TH AIMAG 3F .SH NAME aimag, dimag \- FORTRAN imaginary part of complex argument .SH SYNOPSIS .nf .BR "real" " r" .BR "complex" " cxr" .BR "double precision" " dp" .BR "double complex" " cxd" .P .RB "r" " = aimag(" "cxr" ")" .P .RB "dp" " = dimag(" "cxd" ")" .SH DESCRIPTION .I Aimag\^ returns the imaginary part of its single-precision complex argument. .I Dimag\^ returns the double-precision imaginary part of its double-complex argument. .\" @(#)aimag.3f 1.4 .\" @(#)dcos.3f 1.2 .so /usr/man/u_man/man3/cos.3f (l)" The event for which the process is waiting or sleeping; if blank, the process is running. .TP .SM .BR TTY\*S " (all)" The controlling terminal for the process. .TP .SM .BR TIME\*S " (all)" The cumulative execution time for the process. .TP .SM .BR CMD\*S " (all)" The command name; the full command name and its arguments are printed under the .B \-f option. .DT .PD .PP A process that has exited and has a parent, but has not yet been waited for by the parent, is marked .BR . .PP Under the .B \-f option, .I ps\^ tries to determine the command name and arguments given when the process was created by examining memory or the swap area. Failing this, the command name, as it would appear without the .B \-f option, is printed in square brackets. .SH FILES .PD 0 .TP "\w'/etc/ps_data\ \ \ 'u" /unix system namelist. .TP /dev/mem memory. .TP /dev/swap the default swap device. .TP /etc/passwd supplies \s-1UID\s+1 information. .TP /etc/ps_data internal data structure. .TP /dev searched to find terminal (``tt.TH AINT 3F .SH NAME aint, dint \- FORTRAN integer part intrinsic function .SH SYNOPSIS .nf .BR "real" " r1, r2" .BR "double precision" " dp1, dp2" .P .RB "r2" " = aint(" "r1" ")" .P .RB "dp2" " = dint(" "dp1" ")" .RB "dp2" " = aint(" "dp1" ")" .SH DESCRIPTION .I Aint\^ returns the truncated value of its real argument in a real. .I Dint\^ returns the truncated value of its double-precision argument as a double-precision value. .I Aint\^ may be used as a generic function name, returning either a real or double-precision value depending on the type of its argument. .\" @(#)aint.3f 1.4 < .\" @(#)dcosh.3f 1.2 .so /usr/man/u_man/man3/cosh.3f y'') names. .DT .PD .SH SEE ALSO kill(1), nice(1). .SH BUGS Things can change while .I ps\^ is running; the picture it gives is only a close approximation to reality. Some data printed for defunct processes are irrelevant. .\" @(#)ps.1 1.4 .\" @(#)alog.3f 1.2 .so /usr/man/u_man/man3/log.3f .\" @(#)dexp.3f 1.2 .so /usr/man/u_man/man3/exp.3f < .TH PTX 1 .SH NAME ptx \- permuted index .SH SYNOPSIS .B ptx [ options ] [ input [ output ] ] .SH DESCRIPTION .I Ptx\^ generates the file .I output\^ that can be processed with a text formatter to produce a permuted index of file .I input\^ (standard input and output default). It has three phases: the first does the permutation, generating one line for each keyword in an input line. The keyword is rotated to the front. The permuted file is then sorted. Finally, the sorted lines are rotated so the keyword comes at the middle of each line. .I Ptx\^ output is in the form: .br .IP \&\f3.xx\fP ``tail'' ``before keyword'' ``keyword and after'' ``head'' .PP where .B \&.xx is assumed to be an .I nroff\^ or .IR troff (1) macro provided by the user, or provided by the .IR mptx (5) macro package. The .I "before keyword\^" and .I "keyword and after\^" fields incorporate as much of the line as will fit around the keyword when it is printed. .I Tail\^ and .IR head , at least one of which is always the empty string, are wra.\" @(#)alog10.3f 1.2 .so /usr/man/u_man/man3/log10.3f .TH DIAL 3C .SH NAME dial \- establish an out-going terminal line connection .SH SYNOPSIS .B #include .PP .BR "int dial (" call ) .br .BR "\s-1CALL\s+1 \(**" call ; .PP .BR "void undial (" fd ) .br .BR int " fd" ; .SH DESCRIPTION .I Dial\^ returns a file descriptor for a terminal line open for read/write. The argument to .I dial\^ is a \s-1CALL\s+1 structure (defined in the .B header file. .P When finished with the terminal line, the calling program must invoke .I undial\^ to release the semaphore that has been set during the allocation of the terminal device. .PP The .SM CALL typedef in the .B \^ header file is: .PP .nf .ta .5i 1.8i 2.2i 2.8i \f3typedef struct {\f1 \f3struct termio \(**attr;\f1 /\(** pointer to termio attribute struct \(**/ \f3int baud;\f1 /\(** transmission data rate \(**/ \f3int speed;\f1 /\(** 212A modem: low=300, high=1200 \(**/ \f3char \(**line;\f1 /\(** device name for out-going line \(**/ \f3char \(**telno;\f1 /\(** pointer to tel-no digits string \pped-around pieces small enough to fit in the unused space at the opposite end of the line. .PP The following \fIoptions\fP can be applied: .TP 11 .BR \-f Fold upper and lower case letters for sorting. .TP .BR \-t Prepare the output for the phototypesetter. .TP .BI \-w " n\^" Use the next argument, .IR n , as the length of the output line. The default line length is 72 characters for .I nroff\^ and 100 for .IR troff . .TP .BI \-g " n\^" Use the next argument, .IR n , as the number of characters that .I ptx\^ reserves in its calculations for each gap among the four parts of the line as finally printed. The default gap is 3. .TP .BI \-o " only\^" Use as keywords only the words given in the \fIonly\fR file. .TP .BI \-i " ignore\^" Do not use as keywords any words given in the .I ignore file. If the .B \-i and .B \-o options are missing, use .B /usr/lib/eign as the .I ignore file. .TP .BI \-b " break\^" Use the characters in the .I break file to separate words. Tab, new-line, and space characters are always used = .\" @(#)amax0.3f 1.2 .so /usr/man/u_man/man3/max.3f (**/ \f3int modem;\f1 /\(** specify modem control for direct lines \(**/ \f3} \s-1CALL\s+1;\f1 .fi .PP The \s-1CALL\s+1 element .I speed\^ is intended only for use with an outgoing dialed call, in which case its value should be either 300 or 1200 to identify the 113A modem, or the high-speed or low-speed setting on the 212A modem. The \s-1CALL\s+1 element .I baud is for the desired transmission baud rate. For example, one might set .I baud\^ to 110 and .I speed\^ to 300 (or 1200). .P If the desired terminal line is a direct line, a string pointer to its device name should be placed in the .I line\^ element in the \s-1CALL\s+1 structure. Legal values for such terminal device names are kept in the .I L-devices\^ file. In this case, the value of the .I baud\^ element need not be specified as it will be determined from the .I L-devices\^ file. .P The .I telno\^ element is for a pointer to a character string representing the telephone number to be dialed. Such numbers may consist only of symbols described on the as break characters. .TP .BR \-r Take any leading non-blank characters of each input line to be a reference identifier (e.g., a page or chapter reference), separate from the text of the line. Attach the reference identifier as a 5th field on each output line. .PP The index for this manual was generated using .IR ptx . .SH FILES /bin/sort .br /usr/lib/eign .br /usr/lib/tmac/tmac.ptx .PD .SH SEE ALSO .PD 0 nroff(1), troff(1), mm(5), mptx(5). .PD .SH BUGS Line length counts do not account for overstriking or proportional spacing. .br Lines that contain tildes (\f3~\fP) are botched, because . I ptx uses that character internally. .\" @(#)ptx.1 1.4 .\" @(#)amax1.3f 1.2 .so /usr/man/u_man/man3/max.3f = .IR acu (7). The termination symbol will be supplied by the .I dial\^ function, and should not be included in the .I telno\^ string passed to .I dial\^ in the \s-1CALL\s+1 structure. .P The \s-1CALL\s+1 element .I modem\^ is used to specify modem control for direct lines. This element should be non-zero if modem control is required. The \s-1CALL\s+1 element .I attr\^ is a pointer to a .I termio\^ structure, as defined in the .B \^ header file. A \s-1NULL\s+1 value for this pointer element may be passed to the .I dial\^ function, but if such a structure is included, the elements specified in it will be set for the outgoing terminal line before the connection is established. This is important for attributes such as parity and baud rate. .SH FILES /usr/lib/uucp/L-devices .br /usr/spool/uucp/\s-1LCK\s+1..\fItty-device\fP .SH "SEE ALSO" uucp(1C), alarm(2), read(2), write(2). .br termio(7) in the .IR "\*(6) Administrator's Manual" . .SH DIAGNOSTICS On failure, a negative value indicating the reason for th.TH PWD 1 .SH NAME pwd \- working directory name .SH SYNOPSIS .B pwd .SH DESCRIPTION .I Pwd\^ prints the pathname of the working (current) directory. .SH "SEE ALSO" cd(1). .SH DIAGNOSTICS .B "Cannot open .." and .B "Read error in .." indicate possible file system trouble. These messages should be referred to a system programming counselor. .\" @(#)pwd.1 1.3 .\" @(#)amin0.3f 1.2 .so /usr/man/u_man/man3/min.3f e failure is returned. Mnemonics for these negative indices as listed here are defined in the .B header file. .PP .nf .ta .5i 1.3i 2.0i \f3\s-1INTRPT\s+1 \-1\f1 /\(** interrupt occured \(**/ \f3\s-1D_HUNG\s+1 \-2\f1 /\(** dialer hung (no return from write) \(**/ \f3\s-1NO_ANS\s+1 \-3\f1 /\(** no answer within 10 seconds \(**/ \f3\s-1ILL_BD\s+1 \-4\f1 /\(** illegal baud-rate \(**/ \f3\s-1A_PROB\s+1 \-5\f1 /\(** acu problem (open() failure) \(**/ \f3\s-1L_PROB\s+1 \-6\f1 /\(** line problem (open() failure) \(**/ \f3\s-1NO_L\s+1dv \-7\f1 /\(** can't open \s-1LDEVS\s+1 file \(**/ \f3\s-1DV_NT_A\s+1 \-8\f1 /\(** requested device not available \(**/ \f3\s-1DV_NT_K\s+1 \-9\f1 /\(** requested device not known \(**/ \f3\s-1NO_BD_A\s+1 \-10\f1 /\(** no device available at requested baud \(**/ \f3\s-1NO_BD_K\s+1 \-11\f1 /\(** no device known at requested baud \(**/ .fi .SH WARNINGS Including the .B \^ header file automatically includes the .B \^ header file. .PP Because the above ro> .TH RATFOR 1 .SH NAME ratfor \- rational FORTRAN dialect .SH SYNOPSIS .B ratfor [ options ] [ files ] .SH DESCRIPTION .I Ratfor\^ converts a rational dialect of \s-1FORTRAN\s+1 into ordinary irrational \s-1FORTRAN\s+1. .I Ratfor\^ provides control flow constructs essentially identical to those in C: .RS .TP \(bu\|\|\|statement grouping: \f3{\f2 statement\f3;\f2 statement\f3;\f2 statement\f3 }\f1 .TP \(bu\|\|\|decision-making: .nf \f3if\fP (\f2condition\f1)\f2 statement\f1 [ \f3else\f2 statement\f1 ] \f3switch\fP (\f2integer value\f1)\f3 { \f3case\f2 integer\f3:\f2 statement\f1 ... [ \f3default\fP: ] \f2statement\f1 \f3}\f1 .fi .TP \(bu\|\|\|loops: .br .nf \f3while\fP (\f2condition\f1) \f2statement\f1 \f3for\fP (\f2expression\f3;\f2 condition\f3;\f2 expression\f1)\f2 statement\f1 \f3do\f2 limits statement\f1 \f3repeat\f2 statement\f1 [ \f3until\fP (\f2condition\f1) ] \f3break\fP \f3next\fP .fi .RE .PP and some syntactic sugar to make programs easier to read and write: .RS .TP \(bu\|\|\|free form input: mult.\" @(#)amin1.3f 1.2 .so /usr/man/u_man/man3/min.3f utine uses \fB\fP, the size of programs not otherwise using standard I/O is increased more than might be expected. .SH BUGS An .IR alarm (2) system call for 3,600 seconds is made (and caught) within the .I dial\^ module for the purpose of ``touching'' the \fI\s-1LCK\s+1..\fP file and constitutes the device allocation semaphore for the terminal device. Otherwise, .IR uucp (1C) may simply delete the \fI\s-1LCK\s+1..\fP entry on its 90-minute clean-up rounds. The alarm may go off while the user program is in a .IR read (2) or .IR write (2) system call, causing an apparent error return. If the user program is to run for an hour or more, error returns from .IR read s should be checked for \fB(errno==\s-1EINTR\s+1)\fP, and the .I read\^ possibly reissued. .\" @(#)dial.3c 1.8 iple statements/line; automatic continuation .TP \(bu\|\|\|comments: .B # \f2This is a comment.\f1 .TP \(bu\|\|\|translation of relationals: for example, .BR > , .BR >= , become .BR .\s-1GT\s+1. , .BR .\s-1GE\s+1. . .TP \(bu\|\|\|return expression to caller from function: \f3return\fP (\f2expression\f1) .TP \(bu\|\|\|define: .br .B define .I name replacement\^ .TP \(bu\|\|\|include: .br .B include .I file\^ .RE .PP The option .B \-h causes quoted strings to be turned into .B 27H constructs. The .B \-C option copies comments to the output and attempts to format it neatly. Normally, continuation lines are marked with a .B & in column 1; the option .B \-6x makes the continuation character .B x and places it in column 6. .PP .I Ratfor\^ is best used with .IR f77 (1). .SH SEE ALSO ef\&l(1), f77(1). .br B. W. Kernighan and P. J. Plauger, ``Software Tools'', Addison-Wesley, 1976. .br ``\s-1FORTRAN\s+1'' in the .IR "\*(6) Programming Guide" . .\" @(#)ratfor.1 1.6 > .\" @(#)amod.3f 1.2 .so /usr/man/u_man/man3/mod.3f .\" @(#)dimag.3f 1.2 .so /usr/man/u_man/man3/aimag.3f .\" @(#)red.1 1.2 .so /usr/man/u_man/man1/ed.1 .\" @(#)and.3f 1.2 .so /usr/man/u_man/man3/bool.3f ? .\" @(#)dint.3f 1.2 .so /usr/man/u_man/man3/aint.3f .TH REGCMP 1 .SH NAME regcmp \- regular expression compile .SH SYNOPSIS .B regcmp [ .B \- ] files .SH DESCRIPTION .IR Regcmp , in most cases, precludes the need for calling .IR regcmp (3X) from C programs. This saves both execution time and program size. The command .I regcmp\^ compiles the regular expressions in .I file\^ and places the output in .IB file .i\fR.\fP If the \fB\-\fP option is used, the output is placed in .IB file .c\fR.\fP The format of entries in .I file\^ is a name (C variable), followed by one or more blanks, followed by a regular expression enclosed in double quotes. The output of .I regcmp\^ is C source code. Compiled regular expressions are represented as .B "extern char" vectors. .IB File .i files may thus be .I included\^ into C programs, or .IB file .c files may be compiled and later loaded. In the C program which uses the .I regcmp\^ output, .IR regex ( abc , line ) applies the regular expression named .I abc\^ to .IR line . Diagnostics are self-explanatory. .SH EXAMPLES .TP "\w'tel.\" @(#)anint.3f 1.2 .so /usr/man/u_man/man3/round.3f .\" @(#)dlog.3f 1.2 .so /usr/man/u_man/man3/log.3f ? no\ \ \ \ 'u" name ``([A\-Za\-z][A\-Za\-z0\-9\_]\(**)$0'' .TP telno ``\\({0,1}([2\-9][01][1\-9])$0\\){0,1} \(**'' .br ``([2\-9][0\-9]{2})$1[ \-]{0,1}'' .br ``([0\-9]{4})$2'' .TP In the C program that uses the \fIregcmp\fP output, .PP .RS \f3regex(telno, line, area, exch, rest)\f1 .RE .PP applies the regular expression named \f3telno\f1 to \f3line\f1. .SH SEE ALSO regcmp(3X). .\" @(#)regcmp.1 1.4 .\" @(#)asctime.3c 1.2 .so /usr/man/u_man/man3/ctime.3c .\" @(#)dlog10.3f 1.2 .so /usr/man/u_man/man3/log10.3f .TH RM 1 .SH NAME rm, rmdir \- remove files or directories .SH SYNOPSIS .B rm [ .B \-fri ] file ... .PP .B rmdir dir ... .PP .SH DESCRIPTION .I Rm\^ removes the entries for one or more files from a directory. If an entry is the last link to the file, the file is destroyed. Removal of a file requires write permission in its directory, but neither read nor write permission on the file itself. .PP If a file has no write permission and the standard input is a terminal, its permissions are printed and a line is read from the standard input. If that line begins with \f3y\fP the file is deleted; otherwise, the file remains. No questions are asked when the .B \-f option is given or if the standard input is not a terminal. .PP If a designated file is a directory, an error comment is printed unless the optional argument .B \-r has been used. When \f3\-r\f1 is used, .I rm\^ recursively deletes the entire contents of the specified directory, and the directory itself. To remove a directory, you must be located at the ne@ .TH ASIN 3F .SH NAME asin, dasin \- FORTRAN arcsine intrinsic function .SH SYNOPSIS .nf .BR "real" " r1, r2" .BR "double precision" " dp1, dp2" .P .RB "r2" " = asin(" "r1" ")" .P .RB "dp2" " = dasin(" "dp1" ")" .RB "dp2" " = asin(" "dp1" ")" .SH DESCRIPTION .I Asin\^ returns the real arcsine of its real argument. .I Dasin\^ returns the double-precision arcsine of its double-precision argument. The generic form .I asin\^ may be used with impunity as it derives its type from that of its argument. .SH SEE ALSO trig(3M). .\" @(#)asin.3f 1.4 B \-q Report average queue length while occupied, and % of time occupied: .br runq-sz, %runocc \- run queue of processes in memory and runnable; .br swpq-sz, %swpocc \- swap queue of processes swapped out but ready to run. .sp .TP .B \-v Report status of text, process, inode and file tables: .br text-sz, proc-sz, inod-sz, file-sz \- entries/size for each table, evaluated once at sampling point; .br text-ov, proc-ov, inod-ov, file-ov \- overflows occurring between sampling points. .sp .TP .B \-m Report message and semaphore activities: .br msg/s, sema/s \- primitives per second. .sp .TP .B \-A Report all data. Equivalent to .BR \-udqbwcayvm . .SH EXAMPLES To see today's .SM CPU activity so far: .PP .RS .B sar .RE .PP To watch .SM CPU activity evolve for 10 minutes and save data: .PP .RS .B "sar \|\-o temp 60 10" .RE .PP To later review disk and tape activity from that period: .PP .RS .B "sar \|\-d \|\-f temp" .RE .SH FILES .TP 18 .RI /usr/adm/sa/sa dd\^ daily data file, where .I dd\^ are digits representing txt higher level (parent directory) in the directory hierarchy. You cannot be located in the directory you are trying to remove. For example, if the full pathname of a directory is \f3/top/next\f1, you must be in \f3/top\f1 to remove the directory \f3next\f1. .PP If the .B \-i (interactive) option is in effect, .I rm\^ asks whether to delete each file. The name of the file is printed on the terminal followed by a colon. If you do not want to delete the file, press the carriage return. If you do want to delete the file, type input that begins with the letter ``\f3y\f1''. The \f3\-i\f1 option can be used in combination with the \f3\-r\f1 option to interactively delete directories. When the command \f3rm \-ir\f2 directory name\f1 is given, the message \f3directory\f2 directory name\f3:\f1 is printed on the terminal. As with interactive file deletion, type either input beginning with the letter \f3y\f1 or a carriage return alone to delete or not delete a directory. .PP .I Rmdir\^ removes entries for the name.\" @(#)asin.3m 1.2 .so /usr/man/u_man/man3/trig.3m @ he day of the month. .SH SEE ALSO sag(1G). .br sar(1M) in the .IR "\*(6) Administrator's Manual" . .\" @(#)sar.1 1.6 d directories, which must be empty. .SH SEE ALSO unlink(2). .SH DIAGNOSTICS Generally self-explanatory. It is forbidden to remove the file \f3..\fP merely to avoid the consequences of inadvertently doing something like: .PP .RS .B "rm \-r .\(**" .RE .\" @(#)rm.1 1.4 2UROLIFC@=:741.+(%"  .TH SCAT 1 .SH NAME scat \- concatenate and print files on synchronous printer .SH SYNOPSIS .B scat [ .B \-u ] [ .B \-s ] file .\|.\|. .SH DESCRIPTION .I Scat\^ reads each .I file\^ in sequence and writes it on the standard output, which is assumed to be a synchronous printer device. Thus: .PP .RS .B "scat file > /dev/sp0" .RE .PP prints the file, and: .PP .RS .B "scat file1 file2 > /dev/sp0" .RE .PP concatenates .I file1\^ and .I file2\^ and places the result on the printer. .PP If no input file is given, or if the argument .B \- is encountered, .I scat\^ reads from the standard input file. Output is buffered in 512-byte blocks unless the .B \-u option is specified. The .B \-s option makes .I scat\^ silent about non-existent files. .SH SEE ALSO cp(1), pr(1), stty(1). .SH WARNINGS .I Scat\^ uses synchronous printers in line mode with the wrap around option enabled. This means that the maximum line length is 79 characters; longer lines are wrapped back to the beginning of the next line each time the end of a pA .\" @(#)rmail.1 1.2 .so /usr/man/u_man/man1/mail.1 .TH ATAN 3F .SH NAME atan, datan \- FORTRAN arctangent intrinsic function .SH SYNOPSIS .nf .BR "real" " r1, r2" .BR "double precision" " dp1, dp2" .P .RB "r2" " = atan(" "r1" ")" .P .RB "dp2" " = datan(" "dp1" ")" .RB "dp2" " = atan(" "dp1" ")" .SH DESCRIPTION .I Atan\^ returns the real arctangent of its real argument. .I Datan\^ returns the double-precision arctangent of its double-precision argument. The generic form .I atan\^ may be used with a double-precision argument returning a double-precision value. .SH SEE ALSO trig(3M). .\" @(#)atan.3f 1.4 rinter line is reached. .\" @(#)scat.1 1.3 .TH RMDEL 1 .SH NAME rmdel \- remove a delta from an \s-1SCCS\s+1 file .SH SYNOPSIS .B rmdel .if n .ul \fB\-r\fR\c .if n .ul 0 \s-1SID\s0 files .SH DESCRIPTION .I Rmdel\^ removes the delta specified by the .SM \fISID\fP from each named \s-1SCCS\s+1 file. The delta to be removed must be the newest (most recent) delta in its branch in the delta chain of each named \s-1SCCS\s+1 file. In addition, the specified .SM \fISID\fR must not be that of a version being edited for the purpose of making a delta (i. e., if a .I p-file\^ (see .IR get (1)) exists for the named \s-1SCCS\s+1 file, the specified .SM \fISID\fR must .I not\^ appear in any entry of the .I p-file\c\^ ). .PP If a directory is named, .I rmdel\^ behaves as though each file in the directory were specified as a named file, except that non-\s-1SCCS\s+1 files (last component of the pathname does not begin with \fBs.\fR) and unreadable files are silently ignored. If a name of \fB\-\fR is given, the standard input is read; each line of the standard input is tA .\" @(#)atan.3m 1.2 .so /usr/man/u_man/man3/trig.3m .TH SCC 1 .SH NAME scc \- C compiler for stand-alone programs .SH SYNOPSIS .B scc [ .B +\c [ lib ] ] [ option ] ... [ file ] ... .SH DESCRIPTION .I Scc\^ prepares the named files for stand-alone execution. The .I option\^ and .I file\^ arguments may be anything that can legally be used with the .I cc\^ command; it should be noted, though, that the .B \-p (profiling) option, as well as any object module that contains system calls, causes the executable not to run. .PP .I Scc\^ defines the compiler constant, .BR \s-1STANDALONE\s+1 , so that sections of C programs may be compiled conditionally when the executable is run stand-alone. .PP The first argument specifies an auxiliary library that defines the device configuration of the computer for which the stand-alone executable is being prepared. .I Lib\^ may be one of the following: .TP 8 .B A .SM RP\*S04/05/06 disk and .SM TU\*S16 magnetic tape, or equivalent on the \s-1PDP\s+1-11 plus \s-1RM\s+105 and \s-1RM\s+180 disks, and \s-1TU\s+178 and \s-1TS\s+111 tapes, aken to be the name of an \s-1SCCS\s+1 file to be processed; non-\s-1SCCS\s+1 files and unreadable files are silently ignored. .PP The exact permissions necessary to remove a delta are documented in the ``Source Code Control System User's Guide''. Simply stated, if you make a delta you can remove it; if you own the file and directory you can remove a delta. .SH FILES .PD 0 .TP 10 x-file (see .IR delta (1)) .TP 10 z-file (see .IR delta (1)) .PD .SH "SEE ALSO" delta(1), get(1), help(1), prs(1), sccsfile(4). .br ``Source Code Control System User's Guide'' in the .IR "\*(6) User's Guide" . .br .SH DIAGNOSTICS Use .IR help (1) for explanations. .\" @(#)rmdel.1 1.5 .TH ATAN2 3F .SH NAME atan2, datan2 \- FORTRAN arctangent intrinsic function .SH SYNOPSIS .nf .BR "real" " r1, r2, r3" .BR "double precision" " dp1, dp2, dp3" .P .RB "r3" " = atan2(" "r1, r2" ) .P .RB "dp3" " = datan2(" "dp1, dp2" ")" .RB "dp3" " = atan2(" "dp1, dp2" ")" .SH DESCRIPTION .I Atan2\^ returns the arctangent of .I arg1/arg2 as a real value. .I Datan2\^ returns the double-precision arctangent of its double-precision arguments. The generic form .I atan2\^ may be used with impunity with double-precision arguments. .SH SEE ALSO trig(3M). .\" @(#)atan2.3f 1.4 B or equivalent .TP .B B \s-1RK\s+111/\s-1RK\s+105 disk, \s-1RP\s+111/\s-1RP\s+103 disk, and \s-1TM\s+111/\s-1TU\s+116 magnetic tape, or equivalent .PP If no .BI + lib\^ argument is specified, .B +A is assumed. If the .B + argument is specified alone, no configuration library is loaded unless the user supplies his own. .SH FILES .nr t1 \w'/usr/lib/lib2A.a ' .nr t2 \n(t1+\w'+A configuration library ' .ta \n(t1u \n(t2u /lib/crt2.o execution start-off .br /usr/lib/lib2.a stand-alone library .br /usr/lib/lib2A.a +A configuration library (\s-1PDP\s+1-11 only) .br /usr/lib/lib2B.a +B configuration library (\s-1PDP\s+1-11 only) .SH SEE ALSO cc(1), ld(1), a.out(4). .\" @(#)scc.1 1.4 .\" @(#)rmdir.1 1.2 .so /usr/man/u_man/man1/rm.1 .\" @(#)atan2.3m 1.2 .so /usr/man/u_man/man3/trig.3m .TH SCCSDIFF 1 .SH NAME sccsdiff \- compare two versions of an \s-1SCCS\s+1 file .SH SYNOPSIS .B sccsdiff .BR \-r \s-1SID\s+1\&1 .BR \-r \s-1SID\s+1\&2 .RB [ \-p ] .RB [ \-s n] files .SH DESCRIPTION .I Sccsdiff\^ compares two versions of an .SM SCCS file and generates the differences between the two versions. Any number of .SM SCCS files may be specified, but arguments apply to all files. .RS 5 .TP 12 .BI \-r \s-1SID\s+1?\^ .IR \s-1SID\s+11 \ and \ \s-1SID\s+12 \ specify the deltas of an .SM SCCS file that are to be compared. Versions are passed to .IR bdiff (1) in the order given. .TP 12 .B \-p pipe output for each file through .IR pr (1). .TP 12 .BI \-s n\^ \fIn\fP is the file segment size that .I bdiff\^ will pass to .IR diff (1). This is useful when .I diff\^ fails due to a high system load. .SH FILES .TP "\w'/tmp/get?????\ \ 'u" /tmp/get????? Temporary files .SH "SEE ALSO" bdiff(1), get(1), help(1), pr(1). .br ``Source Code Control System'' in the .IR "\*(6) User's Guide" . .SH DIAGNOSTICS .I file: .B "NB .\" @(#)rsh.1 1.2 .so /usr/man/u_man/man1/sh.1 .TH ATOF 3C .SH NAME atof \- convert \s-1ASCII\s0 string to floating-point number .SH SYNOPSIS .BR "double atof (" nptr ) .br .BR "char \(**" nptr ; .SH DESCRIPTION .I Atof\^ converts a character string pointed to by .I nptr\^ to a double-precision floating-point number. The first unrecognized character ends the conversion. .I Atof\^ recognizes an optional string of white-space characters (blanks or tabs), then an optional sign, then a string of digits optionally containing a decimal point, then an optional .B e or .B E followed by an optionally signed integer. If the string begins with an unrecognized character, .I atof\^ returns the value zero. .SH DIAGNOSTICS When the correct value would overflow, .I atof\^ returns .SM .BR HUGE, and sets .I errno\^ to .SM .BR ERANGE\*S . Zero is returned on underflow. .SH SEE ALSO scanf(3S). .\" @(#)atof.3c 1.4 o differences" means the two versions are the same. .sp Use .IR help (1) for explanations. .PD .\" @(#)sccsdiff.1 1.6 .TH SACT 1 .SH NAME sact \- print current \s-1SCCS\s+1 file editing activity .SH SYNOPSIS .B sact files .SH DESCRIPTION .I Sact\^ informs the user of any impending deltas to a named .SM SCCS file. This situation occurs when .IR get (1) with the .B \-e option has been previously executed without a subsequent execution of .IR delta (1). If a directory is named on the command line, .I sact\^ behaves as though each file in the directory were specified as a named file, except that non-\s-1SCCS\s+1 files and unreadable files are silently ignored. If a name of .B \- is given, the standard input is read with each line being taken as the name of an .SM SCCS file to be processed. .P The output for each named file consists of five fields separated by spaces. .RS 5 .TP 12 Field 1 specifies the .SM SID of a delta that currently exists in the .SM SCCS file to which changes will be made to make the new delta. .TP 12 Field 2 specifies the .SM SID for the new delta to be created. .TP 12 Field 3 contains the login id of the usC .\" @(#)atoi.3c 1.2 .so /usr/man/u_man/man3/strtol.3c .TH SDB 1 .SH NAME sdb \- symbolic debugger .SH SYNOPSIS .B sdb [\fB\-w\fR] [\fB\-W\fR] [ objfil [ corfil [ directory ] ] ] .SH DESCRIPTION .I Sdb\^ is a symbolic debugger which can be used with C and F77 programs. It may be used to examine their object files and core files and to provide a controlled environment for their execution. .PP .I Objfil\^ is normally an executable program file which has been compiled with the .B \-g (debug) option; if it has not been compiled with the .B \-g option, or if it is not an executable file, the symbolic capabilities of .I sdb\^ are limited, but the file can still be examined and the program debugged. The default for .I objfil\^ is .BR a.out . .I Corfil\^ is assumed to be a core image file produced after executing .IR objfil ; the default for .I corfil\^ is .BR core . The core file need not be present. A .B \- in place of .I corfil\^ forces .I sdb\^ to ignore any core image file. Source files used in constructing .I objfil\^ must be in .I directory to be located. .PP It ier who will make the delta (i.e., executed a .I get\^ for editing). .TP 12 Field 4 contains the date that .B "get \-e" was executed. .TP 12 Field 5 contains the time that .B "get \-e" was executed. .SH "SEE ALSO" delta(1), get(1), unget(1). .br ``Source Code Control System User's Guide'' in the .IR "\*(6) User's Guide" . .SH DIAGNOSTICS Use .IR help (1) for explanations. .\" @(#)sact.1 1.6 .\" @(#)atol.3c 1.2 .so /usr/man/u_man/man3/strtol.3c C s useful to know that at any time there is a .I "current line\^" and .IR "current file" . If .I corfil\^ exists then they are initially set to the line and file containing the source statement at which the process terminated. Otherwise, they are set to the first line in .BR main (). The current line and file may be changed with the source file examination commands. .PP By default, warnings are provided if the source files used in producing .I objfil cannot be found or are newer than .IR objfil . This checking feature and the accompanying warnings may be disabled by the use of the .B \-W flag. .PP Names of variables are written just as they are in C or F77. Variables local to a procedure may be accessed using the form .IB procedure : variable\fR. If no procedure name is given, the procedure containing the current line is used by default. .P It is also possible to refer to structure members as .IB variable . member\fR, pointers to structure members as .IB variable \(mi> member , and array elements as .IB variab.TH SADP 1 .SH NAME sadp \- disk access profiler .SH SYNOPSIS .B sadp [ .B \-th ] [ .B \-d device[\|\-drive] ] s [ n ] .SH DESCRIPTION .I Sadp reports disk access location and seek distance, in tabular or histogram form. It samples disk activity once every second during an interval of .I s seconds. This is done repeatedly if .I n is specified. Cylinder usage and disk distance are recorded in units of eight cylinders. .PP The only valid value of .I device is .BR disk. .I Drive specifies the disk drives and it may be: a drive number in the range supported by .IR device , two numbers separated by a minus (indicating an inclusive range), or a list of drive numbers separated by commas. .PP Up to eight disk drives may be reported. The .B \-d option may be omitted, if only one .I device is present. .PP The .B \-t flag causes the data to be reported in tabular form. The .B \-h flag produces a histogram of the data on the printer. Default is .BR \-t . .SH EXAMPLE The command: .PP .RS \f3sadp \|\-d disk\|\-0 900 4 \f1.TH BESSEL 3M .SH NAME j0, j1, jn, y0, y1, yn \- Bessel functions .SH SYNOPSIS .nf .B #include .PP .BR "double j0 (" x ) .BR "double " x ; .PP .BR "double j1 (" x ) .BR "double " x ; .PP .BR "double jn (" "n, x" ) .BR int " n" ; .BR double " x" ; .PP .BR "double y0 (" x ) .BR double " x" ; .PP .BR "double y1 (" x ) .BR double " x" ; .PP .BR "double yn (" "n, x" ) .BR int " n" ; .BR double " x" ; .SH DESCRIPTION .I J0\^ and .I j1\^ return Bessel functions of .I x\^ of the first kind of orders 0 and 1 respectively. .I Jn\^ returns the Bessel function of .I x\^ of the first kind of order .IR n . .PP .I Y0\^ and .I y1\^ return the Bessel functions of .I x\^ of the second kind of orders 0 and 1 respectively. .I Yn\^ returns the Bessel function of .I x\^ of the second kind of order .IR n . The value of .I x\^ must be positive. .SH DIAGNOSTICS Non-positive arguments cause .IR y0 , .IR "y1\^" , and .I yn\^ to return the value .SM .B HUGE and to set .I errno\^ to .SM .BR EDOM . They also cause a message indile [ number ]\fR. Pointers may be dereferenced by using the form \fIpointer\fB[\fR0\fB]\fR. Combinations of these forms may also be used. F77 common variables may be referenced by using the name of the common block instead of the structure name. Blank common variables may be named by the form .BI . variable\fR. A number may be used in place of a structure variable name, in which case the number is viewed as the address of the structure, and the template used for the structure is that of the last structure referenced by .I sdb\fR. An unqualified structure variable may also be used with various commands. Generally, .I sdb interprets a structure as a set of variables; thus, it displays the values of all the elements of a structure when it is requested to display a structure. An exception to this interpretation occurs when displaying variable addresses. An entire structure does have an address, and it is this value .I sdb displays, not the addresses of individual elements. .P Elements of a multidimensional arrayD  .RE .PP generates 4 tabular reports, each describing cylinder usage and seek distance of disk drive 0 during a 15-minute interval. .SH FILES /dev/kmem .\" @(#)sadp.1 1.5 cating .SM DOMAIN error to be printed on the standard error output; the process will continue. .PP These error-handling procedures may be changed with the function .IR matherr (3M). .SH SEE ALSO matherr(3M). .\" @(#)bessel.3m 1.4  may be referenced as .IB variable [ number ][ number ]...\fR, or as .IB variable [ number,number,... ]\fR. In place of .I number\fR, the form .IB number ; number may be used to indicate a range of values, .B \(** may be used to indicate all legitimate values for that subscript, or subscripts may be omitted entirely if they are the last subscripts and the full range of values is desired. As with structures, .I sdb displays all the values of an array or of the section of an array if trailing subscripts are omitted. It displays only the address of the array itself or of the section specified by the user if subscripts are omitted. A multidimensional parameter in an F77 program cannot be displayed as an array, but it is actually a pointer, whose value is the location of the array. The array itself can be accessed symbolically from the calling function. .P A particular instance of a variable on the stack may be referenced by using the form .IB procedure : variable , number\fR. All the variations mentioned in namin.if t .ds ' \h@.05m@\s+4\v@.333m@\'\v@-.333m@\s-4\h@.05m@ .if n .ds ' ' .if t .ds ` \h@.05m@\s+4\v@.333m@\`\v@-.333m@\s-4\h@.05m@ .if n .ds ` ` .TH SAG 1G .SH NAME sag \- system activity graph .SH SYNOPSIS .B "sag " [ options ] .SH DESCRIPTION .I Sag graphically displays the system activity data stored in a binary data file by a previous .IR sar (1) run. Any of the .I sar data items may be plotted singly, or in combination; as cross plots, or versus time. Simple arithmetic combinations of data may be specified. .I Sag invokes .I sar and finds the desired data by string-matching the data column header (run .I sar to see what's available). The following \fIoptions\fP may be passed to .IR sar : .TP 9 \fB\-s \fItime\fR Select data later than .I time in the form hh\|[\^:mm\^]\^. Default is 08:00. .TP 9 \fB\-e \fItime\fR Select data up to .IR time . Default is 18:00. .TP 9 \fB\-i \fIsec\fR Select data at intervals as close as possible to \fIsec \fRseconds. .TP 9 \fB\-f \fIfile\fR Use \fIfile \fRas the data sourcD .TH BOOL 3F .SH NAME and, or, xor, not, lshift, rshift \- FORTRAN bitwise Boolean functions .SH SYNOPSIS .nf .BR "integer" " i, j, k" .BR "real" " a, b, c" .BR "double precision" " dp1, dp2, dp3" .PP .RB "k" " = and(" "i, j" ")" .RB "c" " = or(" "a, b" ")" .RB "j" " = xor(" "i, a" ")" .RB "j" " = not(" "i" ")" .RB "k" " = lshift(" "i, j" ")" .RB "k" " = rshift(" "i, j" ")" .SH DESCRIPTION The generic intrinsic Boolean functions .IR and , .IR or , and .I xor\^ return the value of the binary operations on their arguments. .I Not\^ is a unary operator returning the one's complement of its argument. .I Lshift\^ and .I rshift\^ return the value of the first argument shifted left or right, respectively, the number of times specified by the second (integer) argument. .P The Boolean functions are generic, i.e., defined for all data types as arguments and return values. Where required, the compiler generates appropriate type conversions. .SH NOTE Although defined for all data types, use of Boolean functions on non-ig variables may be used. .IB Number\^ is the occurrence of the specified procedure on the stack, counting the top, or most current, as the first. If no procedure is specified, the procedure currently executing is used by default. .PP It is also possible to specify a variable by its address. All forms of integer constants which are valid in C may be used, so that addresses may be input in decimal, octal, or hexadecimal. .PP Line numbers in the source program are referred to as .IB file-name : number or .IB procedure : number\fR. In either case the number is relative to the beginning of the file. If no procedure or filename is given, the current file is used by default. If no number is given, the first line of the named procedure or file is used. .PP While a process is running under .IR sdb all addresses refer to the executing program; otherwise they refer to .I objfil\^ or .I corfil\^. An initial argument of .B \-w permits overwriting locations in .I objfil\^. .SS Addresses. The address in a file associated we for \fIsar\fR. Default is the current daily data file \fB/usr/adm/sa/sa\fIdd\fR. .P Other \fIoptions\fP: .TP 9 \fB\-T \fIterm\fR Produce output suitable for terminal \fIterm\fR. See \fItplot\fR(1G) for known terminals. If .I term is .BR vpr , output is processed by .B vpr \-p and queued to a Versatec printer. Default for .I term is .BR \s-1$TERM\s+1 . .TP 9 .BI "\-x\0" spec x axis specification with .I spec in the form: .RS "name\|[op \|name]\|.\|.\|.\|[lo \|hi]" .RE .TP 9 .BI "\-y\0" spec y axis specification with .I spec in the same form as above. .P \fIName\fR is either a string that matches a column header in the \fIsar \fR report, with an optional device name in square brackets, e.g., \fBr+w/s[dsk\-1]\fR, or an integer value. \fIOp \fR is \fB + \- \(**\fR or \fB/ \fRsurrounded by blanks. Up to five names may be specified. Parentheses are not recognized. Contrary to custom, .BR "\0+\0" "and" "\0\-\0" have precedence over .BR "\0\(**\0" "and" "\0/" "." Evaluation is left to right. Thus A\0/\0A\0+\0B\0\(*nteger data is not productive. .SH BUGS The implementation of the shift functions may cause large shift values to deliver unexpected results. .\" @(#)bool.3f 1.5 E ith a written address is determined by a mapping associated with that file. Each mapping is represented by two triples .RI ( "b1, e1, f1" ) and .RI ( "b2, e2, f2" ). The .I file address\^ corresponding to a written .I address\^ is calculated as follows: .PP .RS .IR b1 \*(LE address < e1 \*(IM .IR "file address" = address + f1\-b1 .RE otherwise .PP .RS .IR b2 \*(LE address < e2 \*(IM .IR "file address" = address + f2\-b2, .RE .PP otherwise, the requested .I address\^ is not legal. In some cases (e.g., for programs with separated I and D space) the two segments for a file may overlap. .PP The initial setting of both mappings is suitable for normal .B a.out and .B core files. If either file is not of the kind expected then, for that file, .I b1\^ is set to 0, .I e1\^ is set to the maximum file size, and .I f1\^ is set to 0; in this way the whole file can be examined with no address translation. .PP In order for .I sdb\^ to be used on large files, all appropriate values are kept as signed 32-bit integers. .SS C*\0100 is evaluated (A/(A+B))\(**100, and A\0+\0B\0/\0C\0+\0D is (A+B)/(C+D). .IR "Lo " "and " "hi " are optional numeric scale limits. If unspecified, they are deduced from the data. .P A single .I spec is permitted for the x axis. If unspecified, \fItime\fP is used. Up to 5 \fIspec\fR's separated by .B \|;\| may be given for .BR \-y . Enclose the .BR "\-x " "and " "\-y" arguments in double quotes (\fB"\|"\fR) if blanks or \fB\\\fR<\s-1CR\s+1> are included. The .B \-y default is: .PP .RS 0 \fB\-y\0"%usr\00\0100;\0%usr\0+\0%sys\00\0100;\0%usr\0+\0%sys\0+\0%wio\00\0100"\fR .RE .SH EXAMPLES To see today's .SM CPU utilization: .RS \f3sag\f1 .RE .P To see activity over 15 minutes of all disk drives: .RS \f3TS=\*`date\0+%H:%M\*`\f1 .br \f3sar\0\-o\0tempfile\060\015\f1 .br \f3TE=\*`date\0+%H:%M\*`\f1 .br \f3sag\0\-f\0tempfile\0\-s\0$TS\0\-e\0$TE\0\-y\0"r+w/s[dsk]"\f1 .RE .SH FILES .TP 22 /usr/adm/sa/sa\fIdd\fR daily data file for day \fIdd\fR. .SH SEE ALSO sar(1), tplot(1G). .\" @(#)sag.1g 1.4 .TH BSEARCH 3C .SH NAME bsearch \- binary search .SH SYNOPSIS .BR "char \(**bsearch ((char \(**)" " key" ", (char \(**)" " base, nel, sizeof" .BR " (\(**" "key" ")," " compar" ")" .br .BR unsigned " nel" ; .br .BR "int (\(**" "compar" ")( );" .SH DESCRIPTION .I Bsearch\^ is a binary search routine generalized from Knuth (6.2.1) Algorithm B. It returns a pointer into a table indicating where a datum may be found. The table must be previously sorted in increasing order according to a provided comparison function. .I Key\^ points to the datum to be sought in the table. .I Base\^ points to the element at the base of the table. .I Nel\^ is the number of elements in the table. .I Compar\^ is the name of the comparison function, which is called with two arguments that point to the elements being compared. The function must return an integer less than, equal to, or greater than zero, depending on whether the first argument is to be considered less than, equal to, or greater than the second. .SH DIAGNOSTICS A .SM .B ommands. .PP The commands for examining data in the program are: .TP 5 .B t Print a stack trace of the terminated or halted program. .TP 5 .B T Print the top line of the stack trace. .TP 5 .IB variable / clm Print the value of .I variable\^ according to length .I l\^ and format .IR m . A numeric count .I c indicates that a region of memory, beginning at the address implied by .IR variable , is to be displayed. The length specifiers are: .RS .RS .PD 0 .TP .BI b\^ one byte .TP .BI h\^ two bytes (half word) .TP .BI l\^ four bytes (long word) .RE .PD .br .ne 5 .PP Legal values for .I m\^ are: .RS .PD 0 .TP .BI c\^ character .TP .BI d\^ decimal .TP .BI u\^ decimal, unsigned .TP .BI o\^ octal .TP .BI x\^ hexadecimal .TP .BI f\^ 32-bit single precision floating point .TP .BI g\^ 64-bit double precision floating point .TP .BI s\^ Assume .I variable\^ is a string pointer and print characters starting at the address pointed to by the variable. .TP .BI a\^ Print characters starting at the variable's address. This formaE .TH SAR 1 .SH NAME sar \- system activity reporter .SH SYNOPSIS .B sar .RB [\| \-ubdycwaqvmA\| ] .RB [\| \-o\0 file\|] t [ n ] .PP .B sar .RB [\| \-ubdycwaqvmA\| ] .RB [\| \-s\0 time\|] .RB [\| \-e\0 time\|] .RB [\| \-i\0 sec\|] .RB [\| \-f\0 file\|] .SH DESCRIPTION .IR Sar, in the first instance, samples cumulative activity counters in the operating system at .I n intervals of .I t seconds. If the .B \-o option is specified, .I sar saves the samples in .I file in binary format. The default value of .I n is 1. In the second instance, with no sampling interval specified, .I sar extracts data from a previously recorded .IR file, either the one specified by the .B \-f option or, by default, the standard system activity daily data file .BI /usr/adm/sa/sa dd\^ for the current day .IR dd. The starting and ending times of the report can be bounded via the .B \-s and .B \-e .I time arguments of the form .IR hh [: mm [: ss ]].\^ The .B \-i option selects records at .I sec second intervals; otherwise, all intervals foNULL pointer is returned if the key cannot be found in the table. .SH NOTES The pointers to the key and the element at the base of the table should be of type pointer-to-element, and cast to type pointer-to-character. .br The comparison function need not compare every byte, so arbitrary data may be contained in the elements in addition to the values being compared. .br Although declared as type pointer-to-character, the value returned should be cast into type pointer-to-element. .SH SEE ALSO lsearch(3C), hsearch(3C), qsort(3C), tsearch(3C). .\" @(#)bsearch.3c 1.6 t may not be used with register variables. .TP .BI p\^ pointer to procedure .TP .BI i\^ Disassemble machine-language instruction with addresses printed numerically and symbolically. .TP .BI I\^ Disassemble machine-language instruction with addresses printed numerically only. .RE .PD The length specifiers are only effective with the formats \fBc\fP, \fBd\fP, \fBu\fP, \fBo\fP and \fBx\fP. Any of the specifiers, \fIc\fP, \fIl\fP, and \fIm\fP, may be omitted. If all are omitted, .I sdb chooses a length and a format suitable for the variable's type, as declared in the program. If .I m is specified, then this format is used for displaying the variable. A length specifier determines the output length of the value to be displayed, sometimes resulting in truncation. A count specifier .I c tells .I sdb to display that many units of memory, beginning at the address of .IR variable . The number of bytes in one such unit of memory is determined by the length specifier .IR l , or, if no length is given, by the size associaund in the data file are reported. .PP In either case, subsets of data to be printed are specified by the following options: .PP .PD 0 .TP 5 .B \-u Report .SM CPU utilization (the default): .br %usr, %sys, %wio, %idle \- portion of time running in user mode, running in system mode, idle with some process waiting for block .SM I/O, and otherwise idle. .sp .TP .B \-b Report buffer activity: .br bread/s, bwrit/s \- transfers per second of data between system buffers and disk or other block devices; .br lread/s, lwrit/s \- accesses of system buffers; .br %rcache, %wcache \- cache hit ratios, e. g., 1 \- bread/lread; .br pread/s, pwrit/s \- transfers via raw (physical) device mechanism. .sp .TP .B \-d Report activity for each block device, e. g., disk or tape drive: .br %busy, avque \- portion of time device was busy servicing a transfer request, average number of requests outstanding during that time; .br r+w/s, blks/s \- number of data transfers from or to device, number of bytes transferred in 512-byte units; F .\" @(#)cabs.3f 1.2 .so /usr/man/u_man/man3/abs.3f ted with the .IR variable. If a count specifier is used for the .B s or .B a command, then that many characters are printed. Otherwise successive characters are printed until either a null byte is reached or 128 characters are printed. The last variable may be redisplayed with the command .BR ./ . .PP The .IR sh (1) metacharacters .B \(** and .B ? may be used within procedure and variable names, providing a limited form of pattern matching. If no procedure name is given, variables local to the current procedure and global variables are matched; if a procedure name is specified, only variables local to that procedure are matched. To match only global variables, the form .BI : pattern\^ is used. .RE .TP 5 .PD 0 .IB linenumber ? lm .TP 5 \fIvariable:\fB?\fIlm\fR .PD Print the value at the address from .BR a.out or I space given by .I linenumber\^ or .IR variable (procedure name), according to the format .IR lm . The default format is `i'. .TP 5 .PD 0 .IB variable = lm .TP 5 .IB linenumber = lm .TP 5 .IB number .br avwait, avserv \- average time in ms. that transfer requests wait idly on queue, and average time to be serviced (which for disks includes seek, rotational latency and data transfer times). .sp .TP .B \-y Report TTY device activity: .br rawch/s, canch/s, outch/s \- input character rate, input character rate processed by canon, output character rate; .br rcvin/s, xmtin/s, mdmin/s \- receive, transmit and modem interrupt rates. .sp .TP .B \-c Report system calls: .br scall/s \- system calls of all types; .br sread/s, swrit/s, fork/s, exec/s \- specific system calls; .br rchar/s, wchar/s \- characters transferred by read and write system calls. .sp .TP .B \-w Report system swapping and switching activity: .br swpin/s, swpot/s, bswin/s, bswot/s \- number of transfers and number of 512-byte units transferred for swapins (including initial loading of some programs) and swapouts; .br pswch/s \- process switches. .sp .TP .B \-a Report use of file access system routines: .br iget/s, namei/s, dirblk/s. .sp .TP ..\" @(#)calloc.3c 1.2 .so /usr/man/u_man/man3/malloc.3c F = lm .PD Print the address of .I variable\^ or .IR linenumber , or the value of .IR number , in the format specified by .IR lm . If no format is given, then .B lx is used. The last variant of this command provides a convenient way to convert between decimal, octal and hexadecimal. .TP 5 .IB variable ! value Set .I variable\^ to the given .IR value . The value may be a number, a character constant or a variable. The value must be well defined; expressions that produce more than one value, such as structures, are not allowed. Character constants are denoted .BI ' character\fR. Numbers are viewed as integers unless a decimal point or exponent is used. In this case, they are treated as having the type double. Registers are viewed as integers. The .I variable may be an expression that indicates more than one variable, such as an array or structure name. If the address of a variable is given, it is regarded as the address of a variable of type .IR int . C conventions are used in any type conversions necessary to peB \-q Report average queue length while occupied, and % of time occupied: .br runq-sz, %runocc \- run queue of processes in memory and runnable; .br swpq-sz, %swpocc \- swap queue of processes swapped out but ready to run. .sp .TP .B \-v Report status of text, process, inode and file tables: .br text-sz, proc-sz, inod-sz, file-sz \- entries/size for each table, evaluated once at sampling point; .br text-ov, proc-ov, inod-ov, file-ov \- overflows occurring between sampling points. .sp .TP .B \-m Report message and semaphore activities: .br msg/s, sema/s \- primitives per second. .sp .TP .B \-A Report all data. Equivalent to .BR \-udqbwcayvm . .SH EXAMPLES To see today's .SM CPU activity so far: .PP .RS .B sar .RE .PP To watch .SM CPU activity evolve for 10 minutes and save data: .PP .RS .B "sar \|\-o temp 60 10" .RE .PP To later review disk and tape activity from that period: .PP .RS .B "sar \|\-d \|\-f temp" .RE .SH FILES .TP 18 .RI /usr/adm/sa/sa dd\^ daily data file, where .I dd\^ are digits representing t.\" @(#)ccos.3f 1.2 .so /usr/man/u_man/man3/cos.3f 8;>ADGJMPG 2}zwtqnkheb_\Y|yvspmjgda^[X{xurolifc`]ZWTQNKHEB?<9.\" @(#)ceil.3m 1.2 .so /usr/man/u_man/man3/floor.3m rform the indicated assignment. .TP 5 .B x Print the machine registers and the current machine-language instruction. .TP 5 .B X Print the current machine-language instruction. .PP The commands for examining source files are: .PP .PD 0 .TP 5 .BI "e " procedure\^ .TP 5 .BI "e " file-name\^ .TP 5 .BI "e " directory/\^ .TP 5 .BI "e " "directory file-name"\^ .PD The first two forms set the current file to the file containing .I procedure\^ or to .IR file-name . The current line is set to the first line in the named procedure or file. Source files are assumed to be in .IR directory . The default is the current working directory. The latter two forms change the value of .IR directory . If no procedure, filename, or directory is given, the current procedure name and filename are reported. .TP 5 .BI / "regular expression" / Search forward from the current line for a line containing a string matching .I regular expression\^ as in .IR ed (1). The trailing .B / may be elided. .TP 5 .BI ? "regular expression" ? Search ba.TH SCAT 1 .SH NAME scat \- concatenate and print files on synchronous printer .SH SYNOPSIS .B scat [ .B \-u ] [ .B \-s ] file .\|.\|. .SH DESCRIPTION .I Scat\^ reads each .I file\^ in sequence and writes it on the standard output, which is assumed to be a synchronous printer device. Thus: .PP .RS .B "scat file > /dev/sp0" .RE .PP prints the file, and: .PP .RS .B "scat file1 file2 > /dev/sp0" .RE .PP concatenates .I file1\^ and .I file2\^ and places the result on the printer. .PP If no input file is given, or if the argument .B \- is encountered, .I scat\^ reads from the standard input file. Output is buffered in 512-byte blocks unless the .B \-u option is specified. The .B \-s option makes .I scat\^ silent about non-existent files. .SH SEE ALSO cp(1), pr(1), stty(1). .SH WARNINGS .I Scat\^ uses synchronous printers in line mode with the wrap around option enabled. This means that the maximum line length is 79 characters; longer lines are wrapped back to the beginning of the next line each time the end of a pG .\" @(#)cexp.3f 1.2 .so /usr/man/u_man/man3/exp.3f ckward from the current line for a line containing a string matching .I regular expression\^ as in .IR ed (1). The trailing .B ? may be elided. .TP 5 .B p Print the current line. .TP 5 .B z Print the current line followed by the next 9 lines. Set the current line to the last line printed. .TP 5 .B w Window. Print the 10 lines around the current line. .TP 5 .I number\^ Set the current line to the given line number. Print the new current line. .TP 5 .IB count + Advance the current line by .I count\^ lines. Print the new current line. .TP 5 .IB count \(mi Retreat the current line by .I count\^ lines. Print the new current line. .PP The commands for controlling the execution of the source program are: .PP .TP 5 \fIcount\fB r \fIargs\fR .br .ns .TP 5 \fIcount\fB R Run the program with the given arguments. The \fBr\fP command with no arguments reuses the previous arguments to the program while the \fBR\fP command runs the program with no arguments. An argument beginning with .B < or .B > causes redirection for the rinter line is reached. .\" @(#)scat.1 1.3 .\" @(#)char.3f 1.2 .so /usr/man/u_man/man3/ftype.3f H standard input or output respectively. If \fIcount\fP is given, it specifies the number of breakpoints to be ignored. .TP 5 \fIlinenumber\fB c\fI count\fR .br .ns .TP 5 \fIlinenumber\fB C\fI count\fR Continue after a breakpoint or interrupt. If \fIcount\fP is given, it specifies the number of breakpoints to be ignored. \fBC\fP continues with the signal that caused the program to stop reactivated and \fBc\fP ignores it. If a linenumber is specified then a temporary breakpoint is placed at the line and execution is continued. The breakpoint is deleted when the command finishes. .TP 5 \fIlinenumber\fB g\fI count\fR Continue after a breakpoint with execution resumed at the given line. If \fIcount\fP is given, it specifies the number of breakpoints to be ignored. .TP 5 \fBs \fIcount\fR .br .ns .TP 5 \fBS \fIcount\fR Single step the program through \fIcount\fP lines. If no count is given then the program is run for one line. .B S is equivalent to .B s except it steps through procedure calls. .TP 5 \fBi\fR .br .ns ..TH SCC 1 .SH NAME scc \- C compiler for stand-alone programs .SH SYNOPSIS .B scc [ .B +\c [ lib ] ] [ option ] ... [ file ] ... .SH DESCRIPTION .I Scc\^ prepares the named files for stand-alone execution. The .I option\^ and .I file\^ arguments may be anything that can legally be used with the .I cc\^ command; it should be noted, though, that the .B \-p (profiling) option, as well as any object module that contains system calls, causes the executable not to run. .PP .I Scc\^ defines the compiler constant, .BR \s-1STANDALONE\s+1 , so that sections of C programs may be compiled conditionally when the executable is run stand-alone. .PP The first argument specifies an auxiliary library that defines the device configuration of the computer for which the stand-alone executable is being prepared. .I Lib\^ may be one of the following: .TP 8 .B A .SM RP\*S04/05/06 disk and .SM TU\*S16 magnetic tape, or equivalent on the \s-1PDP\s+1-11 plus \s-1RM\s+105 and \s-1RM\s+180 disks, and \s-1TU\s+178 and \s-1TS\s+111 tapes, .\" @(#)clearerr.3s 1.2 .so /usr/man/u_man/man3/ferror.3s TP 5 \fBI\fR Single step by one machine-language instruction. \fBI\fP steps with the signal that caused the program to stop reactivated and \fBi\fP ignores it. .TP 5 \fIvariable$\fBm \fIcount\fR .br .ns .TP 5 \fIaddress:\fBm \fIcount\fR Single step (as with \fBs\fP) until the specified location is modified with a new value. If \fIcount\fP is omitted, it is effectively infinity. \fIVariable\fR must be accessible from the current procedure. Since this command is done by software, it can be very slow. .TP 5 \fIlevel\fB v \fR Toggle verbose mode, for use when single stepping with \fBS\fP, \fBs\fP or \fBm\fP. If \fIlevel\fP is omitted, then just the current source file and/or subroutine name is printed when either changes. If \fIlevel\fP is 1 or greater, each C source line is printed before it is executed; if \fIlevel\fP is 2 or greater, each assembler statement is also printed. A \fBv\fP turns verbose mode off if it is on for any level. .TP 5 .B k Kill the program being debugged. .TP 5 procedure\fB(\fParg1,arg2,.H or equivalent .TP .B B \s-1RK\s+111/\s-1RK\s+105 disk, \s-1RP\s+111/\s-1RP\s+103 disk, and \s-1TM\s+111/\s-1TU\s+116 magnetic tape, or equivalent .PP If no .BI + lib\^ argument is specified, .B +A is assumed. If the .B + argument is specified alone, no configuration library is loaded unless the user supplies his own. .SH FILES .nr t1 \w'/usr/lib/lib2A.a ' .nr t2 \n(t1+\w'+A configuration library ' .ta \n(t1u \n(t2u /lib/crt2.o execution start-off .br /usr/lib/lib2.a stand-alone library .br /usr/lib/lib2A.a +A configuration library (\s-1PDP\s+1-11 only) .br /usr/lib/lib2B.a +B configuration library (\s-1PDP\s+1-11 only) .SH SEE ALSO cc(1), ld(1), a.out(4). .\" @(#)scc.1 1.4 .TH CLOCK 3C .SH NAME clock \- report CPU time used .SH SYNOPSIS .B long clock ( ) .SH DESCRIPTION .I Clock\^ returns the amount of CPU time (in microseconds) used since the first call to .IR clock . The time reported is the sum of the user and system times of the calling process and its terminated child processes for which it has executed .IR wait (2) or .IR system (3S). .PP The resolution of the clock is 16.667 milliseconds on M68000 or DEC processors. .SH SEE ALSO times(2), wait(2), system(3S). .SH BUGS The value returned by .I clock\^ is defined in microseconds for compatibility with systems that have CPU clocks with much higher resolution. Because of this, the value returned wraps around after accumulating only 2,147 seconds of CPU time (about 36 minutes). .\" @(#)clock.3c 1.4 ..\fB)\fP .br .ns .TP 5 procedure\fB(\fParg1,arg2,...\fB)/\fP\fIm\fP Execute the named procedure with the given arguments. Arguments can be integer, character or string constants or names of variables accessible from the current procedure. The second form causes the value returned by the procedure to be printed according to format \fIm\fP. If no format is given, it defaults to .BR d . .TP 5 \fIlinenumber\fB b\fR \fIcommands\fR Set a breakpoint at the given line. If a procedure name without a line number is given (e.g., \fBproc:\fR), a breakpoint is placed at the first line in the procedure even if it was not compiled with the .B \-g option. If no \fIlinenumber\fP is given, a breakpoint is placed at the current line. If no .I commands\^ are given, execution stops just before the breakpoint and control is returned to .IR sdb . Otherwise the .I commands\^ are executed when the breakpoint is encountered and execution continues. Multiple commands are specified by separating them with semicolons. If \fBk\fP is use.TH SCCSDIFF 1 .SH NAME sccsdiff \- compare two versions of an \s-1SCCS\s+1 file .SH SYNOPSIS .B sccsdiff .BR \-r \s-1SID\s+1\&1 .BR \-r \s-1SID\s+1\&2 .RB [ \-p ] .RB [ \-s n] files .SH DESCRIPTION .I Sccsdiff\^ compares two versions of an .SM SCCS file and generates the differences between the two versions. Any number of .SM SCCS files may be specified, but arguments apply to all files. .RS 5 .TP 12 .BI \-r \s-1SID\s+1?\^ .IR \s-1SID\s+11 \ and \ \s-1SID\s+12 \ specify the deltas of an .SM SCCS file that are to be compared. Versions are passed to .IR bdiff (1) in the order given. .TP 12 .B \-p pipe output for each file through .IR pr (1). .TP 12 .BI \-s n\^ \fIn\fP is the file segment size that .I bdiff\^ will pass to .IR diff (1). This is useful when .I diff\^ fails due to a high system load. .SH FILES .TP "\w'/tmp/get?????\ \ 'u" /tmp/get????? Temporary files .SH "SEE ALSO" bdiff(1), get(1), help(1), pr(1). .br ``Source Code Control System'' in the .IR "\*(6) User's Guide" . .SH DIAGNOSTICS .I file: .B "NI .\" @(#)clog.3f 1.2 .so /usr/man/u_man/man3/log.3f d as a command to execute at a breakpoint, control returns to .IR sdb , instead of continuing execution. .TP 5 .B B Print a list of the currently active breakpoints. .TP 5 \fIlinenumber\fB d\fR Delete a breakpoint at the given line. If no \fIlinenumber\fP is given, the breakpoints are deleted interactively. Each breakpoint location is printed and a line is read from the standard input. If the line begins with a .B y or .B d , the breakpoint is deleted. .TP 5 .B D Delete all breakpoints. .TP 5 .B l Print the last executed line. .TP 5 \fIlinenumber\fB a\fR Announce. If \fIlinenumber\fR is of the form .IB proc : number\fR, the command effectively does a .IB "linenumber " "b l\fR. If \fIlinenumber\fR is of the form .IB proc :\fR, the command effectively does a .IB proc ": b T"\fR. .PP Miscellaneous commands: .TP 5 .BI ! command\^ The command is interpreted by .IR sh (1). .TP 5 .B new-line If the previous command printed a source line, advance the current line by one line and print the new current line. If the preo differences" means the two versions are the same. .sp Use .IR help (1) for explanations. .PD .\" @(#)sccsdiff.1 1.6 .\" @(#)cmplx.3f 1.2 .so /usr/man/u_man/man3/ftype.3f I vious command displayed a memory location, display the next memory location. .TP 5 .B control-D Scroll. Print the next 10 lines of instructions, source, or data, depending on which was printed last. .TP 5 .BI "< " filename Read commands from .I filename until the end of file is reached, then continue to accept commands from standard input. When .I sdb is told to display a variable by a command in such a file, the variable name is displayed along with the value. This command may not be nested; .B < may not appear as a command in a file. .TP 5 .B M Print the address maps. .TP 5 .BR M\ [ ?/ ][ \(** "] \fIb \|e \|f\fP" Record new values for the address map. The arguments \fB?\fP and \fB/\fP specify the text and data maps, respectively. The first segment, .RI ( "b1, e1, f1" ), is changed unless \fB\(**\fP is specified, in which case the second segment, .RI ( "b1, e1, f1" ), of the mapping is changed. If fewer than three values are given, the remaining map parameters are left unchanged. .TP 5 \fB"\fI string\fR Prin.TH SDB 1 .SH NAME sdb \- symbolic debugger .SH SYNOPSIS .B sdb [\fB\-w\fR] [\fB\-W\fR] [ objfil [ corfil [ directory ] ] ] .SH DESCRIPTION .I Sdb\^ is a symbolic debugger which can be used with C and F77 programs. It may be used to examine their object files and core files and to provide a controlled environment for their execution. .PP .I Objfil\^ is normally an executable program file which has been compiled with the .B \-g (debug) option; if it has not been compiled with the .B \-g option, or if it is not an executable file, the symbolic capabilities of .I sdb\^ are limited, but the file can still be examined and the program debugged. The default for .I objfil\^ is .BR a.out . .I Corfil\^ is assumed to be a core image file produced after executing .IR objfil ; the default for .I corfil\^ is .BR core . The core file need not be present. A .B \- in place of .I corfil\^ forces .I sdb\^ to ignore any core image file. Source files used in constructing .I objfil\^ must be in .I directory to be located. .PP It i.TH CONJG 3F .SH NAME conjg, dconjg \- FORTRAN complex conjugate intrinsic function .SH SYNOPSIS .nf .BR "complex" " cx1, cx2" .BR "double complex" " dx1, dx2" .P .RB "cx2" " = conjg(" "cx1" ")" .P .RB "dx2" " = dconjg(" "dx1" ")" .SH DESCRIPTION .I Conjg\^ returns the complex conjugate of its complex argument. .I Dconjg\^ returns the double-complex conjugate of its double-complex argument. .\" @(#)conjg.3f 1.4 t the given string. The C escape sequences of the form .I "\\\\character" are recognized, where .I character is a nonnumeric character. .TP 5 .B q Exit the debugger. .PP The following commands also exist and are intended only for debugging the debugger: .PP .PD 0 .TP 5 .B V Print the version number. .TP 5 .B Q Print a list of procedures and files being debugged. .TP 5 .B Y Toggle debug output. .PD .SH FILES a.out .br core .SH SEE ALSO cc(1), f77(1), sh(1), a.out(4), core(4). .br .IR "\*(6) Programming Guide" . .SH WARNINGS On the .SM VAX\*S-11/780, C variables are identified internally with an underscore prepended. User variables which differ by only an initial underscore cannot be distinguished, as .I sdb recognizes both internal and external names. .PP Data stored in text sections are indistinguishable from functions. .PP Line number information in optimized functions is unreliable, and some information may be missing. .SH BUGS If a procedure is called when the program is .I not\^ stopped at a breakpoint (sJ s useful to know that at any time there is a .I "current line\^" and .IR "current file" . If .I corfil\^ exists then they are initially set to the line and file containing the source statement at which the process terminated. Otherwise, they are set to the first line in .BR main (). The current line and file may be changed with the source file examination commands. .PP By default, warnings are provided if the source files used in producing .I objfil cannot be found or are newer than .IR objfil . This checking feature and the accompanying warnings may be disabled by the use of the .B \-W flag. .PP Names of variables are written just as they are in C or F77. Variables local to a procedure may be accessed using the form .IB procedure : variable\fR. If no procedure name is given, the procedure containing the current line is used by default. .P It is also possible to refer to structure members as .IB variable . member\fR, pointers to structure members as .IB variable \(mi> member , and array elements as .IB variab.TH CONV 3C .SH NAME toupper, tolower, _toupper, _tolower, toascii \- translate characters .SH SYNOPSIS .nf .B #include .PP .BR "int toupper (" c ) .BR int " c" ; .PP .BR "int tolower (" c ) .BR int " c" ; .PP .BR "int _toupper (" c ) .BR int " c" ; .PP .BR "int _tolower (" c ) .BR int " c" ; .PP .BR "int toascii (" c ) .BR int " c" ; .SH DESCRIPTION .I Toupper\^ and .I tolower\^ have as domain the range of .IR getc (3S): the integers from \-1 through 255. If the argument of .I toupper\^ represents a lowercase letter, the result is the corresponding uppercase letter. If the argument of .I tolower\^ represents an uppercase letter, the result is the corresponding lowercase letter. All other arguments in the domain are returned unchanged. .PP .I _toupper\^ and .I _tolower\^ are macros that accomplish the same thing as .I toupper\^ and .I tolower\^ but have restricted domains and are faster. .I _toupper\^ requires a lowercase letter as its argument; its result is the corresponding uppercase letter. .I _uch as when a core image is being debugged), all variables are initialized before the procedure is started. This makes it impossible to use a procedure which formats data from a core image. .PP The default type for printing F77 parameters is incorrect. Their address is printed instead of their value. .PP Tracebacks containing F77 subprograms with multiple entry points may print too many arguments in the wrong order, but their values are correct. .PP The range of an F77 array subscript is assumed to be .I 1 to .IR n , where .I n is the dimension corresponding to that subscript. This is only significant when the user omits a subscript, or uses .B \(** to indicate the full range. There is no problem in general with arrays having subscripts whose lower bounds are not 1. .\" @(#)sdb.1 1.6 le [ number ]\fR. Pointers may be dereferenced by using the form \fIpointer\fB[\fR0\fB]\fR. Combinations of these forms may also be used. F77 common variables may be referenced by using the name of the common block instead of the structure name. Blank common variables may be named by the form .BI . variable\fR. A number may be used in place of a structure variable name, in which case the number is viewed as the address of the structure, and the template used for the structure is that of the last structure referenced by .I sdb\fR. An unqualified structure variable may also be used with various commands. Generally, .I sdb interprets a structure as a set of variables; thus, it displays the values of all the elements of a structure when it is requested to display a structure. An exception to this interpretation occurs when displaying variable addresses. An entire structure does have an address, and it is this value .I sdb displays, not the addresses of individual elements. .P Elements of a multidimensional arrayJ tolower\^ requires an uppercase letter as its argument; its result is the corresponding lowercase letter. Arguments outside the domain cause undefined results. .PP .I Toascii\^ yields its argument with all bits turned off that are not part of a standard .SM ASCII character; it is intended for compatibility with other systems. .SH SEE ALSO ctype(3C), getc(3S). .\" @(#)conv.3c 1.4 .TH SDIFF 1 .SH NAME sdiff \- side-by-side difference program .SH SYNOPSIS .B sdiff [ options ... ] file1 file2 .SH DESCRIPTION .I Sdiff\^ uses the output of .IR diff (1) to produce a side-by-side listing of two files indicating those lines that are different. Each line of the two files is printed with a blank gutter between them if the lines are identical, a .B < in the gutter if the line only exists in .IR file1 , a .B > in the gutter if the line only exists in .IR file2 , and a .B | for lines that are different. .PP For example: .PP .RS 11 .nf x | y a a b < c < d d > c .fi .RE .PP The following options exist: .TP 11 .BI \-w " n\^" Use the next argument, .IR n , as the width of the output line. The default line length is 130 characters. .TP .BR \-l Only print the left side of any lines that are identical. .TP .BR \-s Do not print identical lines. .TP .BI \-o " output\^" Use the next argument, .IR output , as the name of a third file that is created as a user controlled merging of .I file1\^ and  may be referenced as .IB variable [ number ][ number ]...\fR, or as .IB variable [ number,number,... ]\fR. In place of .I number\fR, the form .IB number ; number may be used to indicate a range of values, .B \(** may be used to indicate all legitimate values for that subscript, or subscripts may be omitted entirely if they are the last subscripts and the full range of values is desired. As with structures, .I sdb displays all the values of an array or of the section of an array if trailing subscripts are omitted. It displays only the address of the array itself or of the section specified by the user if subscripts are omitted. A multidimensional parameter in an F77 program cannot be displayed as an array, but it is actually a pointer, whose value is the location of the array. The array itself can be accessed symbolically from the calling function. .P A particular instance of a variable on the stack may be referenced by using the form .IB procedure : variable , number\fR. All the variations mentioned in namin.TH COS 3F .SH NAME cos, dcos, ccos \- FORTRAN cosine intrinsic function .SH SYNOPSIS .nf .BR "real" " r1, r2" .BR "double precision" " dp1, dp2" .B" "complex" " cx1, cx2" .P .RB "r2" " = cos(" "r1" ")" .P .RB "dp2" " = dcos(" "dp1" ")" .RB "dp2" " = cos(" "dp1" ")" .P .RB "cx2" " = ccos(" "cx1" ")" .RB "cx2" " = cos(" "cx1" ")" .SH DESCRIPTION .I Cos\^ returns the real cosine of its real argument. .I Dcos\^ returns the double-precision cosine of its double-precision argument. .I Ccos\^ returns the complex cosine of its complex argument. The generic form .I cos\^ may be used with impunity because its returned type is determined by that of its argument. .SH SEE ALSO trig(3M). .\" @(#)cos.3f 1.5 K .IR file2 . Identical lines of .I file1\^ and .I file2\^ are copied to .IR output . Sets of differences produced by .IR diff (1) are printed, where a set of differences share a common gutter character. After printing each set of differences, .I sdiff\^ prompts the user with a .B % and waits for one of the following user-typed commands: .PP .RS 19 .TP .B l append the left column to the output file .TP .B r append the right column to the output file .TP .B s turn on silent mode; do not print identical lines .TP .B v turn off silent mode .TP .B "e l" call the editor with the left column .TP .B "e r" call the editor with the right column .TP .B "e b" call the editor with the concatenation of left and right .TP .B e call the editor with a zero length file .TP .B q exit from the program .RE .sp .2i .RS 11 On exit from the editor, the resulting file is concatenated on the end of the .I output\^ file. .RE .SH SEE ALSO diff(1), ed(1). .\" @(#)sdiff.1 1.3 g variables may be used. .IB Number\^ is the occurrence of the specified procedure on the stack, counting the top, or most current, as the first. If no procedure is specified, the procedure currently executing is used by default. .PP It is also possible to specify a variable by its address. All forms of integer constants which are valid in C may be used, so that addresses may be input in decimal, octal, or hexadecimal. .PP Line numbers in the source program are referred to as .IB file-name : number or .IB procedure : number\fR. In either case the number is relative to the beginning of the file. If no procedure or filename is given, the current file is used by default. If no number is given, the first line of the named procedure or file is used. .PP While a process is running under .IR sdb all addresses refer to the executing program; otherwise they refer to .I objfil\^ or .I corfil\^. An initial argument of .B \-w permits overwriting locations in .I objfil\^. .SS Addresses. The address in a file associated wvious command displayed a memory location, display the next memory location. .TP 5 .B control-D Scroll. Print the next 10 lines of instructions, source, or data, depending on which was printed last. .TP 5 .BI "< " filename Read commands from .I filename until the end of file is reached, then continue to accept commands from standard input. When .I sdb is told to display a variable by a command in such a file, the variable name is displayed along with the value. This command may not be nested; .B < may not appear as a command in a file. .TP 5 .B M Print the address maps. .TP 5 .BR M\ [ ?/ ][ \(** "] \fIb \|e \|f\fP" Record new values for the address map. The arguments \fB?\fP and \fB/\fP specify the text and data maps, respectively. The first segment, .RI ( "b1, e1, f1" ), is changed unless \fB\(**\fP is specified, in which case the second segment, .RI ( "b1, e1, f1" ), of the mapping is changed. If fewer than three values are given, the remaining map parameters are left unchanged. .TP 5 \fB"\fI string\fR Princommand. The command name is passed as argument 0 (see .IR exec (2)). The .I value\^ of a simple-command is its exit status if it terminates normally, or (octal) 200+\f2status\^\fP if it terminates abnormally (see .IR signal (2) for a list of status values). .PP A .I pipeline\^ is a sequence of one or more .I commands\^ separated by .B \(bv (or, for historical compatibility, by ^). The standard output of each command except the last one is connected by a .IR pipe (2) to the standard input of the next command. Each command is run as a separate process; the shell waits for the last command to terminate. .PP A .I list\^ is a sequence of one or more pipelines separated by .BR ; , .BR & , .BR && , or .BR \(bv\|\(bv , and optionally terminated by .B ; or .BR & . Of these four symbols, .B ; and .B & have equal precedence, which is lower than that of .B && and .BR \(bv\|\(bv . The symbols .B && and .B \(bv\|\(bv also have equal precedence. A semicolon .RB ( ; ) causes sequential execution of the preceding pipeline; aK ith a written address is determined by a mapping associated with that file. Each mapping is represented by two triples .RI ( "b1, e1, f1" ) and .RI ( "b2, e2, f2" ). The .I file address\^ corresponding to a written .I address\^ is calculated as follows: .PP .RS .IR b1 \*(LE address < e1 \*(IM .IR "file address" = address + f1\-b1 .RE otherwise .PP .RS .IR b2 \*(LE address < e2 \*(IM .IR "file address" = address + f2\-b2, .RE .PP otherwise, the requested .I address\^ is not legal. In some cases (e.g., for programs with separated I and D space) the two segments for a file may overlap. .PP The initial setting of both mappings is suitable for normal .B a.out and .B core files. If either file is not of the kind expected then, for that file, .I b1\^ is set to 0, .I e1\^ is set to the maximum file size, and .I f1\^ is set to 0; in this way the whole file can be examined with no address translation. .PP In order for .I sdb\^ to be used on large files, all appropriate values are kept as signed 32-bit integers. .SS Ct the given string. The C escape sequences of the form .I "\\\\character" are recognized, where .I character is a nonnumeric character. .TP 5 .B q Exit the debugger. .PP The following commands also exist and are intended only for debugging the debugger: .PP .PD 0 .TP 5 .B V Print the version number. .TP 5 .B Q Print a list of procedures and files being debugged. .TP 5 .B Y Toggle debug output. .PD .SH FILES a.out .br core .SH SEE ALSO cc(1), f77(1), sh(1), a.out(4), core(4). .br .IR "\*(6) Programming Guide" . .SH WARNINGS On the .SM VAX\*S-11/780, C variables are identified internally with an underscore prepended. User variables which differ by only an initial underscore cannot be distinguished, as .I sdb recognizes both internal and external names. .PP Data stored in text sections are indistinguishable from functions. .PP Line number information in optimized functions is unreliable, and some information may be missing. .SH BUGS If a procedure is called when the program is .I not\^ stopped at a breakpoint (sn ampersand .RB ( & ) causes asynchronous execution of the preceding pipeline (i.e., the shell does .I not\^ wait for that pipeline to finish). The symbol .B && .RB (\| \(bv\|\(bv \^) causes the .I list\^ following it to be executed only if the preceding pipeline returns a zero (non-zero) exit status. An arbitrary number of new-line characters may appear in a .IR list , instead of semicolons, to delimit commands. .PP A .I command\^ is either a simple-command or one of the following. Unless otherwise stated, the value returned by a command is that of the last simple-command executed in the command. .PP .PD 0 .TP \f3for\fP \f2name\^\fP \*(OK \f3in\fP \f2word\^\fP .\|.\|. \*(CK \f3do\fP \f2list\^\fP \f3done\fP Each time a .B for command is executed, .I name\^ is set to the next .I word\^ taken from the .B in .I word\^ list. If .BI in " word\^" \&.\|.\|. is omitted, then the .B for command executes the \f3do\fP \f2list\^\fP once for each positional parameter that is set (see .I "Parameter Substitution\^" below). ommands. .PP The commands for examining data in the program are: .TP 5 .B t Print a stack trace of the terminated or halted program. .TP 5 .B T Print the top line of the stack trace. .TP 5 .IB variable / clm Print the value of .I variable\^ according to length .I l\^ and format .IR m . A numeric count .I c indicates that a region of memory, beginning at the address implied by .IR variable , is to be displayed. The length specifiers are: .RS .RS .PD 0 .TP .BI b\^ one byte .TP .BI h\^ two bytes (half word) .TP .BI l\^ four bytes (long word) .RE .PD .br .ne 5 .PP Legal values for .I m\^ are: .RS .PD 0 .TP .BI c\^ character .TP .BI d\^ decimal .TP .BI u\^ decimal, unsigned .TP .BI o\^ octal .TP .BI x\^ hexadecimal .TP .BI f\^ 32-bit single precision floating point .TP .BI g\^ 64-bit double precision floating point .TP .BI s\^ Assume .I variable\^ is a string pointer and print characters starting at the address pointed to by the variable. .TP .BI a\^ Print characters starting at the variable's address. This formaL uch as when a core image is being debugged), all variables are initialized before the procedure is started. This makes it impossible to use a procedure which formats data from a core image. .PP The default type for printing F77 parameters is incorrect. Their address is printed instead of their value. .PP Tracebacks containing F77 subprograms with multiple entry points may print too many arguments in the wrong order, but their values are correct. .PP The range of an F77 array subscript is assumed to be .I 1 to .IR n , where .I n is the dimension corresponding to that subscript. This is only significant when the user omits a subscript, or uses .B \(** to indicate the full range. There is no problem in general with arrays having subscripts whose lower bounds are not 1. .\" @(#)sdb.1 1.6 Execution ends when there are no more words in the list. .TP \f3case\fP \f2word\^\fP \f3in\fP \*(OK \f2pattern\^\fP \*(OK \(bv \ \f2pattern\^\fP \*(CK .\|.\|. \f3)\fP \f2list\^\fP \f3;;\fP \*(CK .\|.\|. \f3esac\fP A .B case command executes the .I list\^ associated with the first .I pattern\^ that matches .IR word . The form of the patterns is the same as that used for filename generation (see .I "Filename Generation\^" below). .TP \f3if\fP \f2list\^\fP \f3then\fP \f2list\^\fP \*(OK \ \f3elif\fP \f2list\^\fP \f3then\fP \f2list\^\fP \*(CK .\|.\|. \ \*(OK \f3else\fP \f2list\^\fP \*(CK \f3f\&i\fP The .I list\^ following \f3if\fP is executed and, if it returns a zero exit status, the .I list\^ following the first .B then is executed. Otherwise, the .I list\^ following \f3elif\fP is executed and, if its value is zero, the .I list\^ following the next .B then is executed. Failing that, the .B else .I list\^ is executed. If no .B else .I list\^ or .B then .I list\^ is executed, then the .B if command returns a zerot may not be used with register variables. .TP .BI p\^ pointer to procedure .TP .BI i\^ Disassemble machine-language instruction with addresses printed numerically and symbolically. .TP .BI I\^ Disassemble machine-language instruction with addresses printed numerically only. .RE .PD The length specifiers are only effective with the formats \fBc\fP, \fBd\fP, \fBu\fP, \fBo\fP and \fBx\fP. Any of the specifiers, \fIc\fP, \fIl\fP, and \fIm\fP, may be omitted. If all are omitted, .I sdb chooses a length and a format suitable for the variable's type, as declared in the program. If .I m is specified, then this format is used for displaying the variable. A length specifier determines the output length of the value to be displayed, sometimes resulting in truncation. A count specifier .I c tells .I sdb to display that many units of memory, beginning at the address of .IR variable . The number of bytes in one such unit of memory is determined by the length specifier .IR l , or, if no length is given, by the size associa.TH SDIFF 1 .SH NAME sdiff \- side-by-side difference program .SH SYNOPSIS .B sdiff [ options ... ] file1 file2 .SH DESCRIPTION .I Sdiff\^ uses the output of .IR diff (1) to produce a side-by-side listing of two files indicating those lines that are different. Each line of the two files is printed with a blank gutter between them if the lines are identical, a .B < in the gutter if the line only exists in .IR file1 , a .B > in the gutter if the line only exists in .IR file2 , and a .B | for lines that are different. .PP For example: .PP .RS 11 .nf x | y a a b < c < d d > c .fi .RE .PP The following options exist: .TP 11 .BI \-w " n\^" Use the next argument, .IR n , as the width of the output line. The default line length is 130 characters. .TP .BR \-l Only print the left side of any lines that are identical. .TP .BR \-s Do not print identical lines. .TP .BI \-o " output\^" Use the next argument, .IR output , as the name of a third file that is created as a user controlled merging of .I file1\^ and L  exit status. .TP \f3while\fP \f2list\^\fP \f3do\fP \f2list\^\fP \f3done\fP A .B while command repeatedly executes the .B while .I list\^ and, if the exit status of the last command in the list is zero, executes the .B do .IR list ; otherwise the loop terminates. If no commands in the .B do .I list\^ are executed, then the .B while command returns a zero exit status; .B until may be used in place of .B while to negate the loop termination test. .TP \f3(\fP\f2list\^\fP\f3)\fP .br Execute .I list\^ in a sub-shell. .TP \f3{\fP\f2list\^\fP\f3;}\fP .br .I list\^ is simply executed. .PD .PP The following words are only recognized as the first word of a command and when not quoted: .if t .RS .PP .B .if n if then else elif fi case esac for while until do done { } .if t if then else elif f\&i case esac for while until do done { } .if t .RE .SS Comments. A word beginning with .B # causes that word and all the following characters up to a new line to be ignored. .SS Command Substitution. The standard outputted with the .IR variable. If a count specifier is used for the .B s or .B a command, then that many characters are printed. Otherwise successive characters are printed until either a null byte is reached or 128 characters are printed. The last variable may be redisplayed with the command .BR ./ . .PP The .IR sh (1) metacharacters .B \(** and .B ? may be used within procedure and variable names, providing a limited form of pattern matching. If no procedure name is given, variables local to the current procedure and global variables are matched; if a procedure name is specified, only variables local to that procedure are matched. To match only global variables, the form .BI : pattern\^ is used. .RE .TP 5 .PD 0 .IB linenumber ? lm .TP 5 \fIvariable:\fB?\fIlm\fR .PD Print the value at the address from .BR a.out or I space given by .I linenumber\^ or .IR variable (procedure name), according to the format .IR lm . The default format is `i'. .TP 5 .PD 0 .IB variable = lm .TP 5 .IB linenumber = lm .TP 5 .IB number .IR file2 . Identical lines of .I file1\^ and .I file2\^ are copied to .IR output . Sets of differences produced by .IR diff (1) are printed, where a set of differences share a common gutter character. After printing each set of differences, .I sdiff\^ prompts the user with a .B % and waits for one of the following user-typed commands: .PP .RS 19 .TP .B l append the left column to the output file .TP .B r append the right column to the output file .TP .B s turn on silent mode; do not print identical lines .TP .B v turn off silent mode .TP .B "e l" call the editor with the left column .TP .B "e r" call the editor with the right column .TP .B "e b" call the editor with the concatenation of left and right .TP .B e call the editor with a zero length file .TP .B q exit from the program .RE .sp .2i .RS 11 On exit from the editor, the resulting file is concatenated on the end of the .I output\^ file. .RE .SH SEE ALSO diff(1), ed(1). .\" @(#)sdiff.1 1.3  from a command enclosed in a pair of grave accents (\^\f3\*`\^\*`\fP\^) may be used as part or all of a word; trailing new lines are removed. .SS Parameter Substitution. The character .B $ is used to introduce substitutable .IR parameters . Positional parameters may be assigned values by .BR set . Variables may be set by writing: .RS .PP .IB name = value\^ \*(OK .IB name = value\^ \*(CK .\|.\|. .RE .PP Pattern-matching is not performed on .IR value . .PP .PD 0 .TP \f3${\fP\f2parameter\^\fP\f3}\fP A .I parameter\^ is a sequence of letters, digits, or underscores (a .IR name ), a digit, or any of the characters .BR \(** , .BR @ , .BR # , .BR ? , .BR \- , .BR $ , and .BR !\\^ . The value, if any, of the parameter is substituted. The braces are required only when .I parameter\^ is followed by a letter, digit, or underscore that is not to be interpreted as part of its name. A .I name\^ must begin with a letter or underscore. If .I parameter\^ is a digit then it is a positional parameter. If .I parameter\^ is .B \M = lm .PD Print the address of .I variable\^ or .IR linenumber , or the value of .IR number , in the format specified by .IR lm . If no format is given, then .B lx is used. The last variant of this command provides a convenient way to convert between decimal, octal and hexadecimal. .TP 5 .IB variable ! value Set .I variable\^ to the given .IR value . The value may be a number, a character constant or a variable. The value must be well defined; expressions that produce more than one value, such as structures, are not allowed. Character constants are denoted .BI ' character\fR. Numbers are viewed as integers unless a decimal point or exponent is used. In this case, they are treated as having the type double. Registers are viewed as integers. The .I variable may be an expression that indicates more than one variable, such as an array or structure name. If the address of a variable is given, it is regarded as the address of a variable of type .IR int . C conventions are used in any type conversions necessary to pe.TH SED 1 .SH NAME sed \- stream editor .SH SYNOPSIS .B sed [ .B \-n ] [ .B \-e script ] [ .B \-f sfile ] [ files ] .SH DESCRIPTION .I Sed\^ copies the named .I files\^ (standard input default) to the standard output, edited according to a script of commands. The .B \-f option causes the script to be taken from file .IR sfile ; these options accumulate. If there is just one .B \-e option and no .B \-f option, the flag .B \-e may be omitted. The .B \-n option suppresses the default output. A script consists of editing commands, one per line, of the following form: .sp .RS [ \|address \|[ \|, \|address \|] \|] \|function \|[ \|arguments \|] .RE .sp In normal operation, .I sed\^ cyclically copies a line of input into a .I pattern space\^ (unless there is something left after a .B D command), applies in sequence all commands whose .I addresses\^ select that pattern space, and at the end of the script copies the pattern space to the standard output (except under .BR \-n ) and deletes the pattern space. .PP Some of(** or .BR @ , then all the positional parameters, starting with .BR $1 , are substituted (separated by spaces). Parameter .B $0 is set from argument zero when the shell is invoked. .TP \f3${\fP\f2parameter\^\fP\f3:\-\fP\f2word\^\fP\f3}\fP If .I parameter\^ is set and is non-null, substitute its value; otherwise substitute .IR word . .TP \f3${\fP\f2parameter\^\fP\f3:=\fP\f2word\^\fP\f3}\fP If .I parameter\^ is not set or is null, set it to .IR word ; the value of the parameter is then substituted. Positional parameters may not be assigned in this way. .TP \f3${\fP\f2parameter\^\fP\f3:?\fP\f2word\^\fP\f3}\fP If .I parameter\^ is set and is non-null, substitute its value; otherwise, print .I word\^ and exit from the shell. If .I word\^ is omitted, the message .B "parameter null or not set" is printed. .TP \f3${\fP\f2parameter\^\fP\f3:+\fP\f2word\^\fP\f3}\fP If .I parameter\^ is set and is non-null, substitute .IR word ; otherwise substitute nothing. .PD .PP In the above structures, .I word\^ is not evaluated ulorux{X[^M  the commands use a .I hold space\^ to save all or part of the .I pattern space\^ for subsequent retrieval. .PP An .I address\^ is either a decimal number that counts input lines cumulatively across files, a .B $ that addresses the last line of input, or a context address, i.e., a .BI / "regular expression" / in the style of .IR ed (1) modified thus: .PP .TP 5 \(bu In a context address, the construction \f3\e\fP\f2?regular expression?\^\fP, where .IR ? is any character, is identical to .BI / "regular expression" /\fR.\fP Note that in the context address .BR \exabc\exdefx , the second .B x stands for itself, so that the regular expression is .BR abcxdef . .TP 5 \(bu The escape sequence .B \en matches a new-line character .I embedded\^ in the pattern space. .TP 5 \(bu A period .B . matches any character except the .I terminal\^ new-line character of the pattern space. .TP 5 \(bu A command line with no addresses selects every pattern space. .TP 5 \(bu A command line with one address selects each pattern space thnless it is to be used as the substituted string; in the following example, .B pwd is executed only if .B d is not set or is null: .RS .PP \f3echo \|${d:\-\^\*`\^pwd\^\*`\^}\f1 .RE .PP If the colon .RB ( : ) is omitted from the above expressions, then the shell only checks whether .I parameter\^ is set or not. .PP The following parameters are automatically set by the shell: .RS .PD 0 .TP .B # The number of positional parameters in decimal. .TP .B \- Flags supplied to the shell on invocation or by the .B set command. .TP .B ? The decimal value returned by the last synchronously executed command. .TP .B $ The process number of this shell. .TP .B ! The process number of the last background command invoked. .PD .RE .PP The following parameters are used by the shell: .RS .PD 0 .TP .B .SM HOME The default argument (home directory) for the .I cd\^ command. .TP .B .SM PATH The search path for commands (see .I Execution\^ below). The user may not change .B \s-1PATH\s+1 if executing under .IR rsh . .TP .B .SM CDPATH Trform the indicated assignment. .TP 5 .B x Print the machine registers and the current machine-language instruction. .TP 5 .B X Print the current machine-language instruction. .PP The commands for examining source files are: .PP .PD 0 .TP 5 .BI "e " procedure\^ .TP 5 .BI "e " file-name\^ .TP 5 .BI "e " directory/\^ .TP 5 .BI "e " "directory file-name"\^ .PD The first two forms set the current file to the file containing .I procedure\^ or to .IR file-name . The current line is set to the first line in the named procedure or file. Source files are assumed to be in .IR directory . The default is the current working directory. The latter two forms change the value of .IR directory . If no procedure, filename, or directory is given, the current procedure name and filename are reported. .TP 5 .BI / "regular expression" / Search forward from the current line for a line containing a string matching .I regular expression\^ as in .IR ed (1). The trailing .B / may be elided. .TP 5 .BI ? "regular expression" ? Search baat matches the address. .TP 5 \(bu A command line with two addresses selects the inclusive range from the first pattern space that matches the first address through the next pattern space that matches the second. (If the second address is a number less than or equal to the line number first selected, only one line is selected.)\ Thereafter the process is repeated, looking again for the first address. .PP Editing commands can be applied only to non-selected pattern spaces by use of the negation function .B ! (below). .PP In the following list of functions the maximum number of permissible addresses for each function is indicated in parentheses. .PP The .I text\^ argument consists of one or more lines, all but the last of which end with .B \e to hide the new-line character. Backslashes in text are treated like backslashes in the replacement string of an .B s command, and may be used to protect initial blanks and tabs against the stripping that is done on every script line. The .I rfile\^ or .I wfile\^ argumentN he search path for the .I cd command. .TP .B .SM MAIL If this variable is set to the name of a mail file, then the shell informs the user of the arrival of mail in the specified file. .TP .SM .B PS1 Primary prompt string, by default .RB `` "$ \|" ''. .TP .SM .B PS2 Secondary prompt string, by default .RB `` "> \|" ''. .TP .SM .B IFS Internal field separators, normally .BR space , .BR tab , and .BR "new line" . .PD .RE .PP The shell gives default values to \f3\s-1PATH\s+1\fP, \f3\s-1PS1\s+1\fP, \f3\s-1PS2\s+1\fP, and \f3\s-1IFS\s+1\fP, while .SM .B HOME and .SM .B MAIL are not set at all by the shell (although .SM .B HOME is set by .IR login (1)). .SS Blank Interpretation. After parameter and command substitution, the results of substitution are scanned for internal field separator characters (those found in .BR \s-1IFS\s+1 ) and split into distinct arguments where such characters are found. Explicit null arguments (\^\f3"\^"\fP or \f3\*'\^\*'\fP\^) are retained. Implicit null arguments (those resulting from .ckward from the current line for a line containing a string matching .I regular expression\^ as in .IR ed (1). The trailing .B ? may be elided. .TP 5 .B p Print the current line. .TP 5 .B z Print the current line followed by the next 9 lines. Set the current line to the last line printed. .TP 5 .B w Window. Print the 10 lines around the current line. .TP 5 .I number\^ Set the current line to the given line number. Print the new current line. .TP 5 .IB count + Advance the current line by .I count\^ lines. Print the new current line. .TP 5 .IB count \(mi Retreat the current line by .I count\^ lines. Print the new current line. .PP The commands for controlling the execution of the source program are: .PP .TP 5 \fIcount\fB r \fIargs\fR .br .ns .TP 5 \fIcount\fB R Run the program with the given arguments. The \fBr\fP command with no arguments reuses the previous arguments to the program while the \fBR\fP command runs the program with no arguments. An argument beginning with .B < or .B > causes redirection for the  must terminate the command line and must be preceded by exactly one blank. Each .I wfile\^ is created before processing begins. There can be at most 10 distinct .I wfile\^ arguments. .PP .PD 0 .TP 10 (1)\|\f3a\e\fP .br .ns .TP .I text\^ Append. Place .I text\^ on the output before reading the next input line. .TP .RI (2)\|\f3b\fP " label\^" Branch to the .B : command bearing the .IR label . If .I label\^ is empty, branch to the end of the script. .br .ne 2.1v .TP (2)\|\f3c\e\fP .br .ns .TP .I text\^ Change. Delete the pattern space. With 0 or 1 address or at the end of a 2-address range, place .I text\^ on the output. Start the next cycle. .TP (2)\|\f3d\fP Delete the pattern space. Start the next cycle. .TP (2)\|\f3D\fP Delete the initial segment of the pattern space through the first new-line character. Start the next cycle. .TP (2)\|\f3g\fP Replace the contents of the pattern space by the contents of the hold space. .TP (2)\|\f3G\fP Append the contents of the hold space to the pattern space. .TP (2)\|\f3h\I parameters\^ that have no values) are removed. .SS Filename Generation. Following substitution, each command .I word\^ is scanned for the characters .BR \(** , .BR ? , and .BR \*(OK . If one of these characters appears then the word is regarded as a .IR pattern . The word is replaced with alphabetically sorted filenames that match the pattern. If no filename is found that matches the pattern, then the word is left unchanged. The character .B . at the start of a filename or immediately following a .BR / , as well as the character .B / itself, must be matched explicitly. .PP .PD 0 .RS .TP .B \(** Matches any string, including the null string. .TP .B ? Matches any single character. .TP .BR \*(OK .\|.\|.\^ \*(CK Matches any one of the enclosed characters. A pair of characters separated by .B \- matches any character lexically between the pair, inclusive. If the first character following the opening \`\`\*(OK\'\' is a .B "``!''" then any character not enclosed is matched. .PD .RE .SS Quoting. The following charN standard input or output respectively. If \fIcount\fP is given, it specifies the number of breakpoints to be ignored. .TP 5 \fIlinenumber\fB c\fI count\fR .br .ns .TP 5 \fIlinenumber\fB C\fI count\fR Continue after a breakpoint or interrupt. If \fIcount\fP is given, it specifies the number of breakpoints to be ignored. \fBC\fP continues with the signal that caused the program to stop reactivated and \fBc\fP ignores it. If a linenumber is specified then a temporary breakpoint is placed at the line and execution is continued. The breakpoint is deleted when the command finishes. .TP 5 \fIlinenumber\fB g\fI count\fR Continue after a breakpoint with execution resumed at the given line. If \fIcount\fP is given, it specifies the number of breakpoints to be ignored. .TP 5 \fBs \fIcount\fR .br .ns .TP 5 \fBS \fIcount\fR Single step the program through \fIcount\fP lines. If no count is given then the program is run for one line. .B S is equivalent to .B s except it steps through procedure calls. .TP 5 \fBi\fR .br .ns .fP Replace the contents of the hold space by the contents of the pattern space. .TP (2)\|\f3H\fP Append the contents of the pattern space to the hold space. .TP (1)\|\f3i\e\fP .br .ns .TP .I text\^ Insert. Place .I text\^ on the standard output. .TP (2)\|\f3l\fP List the pattern space on the standard output in an unambiguous form. Non-printing characters are spelled in two-digit .SM ASCII and long lines are folded. .TP (2)\|\f3n\fP Copy the pattern space to the standard output. Replace the pattern space with the next line of input. .TP (2)\|\f3N\fP Append the next line of input to the pattern space with an embedded new-line character. (The current line number changes.) .TP (2)\|\f3p\fP Print. Copy the pattern space to the standard output. .TP (2)\|\f3P\fP Copy the initial segment of the pattern space through the first new-line character to the standard output. .TP (1)\|\f3q\fP Quit. Branch to the end of the script. Do not start a new cycle. .TP .RI (2)\|\f3r\fP " rfile\^" Read the contents of .IR rfile . Placwz}TP 5 \fBI\fR Single step by one machine-language instruction. \fBI\fP steps with the signal that caused the program to stop reactivated and \fBi\fP ignores it. .TP 5 \fIvariable$\fBm \fIcount\fR .br .ns .TP 5 \fIaddress:\fBm \fIcount\fR Single step (as with \fBs\fP) until the specified location is modified with a new value. If \fIcount\fP is omitted, it is effectively infinity. \fIVariable\fR must be accessible from the current procedure. Since this command is done by software, it can be very slow. .TP 5 \fIlevel\fB v \fR Toggle verbose mode, for use when single stepping with \fBS\fP, \fBs\fP or \fBm\fP. If \fIlevel\fP is omitted, then just the current source file and/or subroutine name is printed when either changes. If \fIlevel\fP is 1 or greater, each C source line is printed before it is executed; if \fIlevel\fP is 2 or greater, each assembler statement is also printed. A \fBv\fP turns verbose mode off if it is on for any level. .TP 5 .B k Kill the program being debugged. .TP 5 procedure\fB(\fParg1,arg2,.O e them on the output before reading the next input line. .TP .RI (2)\|\f3s\fP/ "regular expression" / replacement / flags\^ Substitute the .I replacement\^ string for instances of the .I regular expression\^ in the pattern space. Any character may be used instead of .BR / . For a fuller description see .IR ed (1). .I Flags\^ is zero or more of: .RS .RS .TP .B g Global. Substitute for all nonoverlapping instances of the .I regular expression\^ rather than just the first one. .TP .B p Print the pattern space if a replacement was made. .TP .BI w " wfile\^" Write. Append the pattern space to .I wfile\^ if a replacement was made. .RE .RE .TP .RI (2)\|\f3t\fP " label\^" Test. Branch to the .B : command bearing the .I label\^ if any substitutions have been made since the most recent reading of an input line or execution of a .BR t . If .I label\^ is empty, branch to the end of the script. .TP .RI (2)\|\f3w\fP " wfile\^" Write. Append the pattern space to .IR wfile . .TP (2)\|\f3x\fP Exchange the contents of the pattacters have a special meaning to the shell and cause termination of a word unless quoted: .RS .PP \f3; & ( ) \(bv ^ < > new\^line space tab\fP .RE .PP A character may be .I quoted\^ (i.e., made to stand for itself) by preceding it with a .BR \e . The pair .B \enew line is ignored. All characters enclosed between a pair of single quote marks (\^\f3\*'\^\*'\fP\^), except a single quote, are quoted. Inside double quote marks (\f3"\^"\fP), parameter and command substitution occur and .B \e quotes the characters .BR \e , .BR \*` , \f3"\fP, and .BR $ . .B "$\(**" is equivalent to \f3"$1 \|$2\fP \|.\|.\|.\f3"\fP, whereas .B "$@" is equivalent to .B "$1"\| .B "$2"\| \&.\|.\|.\|. .SS Prompting. When used interactively, the shell prompts with the value of .SM .B PS1 before reading a command. If at any time a new-line character is typed and further input is needed to complete a command, then the secondary prompt (i.e., the value of .BR \s-1PS2\s+1 ) is issued. .SS Input/Output. Before a command is executed, it..\fB)\fP .br .ns .TP 5 procedure\fB(\fParg1,arg2,...\fB)/\fP\fIm\fP Execute the named procedure with the given arguments. Arguments can be integer, character or string constants or names of variables accessible from the current procedure. The second form causes the value returned by the procedure to be printed according to format \fIm\fP. If no format is given, it defaults to .BR d . .TP 5 \fIlinenumber\fB b\fR \fIcommands\fR Set a breakpoint at the given line. If a procedure name without a line number is given (e.g., \fBproc:\fR), a breakpoint is placed at the first line in the procedure even if it was not compiled with the .B \-g option. If no \fIlinenumber\fP is given, a breakpoint is placed at the current line. If no .I commands\^ are given, execution stops just before the breakpoint and control is returned to .IR sdb . Otherwise the .I commands\^ are executed when the breakpoint is encountered and execution continues. Multiple commands are specified by separating them with semicolons. If \fBk\fP is useern and hold spaces. .TP .RI (2)\|\f3y\fP/ string1 / string2 /\^ Transform. Replace all occurrences of characters in .I string1\^ with the corresponding character in .IR string2 . The lengths of .I string1 and .I string2\^ must be equal. .TP .RI (2)\f3!\fP " function\^" Don't. Apply the .I function\^ (or group, if .I function\^ is .BR {\| ) only to lines .I not\^ selected by the address(es). .TP .RI (0)\|\f3:\fP " label\^" This command does nothing; it bears a .I label\^ for .B b and .B t commands to branch to. .TP (1)\|\f3=\fP Place the current line number on the standard output as a line. .TP (2)\|\f3{\fP Execute the following commands through a matching .B } only when the pattern space is selected. .TP (0)\| An empty command is ignored. .PD .SH SEE ALSO awk(1), ed(1), grep(1). .br ``Stream Editor'' in the .IR "\*(6) Document Processing Guide" . .\" @(#)sed.1 1.7 O s input and output may be redirected using a special notation interpreted by the shell. The following may appear anywhere in a simple-command or may precede or follow a command and are not passed on to the invoked command; substitution occurs before .I word\^ or .I digit\^ is used: .PP .PD 0 .TP 14 .B word Use file .I word\^ as standard output (file descriptor 1). If the file does not exist, it is created; otherwise, it is truncated to zero length. .TP .B >\h@-.3m@>word Use file .I word\^ as standard output. If the file exists, output is appended to it (by first seeking to the end-of-file); otherwise, the file is created. .TP \f3<\h@-.3m@<\fP\*(OK\f3\-\fP\*(CK\f3word\fP The shell input is read up to a line that is the same as .IR word , or to an end-of-file. The resulting document becomes the standard input. If any character of .I word\^ is quoted, then no interpretation is placed upon the characters of the document; otherwise, parameter d as a command to execute at a breakpoint, control returns to .IR sdb , instead of continuing execution. .TP 5 .B B Print a list of the currently active breakpoints. .TP 5 \fIlinenumber\fB d\fR Delete a breakpoint at the given line. If no \fIlinenumber\fP is given, the breakpoints are deleted interactively. Each breakpoint location is printed and a line is read from the standard input. If the line begins with a .B y or .B d , the breakpoint is deleted. .TP 5 .B D Delete all breakpoints. .TP 5 .B l Print the last executed line. .TP 5 \fIlinenumber\fB a\fR Announce. If \fIlinenumber\fR is of the form .IB proc : number\fR, the command effectively does a .IB "linenumber " "b l\fR. If \fIlinenumber\fR is of the form .IB proc :\fR, the command effectively does a .IB proc ": b T"\fR. .PP Miscellaneous commands: .TP 5 .BI ! command\^ The command is interpreted by .IR sh (1). .TP 5 .B new-line If the previous command printed a source line, advance the current line by one line and print the new current line. If the pre.if t .ds ' \h@.05m@\s+4\v@.333m@\'\v@-.333m@\s-4\h@.05m@ .if n .ds ' ' .if t .ds ` \h@.05m@\s+4\v@.333m@\`\v@-.333m@\s-4\h@.05m@ .if n .ds ` ` .ds OK [\| .ds CK \|] .TH SH 1 .SH NAME sh, rsh \- shell, the standard/restricted command programming language .SH SYNOPSIS .B sh [ .B \-ceiknrstuvx ] [ args ] .br .B rsh [ .B \-ceiknrstuvx ] [ args ] .SH DESCRIPTION .I Sh\^ is a command programming language that executes commands read from a terminal or a file. .I Rsh\^ is a restricted version of the standard command interpreter .IR sh ; it is used to set up login names and execution environments whose capabilities are more controlled than those of the standard shell. See .I Invocation\^ below for the meaning of arguments to the shell. .SS Commands. A .I simple-command\^ is a sequence of non-blank .I words\^ separated by .I blanks\^ (a .I blank\^ is a tab or a space). The first word specifies the name of the command to be executed. Except as specified below, the remaining words are passed as arguments to the invoked substitution and command substitution occur, (unescaped) .B \enew line is ignored, and .B \e must be used to quote the characters .BR \e , .BR $ , .BR \*` , and the first character of .IR word . If .B \- is appended to .BR <\h@-.3m@< , all leading tabs are stripped from .I word\^ and from the document. .TP .B <&digit The standard input is duplicated from file descriptor .I digit\^ (see .IR dup (2)). The standard output can be duplicated similarly, using .B > in place of .BR < . .TP .B <&\- The standard input is closed. The standard output can be closed similarly, using .B > in place of .BR < . .PD .PP If one of the above is preceded by a digit, the file descriptor created is that specified by the digit (instead of the default 0 or 1). For example: .RS .PP \f3\&.\|.\|. \|2>&1\f1 .RE .PP creates file descriptor 2 that is a duplicate of file descriptor 1. .PP If a command is followed by .BR & , the default standard input for the command is the empty file .BR /dev/null . Otherwise, the environment for the execu