getdomainname, setdomainname - get/set NIS domain name


   #include <unistd.h>

   int getdomainname(char *name, size_t len);
   int setdomainname(const char *name, size_t len);

   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):

   getdomainname(), setdomainname():
       Since glibc 2.21:
       In glibc 2.19 and 2.20:
       Up to and including glibc 2.19:
           _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)


   These  functions are used to access or to change the NIS domain name of
   the host system.

   setdomainname() sets  the  domain  name  to  the  value  given  in  the
   character  array  name.  The len argument specifies the number of bytes
   in name.  (Thus, name does not require a terminating null byte.)

   getdomainname()  returns  the  null-terminated  domain  name   in   the
   character  array  name,  which has a length of len bytes.  If the null-
   terminated domain name requires more than  len  bytes,  getdomainname()
   returns the first len bytes (glibc) or gives an error (libc).


   On  success,  zero is returned.  On error, -1 is returned, and errno is
   set appropriately.


   setdomainname() can fail with the following errors:

   EFAULT name pointed outside of user address space.

   EINVAL len was negative or too large.

   EPERM  The caller did not have the CAP_SYS_ADMIN capability in the user
          namespace associated with its UTS namespace (see namespaces(7)).

   getdomainname() can fail with the following errors:

   EINVAL For  getdomainname()  under libc: name is NULL or name is longer
          than len bytes.


   POSIX does not specify these calls.


   Since Linux 1.0, the limit on the length of a  domain  name,  including
   the  terminating  null  byte,  is 64 bytes.  In older kernels, it was 8

   On  most   Linux   architectures   (including   x86),   there   is   no
   getdomainname()  system call; instead, glibc implements getdomainname()
   as a library function that returns  a  copy  of  the  domainname  field
   returned from a call to uname(2).


   gethostname(2), sethostname(2), uname(2)


   This  page  is  part of release 4.09 of the Linux man-pages project.  A
   description of the project, information about reporting bugs,  and  the
   latest     version     of     this    page,    can    be    found    at

More Linux Commands

rjoe(1) - Joe's Own Editor (Commands - Linux manual page)...
JOE is a powerful ASCII-text screen editor. It has a mode-less user interface which is similar to many user-friendly PC editors. Users of Micro-Pros WordStar or

systemd-readahead-replay.service(8) Disk read ahead logic...
systemd-readahead-collect.service is a service that collects disk usage patterns at boot time. systemd-readahead-replay.service is a service that replays this a

read_configs(3) - netsnmp_config_api functions (Man Page)...
The functions are a fairly extensible system of parsing various configuration files at the run time of an application. The configuration file flow is broken int

glPixelMapfv(3gl) - set up pixel transfer maps (Man Page)...
glPixelMap sets up translation tables, or maps, used by glCopyPixels, glCopyTexImage1D, glCopyTexImage2D, glCopyTexSubImage1D, glCopyTexSubImage2D, glCopyTexSub

flocks(1) - floating wisps. (Commands - Linux man page).....
From Terry Walsh ( Heres a 3D variation on a favorite old theme. Try it out with Chromateks ChromaDepth glasses for a cool 3D effect. Po

re2c(1) - (unknown subject) (Commands - Linux man page).....
re2c is a preprocessor that generates C-based recognizers from regular expressions. The input to re2c consists of C/C++ source interleaved with comments of the

CPANPLUS::Internals(3pm) - (unknown subject) (Man Page).....
This module is the guts of CPANPLUS -- it inherits from all other modules in the CPANPLUS::Internals::* namespace, thus defying normal rules of OO programming -

field_term(3form) - set hooks for automatic invocation by ap
These functions make it possible to set hook functions to be called at various points in the automatic processing of input event codes by form_driver. The funct

Tcl_GetCommandInfoFromToken(3) - implement new commands in C
Tcl_CreateObjCommand defines a new command in interp and associates it with procedure proc such that whenever name is invoked as a Tcl command (e.g., via a call

XtAppPending(3) - query and process events and input........
If the X event queue is empty, XtAppNextEvent flushes the X output buffers of each Display in the application context and waits for an event while looking at th

sane-umax_pp(5) - SANE backend for Umax Astra parallel port
The sane-umax_pp library implements a SANE (Scanner Access Now Easy) backend that provides access to Umax parallel port flatbed scanners. The following scanners

fgetws(3) - read a wide-character string from a FILE stream
The fgetws() function is the wide-character equivalent of the fgets(3) function. It reads a string of at most n-1 wide characters into the wide-character array

We can't live, work or learn in freedom unless the software we use is free.