4 ** This file contains emulation routines for some common Unix functions
6 ** Author: Peter Eriksson <pen@lysator.liu.se>
16 uid_t primos_uid
= 42;
17 gid_t primos_gid
= 42;
18 mode_t primos_mode
= 600;
20 /* Dummy do-nothing routine for chmod() */
51 return stat(path
, buf
);
61 buf
->st_uid
= primos_uid
;
62 buf
->st_gid
= primos_gid
;
64 buf
->st_blksize
= 2048;
66 buf
->st_rwlock
= frwlock(path
);
67 switch (buf
->st_type
= ftype(path
))
71 /* Regular file (SAM or DAM) */
72 buf
->st_size
= fsize(path
);
73 buf
->st_mtime
= fdtm(path
);
75 buf
->st_mode
= S_IFREG
|primos_mode
;
80 buf
->st_mtime
= fdtm(path
);
82 buf
->st_mode
= S_IFDIR
|primos_mode
;
89 buf
->st_mode
= primos_mode
;
90 buf
->st_size
= fsize(path
);
91 buf
->st_mtime
= fdtm(path
);
94 buf
->st_blocks
= (buf
->st_size
-1) / buf
->st_blksize
+ 1;
96 /* Should be fixed to really fetch these values, but that
97 * would require calling some PRIMOS subroutines and I don't have
98 * a copy of the Primos Subroutine reference manuals here..
100 buf
->st_atime
= buf
->st_mtime
;
101 buf
->st_ctime
= buf
->st_mtime
;
112 return stat(getname(fd
, path
), buf
);
118 return (c
? (c
| 0x80) : '\0');
122 #endif /* __50SERIES */