RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 735789 - realtime clock functions need to link with -lrt
Summary: realtime clock functions need to link with -lrt
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: man-pages
Version: 6.1
Hardware: All
OS: Linux
medium
low
Target Milestone: rc
: ---
Assignee: Peter Schiffer
QA Contact: Iveta Wiedermann
URL:
Whiteboard:
Depends On: 734836
Blocks: MPO-6.4-REMOVE
TreeView+ depends on / blocked
 
Reported: 2011-09-05 12:00 UTC by Peter Schiffer
Modified: 2013-02-21 10:45 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: the clock_gettime(2), clock_getres(2), and clock_nanosleep(2) manual pages did not mention the "-lrt" option Consequence: incorrect documentaiton Fix: mention the "-lrt" option in the aforementioned manual pages Result: correct documentation
Clone Of: 734836
Environment:
Last Closed: 2013-02-21 10:45:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0447 0 normal SHIPPED_LIVE man-pages bug fix and enhancement update 2013-02-20 20:47:52 UTC

Description Peter Schiffer 2011-09-05 12:00:42 UTC
+++ This bug was initially created as a clone of Bug #734836 +++

Description of problem:
The clock_gettime(2), clock_settime(2), clock_getres(2) and clock_nanosleep(2) man pages do not mention the fact that you must link to the librt library (with -lrt command line option) to use them.

Without -lrt, the compile fails:
$ gcc test.c
/tmp/ccyoU0Vi.o: In function `getustime':
test.c:(.text+0x36): undefined reference to `clock_gettime'
collect2: ld returned 1 exit status

The latest version of the man page in Fedora 15 does note this fact in the SYNOPSYS section:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SYNOPSIS
       #include <time.h>

       int clock_getres(clockid_t clk_id, struct timespec *res);

       int clock_gettime(clockid_t clk_id, struct timespec *tp);

       int clock_settime(clockid_t clk_id, const struct timespec *tp);

       Link with -lrt.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Please update the realtime clock function man pages to note the linking options.


Version-Release number of selected component (if applicable):
man-pages-3.22-17.el6.noarch

How reproducible:
every time

Steps to Reproduce:
1. man clock_gettime

  
Actual results:
no mention of -lrt link option

Expected results:
note on linking with -lrt

--- Additional comment from jbastian on 2011-08-31 11:25:10 EDT ---

There's something strange with the RHEL 6 man pages: the upstream man-pages-3.22.tar.gz contains the linking notes and was written in 2009, but the RHEL 6 version of the man page is from 2004.

--- Additional comment from jbastian on 2011-08-31 11:29:48 EDT ---

The RHEL 6 man-pages-3.22-17.el6.src.rpm contains a man-pages_syscalls-01.tar.bz2 which overrides a number of the man pages including the clock_* pages with much older versions of the pages.

Is this intentional?

--- Additional comment from pschiffe on 2011-09-05 07:59:33 EDT ---

man-pages_syscalls-01.tar.bz2 is from old BZ #159225, when not all man pages was included in upstream tarball. It should be revised and irrelevant man pages removed.

For now, I'll fix four clock_* functions in MPO process in RHEL-6.2, rest when man-pages component will be updated in RHEL.

Comment 3 Suzanne Logcher 2012-02-15 17:17:51 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time, but it has been proposed
for the next release.

Comment 12 errata-xmlrpc 2013-02-21 10:45:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0447.html


Note You need to log in before you can comment on or make changes to this bug.