本文整理汇总了C++中proc_mkdir函数的典型用法代码示例。如果您正苦于以下问题:C++ proc_mkdir函数的具体用法?C++ proc_mkdir怎么用?C++ proc_mkdir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了proc_mkdir函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: pn544_mmi_init
int pn544_mmi_init(void)
{
struct proc_dir_entry *pn544_dir;
struct proc_dir_entry *pn544_mmi;
PN544_MMI_DEBUG("%s:entered and ready to create proc node to support MMI test\n",__func__);
pn544_dir=proc_mkdir("pn544",NULL);
if(NULL==pn544_dir)
{
printk("Can not create folder pn544 in proc system.\n");
return -EIO;
}
pn544_mmi=proc_create("pn544_mmi", S_IRUGO, pn544_dir, &pn544_mmi_fops);
if(NULL==pn544_mmi)
{
printk("Can not create folder pn544 in proc system.\n");
return -EIO;
}
return 0;
}
开发者ID:Kra1o5,项目名称:android_kernel_huawei_u8815-ics,代码行数:20,代码来源:pn544mmi.c
示例2: configure_procfs
static int
configure_procfs ( void )
{
/* create directory */
dir_pfs = proc_mkdir ( PROBE_PROCFS_DIR_NAME, NULL );
if ( dir_pfs == NULL )
{
remove_proc_entry ( PROBE_PROCFS_DIR_NAME, NULL );
log_infok( "error: Could not initialize /proc/%s\n", PROBE_PROCFS_DIR_NAME );
return -ENOMEM;
}
dir_pfs->owner = THIS_MODULE;
if ( !configure_proc_entry ( ivhs_feedback_pfs, &ivhs_feedback_fops, PROBE_PROCFS_FEEDBACK ) )
goto out_trigger;
return true_b;
out_trigger:
remove_proc_entry ( PROBE_PROCFS_FEEDBACK, dir_pfs );
remove_proc_entry ( PROBE_PROCFS_DIR_NAME, NULL );
return false_b;
}
开发者ID:Jornason,项目名称:DieHard,代码行数:20,代码来源:ivhs_feedback.c
示例3: scsi_init_procfs
int __init scsi_init_procfs(void)
{
struct proc_dir_entry *pde;
proc_scsi = proc_mkdir("scsi", NULL);
if (!proc_scsi)
goto err1;
pde = create_proc_entry("scsi/scsi", 0, NULL);
if (!pde)
goto err2;
pde->proc_fops = &proc_scsi_operations;
return 0;
err2:
remove_proc_entry("scsi", NULL);
err1:
return -ENOMEM;
}
开发者ID:StephenMacras,项目名称:dsl-n55u-bender,代码行数:20,代码来源:scsi_proc.c
示例4: cachefiles_proc_init
/*
* initialise the /proc/fs/cachefiles/ directory
*/
int __init cachefiles_proc_init(void)
{
_enter("");
if (!proc_mkdir("fs/cachefiles", NULL))
goto error_dir;
if (!proc_create("fs/cachefiles/histogram", S_IFREG | 0444, NULL,
&cachefiles_histogram_fops))
goto error_histogram;
_leave(" = 0");
return 0;
error_histogram:
remove_proc_entry("fs/cachefiles", NULL);
error_dir:
_leave(" = -ENOMEM");
return -ENOMEM;
}
开发者ID:rrowicki,项目名称:Chrono_Kernel-1,代码行数:23,代码来源:proc.c
示例5: alignment_init
/*
* This needs to be done after sysctl_init, otherwise sys/ will be
* overwritten. Actually, this shouldn't be in sys/ at all since
* it isn't a sysctl, and it doesn't contain sysctl information.
* We now locate it in /proc/cpu/alignment instead.
*/
static int __init alignment_init(void)
{
struct proc_dir_entry *dir, *res;
dir = proc_mkdir("cpu", NULL);
if (!dir)
return -ENOMEM;
res = proc_create_data("alignment", S_IWUSR | S_IRUGO, dir,
&alignment_proc_fops, &se_usermode);
if (!res)
return -ENOMEM;
res = proc_create_data("kernel_alignment", S_IWUSR | S_IRUGO, dir,
&alignment_proc_fops, &se_kernmode_warn);
if (!res)
return -ENOMEM;
return 0;
}
开发者ID:0-T-0,项目名称:ps4-linux,代码行数:26,代码来源:alignment.c
示例6: acpi_battery_init
static int __init
acpi_battery_init (void)
{
int result = 0;
ACPI_FUNCTION_TRACE("acpi_battery_init");
acpi_battery_dir = proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir);
if (!acpi_battery_dir)
return_VALUE(-ENODEV);
acpi_battery_dir->owner = THIS_MODULE;
result = acpi_bus_register_driver(&acpi_battery_driver);
if (result < 0) {
remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir);
return_VALUE(-ENODEV);
}
return_VALUE(0);
}
开发者ID:wxlong,项目名称:Test,代码行数:20,代码来源:battery.c
示例7: divert_dev_init
int
divert_dev_init(void)
{
init_waitqueue_head(&rd_queue);
#ifdef CONFIG_PROC_FS
isdn_proc_entry = proc_mkdir("isdn", init_net.proc_net);
if (!isdn_proc_entry)
return (-1);
isdn_divert_entry = proc_create("divert", S_IFREG | S_IRUGO,
isdn_proc_entry, &isdn_fops);
if (!isdn_divert_entry) {
remove_proc_entry("isdn", init_net.proc_net);
return (-1);
}
#endif /* CONFIG_PROC_FS */
return (0);
} /* divert_dev_init */
开发者ID:robacklin,项目名称:ts4700,代码行数:20,代码来源:divert_procfs.c
示例8: rtas_init
static void __init rtas_init(void)
{
struct proc_dir_entry *rtas_dir, *entry;
rtas_dir = proc_mkdir("rtas", 0);
if (!rtas_dir) {
printk(KERN_ERR "Failed to create rtas proc directory\n");
} else {
entry = create_proc_entry("error_log", S_IRUSR, rtas_dir);
if (entry)
entry->proc_fops = &proc_rtas_log_operations;
else
printk(KERN_ERR "Failed to create rtas/error_log proc entry\n");
}
if (kernel_thread(rtasd, 0, CLONE_FS) < 0)
printk(KERN_ERR "Failed to start RTAS daemon\n");
printk(KERN_ERR "RTAS daemon started\n");
}
开发者ID:huangyukun2012,项目名称:linux-2.4.21,代码行数:20,代码来源:rtasd.c
示例9: proc_root_init
void __init proc_root_init(void)
{
int err;
proc_init_inodecache();
err = register_filesystem(&proc_fs_type);
if (err)
return;
proc_mnt = kern_mount_data(&proc_fs_type, &init_pid_ns);
err = PTR_ERR(proc_mnt);
if (IS_ERR(proc_mnt)) {
unregister_filesystem(&proc_fs_type);
return;
}
proc_symlink("mounts", NULL, "self/mounts");
proc_net_init();
#ifdef CONFIG_SYSVIPC
proc_mkdir("sysvipc", NULL);
#endif
proc_mkdir("fs", NULL);
proc_mkdir("driver", NULL);
proc_mkdir("fs/nfsd", NULL); /* somewhere for the nfsd filesystem to be mounted */
#if defined(CONFIG_SUN_OPENPROMFS) || defined(CONFIG_SUN_OPENPROMFS_MODULE)
/* just give it a mountpoint */
proc_mkdir("openprom", NULL);
#endif
proc_tty_init();
#ifdef CONFIG_PROC_DEVICETREE
proc_device_tree_init();
#endif
proc_mkdir("bus", NULL);
#if defined(CONFIG_MIPS_BRCM)
proc_brcm = proc_mkdir("brcm", NULL);
proc_brcm_init(proc_brcm);
#endif
proc_sys_init();
}
开发者ID:fr34k8,项目名称:DT_Hybrid_GPL_1.00.053,代码行数:44,代码来源:root.c
示例10: my_init
static int my_init (void) {
proc_mydev = proc_mkdir(MYDEV,0);
proc_hello = create_proc_entry(HELLO,0,proc_mydev);
proc_hello->read_proc = read_hello;
proc_hello->write_proc = write_hello;
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,29)
proc_hello->owner = THIS_MODULE;
#endif
hello_data.proc_hello_value=kmalloc(PROC_HELLO_BUFLEN,GFP_KERNEL);
hello_data.proc_hello_flag=0;
hello_data.proc_hello_bitpos=0;
// module init message
printk(KERN_ALERT "2470:5.6: main initialized!\n");
return 0;
}
开发者ID:yishengjiang99,项目名称:pr,代码行数:20,代码来源:bitops.c
示例11: proc_demo_init
int __init proc_demo_init(void){
printk("------------module init--------------------\n");
proc_entry_base = proc_mkdir(PROC_DIR_NAME, NULL);
proc_bin2dec_entry = proc_create(PROC_BIN2DEC_NAME, 0666, proc_entry_base, &proc_bin2dec_ops);
proc_readonly_entry = proc_create(PROC_READONLY_NAME, 0444, proc_entry_base, &proc_readonly_ops);
if(!(proc_entry_base || proc_bin2dec_entry || proc_readonly_entry)){
return -1;
}
printk("------------module init finish--------------------\n");
return 0;
}
开发者ID:jiangrunwu,项目名称:linux_driver,代码行数:20,代码来源:proc_mem-cdrv.c
示例12: psf_init
static int __init psf_init(void)
{
int i;
struct psf_entry *p;
int rc;
for (i = 0; i < ARRAY_SIZE(psf_table); i++) {
p = &psf_table[i];
if (p->size == -1) {
p->data = proc_mkdir(p->name, psf_parent(p));
BUG_ON(p->data == NULL);
} else {
rc = psf_create_file(p);
if (rc < 0)
return rc;
}
}
return 0;
}
开发者ID:mausvt,项目名称:seagate_central_cns3420_2-6-35,代码行数:20,代码来源:proc_static_files.c
示例13: proc_xm_init
static int __init proc_xm_init(void)
{
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *res;
struct proc_dir_entry *proc_xm_dir = NULL;
proc_xm_dir = proc_mkdir("xiaoqiang", NULL);
res = proc_create("model", 0444, proc_xm_dir,
&model_proc_fops);
if (!res)
return -ENOMEM;
res = proc_create("reset", 0444, proc_xm_dir,
&reset_proc_fops);
if (!res)
return -ENOMEM;
#endif
return 0;
}
开发者ID:AsingleMan,项目名称:miwifi,代码行数:20,代码来源:plat-xiaomi.c
示例14: ipv6_proc_init_net
static int __net_init ipv6_proc_init_net(struct net *net)
{
if (!proc_create("sockstat6", S_IRUGO, net->proc_net,
&sockstat6_seq_fops))
return -ENOMEM;
if (!proc_create("snmp6", S_IRUGO, net->proc_net, &snmp6_seq_fops))
goto proc_snmp6_fail;
net->mib.proc_net_devsnmp6 = proc_mkdir("dev_snmp6", net->proc_net);
if (!net->mib.proc_net_devsnmp6)
goto proc_dev_snmp6_fail;
return 0;
proc_dev_snmp6_fail:
remove_proc_entry("snmp6", net->proc_net);
proc_snmp6_fail:
remove_proc_entry("sockstat6", net->proc_net);
return -ENOMEM;
}
开发者ID:MaxChina,项目名称:linux,代码行数:20,代码来源:proc.c
示例15: ide_proc_port_register_devices
void ide_proc_port_register_devices(ide_hwif_t *hwif)
{
struct proc_dir_entry *ent;
struct proc_dir_entry *parent = hwif->proc;
ide_drive_t *drive;
char name[64];
int i;
ide_port_for_each_dev(i, drive, hwif) {
if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0)
continue;
drive->proc = proc_mkdir(drive->name, parent);
if (drive->proc)
ide_add_proc_entries(drive->proc, generic_drive_entries, drive);
sprintf(name, "ide%d/%s", (drive->name[2]-'a')/2, drive->name);
ent = proc_symlink(drive->name, proc_ide_root, name);
if (!ent) return;
}
}
开发者ID:mecke,项目名称:linux-2.6,代码行数:20,代码来源:ide-proc.c
示例16: proc_mali_register
void proc_mali_register(void)
{
mali_pentry = proc_mkdir("mali", NULL);
if (!mali_pentry)
return;
g_aee_workqueue = alloc_ordered_workqueue("mali_aeewp", WQ_FREEZABLE | WQ_MEM_RECLAIM);
INIT_WORK(&g_aee_work, aee_Handle);
proc_create("help", 0, mali_pentry, &kbasep_gpu_help_debugfs_fops);
proc_create("memory_usage", 0, mali_pentry, &kbasep_gpu_memory_usage_debugfs_open);
proc_create("utilization", 0, mali_pentry, &kbasep_gpu_utilization_debugfs_fops);
proc_create("frequency", 0, mali_pentry, &kbasep_gpu_frequency_debugfs_fops);
proc_create("dvfs_enable", S_IRUGO | S_IWUSR, mali_pentry, &kbasep_gpu_dvfs_enable_debugfs_fops);
// proc_create("input_boost", S_IRUGO | S_IWUSR, mali_pentry, &kbasep_gpu_input_boost_debugfs_fops);
// proc_create("dvfs_freq", S_IRUGO | S_IWUSR, mali_pentry, &kbasep_gpu_dvfs_freq_debugfs_fops);
// proc_create("dvfs_threshold", S_IRUGO | S_IWUSR, mali_pentry, &kbasep_gpu_dvfs_threshold_debugfs_fops);
// proc_create("dvfs_deferred_count", S_IRUGO | S_IWUSR, mali_pentry, &kbasep_gpu_dvfs_deferred_count_debugfs_fops);
}
开发者ID:John677,项目名称:Kernal_k3note,代码行数:20,代码来源:mtk_platform_common.c
示例17: rfs_proc_init
/*
* rfs_proc_init
*/
static int rfs_proc_init(void)
{
/*
* Create /proc/qrfs
*/
rfs_proc_entry = proc_mkdir("qrfs", NULL);
if (!rfs_proc_entry) {
RFS_ERROR("failed to register qrfs proc entry\n");
return -1;
}
rfs_debug_entry = proc_create("debug",
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH,
rfs_proc_entry, &debug_proc_fops);
rfs_enable_entry = proc_create("enable",
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH,
rfs_proc_entry, &enable_proc_fops);
return 0;
}
开发者ID:OpenHUE,项目名称:bsb002-lklm_qca-rfs,代码行数:23,代码来源:rfs_main.c
示例18: proc_mali_register
static void proc_mali_register(void)
{
struct proc_dir_entry *mt_elsuspend_entry = NULL;
mali_pentry = proc_mkdir("mali", NULL);
MALI_DEBUG_PRINT(1, ("[%s] pentry=%p\n", __FUNCTION__, mali_pentry));
if (!mali_pentry)
return;
proc_create("memory_usage", 0, mali_pentry, &proc_memoryusage_operations);
proc_create("cur_freq", 0, mali_pentry, &proc_curfreq_operations);
proc_create("utilization", 0, mali_pentry, &proc_utilization_operations);
mt_elsuspend_entry = create_proc_entry("earlysuspend", S_IRUGO | S_IWUSR | S_IWGRP, mali_pentry);
if (mt_elsuspend_entry)
{
mt_elsuspend_entry->read_proc = mali_early_suspend_debug_read;
mt_elsuspend_entry->write_proc = mali_early_suspend_register_write;
}
}
开发者ID:Proshivalskiy,项目名称:MT6582_kernel_source,代码行数:20,代码来源:mali_kernel_sysfs.c
示例19: icpld_proc_init
static int __init icpld_proc_init(void)
{
int i;
char nametemp[128];
proc_bus_cpld_dir = proc_mkdir("cpld", NULL);
if (!proc_bus_cpld_dir)
return -ENOMEM;
for (i=0; i<CPLD_REG_COUNT; i++)
{
cpldEntry[i]=create_proc_entry (cpldRegNames[i].name, 0666, proc_bus_cpld_dir);
if (!cpldEntry[i])
return -ENOMEM;
cpldEntry[i]->nlink = 1;
cpldEntry[i]->data = (void *)(&cpldRegNames[i].index);
cpldEntry[i]->read_proc = icpld_read_proc;
cpldEntry[i]->write_proc = icpld_write_proc;
sprintf(nametemp,"%s_setbit",cpldRegNames[i].name);
cpldEntrySetbit[i]=create_proc_entry (nametemp, 0666, proc_bus_cpld_dir);
if (!cpldEntrySetbit[i])
return -ENOMEM;
cpldEntrySetbit[i]->nlink = 1;
cpldEntrySetbit[i]->data = (void *)(&cpldRegNames[i].index);
cpldEntrySetbit[i]->write_proc = icpld_write_proc_setbit;
sprintf(nametemp,"%s_clrbit",cpldRegNames[i].name);
cpldEntryClrbit[i]=create_proc_entry (nametemp, 0666, proc_bus_cpld_dir);
if (!cpldEntryClrbit[i])
return -ENOMEM;
cpldEntryClrbit[i]->nlink = 1;
cpldEntryClrbit[i]->data = (void *)(&cpldRegNames[i].index);
cpldEntryClrbit[i]->write_proc = icpld_write_proc_clrbit;
}
return 0;
}
开发者ID:mcarrier,项目名称:reconn-linux,代码行数:41,代码来源:inhand-cpld.c
示例20: proc_device_tree_add_node
/*
* Process a node, adding entries for its children and its properties.
*/
void proc_device_tree_add_node(struct device_node *np,
struct proc_dir_entry *de)
{
struct property *pp;
struct proc_dir_entry *ent;
struct device_node *child;
const char *p;
set_node_proc_entry(np, de);
for (child = NULL; (child = of_get_next_child(np, child));) {
/* Use everything after the last slash, or the full name */
p = strrchr(child->full_name, '/');
if (!p)
p = child->full_name;
else
++p;
if (duplicate_name(de, p))
p = fixup_name(np, de, p);
ent = proc_mkdir(p, de);
if (ent == NULL)
break;
proc_device_tree_add_node(child, ent);
}
of_node_put(child);
for (pp = np->properties; pp != NULL; pp = pp->next) {
p = pp->name;
if (strchr(p, '/'))
continue;
if (duplicate_name(de, p))
p = fixup_name(np, de, p);
ent = __proc_device_tree_add_prop(de, pp, p);
if (ent == NULL)
break;
}
}
开发者ID:Core2idiot,项目名称:Kernel-Samsung-3.0...-,代码行数:44,代码来源:proc_devtree.c
注:本文中的proc_mkdir函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论