Page MenuHomeFreeBSD

lib{c,sys}: stop exposing errno symbol
Needs ReviewPublic

Authored by brooks on Tue, Sep 24, 10:41 PM.

Details

Reviewers
kib
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 Passed
Unit
No Test Coverage
Build Status
Buildable 59589
Build 56476: arc lint + arc unit

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
386

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