Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QProcess::startDetached instead of manually fork()-ing

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

Scheduled Pinned Locked Moved Solved General and Desktop
qprocessdaemon
1 Posts 1 Posters 976 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kshegunov
    Moderators
    wrote on 26 Apr 2016, 13:08 last edited by kshegunov
    #1

    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.

    Read and abide by the Qt Code of Conduct

    1 Reply Last reply
    0

    1/1

    26 Apr 2016, 13:08

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved