ioinit.f should be in the library
[unix-history] / usr / src / usr.bin / f77 / libU77 / hostnm_.c
CommitLineData
ad01bced
DW
1/*
2 * hostnm - return this machines hostname
3 * @(#)hostnm_.c 1.1
4 *
5 * synopsis:
6 * integer function hostnm (name)
7 * character(*) name
8 *
9 * where:
10 * name will receive the host name
11 * The returned value will be 0 if successful, an error number otherwise.
12 */
13
14extern int errno;
15
16long
17hostnm_ (name, len)
18char *name;
19long len;
20{
21 char buf[64];
22 register char *bp;
23 int blen = sizeof buf;
24
25 if (gethostname (buf, blen) == 0)
26 {
27 b_char (buf, name, len);
28 return (0L);
29 }
30 else
31 return((long)errno);
32}