question regarding windows and libc crate. I'm totally unfamiliar with this os and according to the list of supported platforms, libc should work on windows but I'm not sure about details. e.g. what would be if I ran libc::kill(pid, libc::SIGINT)? is this the same thing as running it on nix systems?

@alex.fedoseev
question regarding windows and libc crate. I'm totally unfamiliar with this os and according to the list of supported platforms, libc should work on windows but I'm not sure about details. e.g. what would be if I ran libc::kill(pid, libc::SIGINT)? is this the same thing as running it on nix systems?

hyeonu — Today at 9:42 AM
there's no libc::kill() on msvc target

pie_flavor — Today at 9:58 AM
on windows, libc is actually libc and not the platform api too
[9:59 AM]
the equivalent function is winapi::TerminateProcess

alex.fedoseev — Today at 10:03 AM
@hyeonuah right, I was confused by the presence of SIGINT in this target

@pie_flavor what is winapi? is it this crate? https://docs.rs/winapi/0.3.9/winapi/index.html
winapi - Rust
API documentation for the Rust `winapi` crate.

pie_flavor — Today at 10:04 AM
yes

gotcha. and what's the counterpart of  SIGKILL?(edited)

pie_flavor — Today at 10:05 AM
you know how you know nothing about windows
[10:05 AM]
guess what os I know next to nothing about
[10:07 AM]
what's sigkill vs sigint

alex.fedoseev — Today at 10:09 AM
sigint is what happens when user hits ctrl + c. it basically gives a chance to an app to clean up everything and exit. sigkill just kills the process.

pie_flavor — Today at 10:10 AM
okay. so TerminateProcess is the latter
[10:10 AM]
for the former it depends if it's a console app or a gui app
[10:10 AM]
for a gui app you send it WM_CLOSE with SendMessage(edited)
[10:12 AM]
for a console app you call GenerateConsoleCtrlEvent

alex.fedoseev — Today at 10:13 AM
gotcha, thanks a bunch!

pie_flavor — Today at 10:16 AM
you will find that Windows has a more advanced API with richer functionality, but at the cost of having to set up more scaffolding (e.g. the permission system around processes meaning that where nix would take pid_t, winapi takes the handle you get from OpenProcess)
