Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Some Questions on : process, poll, pollfd

Posted on 2001-09-12
3
Medium Priority
?
454 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
chris_calabrese earned 300 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

609 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