<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://sourceware.org/bugzilla/bugzilla.dtd">

<bugzilla version="4.0.10"
          urlbase="http://sourceware.org/bugzilla/"
          
          maintainer="overseers@sourceware.org"
>

    <bug>
          <bug_id>14304</bug_id>
          
          <creation_ts>2012-06-27 14:59:00 +0000</creation_ts>
          <short_desc>Provide some parts of librt in libc as well</short_desc>
          <delta_ts>2013-01-15 14:34:56 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>glibc</product>
          <component>nptl</component>
          <version>2.13</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>14743</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Adam Jackson">ajax</reporter>
          <assigned_to name="Not yet assigned to anyone">unassigned</assigned_to>
          <cc>drepper.fsp</cc>
          <cf_gcchost></cf_gcchost>
          <cf_gcctarget></cf_gcctarget>
          <cf_gccbuild></cf_gccbuild>
          

      

      

      

          <long_desc isprivate="0">
            <commentid>56005</commentid>
            <who name="Adam Jackson">ajax</who>
            <bug_when>2012-06-27 14:59:55 +0000</bug_when>
            <thetext>librt links against libpthread, mostly because aio_* are implemented in threads instead of in the kernel AFAICT.  This is unfortunate, because many libraries would like to use (for example) clock_gettime, but doing so pulls in pthreads.  Now you have no choice but to hit the more expensive thread-safe paths, because your library can&apos;t know whether multiple threads actually exist, only whether the pthread symbols are non-zero.

The complementary problem also exists for applications that are unthreaded: if they link against librt, pthread symbols will be non-zero, and any thread-safe library beneath that app now has to behave thread-safely.

This is especially comic when reading the clock_gettime implementation, which goes out of its way to work correctly regardless of whether __pthread_clock_gettime is available.

Ideally it would be possible to provide most of these symbols from libc directly (presumably versioned so the app requires a sufficiently new libc).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>59492</commentid>
            <who name="Andreas Schwab">schwab</who>
            <bug_when>2013-01-15 14:34:56 +0000</bug_when>
            <thetext>The clock_* function have been moved to libc.

*** This bug has been marked as a duplicate of bug 14743 ***</thetext>
          </long_desc>
      
      

    </bug>

</bugzilla>