public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* Return type of getrandom(2)
@ 2016-10-08 12:28 Florian Weimer
       [not found] ` <87mvifnhxw.fsf-ZqZwdwZz9NfTBotR3TxKnbNAH6kLmebB@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Weimer @ 2016-10-08 12:28 UTC (permalink / raw)
  To: linux-api-u79uwXL29TY76Z2rM5mHXA,
	linux-man-u79uwXL29TY76Z2rM5mHXA
  Cc: Heinrich Schuchardt, Theodore Ts'o

The manual page says the return type of getrandom(2) is int, but
ssize_t would be more natural (see read(2) for comparison).  The
kernel uses ssize_t internally, which is converted to long on the
system call boundary.

The difference does not currently matter because the return value is
limited to much less than INT_MAX in the implementation.

Should we use int or ssize_t in the glibc system call wrapper?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-10-12  6:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-08 12:28 Return type of getrandom(2) Florian Weimer
     [not found] ` <87mvifnhxw.fsf-ZqZwdwZz9NfTBotR3TxKnbNAH6kLmebB@public.gmane.org>
2016-10-08 19:40   ` Theodore Ts'o
     [not found]     ` <20161008194005.uo7uwiaukgk4y7ku-AKGzg7BKzIDYtjvyW6yDsg@public.gmane.org>
2016-10-09  9:47       ` Florian Weimer
2016-10-09 16:53       ` Andy Lutomirski
     [not found]         ` <CALCETrWgc0Wwd5AQ8fk3qPabsXKAgFZmH5O6w0CrcXEx+Pwy-Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-12  6:30           ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox