📄 0916-0920.html
字号:
<HTML>
<HEAD>
<TITLE>Linux Complete Command Reference:Library Functions:EarthWeb Inc.-</TITLE>
</HEAD>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!-- ISBN=0672311046 //-->
<!-- TITLE=Linux Complete Command Reference//-->
<!-- AUTHOR=Red Hat//-->
<!-- PUBLISHER=Macmillan Computer Publishing//-->
<!-- IMPRINT=Sams//-->
<!-- CHAPTER=03 //-->
<!-- PAGES=0891-1062 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="0914-0915.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0921-0921.html">Next</A></CENTER></P>
<A NAME="PAGENUM-916"><P>Page 916</P></A>
<A NAME="PAGENUM-917"><P>Page 917</P></A>
<TABLE>
<TR><TD>
ENOSPC
</TD><TD>
No space left on device
</TD></TR><TR><TD>
ENOSYS
</TD><TD>
Function not implemented
</TD></TR><TR><TD>
ENOTDIR
</TD><TD>
Not a directory
</TD></TR><TR><TD>
ENOTEMPTY
</TD><TD>
Directory not empty
</TD></TR><TR><TD>
ENOTTY
</TD><TD>
Inappropriate I/O control operation
</TD></TR><TR><TD>
ENXIO
</TD><TD>
No such device or address
</TD></TR><TR><TD>
EPERM
</TD><TD>
Operation not permitted
</TD></TR><TR><TD>
EPIPE
</TD><TD>
Broken pipe
</TD></TR><TR><TD>
ERANGE
</TD><TD>
Result too large
</TD></TR><TR><TD>
EROFS
</TD><TD>
Read-only filesystem
</TD></TR><TR><TD>
ESPIPE
</TD><TD>
Invalid seek
</TD></TR><TR><TD>
ESRCH
</TD><TD>
No such process
</TD></TR><TR><TD>
EXDEV
</TD><TD>
Improper link
</TD></TR></TABLE>
<H3><A NAME="ch03_ 45">
See Also
</A></H3>
<P>perror(3)</P>
<P>21 July 1996</P>
<H3><A NAME="ch03_ 46">
exit
</A></H3>
<P>exit—Causes normal program termination</P>
<H3><A NAME="ch03_ 47">
Synopsis
</A></H3>
<!-- CODE SNIP //-->
<PRE WIDTH="1">
#include <stdlib.h>
void exit(int status);
</PRE>
<!-- END CODE SNIP //-->
<H3><A NAME="ch03_ 48">
Description
</A></H3>
<P>The exit() function causes normal program termination, and the value of
status is returned to the parent. All functions registered with
atexit() and on exit() are called in the reverse order of their registration, and all open streams are
flushed and closed.
</P>
<H3><A NAME="ch03_ 49">
Return Value
</A></H3>
<P>The exit() function does not return.
</P>
<H3><A NAME="ch03_ 50">
Conforms To
</A></H3>
<P>SVID 3, POSIX, BSD 4.3, ISO 9899</P>
<H3><A NAME="ch03_ 51">
See Also
</A></H3>
<P>_exit(2), atexit(3), on_exit(3)
</P>
<P>GNU, 2 April 1993
</P>
<H3><A NAME="ch03_ 52">
exp, log, log10, pow
</A></H3>
<P>exp, log, log10, pow—Exponential, logarithmic, and power functions
</P>
<H3><A NAME="ch03_ 53">
Synopsis
</A></H3>
<!-- CODE SNIP //-->
<PRE WIDTH="1">
#include <math.h>
double exp(double x);
</PRE>
<!-- END CODE SNIP //-->
<A NAME="PAGENUM-918"><P>Page 918</P></A>
<!-- CODE SNIP //-->
<PRE WIDTH="1">
double log(double x);
double log10(double x);
double pow(double x, double y);
</PRE>
<!-- END CODE SNIP //-->
<H3><A NAME="ch03_ 54">
Description
</A></H3>
<P>The exp() function returns the value of e (the base of natural logarithms) raised to the power of
x.
</P>
<P>The log() function returns the natural logarithm of
x.</P>
<P>The log10() function returns the base-10 logarithm of
x.</P>
<P>The pow() function returns the value of x raised to the power of
y.</P>
<H3><A NAME="ch03_ 55">
Errors
</A></H3>
<P>The log() and log10() functions can return the following errors:
</P>
<!-- CODE SNIP //-->
<PRE>
EDOM The argument x is negative.
ERANGE The argument x is 0. The log of 0 is not defined.
</PRE>
<!-- END CODE SNIP //-->
<P>The pow() function can return the following error:
</P>
<!-- CODE SNIP //-->
<PRE>
EDOM The argument x is negative and y is not an integral value. This would result in a complex number.
</PRE>
<!-- END CODE SNIP //-->
<P><B>CONFORMS TO</B>
</P>
<P>SVID 3, POSIX, BSD 4.3, ISO 9899
</P>
<P></B>SEE ALSO</b>
</P>
<P>sqrt(3), cbrt(3)</P>
<P>GNU June 16, 1993</P>
<H3><A NAME="ch03_ 56">
expm1, log1p
</A></H3>
<P>expm1, log1p—Exponential minus 1, logarithm of 1 plus argument
</P>
<P><B>SYNOPSIS</b>
</P>
<!-- CODE SNIP //-->
<PRE WIDTH="1">#include <math.h>
double expm1 (double x);
double log1p (double x);
</PRE>
<!-- END CODE SNIP //-->
<b><P>DESCRIPTION
</P></b>
<P>expm1(x) returns a value equivalent to exp (x)_1. It is computed in a way that is accurate even if the value of
x is near 0—a case where exp (x)_1 would be inaccurate due to subtraction of two numbers that are nearly equal.
<P>log1p(x) returns a value equivalent to log (1 + x). It is computed in a way that is accurate even if the value of
x is near 0.
</P>
<P><B>CONFORMS TO</b>
</P>
<P>BSD</P>
<P></B>SEE ALSO</b>
</P>
<P>exp(3), log(3)</P>
<P>GNU, 16 September 1995</P>
<A NAME="PAGENUM-919"><P>Page 919</P></A>
<H3><A NAME="ch03_ 57">
fabs
</A></H3>
<P>Fabs—Absolute value of floating-point number
</P>
<P><B>SYNOPSIS</b>
</P>
<!-- CODE SNIP //-->
<PRE WIDTH="1">#include <math.h>
double fabs(double x);
</PRE>
<!-- END CODE SNIP //-->
<P><B>DESCRIPTION</b>
</P>
<P>The fabs() function returns the absolute value of the floating-point number
x.</P>
<P><B>CONFORMS TO</b>
</P>
<P>SVID 3, POSIX, BSD 4.3, ISO 9899
</P>
<P></B>SEE ALSO</b>
</P>
<P>abs(3), ceil(3), floor(3), labs(3), rint(3)
<P>25 June 1993
<H3><A NAME="ch03_ 58">
fclose
</A></H3>
<P>fclose—Closes a stream
</P>
<P><B>SYNOPSIS</b>
</P>
<!-- CODE SNIP //-->
<PRE WIDTH="1">#include <stdio.h>
int fclose(FILE *stream);
</PRE>
<!-- END CODE SNIP //-->
<P><B>DESCRIPTION</b>
</P>
<P>The fclose function dissociates the named
stream from its underlying file or set of functions. If the stream was being used
for output, any buffered data is written first, using
fflush(3).
<P>
<B>RETURN VALUES</b>
</P>
<P>Upon successful completion, 0 is returned. Otherwise,
EOF is returned, and the global variable errno is set to indicate
the error. In either case, no further access to the stream is possible.
</P>
<P><B>ERRORS</b>
</P>
<!-- CODE SNIP //-->
<PRE>
EBADF The argument stream is not an open stream.
</PRE>
<!-- END CODE SNIP //-->
<P>The fclose function may also fail and set errno for any of the errors specified for the routines
close(2) or fflush(3).
</P>
<P></B>SEE ALSO</b>
</P>
<P>close(2), fflush(3), fopen(3), setbuf(3)
</P>
<P></B>STANDARDS</b>
</P>
<P>The fclose function conforms to ANSI C3.159-1989 ("ANSI C").
</P>
<P>BSD Man Page, 29 November 1993
</P>
<H3><A NAME="ch03_ 59">
clearerr, feof, ferror, fileno
</A></H3>
<P>clearerr, feof, ferror, fileno—Check and reset stream status
</P>
<A NAME="PAGENUM-920"><P>Page 920</P></A>
<P><B>SYNOPSIS</b>
</P>
<!-- CODE SNIP //-->
<PRE WIDTH="1">#include <stdio.h>
void clearerr( FILE *stream);
int feof(FILE *stream);
int ferror(FILE *stream);
int fileno(FILE *stream);
</PRE>
<!-- END CODE SNIP //-->
<P><B>DESCRIPTION</b>
</P>
<P>The function clearerr clears the end-of-file and error indicators for the stream pointed to by
stream.
</P>
<P>The function feof tests the end-of-file indicator for the stream pointed to by
stream, returning nonzero if it is set. The end-of-file indicator can only be cleared by the function
clearerr.
</P>
<P>The function ferror tests the error indicator for the stream pointed to by
stream, returning nonzero if it is set. The error indicator can only be reset by the
clearerr function.
</P>
<P>The function fileno examines the argument
stream and returns its integer descriptor.
</P>
<P><B>ERRORS</b>
</P>
<P>These functions should not fail and do not set the external variable
errno.
</P>
<P></B>SEE ALSO</b>
</P>
<P>open(2), stdio(3)</P>
<P></B>STANDARDS</b>
</P>
<P>The functions clearerr, feof, and ferror conform to C3.159-1989 ("ANSI C").
<P>BSD Man Page, 29 November 1993
<H3><A NAME="ch03_ 60">
fflush, fpurge
</A></H3>
<P>fflush, fpurge—Flush a stream</P>
<P><B>SYNOPSIS</b>
</P>
<!-- CODE SNIP //-->
<PRE>
#include <stdio.h>
int fflush( FILE *stream);
int fpurge( FILE *stream);
</PRE>
<!-- END CODE SNIP //-->
<P><B>DESCRIPTION</b>
</P>
<P>The function fflush forces a write of all buffered data for the given output or update stream via the stream's underlying
write function. The open status of the stream is unaffected.
<P>If the stream argument is NULL, fflush flushes all open output streams. (Does this happen under Linux?)
<P>The function fpurge erases any input or output buffered in the given stream. For output streams, this discards any
unwritten output. For input streams, this discards any input read from the underlying object but not yet obtained via
getc(3); this includes any text pushed back via
ungetc.
</P>
<P>
<B>RETURN VALUES</b>
</P>
<P>Upon successful completion, 0 is returned. Otherwise,
EOF is returned, and the global variable errno is set to indicate
the error.
</P>
<P><B>ERRORS</b>
</P>
<!-- CODE SNIP //-->
<PRE>
EBADF Stream is not an open stream, or, in the case of
fflush, not a stream open for writing.
</PRE>
<!-- END CODE SNIP //-->
<P>The function fflush may also fail and set errno for any of the errors specified for the routine
write(2).
</P>
<P><CENTER>
<a href="0914-0915.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0921-0921.html">Next</A></CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -