diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-09-03 14:03:53 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-09-03 14:03:53 -0700 |
commit | bf468d8027b1dc3933f91f7588f25cf5e0a5ff30 (patch) | |
tree | d7f004e63c0bc44b0d6f0e0727183bcee758e9d6 /machdep.c | |
parent | f2e17bb1673b6c1c9d62ea51625aef920d7252d2 (diff) | |
download | tcpdump-bf468d8027b1dc3933f91f7588f25cf5e0a5ff30.tar.gz |
Clarify what abort_on_misalignment() does.
It doesn't request byte misalignment repair, it requests that byte
misalignment kill the program with SIGBUS; on platforms that don't
support aligned loads, we should be fetching possibly-misaligned data
using some safe instruction sequence, not by doing misaligned loads and
relying on them to trap to the kernel and be (slowly) emulated.
Diffstat (limited to 'machdep.c')
-rw-r--r-- | machdep.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -50,6 +50,15 @@ int snprintf(char *, size_t, const char *, ...) #include "machdep.h" +/* + * On platforms where the CPU doesn't support unaligned loads, force + * unaligned accesses to abort with SIGBUS, rather than being fixed + * up (slowly) by the OS kernel; on those platforms, misaligned accesses + * are bugs, and we want tcpdump to crash so that the bugs are reported. + * + * The only OS on which this is necessary is DEC OSF/1^W^WDigital + * UNIX^W^WTru64 UNIX. + */ int abort_on_misalignment(char *ebuf _U_, size_t ebufsiz _U_) { |