Unix and Linux Discussions Tagged with fails |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
6 |
7,299 |
Shell Programming and Scripting |
|
|
|
7 |
18,100 |
Linux |
|
|
|
6 |
6,724 |
Cybersecurity |
|
|
|
3 |
2,354 |
Shell Programming and Scripting |
|
|
|
4 |
5,653 |
Shell Programming and Scripting |
|
|
|
1 |
2,119 |
UNIX for Advanced & Expert Users |
|
|
|
7 |
9,825 |
Solaris |
|
|
|
3 |
4,468 |
Programming |
|
|
|
6 |
3,583 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
9,738 |
Shell Programming and Scripting |
|
|
|
9 |
15,267 |
Shell Programming and Scripting |
|
|
|
1 |
12,837 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
3,042 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
2,032 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
11,540 |
UNIX for Dummies Questions & Answers |
sethostname(2) System Calls Manual sethostname(2)
NAME
sethostname - Sets the name of the current host
SYNOPSIS
int sethostname ( char *name, int name_len );
PARAMETERS
Points to an array of bytes where the host name is stored. Specifies the length of the array pointed to by the name parameter.
DESCRIPTION
The sethostname() function allows a calling process with root user authority to set the internal host name of a machine on a network.
System host names are limited to MAXHOSTNAMELEN as defined in the /usr/include/sys/param.h file.
The sethostid() function fails if the calling process does not have superuser privilege.
RETURN VALUES
Upon successful completion, the system returns a value of 0 (zero). If the sethostname() function fails, -1 is returned and errno is set
to indicate the error.
ERRORS
If the sethostname() function fails, errno may be set to one of the following values: The name parameter or the name_len parameter gives an
address that is not valid. The calling process does not have appropriate privilege.
RELATED INFORMATION
Functions: gethostid(2), sethostid(2), gethostname(2) delim off
sethostname(2)