public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Asynchronous I/O and SIGIO
@ 1998-07-27  4:08 John Knottenbelt
  0 siblings, 0 replies; only message in thread
From: John Knottenbelt @ 1998-07-27  4:08 UTC (permalink / raw)
  To: gnu-win32

Hi

I've been trying to get asynchronous I/O going. I would like to be able to
receive SIGIO signals when a file descriptor becomes ready for reading or
writing.

I have had some success by performing an fcntl:

int flags = fcntl( fd, F_GETFL, 0 );
fcntl( fd, F_SETFL, flags | O_NONBLOCK | FASYNC );

and then subsequently an ioctl

int yesplease = 1;
ioctl( fd, FIOASYNC, &yesplease );

(I'll admit I don't really know what the argument to the FIOASYNC ioctl
has got to be :)) It seems the the FIOASYNC actually enables the SIGIO
signals.

I tried using the fcntl F_SETOWN, but that didn't seem to work at all.

Any way this seems to work quite well for sockets and gives me SIGIOs.
However, it does not give me a SIGIO when the other end of the socket is
closed, which is desirable.

I would also like to get some SIGIOs when standard input / output are
ready for reading/writing but the ioctl does not succeed on fd 0.

Has any one had similar experience or can offer any advice?

Thanks

Johnny

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-07-27  4:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-07-27  4:08 Asynchronous I/O and SIGIO John Knottenbelt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).