About Red Hat Partner Programmes Training Support and Docs Products and Services
  downloadstorecart
red hat logo search    
redhat.comredhat network
Red Hat Documentation: man pages: man2: Linux Programmer's Manual (2)

Manpage of GETDOMAINNAME

GETDOMAINNAME

Section: Linux Programmer's Manual (2)
Updated: 22 July 2025
Index  

NAME

getdomainname, setdomainname - get/set 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, zero is returned. On error, -1 is returned, and errno is set appropriately.  

ERRORS

EINVAL
For getdomainname, name points to NULL or name is longer than len.
EPERM
For setdomainname, the caller was not the superuser.
EINVAL
For setdomainname, len was too long.
 

CONFORMING TO

POSIX does not specify these calls.  

BUGS

getdomainname is not compliant with other implementations, since 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  

SEE ALSO


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
CONFORMING TO
BUGS
NOTES
SEE ALSO

This document was created by using the manual pages.
Time: 11:56:05 GMT, March 24, 2025

 

 
 
© 2001 Red Hat, Inc. All rights reserved.       About Red Hat   :   Legal statement   :   Privacy statement   :   Y2K statement   :   Contact Red Hat