Change copyright notice from GPLv2+ to GPLv3+.
[gnulib.git] / lib / getdomainname.h
1 /* getdomainname - Return the NIS domain name.
2    Copyright (C) 2003 Free Software Foundation, Inc.
3
4    This program is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 3 of the License, or
7    (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
16
17 #ifndef _GETDOMAINNAME_H
18 #define _GETDOMAINNAME_H
19
20 #if HAVE_GETDOMAINNAME
21
22 /* Get getdomainname() declaration.  */
23 # include <unistd.h>
24
25 #else
26
27 # include <stddef.h>
28
29 /* Return the NIS domain name of the machine.
30    WARNING! The NIS domain name is unrelated to the fully qualified host name
31             of the machine.  It is also unrelated to email addresses.
32    WARNING! The NIS domain name is usually the empty string or "(none)" when
33             not using NIS.
34
35    Put up to LEN bytes of the NIS domain name into NAME.
36    Null terminate it if the name is shorter than LEN.
37    If the NIS domain name is longer than LEN, set errno = EINVAL and return -1.
38    Return 0 if successful, otherwise set errno and return -1.  */
39 extern int getdomainname(char *name, size_t len);
40
41 #endif /* HAVE_GETDOMAINNAME */
42
43 #endif /* _GETDOMAINNAME_H */