Home | History | Annotate | Download | only in lsb

Lines Matching defs:hostname

0 /* hostname.c - Get/Set the hostname
5 * http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/hostname.html
7 USE_HOSTNAME(NEWTOY(hostname, "bF:", TOYFLAG_BIN))
9 config HOSTNAME
10 bool "hostname"
13 usage: hostname [-b] [-F FILENAME] [newname]
15 Get/Set the current hostname
17 -b Set hostname to 'localhost' if otherwise unset
18 -F Set hostname to contents of FILENAME
30 char *hostname = *toys.optargs;
32 if (TT.fname && (hostname = xreadfile(TT.fname, 0, 0))) {
33 if (!*chomp(hostname)) {
34 if (CFG_TOYBOX_FREE) free(hostname);
36 hostname = 0;
40 if (!hostname && (toys.optflags&FLAG_b))
42 hostname = "localhost";
44 if (hostname) {
45 if (sethostname(hostname, strlen(hostname)))
46 perror_exit("set '%s'", hostname);