*参照元 [#wf046f7a]
#backlinks

*説明 [#m8fdf95b]
-パス: [[linux-4.4.1/fs/seq_file.c]]

-FIXME: これは何?
--説明


**引数 [#c42dcf33]
-struct file *file
--
--[[linux-4.4.1/file]]
-int (*show)(struct seq_file *, void *)
--
--[[linux-4.4.1/seq_file]]
-void *data
--


**返り値 [#w0730b9f]
-int
--


**参考 [#z660567c]


*実装 [#w384d0f8]
 int single_open(struct file *file, int (*show)(struct seq_file *, void *),
                 void *data)
 {
         struct seq_operations *op = kmalloc(sizeof(*op), GFP_KERNEL);
         int res = -ENOMEM;
 
-
--[[linux-4.4.1/seq_operations]]
--[[linux-4.4.1/kmalloc()]]

         if (op) {
                 op->start = single_start;
                 op->next = single_next;
                 op->stop = single_stop;
                 op->show = show;
                 res = seq_open(file, op);
                 if (!res)
                         ((struct seq_file *)file->private_data)->private = data;
                 else
                         kfree(op);
-
--[[linux-4.4.1/single_start()]]
--[[linux-4.4.1/single_next()]]
--[[linux-4.4.1/single_stop()]]
--[[linux-4.4.1/seq_open()]]
--[[linux-4.4.1/seq_file]]
--[[linux-4.4.1/kfree()]]

         }
         return res;
 }
 EXPORT_SYMBOL(single_open);
-
--[[linux-4.4.1/EXPORT_SYMBOL()]]


*コメント [#t76eb22e]


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS