uswitch - Get or set compatibility environment specific behavior for a calling process through the uswitch value.
Specifies the requested actions. The valid
Returns the current
value for the
calling process. If
is non-zero, it returns the
status of specific
Changes the current
value for the
calling process as specified by the
The following bit-masks are valid when specified with either
of the values for the
Specifies System V NULL pointer behavior.
Specifies process requests enhanced core file naming.
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 segmentation 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.
references to NULL pointers generate a segmentation violation
signal (SIGSEGV) regardless of the
Usage of this system call may make the application non-portable.
Upon successful completion, either the current or new
is returned. Otherwise,
a value of
is returned and
is set to indicate the error.
system call fails, the
value remains unchanged and
is set to the
is greater than USW_MAX or
less than USW_MIN.
The following code sample sets the bit mask for System V NULL pointer behavior:
... 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:
... uswitch_val = uswitch(USC_GET,0); /* Gets current value*/ uswitch(USC_SET, uswitch_val | USW_CORE); /* Sets USW_CORE bit */