这篇教程C++ sys_sync函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中sys_sync函数的典型用法代码示例。如果您正苦于以下问题:C++ sys_sync函数的具体用法?C++ sys_sync怎么用?C++ sys_sync使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了sys_sync函数的23个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: pm_autosleep_set_stateint pm_autosleep_set_state(suspend_state_t state){#ifndef CONFIG_HIBERNATION if (state >= PM_SUSPEND_MAX) return -EINVAL;#endif __pm_stay_awake(autosleep_ws); mutex_lock(&autosleep_lock); autosleep_state = state; __pm_relax(autosleep_ws); if (state > PM_SUSPEND_ON) { pm_wakep_autosleep_enabled(true); queue_up_suspend_work();#ifndef CONFIG_PM_SYNC_BEFORE_SUSPEND printk(KERN_INFO "PM: Syncing filesystems ... "); sys_sync(); printk("done./n");#endif } else { pm_wakep_autosleep_enabled(false); } mutex_unlock(&autosleep_lock); return 0;}
开发者ID:sombree,项目名称:Hulk-Kernel-V2,代码行数:31,
示例2: lge_dump_kernel_logstatic void lge_dump_kernel_log(){ extern int log_buf_copy(char *dest, int idx, int len); char log_buf[1024]; int idx = 0; int cnt; int h_file = 0; mm_segment_t oldfs = get_fs(); set_fs(KERNEL_DS); h_file = sys_open("/data/panic.txt", O_RDWR|O_CREAT,0644); if(h_file >= 0) { for (;;) { cnt = log_buf_copy(log_buf, idx, 1023); if (cnt <= 0) break; // WBT 20110314 [START] log_buf[cnt] = 0; // WBT 20110314 [END] sys_write(h_file,log_buf,cnt); idx += cnt; } sys_close(h_file); } else { printk("Can't open log file ret = %d./n",h_file); } sys_sync(); set_fs(oldfs);}
开发者ID:c-ong,项目名称:LGP925_Kernel,代码行数:34,
示例3: hom_prepare/** * hom_prepare - Do prep work before entering low-power state. * * This is common code that is called for each state that we're entering. * Run suspend notifiers, allocate a console and stop all processes. */static int hom_prepare(void){ int error; pm_prepare_console(); error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE); if (error) goto Exit; error = usermodehelper_disable(); if (error) goto Exit; pr_info("PM: Syncing filesystems ... "); sys_sync(); pr_info("done./n"); error = prepare_processes(); if (!error) return 0; usermodehelper_enable();Exit: pm_notifier_call_chain(PM_POST_HIBERNATION); pm_restore_console(); return error;}
开发者ID:highzeth,项目名称:satip-axe,代码行数:35,
示例4: hibernateint hibernate(void){ int error; mutex_lock(&pm_mutex); /* The snapshot device should not be opened while we're running */ if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { error = -EBUSY; goto Unlock; } error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE); if (error) goto Exit; /* Allocate memory management structures */ error = create_basic_memory_bitmaps(); if (error) goto Exit; printk("Syncing filesystems ... "); sys_sync(); printk("done./n"); error = prepare_processes(); if (error) goto Finish; if (hibernation_mode == HIBERNATION_TESTPROC) { printk("swsusp debug: Waiting for 5 seconds./n"); mdelay(5000); goto Thaw; } error = hibernation_snapshot(hibernation_mode == HIBERNATION_PLATFORM); if (in_suspend && !error) { unsigned int flags = 0; if (hibernation_mode == HIBERNATION_PLATFORM) flags |= SF_PLATFORM_MODE; pr_debug("PM: writing image./n"); error = swsusp_write(flags); swsusp_free(); if (!error) power_down(); } else { pr_debug("PM: Image restored successfully./n"); swsusp_free(); } Thaw: unprepare_processes(); Finish: free_basic_memory_bitmaps(); Exit: pm_notifier_call_chain(PM_POST_HIBERNATION); atomic_inc(&snapshot_device_available); Unlock: mutex_unlock(&pm_mutex); return error;}
开发者ID:acassis,项目名称:emlinux-ssd1935,代码行数:59,
示例5: poweroffstatic void poweroff(struct work_struct *work){ synchronous_emergency_remount(); sys_sync(); printk(KERN_EMERG "Filesystems synced./n"); kernel_power_off();}
开发者ID:egonalter,项目名称:R-Link_kernel,代码行数:8,
示例6: do_restartstatic void do_restart(void){#if defined(CONFIG_POWER_KEY_CLR_RESET) clear_hw_reset();#endif sys_sync(); machine_restart("power-key-force-hard");}
开发者ID:qriozum,项目名称:M9,代码行数:8,
示例7: panicNORET_TYPE void panic(const char * fmt, ...){ static char buf[1024]; va_list args;#if defined(CONFIG_ARCH_S390) unsigned long caller = (unsigned long) __builtin_return_address(0);#endif bust_spinlocks(1); va_start(args, fmt); vsprintf(buf, fmt, args); va_end(args); printk(KERN_EMERG "Kernel panic: %s/n",buf); if (in_interrupt()) printk(KERN_EMERG "In interrupt handler - not syncing/n"); else if (!current->pid) printk(KERN_EMERG "In idle task - not syncing/n"); else sys_sync(); bust_spinlocks(0);#ifdef CONFIG_SMP smp_send_stop();#endif notifier_call_chain(&panic_notifier_list, 0, NULL); if (panic_timeout > 0) { /* * Delay timeout seconds before rebooting the machine. * We can't use the "normal" timers since we just panicked.. */ printk(KERN_EMERG "Rebooting in %d seconds..",panic_timeout); mdelay(panic_timeout*1000); /* * Should we run the reboot notifier. For the moment Im * choosing not too. It might crash, be corrupt or do * more harm than good for other reasons. */ machine_restart(NULL); }#ifdef __sparc__ { extern int stop_a_enabled; /* Make sure the user can actually press L1-A */ stop_a_enabled = 1; printk("Press L1-A to return to the boot prom/n"); }#endif#if defined(CONFIG_ARCH_S390) disabled_wait(caller);#endif sti(); for(;;) { CHECK_EMERGENCY_SYNC }}
开发者ID:hugh712,项目名称:Jollen,代码行数:58,
|