A-94
Motorola DSP56000 Family Optimizing C Compiler User’s Manual
For More Information On This Product,
Go to: www.freescale.com
Motorola
A.4.89 setvbuf—Alter stream buffering
#include <stdio.h>
int setvbuf ( FILE *stream,
char *buf, int mode, size_t size );
The function
setvbuf
is used to alter the way a specified stream is buffered. It must only
be used before any other operation is performed on the specified stream. The argument
mode
determines the buffering policy:
_IOFBF
—Use the full size of the buffer in the most efficient way.
_IOLBF
—Use a line buffering policy: flush on newlines.
_IONBF
—Do not buffer the stream at all.
The argument
size
specified the buffer size for this stream. The pointer
buf
, if
non-
NULL
, may be used for stream buffering. If
buf
is
NULL
, then
setvbuf
will allocate
any needed buffer.
Refer to the following sections for more information:
Section A.4.88, “setbuf—Read formatted input from standard input,” on page A-93
A.4.90 signal—Set up signal handler
#include <setjmp.h>
void (*signal( int sig, void (*func)(int) ) ) (int);
The
signal
function chooses one of three ways in which to handle the receipt of signal
sig
.
1. If the value of
func
is the macro
SIG_DFL
, default handling for the signal will
occur.
2. If the value of
func
is the macro
SIG_IGN
, the signal is ignored.
3. Otherwise,
func
is a pointer to a function that will be called on the receipt of signal
sig
.
When a signal occurs, the signal handler for
sig
is reset to
SIG_DFL
; this is equivalent to
making the call
signal
(
sig, SIG_DFL
). The function
func
terminates by executing
the
return
statement or by calling the
abort
,
exit
, or
longjmp
function. If the
function
func
terminates with a
return
statement, execution continues at the point the
signal was caught. Note that if the value of
sig
was
SIGFPE
, the behavior is undefined.
Also note that in order to continue catching signal
sig
, the signal handler must reissue the
signal call.
For more information, see Chapter 6, “Software-Hardware Integration.” .
F
Freescale Semiconductor, Inc.
n
.