#ifndef _SYS__DEFAULT_FCNTL_H_
#define _SYS__DEFAULT_FCNTL_H_
#include <sys/cdefs.h>
#include <sys/_types.h>
_BEGIN_STD_C
#ifndef _MODE_T_DECLARED
typedef __mode_t mode_t;
#define _MODE_T_DECLARED
#endif
#ifndef _OFF_T_DECLARED
typedef __off_t off_t;
#define _OFF_T_DECLARED
#endif
#ifndef _PID_T_DECLARED
typedef __pid_t pid_t;
#define _PID_T_DECLARED
#endif
#ifndef _OFF64_T_DECLARED
typedef __off64_t off64_t;
#define _OFF64_T_DECLARED
#endif
#define _FOPEN (-1)
#define _FREAD 0x0001
#define _FWRITE 0x0002
#define _FAPPEND 0x0400
#define _FMARK 0x0010
#define _FDEFER 0x0020
#define _FASYNC 0x0008
#define _FSHLOCK 0x0080
#define _FEXLOCK 0x0100
#define _FCREAT 0x0040
#define _FTRUNC 0x0200
#define _FEXCL 0x0800
#define _FNBIO 0x1000
#define _FSYNC 0x2000
#define _FNONBLOCK 0x4000
#define _FNDELAY _FNONBLOCK
#define _FNOCTTY 0x8000
#define _FNOINHERIT 0x40000
#define _FDIRECT 0x80000
#define _FNOFOLLOW 0x100000
#define _FDIRECTORY 0x200000
#define _FEXECSRCH 0x400000
#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
#define O_RDONLY 0
#define O_WRONLY 1
#define O_RDWR 2
#define O_APPEND _FAPPEND
#define O_CREAT _FCREAT
#define O_TRUNC _FTRUNC
#define O_EXCL _FEXCL
#define O_SYNC _FSYNC
#define O_NONBLOCK _FNONBLOCK
#define O_NOCTTY _FNOCTTY
#if __POSIX_VISIBLE >= 200809
#define O_CLOEXEC _FNOINHERIT
#define O_NOFOLLOW _FNOFOLLOW
#define O_DIRECTORY _FDIRECTORY
#define O_EXEC _FEXECSRCH
#define O_SEARCH _FEXECSRCH
#endif
#if __BSD_VISIBLE
#define O_DIRECT _FDIRECT
#endif
#define O_DSYNC _FSYNC
#define O_RSYNC _FSYNC
#if __MISC_VISIBLE
#define FAPPEND _FAPPEND
#define FSYNC _FSYNC
#define FASYNC _FASYNC
#define FNBIO _FNBIO
#define FNONBIO _FNONBLOCK
#define FNDELAY _FNDELAY
#define FREAD _FREAD
#define FWRITE _FWRITE
#define FMARK _FMARK
#define FDEFER _FDEFER
#define FSHLOCK _FSHLOCK
#define FEXLOCK _FEXLOCK
#define FOPEN _FOPEN
#define FCREAT _FCREAT
#define FTRUNC _FTRUNC
#define FEXCL _FEXCL
#define FNOCTTY _FNOCTTY
#endif
#if __BSD_VISIBLE
#define FNONBLOCK _FNONBLOCK
#endif
#define FD_CLOEXEC 1
#define F_DUPFD 0
#define F_GETFD 1
#define F_SETFD 2
#define F_GETFL 3
#define F_SETFL 4
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112
#define F_GETOWN 5
#define F_SETOWN 6
#endif
#define F_GETLK 7
#define F_SETLK 8
#define F_SETLKW 9
#if __MISC_VISIBLE
#define F_RGETLK 10
#define F_RSETLK 11
#define F_CNVT 12
#define F_RSETLKW 13
#endif
#if __POSIX_VISIBLE >= 200809
#define F_DUPFD_CLOEXEC 14
#endif
#define F_RDLCK 1
#define F_WRLCK 2
#define F_UNLCK 3
#if __MISC_VISIBLE
#define F_UNLKSYS 4
#endif
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809
#define AT_FDCWD -2
#define AT_EACCESS 0x0001
#define AT_SYMLINK_NOFOLLOW 0x0002
#define AT_SYMLINK_FOLLOW 0x0004
#define AT_REMOVEDIR 0x0008
#if __GNU_VISIBLE
#define AT_EMPTY_PATH 0x0010
#define _AT_NULL_PATHNAME_ALLOWED 0x4000
#endif
#endif
#if __BSD_VISIBLE
#define LOCK_SH 0x01
#define LOCK_EX 0x02
#define LOCK_NB 0x04
#define LOCK_UN 0x08
#endif
struct flock {
short l_type;
short l_whence;
long l_start;
long l_len;
short l_pid;
short l_xxx;
};
#if __MISC_VISIBLE
struct eflock {
short l_type;
short l_whence;
long l_start;
long l_len;
short l_pid;
short l_xxx;
long l_rpid;
long l_rsys;
};
#endif
extern int open(const char *, int, ...);
#if __ATFILE_VISIBLE
extern int openat(int, const char *, int, ...);
#endif
extern int creat(const char *, mode_t);
extern int fcntl(int, int, ...);
#if __BSD_VISIBLE
extern int flock(int, int);
#endif
#ifdef _LIBC
extern int open(const char *, int, ...);
extern int fcntl(int, int, ...);
#ifdef __LARGE64_FILES
extern int open64(const char *, int, ...);
#endif
#endif
_END_STD_C
#endif