Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

idle(2) [linux man page]

IDLE(2) 						     Linux Programmer's Manual							   IDLE(2)

NAME
idle - make process 0 idle SYNOPSIS
#include <unistd.h> int idle(void); DESCRIPTION
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. RETURN VALUE
idle() never returns for process 0, and always returns -1 for a user process. ERRORS
EPERM Always, for a user process. VERSIONS
Since 2.3.13 this system call does not exist anymore. CONFORMING TO
This function is Linux-specific, and should not be used in programs intended to be portable. COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 1994-08-21 IDLE(2)

Check Out this Related Man Page

GETSID(2)						     Linux Programmer's Manual							 GETSID(2)

NAME
getsid - get session ID SYNOPSIS
#include <unistd.h> pid_t getsid(pid_t pid); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): getsid(): Since glibc 2.12: _POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED Before glibc 2.12: _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED DESCRIPTION
getsid(0) returns the session ID of the calling process. getsid(p) returns the session ID of the process with process ID p. (The session ID of a process is the process group ID of the session leader.) RETURN VALUE
On success, a session ID is returned. On error, (pid_t) -1 will be returned, and errno is set appropriately. ERRORS
EPERM A process with process ID p exists, but it is not in the same session as the calling process, and the implementation considers this an error. ESRCH No process with process ID p was found. VERSIONS
This system call is available on Linux since version 2.0. CONFORMING TO
SVr4, POSIX.1-2001. NOTES
Linux does not return EPERM. SEE ALSO
getpgid(2), setsid(2), credentials(7) COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2010-09-20 GETSID(2)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script for killing idle users

I need a script that will look for idle users and kill there proc. (7 Replies)
Discussion started by: jdel80
7 Replies

2. Shell Programming and Scripting

finding idle time of a process

Matez, I have a list of process id's in a text file. I want to know how to find the idle time of a process which are more than 300secs and kill them accordingly. Could you please help me to get these details. I want to write a shell script with this. Thanks..Krish :) (36 Replies)
Discussion started by: Krrishv
36 Replies

3. UNIX for Advanced & Expert Users

any way to commit idle tasks in unix?

I need to do some code benchmarking in unix. On windows, it is always recommended that before you run any kind of benchmark, that you execute the command Rundll32.exe advapi32.dll,ProcessIdleTasks which commits idle tasks, so that hopefully this does not happen in the middle of your benchmark... (9 Replies)
Discussion started by: fabulous2
9 Replies

4. HP-UX

kill idle users

Hi, In my network we uses the NetTerm program to connect us to HP-UX 10.x server from windows workstations, but in some cases the user doesn't logout and close it by window's x button. The problem is that in HP-UX the user and all his tasks remain active and when he enter again HP-UX creates a... (12 Replies)
Discussion started by: efrenba
12 Replies

5. Shell Programming and Scripting

User Idle Time

Does anyone know how do you determine the user idle time of stdin in order to log the user out for being idle too long. I would like to write a c program to do this but I it is not clear upon how to determine idle time from keyboard input. (9 Replies)
Discussion started by: cpaquette
9 Replies

6. Solaris

Every session is expiring within 1 minute if it kept idle.

Hi, I am accessing a solaris server via client machine. My problem is that every session is expiring within 1 minute if it kept idle. I am facing problem as i have to enter the credentials around 30 to 40 times per day. I tried to set the TMOUT variable but it does n't work. Please help... (7 Replies)
Discussion started by: vamshikrishnab
7 Replies

7. Programming

How to lock own console when idle?

Newbie here, have looked using search engine and can find nothing revelant to my problem.. Using Linux Here, I want to create a unix daemon (using C) that run to check user idle time, then if the idle time match the timeout, that console will be locked automatically (user need to enter... (14 Replies)
Discussion started by: develop_5889
14 Replies

8. UNIX for Dummies Questions & Answers

CPU 0% idle - how do I find what was running?

Hi, I checking yesterday's SAR logs for one of our servers and it was showing that utilisation was down to 0% for 10 minutes at 2am. We're unaware of any jobs running at this time so need to find out which process caused this spike. Is there anything built into SAR (or does anything else exist)... (11 Replies)
Discussion started by: dlam
11 Replies

9. Solaris

Logging out idle users after a certain timeframe

We recently underwent a security audit and have a new requirement to not allow users to stay logged on overnight. In order to place this policy into effect i need a way to check for idle users and log them off. Is there any good way to enforce this policy in Solaris 10 and make it work in such a... (11 Replies)
Discussion started by: goose25
11 Replies

10. Red Hat

Mouse freezing after idle time

Hi All, I am having a problem where my mouse (USB) is freezing after some idle time, and I am having to reboot everytime that happens. I looked in the file /etc/X11/xorg.config to see if there is an entry for mouse and I could not find it. Instead I found the following entry: Section... (8 Replies)
Discussion started by: jxh461
8 Replies

11. AIX

Background & is considered as Idle

Our Aix Unix has one issue. If I type xedit & after 30 minutes, xedit auto shut down. If I type xedit xedit will run forward. I feel this & doesn't perform as it should be. When I use &, system consider this process as idle. How to fix this issue? Does this mean unix env... (12 Replies)
Discussion started by: david_hu_66
12 Replies

12. Shell Programming and Scripting

User idle time and kill

Hello.. I have many sleepy users on my Solaris box and need to kill them if they are idle for more than 45 minutes for example...I know who -u gives and the idle time but unable to make a awk line to get the condition perfect. Please help...:wall: (9 Replies)
Discussion started by: wimaxpole
9 Replies

13. Solaris

sftp connection closes if idle for around 10minutes

does sftp connection closes by default if it stays idle for a prolonged time ? i have checked sshd_config files , there is no time out value set. but still the connection closes after certain period of time. Please help. verbose mode output : sftp> debug1: channel 0: free:... (10 Replies)
Discussion started by: chidori
10 Replies

14. UNIX for Dummies Questions & Answers

What is %idle means in SAR?

Hi what does %idle reflect in SAR command suppose SAR commamd is showing idle as 90% does it means sytem is fine or sytem is in danger state. below is the o/p of sar command and %idle is 90 then what does its means. sar 1 4 AIX ab41cp01 3 5 000B3E0AD400 01/01/15... (17 Replies)
Discussion started by: scriptor
17 Replies

15. AIX

Telnet sessions stay as idle users

Hi The telnet sessions stay as idle users. It is not getting kicked out. Please advise what could be the issue. only when we reboot the server these telnet sessions goes. Below is the current output from the server. we rebooted the server three days ago: pmut6:/> uptime 04:21PM... (8 Replies)
Discussion started by: newtoaixos
8 Replies