Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for std::process::id #44971
Comments
TimNN
added
C-feature-request
T-libs
labels
Oct 3, 2017
This comment has been minimized.
This comment has been minimized.
|
Seems reasonable to add! |
This comment has been minimized.
This comment has been minimized.
|
|
tmccombs
added a commit
to tmccombs/rust
that referenced
this issue
Oct 6, 2017
tmccombs
added a commit
to tmccombs/rust
that referenced
this issue
Oct 6, 2017
tmccombs
added a commit
to tmccombs/rust
that referenced
this issue
Oct 6, 2017
kennytm
added a commit
to kennytm/rust
that referenced
this issue
Oct 25, 2017
bors
closed this
in
#45059
Oct 26, 2017
sfackler
reopened this
Nov 19, 2017
This comment has been minimized.
This comment has been minimized.
|
Reopening as the tracking issue. |
sfackler
added
B-unstable
and removed
C-feature-request
labels
Nov 19, 2017
This comment has been minimized.
This comment has been minimized.
|
While porting Rust over to CloudABI, a sandboxed UNIX-like runtime environment, I ran into the issue that there is no way for me to implement this function. As we're aiming to use CloudABI in distributed settings, there is no traditional 16/32-bit process identifier. Instead, processes may be identified by a UUID. This is useful, as integer process identifiers can easily collide when dealing with many instances of a job (due to the birthday paradox). As this function was only introduced recently, would it still be possible to alter it to return an opaque, but displayable data type instead? That said, almost all of the other functions provided by this module are also broken on CloudABI. The traditional |
This comment has been minimized.
This comment has been minimized.
|
I'm opposed a completely opaque data type, because that limits the usefulness. For example, that makes it difficult to use in C (or dbus) that require a PID. However, I think it would be alright if the it was a semi-opaque type with OS-specific API's to get the underlying representation (in std::os::unix, etc). However, that would break consistency with |
This comment has been minimized.
This comment has been minimized.
|
As @tmccombs has mentioned, the ship has already sailed here due to |
This comment has been minimized.
This comment has been minimized.
|
One thing that would be low-hanging fruit would be to at least have some kind of type alias for this. On UNIX/Windows, it could be defined as |
XAMPPRocky
added
the
C-enhancement
label
Jan 22, 2018
This comment has been minimized.
This comment has been minimized.
|
Given this:
and this:
I’m inclined to stabilize @rfcbot fcp merge Hopefully the portability lint can eventually help a CloudABI port to "cleanly" implement this differently, or not at all. |
rfcbot
added
the
proposed-final-comment-period
label
Mar 17, 2018
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Mar 17, 2018
•
|
Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
SimonSapin
changed the title
getpid function
Tracking issue for std::process::id
Mar 17, 2018
rfcbot
added
final-comment-period
and removed
proposed-final-comment-period
labels
Mar 19, 2018
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Mar 19, 2018
|
|
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Mar 29, 2018
|
The final comment period is now complete. |
tmccombs commentedOct 2, 2017
The standard library provides a way to get the process id of a child process with
std::process::Child::id(), but doesn't have any way to get the current processes id (the equivalent ofgetpid).It is possible to do this with
libc::getpid, but it seems to me that this should be something that is part of the standard library, especially since it already has cross-platform support for process ids of child processes.