4 ** This file contains emulation routines for some common Unix functions
6 ** Author: Peter Eriksson <pen@lysator.liu.se>
17 uid_t primos_uid = 42;
18 gid_t primos_gid = 42;
19 mode_t primos_mode = 600;
21 /* Dummy do-nothing routine for chmod() */
52 return stat(path, buf);
62 buf->st_uid = primos_uid;
63 buf->st_gid = primos_gid;
65 buf->st_blksize = 2048;
67 buf->st_rwlock = frwlock(path);
68 switch (buf->st_type = ftype(path))
72 /* Regular file (SAM or DAM) */
73 buf->st_size = fsize(path);
74 buf->st_mtime = fdtm(path);
76 buf->st_mode = S_IFREG|primos_mode;
81 buf->st_mtime = fdtm(path);
83 buf->st_mode = S_IFDIR|primos_mode;
90 buf->st_mode = primos_mode;
91 buf->st_size = fsize(path);
92 buf->st_mtime = fdtm(path);
95 buf->st_blocks = (buf->st_size-1) / buf->st_blksize + 1;
97 /* Should be fixed to really fetch these values, but that
98 * would require calling some PRIMOS subroutines and I don't have
99 * a copy of the Primos Subroutine reference manuals here..
101 buf->st_atime = buf->st_mtime;
102 buf->st_ctime = buf->st_mtime;
113 return stat(getname(fd, path), buf);
119 return (c ? (c | 0x80) : '\0');
123 #endif /* __50SERIES */