diff options
author | Pavel Labath <pavel@labath.sk> | 2020-10-02 13:38:09 +0200 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2020-10-07 15:29:29 +0200 |
commit | 3dfb94986170c57d9b3f5f2cba039a2eab5e6f13 (patch) | |
tree | 98ebd320ab4b812951f0ddc7574d2c99a17d1542 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 029290f1a6231507b82981d56c0a0d2b02d508e0 (diff) | |
download | llvm-3dfb94986170c57d9b3f5f2cba039a2eab5e6f13.zip llvm-3dfb94986170c57d9b3f5f2cba039a2eab5e6f13.tar.gz llvm-3dfb94986170c57d9b3f5f2cba039a2eab5e6f13.tar.bz2 |
[lldb] Check for and use ptsname_r if available
ptsname is not thread-safe. ptsname_r is available on most (but not all)
systems -- use it preferentially.
In the patch I also improve the thread-safety of the ptsname fallback
path by wrapping it in a mutex. This should guarantee the safety of a
typical ptsname implementation using a single static buffer, as long as
all callers go through this function.
I also remove the error arguments, as the only way this function can
fail is if the "primary" fd is not valid. This is a programmer error as
this requirement is documented, and all callers ensure that is the case.
Differential Revision: https://reviews.llvm.org/D88728
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions