| 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 network group entry
#include <netdb.h>intgetnetgrent(char **machinep,char **userp,char **domainp);
intgetnetgrent_r(char **machinep,char **userp,char **domainp,char *buffer,intbuflen);
intsetnetgrent(const char *netgroup);
intendnetgrent(void);
intinnetgr(const char *netgroup,const char *machine,const char *user,const char *domain);
These functions are used to test membership in and enumerate members of``netgroup'' network groups defined in a system database. Netgroups are setsof (machine,user,domain) triples (seenetgroup(4)).
These functions consult the source specified fornetgroup in the/etc/nsswitch.conf file(seensswitch.conf(4)).
The functioninnetgr() returns1 if there is a netgroupnetgroupthat contains the specifiedmachine,user,domain triple as a member; otherwise itreturns0. Any of the supplied pointersmachine,user, anddomainmay beNULL, signifying a "wild card" that matches all values inthat position of the triple.
Theinnetgr() function is safe for use in single-threaded and multithreaded applications.
The functionssetnetgrent(),getnetgrent(), andendnetgrent() are used to enumerate the membersof a given network group.
The functionsetnetgrent() establishes the network group specified in the parameternetgroupas the current group whose members are to be enumerated.
Successive calls to the functiongetnetgrent() will enumerate the members of thegroup established by callingsetnetgrent(); each call returns1 if itsucceeds in obtaining another member of the network group, or0if there are no further members of the group.
When calling eithergetnetgrent() orgetnetgrent_r(), addresses of the three character pointersare used as arguments, for example:
char*mp,*up,*dp;getnetgrent(&mp,&up,&dp);
Upon successful return fromgetnetgrent(), the pointermp points to astring containing the name of the machine part of the member triple,up points to a string containing the user name anddp points toa string containing the domain name. If the pointer returned formp,up, ordp isNULL, it signifies that the element of thenetgroup contains wild card specifier in that position of the triple.
The pointers returned bygetnetgrent() point into a buffer allocated bysetnetgrent()that is reused by each call. This space is released when anendnetgrent() call is made, and should not be released by the caller.This implementation is not safe for use in multi-threaded applications.
The functiongetnetgrent_r() is similar togetnetgrent() function, but it uses abuffer supplied by the caller for the space needed to store theresults. The parameterbuffer should be a pointer to abuffer allocated by the caller and the length of this buffer should bespecified by the parameterbuflen. The buffer must be large enough tohold the data associated with the triple. Thegetnetgrent_r() function is safefor use both in single-threaded and multi-threaded applications.
The functionendnetgrent() frees the space allocated by the previoussetnetgrent() call. The equivalent of anendnetgrent() implicitly performed whenever asetnetgrent()call is made to a new network group.
Note that whilesetnetgrent() andendnetgrent() are safe for use in multi-threadedapplications, the effect of each is process-wide. Callingsetnetgrent() resets theenumeration position for all threads. If multiple threads interleave calls togetnetgrent_r() eachwill enumerate a disjoint subset of the netgroup. Thus the effective useof these functions in multi-threaded applications may require coordination by the caller.
The functiongetnetgrent_r() will return0 and seterrno toERANGEif the length of the buffer supplied by caller is not largeenough to store the result. SeeIntro(2) for the proper usageand interpretation oferrno in multi-threaded applications.
The functionssetnetgrent() andendnetgrent() return0 upon success.
Seeattributes(5) for descriptions of the following attributes:
|
Intro(2),Intro(3),netgroup(4),nsswitch.conf(4),attributes(5)
The functiongetnetgrent_r() is included in this release on an uncommitted basisonly, and is subject to change or removal in future minor releases.
Only the Network Information Services, NIS and NIS+, are supported as sourcesfor thenetgroup database.
When compiling multi-threaded applications, seeIntro(3),Notes On Multithread Applications, for information about theuse of the_REENTRANT flag.
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |