open(2)
#include <fcntl.h>
int open(const char *pathname, int flags);
int open(const char *pathname, int flags, mode_t mode);
int creat(const char *pathname, mode_t mode);
int openat(int dirfd, const char *pathname, int flags);
int openat(int dirfd, const char *pathname, int flags, mode_t mode);
/* Documented separately, in openat2(2): */
int openat2(int dirfd, const char *pathname,
const struct open_how *how, size_t size);
Description
flags
- access modes
O_RDONLYO_WRONLYO_RDWR
- file creation flags, file status flags
O_CLOEXECenable close-on-exec flagO_CREATif pathname does not exist, create it as a regular fileO_DIRECTORYif pathname is not a directory, cause the open to failO_EXCLO_NOCTTYO_NOFOLLOWO_TMPFILEO_APPENDopen in append modeO_ASYNCenable signal-driven io
μμ£Ό μ°λ νλκ·Έ: μ¬λ¬ νλ‘μΈμ€λ€ κ°μ λ μ μ μΈ μ½κΈ°λ₯Ό 보μ₯ν΄μ£Όλ μ΅μ . μΌμ’ μ lock νμΌμ²λΌ μΈ μ μκ²λλ€.
O_CREAT | O_EXCL