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)
Mon, Jan 12, 10:44 AM
Unknown Object (File)
Dec 18 2025, 9:21 PM
Unknown Object (File)
Dec 13 2025, 9:40 PM
Unknown Object (File)
Dec 12 2025, 9:06 PM
Unknown Object (File)
Dec 4 2025, 3:28 AM
Unknown Object (File)
Dec 1 2025, 3:07 AM
Unknown Object (File)
Nov 30 2025, 4:32 PM
Unknown Object (File)
Nov 30 2025, 1:07 AM

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.