当前位置: 首页>>代码示例>>C++>>正文


C++ seq_open函数代码示例

本文整理汇总了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);
}
开发者ID:xf739645524,项目名称:kernel-rhel5,代码行数:4,代码来源:proc.c

示例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);
}
开发者ID:channinglan,项目名称:LinuxKernel2.6.27,代码行数:8,代码来源:ehci-socle.c

示例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);
};
开发者ID:jerryrt,项目名称:lkm2.6-docbook-chs,代码行数:8,代码来源:procfs4.c

示例4: slabinfo_open

static int slabinfo_open(struct inode *inode, struct file *file)
{
	return seq_open(file, &slabinfo_op);
}
开发者ID:muromec,项目名称:linux-ezxdev,代码行数:4,代码来源:proc_misc.c

示例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,
};
开发者ID:MikeForeskin,项目名称:Vindicator-S6-MM,代码行数:101,代码来源:proc_namespace.c

示例6: partitions_open

static int partitions_open(struct inode *inode, struct file *file)
{
	return seq_open(file, &partitions_op);
}
开发者ID:muromec,项目名称:linux-ezxdev,代码行数:4,代码来源:proc_misc.c

示例7: yam_info_open

static int yam_info_open(struct inode *inode, struct file *file)
{
	return seq_open(file, &yam_seqops);
}
开发者ID:BozkurTR,项目名称:kernel,代码行数:4,代码来源:yam.c

示例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);
}
开发者ID:Red680812,项目名称:android_44_KitKat_kernel_htc_dlxpul-2,代码行数:6,代码来源:htc_monitor.c

示例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);
}
开发者ID:daivietpda,项目名称:android_kernel_huawei_msm7x27,代码行数:4,代码来源:nommu.c

示例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);
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:4,代码来源:proc.c

示例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);
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:7,代码来源:histogram.c

示例12: profiling_events_open

static int profiling_events_open(struct inode *inode, struct file *file)
{
	return seq_open(file, &profiling_events_seq_ops);
}
开发者ID:1DeMaCr,项目名称:android_hd_kernel_samsung_codina,代码行数:4,代码来源:mali_kernel_sysfs.c

示例13: devinfo_open

static int devinfo_open(struct inode *inode, struct file *filp)
{
	return seq_open(filp, &devinfo_ops);
}
开发者ID:rrowicki,项目名称:Chrono_Kernel-1,代码行数:4,代码来源:devices.c

示例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);
}
开发者ID:sombree,项目名称:Hulk-Kernel-V2,代码行数:4,代码来源:tty_ldisc.c

示例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);
}
开发者ID:0xroot,项目名称:Blackphone-BP1-Kernel,代码行数:4,代码来源:ar-proc.c


注:本文中的seq_open函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。