Skip to content

Instantly share code, notes, and snippets.

@Zhangerr
Created July 17, 2013 17:10
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zhangerr/6022492 to your computer and use it in GitHub Desktop.
Save Zhangerr/6022492 to your computer and use it in GitHub Desktop.
Flags for the linux syscall open in /usr/include/bits/fcntl.h
#define O_ACCMODE 0003
#define O_RDONLY 00
#define O_WRONLY 01
#define O_RDWR 02
#define O_CREAT 0100 /* not fcntl */
#define O_EXCL 0200 /* not fcntl */
#define O_NOCTTY 0400 /* not fcntl */
#define O_TRUNC 01000 /* not fcntl */
#define O_APPEND 02000
#define O_NONBLOCK 04000
#define O_NDELAY O_NONBLOCK
#define O_SYNC 04010000
#define O_FSYNC O_SYNC
#define O_ASYNC 020000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment