Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

uswitch(2) [osf1 man page]

uswitch(2)							System Calls Manual							uswitch(2)

NAME
uswitch - Get or set compatibility environment specific behavior for a calling process through the uswitch value. SYNOPSIS
#include <sys/uswitch.h> long uswitch( long cmd, long mask ); PARAMETERS
Specifies the requested actions. The valid cmd values are: Returns the current uswitch value for the calling process. If mask is non-zero, it returns the status of specific uswitch bit-mask(s). Changes the current uswitch value for the calling process as specified by the mask bit-mask(s). The following bit-masks are valid when specified with either of the values for the cmd parameter: Specifies System V NULL pointer behavior. Specifies process requests enhanced core file naming. DESCRIPTION
The uswitch system call is used to get or change the compatibility environment specific behavior in Tru64 UNIX. Any changes affect the calling process and its children. When the USW_NULLP bit of uswitch is set to 1, the System V method of treating NULL pointers is applied. In this method, references to a NULL pointer always returns zero (0). When this bit-mask is reset to zero (0), subsequent references to a NULL pointer generate a segmen- tation violation signal (SIGSEGV). When the USW_CORE bit of uswitch is set to 1, the process requests enhanced core file naming. The bit-mask, when set, can be inherited when the process forks. The bit-mask is cleared when an exec system call is executed. See core(4) for more information about core files. Any write(2) references to NULL pointers generate a segmentation violation signal (SIGSEGV) regardless of the uswitch value. NOTES
Usage of this system call may make the application non-portable. RETURN VALUES
Upon successful completion, either the current or new uswitch value for mask is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. ERRORS
If the uswitch system call fails, the uswitch value remains unchanged and errno is set to the following: The mask is greater than USW_MAX or less than USW_MIN. EXAMPLES
The following code sample sets the bit mask for System V NULL pointer behavior: long uswitch_val; ... uswitch_val = uswitch(USC_GET,0); /* Gets current value*/ uswitch(USC_SET, uswitch_val | USW_NULLP); /* Sets USW_NULLP bit */ The following code sample sets the bit mask for enhanced core file names: long uswitch_val; ... uswitch_val = uswitch(USC_GET,0); /* Gets current value*/ uswitch(USC_SET, uswitch_val | USW_CORE); /* Sets USW_CORE bit */ uswitch(2)

Check Out this Related Man Page

sigprocmask(2)							System Calls Manual						    sigprocmask(2)

NAME
sigprocmask, sigsetmask - Sets the current signal mask LIBRARY
Standard C Library (libc) SYNOPSIS
#include <signal.h> int sigprocmask( int how, const sigset_t *set, sigset_t *o_set ); The following function declaration does not conform to current standards and is supported only for backward compatibility: int sigsetmask ( int signal_mask ); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: sigprocmask(): XSH4.2 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Indicates the manner in which the set of masked signals is changed; it has one of the following values: The resulting set is the union of the current set and the signal set pointed to by the set parameter. The resulting set is the intersection of the current set and the com- plement of the signal set pointed to by the set parameter. The resulting set is the signal set pointed to by the set parameter. Specifies the signal set. If the value of the set parameter is not null, it points to a set of signals to be used to change the currently blocked set. If the value of the set parameter is null, the value of the how parameter is not significant and the process signal mask is unchanged; thus, the call can be used to inquire about currently blocked signals. If the o_set parameter is not the null value, the signal mask in effect at the time of the call is stored in the space pointed to by the o_set parameter. [Tru64 UNIX] Specifies the new signal mask for the process. DESCRIPTION
The sigprocmask() function is used to examine or change the signal mask of the calling process. Typically, you would use the sigprocmask (SIG_BLOCK) function to block signals during a critical section of code, and then use the sigproc- mask (SIG_SETMASK) function to restore the mask to the previous value returned by the sigprocmask (SIG_BLOCK) function. If there are any unblocked signals pending after the call to the sigprocmask() function, at least one of those signals will be delivered before the sigprocmask() function returns. The sigprocmask() function does not allow the SIGKILL or SIGSTOP signals to be blocked. If a program attempts to block one of these sig- nals, the sigprocmask() function gives no indication of the error. [Tru64 UNIX] The sigsetmask() function allows the process signal mask to change for signal values 1 to 31. This same function can be accomplished for all values with the sigprocmask(SIG_SETMASK) function. The signal of value i will be blocked if the i-th bit of sig- nal_mask parameter is set. EXAMPLES
To set the signal mask to block only the SIGINT signal from delivery, enter: #include <signal.h> int return_value; sigset_t newset; ... sigemptyset(&newset); sigaddset(&newset, SIGINT); return_value = sigprocmask (SIG_SETMASK, &newset, NULL); RETURN VALUES
Upon successful completion, the sigprocmask() function returns a value of 0 (zero). If the sigprocmask() function fails, the signal mask of the process is unchanged, a value of -1 is returned, and errno is set to indicate the error. [Tru64 UNIX] Upon successful completion, the sigsetmask() function returns the value of the previous signal mask. If the function fails, a value of -1 is returned. ERRORS
The sigprocmask() function sets errno to the specified values for the following conditions: The value of the how parameter is not equal to one of the defined values. [Tru64 UNIX] The set or o_set parameter points to a location outside the allocated address space of the process. RELATED INFORMATION
Functions: kill(2), sigaction(2), sigsuspend(2), sigvec(2), sigpause(3) Standards: standards(5) delim off sigprocmask(2)
Man Page