寧波市城鄉(xiāng)建設(shè)委員會網(wǎng)站填寫電話的廣告
在《使用procfs》一文的源碼示例中有說到proc文件系統(tǒng)每次讀取的數(shù)據(jù)只能是1個頁,如果超過則需多次讀取,這樣的話會增加讀取次數(shù),增多系統(tǒng)調(diào)用次數(shù),影響了整體的效率,故而才有seq file序列文件的出現(xiàn),該項功能使得內(nèi)核對于大文件的讀取更加容易。
對于seq file,其結(jié)構(gòu)體定義在include/linux/seq_file.h文件中,內(nèi)容如下:
struct seq_file {
char *buf;
size_t size;
size_t from;
size_t count;
size_t pad_until;
loff_t index;
loff_t read_pos;
u64 version;
struct mutex lock;
const struct seq_operations *op;
int poll_event;
#ifdef CONFIG_USER_NS
struct user_namespace *user_ns;
#endif
void *private;