]> diplodocus.org Git - nmh/blob - docs/historical/mh-jun-1982/Extras/libg/getwho.c
Replaced use of snprintf() with memcpy()/memmove().
[nmh] / docs / historical / mh-jun-1982 / Extras / libg / getwho.c
1 #ifdef COMMENT
2 Proprietary Rand Corporation, 1981.
3 Further distribution of this software
4 subject to the terms of the Rand
5 license agreement.
6 #endif
7
8 #include "libg.h"
9 #include "../h/stat.h"
10 getwho(i)
11 {
12 register char *st;
13 struct inode i_buf;
14
15 st = ttyname(i);
16 if (st == NULSTR) return(-1);
17 stat(cat("/dev/",st),&i_buf);
18 return(i_buf.i_uid&0377);
19 }