public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: John Knottenbelt <johnny@tecc.co.uk>
To: gnu-win32@cygnus.com
Subject: Asynchronous I/O and SIGIO
Date: Mon, 27 Jul 1998 04:08:00 -0000	[thread overview]
Message-ID: <Pine.GSO.3.96.980727120032.7152C-100000@handbag.tecc.co.uk> (raw)

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".

                 reply	other threads:[~1998-07-27  4:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.3.96.980727120032.7152C-100000@handbag.tecc.co.uk \
    --to=johnny@tecc.co.uk \
    --cc=gnu-win32@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).