Open fwyzard opened 1 year ago
assign core
New categories assigned: core
@Dr15Jones,@smuzaffar,@makortel you have been requested to review this Pull request/Issue and eventually sign? Thanks
A new Issue was created by @fwyzard Andrea Bocci.
@Dr15Jones, @perrotta, @dpiparo, @rappoccio, @makortel, @smuzaffar can you please review it and eventually sign/assign? Thanks.
cms-bot commands are listed here
Thanks @fwyzard for raising the issue.
Would it be useful to replace our usage of
strerror()
withstrerror_r()
, which uses a user-provided buffer and is thread-safe ?
I agree, we should review each case and maybe see first if the code could be changed to not use errno()
(e.g. TFileService.cc
looked like that), and if not, then move to strerror_r()
. A potential downside is that while strerror()
is part of C and C++ standards, strerror_r()
is POSIX` (on the other hand we depend on POSIX in many other places already so the added risk is likely negligible).
CMSSW makes use of
std::strerror()
and::strerror()
:According to the C and C++ librariy documentation (e.g. https://en.cppreference.com/w/cpp/string/byte/strerror )
Would it be useful to replace our usage of
strerror()
withstrerror_r()
, which uses a user-provided buffer and is thread-safe ?