Solved

Some Questions on : process, poll, pollfd

Posted on 2001-09-12
3
404 Views
Last Modified: 2006-11-17
Hi All
 
I have some questions :
 
1. Can I change the owner of the process? Suppose I execute a program.
    pid = 1234
    process owner = "x"
   
    then I fork the process.
    pid of child = 12345
 
    Now I kill the parent.(1234). parent of 1235 is "1" now (init process). but owner still remains the same.. "x". can I change it to y?
 
2. what does POLLHUP signify in poll system call? does somebody have a piece of code that can emulate this??? when will I get POLLHUP as in reevent member of pollfd structure?
 
3. what is the significance of events & revents members of pollfd??? any program that emulates "all/most of" the conditions of poll will be really great.
 
Regards
 
Ajay
0
Comment
Question by:avi_india
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
chris_calabrese earned 100 total points
ID: 6477724
1.  Only processes running as uid 0 (i.e., 'root') can change their uid.
 This is done with the setuid() system call.

2.  According the poll() man page, it happens when you're trying to access a device that's been physically disconnected..

3.  The significance of event and revent is that these are the structures
used to pass the list of things you want to poll for and where you find
out what actually happened respectively.

Don't have any code, but check the man pages.  The man page for poll
has excellent examples on every system I've seen.
0
 

Author Comment

by:avi_india
ID: 6478440
Thanks Chris....

About 2nd point my main concern is that in real scenario when this actually would happen??? i.e. if I've made a poll call, then when will I get POLLHUP?

0
 
LVL 14

Expert Comment

by:chris_calabrese
ID: 6480075
Say you're reading a file on a CD-ROM and someone ejects the CD...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Virtualizing TAPE on dual VIOS 3 75
ftpcommand 2 56
Write an app 10 66
SCP a file to multiple machines using a script 4 16
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now