@@ -33,12 +33,12 @@ ngx_feature_run=no
33
33
ngx_feature_incs="#include <poll.h>"
34
34
ngx_feature_path=
35
35
ngx_feature_libs=
36
- ngx_feature_test="int n, dp; struct pollfd pl;
37
- dp = 0;
36
+ ngx_feature_test="int n; struct pollfd pl;
38
37
pl.fd = 0;
39
38
pl.events = 0;
40
39
pl.revents = 0;
41
- n = poll(&pl, 1, 0)"
40
+ n = poll(&pl, 1, 0);
41
+ if (n == -1) return 1"
42
42
. auto/feature
43
43
44
44
if [ $ngx_found = no ]; then
@@ -57,7 +57,8 @@ ngx_feature_test="int n, dp; struct dvpoll dvp;
57
57
dvp.dp_fds = NULL;
58
58
dvp.dp_nfds = 0;
59
59
dvp.dp_timeout = 0;
60
- n = ioctl(dp, DP_POLL, &dvp)"
60
+ n = ioctl(dp, DP_POLL, &dvp);
61
+ if (n == -1) return 1"
61
62
. auto/feature
62
63
63
64
if [ $ngx_found = yes ]; then
@@ -237,7 +238,7 @@ ngx_feature_incs="$NGX_INCLUDE_SYS_PARAM_H
237
238
ngx_feature_path=
238
239
ngx_feature_libs=
239
240
ngx_feature_test="struct statfs fs;
240
- statfs(NULL , &fs);"
241
+ statfs(\".\" , &fs);"
241
242
. auto/feature
242
243
243
244
@@ -249,7 +250,7 @@ ngx_feature_incs="#include <sys/types.h>
249
250
ngx_feature_path=
250
251
ngx_feature_libs=
251
252
ngx_feature_test="struct statvfs fs;
252
- statvfs(NULL , &fs);"
253
+ statvfs(\".\" , &fs);"
253
254
. auto/feature
254
255
255
256
@@ -343,6 +344,24 @@ ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_KEEPIDLE, NULL, 0);
343
344
. auto/feature
344
345
345
346
347
+ ngx_feature="TCP_INFO"
348
+ ngx_feature_name="NGX_HAVE_TCP_INFO"
349
+ ngx_feature_run=no
350
+ ngx_feature_incs="#include <sys/socket.h>
351
+ #include <netinet/in.h>
352
+ #include <netinet/tcp.h>"
353
+ ngx_feature_path=
354
+ ngx_feature_libs=
355
+ ngx_feature_test="socklen_t optlen = sizeof(struct tcp_info);
356
+ struct tcp_info ti;
357
+ ti.tcpi_rtt = 0;
358
+ ti.tcpi_rttvar = 0;
359
+ ti.tcpi_snd_cwnd = 0;
360
+ ti.tcpi_rcv_space = 0;
361
+ getsockopt(0, IPPROTO_TCP, TCP_INFO, &ti, &optlen)"
362
+ . auto/feature
363
+
364
+
346
365
ngx_feature="accept4()"
347
366
ngx_feature_name="NGX_HAVE_ACCEPT4"
348
367
ngx_feature_run=no
481
500
ngx_feature="setproctitle()"
482
501
ngx_feature_name="NGX_HAVE_SETPROCTITLE"
483
502
ngx_feature_run=no
484
- ngx_feature_incs=
503
+ ngx_feature_incs="#include <stdlib.h>"
485
504
ngx_feature_path=
486
505
ngx_feature_libs=$NGX_SETPROCTITLE_LIB
487
506
ngx_feature_test="setproctitle(\"test\");"
@@ -494,7 +513,8 @@ ngx_feature_run=no
494
513
ngx_feature_incs=
495
514
ngx_feature_path=
496
515
ngx_feature_libs=
497
- ngx_feature_test="char buf[1]; ssize_t n; n = pread(0, buf, 1, 0)"
516
+ ngx_feature_test="char buf[1]; ssize_t n; n = pread(0, buf, 1, 0);
517
+ if (n == -1) return 1"
498
518
. auto/feature
499
519
500
520
@@ -504,7 +524,8 @@ ngx_feature_run=no
504
524
ngx_feature_incs=
505
525
ngx_feature_path=
506
526
ngx_feature_libs=
507
- ngx_feature_test="char buf[1]; ssize_t n; n = pwrite(1, buf, 1, 0)"
527
+ ngx_feature_test="char buf[1]; ssize_t n; n = pwrite(1, buf, 1, 0);
528
+ if (n == -1) return 1"
508
529
. auto/feature
509
530
510
531
@@ -578,17 +599,20 @@ ngx_feature_run=no
578
599
ngx_feature_incs="#include <stdlib.h>"
579
600
ngx_feature_path=
580
601
ngx_feature_libs=
581
- ngx_feature_test="void *p; int n; n = posix_memalign(&p, 4096, 4096)"
602
+ ngx_feature_test="void *p; int n; n = posix_memalign(&p, 4096, 4096);
603
+ if (n != 0) return 1"
582
604
. auto/feature
583
605
584
606
585
607
ngx_feature="memalign()"
586
608
ngx_feature_name="NGX_HAVE_MEMALIGN"
587
609
ngx_feature_run=no
588
- ngx_feature_incs="#include <stdlib.h>"
610
+ ngx_feature_incs="#include <stdlib.h>
611
+ #include <malloc.h>"
589
612
ngx_feature_path=
590
613
ngx_feature_libs=
591
- ngx_feature_test="void *p; p = memalign(4096, 4096)"
614
+ ngx_feature_test="void *p; p = memalign(4096, 4096);
615
+ if (p == NULL) return 1"
592
616
. auto/feature
593
617
594
618
675
699
ngx_feature="struct msghdr.msg_control"
676
700
ngx_feature_name="NGX_HAVE_MSGHDR_MSG_CONTROL"
677
701
ngx_feature_run=no
678
- ngx_feature_incs="#include <sys/socket.h>"
702
+ ngx_feature_incs="#include <sys/socket.h>
703
+ #include <stdio.h>"
679
704
ngx_feature_path=
680
705
ngx_feature_libs=
681
- ngx_feature_test="struct msghdr msg; msg.msg_control = NULL"
706
+ ngx_feature_test="struct msghdr msg;
707
+ printf(\"%d\", (int) sizeof(msg.msg_control))"
682
708
. auto/feature
683
709
684
710
685
711
ngx_feature="ioctl(FIONBIO)"
686
712
ngx_feature_name="NGX_HAVE_FIONBIO"
687
713
ngx_feature_run=no
688
714
ngx_feature_incs="#include <sys/ioctl.h>
715
+ #include <stdio.h>
689
716
$NGX_INCLUDE_SYS_FILIO_H"
690
717
ngx_feature_path=
691
718
ngx_feature_libs=
692
- ngx_feature_test="int i; i = FIONBIO"
719
+ ngx_feature_test="int i = FIONBIO; printf(\"%d\", i) "
693
720
. auto/feature
694
721
695
722
696
723
ngx_feature="struct tm.tm_gmtoff"
697
724
ngx_feature_name="NGX_HAVE_GMTOFF"
698
725
ngx_feature_run=no
699
- ngx_feature_incs="#include <time.h>"
726
+ ngx_feature_incs="#include <time.h>
727
+ #include <stdio.h>"
700
728
ngx_feature_path=
701
729
ngx_feature_libs=
702
- ngx_feature_test="struct tm tm; tm.tm_gmtoff = 0"
730
+ ngx_feature_test="struct tm tm; tm.tm_gmtoff = 0;
731
+ printf(\"%d\", (int) tm.tm_gmtoff)"
703
732
. auto/feature
704
733
705
734
706
735
ngx_feature="struct dirent.d_namlen"
707
736
ngx_feature_name="NGX_HAVE_D_NAMLEN"
708
737
ngx_feature_run=no
709
- ngx_feature_incs="#include <dirent.h>"
738
+ ngx_feature_incs="#include <dirent.h>
739
+ #include <stdio.h>"
710
740
ngx_feature_path=
711
741
ngx_feature_libs=
712
- ngx_feature_test="struct dirent dir; dir.d_namlen = 0"
742
+ ngx_feature_test="struct dirent dir; dir.d_namlen = 0;
743
+ printf(\"%d\", (int) dir.d_namlen)"
713
744
. auto/feature
714
745
715
746
716
747
ngx_feature="struct dirent.d_type"
717
748
ngx_feature_name="NGX_HAVE_D_TYPE"
718
749
ngx_feature_run=no
719
- ngx_feature_incs="#include <dirent.h>"
750
+ ngx_feature_incs="#include <dirent.h>
751
+ #include <stdio.h>"
720
752
ngx_feature_path=
721
753
ngx_feature_libs=
722
- ngx_feature_test="struct dirent dir; dir.d_type = DT_REG"
754
+ ngx_feature_test="struct dirent dir; dir.d_type = DT_REG;
755
+ printf(\"%d\", (int) dir.d_type)"
723
756
. auto/feature
724
757
725
758
0 commit comments