| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 3: Basic Library Functions Oracle Solaris 11 Information Library |
enable_extended_FILE_stdio(3C)
posix_spawnattr_getschedparam(3C)
posix_spawnattr_getschedpolicy(3C)
posix_spawnattr_getsigdefault(3C)
posix_spawnattr_getsigignore_np(3C)
posix_spawnattr_getsigmask(3C)
posix_spawnattr_setschedparam(3C)
posix_spawnattr_setschedpolicy(3C)
posix_spawnattr_setsigdefault(3C)
posix_spawnattr_setsigignore_np(3C)
posix_spawnattr_setsigmask(3C)
posix_spawn_file_actions_addclose(3C)
posix_spawn_file_actions_addclosefrom_np(3C)
posix_spawn_file_actions_adddup2(3C)
posix_spawn_file_actions_addopen(3C)
posix_spawn_file_actions_destroy(3C)
posix_spawn_file_actions_init(3C)
pthread_attr_getdetachstate(3C)
pthread_attr_getinheritsched(3C)
pthread_attr_getschedparam(3C)
pthread_attr_getschedpolicy(3C)
pthread_attr_setdetachstate(3C)
pthread_attr_setinheritsched(3C)
pthread_attr_setschedparam(3C)
pthread_attr_setschedpolicy(3C)
pthread_barrierattr_destroy(3C)
pthread_barrierattr_getpshared(3C)
pthread_barrierattr_setpshared(3C)
pthread_condattr_getpshared(3C)
pthread_condattr_setpshared(3C)
pthread_cond_reltimedwait_np(3C)
pthread_key_create_once_np(3C)
pthread_mutexattr_getprioceiling(3C)
pthread_mutexattr_getprotocol(3C)
pthread_mutexattr_getpshared(3C)
pthread_mutexattr_getrobust(3C)
pthread_mutexattr_setprioceiling(3C)
pthread_mutexattr_setprotocol(3C)
pthread_mutexattr_setpshared(3C)
pthread_mutexattr_setrobust(3C)
pthread_mutex_getprioceiling(3C)
pthread_mutex_reltimedlock_np(3C)
pthread_mutex_setprioceiling(3C)
pthread_rwlockattr_destroy(3C)
pthread_rwlockattr_getpshared(3C)
pthread_rwlockattr_setpshared(3C)
pthread_rwlock_reltimedrdlock_np(3C)
pthread_rwlock_reltimedwrlock_np(3C)
pthread_rwlock_timedrdlock(3C)
pthread_rwlock_timedwrlock(3C)
rctlblk_get_enforced_value(3C)
- user credential functions
#include <ucred.h>ucred_t *ucred_get(pid_tpid);
voiducred_free(ucred_t *uc);
uid_tucred_geteuid(const ucred_t *uc);
uid_tucred_getruid(const ucred_t *uc);
uid_tucred_getsuid(const ucred_t *uc);
gid_tucred_getegid(const ucred_t *uc);
gid_tucred_getrgid(const ucred_t *uc);
gid_tucred_getsgid(const ucred_t *uc);
intucred_getgroups(const ucred_t *uc,const gid_t **groups);
const priv_set_t *ucred_getprivset(const ucred_t *uc,priv_ptype_tset);
pid_tucred_getpid(const ucred_t *uc);
projid_tucred_getprojid(const ucred_t *uc);
zoneid_tucred_getzoneid(const ucred_t *uc);
uint_tucred_getpflags(const ucred_t *uc,uint_tflags);
m_label_t *ucred_getlabel(const ucred_t *uc);
size_tucred_size(void);
These functions return or act on a user credential,ucred_t. User credentialsare returned by various functions and describe the credentials of a process.Information about the process can then be obtained by calling the accessfunctions. Access functions can fail if the underlying mechanism did not return sufficientinformation.
Theucred_get() function returns the user credential of the specifiedpid orNULL if none can be obtained. Apid value ofP_MYID returnsinformation about the calling process. The return value is dynamically allocated and mustbe freed usingucred_free().
Theucred_geteuid(),ucred_getruid(),ucred_getsuid(),ucred_getegid(),ucred_getrgid(), anducred_getsgid() functions return the effectiveUID, real UID, saved UID, effective GID, real GID, saved GID, respectively, or-1 if the user credential does not contain sufficient information.
Theucred_getgroups() function stores a pointer to the group list in thegid_t * pointed to by the second argument and returns the number ofgroups in the list. It returns -1 if the information is notavailable. The returned group list is valid untilucred_free() is called onthe user credential given as argument.
Theucred_getpid() function returns the process ID of the process or -1if the process ID is not available. The process ID returned ina user credential is only guaranteed to be correct in a verylimited number of cases when returned bydoor_ucred(3C) anducred_get(). In allother cases, the process in question might have handed of the filedescriptor, the process might have exited or executed another program, or the processID might have been reused by a completely unrelated process after theoriginal program exited.
Theucred_getprojid() function returns the project ID of the process or -1if the project ID is not available.
Theucred_getzoneid() function returns the zone ID of the process or -1if the zone ID is not available.
Theucred_getprivset() function returns the specified privilege set specified as second argument,orNULL if either the requested information is not available or theprivilege set name is invalid. The returned privilege set is valid untilucred_free() is called on the specified user credential.
Theucred_getpflags() function returns the value of the specified privilege flags fromtheucred structure, or (uint_t)-1 if none was present.
Theucred_getlabel() function returns the value of the label, orNULL ifthe label is not available. The returned label is valid untilucred_free()is called on the specified user credential. This function is available only ifthe system is configured with Trusted Extensions.
Theucred_free() function frees the memory allocated for the specified user credential.
Theucred_size() function returnssizeof(ucred_t). This value is constant only until thenext boot, at which time it could change. Theucred_size() function canbe used to determine the size of the buffer needed to receive acredential option withSO_RECVUCRED. Seesocket.h(3HEAD).
See DESCRIPTION.
Theucred_get() function will fail if:
There is not enough memory available to allocate sufficient memory to hold a user credential. The application can try again later.
The caller does not have sufficient privileges to examine the target process.
The calling process cannot open any more files.
The physical limits of the system are exceeded by the memory allocation needed to hold a user credential.
The target process does not exist.
Theucred_getprivset() function will fail if:
The privilege set argument is invalid.
Theucred_getlabel() function will fail if:
The label is not present.
Theucred_geteuid(),ucred_getruid(),ucred_getsuid(),ucred_getegid(),ucred_getrgid(),ucred_getsgid(),ucred_getgroups(),ucred_getpflags(),ucred_getprivset(),ucred_getprojid(),ucred_getpid(),anducred_getlabel() functions will fail if:
The requested user credential attribute is not available in the specified user credential.
Seeattributes(5) for descriptions of the following attributes:
|
getpflags(2),getppriv(2),door_ucred(3C),getpeerucred(3C),priv_set(3C),socket.h(3HEAD),attributes(5),labels(5),privileges(5)
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |