/* * fcntl() emulation for MiNT; written by Eric R. Smith and placed * in the public domain */ #include #include #include #include extern int __mint; /* MiNT version */ #ifdef __STDC__ int fcntl (int f, int cmd, ...) #else int fcntl (f, cmd) int f; int cmd; #endif { long r; va_list argp; va_start(argp, cmd); if (__mint) { r = Fcntl(f, va_arg(argp, void *), cmd); } else r = -EINVAL; if (r < 0) { errno = (int) -r; r = -1L; } return (int) r; }