open

OPEN(2)                    Linux Programmer's Manual                   OPEN(2)



åå
       open, creat - ãã¡ã¤ã«ãããã¤ã¹ã®ãªã¼ãã³ãä½æãè¡ã

æ¸å¼
       #include <sys/types.h>
       #include <sys/stat.h>
       #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);

説æ
       ãã¡ã¤ã«ã® pathname ãä¸ããã¨ã open()  ã¯ãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ãè¿ãã
       ãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ã¯ããã®å¾ã«ç¶ãã·ã¹ãã ã³ã¼ã« (read(2), write(2),
       lseek(2), fcntl(2) ãªã©)  ã§ä½¿ç¨ãããå°ããªéè² ã®æ´æ°ã§ããã
       ãã®ã·ã¹ãã ã³ã¼ã«ãæåããå ´åã«è¿ããããã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ã¯ ãã®ãã‐
       ã»ã¹ããã®æç¹ã§ãªã¼ãã³ãã¦ããªããã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ã® ãã¡æå°ã®æ°åã®ãã®ã¨ãªãã

       ããã©ã«ãã§ã¯ãæ°ãããã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ã¯ execve(2) ãå®è¡ããå¾ã
       ãªã¼ãã³ãããã¾ã¾ã¨ãªã (ã¤ã¾ãã fcntl(2) ã«èª¬æããã FD_CLOEXEC
       ãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ãã©ã°ã¯æåã¯ç¡å¹ã§ãã; å¾è¿°ã® O_CLOEXEC ãã©ã°
       ã使ãã¨ãã®ããã©ã«ããå¤æ´ãããã¨ãã§ãã)ã ãã¡ã¤ã«ãªãã»ãã (file offset)
       ã¯ãã¡ã¤ã«ã®åé ã«è¨å®ããã (lseek(2) åç§)ã

       open()  ãå¼ã³åºãã¨ãããªã¼ãã³ãã¡ã¤ã«è¨è¿°ã (open file description)
       ãä½æãããããã¡ã¤ã«è¨è¿°ã¨ã¯ãã·ã¹ãã å¨ä½ã® ãªã¼ãã³ä¸‐
       ã®ãã¡ã¤ã«ã®ãã¼ãã«ã®ã¨ã³ããªã§ããã
       ãã®ã¨ã³ããªã¯ããã¡ã¤ã«ãªãã»ããã¨ãã¡ã¤ã«ç¶æãã©ã° (fcntl(2)  F_SETFL
       æä½ã«ããå¤æ´å¯è½) ãä¿æããã
       ãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ã¯ãããã®ã¨ã³ããªã®ä¸ã¤ã¸ã®åç§ã§ããã ãã®å¾ã§ pathname
       ãåé¤ãããããä»ã®ãã¡ã¤ã«ãåç§ããããã«å¤æ´ãããããã¦ãã ãã®åç§ã¯å½±é¿ãåããªãã
       æ°ãããªã¼ãã³ãã¡ã¤ã«è¨è¿°ã¯æåã¯ä»ã®ã©ã®ããã»ã¹ã¨ã å±æããã¦ããªããã fork(2)
       ã§å±æãèµ·ããå ´åãããã

       å¼ãæ° flags ã«ã¯ãã¢ã¯ã»ã¹ã¢ã¼ã O_RDONLY, O_WRONLY, O_RDWR
       ã®ã©ããã²ã¨ã¤ãå¥ã£ã¦ããªããã°ãªããªãã ãããã¯ããããèª‐
       ã¿è¾¼ã¿å°ç¨ãæ¸ãè¾¼ã¿å°ç¨ãèªã¿æ¸ãç¨ã«
       ãã¡ã¤ã«ããªã¼ãã³ãããã¨ãè¦æ±ãããã®ã§ããã

       ããã«ã flags ã«ã¯ããã¡ã¤ã«ä½æãã©ã° (file creation flag) ã¨ãã¡ã¤ã«ç¶æãã©ã°
       (file status flag) ã 0 å以ä¸ããããåä½ã® OR (bitwise-or)ãã§
       æå®ãããã¨ãã§ããã ãã¡ã¤ã«ä½æãã©ã° 㯠O_CLOEXEC, O_CREAT, O_DIRECTORY,
       O_EXCL, O_NOCTTY, O_NOFOLLOW, O_TRUNC, O_TTY_INIT ã§ããã ãã¡ã¤ã«ç¶æãã©ã°
       ã¯ä»¥ä¸ã®ãªã¹ãã®ãã¡ä¸è¨ä»¥å¤ã®æ®ãã®ãã®ã§ããã
       äºç¨®é¡ã®ãã©ã°ã®éãã¯ããã¡ã¤ã«ç¶æãã©ã°ã®æ¹ã¯ fcntl(2)
       ã使ã£ã¦ãã®å容ãåå¾ããã (å ´åã«ãã£ã¦ã¯) å¤æ´ãããã§ããç¹ã«ããã
       ãã¡ã¤ã«ä½æãã©ã°ã¨ãã¡ã¤ã«ç¶æãã©ã°ã®å¨ãªã¹ãã以ä¸ã«ç¤ºã:

       O_APPEND
              ãã¡ã¤ã«ãè¿½å  (append) ã¢ã¼ãã§ãªã¼ãã³ããã æ¯åã® write(2)  ã®åã«
              lseek(2) ãè¡ã£ããã®ããã«ããã¡ã¤ã«ãã¤ã³ã¿ããã¡ã¤ã«ã®æå¾ã«ç§»åããã NFS
              ãã¡ã¤ã«ã·ã¹ãã ã§ã O_APPEND ã使ç¨ããã¨ãè¤æ°ã®ãã‐
              ã»ã¹ãã²ã¨ã¤ã®ãã¡ã¤ã«ã«åæã«ãã¼ã¿ã追å ããå ´åã
              ãã¡ã¤ã«ãå£ãã¦ãã¾ããã¨ãããã ãã㯠NFS ã追å ã¢ã¼ãããµãã¼ããã¦ããªãããã
              ã¯ã©ã¤ã¢ã³ãã®ã«ã¼ãã« (kernel) ããããã·ãã¥ã¬ã¼ãããªããã°ãªããªãã®ã ãã
              競åç¶æãé¿ãããã¨ã¯ã§ããªãããã§ããã

       O_ASYNC
              ã·ã°ãã«é§å I/O (signal-driven I/O) ãæå¹ã«ãã:
              ãã®ãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ã¸ã®
              å¥åã¾ãã¯åºåãå¯è½ã«ãªã£ãå ´åã«ãã·ã°ãã«ãçæãã (ããã©ã«ã㯠SIGIO
              ã§ãããã fcntl(2) ã«ãã£ã¦å¤æ´å¯è½ã§ãã)ã
              ãã®æ©è½ã使ç¨å¯è½ãªã®ã¯ç«¯æ«ãç似端æ«ãã½ã±ããã®ã¿ã§ããã (Linux
              2.6 以éã§ã¯) ãã¤ã㨠FIFO ã«å¯¾ãã¦ã使ç¨ã§ããã ããã«è©³ãã説æã¯
              fcntl(2)  ãåç§ãããã¨ã

       O_CLOEXEC (Linux 2.6.23 以é)
              æ°ãããã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ã«å¯¾ã㦠close-on-exec ãã©ã°ãæå¹ã«ããã
              ãã®ãã©ã°ãæå®ãããã¨ã§ãããã°ã©ã 㯠FD_CLOEXEC ãã©ã°ãã»ããããããã®
              fcntl(2)  F_SETFD æä½ãå¥éå¼ã³åºãå¿è¦ããªããªãã
              ã¾ãããã種ã®ãã«ãã¹ã¬ããã®ããã°ã©ã ã¯ãã®ãã©ã°ã®ä½¿ç¨ã¯
              ä¸å¯æ¬ ã§ããããªããªããåå¥ã« FD_CLOEXEC ãã©ã°ãè¨å®ãã fcntl(2)
              F_SETFD æä½ãå¼ã³åºããã¨ãã¦ããããã¹ã¬ããããã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ã
              ãªã¼ãã³ããã®ã¨åæã«å¥ã®ã¹ã¬ããã fork(2)  㨠execve(2)
              ãå®è¡ããã¨ãã競åæ¡ä»¶ãé¿ããã®ã«ã¯ååã§ã¯ãªãããã§ããã

       O_CREAT
              ãã¡ã¤ã«ãåå¨ããªãã£ãå ´åã¯ä½æ (create) ããã ãã¡ã¤ã«ã®ææè (ã¦ã¼ã¶ã¼
              ID) ã¯ãããã»ã¹ã®å®å¹ã¦ã¼ã¶ã¼ ID ã«è¨å®ãããã ã°ã«ã¼ãææ権 (ã°ã«ã¼ã
              ID) ã¯ãããã»ã¹ã®å®å¹ã°ã«ã¼ã ID ã¾ãã¯è¦ªãã£ã¬ã¯ããªã®ã°ã«ã¼ã ID
              ã«è¨å®ããã (ããã¯ããã¡ã¤ã«ã·ã¹ãã ã¿ã¤ãããã¦ã³ããªãã·ã§ã³ã
              親ãã£ã¬ã¯ããªã®ã¢ã¼ãã«ä¾åããã mount(8)
              ã§èª¬æããã¦ãããã¦ã³ããªãã·ã§ã³ bsdgroups 㨠sysvgroups ãåç§)ã

              mode ã¯æ°ãããã¡ã¤ã«ãä½æããå ´åã«ä½¿ç¨ããã¢ã¯ã»ã¹è¨±å¯ (permission)
              ãæå®ããã flags ã« O_CREAT ãæå®ããã¦ããå ´åã mode ãæå®ããªããã°ãªããªãã
              O_CREAT ãæå®ããã¦ããªãå ´åã mode ã¯ç¡è¦ãããã
              æå¹ãªã¢ã¯ã»ã¹è¨±å¯ã¯ãæ®æ®µã¨åãããã«ããã»ã¹ã® umask ã«ãã£ã¦ä¿®æ‐
              £ãããä½æããããã¡ã¤ã«ã®è¨±å¯ã¯ (mode & ~umask) ã¨ãªãã
              ãã®ã¢ã¼ãã¯ãæ°ããä½æããããã¡ã¤ã«ã«å¯¾ãããã以éã®ã¢ã¯ã»ã¹
              ã«ã®ã¿é©ç¨ãããç¹ã«æ³¨æãããã¨ã èªã¿åãå°ç¨ã®ãã¡ã¤ã«ãä½æãã open()
              ã³ã¼ã«ã§ãã£ã¦ãã èªã¿æ¸ãå¯è½ãªãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ãè¿ããã¨ãããããã

              mode ã®ããã«ä»¥ä¸ã®ã·ã³ãã«å®æ°ãæä¾ããã¦ãã :

              S_IRWXU  00700 ã¦ã¼ã¶ã¼ (ãã¡ã¤ã«ã®ææè) ã«èªã¿è¾¼ã¿ãæ¸ãè¾¼ã¿ã
                       å®è¡ã®è¨±å¯ãããã

              S_IRUSR  00400 ã¦ã¼ã¶ã¼ã«èªã¿è¾¼ã¿ã®è¨±å¯ãããã

              S_IWUSR  00200 ã¦ã¼ã¶ã¼ã«æ¸ãè¾¼ã¿ã®è¨±å¯ãããã

              S_IXUSR  00100 ã¦ã¼ã¶ã¼ã«å®è¡ã®è¨±å¯ãããã

              S_IRWXG  00070 ã°ã«ã¼ãã«èªã¿è¾¼ã¿ãæ¸ãè¾¼ã¿ãå®è¡ã®è¨±å¯ãããã

              S_IRGRP  00040 ã°ã«ã¼ãã«èªã¿è¾¼ã¿ã®è¨±å¯ãããã

              S_IWGRP  00020 ã°ã«ã¼ãã«æ¸ãè¾¼ã¿ã®è¨±å¯ãããã

              S_IXGRP  00010 ã°ã«ã¼ãã«å®è¡ã®è¨±å¯ãããã

              S_IRWXO  00007 ä»äºº (others) ã«èª‐
                       ã¿è¾¼ã¿ãæ¸ãè¾¼ã¿ãå®è¡ã®è¨±å¯ãããã

              S_IROTH  00004 ä»äººã«èªã¿è¾¼ã¿ã®è¨±å¯ãããã

              S_IWOTH  00002 ä»äººã«æ¸ãè¾¼ã¿ã®è¨±å¯ãããã

              S_IXOTH  00001 ä»äººã«å®è¡ã®è¨±å¯ãããã

       O_DIRECT (Linux 2.4.10 以é)
              ãã®ãã¡ã¤ã«ã«å¯¾ãã I/O ã®ã‐
              ã£ãã·ã¥ã®å¹æãæå°åãããã¨ããããã®ãã©ã°ã使ãã¨ãä¸è¬çã«æ§è½ãä½ä¸ããã
              ãããã¢ããªã±ã¼ã·ã§ã³ãç¬èªã«ãã£ãã·ã³ã°ãè¡ã£ã¦ãããããª
              ç¹å¥ãªå ´åã«ã¯å½¹ã«ç«ã¤ã ãã¡ã¤ã«ã® I/O
              ã¯ã¦ã¼ã¶ã¼ç©ºéãããã¡ã«å¯¾ãã¦ç´æ¥è¡ãããã O_DIRECT
              ãã©ã°èªèº«ã¯ãã¼ã¿ãåæã§è»¢éãããã¨ã¯ãããã O_SYNC
              ãã©ã°ã®ããã«ãã¼ã¿ã¨å¿è¦ãªã¡ã¿ãã¼ã¿ã®è»¢éãä¿è¨¼ãããããã§ã¯ãªããåæ I/O
              ãä¿è¨¼ããããã«ã¯ã O_DIRECT ã«å ã㦠O_SYNC
              ã使ç¨ããªããã°ãªããªããä¸è¨ã®ã注æãã®ç¯ã®è°è«ãåç§ã

              ãããã¯ããã¤ã¹ã«å¯¾ããä¼¼éã£ãæå³ã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ã raw(8)
              ã§èª¬æããã¦ãã (ä½ãããã®ã¤ã³ã¿ãã§ã¼ã¹ã¯éæ¨å¥¨ã§ãã)ã

       O_DIRECTORY
              pathname ããã£ã¬ã¯ããªã§ãªããã°ãªã¼ãã³ã¯å¤±æããã ãã®ãã©ã°ã¯ Linux
              ç¹æã§ããã opendir(3)  ã FIFO ããã¼ãããã¤ã¹ã«å¯¾ãã¦ã³ã¼ã«ãããå ´åã®
              ãµã¼ãã¹ä¸è½ (denial-of-service) æ»æãé¿ããããã« ã«ã¼ãã« 2.1.126
              ã§è¿½å ãããã ããããã㯠opendir(3)
              ã®å®è£ä»¥å¤ã§ã¯ä½¿ç¨ããã¹ãã§ã¯ãªãã

       O_EXCL ãã®å¼ã³åºãã§ãã¡ã¤ã«ãä½æããããã¨ãä¿è¨¼ããããã®ãã©ã°ã O_CREAT ã¨
              ä¸ç·ã«æå®ããã pathname ã®ãã¡ã¤ã«ãæ¢ã«åå¨ããå ´åã open() ã¯å¤±æ ããã

              ãããäºã¤ã®ãã©ã°ãæå®ãããéãã·ã³ããªãã¯ãªã³ã¯ã¯è¾¿ãããªãã pathname
              ãã·ã³ããªãã¯ãªã³ã¯ã®å ´åã ã·ã³ããªãã¯ãªã³ã¯ãã©ããæãã¦ãããã«é¢ããã
              open()  ã¯å¤±æããã

              ä¸è¬çã«ã¯ã O_CREAT ãæå®ããã« O_EXCL ã使ç¨ããå ´åã® O_EXCL
              ã®åä½ã¯è¦å®ããã¦ããªãã ããã«ã¯ä¸ã¤ä¾å¤ããããLinux 2.6 以éã§ã¯ã
              pathname ããããã¯ããã¤ã¹ãåç§ãã¦ããå ´åã O_CREAT ãªã㧠O_EXCL
              ã使ç¨ãããã¨ãã§ããã ã·ã¹ãã ããã®ãããã¯ããã¤ã¹ã使ç¨ä¸ã®å ´å (ä¾ãã°ã
              ãã¦ã³ãããã¦ãããªã©)ã open() ã¯ã¨ã©ã¼ EBUSY ã§å¤±æããã

              NFS ã§ã¯ã O_EXCL ã¯ãLinux 2.6 以é㧠NFSv3
              以éã使ã£ã¦ããå ´åã§ã®ã¿ãµãã¼ããããã O_EXCL ãµãã¼ããæä¾ããã¦ããªã NFS
              ç°å¢ã§ã¯ããã®ãã©ã°ã«é ¼ã£ã¦ ããã¯å¦çãå®è¡ããããã°ã©ã ã¯ç«¶åç¶æ (race
              condition) ã«åºä¼ã å¯è½æ§ãããã ããã¯ãã¡ã¤ã«ã使ç¨ãã¦ä¸å¯å (atomic)
              ãªãã¡ã¤ã«ããã¯ãå®ç¾ãã NFS ã O_EXCL ããµãã¼ããã¦ãããã«ä¾å‐
              ããªãããã«ãããå ´åã
              移æ¤æ§ã®ããæ¹æ³ã¯ãåããã¡ã¤ã«ã·ã¹ãã ä¸ã«ä»ã¨ååã®éãªããªã ãã¡ã¤ã«
              (ä¾ãã°ãã¹ãå㨠PID ãçµã¿åãããåå) ãä½æãã link(2)  ã使ç¨ãã¦ãã®ã‐
              ãã¯ãã¡ã¤ã«ã¸ã®ãªã³ã¯ãä½æãããã¨ã§ããã link(2) ã³ã¼ã«ã®è¿ãå¤ã 0
              ãªãã°ããã¯ã«æåãã¦ããã ãããã¯ããã®ãã¡ã¤ã«ã« stat(2)
              ã使ç¨ãã¦ãªã³ã¯æ° (link count) ã 2 ã«ãªã£ã¦ãããããã§ãã¯ããã
              ãããªã£ã¦ããã°ãåããããã¯ã«æåãã¦ããã¨ãããã¨ã§ããã

       O_LARGEFILE
              (LFS) off_t ã§ã¯ãµã¤ãºã表ããªã (ã ã ã off64_t
              ã§ã¯ãµã¤ãºã表ãã)ãã¡
              ã¤ã«ããªã¼ãã³å¯è½ã«ããããã®å®ç¾©ãæå¹ã«ããããã«ã¯ã(ã©ã®ããããã¡ã¤
              ã«ãã¤ã³ã¯ã«ã¼ããããããåã«) _LARGEFILE64_SOURCE ãã¯ããå®ç¾©ããªããã°
              ãªããªãã 32 ãããã·ã¹ãã ã«ããã¦å¤§ããªãã¡ã¤ã«ã«ã¢ã¯ã»ã¹ãããå ´åã
              (O_LARGEFILE ã使ãããã) _FILE_OFFSET_BITS æ©è½æ¤æ»ãã¯ãã 64 ã«
              ã»ããããæ¹ãæã¾ããæ¹æ³ã§ãã (feature_test_macros(7) ãåç§)ã

       O_NOATIME (Linux 2.6.8 以é)
              ãã¡ã¤ã«ã«å¯¾ã㦠read(2)  ãå®è¡ãããã¨ãã«ãæçµã¢ã¯ã»ã¹æå» (inode ã®
              st_atime) ãæ´æ°ããªãã ãã®ãã©ã°ã¯ã¤ã³ããã¯ã¹ä½æãããã¯ã¢ãããã‐
              ã°ã©ã ã§ä½¿ããã¨ãæå³ãã¦ããã
              ããã使ãã¨ãã£ã¹ã¯ã«å¯¾ããæä½ã大å¹ã«æ¸ãããã¨ãã§ããã
              ãã®ãã©ã°ã¯å¨ã¦ã®ãã¡ã¤ã«ã·ã¹ãã ã«å¯¾ãã¦æå¹ã§ããããã§ã¯ãªãã ãã®ä¸ä¾ã
              NFS ã§ããããµã¼ããã¢ã¯ã»ã¹æå»ã管çãã¦ããã

       O_NOCTTY
              pathname ãç«¯æ« (terminal) ããã¤ã¹ — tty(4) åç§ — ãæãã¦ãã
              å ´åã«ããã¨ããã®ããã»ã¹ãå¶å¾¡ç«¯æ«ãæã£ã¦ããªãã¦ãããªã¼ãã³ãããã¡ã¤ã«
              ã¯å¶å¾¡ç«¯æ«ã«ã¯ãªããªãã

       O_NOFOLLOW
              pathname ãã·ã³ããªãã¯ãªã³ã¯ã ã£ãå ´åããªã¼ãã³ã¯å¤±æããã ããã¯
              FreeBSD ã®æ¡å¼µã§ãLinux ã«ã¯ 2.1.126 ãã追å ãããã pathname
              ã®åã®ã³ã³ãã¼ãã³ã (earlier component; 訳註:
              æå¾ã®ãã£ã¬ã¯ããªã»ãã¬ã¼ã¿ããåã®é¨å) ã
              ã·ã³ããªãã¯ãªã³ã¯ã§ããå ´åã«ã¯ããããæãåãåç§ãããã

       O_NONBLOCK ã¾ã㯠O_NDELAY
              å¯è½ãªãã°ããã¡ã¤ã«ã¯éåæ¢ (nonblocking) ã¢ã¼ãã§ãªã¼ãã³ãããã open()
              ããè¿ãããã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ã«å¯¾ãã以å¾ã®ãã¹ã¦ã®æä½ãå¼ã³åº ãããã‐
              ã»ã¹ãå¾ããããã¨ã¯ãªãã FIFO (ååä»ããã¤ã) ãæ±ãå ´åã«ã¯ fifo(7)
              ãåç§ãããã¨ã å¼·å¶ãã¡ã¤ã«ãã㯠(mandatory file lock) ããã¡ã¤
              ã«ãªã¼ã¹ (file lease) ã¨çµã¿åãããå ´åã®ã O_NONBLOCK
              ã®å¹æã«ã¤ãã¦ã® è°è«ã¯ã fcntl(2) ãåç§ãããã¨ã

       O_SYNC ãã¡ã¤ã«ã¯åæ (synchronous) I/O ã¢ã¼ãã§ãªã¼ãã³ãããã open()
              ãè¿ãããã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ã«å¯¾ã㦠write(2)  ãè¡ãã¨ãå¿ãå¼ã³åºãããã‐
              ã»ã¹ããããã¯ãã 該å½ãã¼ãã¦ã§ã¢ã«ç©ççã«æ¸ãè¾¼ã¾ããã¾ã§è¿ããªãã
              以ä¸ã®ã注æãã®ç« ãåç§ã

       O_TRUNC
              ãã¡ã¤ã«ãæ¢ã«åå¨ããé常ãã¡ã¤ã«ã§ããã æ¸ãè¾¼ã¿å¯ã¢ã¼ãã§ãªã¼ãã³ããã¦ãã
              (ã¤ã¾ãã O_RDWRã¾ãã¯O_WRONLY ã®) å ´åãé·ã 0 ã«åãè©°ã (truncate)
              ãããã ãã¡ã¤ã«ã FIFO ã¾ãã¯ç«¯æ«ããã¤ã¹ãã¡ã¤ã«ã®å ´åã O_TRUNC
              ãã©ã°ã¯ç¡è¦ãããã ãã以å¤ã®å ´åã O_TRUNC ã®å¹æã¯æªå®ç¾©ã§ããã

       ãããã®é¸æãã©ã°ã®ããã¤ãã¯ãã¡ã¤ã«ããªã¼ãã³ããå¾ã§ã fcntl(2)
       ã使ç¨ãã¦å¤æ´ãããã¨ãã§ããã

       creat()  㯠flags ã« O_CREAT|O_WRONLY|O_TRUNC ãæå®ã㦠open() ãè¡ãã®ã¨ç‐
       価ã§ããã

è¿ãå¤
       open()  㨠creat()  ã¯æ°ãããã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ãè¿ãã ã¨ã©ã¼ãçºçããå ´åã¯
       -1 ãè¿ã (ãã®å ´å㯠errno ãé©åã«è¨å®ããã)ã

ã¨ã©ã¼
       EACCES ãã¡ã¤ã«ã«å¯¾ããè¦æ±ãããã¢ã¯ã»ã¹ã許ããã¦ããªããã pathname
              ã®ãã£ã¬ã¯ããªé¨åã®ä½ããã®ãã£ã¬ã¯ããªã«æ¤ç´¢è¨±å¯ããªãã£ãã
              ã¾ãã¯ãã¡ã¤ã«ãåå¨ããã親ãã£ã¬ã¯ããªã¸ã®æ¸ãè¾¼ã¿è¨±å¯ããªãã£ãã
              (path_resolution(7)  ãåç§ãããã¨ã)

       EDQUOT Where O_CREAT is specified, the file does not exist, and the
              user's quota of disk blocks or inodes on the file system has
              been exhausted.

       EEXIST pathname ã¯æ¢ã«åå¨ãã O_CREAT 㨠O_EXCL ã使ç¨ãããã

       EFAULT pathname ãã¢ã¯ã»ã¹å¯è½ãªã¢ãã¬ã¹ç©ºéã®å¤ãæãã¦ããã

       EFBIG  EOVERFLOW åç§ã

       EINTR  éãããã¤ã¹ (ä¾ãã° FIFOã fifo(7)  åç§) ã®ãªã¼ãã³ãå®äºããã®ãå¾ã£ã¦åæ‐
              ¢ãã¦ããéã« ã·ã¹ãã ã³ã¼ã«ãã·ã°ãã«ãã³ãã©ã«ããå²ãè¾¼ã¾ããã signal(7)
              åç§ã

       EISDIR pathname ã¯ãã£ã¬ã¯ããªãåç§ãã¦ãããæ¸ãè¾¼ã¿è¦æ±ãå«ã¾ãã¦ãã (ã¤ã¾ã
              O_WRONLY ã¾ã㯠O_RDWR ãè¨å®ããã¦ãã)ã

       ELOOP  pathname ã解決ããéã«ééããã·ã³ããªãã¯ãªã³ã¯ãå¤éããã ã¾ãã¯
              O_NOFOLLOW ãæå®ããã¦ããã pathname ãã·ã³ããªãã¯ãªã³ã¯ã ã£ãã

       EMFILE ããã»ã¹ããªã¼ãã³ãã¦ãããã¡ã¤ã«æ°ããã§ã«æ大æ°ã«éãã¦ããã

       ENAMETOOLONG
              pathname ãé·éããã

       ENFILE ãªã¼ãã³ããã¦ãããã¡ã¤ã«ã®ç·æ°ãã·ã¹ãã ã®å¶éã«éãã¦ããã

       ENODEV pathname ãããã¤ã¹ã¹ãã·ã£ã«ãã¡ã¤ã«ãåç§ãã¦ããã対å¿ããããã¤ã¹ãåå¨ããªãã
              (ãã㯠Linux ã«ã¼ãã«ã®ãã°ã§ããããã®å ´åã«ã¯ ENXIO ãè¿ãããã¹ãã§ãã)

       ENOENT O_CREAT ãè¨å®ããã¦ãããããã¤æå®ããããã¡ã¤ã«ãåå¨ããªãã ã¾ãã¯ã pathname
              ã®ãã£ã¬ã¯ããªé¨åãåå¨ããªããå£ãã (dangling) ã·ã³ããªãã¯ãªã³ã¯ã§ããã

       ENOMEM ååãªã«ã¼ãã«ã¡ã¢ãªã¼ããªãã

       ENOSPC pathname ãä½æããå¿è¦ããããã pathname
              ãå«ãã§ããããã¤ã¹ã«æ°ãããã¡ã¤ã«ã®ããã®ç©ºã容éããªãã

       ENOTDIR
              pathname ã«å«ã¾ãããã£ã¬ã¯ããªé¨åã®ã©ãããå®éã«ã¯ãã£ã¬ã¯ããªã§ãªãã
              ã¾ã㯠O_DIRECTORY ãæå®ããã¦ããã pathname ããã£ã¬ã¯ããªã§ãªãã

       ENXIO  O_NONBLOCK | O_WRONLY ãè¨å®ããã¦ãããæå®ãããã¡ã¤ã«ã FIFO ã§
              ãã®ãã¡ã¤ã«ãèªã¿è¾¼ã¿ã®ããã«ãªã¼ãã³ãã¦ããããã»ã¹ãåå¨ããªãã
              ã¾ãã¯ããã¡ã¤ã«ãããã¤ã¹ã¹ãã·ã£ã«ãã¡ã¤ã«ã§ 対å¿ããããã¤ã¹ãåå¨ããªãã

       EOVERFLOW
              pathname ãåç§ãã¦ããã®ãã大ãéãã¦ãªã¼ãã³ã§ããªãé常ã®ãã¡ã¤ã«ã§ããã
              é常ããã®ã¨ã©ã¼ãçºçããã¯ã32 ããããã©ãããã©ã¼ã ä¸ã§
              -D_FILE_OFFSET_BITS=64
              ãæå®ããã«ã³ã³ãã¤ã«ãããã¢ããªã±ã¼ã·ã§ã³ãããã¡ã¤ã«ãµã¤ãºã (2<31)-1
              ããããè¶ãããã¡ã¤ã«ãéããã¨ããå ´åã§ããã ä¸è¨ã® O_LARGEFILE ãåç§ã ããã¯
              POSIX.1-2001 ã§è¦å®ããã¦ããã¨ã©ã¼ã§ããã 2.6.24
              ããåã®ã«ã¼ãã«ã§ã¯ãLinux ã¯ãã®å ´åã«ã¨ã©ã¼ EFBIG ãè¿ãã¦ããã

       EPERM  O_NOATIME ãã©ã°ãæå®ãããããå¼ã³åºãåã®å®å¹ã¦ã¼ã¶ã¼ ID ã
              ãã¡ã¤ã«ã®ææèã¨ä¸è´ããããã¤å¼ã³åºãåã«ç¹æ¨© (CAP_FOWNER)  ããªãã

       EROFS  pathname ãèªã¿è¾¼ã¿å°ç¨ã®ãã¡ã¤ã«ã·ã¹ãã ä¸ã®ãã¡ã¤ã«ãåç§ãã¦ããã
              æ¸ãè¾¼ã¿ã¢ã¯ã»ã¹ãè¦æ±ãããã

       ETXTBSY
              pathname ãç¾å¨å®è¡ä¸ã®å®è¡ã¤ã¡ã¼ã¸ãåç§ãã¦ãããæ¸ãè¾¼ã¿ãè¦æ±ãããã

       EWOULDBLOCK
              O_NONBLOCK ãã©ã°ãæå®ããããããã®ãã¡ã¤ã«ã«ã¯çç¾ãããªã¼ã¹ãè¨å®ããã¦ãã
              (fcntl(2)  åç§)ã

æºæ
       SVr4, 4.3BSD, POSIX.1-2001.  ãã©ã° O_DIRECTORY, O_NOATIME, O_NOFOLLOW
       㯠Linux ç¹æã®ãã®ã§ããã ãããã®ãã©ã°ã®å®ç¾©ãå¾ãããã«ã¯ã
       (ãã©ã®ãããããã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ããããããåã«) _GNU_SOURCE
       ãå®ç¾©ããå¿è¦ããããããããªãã

       O_CLOEXEC ãã©ã°ã¯ POSIX.1-2001 ã§ã¯è¦å®ããã¦ããªããã POSIX.1-2008
       ã§è¦å®ããã¦ããã

       O_DIRECT 㯠POSIX ã§ã¯è¦å®ããã¦ããªãã O_DIRECT ã®å®ç¾©ãå¾ãã«ã¯
       (ãã©ã®ãããããã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ããããããåã«)  _GNU_SOURCE
       ãå®ç¾©ããªããã°ãªããªãã

注æ
       Linux ã§ã¯ã O_NONBLOCK ãã©ã°ã¯ã open ãå®è¡ãããã read ã¾ã㯠write
       ãå®è¡ããæå³ã¯ å¿ããããªããã¨ãæå³ããã ãã㯠ioctl(2)
       ã®ããã®ãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ãåå¾ããããã«ã ããã¤ã¹ããªã¼ãã³ããã¨ãã«ããç¨ããããã

       ãã¢ã¯ã»ã¹ã¢ã¼ããã®å¤ O_RDONLY, O_WRONLY, O_RDWR ã¯ã flags
       ã«æå®ã§ããä»ã®å¤ã¨éããåãã®ããããæå®ãããã®ã§ã¯ãªãã ãããã®å¤ã¯ flags ã®ä¸ä½ 2
       ããããå®ç¾©ããã O_RDONLY, O_WRONLY, O_RDWR ã¯ãããã 0, 1, 2 ã«å®ç¾©ããã¦ããã
       è¨ãæããã¨ã O_RDONLY | O_WRONLY ã®çµã¿åããã¯è«ççã«ééãã§ããã確ãã« O_RDWR
       ã¨åãæå³ã§ã¯ãªãã Linux ã§ã¯ãç¹å¥ãªãéæ¨æºãªã¢ã¯ã»ã¹ã¢ã¼ãã¨ã㦠3
       (ãã¤ããªã§ã¯ 11) ã äºç´ããã¦ãã flags ã«æå®ã§ããã
       ãã®ã¢ã¯ã»ã¹ã¢ã¼ããæå®ããã¨ããã¡ã¤ã«ã®èªã¿åºã/æ¸ãè¾¼ã¿è¨±å¯ããã§ãã¯ãã èª‐
       ã¿åºãã«ãæ¸ãè¾¼ã¿ã«ã使ç¨ã§ããªããã£ã¹ã¯ãªãã¿ãè¿ãã
       ãã®éæ¨æºã®ã¢ã¯ã»ã¹ã¢ã¼ãã¯ããã¤ãã® Linux ãã©ã¤ãã§ãããã¤ã¹åºæã® ioctl(2)
       æä½ã«ã®ã¿ä½¿ç¨ããããã£ã¹ã¯ãªãã¿ãè¿ãããã«ä½¿ããã¦ããã

       O_RDONLY | O_TRUNC ã®å½±é¿ã¯æªå®ç¾©ã§ããããã®åä½ã¯å®è£ã«ãã£ã¦ç°ãªãã
       å¤ãã®ã·ã¹ãã ã§ã¯ãã¡ã¤ã«ã¯å®éã«åãè©°ããããã

       NFS ãå®ç¾ãã¦ãããããã³ã«ã«ã¯å¤ãã®ä¸åããããç¹ã« O_SYNC 㨠O_NDELAY ã«å½±é¿ããã

       POSIX ã§ã¯ã3 種é¡ã®åæ I/O ãæä¾ããã¦ããã O_SYNC, O_DSYNC, O_RSYNC
       ãã©ã°ãããã«å¯¾å¿ãããã®ã§ããã ä»ã®ã¨ãã (ã«ã¼ãã« 2.6.31)ã Linux ã§ã¯ O_SYNC
       ã ããå®è£ããã¦ãããã glibc 㯠O_DSYNC 㨠O_RSYNC ã« O_SYNC
       ã¨åãæ°å¤ãå²ãå½ã¦ã¦ããã ã»ã¨ãã©ã® Linux ã®ãã¡ã¤ã«ã·ã¹ãã ã¯ãå®éã«ã¯ POSIX
       ã® O_SYNC ã®åä½ã§ã¯ãªã O_DSYNC ã®åä½ã ããå®è£ãã¦ããã POSIX ã® O_SYNC
       ã§ã¯ã open()  ãã¦ã¼ã¶ç©ºéã«è¿ãéã«ãæ¸ãè¾¼ã¿ã«é¢ããå¨ã¦ã®ã¡ã¿ãã¼ã¿ã®
       æ´æ°ããã£ã¹ã¯ã«æ¸ãè¾¼ã¾ãã¦ããå¿è¦ãããã ä¸æ¹ã O_DSYNC ã§ã¯ã open()
       ãè¿ãã¾ã§ã«ãå®éã®ãã¡ã¤ã«ã®ãã¼ã¿ã¨ãã®ãã¼ã¿ãåå¾ããããã«
       å¿è¦ãªã¡ã¿ãã¼ã¿ã ãããã£ã¹ã¯ã«æ¸ãè¾¼ã¾ãã¦ããã°ããã

       open()  ã¯ã¹ãã·ã£ã«ãã¡ã¤ã«ããªã¼ãã³ãããã¨ãã§ãããã creat()
       ã§ã¹ãã·ã£ã«ãã¡ã¤ã«ãä½æã§ããªãç¹ã«æ³¨æãããã¨ã 代ããã« mknod(2)  ã使ç¨ããã

       UID ãããã³ã°ã使ç¨ãã¦ãã NFS ãã¡ã¤ã«ã·ã¹ãã ã§ã¯ã open()
       ããã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ãè¿ããå ´åã§ã read(2) ã EACCES ã§æå¦ãããå ´åãããã
       ããã¯ã¯ã©ã¤ã¢ã³ããã¢ã¯ã»ã¹è¨±å¯ã®ãã§ãã¯ãè¡ã£ã¦ open() ãå®è¡ããããèª‐
       ã¿è¾¼ã¿ãæ¸ãè¾¼ã¿ã®éã«ã¯ ãµã¼ãã¼ã§ UID ãããã³ã°ãè¡ãããããã§ããã

       ãã¡ã¤ã«ãæ°ããä½æãããã¨ã ãã¡ã¤ã«ã® st_atime, st_ctime, st_mtime ãã£ã¼ã«ã
       (ããããæçµã¢ã¯ã»ã¹æå»ãæçµç¶æå¤æ´æå»ãæçµä¿®æ£æå»ã§ããã stat(2)  åç§)
       ãç¾å¨æå»ã«è¨å®ãããã ããã«è¦ªãã£ã¬ã¯ããªã® st_ctime 㨠st_mtime
       ãç¾å¨æå»ã«è¨å®ãããã ãã以å¤ã®å ´åã§ãO_TRUNC ãã©ã°ã§ãã¡ã¤ã«ãä¿®æ‐
       £ãããã¨ãã¯ã ãã¡ã¤ã«ã® st_ctime 㨠st_mtime ãã£ã¼ã«ããç¾å¨æå»ã«è¨å®ãããã

   O_DIRECT
       O_DIRECT ãã©ã°ã使ç¨ããå ´åãã¦ã¼ã¶ç©ºéãããã¡ã®é·ããã¢ãã¬ã¹ã I/O
       ã®ãã¡ã¤ã«ãªãã»ããã«é¢ãã¦ã¢ã©ã¤ã³ã¡ã³ãã®å¶éã課ããããã¨ãããã Linux
       ã§ã¯ãã¢ã©ã¤ã³ã¡ã³ãã®å¶éã¯ãã¡ã¤ã«ã·ã¹ãã ãã«ã¼ãã«ã®ãã¼ã¸ã§ã³ã«
       ãã£ã¦ç°ãªããå¨ãå¶éãåå¨ããªãå ´åãããã
       ããããªãããç¾å¨ã®ã¨ãããæå®ããããã¡ã¤ã«ããã¡ã¤ã«ã·ã¹ãã ã«å¯¾ãã¦
       ããããå¶éãããããè¦ã¤ããããã®ãã¢ããªã±ã¼ã·ã§ã³åãã®ã¤ã³ã¿ãã§ã¼ã¹ã§
       ãã¡ã¤ã«ã·ã¹ãã éä¾åã®ãã®ã¯åå¨ããªãã
       ããã¤ãã®ãã¡ã¤ã«ã·ã¹ãã ã§ã¯ãå¶éã確èªããããã®ç¬èªã®ã¤ã³ã¿ãã§ã¼ã¹ã
       æä¾ããã¦ãããä¾ãã°ã xfsctl(3)  ã® XFS_IOC_DIOINFO å½ä»¤ã§ããã

       Linux 2.4 ã§ã¯ã転éãµã¤ãºã
       ã¦ã¼ã¶ã¼ãããã¡ã®ã¢ã©ã¤ã³ã¡ã³ãããã¡ã¤ã«ãªãã»ããã¯ã ãã¡ã¤ã«ã·ã¹ãã ã®è«çãã‐
       ãã¯ãµã¤ãºã®åæ°ã§ãªããã°ãªããªãã Linux 2.6 ã§ã¯ã512
       ãã¤ããã¨ã®å¢çã«éç½®ããã¦ããã°ååã§ããã

       ã¡ã¢ãªãããã¡ããã©ã¤ãã¼ããããã³ã° (mmap(2) ã® MAP_PRIVATE
       ãã©ã°ã§ä½æããããããã³ã°) ã®å ´åã«ã¯ãO_DIRECT I/O 㯠fork(2)
       ã·ã¹ãã ã³ã¼ã«ã¨åæã«æ±ºãã¦å®è¡ãã¹ãã§ã¯ãªã
       (ãã©ã¤ãã¼ããããã³ã°ã«ã¯ããã¼ãé åã«å²ãå½ã¦ãããã¡ã¢ãªãéçã«
       å²ãå½ã¦ããããã¡ãå«ã¾ãã)ãéåæ I/O ã¤ã³ã¿ã¼ãã§ã¼ã¹ (AIO) çµç± ããã‐
       ã»ã¹åã®ä»ã®ã¹ã¬ããããçºè¡ãããããã®ãã㪠I/O ã¯ã fork(2)
       ãå¼ã³åºãããåã«å®äºãããã¹ãã§ããã ããããªãã£ãå ´åããã¼ã¿ç ´å£ãã親ããã»ã¹ãåãã‐
       ã»ã¹ã§ã®äºæããªã åä½ãèµ·ããå¯è½æ§ãããã O_DIRECT I/O ç¨ã®ã¡ã¢ãªãããã¡ã
       shmat(2) ãMAP_SHARED ãã©ã° ä»ãã® mmap(2)
       ã§ä½æãããå ´åã«ã¯ããã®å¶éã¯ãã¦ã¯ã¾ããªãã madvise(2)
       ã§ã¡ã¢ãªãããã¡ã«ã¢ããã¤ã¹ MADV_DONTFORK ãè¨å®ãã
       ã¦ããå ´åã«ãããã®å¶éã¯ãã¦ã¯ã¾ããªã(MADV_DONTFORK ã¯ãã®ã¡ã¢ãª ãããã¡ã
       fork(2) å¾ã«åããã»ã¹ããã¯å©ç¨ã§ããªããã¨ãä¿è¨¼ããã ã®ã§ãã)ã

       O_DIRECT ãã©ã°ã¯ SGI IRIX ã§å°å¥ããããSGI IRIX ã«ã Linux 2.4 ã¨åæ§ã®
       (ã¦ã¼ã¶ã¼ãããã¡ã®) ã¢ã©ã¤ã³ã¡ã³ãã®å¶éãããã ã¾ããIRIX
       ã«ã¯é©åãªéç½®ã¨ãµã¤ãºãåå¾ããããã® fcntl(2)  ã³ã¼ã«ãããã FreeBSD 4.x
       ãåãååã®ãã©ã°ãå°å¥ããããã¢ã©ã¤ã³ã¡ã³ãã®å¶éã¯ãªãã

       O_DIRECT ã Linux ã§ãµãã¼ããããã®ã¯ãã«ã¼ãã«ãã¼ã¸ã§ã³ 2.4.10 ã§ããã å¤ã
       Linux ã«ã¼ãã«ã¯ããã®ãã©ã°ãåã«ç¡è¦ããã O_DIRECT
       ãã©ã°ããµãã¼ããã¦ããªããã¡ã¤ã«ã·ã¹ãã ãããããã®å ´åã¯ã O_DIRECT ã使ç¨ããã¨
       open()  㯠EINVAL ã§å¤±æããã

       ã¢ããªã±ã¼ã·ã§ã³ã¯ãåããã¡ã¤ã«ã ç¹ã«åããã¡ã¤ã«ã®éè¤ãããã¤ãé åã«å¯¾ãã¦ã
       O_DIRECT ã¨é常㮠I/O ãæ··ãã¦ä½¿ãã®ã¯é¿ããã¹ãã§ããã
       ãã¡ã¤ã«ã·ã¹ãã ããã®ãããªç¶æ³ã«ããã¦ä¸è²«æ§ã®åé¡ãæ£ãã
       æ±ããã¨ãã§ããå ´åã§ãã£ã¦ããå¨ä½ã® I/O ã¹ã«ã¼ãããã¯
       ã©ã¡ããä¸æ¹ã使ç¨ããã¨ãã¨æ¯ã¹ã¦ä½éã«ãªãã§ãããã
       åæ§ã«ãã¢ããªã±ã¼ã·ã§ã³ã¯ãåããã¡ã¤ã«ã«å¯¾ã㦠mmap(2)  ã¨ç´æ¥ I/O
       (O_DIRECT)  ãæ··ãã¦ä½¿ãã®ãé¿ããã¹ãã§ããã

       NFS 㧠O_DIRECT ã使ã£ãå ´åã®åä½ã¯ãã¼ã«ã«ã®ãã¡ã¤ã«ã·ã¹ãã ã®å ´åã¨éãã
       å¤ãã«ã¼ãã«ãããã種ã®è¨å®ã§ã³ã³ãã¤ã«ãããã«ã¼ãã«ã¯ã O_DIRECT 㨠NFS
       ã®çµã¿åããããµãã¼ããã¦ããªããããããªãã NFS ãã‐
       ãã³ã«èªä½ã¯ãµã¼ãã«ãã©ã°ã渡ãæ©è½ã¯æã£ã¦ããªãã®ã§ã O_DIRECT I/O
       ã¯ã¯ã©ã¤ã¢ã³ãä¸ã®ãã¼ã¸ãã£ãã·ã¥ããã¤ãã¹ããã ãã«ãªãã ãµã¼ã㯠I/O ãã‐
       ã£ãã·ã¥ãã¦ãããããããªãã ã¯ã©ã¤ã¢ã³ãã¯ã O_DIRECT
       ã®åææ©æ§ãä¿æããããããµã¼ãã«å¯¾ã㦠I/O ãåæãã¦è¡ãããã«ä¾é ¼ããã
       ãµã¼ãã«ãã£ã¦ã¯ãããããç¶æ³ä¸ãç¹ã« I/O ãµã¤ãºãå°ããå ´åã« æ§è½ã大ããå£åããã
       ã¾ãããµã¼ãã«ãã£ã¦ã¯ãI/O ãå®å®ããã¹ãã¬ã¼ã¸ã«ã¾ã§è¡ãããã¨ã
       ã¯ã©ã¤ã¢ã³ãã«å¯¾ãã¦åãã¤ããã®ãããã
       ããã¯ããµã¼ãã®é»æºæéãèµ·ãã£ãéã«ãã¼ã¿ã®å®å¨æ§ãä¿ãããªã
       å±éºã¯å°ãããããæ§è½é¢ã§ã®ä¸å©ãªæ¡ä»¶ãåé¿ããããã«è¡ããã¦ããã Linux ã® NFS
       ã¯ã©ã¤ã¢ã³ãã§ã¯ O_DIRECT I/O ã§ã®ã¢ã©ã¤ã³ã¡ã³ãã®å¶éã¯ãªãã

       ã¾ã¨ããã¨ã O_DIRECT
       ã¯ã注æãã¦ä½¿ãã¹ãã§ããããå¼·åãªãã¼ã«ã¨ãªãå¯è½æ§ãæã£ã¦ããã
       ã¢ããªã±ã¼ã·ã§ã³ã¯ O_DIRECT
       ãããã©ã«ãã§ã¯ç¡å¹ã«ãªã£ã¦ããæ§è½åä¸ã®ããã®ãªãã·ã§ã³ã¨ èãã¦ããã®ãããã§ãããã

              ãO_DIRECT ã§ãã¤ãå°ãã®ã¯ãã¤ã³ã¿ãã§ã¼ã¹å¨é¨ãæ¬å½ã«ã馬鹿ãªç¹ã ã
              ãã¶ãå±ãªããã¤ã³ãã³ã³ããã¼ã«å¤ã§ é ããããããªã£ããµã«ãè¨è¨ããããããªãããªã
              — Linus

ãã°
       ç¾å¨ã®ã¨ããã open()  ã®å¼ã³åºãæã« O_ASYNC ãæå®ãã¦ã·ã°ãã«é§å I/O
       ãæå¹ã«ãããã¨ã¯ã§ããªãã ãã®ãã©ã°ãæå¹ã«ããã«ã¯ fcntl(2)  ã使ç¨ãããã¨ã

é¢é£é ç®
       chmod(2), chown(2), close(2), dup(2), fcntl(2), link(2), lseek(2),
       mknod(2), mmap(2), mount(2), openat(2), read(2), socket(2), stat(2),
       umask(2), unlink(2), write(2), fopen(3), fifo(7), path_resolution(7),
       symlink(7)

ãã®ææ¸ã«ã¤ãã¦
       ãã® man ãã¼ã¸ã¯ Linux man-pages ããã¸ã§ã¯ãã®ãªãªã¼ã¹ 3.51 ã®ä¸é¨
       ã§ãããããã¸ã§ã¯ãã®èª¬æã¨ãã°å ±åã«é¢ããæå ±ã¯
       http://www.kernel.org/doc/man-pages/ ã«æ¸ããã¦ããã



Linux                             2013-02-18                           OPEN(2)