Conversation
On UN*Xes, if The The The Single UNIX Specification requires that The QNX 8.0 documentation for So I'm not surprised that tcpdump (and the libpcap |
|
Thank you for the comment, signal handling is a demanding subject, which may also be a reason why QNX is not entirely SUS-compliant in this department. |
It's not required by POSIX/the SUS; it was originally a later BSDism ("later" as in "not in 4.2BSD or even whichever earlier 4BSD introduced the TENEXisms into the tty driver), and I think only shows up in derivatives of that later BSD, i.e. FreeBSD/NetBSD/OpenBSD/DragonFly BSD/CupertinoBSD. It's not in Linux, for example. |
|
The code compiles, but something isn't quite right somewhere. One time after Ctrl-C I observed this instead of the final packet stats at the end: Another time (with ping running in the background) capturing This certainly requires more testing at least to say what works and what does not, but to be able to debug this code it would be necessary to compile it in the first place anyway. |
|
That sounds as if whatever indication ( The main-branch version of tcpdump's That means that, if the interrupt hits while writing out packet dissections - or, perhaps, while writing raw packets in pcap format to a pipe - tcpdump might repair that as an error. In systems whose
However, the write's probably being done as a flush of the So this raises a bunch of issues about signals. And that's just on UN*X. At least on UN*X, we can specify whether writes will be interrupted or restarted, on a per-signal basis, but that's what See also issue #997/pull request #998, issue #1231, issue #840, issue #638/pull request #752, (And then there's pull request #570 - unfortunately, on non-4.4BSD-flavored systems, we have only two signals to implement the three operations "print info", "flush out the buffer for the current output file", and "rotate files". Oy.) And it's all different on Windows. |
|
It seems a good starting point to mention some likely side effects of the missing |
Same as in libpcap. Before: checking for gethostbyaddr... no checking for gethostbyaddr in -lsocket... no checking for gethostbyaddr in -lnetwork... no configure: error: gethostbyaddr is required, but wasn't found After: checking for gethostbyaddr... no checking for gethostbyaddr in -lsocket... no checking for gethostbyaddr in -lnetwork... no checking for gethostbyaddr in -lsocket... yes
QNX SDP 8.0.3, cross-compiling for AArch64. tcpdump.c:3030:32: error: 'SA_RESTART' undeclared (first use in this function); did you mean 'ERESTART'?
28440a0 to
e76a16d
Compare
|
Rebased on top of the cross-compiling support and has been build-matrix-tested (i.e. builds free of compiler warnings) using QNX SDP. I do not have a good solution to the signals problem, but tcpdump that does not handle signals perfectly, but runs, seems better that tcpdump that does not build. So this is is going to be merged soon unless anyone stops me. |
I won't stop you. :-) Looks fine to me. |
The
SA_RESTARTworkaround has not been tested in any regard, other than it unblocks building of tcpdump and the resulting executable seems to work as expected.