8 extern volatile sig_atomic_t sigint
;
10 ssize_t
read_exact(int fd
, void *buf
, size_t len
, bool mayexit
)
12 ssize_t num
= 0, written
;
14 while (len
> 0 && !sigint
) {
15 if ((written
= read(fd
, buf
, len
)) < 0) {
16 if (errno
== EAGAIN
&& num
> 0)
34 ssize_t
write_exact(int fd
, void *buf
, size_t len
, bool mayexit
)
36 ssize_t num
= 0, written
;
38 while (len
> 0 && !sigint
) {
39 if ((written
= write(fd
, buf
, len
)) < 0) {
40 if (errno
== EAGAIN
&& num
> 0)