Closed
Bug 348399
Opened 19 years ago
Closed 19 years ago
There is no way to get a PRProcess* from an existing PID
Categories
(NSPR :: NSPR, enhancement)
Tracking
(Not tracked)
RESOLVED
WONTFIX
4.7
People
(Reporter: julien.pierre, Unassigned)
Details
Attachments
(1 file)
8.36 KB,
patch
|
Details | Diff | Splinter Review |
NSPR offers some useful portable functions for process manipulation, such as PR_WaitProcess and PR_KillProcess . These functions require a PRProcess* . This is a platform-specific, opaque structure.
The only way to currently obtain one of those structures is to create the process from PR_CreateProcess, that is, from the parent process that created the child.
In some cases, process manipulation is needed from another process than the immediate parent. I'm proposing a new function :
PRProcess* PR_GetProcessFromPID(PRUint64 pid);
I believe PRUint64 should be large enough to handle the size of a PID on all our currently supported platforms.
Reporter | ||
Updated•19 years ago
|
Assignee: wtchang → julien.pierre.bugs
Reporter | ||
Comment 1•19 years ago
|
||
I took a quick stab at fixing this on Solaris. I was able to make PR_KillProcess work on non-child processes, but I can't get PR_WaitProcess to work because the waitpid system call it relies on only operates on child processes.
Reporter | ||
Comment 2•19 years ago
|
||
This is a patch that attempts to implement the RFE for Unix pthread platforms, including a test program. Unfortunately, it fails because there is no way to wait for uan unrelated process.
Reporter | ||
Updated•19 years ago
|
Assignee: julien.pierre.bugs → nobody
Comment 3•19 years ago
|
||
Marked the bug WONTFIX. It's not easy to design a
cross-platform process management API for two reasons.
1. On Unix the SIGCHLD signal is only sent to the parent
process, and only the parent process can call one of the
wait* functions to reap the terminated child process.
2. It's inappropriate for NSPR (a library) to own the
SIGCHILD signal handler, which is process-wide.
This is why I stopped further development of the PRProcess
API in NSPR. NSPR-based applications may write platform
specific code to create and manage processes.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → WONTFIX
Target Milestone: --- → 4.7
You need to log in
before you can comment on or make changes to this bug.
Description
•