?? idle.c
字號:
/* * This file is part of John the Ripper password cracker, * Copyright (c) 1996-99 by Solar Designer */#include <unistd.h>#ifdef __linux__#include <sched.h>#ifndef SCHED_IDLE#define SCHED_IDLE 3#endifstatic int use_yield = 0;#endif#ifdef __CYGWIN32__extern int nice(int);#endif#include "params.h"#include "config.h"#include "options.h"void idle_init(void){#ifdef __linux__ struct sched_param param = {0};#endif if (!cfg_get_bool(SECTION_OPTIONS, NULL, "Idle")) return; if (options.flags & FLG_STDOUT) return; nice(20);#ifdef __linux__ use_yield = sched_setscheduler(getpid(), SCHED_IDLE, ¶m) ? 1 : 2;#endif}void idle_yield(int always){#ifdef __linux__ if (use_yield) if (use_yield == 1 || always) sched_yield();#endif}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -