@@ -450,6 +450,21 @@ init_io_intf ()
450
450
else
451
451
__real_fgetpos64 = dlsym (dlflag , "fgetpos64" );
452
452
453
+ __real_fsetpos64_2_17 = dlvsym (dlflag , "fsetpos64" , "GLIBC_2.17" );
454
+ __real_fsetpos64_2_2_5 = dlvsym (dlflag , "fsetpos64" , "GLIBC_2.2.5" );
455
+ __real_fsetpos64_2_2 = dlvsym (dlflag , "fsetpos64" , "GLIBC_2.2" );
456
+ __real_fsetpos64_2_1 = dlvsym (dlflag , "fsetpos64" , "GLIBC_2.1" );
457
+ if (__real_fsetpos64_2_17 )
458
+ __real_fsetpos64 = __real_fsetpos64_2_17 ;
459
+ else if (__real_fsetpos64_2_2_5 )
460
+ __real_fsetpos64 = __real_fsetpos64_2_2_5 ;
461
+ else if (__real_fsetpos64_2_2 )
462
+ __real_fsetpos64 = __real_fsetpos64_2_2 ;
463
+ else if (__real_fsetpos64_2_1 )
464
+ __real_fsetpos64 = __real_fsetpos64_2_1 ;
465
+ else
466
+ __real_fsetpos64 = dlsym (dlflag , "fsetpos64" );
467
+
453
468
__real_pread_2_2 = dlvsym (dlflag , "pread" , "GLIBC_2.2" );
454
469
if (__real_pread_2_2 )
455
470
__real_pread = __real_pread_2_2 ;
@@ -1001,21 +1016,21 @@ gprofng_open64 (int(real_open64) (const char *, int, ...),
1001
1016
return fd ;
1002
1017
}
1003
1018
1004
- #define DCL_OPEN64 (dcl_f , real_f ) \
1019
+ #define DCL_OPEN64 (dcl_f ) \
1005
1020
int dcl_f (const char *path, int oflag, ...) \
1006
1021
{ \
1007
- if ((real_f) == NULL) \
1022
+ if (__real_open64 == NULL) \
1008
1023
init_io_intf (); \
1009
1024
mode_t mode; \
1010
1025
va_list ap; \
1011
1026
va_start (ap, oflag); \
1012
1027
mode = va_arg (ap, mode_t); \
1013
1028
va_end (ap); \
1014
- return gprofng_open64 (real_f , path, oflag, mode); \
1029
+ return gprofng_open64 (__real_open64 , path, oflag, mode); \
1015
1030
}
1016
1031
1017
1032
DCL_FUNC_VER (DCL_OPEN64 , open64_2_2 , open64 @GLIBC_2 .2 )
1018
- DCL_OPEN64 (open64 , CALL_REAL ( open64 ) )
1033
+ DCL_OPEN64 (open64 )
1019
1034
1020
1035
1021
1036
#define F_ERROR_ARG 0
@@ -1516,19 +1531,19 @@ gprofng_fopen (FILE*(real_fopen) (), const char *filename, const char *mode)
1516
1531
return fp ;
1517
1532
}
1518
1533
1519
- #define DCL_FOPEN (dcl_f , real_f ) \
1534
+ #define DCL_FOPEN (dcl_f ) \
1520
1535
FILE *dcl_f (const char *filename, const char *mode) \
1521
1536
{ \
1522
- if ((real_f) == NULL) \
1537
+ if (__real_fopen == NULL) \
1523
1538
init_io_intf (); \
1524
- return gprofng_fopen (real_f , filename, mode); \
1539
+ return gprofng_fopen (__real_fopen , filename, mode); \
1525
1540
}
1526
1541
1527
1542
DCL_FUNC_VER (DCL_FOPEN , fopen_2_17 , fopen @GLIBC_2 .17 )
1528
1543
DCL_FUNC_VER (DCL_FOPEN , fopen_2_2_5 , fopen @GLIBC_2 .2.5 )
1529
1544
DCL_FUNC_VER (DCL_FOPEN , fopen_2_1 , fopen @GLIBC_2 .1 )
1530
1545
DCL_FUNC_VER (DCL_FOPEN , fopen_2_0 , fopen @GLIBC_2 .0 )
1531
- DCL_FOPEN (fopen , CALL_REAL ( fopen ) )
1546
+ DCL_FOPEN (fopen )
1532
1547
1533
1548
/*------------------------------------------------------------- fclose */
1534
1549
static int
@@ -1564,19 +1579,19 @@ gprofng_fclose (int(real_fclose) (), FILE *stream)
1564
1579
return stat ;
1565
1580
}
1566
1581
1567
- #define DCL_FCLOSE (dcl_f , real_f ) \
1582
+ #define DCL_FCLOSE (dcl_f ) \
1568
1583
int dcl_f (FILE *stream) \
1569
1584
{ \
1570
- if ((real_f) == NULL) \
1585
+ if (__real_fclose == NULL) \
1571
1586
init_io_intf (); \
1572
- return gprofng_fclose (real_f , stream); \
1587
+ return gprofng_fclose (__real_fclose , stream); \
1573
1588
}
1574
1589
1575
1590
DCL_FUNC_VER (DCL_FCLOSE , fclose_2_17 , fclose @GLIBC_2 .17 )
1576
1591
DCL_FUNC_VER (DCL_FCLOSE , fclose_2_2_5 , fclose @GLIBC_2 .2.5 )
1577
1592
DCL_FUNC_VER (DCL_FCLOSE , fclose_2_1 , fclose @GLIBC_2 .1 )
1578
1593
DCL_FUNC_VER (DCL_FCLOSE , fclose_2_0 , fclose @GLIBC_2 .0 )
1579
- DCL_FCLOSE (fclose , CALL_REAL ( fclose ) )
1594
+ DCL_FCLOSE (fclose )
1580
1595
1581
1596
/*------------------------------------------------------------- fflush */
1582
1597
int
@@ -1653,19 +1668,19 @@ gprofng_fdopen (FILE*(real_fdopen) (), int fildes, const char *mode)
1653
1668
return fp ;
1654
1669
}
1655
1670
1656
- #define DCL_FDOPEN (dcl_f , real_f ) \
1671
+ #define DCL_FDOPEN (dcl_f ) \
1657
1672
FILE *dcl_f (int fildes, const char *mode) \
1658
1673
{ \
1659
- if ((real_f) == NULL) \
1674
+ if (__real_fdopen == NULL) \
1660
1675
init_io_intf (); \
1661
- return gprofng_fdopen (real_f , fildes, mode); \
1676
+ return gprofng_fdopen (__real_fdopen , fildes, mode); \
1662
1677
}
1663
1678
1664
1679
DCL_FUNC_VER (DCL_FDOPEN , fdopen_2_17 , fdopen @GLIBC_2 .17 )
1665
1680
DCL_FUNC_VER (DCL_FDOPEN , fdopen_2_2_5 , fdopen @GLIBC_2 .2.5 )
1666
1681
DCL_FUNC_VER (DCL_FDOPEN , fdopen_2_1 , fdopen @GLIBC_2 .1 )
1667
1682
DCL_FUNC_VER (DCL_FDOPEN , fdopen_2_0 , fdopen @GLIBC_2 .0 )
1668
- DCL_FDOPEN (fdopen , CALL_REAL ( fdopen ) )
1683
+ DCL_FDOPEN (fdopen )
1669
1684
1670
1685
/*------------------------------------------------------------- dup */
1671
1686
int
@@ -2088,16 +2103,16 @@ gprofng_pread (ssize_t(real_pread) (int, void *, size_t, off_t),
2088
2103
return ret ;
2089
2104
}
2090
2105
2091
- #define DCL_PREAD (dcl_f , real_f ) \
2106
+ #define DCL_PREAD (dcl_f ) \
2092
2107
ssize_t dcl_f (int fildes, void *buf, size_t nbyte, off_t offset) \
2093
2108
{ \
2094
- if ((real_f) == NULL) \
2109
+ if (__real_pread == NULL) \
2095
2110
init_io_intf (); \
2096
- return gprofng_pread (real_f , fildes, buf, nbyte, offset); \
2111
+ return gprofng_pread (__real_pread , fildes, buf, nbyte, offset); \
2097
2112
}
2098
2113
2099
2114
DCL_FUNC_VER (DCL_PREAD , pread_2_2 , pread @GLIBC_2 .2 )
2100
- DCL_PREAD (pread , CALL_REAL ( pread ) )
2115
+ DCL_PREAD (pread )
2101
2116
2102
2117
/*------------------------------------------------------------- pwrite */
2103
2118
@@ -2914,19 +2929,19 @@ gprofng_fgetpos (int(real_fgetpos) (FILE *stream, fpos_t *pos),
2914
2929
return ret ;
2915
2930
}
2916
2931
2917
- #define DCL_FGETPOS (dcl_f , real_f ) \
2932
+ #define DCL_FGETPOS (dcl_f ) \
2918
2933
int dcl_f (FILE *stream, fpos_t *pos) \
2919
2934
{ \
2920
- if ((real_f) == NULL) \
2935
+ if (__real_fgetpos == NULL) \
2921
2936
init_io_intf (); \
2922
- return gprofng_fgetpos (real_f , stream, pos); \
2937
+ return gprofng_fgetpos (__real_fgetpos , stream, pos); \
2923
2938
}
2924
2939
2925
2940
DCL_FUNC_VER (DCL_FGETPOS , fgetpos_2_17 , fgetpos @GLIBC_2 .17 )
2926
2941
DCL_FUNC_VER (DCL_FGETPOS , fgetpos_2_2_5 , fgetpos @GLIBC_2 .2 .5 )
2927
2942
DCL_FUNC_VER (DCL_FGETPOS , fgetpos_2_2 , fgetpos @GLIBC_2 .2 )
2928
2943
DCL_FUNC_VER (DCL_FGETPOS , fgetpos_2_0 , fgetpos @GLIBC_2 .0 )
2929
- DCL_FGETPOS (fgetpos , CALL_REAL ( fgetpos ) )
2944
+ DCL_FGETPOS (fgetpos )
2930
2945
2931
2946
/*------------------------------------------------------------- fgetpos64 */
2932
2947
static int
@@ -2962,19 +2977,19 @@ gprofng_fgetpos64 (int(real_fgetpos64) (), FILE *stream, fpos64_t *pos)
2962
2977
return ret ;
2963
2978
}
2964
2979
2965
- #define DCL_FGETPOS64 (dcl_f , real_f ) \
2980
+ #define DCL_FGETPOS64 (dcl_f ) \
2966
2981
int dcl_f (FILE *stream, fpos64_t *pos) \
2967
2982
{ \
2968
- if ((real_f) == NULL) \
2983
+ if (__real_fgetpos64 == NULL) \
2969
2984
init_io_intf (); \
2970
- return gprofng_fgetpos64 (real_f , stream, pos); \
2985
+ return gprofng_fgetpos64 (__real_fgetpos64 , stream, pos); \
2971
2986
}
2972
2987
2973
2988
DCL_FUNC_VER (DCL_FGETPOS64 , fgetpos64_2_17 , fgetpos64 @GLIBC_2 .17 )
2974
2989
DCL_FUNC_VER (DCL_FGETPOS64 , fgetpos64_2_2_5 , fgetpos64 @GLIBC_2 .2 .5 )
2975
2990
DCL_FUNC_VER (DCL_FGETPOS64 , fgetpos64_2_2 , fgetpos64 @GLIBC_2 .2 )
2976
2991
DCL_FUNC_VER (DCL_FGETPOS64 , fgetpos64_2_1 , fgetpos64 @GLIBC_2 .1 )
2977
- DCL_FGETPOS64 (fgetpos64 , CALL_REAL ( fgetpos64 ) )
2992
+ DCL_FGETPOS64 (fgetpos64 )
2978
2993
2979
2994
/*------------------------------------------------------------- fsetpos */
2980
2995
static int
@@ -3011,19 +3026,19 @@ gprofng_fsetpos (int(real_fsetpos) (FILE *, const fpos_t *),
3011
3026
return ret ;
3012
3027
}
3013
3028
3014
- #define DCL_FSETPOS (dcl_f , real_f ) \
3029
+ #define DCL_FSETPOS (dcl_f ) \
3015
3030
int dcl_f (FILE *stream, const fpos_t *pos) \
3016
3031
{ \
3017
- if ((real_f) == NULL) \
3032
+ if (__real_fsetpos == NULL) \
3018
3033
init_io_intf (); \
3019
- return gprofng_fsetpos (real_f , stream, pos); \
3034
+ return gprofng_fsetpos (__real_fsetpos , stream, pos); \
3020
3035
}
3021
3036
3022
3037
DCL_FUNC_VER (DCL_FSETPOS , fsetpos_2_17 , fsetpos @GLIBC_2 .17 )
3023
3038
DCL_FUNC_VER (DCL_FSETPOS , fsetpos_2_2_5 , fsetpos @GLIBC_2 .2 .5 )
3024
3039
DCL_FUNC_VER (DCL_FSETPOS , fsetpos_2_2 , fsetpos @GLIBC_2 .2 )
3025
3040
DCL_FUNC_VER (DCL_FSETPOS , fsetpos_2_0 , fsetpos @GLIBC_2 .0 )
3026
- DCL_FSETPOS (fsetpos , CALL_REAL ( fsetpos ) )
3041
+ DCL_FSETPOS (fsetpos )
3027
3042
3028
3043
/*------------------------------------------------------------- fsetpos64 */
3029
3044
static int
@@ -3060,19 +3075,19 @@ gprofng_fsetpos64 (int(real_fsetpos64) (FILE *, const fpos64_t *),
3060
3075
return ret ;
3061
3076
}
3062
3077
3063
- #define DCL_FSETPOS64 (dcl_f , real_f ) \
3078
+ #define DCL_FSETPOS64 (dcl_f ) \
3064
3079
int dcl_f (FILE *stream, const fpos64_t *pos) \
3065
3080
{ \
3066
- if ((real_f) == NULL) \
3081
+ if (__real_fsetpos64 == NULL) \
3067
3082
init_io_intf (); \
3068
- return gprofng_fsetpos64 (real_f , stream, pos); \
3083
+ return gprofng_fsetpos64 (__real_fsetpos64 , stream, pos); \
3069
3084
}
3070
3085
3071
3086
DCL_FUNC_VER (DCL_FSETPOS64 , fsetpos64_2_17 , fsetpos64 @GLIBC_2 .17 )
3072
3087
DCL_FUNC_VER (DCL_FSETPOS64 , fsetpos64_2_2_5 , fsetpos64 @GLIBC_2 .2 .5 )
3073
3088
DCL_FUNC_VER (DCL_FSETPOS64 , fsetpos64_2_2 , fsetpos64 @GLIBC_2 .2 )
3074
3089
DCL_FUNC_VER (DCL_FSETPOS64 , fsetpos64_2_1 , fsetpos64 @GLIBC_2 .1 )
3075
- DCL_FSETPOS64 (fsetpos64 , CALL_REAL ( fsetpos64 ) )
3090
+ DCL_FSETPOS64 (fsetpos64 )
3076
3091
3077
3092
/*------------------------------------------------------------- fsync */
3078
3093
int
0 commit comments