| 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)
- get connected socket or stream peer's credentials
#include <ucred.h>intgetpeerucred(intfd,ucred_t **ucred);
Thegetpeerucred() function returns the credentials of the peer endpoint of aconnection-oriented socket (SOCK_STREAM) or streamfd at the time the endpoint wascreated or the connection was established. A process that initiates a connectionretrieves the credentials of its peer at the time the peer's endpointwas created. A process that listens for connections retrieves the credentials ofthe peer at the time the peer initiated the connection.
When successful,getpeerucred() stores the pointer to a freshly allocateducred_t inthe memory location pointed to by theucred argument if that memorylocation contains the null pointer. If the memory location is non-null, itwill reuse the existingucred_t.
Whenucred is no longer needed, a credential allocated bygetpeerucred() shouldbe freed withucred_free(3C).
It is possible that all fields of theucred_t are not availableto all peer endpoints and all callers.
Upon successful completion,getpeerucred() returns 0. Otherwise, it returns -1 anderrnois set to indicate the error.
Thegetpeerucred() function will fail if:
There is not enough memory available to allocate sufficient memory to hold the user credential. The application can try again later.
Thefd argument is not a valid file descriptor.
The pointer location pointed to by theucred_t ** argument points to an invalid, non-null address.
The socket is connected but the peer credentials are unknown.
The physical limits of the system are exceeded by the memory allocation needed to hold the user credential.
The socket or stream is not connected or the stream's peer is unknown.
This operation is not supported on this file descriptor.
Seeattributes(5) for descriptions of the following attributes:
|
door_ucred(3C),ucred_get(3C),attributes(5),connld(7M)
The system currently supports both sides of connection endpoints for localAF_UNIX,AF_INET, andAF_INET6 sockets,/dev/tcp,/dev/ticots, and/dev/ticotsord XTI/TLI connections, and pipe filedescriptors sent usingI_SENDFD as a result of the open of anamed pipe with the "connld" module pushed.
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |