Page MenuHomeFreeBSD

ping: Tell SIGQUIT to interrupt the system call
AbandonedPublic

Authored by jlduran on Feb 10 2023, 2:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 19 2024, 10:10 PM
Unknown Object (File)
Dec 17 2024, 4:57 PM
Unknown Object (File)
Nov 24 2024, 3:37 PM
Unknown Object (File)
Nov 13 2024, 6:07 PM
Unknown Object (File)
Oct 3 2024, 4:12 AM
Unknown Object (File)
Oct 3 2024, 12:40 AM
Unknown Object (File)
Oct 1 2024, 12:15 PM
Unknown Object (File)
Sep 30 2024, 1:50 PM

Details

Reviewers
asomers
Summary

Otherwise the statistics won't be printed.
Before:

# ping -4 localhost <PID 1234>
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.001 ms
Quit

In another terminal:

# kill -SIGQUIT 1234

After:

# ping -4 localhost <PID 1234>
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.001 ms

--- localhost ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.001/0.001/0.001/0.000 ms

In another terminal:

# kill -SIGQUIT 1234

Obtained from: Darwin

Test Plan

I don't know how to easily add tests for interrupts, but a simple:

kill -SIGQUIT <PID>

will do.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Philosophically, SIGQUIT is different than SIGINT. It's more like "I the programmer have determined that this program is behaving badly, and would like a core dump". But I could go either way, if people disagree with me here.

Philosophically, SIGQUIT is different than SIGINT. It's more like "I the programmer have determined that this program is behaving badly, and would like a core dump". But I could go either way, if people disagree with me here.

I have added a before/after to the summary. The idea is basically to also dump the statistics, as those could be valuable.

This revision now gets in the middle of a more important one. Let's abandon it... if there is interest, revisit.