#ifndef _CINRS_FCNTL_H
#define _CINRS_FCNTL_H
#if defined(_WIN32)
#error "This <fcntl.h> is the POSIX one; the Microsoft C runtime's has _O_-prefixed flags and an _open with a different signature. Point `#pragma cinrs include_path` at the platform's own header instead."
#else
#include <sys/types.h>
#define O_RDONLY 0
#define O_WRONLY 1
#define O_RDWR 2
#define O_ACCMODE 3
#if defined(__APPLE__)
#define O_NONBLOCK 0x0004
#define O_APPEND 0x0008
#define O_CREAT 0x0200
#define O_TRUNC 0x0400
#define O_EXCL 0x0800
#define O_NOCTTY 0x20000
#define O_SYNC 0x0080
#define O_CLOEXEC 0x1000000
#define O_DIRECTORY 0x100000
#define O_NOFOLLOW 0x0100
#else
#define O_CREAT 0100
#define O_EXCL 0200
#define O_NOCTTY 0400
#define O_TRUNC 01000
#define O_APPEND 02000
#define O_NONBLOCK 04000
#define O_SYNC 04010000
#define O_DIRECTORY 0200000
#define O_NOFOLLOW 0400000
#define O_CLOEXEC 02000000
#endif
#define O_NDELAY O_NONBLOCK
int open(const char *path, int flags, ...);
int creat(const char *path, mode_t mode);
#endif
#endif