Page 760 getdomainname, setdomainnamegetdomainname, setdomainnameGets/sets domain name SYNOPSIS #include <unistd.h> int getdomainname(char *name, size_t len); int setdomainname(const char *name, size_t len); DESCRIPTION These functions are used to access or to change the domain name of the current processor. RETURN VALUE On success, 0 is returned. On error, _1 is returned and errno is set appropriately. ERRORS
CONFORMS TO POSIX does not specify these calls. BUGS getdomainname is not compliant with other implementations because they always return len bytes, even if name is longer. Linux, however, returns EINVAL in this case (as of DLL 4.4.1 libraries). NOTES Under Linux, getdomainname is implemented at the library level by calling uname(2). SEE ALSO gethostname(2), sethostname(2), uname(2) Linux 0.99.11, 22 July 1993 getdtablesizegetdtablesizeGets descriptor table size SYNOPSIS #include <unistd.h> int getdtablesize(void); DESCRIPTION getdtablesize returns the maximum number of files a process can have open. NOTES getdtablesize is implemented as a library function in DLL 4.4.1. This function returns OPEN_MAX (set to 256 in Linux 0.99.11) if OPEN_MAX was defined when the library was compiled. Otherwise, _1 is returned and errno is set to ENOSYS. Page 761 SEE ALSO close(2), dup(2), open(2) Linux 0.99.11, 22 July 1993 getgid, getegidgetgid, getegidGets group identity SYNOPSIS #include <unistd.h> gid_t getgid(void); gid_t getegid(void); DESCRIPTION getgid returns the real group ID of the current process. getegid returns the effective group ID of the current process. The real ID corresponds to the ID of the calling process. The effective ID corresponds to the set ID bit on the file being executed. ERRORS These functions are always successful. CONFORMS TO POSIX, BSD 4.3 SEE ALSO setregid(2), setgid(2) Linux 0.99.11, 23 July 1993 getgroups, setgroupsgetgroups, setgroupsGets/sets group access list SYNOPSIS #include <unistd.h> int getgroups(int size, gid_t list[]); #define_USE_BSD #include <grp.h> int setgroups(size_t size, const gid_t *list); DESCRIPTION
Page 762 RETURN VALUE
ERRORS
CONFORMS TO getgroups conforms to POSIX.1 (and is present in BSD 4.3). Since setgroups requires privilege, it is not covered under POSIX.1. BUGS The USE BSD flag probably shouldn't be required for setgroups. SEE ALSO initgroups(3) Linux 0.99.11, 23 July 1993 gethostid, sethostidgethostid, sethostidGets/sets the unique identifier of the current host SYNOPSIS #include <unistd.h> long int gethostid(void); int sethostid(long int hostid); DESCRIPTION Get or set a unique 32-bit identifier for the current machine. The 32-bit identifier is intended to be unique among all UNIX systems in existence. This normally resembles the Internet address for the local machine, as returned by gethostbyname(3), and thus usually never needs to be set. The sethostid call is restricted to the superuser. The hostid argument is stored in the file /etc/hostid. RETURNS VALUES gethostid returns the 32-bit identifier for the current host as set by sethostid(2). CONFORMS TO POSIX.1 does not define these functions, but ISO/IEC 9945-1:1990 mentions them in B.4.4.1. FILES /etc/hostid Page 763 SEE ALSO hostid(1), gethostbyname(3) Linux 0.99.13, 29 November 1993 gethostname, sethostnamegethostname, sethostnameGets/sets hostname SYNOPSIS #include <unistd.h> int gethostname(char *name, size_t len); int sethostname(const char *name, size_t len); DESCRIPTION These functions are used to access or to change the hostname of the current processor. RETURN VALUE On success, 0 is returned. On error, _1 is returned and errno is set appropriately. ERRORS
CONFORMS TO POSIX.1 does not define these functions, but ISO/IEC 9945-1:1990 mentions them in B.4.4.1. BUGS Some other implementations of gethostname successfully return len bytes even if name is longer. Linux/Alpha complies with this behavior. Linux/i386, however, returns EINVAL in this case (as of DLL 4.6.27 libraries). NOTES Under Linux/Alpha, gethostname is a system call. Under Linux/i386, gethostname is implemented at the library level by calling uname(2). SEE ALSO getdomainname(2), setdomainname(2), uname(2) Linux 1.3.6, 22 July 1995 getitimer, setitimergetitimer, setitimerGets/sets value of an interval timer SYNOPSIS #include <sys/time.h> int getitimer(int which, struct itimerval *value); int setitimer(int which,conststruct itimer-val *value, struct itimerval *ovalue); |