Solved

Detach from controlling tty in daemon process

Posted on 1998-10-30
2
819 Views
Last Modified: 2013-12-26
How can I detach from the controlling tty in a daemon process, in C?
0
Comment
Question by:gumby119
2 Comments
 
LVL 4

Accepted Solution

by:
davidmwilliams earned 200 total points
ID: 1293884
 The answer is to use ioctl, like this -

        int fd;
        fd = open ("/dev/tty", O_RDWR);
        ioctl (fd, TIOCNOTTY, 0);
        close (fd);

  This will do exactly what you want.
0
 

Author Comment

by:gumby119
ID: 1293885
That certainly did the trick !!!  Thanks !  And so quick - within minutes!  This service is great!
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
VB.NET how to use the Vertical ScrollBar 5 90
centeredAverage challenge 8 131
sumHeights  challenge 17 66
How to convert MFC::CString to UTF8 wchar_t* 10 142
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

910 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

25 Experts available now in Live!

Get 1:1 Help Now