linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Andreas Gruenbacher <agruenba-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] aio.7: Improve example
Date: Mon, 1 Feb 2016 15:23:15 +0100	[thread overview]
Message-ID: <56AF6A53.4060201@gmail.com> (raw)
In-Reply-To: <1454320018-14176-1-git-send-email-agruenba-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Hi Andreas,

On 02/01/2016 10:46 AM, Andreas Gruenbacher wrote:
> When aio_sigevent.sigev_notify is set to SIGEV_SIGNAL, signal handlers
> called for asychronous I/O operations will have si->si_code set to
> SI_ASYNCIO.  Check to make sure that si->si_value.sival_ptr is defined.

Thanks. Applied.

Cheers,

Michael


> Signed-off-by: Andreas Gruenbacher <agruenba-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>  aio.7 | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/aio.7 b/aio.7
> index 1f861da..21193fd 100644
> --- a/aio.7
> +++ b/aio.7
> @@ -281,12 +281,14 @@ quitHandler(int sig)
>  static void                 /* Handler for I/O completion signal */
>  aioSigHandler(int sig, siginfo_t *si, void *ucontext)
>  {
> -    write(STDOUT_FILENO, "I/O completion signal received\\n", 31);
> +    if (si->si_code == SI_ASYNCIO) {
> +        write(STDOUT_FILENO, "I/O completion signal received\\n", 31);
>  
> -    /* The corresponding ioRequest structure would be available as
> -           struct ioRequest *ioReq = si\->si_value.sival_ptr;
> -       and the file descriptor would then be available via
> -           ioReq\->aiocbp\->aio_fildes */
> +        /* The corresponding ioRequest structure would be available as
> +               struct ioRequest *ioReq = si\->si_value.sival_ptr;
> +           and the file descriptor would then be available via
> +               ioReq\->aiocbp\->aio_fildes */
> +    }
>  }
>  
>  int
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2016-02-01 14:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-01  9:46 [PATCH] aio.7: Improve example Andreas Gruenbacher
     [not found] ` <1454320018-14176-1-git-send-email-agruenba-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-02-01 12:09   ` walter harms
     [not found]     ` <56AF4AF9.9000807-fPG8STNUNVg@public.gmane.org>
2016-02-01 14:25       ` Michael Kerrisk (man-pages)
2016-02-01 14:23   ` Michael Kerrisk (man-pages) [this message]

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=56AF6A53.4060201@gmail.com \
    --to=mtk.manpages-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=agruenba-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.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).