__librel() — Query release level

Standards

Standards / Extensions C or C++ Dependencies
Language Environment both  

Format

#include <stdlib.h>

int __librel(void);

General description

The __librel() function provides the release level of the z/OS® XL C/C++ library. To use this function, you must compile your application with LANGLVL(EXTENDED).

Returned value

The __librel() function returns the z/OS XL C/C++ library release level that your application is using. The value is printed in hexadecimal format. The first byte of the value returned contains the product and version, second byte the release, and the third and fourth bytes contain the modification level.

Figure 1 shows the format of the hexadecimal value returned by the __librel() function.
Figure 1. Format of the __librel() function return value
0xPVRRMMMM
  ||||||||
  ||||++++ Modification Level (M)
  ||++---- Release (R)
  |+------ Version (V)
  +------- Product Number (P)
Table 1 correlates library release level with the corresponding __librel() return value.
Table 1. Library release level and value returned by the __librel() function
Library release level Return value Notes
z/OS V2.1 0x42010000  
z/OS V1.13 0x410D0000  
z/OS V1.12 0x410C0000  
z/OS V1.11 0x410B0000  
z/OS V1.10 0x410A0000  
z/OS V1.9 0x41090000  
z/OS V1.8 0x41080000  
z/OS V1.7 0x41070000  
z/OS V1.6 0x41060000  
z/OS V1.5 0x41050000  
z/OS V1.4 0x41040000  
z/OS V1.3 0x41030000  
z/OS V1.2 0x41020000  
z/OS V1.1 0x220A0000 When running under z/OS V1.1, the __librel() function returns the same value as returned for OS/390 V2.10.
OS/390® V2.10 0x220A0000  
OS/390 V2.9 0x22090000  
OS/390 V2.8 0x22080000  
C/370™ V2.2 0x02020000 For application running under the C/370 specific library (the common library version), the product designation is 0.

Example

CELEBL04
⁄* CELEBL04

   This example calls the __librel() function that returns
   the library release level your program is currently
   using in the following hexadecimal format 0xPVRRMMMM.

 *⁄
#include <stdio.h>
#include <stdlib.h>

int main(void)
{
   printf("The current release of the library is: %X\n",__librel());
}
Output
The current release of the library is: 42010000

Related information