This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 734836

Summary: realtime clock functions need to link with -lrt
Product: Red Hat Enterprise Linux 6 Reporter: Jeff Bastian <jbastian>
Component: man-pages-overridesAssignee: Peter Schiffer <pschiffe>
Status: CLOSED ERRATA QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: low Docs Contact:
Priority: medium    
Version: 6.1CC: ddumas, ovasik
Target Milestone: rcKeywords: ManPageChange
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Prior to this update, the clock_gettime(2), clock_getres(2), and clock_nanosleep(2) manual pages did not mention the "-lrt" option. With this update, the "-lrt" option is now described in the aforementioned manual pages.
Story Points: ---
Clone Of:
: 735789 (view as bug list) Environment:
Last Closed: 2011-12-06 06:48:36 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 735789, 748554    

Description Jeff Bastian 2011-08-31 11:11:21 EDT
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
Comment 1 Jeff Bastian 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.
Comment 2 Jeff Bastian 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?
Comment 3 Peter Schiffer 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 7 Eliska Slobodova 2011-09-29 07:11:13 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Prior to this update, the clock_gettime(2), clock_getres(2), and clock_nanosleep(2) manual pages did not mention the "-lrt" option. With this update, the "-lrt" option is now described in the aforementioned manual pages.
Comment 8 errata-xmlrpc 2011-12-06 06:48:36 EST
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-2011-1571.html