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: 14: #include "../libI77/fiodefs.h" 15: 16: extern int errno; 17: 18: ftnint 19: hostnm_ (name, len) 20: char *name; 21: ftnlen len; 22: { 23: char buf[64]; 24: register char *bp; 25: int blen = sizeof buf; 26: 27: if (gethostname (buf, blen) == 0) 28: { 29: b_char (buf, name, len); 30: return ((ftnint) 0); 31: } 32: else 33: return((ftnint)errno); 34: }