*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: uswitch | Section: 2 | Source: Digital UNIX | File: uswitch.2.gz
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 cur- rent uswitch value for the calling process as specified by the mask bit-mask(s). The following bit-masks are valid when specified with ei- ther of the values for the cmd parameter: Specifies System V NULL pointer behavior. Specifies process requests enhanced core file nam- ing. DESCRIPTION The uswitch system call is used to get or change the compatibility en- vironment specific behavior in DIGITAL 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 segmenta- tion violation signal (SIGSEGV). When the USW_CORE bit of uswitch is set to 1, the process requests en- hanced 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 viola- tion signal (SIGSEGV) regardless of the uswitch value. 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 */ NOTE 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. delim off uswitch(2)

Navigation Options