QProcess::startDetached instead of manually fork()-ing


  • Qt Champions 2016

    Hello,
    I'm developing a daemon, however I don't want to use daemon() because it causes exit() to be called in the parent process; I want to continue on and eventually perform some cleanup. Now, I know that I can use fork() and do the usual magic, but I was wondering whether I could use QProcess::startDetached instead of that?
    Looking at the source it seems that it should work as I want. Am I correct in assuming that the said static function will detach the child process from the controlling terminal (I think it should but would like a confirmation from someone more experienced than myself)?

    Thanks in advance.
    Kind regards.

    EDIT:
    I seem to have missed the note in the documentation, which clearly states it will work as I expect, so the question is actually irrelevant.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.