mknod MYFIFO p mkfifo a=rw MYFIFOÀ§ÀÇ µÎ ¸í·É¾î´Â ÇѱâÁö ¿¹¿Ü¸¦ Á¦¿ÜÇÏ°í µ¿ÀÏÇÑ µ¿ÀÛÀ» ¼öÇàÇÑ´Ù. mkfifo ¸í·É¾î´Â ÆÄÀÌÇÁ¸¦ ¸¸µç ÈÄ FIFO ÆÄÀÏ¿¡ ´ëÇØ Á÷Á¢ Çã°¡»çÇ×(permission)À» ¹Ù²Ù±â À§ÇÑ Ç׸ñÀ» Á¦°øÇÑ´Ù. mknodÀÇ °æ¿ì´Â chmod ¸í·É¾îÀÇ ºü¸¥ È£ÃâÀÌ ÇÊ¿äÇÒ °ÍÀÌ´Ù.
FIFO ÆÄÀÏÀº ±ä µð·ºÅ丮 ¸®½ºÆ®(long directory listing)¿¡¼ º¸¿©Áö´Â "p" Áö½ÃÀÚ¿¡ ÀÇÇØ ¹°¸®ÀûÀÎ ÆÄÀÏ ½Ã½ºÅÛ¿¡ À绡¸® ¾Ë·ÁÁø´Ù.
$ ls -l MYFIFO prw-r--r-- 1 root root 0 Dec 14 22:15 MYFIFO|ÆÄÀÏ¸í ´ÙÀ½¿¡ ÀÖ´Â ¼öÁ÷¼±("pipe sign")¿¡ ÁÖ¸ñÇ϶ó.
C·Î FIFO¸¦ ¸¸µé±â À§ÇØ, mknod() ½Ã½ºÅÛ È£ÃâÀ» »ç¿ëÇÒ ¼ö ÀÖ´Ù.:
LIBRARY FUNCTION: mknod(); PROTOTYPE: int mknod( char *pathname, mode_t mode, dev_t dev); RETURNS: 0 on success, -1 on error: errno = EFAULT (pathname invalid) EACCES (permission denied) ENAMETOOLONG (pathname too long) ENOENT (invalid pathname) ENOTDIR (invalid pathname) (see man page for mknod for others) NOTES: Creates a filesystem node (file, device file, or FIFO)
mknod("/tmp/MYFIFO", S_IFIFO|0666, 0);ÀÌ °æ¿ì, "/tmp/MYFIFO" ÆÄÀÏÀº FIFO ÆÄÀÏó·³ ¸¸µé¾î Áø´Ù. ´ÙÀ½Ã³·³ ÁöÁ¤µÈ umask¿¡ ÀÇÇØ ¿µÇâÀ» ¹Þ´Â´Ù ÇÏ´õ¶óµµ ¿äûµÈ Çã°¡»çÇ×(permission)Àº "0666"ÀÌ´Ù.:
final_umask = requested_permissions & ~original_umaskÀϹÝÀûÀÎ ¹æ¹ýÀº ÀϽÃÀûÀ¸·Î umask °ªÀ» °ø°ÝÇϱâ À§ÇØ umask() ½Ã½ºÅÛ È£ÃâÀ» »ç¿ëÇÏ´Â °ÍÀÌ´Ù.:
umask(0); mknod("/tmp/MYFIFO", S_IFIFO|0666, 0);°Ô´Ù°¡, µð¹ÙÀ̽º ÆÄÀÏÀ» ¸¸µé°í ÀÖÁö ¾Ê´Ù¸é mknod()ÀÇ ¼¼¹ø° ¾Æ±Ô¸ÕÆ®´Â ¹«½ÃµÈ´Ù. ÀÌ·± °æ¿ì¿¡´Â µð¹ÙÀ̽º ÆÄÀÏÀÇ Å«ÂÊ°ú ÀÛÀº ÂÊÀÇ ¹øÈ£¸¦ ÁöÁ¤ÇØ ÁÖ¾î¾ß¸¸ ÇÑ´Ù.
Copyright (c) 1996,1997 by Euibeom.Hwang & SangEun.Oh All Rights Reserved
Email To:Webmaster ,
Another address
LAST UPDATE Nov 15,1997
Created Nov 15,1997