PM81270: INCORRECT # BYTES READ RETURNED ON 1ST FREAD, AFTER AN FGETPOS, FOR AN RECFM=U FILE.

A fix is available

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • For an RECFM=U dataset, which is empty, the very first fread
    gets EOF from OSREAD and moreover '0' bytes read.
    
    But, if before the first fread, an fgetpos is done,
    the RECFM=U case returns the blksize value (8192 in this
    case) instead of 0 in that first fread.
    
      The rp84 read peg, never calls OSREAD the first time. It
    explicitly returns the blksize value due to a 'readdeferred'
    setting.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED: Users of RECFM=U data sets opened for        *
    *                 read and using Record I/O (type=record).     *
    ****************************************************************
    * PROBLEM DESCRIPTION: When the RECFM=U data set is empty,     *
    *                      an fread() correctly returns 0 bytes    *
    *                      read and feof() is true.  However, if   *
    *                      a call to fgetpos() is inserted         *
    *                      before the fread(), then fread()        *
    *                      incorrectly returns 'blksize' bytes,    *
    *                      as if a block had been read.            *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    See problem description.
    

Problem conclusion

  • The code that handles RECFM=U Record I/O is corrected to
    properly handle the case when the data set is empty and opened
    for read.  The first fread, whether or not preceded by a call to
    fgetpos, fseek (that does not change the position), or rewind
    will return 0 bytes.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PM81270

  • Reported component name

    LE C LIBRARY

  • Reported component ID

    568819805

  • Reported release

    770

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-01-23

  • Closed date

    2013-02-07

  • Last modified date

    2013-03-04

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

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

    UK91487 UK91489

Modules/Macros

  • CELHP084 CELQP084 EDC40052
    

Fix information

  • Fixed component name

    LE C LIBRARY

  • Fixed component ID

    568819805

Applicable component levels

  • R770 PSY UK91489

       UP13/02/27 P F302

  • R780 PSY UK91487

       UP13/02/27 P F302

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.



Rate this page:

(0 users)Average rating

Document information


More support for:

z/OS XL C/C++
Runtime

Software version:

770

Operating system(s):

MVS, z/OS

Reference #:

PM81270

Modified date:

2013-03-04

Translate my page

Machine Translation

Content navigation