getdomainname.3 (17780) | getdomainname.3 (20058) |
---|---|
1.\" Copyright (c) 1983, 1991 The Regents of the University of California. 2.\" All rights reserved. | 1.\" $NetBSD: getdomainname.3,v 1.2 1995/02/27 04:12:27 cgd Exp $ |
3.\" | 2.\" |
3.\" Copyright (c) 1983, 1991, 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" |
|
4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. --- 12 unchanged lines hidden (view full) --- 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" | 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. --- 12 unchanged lines hidden (view full) --- 26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32.\" SUCH DAMAGE. 33.\" |
32.\" from: @(#)getdomainname.2 6.7 (Berkeley) 3/10/91 33.\" $Id: getdomainname.3,v 1.2 1996/02/11 22:33:32 mpp Exp $ | 34.\" @(#)gethostname.3 8.1 (Berkeley) 6/4/93 |
34.\" | 35.\" |
35.Dd March 10, 1991 | 36.Dd May 6, 1994 |
36.Dt GETDOMAINNAME 3 37.Os BSD 4.2 38.Sh NAME 39.Nm getdomainname , 40.Nm setdomainname | 37.Dt GETDOMAINNAME 3 38.Os BSD 4.2 39.Sh NAME 40.Nm getdomainname , 41.Nm setdomainname |
41.Nd get/set name of current host | 42.Nd get/set domain name of current host |
42.Sh SYNOPSIS 43.Fd #include <unistd.h> 44.Ft int 45.Fn getdomainname "char *name" "int namelen" 46.Ft int 47.Fn setdomainname "const char *name" "int namelen" 48.Sh DESCRIPTION 49.Fn Getdomainname | 43.Sh SYNOPSIS 44.Fd #include <unistd.h> 45.Ft int 46.Fn getdomainname "char *name" "int namelen" 47.Ft int 48.Fn setdomainname "const char *name" "int namelen" 49.Sh DESCRIPTION 50.Fn Getdomainname |
50returns the standard host name for the current processor, as | 51returns the standard domain name for the current processor, as |
51previously set by 52.Fn setdomainname . 53The parameter 54.Fa namelen 55specifies the size of the 56.Fa name 57array. The returned name is null-terminated unless insufficient 58space is provided. 59.Pp 60.Fn Setdomainname | 52previously set by 53.Fn setdomainname . 54The parameter 55.Fa namelen 56specifies the size of the 57.Fa name 58array. The returned name is null-terminated unless insufficient 59space is provided. 60.Pp 61.Fn Setdomainname |
61sets the name of the host machine to be | 62sets the domain name of the host machine to be |
62.Fa name , 63which has length 64.Fa namelen . 65This call is restricted to the super-user and 66is normally used only when the system is bootstrapped. 67.Sh RETURN VALUES 68If the call succeeds a value of 0 is returned. If the call 69fails, a value of -1 is returned and an error code is --- 5 unchanged lines hidden (view full) --- 75.It Bq Er EFAULT 76The 77.Fa name 78or 79.Fa namelen 80parameter gave an 81invalid address. 82.It Bq Er EPERM | 63.Fa name , 64which has length 65.Fa namelen . 66This call is restricted to the super-user and 67is normally used only when the system is bootstrapped. 68.Sh RETURN VALUES 69If the call succeeds a value of 0 is returned. If the call 70fails, a value of -1 is returned and an error code is --- 5 unchanged lines hidden (view full) --- 76.It Bq Er EFAULT 77The 78.Fa name 79or 80.Fa namelen 81parameter gave an 82invalid address. 83.It Bq Er EPERM |
83The caller tried to set the domainname and was not the super-user. | 84The caller tried to set the hostname and was not the super-user. |
84.El 85.Sh SEE ALSO 86.Xr gethostid 3 , | 85.El 86.Sh SEE ALSO 87.Xr gethostid 3 , |
87.Xr sysctl 3 | 88.Xr sysctl 3 , 89.Xr gethostname 3 |
88.Sh BUGS 89Host names are limited to 90.Dv MAXHOSTNAMELEN 91(from 92.Ao Pa sys/param.h Ac ) 93characters, currently 256. 94.Sh HISTORY 95The | 90.Sh BUGS 91Host names are limited to 92.Dv MAXHOSTNAMELEN 93(from 94.Ao Pa sys/param.h Ac ) 95characters, currently 256. 96.Sh HISTORY 97The |
96.Fn getdomainname | 98.Nm |
97function call appeared in 98.Bx 4.2 . | 99function call appeared in 100.Bx 4.2 . |