7 extern volatile sig_atomic_t sigint
;
9 ssize_t
read_exact(int fd
, void *buf
, size_t len
, int mayexit
)
11 ssize_t num
= 0, written
;
13 while (len
> 0 && !sigint
) {
14 if ((written
= read(fd
, buf
, len
)) < 0) {
15 if (errno
== EAGAIN
&& num
> 0)
32 ssize_t
write_exact(int fd
, void *buf
, size_t len
, int mayexit
)
34 ssize_t num
= 0, written
;
36 while (len
> 0 && !sigint
) {
37 if ((written
= write(fd
, buf
, len
)) < 0) {
38 if (errno
== EAGAIN
&& num
> 0)