mknodat

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



åå
       mknodat - ãã£ã¬ã¯ããªãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ããç¸å¯¾çãªä½ç½®ã«ã
       ç¹æ®ãã¡ã¤ã«ãé常ã®ãã¡ã¤ã«ãä½æãã

æ¸å¼
       #include <fcntl.h> /* AT_* å®æ°ã®å®ç¾© */
       #include <sys/stat.h>

       int mknodat(int dirfd, const char *pathname, mode_t mode, dev_t dev);

   glibc åãã®æ©è½æ¤æ»ãã¯ãã®è¦ä»¶ (feature_test_macros(7)  åç§):

       mknodat():
           glibc 2.10 以é:
               _XOPEN_SOURCE >= 700
           glibc 2.10 ããå:
               _ATFILE_SOURCE

説æ
       mknodat()  ã·ã¹ãã ã³ã¼ã«ã¯ããã® man ãã¼ã¸ã§èª¬æãã¦ããéãããã以å¤ã¯ã
       mknod(2)  ã¨å¨ãåãããã«åä½ããã

       pathname ã§æå®ããããã¹åãç¸å¯¾ãã¹åã§ããå ´åã ãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ dirfd
       ã§åç§ããããã£ã¬ã¯ããªããã®ç¸å¯¾ãã¹åã¨ãã¦è§£éããã (mknod(2)
       ã§ã¯ãç¸å¯¾ãã¹ã¯å¼ã³åºãåããã»ã¹ã® ã«ã¬ã³ãã¯ã¼ã‐
       ã³ã°ãã£ã¬ã¯ããªããã®ç¸å¯¾ãã¹ã¨ãªã)ã

       pathname ãç¸å¯¾ãã¹ã§ãããã㤠dirfd ãç¹å¥ãªå¤ AT_FDCWD ã§ããå ´åã pathname
       㯠(mknod(2)  ã¨åãããã«) å¼ã³åºãåããã»ã¹ã® ã«ã¬ã³ãã¯ã¼ã‐
       ã³ã°ãã£ã¬ã¯ããªããã®ç¸å¯¾ãã¹åã¨ãã¦è§£éãããã

       pathname ã絶対ãã¹ã§ããå ´åã dirfd ã¯ç¡è¦ãããã

è¿ãå¤
       æåããå ´åã mknodat()  㯠0 ãè¿ãã ã¨ã©ã¼ã®å ´åã-1 ãè¿ããã¦ã errno
       ã«ã¯ã¨ã©ã¼ã示ãå¤ãè¨å®ãããã

ã¨ã©ã¼
       mknod(2)  ã¨åãã¨ã©ã¼ã mknodat()  ã§ãèµ·ããã mknodat()
       ã§ã¯ããã®ä»ã«ä»¥ä¸ã®ã¨ã©ã¼ãèµ·ãã:

       EBADF  dirfd ãæå¹ãªãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ã§ãªãã

       ENOTDIR
              pathname ãç¸å¯¾ãã¹ã§ãã㤠dirfd
              ããã£ã¬ã¯ããªä»¥å¤ã®ãã¡ã¤ã«ãåç§ãããã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ã§ããã

ãã¼ã¸ã§ã³
       mknodat()  㯠Linux ã«ã¼ãã« 2.6.16 ã§è¿½å ãããã ã©ã¤ãã©ãªã«ãããµãã¼ãã¯
       glibc ãã¼ã¸ã§ã³ 2.4 ã§è¿½å ãããã

æºæ
       POSIX.1-2008.

注æ
       mknodat()  ãå¿è¦ãªçç±ã«ã¤ãã¦ã¯ã openat(2)  ãåç§ãããã¨ã

é¢é£é ç®
       mknod(2), openat(2), path_resolution(7)

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



Linux                             2012-05-04                        MKNODAT(2)