Page MenuHomeFreeBSD

lib{c,sys}: stop exposing errno symbol
ClosedPublic

Authored by brooks on Sep 24 2024, 10:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 12, 2:30 PM
Unknown Object (File)
Tue, Nov 5, 4:38 PM
Unknown Object (File)
Tue, Nov 5, 4:36 PM
Unknown Object (File)
Tue, Nov 5, 4:35 PM
Unknown Object (File)
Tue, Nov 5, 4:35 PM
Unknown Object (File)
Sun, Nov 3, 12:04 PM
Unknown Object (File)
Fri, Nov 1, 1:21 PM
Unknown Object (File)
Fri, Nov 1, 12:35 PM
Subscribers

Details

Summary

Officially since C11 (and in reality FreeBSD since 3.0 with commit
1b46cb523df3) errno has been defined to be a macro. Rename it to
__errno and move it to FBSDprivate_1.0 for use by libthr. Add a
FBSD_1.0 compat symbol for existing binaries that were incorrectly
linked to the errno symbol during libc.so.7's lifetime.

This breaks linking previously broken software that directly linked to
errno.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Does this solve the ABI issue that we have two errno's for binaries that did 'extern int errno;' explicitly? I suspect not, since they should get a COPY reloc resolved from libc errno, and now it would either error out on image activation, or still be silently broken.

I believe an experiment is due.

lib/libsys/Symbol.sys.map
387

Can we rename it even more, to make it less confusing? E.g. __libsys_errno.

  • errno -> libsys_errno
  • Only export errno compat symbol from libsys so there's only one version.
kib added inline comments.
lib/libthr/sys/thr_error.c
42

Please remove tabs

This revision is now accepted and ready to land.Sep 25 2024, 11:54 PM
This revision was automatically updated to reflect the committed changes.