[libc-commits] [PATCH] D71094: [libc] Add implementation of errno and define the other macros of errno.h.

Stan Shebs via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Dec 6 12:06:34 PST 2019


stanshebs added inline comments.


================
Comment at: libc/spec/posix.td:1
+def POSIX : StandardSpec<"POSIX"> {
+  HeaderSpec Errno = HeaderSpec<
----------------
Is this expected to be definitive for what POSIX specifies?  EHWPOISON is Linux-only I think.



================
Comment at: libc/src/errno/errno_location.cpp:15
+
+static thread_local int __errno = 0;
+
----------------
One bit of handiness that glibc does is to alias it its version of __errno with plain "errno", so you see it as "errno" in a debugger, object file dumps, etc.  (In theory, getting errno through macro expansion and function call should be possible in debugger, but is much less straightforward and more likely to fail, as with core dumps.)



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71094/new/

https://reviews.llvm.org/D71094





More information about the libc-commits mailing list