12.07.2015 Views

Intel® Fortran Libraries Reference

Intel® Fortran Libraries Reference

Intel® Fortran Libraries Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Descriptions of the Library Routines 2proc(Input) Name of a signal-processing routine. It must be declared EXTERNAL. This routine iscalled only if flag is negative.flag(Input) INTEGER(4). If negative, the user’s proc routine is called. If 0, the signal retains itsdefault action; if 1, the signal should be ignored.Results:The result type is INTEGER(4) on IA-32 processors; INTEGER(8) on Intel Itanium processors.The result is the previous value of proc associated with the specified signal. For example, if theprevious value of proc was SIG_IGN, the return value is also SIG_IGN. You can use this returnvalue in subsequent calls to SIGNAL if the signal number supplied is invalid, if the flag value isgreater than 1, or to restore a previous action definition.A return value of SIG_ERR indicates an error, in which case a call to IERRNO returns EINVAL.If the signal number supplied is invalid, or if the flag value is greater than 1, SIGNAL returns–(EINVAL) and a call to IERRNO returns EINVAL.An initial signal handler is in place at startup for SIGFPE (signal 8); its address is returned the firsttime SIGNAL is called for SIGFPE. No other signals have initial signal handlers.Be careful when you use SIGNALQQ or the C signal function to set a handler, and then use thePortability SIGNAL function to retrieve its value. If SIGNAL returns an address that was notpreviously set by a call to SIGNAL, you cannot use that address with either SIGNALQQ or C’ssignal function, nor can you call it directly. You can, however, use the return value from SIGNALin a subsequent call to SIGNAL. This allows you to restore a signal handler, no matter how theoriginal signal handler was set.All signal handlers are called with a single integer argument, that of the signal number actuallyreceived. Usually, when a process receives a signal, it terminates. With the SIGNAL function, auser procedure is called instead. The signal handler routine must accept the signal number integerargument, even if it does not use it. If the routine does not accept the signal number argument, thestack will not be properly restored after the signal handler has executed.Because signal-handler routines are usually called asynchronously when an interrupt occurs, it ispossible that your signal-handler function will get control when a run-time operation is incompleteand in an unknown state. You cannot use the following kinds of signal-handler routines:• Routines that perform low-level (such as FGETC) or high-level (such as READ) I/O.• Heap routines or any routine that uses the heap routines (such as MALLOC andALLOCATE).• Functions that generate a system call (such as TIME).The following table lists signal names and values:2-441

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!