Opened 15 years ago

Closed 6 years ago

#85 closed enhancement (wontfix)

QProcess: Support P_SESSION

Reported by: Dmitry A. Kuminov Owned by:
Priority: minor Milestone: Qt 5
Component: QtCore Version: 4.5.1 Beta 2
Severity: medium Keywords:
Cc:

Description

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 Dmitry A. Kuminov 15 years ago.
Incomplete patch to libc-0.6 for P_SESSION

Download all attachments as: .zip

Change History (8)

comment:1 by Dmitry A. Kuminov, 15 years ago

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 by Dmitry A. Kuminov, 15 years ago

BT, here is the original kLIBC defect http://svn.netlabs.org/libc/ticket/121.

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.

by Dmitry A. Kuminov, 15 years ago

Attachment: P_SESSION.diff added

Incomplete patch to libc-0.6 for P_SESSION

comment:3 by Silvan Scherrer, 15 years ago

Priority: majorminor
Severity: medium

comment:4 by Dmitry A. Kuminov, 15 years ago

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 by Dmitry A. Kuminov, 15 years ago

Summary: QProcess: Support P_SESSION and P_DETACHQProcess: Support P_SESSION

comment:6 by Silvan Scherrer, 6 years ago

Milestone: Qt EnhancedQt 5

comment:7 by Dmitry A. Kuminov, 6 years ago

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.