Skip to content

os: Add proper process termination in Linux#20671

Merged
spytheman merged 10 commits intovlang:masterfrom
SewerynKaminski:master
Jan 27, 2024
Merged

os: Add proper process termination in Linux#20671
spytheman merged 10 commits intovlang:masterfrom
SewerynKaminski:master

Conversation

@SewerynKaminski
Copy link
Copy Markdown
Contributor

There is only signal_kill() option to terminate a process wich is not working.
The proper way is to send TERM signal.

@spytheman spytheman added os.Process Bugs related to the os.Process implementation Bug This tag is applied to issues which reports bugs. labels Jan 27, 2024
@spytheman spytheman assigned spytheman and unassigned spytheman Jan 27, 2024
@spytheman
Copy link
Copy Markdown
Contributor

You have to also add shims for unix_kill_process to vlib/os/process_windows.c.v, and then v fmt -w vlib/os .

@spytheman spytheman marked this pull request as draft January 27, 2024 10:12
@SewerynKaminski SewerynKaminski marked this pull request as ready for review January 27, 2024 10:13
@spytheman
Copy link
Copy Markdown
Contributor

A shim for unix_term_process should be also added to vlib/os/process_windows.c.v, and a shim for win_term_process should be also added to vlib/os/process_nix.c.v. See the bottom of those files.

The current implementation is a bit convoluted, but it is needed to make the generation of the vc/v.c and vc/v_win.c (bootstrapping) reliable.

@SewerynKaminski
Copy link
Copy Markdown
Contributor Author

OK. I missed it :) Corrected.

Comment thread vlib/os/process.c.v Outdated
Fix returns
@SewerynKaminski SewerynKaminski marked this pull request as draft January 27, 2024 19:44
@SewerynKaminski SewerynKaminski marked this pull request as ready for review January 27, 2024 19:45
Copy link
Copy Markdown
Contributor

@spytheman spytheman left a comment

Choose a reason for hiding this comment

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

Excellent work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug This tag is applied to issues which reports bugs. os.Process Bugs related to the os.Process implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants