]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
getlogin_r: fix the type of len
authorkevans <kevans@FreeBSD.org>
Wed, 9 Sep 2020 18:07:13 +0000 (18:07 +0000)
committerkevans <kevans@FreeBSD.org>
Wed, 9 Sep 2020 18:07:13 +0000 (18:07 +0000)
commitc30b5947ac85117a415ac347579e99e416ae28bb
tree37222cb1fbcb4e94b8311c234bc8ae83e8fb8b0e
parent4e82e3cbcb04f97b1ea6ed637a72462a23160cc1
getlogin_r: fix the type of len

getlogin_r is specified by POSIX to to take a size_t len, not int. Fix our
version to do the same, bump the symbol version due to ABI change and
provide compat.

This was reported to break compilation of Ruby 2.8.

Some discussion about the necessity of the ABI compat did take place in the
review. While many 64-bit platforms would likely be passing it in a 64-bit
register and zero-extended and thus, not notice ABI breakage, some do
sign-extend (e.g. mips).

PR: 247102
Submitted by: Bertram Scharpf <software@bertram-scharpf.de> (original)
Submitted by: cem (ABI compat)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26335
include/unistd.h
lib/libc/gen/Symbol.map
lib/libc/gen/getlogin.c
lib/libc/sys/getlogin.2