位置:首页 > 其他技术 > Unix/Linux系统调用 > idle()函数 Unix/Linux

idle()函数 Unix/Linux

idle - 使进程 0 空闲

内容简介

#include <unistd.h>

int idle(void);

描述

idle() is an internal system call used during bootstrap. It marks the process’s pages as swappable, lowers its priority, and enters the main scheduling loop. idle() never returns.

Only process 0 may call idle(). Any user process, even a process with superuser permission, will receive EPERM.

返回值

idle() never returns for process 0, and always returns -1 for a user process.

错误

标签 描述
EPERM Always, for a user process.

遵循于

This function is Linux-specific, and should not be used in programs intended to be portable.

注意

Since 2.3.13 this system call does not exist anymore.