i think the requirement is only that the compiler accept -lpthread... "It is unspecified whether the libraries libc.a, libl.a, libm.a, libpthread.a, librt.a, [OB] [Option Start] libtrace.a, [Option End] libxnet.a, or liby.a exist as regular files. The implementation may accept as -l option-arguments names of objects that do not exist as regular files."
Android has libpthread and librt in libc (though sadly libm is still separate). On Thu, Apr 18, 2019 at 8:46 AM Joel Sherrill <joel.sherr...@oarcorp.com> wrote: > > > > On 4/18/2019 4:31 AM, Geoff Clare wrote: > > Shware Systems <shwares...@aol.com> wrote, on 17 Apr 2019: > >> On Wednesday, April 17, 2019 Geoff Clare <g...@opengroup.org> wrote: > >> > >>> ... does anyone know of an implementation > >>> that has pthreads and C11/C17 threads, with pthread_t and thrd_t defined > >>> as different types? > >> My implementation defines both as pointers, not int's, as 'typedef > >> thrd_t pthread_t;'. Since threads.h is 99% a subset of pthreads.h, > >> I see no reason to have them be different types, even as a breaking > >> change. What is missing is in pthreads.h, to account for the new > >> attributes C11 introduced, at least to mention them if support > >> isn't going to be added. > > What new attributes? As far as I can see the only attribute a > > thread has in C17 (although it doesn't use that word) is whether it > > has been detached. > > > >> The major hassle I see is POSIX wants the > >> the threading stuff in libpthread, and C11 wants it in libc if the > >> threading option is enabled. IMO C11 should have let interfaces in > >> optional headers all be in header-specific libraries or libc, as an > >> implentation-defined choice, but they didn't. > > Last I knew the C standard says nothing at all about how programs > > are built. > > Is there even a requirement to have libpthread in POSIX? > > --joel >