{"id":514,"date":"2008-03-23T05:46:06","date_gmt":"2008-03-23T05:46:06","guid":{"rendered":"http:\/\/pchero21.com\/?p=514"},"modified":"2008-03-23T05:46:06","modified_gmt":"2008-03-23T05:46:06","slug":"file_operations-%ea%b5%ac%ec%a1%b0%ec%b2%b4-%ec%9b%90%ed%98%95","status":"publish","type":"post","link":"http:\/\/pchero21.com\/?p=514","title":{"rendered":"file_operations \uad6c\uc870\uccb4 \uc6d0\ud615"},"content":{"rendered":"<p>\nstruct file_operations {<br \/>\n &nbsp;&nbsp; struct module *owner;<\/p>\n<p> &nbsp;&nbsp; \/\/ llseek \uba54\uc18c\ub4dc\ub294 \ud30c\uc77c\uc5d0\uc11c \ud604\uc7ac\uc758 read\/write\uc758 \uc704\uce58\ub97c \uc62e\uae30\uba70, \uc0c8\ub85c\uc6b4 \uc704\uce58\uac00 (\uc591\uc218)\uac12\uc73c\ub85c \ub9ac\ud134\ub41c\ub2e4. \uc5d0\ub7ec\ub294 \uc74c\uc218\uac12\uc73c\ub85c \ubc18\ud658\ub41c\ub2e4.<br \/>\n &nbsp;&nbsp; loff_ (*llseek) (struct file *, loff_t, int);<\/p>\n<p> &nbsp;&nbsp; \/\/ read \uba54\uc18c\ub4dc\ub294 \ub514\ubc14\uc774\uc2a4\uc5d0\uc11c \ub370\uc774\ud130\ub97c \uac00\uc838\uc624\uae30 \uc704\ud574\uc11c \uc0ac\uc6a9\ud55c\ub2e4. \uc5ec\uae30\uc5d0 NULL \uac12\uc744 \uc0ac\uc6a9\ud558\uba74 read \uc2dc\uc2a4\ud15c<br \/>\n\ucf5c\uc740 -EINVAL(&#8220;\uc798\ubabb\ub41c \ub9e4\uac1c \ubcc0\uc218&#8221;)\uac12\uc744 \ub3cc\ub824 \uc8fc\uba70 \uc2e4\ud328\ud55c\ub2e4. \uc74c\uc218\uac12\uc774 \uc544\ub2cc \ub9ac\ud134\uac12\uc740 \uc131\uacf5\uc801\uc73c\ub85c \uc77d\uc740 \ubc14\uc774\ud2b8 \uc218\ub97c \ub098\ud0c0\ub0b8\ub2e4.<br \/>\n &nbsp;&nbsp; ssize_t (*read) (struct file *, char *, size_t, loff_t *);<br \/>\n &nbsp;&nbsp; <br \/>\n &nbsp;&nbsp; \/\/ \ub514\ubc14\uc774\uc2a4\uc5d0 \ub370\uc774\ud130\ub97c \ubcf4\ub0b8\ub2e4. NULL \uac12\uc744 \uc2a4\uba74 wirte \uc2dc\uc2a4\ud15c \ucf5c\uc5d0 \ub300\ud574\uc11c -EINVAL\uc744 \ub3cc\ub824\uc900\ub2e4. \ub9ac\ud134\uac12\uc774 \uc74c\uc218\uac00 \uc544\ub2c8\uba74 \uc131\uacf5\uc801\uc73c\ub85c \uc791\uc131\ub41c \ub370\uc774\ud130\uc758 \ubc14\uc774\ud2b8 \ud06c\uae30\uc774\ub2e4.<br \/>\n &nbsp;&nbsp; ssize_t (*write) (struct file *, const char *, size_t, loff_t *);<\/p>\n<p> &nbsp;&nbsp; \/\/ \uc774 \ud568\uc218 \ud3ec\uc778\ud130\ub294 \ub514\ubc14\uc774\uc2a4 \ub178\ub4dc\uc5d0 \ub300\ud574\uc11c\ub294 NULL\uc774\uc5b4\uc57c \ud55c\ub2e4. \uc774\uac83\uc740 \ub514\ub809\ud1a0\ub9ac\uc5d0 \ub300\ud574\uc11c \uc0ac\uc6a9\ud55c\ub2e4.<br \/>\n &nbsp;&nbsp; int (*readdir) (struct file *, void *, filldir_t);<\/p>\n<p> &nbsp;&nbsp; \/\/ \ud604\uc7ac\uc758 \ud504\ub85c\uc138\uc2a4\ub97c \ub300\uae30 \ud050\uc5d0 \ub123\ub294\ub2e4.<br \/>\n &nbsp;&nbsp; unsigned int (*poll) (struct file *, struct poll_table_strcut *);<\/p>\n<p> &nbsp;&nbsp; \/\/ ioctl \uc2dc\uc2a4\ud15c \ucf5c\uc740 \ub514\ubc14\uc774\uc2a4\uc5d0 \uc885\uc18d\uc801\uc778 \uba85\ub839\uc744 \ub9cc\ub4e4 \uc218 \uc788\ub3c4\ub85d\ud55c\ub2e4. \ucee4\ub110\uc774 fops \ud14c\uc774\ube14\uc744 \ucc38\uc870\ud558\uc9c0 \uc54a\uace0\ub3c4 \uc778\uc2dd\ud560 \uc218 \uc788\ub294 \ub9ce\uc740 ioctl \uba85\ub839\uc774 \uc788\ub2e4.<br \/>\n &nbsp;&nbsp; int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);<\/p>\n<p> &nbsp;&nbsp; \/\/ mmap\uc740 \ub514\ubc14\uc774\uc2a4 \uba54\ubaa8\ub9ac\ub97c \ud504\ub85c\uc138\uc11c\uc758 \uba54\ubaa8\ub9ac\uc5d0 \ub9f5\ud551\uc2dc\ud0a4\ub3c4\ub85d \uc694\uccad\ud558\uae30 \uc704\ud574 \uc0ac\uc6a9\ub41c\ub2e4. \ub514\ubc14\uc774\uc2a4\uac00 \uc774 \ubc29\ubc95\uc744 \uc81c\uacf5\ud558\uc9c0 \uc54a\uc73c\uba74 \ub9ac\ud134\uac12\uc740 ENODEV \uc774\ub2e4.<br \/>\n &nbsp;&nbsp; int (*mmap) (struct file *, struct vm_area_struct *);<\/p>\n<p> &nbsp;&nbsp; \/\/ \uc774 \ud56d\ubaa9\uc774 NULL \ub85c \ub418\uc5b4 \uc788\uc73c\uba74 \ub514\ubc14\uc774\uc2a4 open \ud638\ucd9c\uc740 \uc5b8\uc81c\ub098 \uc131\uacf5\uc801\uc774\ub2e4.<br \/>\n &nbsp;&nbsp; int (*open) (struct inode *, struct file *);<\/p>\n<p> &nbsp;&nbsp; \/\/ \uc5f0\ub9b0 \ub514\ubc14\uc774\uc2a4\ub97c \ub2eb\uae30 \uc774\uc804\uc5d0 \ubaa8\ub4e0 \ub370\uc774\ud130\ub97c \uc4f0\ub3c4\ub85d \ud558\uae30 \uc704\ud574\uc11c \uc0ac\uc6a9\ud55c\ub2e4.<br \/>\n &nbsp;&nbsp; int (*flush) (struct file *);<\/p>\n<p> &nbsp;&nbsp; \/\/ \ub178\ub4dc\ub97c \ub2eb\uc744 \ub54c \uc218\ud589\ub41c\ub2e4.<br \/>\n &nbsp;&nbsp; int (*release) (struct inode *, struct file *);<\/p>\n<p> &nbsp;&nbsp; \/\/ \ub370\uc774\ud130 \uc911\uc5d0\uc11c \ubc84\ud37c\uc5d0 \uc788\ub294 \uac83\uc740 \ubaa8\ub450 \ub514\ubc14\uc774\uc2a4\uc5d0 \uc4f4\ub2e4. \uc774 \uba54\uc18c\ub4dc\uac00 \uc9c0\uc6d0\ub418\uc9c0 \uc54a\uc73c\uba74 fsync \uc2dc\uc2a4\ud15c \ucf5c\uc740 -EINVAL \ub9ac\ud134\uac12\uc744 \uac16\ub294\ub2e4.<br \/>\n &nbsp;&nbsp; int (*fsync) (struct file *, struct dentry *, int datasync);<\/p>\n<p> &nbsp;&nbsp; \/\/ \uc774 \ub3d9\uc791\uc740 FASYNC \ud50c\ub798\uadf8\uc5d0 \ubcc0\ud654\uac00 \uc788\ub294 \ub514\ubc14\uc774\uc2a4\ub97c \ud655\uc778\ud558\uae30 \uc704\ud574\uc11c \uc0ac\uc6a9\ud55c\ub2e4. \ub4dc\ub77c\uc774\ubc84\uac00 \ube44\ub3d9\uae30 \ud1b5\uc9c0\ub97c \uc9c0\uc6d0\ud558\uc9c0 \uc54a\uc744 \uacbd\uc6b0\uc5d0 \uc774 \ud544\ub4dc\ub97c NULL\ub85c \ub450\uba74 \ub41c\ub2e4.<br \/>\n &nbsp;&nbsp; int (*fasync) (int, struct file *, int);<\/p>\n<p> &nbsp;&nbsp; \/\/ \ud30c\uc77c\uc5d0 \ub77d\uc744 \uac78\uae30 \uc704\ud574\uc11c \uc0ac\uc6a9\ud55c\ub2e4.<br \/>\n &nbsp;&nbsp; int (*lock) (struct file *, int, struct file_lock *);<\/p>\n<p> &nbsp;&nbsp; ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, loff_t *);<\/p>\n<p> &nbsp;&nbsp; ssize_t (*writev) (struct file *, const struct iovec *, unsigned long, loff_t *);<\/p>\n<p> &nbsp;&nbsp; ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);<\/p>\n<p> &nbsp;&nbsp; unsigned long (*get_unmapped_area) (struct file *, unsigned long,<br \/>\nunsigned long, unsigned long, unsigned long, unsigned long);<br \/>\n}<\/p>\n<p>\n\ucc38\uc870 : <a href=\"http:\/\/blog.naver.com\/sglinux2418?Redirect=Log&amp;logNo=20185596\" target=\"_blank\">http:\/\/blog.naver.com\/sglinux2418?Redirect=Log&amp;logNo=20185596<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>struct file_operations { &nbsp;&nbsp; struct module *owner; &nbsp;&nbsp; \/\/ llseek \uba54\uc18c\ub4dc\ub294 \ud30c\uc77c\uc5d0\uc11c \ud604\uc7ac\uc758 read\/write\uc758 \uc704\uce58\ub97c \uc62e\uae30\uba70, \uc0c8\ub85c\uc6b4 \uc704\uce58\uac00 (\uc591\uc218)\uac12\uc73c\ub85c \ub9ac\ud134\ub41c\ub2e4. \uc5d0\ub7ec\ub294 \uc74c\uc218\uac12\uc73c\ub85c \ubc18\ud658\ub41c\ub2e4. &nbsp;&nbsp; loff_ (*llseek) (struct file *, loff_t, int); &nbsp;&nbsp; \/\/ read \uba54\uc18c\ub4dc\ub294 \ub514\ubc14\uc774\uc2a4\uc5d0\uc11c \ub370\uc774\ud130\ub97c \uac00\uc838\uc624\uae30 \uc704\ud574\uc11c \uc0ac\uc6a9\ud55c\ub2e4. &hellip; <a href=\"http:\/\/pchero21.com\/?p=514\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[21],"tags":[175,705],"_links":{"self":[{"href":"http:\/\/pchero21.com\/index.php?rest_route=\/wp\/v2\/posts\/514"}],"collection":[{"href":"http:\/\/pchero21.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/pchero21.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/pchero21.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/pchero21.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=514"}],"version-history":[{"count":0,"href":"http:\/\/pchero21.com\/index.php?rest_route=\/wp\/v2\/posts\/514\/revisions"}],"wp:attachment":[{"href":"http:\/\/pchero21.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pchero21.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=514"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pchero21.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}