freebsd-src/bin/dd
Konstantin Belousov 8dad5ece49 dd(1): neutralize SIGINT while non-async-signal safe code is executing
making the SIGINT handler (the terminate() function) safe to execute at
any interruption moment.  This fixes a race in
5807f35c54 where SIGINT delivered right
after the check_terminate() but before a blocking syscall would not
cause abort.

Do it by setting the in_io flag around potentially blocking io syscalls.
If handler sees the flag, it terminates the program.  Otherwise,
termination is delegated to the before_io/after_io fences.

Reviewed by:	Andrew Gierth <andrew@tao146.riddles.org.uk>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D40281
2023-06-03 01:06:27 +03:00
..
tests dd: Fix SIGINT handling. 2023-05-05 12:42:32 +00:00
args.c
conv.c
conv_tab.c
dd.1
dd.c dd(1): neutralize SIGINT while non-async-signal safe code is executing 2023-06-03 01:06:27 +03:00
dd.h
extern.h dd(1): neutralize SIGINT while non-async-signal safe code is executing 2023-06-03 01:06:27 +03:00
gen.c
Makefile
Makefile.depend Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
misc.c dd(1): neutralize SIGINT while non-async-signal safe code is executing 2023-06-03 01:06:27 +03:00
position.c dd(1): neutralize SIGINT while non-async-signal safe code is executing 2023-06-03 01:06:27 +03:00
ref.ascii
ref.ebcdic
ref.ibm
ref.lcase
ref.obs_zeroes
ref.oldascii
ref.oldebcdic
ref.oldibm
ref.pareven
ref.parnone
ref.parodd
ref.parset
ref.swab
ref.ucase