本文整理汇总了C++中seq_open函数的典型用法代码示例。如果您正苦于以下问题:C++ seq_open函数的具体用法?C++ seq_open怎么用?C++ seq_open使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了seq_open函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: crypto_info_open
static int crypto_info_open(struct inode *inode, struct file *file)
{
return seq_open(file, &crypto_seq_ops);
}
示例2: socle_otg_proc_open
/*
* Now to implement the /proc file we need only make an open
* method which sets up the sequence operators.
* */
static int socle_otg_proc_open(struct inode *inode, struct file *file)
{
return seq_open(file, &socle_otg_seq_ops);
}
示例3: my_open
/**
* This function is called when the /proc file is open.
*
*/
static int my_open(struct inode *inode, struct file *file)
{
return seq_open(file, &my_seq_ops);
};
示例4: slabinfo_open
static int slabinfo_open(struct inode *inode, struct file *file)
{
return seq_open(file, &slabinfo_op);
}
示例5: show_vfsmnt
//.........这里部分代码省略.........
struct nsproxy *nsp;
struct mnt_namespace *ns = NULL;
struct path root;
struct proc_mounts *p;
int ret = -EINVAL;
if (!task)
goto err;
task_lock(task);
nsp = task->nsproxy;
if (!nsp || !nsp->mnt_ns) {
task_unlock(task);
put_task_struct(task);
goto err;
}
ns = nsp->mnt_ns;
get_mnt_ns(ns);
if (!task->fs) {
task_unlock(task);
put_task_struct(task);
ret = -ENOENT;
goto err_put_ns;
}
get_fs_root(task->fs, &root);
task_unlock(task);
put_task_struct(task);
ret = -ENOMEM;
p = kmalloc(sizeof(struct proc_mounts), GFP_KERNEL);
if (!p)
goto err_put_path;
file->private_data = &p->m;
ret = seq_open(file, &mounts_op);
if (ret)
goto err_free;
p->ns = ns;
p->root = root;
p->m.poll_event = ns->event;
p->show = show;
return 0;
err_free:
kfree(p);
err_put_path:
path_put(&root);
err_put_ns:
put_mnt_ns(ns);
err:
return ret;
}
static int mounts_release(struct inode *inode, struct file *file)
{
struct proc_mounts *p = proc_mounts(file->private_data);
path_put(&p->root);
put_mnt_ns(p->ns);
return seq_release(inode, file);
}
static int mounts_open(struct inode *inode, struct file *file)
{
return mounts_open_common(inode, file, show_vfsmnt);
}
static int mountinfo_open(struct inode *inode, struct file *file)
{
return mounts_open_common(inode, file, show_mountinfo);
}
static int mountstats_open(struct inode *inode, struct file *file)
{
return mounts_open_common(inode, file, show_vfsstat);
}
const struct file_operations proc_mounts_operations = {
.open = mounts_open,
.read = seq_read,
.llseek = seq_lseek,
.release = mounts_release,
.poll = mounts_poll,
};
const struct file_operations proc_mountinfo_operations = {
.open = mountinfo_open,
.read = seq_read,
.llseek = seq_lseek,
.release = mounts_release,
.poll = mounts_poll,
};
const struct file_operations proc_mountstats_operations = {
.open = mountstats_open,
.read = seq_read,
.llseek = seq_lseek,
.release = mounts_release,
};
示例6: partitions_open
static int partitions_open(struct inode *inode, struct file *file)
{
return seq_open(file, &partitions_op);
}
示例7: yam_info_open
static int yam_info_open(struct inode *inode, struct file *file)
{
return seq_open(file, &yam_seqops);
}
示例8: log_proc_open
static int log_proc_open(struct inode *inode, struct file *file)
{
if( htc_monitor_param == 0 )
return -EPERM;
return seq_open(file, &log_seq_ops);
}
示例9: proc_nommu_region_list_open
static int proc_nommu_region_list_open(struct inode *inode, struct file *file)
{
return seq_open(file, &proc_nommu_region_list_seqop);
}
示例10: atm_dev_seq_open
static int atm_dev_seq_open(struct inode *inode, struct file *file)
{
return seq_open(file, &atm_dev_seq_ops);
}
示例11: fscache_histogram_open
/*
* open "/proc/fs/fscache/histogram" to provide latency data
*/
static int fscache_histogram_open(struct inode *inode, struct file *file)
{
return seq_open(file, &fscache_histogram_ops);
}
示例12: profiling_events_open
static int profiling_events_open(struct inode *inode, struct file *file)
{
return seq_open(file, &profiling_events_seq_ops);
}
示例13: devinfo_open
static int devinfo_open(struct inode *inode, struct file *filp)
{
return seq_open(filp, &devinfo_ops);
}
示例14: proc_tty_ldiscs_open
static int proc_tty_ldiscs_open(struct inode *inode, struct file *file)
{
return seq_open(file, &tty_ldiscs_seq_ops);
}
示例15: rxrpc_call_seq_open
static int rxrpc_call_seq_open(struct inode *inode, struct file *file)
{
return seq_open(file, &rxrpc_call_seq_ops);
}