From: simonmar Date: Wed, 31 Oct 2001 10:30:29 +0000 (+0000) Subject: [project @ 2001-10-31 10:30:29 by simonmar] X-Git-Tag: Approximately_9120_patches~670 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=ab01dd3748fb245fe3feacafd87f91abd1822409;p=ghc-hetmet.git [project @ 2001-10-31 10:30:29 by simonmar] Add setNonBlockingFd(), for use in the SIGCONT handler in Signals.c. --- diff --git a/ghc/rts/RtsUtils.c b/ghc/rts/RtsUtils.c index a8ce114..0e302a7 100644 --- a/ghc/rts/RtsUtils.c +++ b/ghc/rts/RtsUtils.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: RtsUtils.c,v 1.22 2001/08/29 15:02:02 sewardj Exp $ + * $Id: RtsUtils.c,v 1.23 2001/10/31 10:30:29 simonmar Exp $ * * (c) The GHC Team, 1998-1999 * @@ -238,6 +238,18 @@ resetNonBlockingFd(int fd) #endif } +void +setNonBlockingFd(int fd) +{ + long fd_flags; + +#if !defined(mingw32_TARGET_OS) + /* clear the non-blocking flag on this file descriptor */ + fd_flags = fcntl(fd, F_GETFL); + fcntl(fd, F_SETFL, fd_flags | O_NONBLOCK); +#endif +} + static ullong startTime = 0; /* used in a parallel setup */ diff --git a/ghc/rts/RtsUtils.h b/ghc/rts/RtsUtils.h index cb01e32..8825460 100644 --- a/ghc/rts/RtsUtils.h +++ b/ghc/rts/RtsUtils.h @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: RtsUtils.h,v 1.11 2001/08/29 14:55:58 sewardj Exp $ + * $Id: RtsUtils.h,v 1.12 2001/10/31 10:30:29 simonmar Exp $ * * (c) The GHC Team, 1998-1999 * @@ -21,7 +21,8 @@ extern void _stgAssert (char *filename, unsigned int linenum); extern void heapOverflow(void); -void resetNonBlockingFd(int fd); +extern void setNonBlockingFd(int fd); +extern void resetNonBlockingFd(int fd); extern nat stg_strlen(char *str);