@@ -16324,8 +16324,7 @@ fi
16324
16324
16325
16325
16326
16326
16327
-
16328
- for ac_func in cbrt dlopen fcvt fdatasync getpeereid getpeerucred getrlimit memmove poll posix_fadvise pstat readlink setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs
16327
+ for ac_func in cbrt dlopen fcvt fdatasync getpeereid getpeerucred getrlimit memmove poll pstat readlink setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs
16329
16328
do
16330
16329
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
16331
16330
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -16419,9 +16418,17 @@ fi
16419
16418
done
16420
16419
16421
16420
16422
- { echo "$as_me:$LINENO: checking whether fdatasync is declared" >&5
16423
- echo $ECHO_N "checking whether fdatasync is declared... $ECHO_C" >&6; }
16424
- if test "${ac_cv_have_decl_fdatasync+set}" = set; then
16421
+ # posix_fadvise() is a no-op on Solaris, so don't incur function overhead
16422
+ # by calling it, 2009-04-02
16423
+ # http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/posix_fadvise.c
16424
+ if test "$PORTNAME" != "solaris"; then
16425
+
16426
+ for ac_func in posix_fadvise
16427
+ do
16428
+ as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
16429
+ { echo "$as_me:$LINENO: checking for $ac_func" >&5
16430
+ echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
16431
+ if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
16425
16432
echo $ECHO_N "(cached) $ECHO_C" >&6
16426
16433
else
16427
16434
cat >conftest.$ac_ext <<_ACEOF
@@ -16430,13 +16437,103 @@ _ACEOF
16430
16437
cat confdefs.h >>conftest.$ac_ext
16431
16438
cat >>conftest.$ac_ext <<_ACEOF
16432
16439
/* end confdefs.h. */
16433
- #include <unistd.h>
16440
+ /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
16441
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
16442
+ #define $ac_func innocuous_$ac_func
16443
+
16444
+ /* System header to define __stub macros and hopefully few prototypes,
16445
+ which can conflict with char $ac_func (); below.
16446
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
16447
+ <limits.h> exists even on freestanding compilers. */
16448
+
16449
+ #ifdef __STDC__
16450
+ # include <limits.h>
16451
+ #else
16452
+ # include <assert.h>
16453
+ #endif
16454
+
16455
+ #undef $ac_func
16456
+
16457
+ /* Override any GCC internal prototype to avoid an error.
16458
+ Use char because int might match the return type of a GCC
16459
+ builtin and then its argument prototype would still apply. */
16460
+ #ifdef __cplusplus
16461
+ extern "C"
16462
+ #endif
16463
+ char $ac_func ();
16464
+ /* The GNU C library defines this for functions which it implements
16465
+ to always fail with ENOSYS. Some functions are actually named
16466
+ something starting with __ and the normal name is an alias. */
16467
+ #if defined __stub_$ac_func || defined __stub___$ac_func
16468
+ choke me
16469
+ #endif
16434
16470
16435
16471
int
16436
16472
main ()
16437
16473
{
16438
- #ifndef fdatasync
16439
- (void) fdatasync;
16474
+ return $ac_func ();
16475
+ ;
16476
+ return 0;
16477
+ }
16478
+ _ACEOF
16479
+ rm -f conftest.$ac_objext conftest$ac_exeext
16480
+ if { (ac_try="$ac_link"
16481
+ case "(($ac_try" in
16482
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16483
+ *) ac_try_echo=$ac_try;;
16484
+ esac
16485
+ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16486
+ (eval "$ac_link") 2>conftest.er1
16487
+ ac_status=$?
16488
+ grep -v '^ *+' conftest.er1 >conftest.err
16489
+ rm -f conftest.er1
16490
+ cat conftest.err >&5
16491
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
16492
+ (exit $ac_status); } && {
16493
+ test -z "$ac_c_werror_flag" ||
16494
+ test ! -s conftest.err
16495
+ } && test -s conftest$ac_exeext &&
16496
+ $as_test_x conftest$ac_exeext; then
16497
+ eval "$as_ac_var=yes"
16498
+ else
16499
+ echo "$as_me: failed program was:" >&5
16500
+ sed 's/^/| /' conftest.$ac_ext >&5
16501
+
16502
+ eval "$as_ac_var=no"
16503
+ fi
16504
+
16505
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
16506
+ conftest$ac_exeext conftest.$ac_ext
16507
+ fi
16508
+ ac_res=`eval echo '${'$as_ac_var'}'`
16509
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
16510
+ echo "${ECHO_T}$ac_res" >&6; }
16511
+ if test `eval echo '${'$as_ac_var'}'` = yes; then
16512
+ cat >>confdefs.h <<_ACEOF
16513
+ #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
16514
+ _ACEOF
16515
+
16516
+ fi
16517
+ done
16518
+
16519
+ { echo "$as_me:$LINENO: checking whether posix_fadvise is declared" >&5
16520
+ echo $ECHO_N "checking whether posix_fadvise is declared... $ECHO_C" >&6; }
16521
+ if test "${ac_cv_have_decl_posix_fadvise+set}" = set; then
16522
+ echo $ECHO_N "(cached) $ECHO_C" >&6
16523
+ else
16524
+ cat >conftest.$ac_ext <<_ACEOF
16525
+ /* confdefs.h. */
16526
+ _ACEOF
16527
+ cat confdefs.h >>conftest.$ac_ext
16528
+ cat >>conftest.$ac_ext <<_ACEOF
16529
+ /* end confdefs.h. */
16530
+ #include <fcntl.h>
16531
+
16532
+ int
16533
+ main ()
16534
+ {
16535
+ #ifndef posix_fadvise
16536
+ (void) posix_fadvise;
16440
16537
#endif
16441
16538
16442
16539
;
@@ -16460,37 +16557,39 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16460
16557
test -z "$ac_c_werror_flag" ||
16461
16558
test ! -s conftest.err
16462
16559
} && test -s conftest.$ac_objext; then
16463
- ac_cv_have_decl_fdatasync =yes
16560
+ ac_cv_have_decl_posix_fadvise =yes
16464
16561
else
16465
16562
echo "$as_me: failed program was:" >&5
16466
16563
sed 's/^/| /' conftest.$ac_ext >&5
16467
16564
16468
- ac_cv_have_decl_fdatasync =no
16565
+ ac_cv_have_decl_posix_fadvise =no
16469
16566
fi
16470
16567
16471
16568
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16472
16569
fi
16473
- { echo "$as_me:$LINENO: result: $ac_cv_have_decl_fdatasync " >&5
16474
- echo "${ECHO_T}$ac_cv_have_decl_fdatasync " >&6; }
16475
- if test $ac_cv_have_decl_fdatasync = yes; then
16570
+ { echo "$as_me:$LINENO: result: $ac_cv_have_decl_posix_fadvise " >&5
16571
+ echo "${ECHO_T}$ac_cv_have_decl_posix_fadvise " >&6; }
16572
+ if test $ac_cv_have_decl_posix_fadvise = yes; then
16476
16573
16477
16574
cat >>confdefs.h <<_ACEOF
16478
- #define HAVE_DECL_FDATASYNC 1
16575
+ #define HAVE_DECL_POSIX_FADVISE 1
16479
16576
_ACEOF
16480
16577
16481
16578
16482
16579
else
16483
16580
cat >>confdefs.h <<_ACEOF
16484
- #define HAVE_DECL_FDATASYNC 0
16581
+ #define HAVE_DECL_POSIX_FADVISE 0
16485
16582
_ACEOF
16486
16583
16487
16584
16488
16585
fi
16489
16586
16490
16587
16491
- { echo "$as_me:$LINENO: checking whether posix_fadvise is declared" >&5
16492
- echo $ECHO_N "checking whether posix_fadvise is declared... $ECHO_C" >&6; }
16493
- if test "${ac_cv_have_decl_posix_fadvise+set}" = set; then
16588
+ fi
16589
+
16590
+ { echo "$as_me:$LINENO: checking whether fdatasync is declared" >&5
16591
+ echo $ECHO_N "checking whether fdatasync is declared... $ECHO_C" >&6; }
16592
+ if test "${ac_cv_have_decl_fdatasync+set}" = set; then
16494
16593
echo $ECHO_N "(cached) $ECHO_C" >&6
16495
16594
else
16496
16595
cat >conftest.$ac_ext <<_ACEOF
@@ -16499,13 +16598,13 @@ _ACEOF
16499
16598
cat confdefs.h >>conftest.$ac_ext
16500
16599
cat >>conftest.$ac_ext <<_ACEOF
16501
16600
/* end confdefs.h. */
16502
- #include <fcntl .h>
16601
+ #include <unistd .h>
16503
16602
16504
16603
int
16505
16604
main ()
16506
16605
{
16507
- #ifndef posix_fadvise
16508
- (void) posix_fadvise ;
16606
+ #ifndef fdatasync
16607
+ (void) fdatasync ;
16509
16608
#endif
16510
16609
16511
16610
;
@@ -16529,28 +16628,28 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16529
16628
test -z "$ac_c_werror_flag" ||
16530
16629
test ! -s conftest.err
16531
16630
} && test -s conftest.$ac_objext; then
16532
- ac_cv_have_decl_posix_fadvise =yes
16631
+ ac_cv_have_decl_fdatasync =yes
16533
16632
else
16534
16633
echo "$as_me: failed program was:" >&5
16535
16634
sed 's/^/| /' conftest.$ac_ext >&5
16536
16635
16537
- ac_cv_have_decl_posix_fadvise =no
16636
+ ac_cv_have_decl_fdatasync =no
16538
16637
fi
16539
16638
16540
16639
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16541
16640
fi
16542
- { echo "$as_me:$LINENO: result: $ac_cv_have_decl_posix_fadvise " >&5
16543
- echo "${ECHO_T}$ac_cv_have_decl_posix_fadvise " >&6; }
16544
- if test $ac_cv_have_decl_posix_fadvise = yes; then
16641
+ { echo "$as_me:$LINENO: result: $ac_cv_have_decl_fdatasync " >&5
16642
+ echo "${ECHO_T}$ac_cv_have_decl_fdatasync " >&6; }
16643
+ if test $ac_cv_have_decl_fdatasync = yes; then
16545
16644
16546
16645
cat >>confdefs.h <<_ACEOF
16547
- #define HAVE_DECL_POSIX_FADVISE 1
16646
+ #define HAVE_DECL_FDATASYNC 1
16548
16647
_ACEOF
16549
16648
16550
16649
16551
16650
else
16552
16651
cat >>confdefs.h <<_ACEOF
16553
- #define HAVE_DECL_POSIX_FADVISE 0
16652
+ #define HAVE_DECL_FDATASYNC 0
16554
16653
_ACEOF
16555
16654
16556
16655
0 commit comments