From: Chuck Winters <cwinters@atl.lmco.com>
To: linux-c-programming@vger.kernel.org
Subject: Asynchronous I/O
Date: Thu, 23 May 2002 20:20:46 -0400 [thread overview]
Message-ID: <20020523202046.A25509@atl.lmco.com> (raw)
I have been messing around with Asynchronous I/O for a couple of days
and I have a couple of questions. First, I am setting my own signal(SIGUSR1)
to be fired instead of SIGIO. That means I have to use the F_SETSIG fcntl.
Next, I am also setting SA_SIGINFO so that I get a little more info with
the signal. Now the questions:
1) Using this combination of F_SETSIG and SA_SIGINFO, I am told(by the man
page) that when the signal is fired, the file(socket in my case) descriptor
is placed in the si_fd field of the siginfo_t structure. Well, when
my registered function is run, I check that the si_fd is the socket I am
using to communicate, and also that the signal in si_signo is the signal
I am listening for. Good. Now what happens is that recv blocks!! Can
anyone tell me why??
2) I also wrote 2 little test programs which just created a connection between
them over localhost. Then set the Asynchronous I/O on the reader program.
And the writer program the user can enter data and it shows up in the
reader terminal(big deal). Now with the code I am writing for real, I am
running into the above problem(1). Now, can the F_SETSIG/F_SETOWN/FASYNC
be set *after* the connection is established, or is this behaviour
undefined? The little test programs worked ok with that setup. Is this
just a fluke?
I thank you all for your time.
Chuck Winters
reply other threads:[~2002-05-24 0:20 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=20020523202046.A25509@atl.lmco.com \
--to=cwinters@atl.lmco.com \
--cc=linux-c-programming@vger.kernel.org \
/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 NNTP newsgroup(s).