Issue 143937
Summary [libc] avoid setting errno in `src/__support`
Labels libc
Assignees
Reporter michaelrj-google
    Setting errno in support makes controlling whether errno is set much more difficult. Errno should be set as close to the return of a public function as possible.

List of places that need to be changed:
- [ ] [__support/OSUtil/linux/fcntl.cpp](https://github.com/llvm/llvm-project/blob/main/libc/src/__support/OSUtil/linux/fcntl.cpp) - change to returning `ErrorOr` since if there's an error it always returns -1.
- [ ] [__support/OSUtil/linux/vdso.cpp](https://github.com/llvm/llvm-project/blob/main/libc/src/__support/OSUtil/linux/vdso.cpp) - currently calling public functions in support, which is also a problem. Move `getauxval` to an internal utility that doesn't set errno and this problem goes away.
- [ ] [__support/HashTable/randomness.h](https://github.com/llvm/llvm-project/blob/main/libc/src/__support/HashTable/randomness.h) - same issue as vdso, calling public functions leads to setting errno.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to