/* * fcntl.h — open / creat for Sprinter ESTEX. * * POSIX-style flag bits. The low two bits select access mode (matches * POSIX numbering — RDONLY=0, WRONLY=1, RDWR=2 — and is translated to * the ESTEX OPEN $11 convention inside open()). * * The other flags map onto ESTEX calls like this: * O_CREAT + O_EXCL → $0B (CREATE_NEW, fails if exists) * O_CREAT + O_TRUNC → $0A (CREATE, truncates existing) * O_CREAT alone → try $11 (OPEN); on ENOENT fall back to $0A * no O_CREAT → $11 (OPEN, fails if missing) * O_APPEND → after open, $15 lseek(0, SEEK_END) */ #ifndef FCNTL_H #define FCNTL_H #define O_RDONLY 0 #define O_WRONLY 1 #define O_RDWR 2 #define O_CREAT 0x040 #define O_EXCL 0x080 #define O_TRUNC 0x200 #define O_APPEND 0x400 int open (const char *path, int flags); int creat(const char *path, int mode); /* mode arg ignored on Sprinter */ #endif