*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> uswitch (2)              
Title
Content
Arch
Section
 

uswitch(2)

Contents


NAME    [Toc]    [Back]

       uswitch  -  Get  or set compatibility environment specific
       behavior for a calling process through the uswitch  value.

SYNOPSIS    [Toc]    [Back]

       #include <sys/uswitch.h>

       long uswitch(
               long cmd,
               long mask );

PARAMETERS    [Toc]    [Back]

       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 bitmask(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    [Toc]    [Back]

       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  bitmask
 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    [Toc]    [Back]

       Usage of this system call may make  the  application  nonportable.

RETURN VALUES    [Toc]    [Back]

       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    [Toc]    [Back]

       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    [Toc]    [Back]

       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)
[ Back ]
 Similar pages
Name OS Title
pthread_atfork Tru64 Declares fork handler routines to be called when the calling thread's process forks a child process
pxfwait IRIX Obtains information about a calling process' child process
madvise Tru64 Advise the system of the expected paging behavior of a process
getaudproc HP-UX get the audit process flag for the calling process
tt_open HP-UX return the process identifier for the calling process
nmadvise Tru64 Advise the system of the expected paging behavior of a process (libnuma)
setpgrp3 HP-UX create session and set process group ID; for HP-UX 9.x compatibility.
_exit FreeBSD terminate the calling process
_exit NetBSD terminate the calling process
getegid Tru64 Get the group ID of the calling process
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service