Opened 10 years ago

Closed 10 months ago

#85 closed enhancement (wontfix)

QProcess: Support P_SESSION

Reported by: dmik Owned by:
Priority: minor Milestone: Qt 5
Component: QtCore Version: 4.5.1 Beta 2
Severity: medium Keywords:


Currently, the necessary P_SESSION and P_DETACH functionality in QProcess is implemented using workarounds which proxy the calls through "cmd.exe /c" (see #72). This is done so because kLIBC 0.6.3 doesn't support P_SESSION and P_DETACH.

Later, we plan to apply a patch to kLIBC that adds support for these execution modes and make use of them in QProcess. This defect is to track this plan.

Attachments (1)

P_SESSION.diff (17.5 KB) - added by dmik 10 years ago.
Incomplete patch to libc-0.6 for P_SESSION

Download all attachments as: .zip

Change History (8)

comment:1 Changed 10 years ago by dmik

For the record: the main (the only?) limitation of the current workarounds is that they return an incorrect PID, which is a PID of CMD.EXE instead of a PID of the target application (which is usually greater by 1, but not necessary). This is not expected by Qt applications and may break possible custom IPC communications if they rely on PIDs.

comment:2 Changed 10 years ago by dmik

BT, here is the original kLIBC defect

Also, I'm attaching my current patch that adds P_SESSION support to the libc-0.6 branch of kLIBC. Note that the patch is a work in progress. P_SESSION works, inheritance works, but SIGCHLD and wait()/waitpid() won't work for processes started with P_SESSION yet. In order to implement that, we will most likely need a worker thread that will watch the system queue attached to the children created in separate sessions and deliver SIGCHILD when they die as well as provide wait()/waitpid() support.

Changed 10 years ago by dmik

Incomplete patch to libc-0.6 for P_SESSION

comment:3 Changed 10 years ago by diver

  • Priority changed from major to minor
  • Severity set to medium

comment:4 Changed 10 years ago by dmik

Actually, I reimplemented QProcess::startDetached() in r484 which was simply broken, by using DosStartSession?() directly. This means we don't need P_DETACH any more (which was not suitable anyway because in QProcess detached doesn't mean the absence of the input and output from the program, it only means the independence from the parent in terms of signals, file handles, termination etc.).

So the P_SESSION implementation in kLIBC for starting PM apps from text mode apps (and vice versa) with inheritance and friends (see the above comments) is the only remaining issue.

comment:5 Changed 10 years ago by dmik

  • Summary changed from QProcess: Support P_SESSION and P_DETACH to QProcess: Support P_SESSION

comment:6 Changed 14 months ago by diver

  • Milestone changed from Qt Enhanced to Qt 5

comment:7 Changed 10 months ago by dmik

  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.