diff options
author | Christopher Faylor <me@cgf.cx> | 2001-01-12 05:38:25 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-01-12 05:38:25 +0000 |
commit | c3d62298ba6caadf2babd191951305ca2e389596 (patch) | |
tree | d4e0f386f548655e8efd8271615e15b70161245e /winsup/cygwin/syscalls.cc | |
parent | e45ab89012ee7415606dcd7c664cd5c4c14e5baf (diff) | |
download | cygnal-c3d62298ba6caadf2babd191951305ca2e389596.tar.gz cygnal-c3d62298ba6caadf2babd191951305ca2e389596.tar.bz2 cygnal-c3d62298ba6caadf2babd191951305ca2e389596.zip |
* debug.h: Add regparm attributes to some functions.
* signal.cc (sigaction): Don't treat SIGCONT specially.
* exceptions.cc (interrupt_setup): Save sa_flags of interrupted signal for
later use.
(sig_handler): Default any stopping signal to SIGSTOP.
(call_signal_handler): New function.
(sigdelayed0): New function.
* sigproc.cc (sigproc_init): Initialize SIGSTOP sigaction for special behavior.
* sigproc.h: Define call_signal_handler.
* syscalls.cc (_read): Allow restartable signal behavior.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r-- | winsup/cygwin/syscalls.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 1cf7d6284..0f6834422 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -220,6 +220,8 @@ _read (int fd, void *ptr, size_t len) { sigframe thisframe (mainthread); extern int sigcatchers; + +beg: if (fdtab.not_open (fd)) { set_errno (EBADF); @@ -257,8 +259,11 @@ _read (int fd, void *ptr, size_t len) } out: - syscall_printf ("%d = read (%d<%s>, %p, %d), errno %d", res, fd, fh->get_name (), - ptr, len, get_errno ()); + if (res < 0 && WaitForSingleObject (signal_arrived, 0) == WAIT_OBJECT_0 && + call_signal_handler ()) + goto beg; + syscall_printf ("%d = read (%d<%s>, %p, %d), bin %d, errno %d", res, fd, fh->get_name (), + ptr, len, fh->get_r_binary (), get_errno ()); MALLOC_CHECK; return res; } |