IBM Support

IV49095: FWRITE() CANNOT WRITE MORE THAN 2GB ITEMS APPLIES TO AIX 7100-02

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The third parameter of fwrite() indicates how many items
    are to be written to the given stdio FILE pointer.
    
    Despite the fact that the parameter accepts a value
    larger than 2^31 (or expressed as 2**31), only 2^31-1
    items may be written.  Larger values result in zero
    bytes written an an errno of 22.
    
    For reference, a verbose prototype of fwrite() is
    expressed thusly:
    
    size_t fwrite(const void *p,        // Data source
                  size_t size,          // Size of each item
                  size_t NumberOfItems, // Number of items
                  FILE *stream)         // Destination
    

Local fix

  • If feasible, increase the "size" parameter by some
    integer multiple necessary to allow "NumberOfItems"
    to be expressed as a value less than 2^31.
    

Problem summary

  • A call to fwrite(), asking to write more than 2Gb items will
    fail with errno set to 22.
    

Problem conclusion

  • Code changes has been made to correct the data type of
    underlying variables to correctly handle the inputs provided
    by fwrite().
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV49095

  • Reported component name

    AIX V7.1

  • Reported component ID

    5765H4000

  • Reported release

    710

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Submitted date

    2013-09-17

  • Closed date

    2013-09-17

  • Last modified date

    2014-02-14

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

    IV39748

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

Fix information

  • Fixed component name

    AIX V7.1

  • Fixed component ID

    5765H4000

Applicable component levels

  • R710 PSY U864646

       UP14/02/14 I 1000

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSMV87","label":"AIX 6.1 Enterprise Edition"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"710","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSMVAX","label":"AIX Express Edition"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"710","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SG11R","label":"AIX 7.1 HIPERS, APARs and Fixes"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"710","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
14 February 2014