LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-18-2004, 09:02 AM   #1
beginner16
Member
 
Registered: Nov 2003
Posts: 33

Rep: Reputation: 15
Diassociating process from control terminal


hi,I'm really stuck here

I started reading a book on network programming,but the problem is
that this book is for Unix systems and I run Linux.Furtunatelly,the
author spends some time describing Unix environment.But when it came
to Control terminals and diassociating daemons from them,I was lost.

For starters,Im not shure if I understand how terminal group ID in the
tty structure works.
Is each time a job-control shell forks a new process (foreground
job),the terminal group ID changed to refer to this job?Does that mean
that all other process groups associated with this terminal will be
blocked if they try to read or write to terminal?

Secondly,System V has a different method from 4.3BSD
In system V you call fork() and in child process you call setpgrp().I
tried it but when I checked ps -A ,process was still associated with
tty3

It worked with ioctl(fd,TIOCNOTTY,(char *)0);

so Im wondering why didn't call to setpgrp() manage to do the
same?Afterall,isn't the way to diassociate from Control terminal to
put process in process group whose group's ID is zero?
And that is what setpgrp() also did.

Does linux assign control terminal to process only if the process
group ID is zero (as is the case with 4.3DSD)?

thank you very much for taking the time
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CPU load -> process control? bobbens Debian 4 10-29-2004 01:43 PM
Process control...? kleptophobiac Linux - General 2 09-25-2004 10:03 AM
Quick process control question gauge73 Linux - Newbie 2 03-18-2004 12:37 PM
Reading thread/process control block murali Linux - General 0 09-05-2002 05:44 AM
Regaining Process Control mikeyt_333 Linux - General 5 03-21-2002 02:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration