Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

people(2) [debian man page]

people(2)							System Calls Manual							 people(2)

NAME
people - fetch a structure containing all ttys, whose owner behaves like a human SYNOPSIS
#include <sys/people.h> #include <asr.h> int people (struct ppl_tty **ttys); DESCRIPTION
The people function fetches a short description of every tty, whose coupled process behaves as an actual human. It returns a newly malloc'ed array with just enough elements to contain all elements needed for this. The struct ppl_tty is declared as: struct ppl_tty { char tty_path[MAX_PATH_LENGTH]; int is_erratic; int uses_jobcontrol; int is_amoron; int is_aluser; int has_aclue; pid_t pgrp_leader; }; RETURN VALUES
On success people returns the number of elements in ttys , on failure it returns -1 and errno is set to an appropriate value. ERRORS
ENOENT There are no human-behavioured processes on the system EBUSY The kernel is busy and will not stand this silly behaviour. Caution to call people again, from the same process, as the kernel might kill it right away. ENODEV See ENOENT above. EUSERS Too many of the people found were lusers. The cut-off for this error is system dependent, but is usually about 3. EXAMPLE
#include <sys/people.h> #include <asr.h> #include <signal.h> int main (int argc, char **argv) { struct ppl_tty **ttys; int rv,c; rv=people(ttys); if (rv!=-1) { for (c=0;c<rv;c++) if ((ttys[c].is_amoron)||(ttys[c].is_aluser)) { kill(-(ttys[c].pgrp_leader),SIGKILL); } } else { ; /* Handle errors in a graceful way... */ } } AUTHOR
This man page was written by Ingvar Mattsson, as a contribution to the a.s.r man page collection. 4th Berkeley Distribution Release 0.01 alpha people(2)

Check Out this Related Man Page

TTYNAME(3)						   BSD Library Functions Manual 						TTYNAME(3)

NAME
isatty, ttyname, ttyslot -- get name of associated terminal (tty) from file descriptor LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <unistd.h> int isatty(int fildes); char * ttyname(int fildes); int ttyslot(void); DESCRIPTION
These functions operate on the system file descriptors for terminal type devices. These descriptors are not related to the standard I/O FILE typedef, but refer to the special device files found in /dev and named /dev/ttyxx and for which an entry exists in the initialization file /etc/ttys. (See ttys(5).) The isatty() function determines if the file descriptor fildes refers to a valid terminal type device. The ttyname() function gets the related device name of a file descriptor for which isatty() is true. The ttyslot() function fetches the current process' control terminal number from the ttys(5) file entry. RETURN VALUES
The ttyname() function returns the null terminated name if the device is found and isatty() is true; otherwise, a NULL pointer is returned. The ttyslot() function returns the unit number of the device file if found; otherwise, the value zero is returned. FILES
/dev/* /etc/ttys SEE ALSO
ioctl(2), ttys(5) HISTORY
A isatty(), ttyname(), and ttyslot() function appeared in Version 7 AT&T UNIX. BUGS
The ttyname() function leaves its result in an internal static object and returns a pointer to that object. Subsequent calls to ttyname() will modify the same object. BSD
June 4, 1993 BSD
Man Page

14 More Discussions You Might Find Interesting

1. What is on Your Mind?

First Job

Just wondering what other people where doing for there first Unix role. Mine was working with a ISP helpdesk (Windows support though I helped all the Linux people out whenever I could with support) :p then that went bust (One.Net if anyone knew of it) then I scored my first UNIX role. Working... (8 Replies)
Discussion started by: woofie
8 Replies

2. Shell Programming and Scripting

Repeating commands in a script

I have written a script that I want to be repeated. The script that I wrote outputs the date, how many people are on the system, how many people logged in before me, and how many people logged in after me. Than what I want it to do is after it outputs the 4 lines I want it to go back to the... (4 Replies)
Discussion started by: Dave2874
4 Replies

3. Shell Programming and Scripting

Parsing Lines from a text file

Hello Guru's I know there are people who live to be able to help people like me. That's why I'm here! I have a text file that has a corresponding address information that I need to be able to get maybe as a Unix Function. The text file contains the following: AIX17_JB_C;... (3 Replies)
Discussion started by: sallender
3 Replies

4. Shell Programming and Scripting

how to make a bash script that can be executed by people simultaneously?

dear friends, i want to make a bash script that can be executed by many people simultaneously. do you have any idea to make it? there will be many dependent-variables(which is input from people) in the scripts. i am thinking about a random temporary file that created by the bash script each... (4 Replies)
Discussion started by: jimmbp
4 Replies

5. What is on Your Mind?

observation...

That is one thing I find unusual about this forum, people post a list of program requirements and many people are happy to post complete solutions even though the person asking has shown no effort at all to solve the problem. Most other forums ( or the forum members anyway ) will not do that.... (9 Replies)
Discussion started by: KevinADC
9 Replies

6. Linux

There is anyone whu can be my MASTER, my Teacher, my Instractor and my Friend.,

Hellooo Salute to All. I am a mini poor STUDENT from a Thirldworld country for learning abt UNIX,MINIX,LINUX etc. I have not enough wisdom abt above topics. But I want to walk,run & fly in UNIX,Linux platform. But I studied in computer science degree...what i did'nt comple at all. Though i... (8 Replies)
Discussion started by: AhsanPrince
8 Replies

7. What is on Your Mind?

Finding people

Since this is a place for very smart, expert tech people I wanted to know if anyone knew a site or way to find accurate info on the whereabouts of relatives online. I am looking for a reputable site where I can find more then just last registered address. I need cell phone or recent email... (2 Replies)
Discussion started by: vedder191
2 Replies

8. HP-UX

how to know the no of people access a same file

how to know the no of people access a same file at a time? (1 Reply)
Discussion started by: megh
1 Replies

9. UNIX for Advanced & Expert Users

What to teach the new guy

so I have taken on the task of running a few workshops / teaching sessions. we have three new unix people, they have the basics sorted, CD, PWD, LS and such. we are looking at people who have been doing helpdesk untill two months ago. I have given them a few session: file systems, what... (2 Replies)
Discussion started by: robsonde
2 Replies

10. Programming

Homework question

i just need guidance in this please. people who will argue " homeworks are not allowed" , i just need help not solutions . thanks CEG433/CEG633 - Operating Systems please (1 Reply)
Discussion started by: evantheking
1 Replies

11. Shell Programming and Scripting

Validation of variable

Hey people, I got small little error which says I entered too many argument in the if else list. The stock contains a list of information. The 4th field consist of the quantity available, so I'm trying to alert the user that the stock is less than 3 and needed to restock. Is this the correct way... (7 Replies)
Discussion started by: aLHaNz
7 Replies

12. UNIX for Dummies Questions & Answers

Hiding history of my commands

i have several boxes running either ubuntu, redhat or solaris. there are multiple people with root access on these boxes. i really dont like people looking through my command history, is there a way i can prevent this? what files do i have to edit to prevent anyone from being able to see what... (7 Replies)
Discussion started by: SkySmart
7 Replies

13. Shell Programming and Scripting

awk logic

I am trying to check my logic on a long awk i'm using. I have about 30 checks that I built into an awk and I "believe" I did this right, but I could be wrong. awk -F\| ' $9 !~ /\/*{1,}*/ $9 ~ /\(-{4}, {2,3}/ $9 ~ /\({6}, {2,3}\)/ $9 ~ /\(\+{5}, {2,3}\)/ $9 ~ /\(\+\+{4}, {2,3}\)/ $9 ~... (8 Replies)
Discussion started by: dagamier
8 Replies

14. What is on Your Mind?

They won't need so many sys admins anymore

Nice eye catching title huh ;) I got laid off along with 55000 others from HP worldwide have been expecting this for some time and now it's finally my turn. Most of the folks I know get laid off at around this age of 40+ so do take note. Ideas that ran thru my head this last few weeks:... (16 Replies)
Discussion started by: sparcguy
16 Replies