Library /sys$common/syshlp/helplib.hlb  —  CRTL  setuid
    With POSIX IDs disabled, implemented for program portability and
    serves no function. It returns 0 (to indicate success).

    With POSIX IDs enabled, sets the user IDs.

    Format

      #include  <types.h>

      #include  <unistd.h>

      int setuid  (__uid_t uid); (_DECC_V4_SOURCE)

      uid_t setuid  (uid_t uid); (not _DECC_V4_SOURCE)

1  –  Argument

 uid

    The value to which you want the user IDs set.

2  –  Description

    The setuid function can be used with POSIX style identifiers
    enabled or disabled.

    POSIX style IDs are supported on OpenVMS Version 7.3-2 and
    higher.

    With POSIX IDs disabled (the default), the setuid function is
    implemented for program portability and serves no function. It
    returns 0 (to indicate success).

    With POSIX style IDs enabled:

    o  If the process has the IMPERSONATE privilege, the setuid
       function sets the real user ID, effective user ID, and the
       saved set-user-ID to uid.

    o  If the process does not have appropriate privileges but uid
       is equal to the real user ID or to the saved set-user-ID, then
       the setuid function sets the effective user ID to uid. The
       real user ID and saved set-user-ID remain unchanged.

    See also getuid to know how UIC is represented.

3  –  Return Values

    0                  Successful completion.
    -1                 Indicates an error. The function sets errno to
                       one of the following values:

                       o  EINVAL - The value of the uid argument
                          is invalid and not supported by the
                          implementation.

                       o  EPERM - The process does not have
                          appropriate privileges and uid does not
                          match the real user ID or the saved set-
                          user-ID.
Close Help