File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+
2+ #define ENOTDIR (-120)
3+ #define EACCES (-54)
4+ #define EEXIST (-48)
5+ #define EBUSY (-47)
6+ #define EROFS (-44)
7+ #define ENOENT (-43)
8+ #define ENFILE (-42)
9+ #define EIO (-36)
10+ #define ENOSPC (-34)
11+
12+ #define ESRCH 3
13+ #define EINTR 4
14+ #define EBADF 9
15+ #define ENODEV 19
16+ #define EINVAL 22
17+ #define EMFILE 24
18+
Original file line number Diff line number Diff line change 1+ /*
2+ ** Glue code for MetroWerks CodeWarrior, which misses
3+ ** unix-like routines for file-access.
4+ */
5+
6+ #ifdef __MWERKS__
7+ #include <Types.h>
8+ #include <Files.h>
9+ #include <Strings.h>
10+
11+ #include <stdio.h>
12+ #include <errno.h>
13+
14+ int
15+ fileno (fp )
16+ FILE * fp ;
17+ {
18+ if (fp == stdin ) return 0 ;
19+ else if (fp == stdout ) return 1 ;
20+ else if (fp == stderr ) return 2 ;
21+ else return 3 ;
22+ }
23+
24+ int
25+ isatty (fd )
26+ int fd ;
27+ {
28+ return (fd >= 0 && fd <= 2 );
29+ }
30+
31+ int
32+ unlink (old )
33+ char * old ;
34+ {
35+ OSErr err ;
36+
37+ if ((err = FSDelete (c2pstr (old ), 0 )) == noErr )
38+ return 0 ;
39+ errno = err ;
40+ return -1 ;
41+ }
42+
43+ #endif /* __MWERKS__ */
You can’t perform that action at this time.
0 commit comments