Page MenuHomeFreeBSD

getlogin_r: fix the type of len
ClosedPublic

Authored by kevans on Sep 5 2020, 2:03 AM.
Tags
None
Referenced Files
F132502567: D26335.id.diff
Fri, Oct 17, 11:12 AM
F132502560: D26335.id76686.diff
Fri, Oct 17, 11:12 AM
F132502558: D26335.id76824.diff
Fri, Oct 17, 11:11 AM
F132452787: D26335.diff
Fri, Oct 17, 1:46 AM
Unknown Object (File)
Sep 13 2025, 1:54 PM
Unknown Object (File)
Aug 20 2025, 11:18 PM
Unknown Object (File)
Aug 18 2025, 12:44 AM
Unknown Object (File)
Aug 17 2025, 2:54 AM
Subscribers

Details

Summary

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.

PR: 247102
Submitted by: Bertram Scharpf <software@bertram-scharpf.de> (original), cem (ABI compat)
MFC after: 3 days

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kevans requested review of this revision.Sep 5 2020, 2:03 AM
This revision is now accepted and ready to land.Sep 5 2020, 9:51 AM
jhb added a subscriber: jhb.

I suspect it's not even an ABI issue since all our 64-bit platforms would pass 'len' in a 64-bit register that is (probably) zero-extended. However, the shim is cheap.

In D26335#586194, @jhb wrote:

I suspect it's not even an ABI issue since all our 64-bit platforms would pass 'len' in a 64-bit register that is (probably) zero-extended. However, the shim is cheap.

At least mips sign-extends.

This revision was automatically updated to reflect the committed changes.