* [patch] poll.2: timeout_ts is a pointer, so use -> not . for member access
@ 2015-12-23 19:30 richardvoigt-Re5JQEeQqe8AvxtiuMwx3w
[not found] ` <CAO_2OxVnn4cmvX5fZmXYHgW6v3aoH=OAGrk62QgrTA=qYrrcew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: richardvoigt-Re5JQEeQqe8AvxtiuMwx3w @ 2015-12-23 19:30 UTC (permalink / raw)
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA
>From the context, it is apparent that in the code explaining ppoll in
terms of poll, timeout_ts must be a pointer.
Usage #1: ready = ppoll(&fds, nfds, timeout_ts, &sigmask);
Usage #2: (timeout_ts == NULL)
Thus member access in (timeout_ts.tv_sec * 1000 + timeout_ts.tv_nsec /
1000000) is an error.
Ben
man2/poll.2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/man2/poll.2 b/man2/poll.2
index bcbecad..34b55a6 100644
--- a/man2/poll.2
+++ b/man2/poll.2
@@ -266,7 +266,7 @@ executing the following calls:
int timeout;
timeout = (timeout_ts == NULL) ? \-1 :
- (timeout_ts.tv_sec * 1000 + timeout_ts.tv_nsec / 1000000);
+ (timeout_ts\->tv_sec * 1000 + timeout_ts\->tv_nsec / 1000000);
pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);
ready = poll(&fds, nfds, timeout);
pthread_sigmask(SIG_SETMASK, &origmask, NULL);
--
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] poll.2: timeout_ts is a pointer, so use -> not . for member access
[not found] ` <CAO_2OxVnn4cmvX5fZmXYHgW6v3aoH=OAGrk62QgrTA=qYrrcew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-12-23 22:29 ` Michael Kerrisk (man-pages)
0 siblings, 0 replies; 2+ messages in thread
From: Michael Kerrisk (man-pages) @ 2015-12-23 22:29 UTC (permalink / raw)
To: richardvoigt-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man, netdev
Hello Richard,
On 23 December 2015 at 20:30, richardvoigt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
<richardvoigt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> From the context, it is apparent that in the code explaining ppoll in
> terms of poll, timeout_ts must be a pointer.
>
> Usage #1: ready = ppoll(&fds, nfds, timeout_ts, &sigmask);
>
> Usage #2: (timeout_ts == NULL)
>
> Thus member access in (timeout_ts.tv_sec * 1000 + timeout_ts.tv_nsec /
> 1000000) is an error.
Thanks. Patch applied.
Cheers,
Michael
> man2/poll.2 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/man2/poll.2 b/man2/poll.2
> index bcbecad..34b55a6 100644
> --- a/man2/poll.2
> +++ b/man2/poll.2
> @@ -266,7 +266,7 @@ executing the following calls:
> int timeout;
>
> timeout = (timeout_ts == NULL) ? \-1 :
> - (timeout_ts.tv_sec * 1000 + timeout_ts.tv_nsec / 1000000);
> + (timeout_ts\->tv_sec * 1000 + timeout_ts\->tv_nsec / 1000000);
> pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);
> ready = poll(&fds, nfds, timeout);
> pthread_sigmask(SIG_SETMASK, &origmask, NULL);
--
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-23 22:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-23 19:30 [patch] poll.2: timeout_ts is a pointer, so use -> not . for member access richardvoigt-Re5JQEeQqe8AvxtiuMwx3w
[not found] ` <CAO_2OxVnn4cmvX5fZmXYHgW6v3aoH=OAGrk62QgrTA=qYrrcew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-23 22:29 ` Michael Kerrisk (man-pages)
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.