IBM Support

PK83212: LANGUAGE ENVIRONMENT SUPPORT FOR CONSTRUCTED CALENDAR TIMES PAST YEAR 2038

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as new function.

Error description

  • Support new time_t requirements.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED: AMODE 31 C/C++ users that want to work       *
    *                 with constructed calendar times beyond       *
    *                 03:14:07 on January 19, 2038 UTC.            *
    ****************************************************************
    * PROBLEM DESCRIPTION: Current C/C++ functions that utilize    *
    *                      the time_t type will not work properly  *
    *                      with constructed calendar times in      *
    *                      the year 2038 and beyond. The           *
    *                      time_t definition cannot represent      *
    *                      dates in that range, causing time       *
    *                      and date functions to fail or to yield  *
    *                      unpredictable results. These functions  *
    *                      include:                                *
    *                         asctime(),                           *
    *                         asctime_r(),                         *
    *                         ctime(),                             *
    *                         ctime_r(),                           *
    *                         difftime(),                          *
    *                         gettimeofday(),                      *
    *                         getdate(),                           *
    *                         gmtime(),                            *
    *                         gmtime_r(),                          *
    *                         localtime(),                         *
    *                         localtime_r()                        *
    *                         mktime(),                            *
    *                         time()                               *
    *                      All associated structures and           *
    *                      typedefs are also affected.             *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    The z/OS Language Environment C Run-time
    library provides new types, structures, and
    functions to support calendar times up to
    and including the arbitrary limit of
    UTC 23:59:59 on December 31, 9999.
    
    The new functions provided are:
       asctime64(),
       asctime64_r(),
       ctime64(),
       ctime64_r(),
       difftime64(),
       gettimeofday64(),
       getdate64(),
       gmtime64(),
       gmtime64_r(),
       localtime64(),
       localtime64_r()
       mktime64(),
       time64()
    A new feature test macro _LARGE_TIME_API is
    provided to allow these new functions to be
    defined.
    
    Additional Keywords: time_t time64_t Y2K38
    

Problem conclusion

Temporary fix

Comments

  • ---------------------------------------------------------------
    The following additions should be made to the Language
    Environment documentation at releases 1.9, 1.10 and 1.11.
    ==============================================================
    z/OS XL C/C++ Run-Time Library Reference (SC23-3881-xx)
    ==============================================================
    
    3.0 Part 3. Library Functions
    ---------------------------------------------------------------
       In sub-section titled 'External Variables', add the
       following at the end of the description of
       getdate_err:
    
        The getdate64() interface affects the same pointer to the
        thread-specific value of getdate_err and uses the same
        getdate_err values as the getdate() interface.
    
    ---------------------------------------------------------------
    
       Add these updates to the asctime() function as follows:
    
         - bottom of the Standards/Extensions box
               Language Environment
    
         - end of format section
               #define _LARGE_TIME_API
               #include <time.h>
               char asctime64 (struct tm *timeptr);
    
         - end of the general description
               The function asctime64() behaves exactly like
               asctime() except it supports a structured date
               beyond 03:14:07 UTC on January 19, 2038 with a limit
               of UTC 23:59:59 on December 31, 9999.
    
    ---------------------------------------------------------------
    
       Add these updates to the asctime_r() function as follows:
    
         - bottom of the Standards/Extensions box
               Language Environment
    
         - end of the format section
               #define _LARGE_TIME_API
               #include <time.h>
               char asctime64_r (const struct tm *__restrict__ tm,
                                           char *__restrict__ buf);
    
         - end of the general description
               The function asctime64_r() behaves exactly like
               asctime_r() except it supports a structured
               date beyond 03:14:07 UTC on January 19, 2038 with
               a limit of UTC 23:59:59 on December 31, 9999.
    
    ---------------------------------------------------------------
    
       Add these updates to the ctime() function as follows:
    
         - bottom of the Standards/Extensions box
               Language Environment
    
         - end of the format section
               #define _LARGE_TIME_API
               #include <time.h>
               char  *ctime64 (const time64_t *timer);
    
         - end of the general description
               The function ctime64() behaves exactly like
               ctime() except it converts a time64_t value
               pointing to a calendar time beyond 03:14:07 UTC
               on January 19, 2038 with a limit of
               UTC 23:59:59 on December 31, 9999.
    
    ---------------------------------------------------------------
    
       Add these updates to the ctime_r() function as follows:
    
         - bottom of the Standards/Extensions box
               Language Environment
    
         - end of the format section
               #define _LARGE_TIME_API
               #include <time.h>
               char  *ctime64_r (const time64_t *clock, char *buf);
    
         - end of the general description.
               The function ctime64_r() behaves exactly
               like ctime_r() except it converts a
               time64_t value pointing to a calendar time
               beyond 03:14:07 UTC  on January 19, 2038 with a
               limit of  UTC 23:59:59 on December 31, 9999.
    
    ---------------------------------------------------------------
    
       Add these updates to the difftime() function as follows:
    
         - bottom of the Standards/Extensions box
               Language Environment
    
         - end of the format section
              #define _LARGE_TIME_API
              #include <time.h>
              double  difftime64 (time64_t  time2, time64_t time1);
    
         - end of the general description.
               The function difftime64() behaves exactly like
               difftime() except it supports converting
               time64_t values of calendar times beyond
               03:14:07 UTC on January 19, 2038 with a limit of
               UTC 23:59:59 on December 31, 9999.
    
    ---------------------------------------------------------------
    
       Add these updates to the getdate() function as follows:
    
         - bottom of the Standards/Extensions box
               Language Environment
    
         - end of the format section
               #define _LARGE_TIME_API
               #include <time.h>
               struct tm *getdate64(const char *string)
    
         - end of general description
               The function getdate64() behaves exactly like
               getdate() except it converts definable date
               and/or time specifications pointed to by string
               into a tm structure of calendar times beyond
               03:14:07 UTC  on January 19, 2038 with a limit of
               UTC 23:59:59 on December 31, 9999.
    
    ---------------------------------------------------------------
    
       Add these updates to the gettimeofday() function as follows:
    
         - bottom of the Standards/Extensions box
               Language Environment
    
         - end of the format section
               #define _LARGE_TIME_API
               #include <time.h>
               int gettimeofday64
                     (struct timeval64 *__restrict__ tp,
                                           void *__restrict__ tzp);
    
         - end of the general description.
               The function gettimeofday64() behaves exactly
               like gettimeofday() except it supports constructed
               calendar times beyond 03:14:07 UTC on
               January 19, 2038.  There is no support for an
               _ALL_SOURCE verion of gettimeofday64().
    
         - Returned Value should be completely rewritten to say:
               gettimeofday() and gettimeofday64() will return a
               zero unless the current time in seconds exceeds
               the arbritrary time of 23:59:59 UTC on
               December 31, 9999.
    
    ---------------------------------------------------------------
    
       Add these updates to the gmtime() function as follows:
    
         - bottom of the Standards/Extensions box
               Language Environment
    
         - end of the format section
               #define _LARGE_TIME_API
               #include <time.h>
               struct tm *gmtime64 (const time64_t *timer);
    
         - end of the general description
               The function gmtime64() behaves exactly like
               gmtime() except it breaks down a time64_t
               value pointing to a calendar time beyond
               03:14:07 UTC on January 19, 2038 with a limit
               of UTC 23:59:59 on December 31, 9999.
    
    ---------------------------------------------------------------
    
       Add these updates to the gmtime_r() function as follows:
    
         - bottom of the Standards/Extensions box
               Language Environment
    
         - end of the format section
               #define _LARGE_TIME_API
               #include <time.h>
               struct tm *gmtime64 _r
                            (const time64_t *__restrict__ clock,
                                   struct tm *__restrict__ result);
    
         - end of the general description
               The function gmtime64_r() behaves exactly
               like gmtime_r() except it breaks down a
               time64_t value pointing to a calendar time beyond
               03:14:07 UTC on January 19, 2038 with a  limit of
               UTC 23:59:59 on December 31, 9999.
    
    ---------------------------------------------------------------
    
       Add these updates to the localtime() function as follows:
    
         - bottom of the Standards/Extensions box
               Language Environment
    
         - end of the format section
               #define _LARGE_TIME_API
               #include <time.h>
               struct tm *localtime64 (const time64_t *timer)
    
         - end of the general description
               The function localtime64() behaves exactly
               like localtime() except breaks down a
               time64_t value pointing to a calendar time beyond
               03:14:07 UTC on January 19, 2038 with a limit of
               UTC 23:59:59 on December 31, 9999.
    
    ---------------------------------------------------------------
    
       Add these updates to the localtime_r() function as follows:
    
         - bottom of the Standards/Extensions box
               Language Environment
    
         - end of the format section
               #define _LARGE_TIME_API
               #include <time.h>
               struct tm *localtime64_r
                            (const time64_t *__restrict__ clock,
                                   struct tm *__restrict__ result);
    
         - end of the general description
               The function localtime64_r() behaves exactly
               like localtime_r() except it breaks down a
               time64_t value pointing to a calendar time beyond
               03:14:07 UTC on January 19, 2038 with a limit of
               UTC 23:59:59 on December 31, 9999.
    
    ---------------------------------------------------------------
    
       Add these updates to the mktime() function as follows:
    
         - bottom of the Standards/Extensions box
               Language Environment
    
         - end of the format section
               #define _LARGE_TIME_API
               #include <time.h>
               time64_t mktime64 (struct tm *timeptr)
    
         - end of the general decription
               The function mktime64() behaves exactly like
               mktime() except it supports a constructed calendar
               time beyond 23:59:59 UTC December 31, 2037.
    
    ---------------------------------------------------------------
    
       Add these updates to the time() function as follows:
    
         - bottom of the Standards/Extensions box
               Language Environment
    
         - end of the format section
               #define _LARGE_TIME_API
               #include <time.h>
               time64_t time64 (time64_t  *timer);
    
         - end of the general description
                The function time64() behaves exactly like
                time() except it supports constructed calendar
                times beyond 03:14:07 UTC  on January 19, 2038.
    
    ==============================================================
    z/OS XL C/C++ Programming Guide (SC09-4765-xx)
    ==============================================================
    
      APPENDIX1.10.3 getdate_err
    
      Add the following to the end of this appendix:
    
      The getdate64() interface affects the same pointer to the
       thread-specific value of getdate_err and uses the same
       getdate_err values as the getdate() interface.
    

APAR Information

  • APAR number

    PK83212

  • Reported component name

    LE C LIBRARY

  • Reported component ID

    568819805

  • Reported release

    730

  • Status

    CLOSED UR1

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    YesSpecatt / New Function / Xsystem

  • Submitted date

    2009-03-24

  • Closed date

    2009-06-22

  • Last modified date

    2009-08-03

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

    UK47653 UK47654 UK47655

Modules/Macros

  • CELHADMY CELHASCT CELHCNVT CELHCTME CELHDFTE
    CELHDFTM CELHGDAT CELHGMTM CELHGTOD CELHMKTM CELHTIME CELHTTRM
    CELHUTMP CELJADMY CELJASCT CELJCNVT CELJCTME CELJGDAT CELJGMTM
    CELJMKTM CELQADMY CELQASCT CELQCNVT CELQCTME CELQDFTE CELQDFTM
    CELQGDAT CELQGMTM CELQGTOD CELQMKTM CELQTIME CELQTTRM CELQUTMP
    CELZADMY CELZASCT CELZCNVT CELZCTME CELZGDAT CELZGMTM CELZMKTM
    CEL4ADMY EDC4H00D EDC4H02F EDC4H031 EDC4H05D EDC400A2 EDC400F2
    EDC4000D EDC40078 EDC40080 EDC40081 EDC40085 EDC4018A EDC4031E
    EDC40315 EDC40354 EDC40463 EJR      GETDATE  GTODINC  SYSTIME
    

Publications Referenced
SC233881XXSC094765XX   

Fix information

  • Fixed component name

    LE C LIBRARY

  • Fixed component ID

    568819805

Applicable component levels

  • R740 PSY UK47653

       UP09/07/09 P F907

  • R750 PSY UK47654

       UP09/07/09 P F907

  • R760 PSY UK47655

       UP09/07/09 P F907

Fix is available

  • Select the PTF appropriate for your component level. You will be required to sign in. Distribution on physical media is not available in all countries.

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSCVSBD","label":"Runtime"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"730","Edition":"","Line of Business":{"code":"","label":""}},{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SG19M","label":"APARs - z\/OS environment"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"730","Edition":"","Line of Business":{"code":"","label":""}},{"Business Unit":{"code":null,"label":null},"Product":{"code":"SG19O","label":"APARs - MVS environment"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"730","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
03 August 2009