Am 24.08.2025 um 06:52 schrieb Christian Schulte: > Am 22.08.2025 um 00:51 schrieb Christian Schulte: >> Hi @misc, >> >> reading the standard, C11 introduced the optional threads.h header >> (7.26). NetBSD, FreeBSD and OpenBSD do not provide it. glibc has it. >> Other non POSIX OSes also have it. To make a long story short. Would it >> make sense to add it to libc in addition to the POSIX threads? Would >> make things easier porting recently written software using those >> interfaces from non POSIX OSes to the BSDs. So add that threads.h file >> with a corresponding implementation like is done in that rthreads >> directory. Wanted to ask first, before starting any work on it. Does >> that make sense? POSIX does not mention it. It has pthreads, of course. >> Any thoughts? >> >> Regards, >> -- >> Christian >> >> $0x02 grep -ri "__STDC_NO_THREADS__" /usr/src >> /usr/src/gnu/llvm/clang/lib/Basic/Targets/OSTargets.cpp: >> Builder.defineMacro("__STDC_NO_THREADS__"); >> /usr/src/gnu/llvm/clang/lib/Basic/Targets/OSTargets.cpp: >> Builder.defineMacro("__STDC_NO_THREADS__"); >> /usr/src/gnu/llvm/clang/lib/Basic/Targets/OSTargets.h: >> Builder.defineMacro("__STDC_NO_THREADS__"); >> /usr/src/gnu/llvm/clang/lib/Basic/Targets/OSTargets.h: >> Builder.defineMacro("__STDC_NO_THREADS__"); >> /usr/src/gnu/llvm/clang/lib/Basic/Targets/OSTargets.h: >> Builder.defineMacro("__STDC_NO_THREADS__"); >> > > I have been informed that NetBSD and FreeBSD support this since years > and where to find theire implementations and that OpenBSD has the > FreeBSD implementation in ports at devel/libstdthreads. That's what I > was looking for. > > Thanks,
Well. If only it would not haven been named libstdthreads. I mean, it's a C standard interface. Quite confusing not to adhere to the conventional naming scheme. It's not -lstdc -lstdm but -lc -lm. -lstdc -lstdm -lstdthreads vs. -lc -lm -lthreads I'am not sure, it is a good idea to not call it libthreads, instead of libstdthreads. There will be reasons I don't know about. For consistency it really should be called libthreads instead of libstdthreads. So long and now to something completely different, -- Christian