Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Process.ppid on Windows #13140

Merged

Conversation

HertzDevil
Copy link
Contributor

The affected spec is still pending because it uses the Signal::KILL stub, which is removed as part of #13131.

Also note that since Windows does not re-parent orphaned processes, it is entirely possible for those parent-child IDs to form loops.

@@ -37,6 +37,10 @@ class Process
end

# Returns the process identifier of the parent process of the current process.
#
# On Windows, the parent is associated only at process creation time, and the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# On Windows, the parent is associated only at process creation time, and the
# NOTE: On Windows, the parent is associated only at process creation time, and the

@straight-shoota
Copy link
Member

straight-shoota commented Mar 13, 2023

@HertzDevil #13131 is merged, so the spec can be enabled.

I suppose the double exclusion from pending_win32 and {% unless flag?(:win32) %} is intentional? Could you please add a code comment why that expectation is disabled on Windows?

src/crystal/system/win32/process.cr Outdated Show resolved Hide resolved
@straight-shoota straight-shoota added this to the 1.8.0 milestone Mar 14, 2023
@straight-shoota straight-shoota merged commit f505337 into crystal-lang:master Mar 15, 2023
@HertzDevil HertzDevil deleted the feature/windows-process-ppid branch March 15, 2023 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants