diff --git a/COPYRIGHT b/COPYRIGHT index 628ee6cc48d3..013202c0fb09 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -3,7 +3,7 @@ This file is automatically generated from html/copyright.html jpg "Clone me," says Dolly sheepishly. - Last update: 4-Feb-2020 23:47 UTC + Last update: 2-Mar-2023 05:21 UTC __________________________________________________________________ The following copyright notice applies to all files collectively called @@ -28,11 +28,11 @@ This file is automatically generated from html/copyright.html * * *********************************************************************** - Content starting in 2011 from Harlan Stenn, Danny Mayer, and Martin - Burnicki is: + Content starting in 2011 from Harlan Stenn, Juergen Perlinger, Dave + Hart, Danny Mayer, Martin Burnicki, and possibly others is: *********************************************************************** * * -* Copyright (c) Network Time Foundation 2011-2020 * +* Copyright (c) Network Time Foundation 2011-2023 * * * * All Rights Reserved * * * @@ -85,73 +85,75 @@ This file is automatically generated from html/copyright.html 13. [14]Steve Clift OMEGA clock driver 14. [15]Casey Crellin vxWorks (Tornado) port and help with target configuration - 15. [16]Sven Dietrich Palisade reference + 15. [16]Philippe De Muyter Wharton reference clock + driver, sysV68 and AIX modifications. + 16. [17]Sven Dietrich Palisade reference clock driver, NT adj. residuals, integrated Greg's Winnt port. - 16. [17]John A. Dundas III Apple A/UX port - 17. [18]Torsten Duwe Linux port - 18. [19]Dennis Ferguson foundation code for + 17. [18]John A. Dundas III Apple A/UX port + 18. [19]Torsten Duwe Linux port + 19. [20]Dennis Ferguson foundation code for NTP Version 2 as specified in RFC-1119 - 19. [20]John Hay IPv6 support and testing - 20. [21]Dave Hart General maintenance, Windows - port interpolation rewrite - 21. [22]Claas Hilbrecht NeoClock4X clock driver - 22. [23]Glenn Hollinger GOES clock driver - 23. [24]Mike Iglesias DEC Alpha port - 24. [25]Jim Jagielski A/UX port - 25. [26]Jeff Johnson massive prototyping + 20. [21]John Hay IPv6 support and testing + 21. [22]Dave Hart General maintenance, IPv6 + cleanup, Windows PPSAPI + 22. [23]Claas Hilbrecht NeoClock4X clock driver + 23. [24]Glenn Hollinger GOES clock driver + 24. [25]Mike Iglesias DEC Alpha port + 25. [26]Jim Jagielski A/UX port + 26. [27]Jeff Johnson massive prototyping overhaul - 26. [27]Hans Lambermont or - [28] ntpsweep - 27. [29]Poul-Henning Kamp Oncore driver (Original + 27. [28]Hans Lambermont or + [29] ntpsweep + 28. [30]Poul-Henning Kamp Oncore driver (Original author) - 28. [30]Frank Kardel [31] PARSE + 29. [31]Frank Kardel [32] PARSE (driver 14 reference clocks), STREAMS modules for PARSE, support scripts, syslog cleanup, dynamic interface handling - 29. [32]Johannes Maximilian Kuehn Rewrote sntp to + 30. [33]Johannes Maximilian Kuehn Rewrote sntp to comply with NTPv4 specification, ntpq saveconfig - 30. [33]William L. Jones RS/6000 AIX + 31. [34]William L. Jones RS/6000 AIX modifications, HPUX modifications - 31. [34]Dave Katz RS/6000 AIX port - 32. [35]Craig Leres 4.4BSD port, ppsclock, Magnavox + 32. [35]Dave Katz RS/6000 AIX port + 33. [36]Craig Leres 4.4BSD port, ppsclock, Magnavox GPS clock driver - 33. [36]George Lindholm SunOS 5.1 port - 34. [37]Louis A. Mamakos MD5-based authentication - 35. [38]Lars H. Mathiesen adaptation of foundation + 34. [37]George Lindholm SunOS 5.1 port + 35. [38]Louis A. Mamakos MD5-based authentication + 36. [39]Lars H. Mathiesen adaptation of foundation code for Version 3 as specified in RFC-1305 - 36. [39]Danny Mayer Network I/O, Windows Port, Code + 37. [40]Danny Mayer Network I/O, Windows Port, Code Maintenance - 37. [40]David L. Mills Version 4 foundation, precision + 38. [41]David L. Mills Version 4 foundation, precision kernel; clock drivers: 1, 3, 4, 6, 7, 11, 13, 18, 19, 22, 36 - 38. [41]Wolfgang Moeller VMS port - 39. [42]Jeffrey Mogul ntptrace utility - 40. [43]Tom Moore i386 svr4 port - 41. [44]Kamal A Mostafa SCO OpenServer port - 42. [45]Derek Mulcahy and [46]Damon + 39. [42]Wolfgang Moeller VMS port + 40. [43]Jeffrey Mogul ntptrace utility + 41. [44]Tom Moore i386 svr4 port + 42. [45]Kamal A Mostafa SCO OpenServer port + 43. [46]Derek Mulcahy and [47]Damon Hart-Davis ARCRON MSF clock driver - 43. [47]Rob Neal Bancomm refclock and config/parse code + 44. [48]Rob Neal Bancomm refclock and config/parse code maintenance - 44. [48]Rainer Pruy + 45. [49]Rainer Pruy monitoring/trap scripts, statistics file handling - 45. [49]Dirce Richards Digital UNIX V4.0 port - 46. [50]Wilfredo Sánchez added support for NetInfo - 47. [51]Nick Sayer SunOS streams modules - 48. [52]Jack Sasportas Saved a Lot of + 46. [50]Dirce Richards Digital UNIX V4.0 port + 47. [51]Wilfredo Sánchez added support for NetInfo + 48. [52]Nick Sayer SunOS streams modules + 49. [53]Jack Sasportas Saved a Lot of space on the stuff in the html/pic/ subdirectory - 49. [53]Ray Schnitzler Unixware1 port - 50. [54]Michael Shields USNO clock driver - 51. [55]Jeff Steinman Datum PTS clock driver - 52. [56]Harlan Stenn GNU automake/autoconfigure + 50. [54]Ray Schnitzler Unixware1 port + 51. [55]Michael Shields USNO clock driver + 52. [56]Jeff Steinman Datum PTS clock driver + 53. [57]Harlan Stenn GNU automake/autoconfigure makeover, various other bits (see the ChangeLog) - 53. [57]Kenneth Stone HP-UX port - 54. [58]Ajit Thyagarajan IP multicast/anycast support - 55. [59]Tomoaki TSURUOKA TRAK clock driver - 56. [60]Brian Utterback General codebase, + 54. [58]Kenneth Stone HP-UX port + 55. [59]Ajit Thyagarajan IP multicast/anycast support + 56. [60]Tomoaki TSURUOKA TRAK clock driver + 57. [61]Brian Utterback General codebase, Solaris issues - 57. [61]Loganaden Velvindron Sandboxing + 58. [62]Loganaden Velvindron Sandboxing (libseccomp) support - 58. [62]Paul A Vixie TrueTime GPS driver, generic + 59. [63]Paul A Vixie TrueTime GPS driver, generic TrueTime clock driver - 59. [63]Ulrich Windl corrected and + 60. [64]Ulrich Windl corrected and validated HTML documents according to the HTML DTD __________________________________________________________________ @@ -172,51 +174,52 @@ References 13. mailto:%20reg@dwf.com 14. mailto:%20clift@ml.csiro.au 15. mailto:%20casey@csc.co.za - 16. mailto:%20Sven_Dietrich@trimble.COM - 17. mailto:%20dundas@salt.jpl.nasa.gov - 18. mailto:%20duwe@immd4.informatik.uni-erlangen.de - 19. mailto:%20dennis@mrbill.canet.ca - 20. mailto:%20jhay@icomtek.csir.co.za - 21. mailto:%20davehart@davehart.com - 22. mailto:%20neoclock4x@linum.com - 23. mailto:%20glenn@herald.usask.ca - 24. mailto:%20iglesias@uci.edu - 25. mailto:%20jagubox.gsfc.nasa.gov - 26. mailto:%20jbj@chatham.usdesign.com - 27. mailto:%20Hans.Lambermont@nl.origin-it.com - 28. mailto:H.Lambermont@chello.nl - 29. mailto:%20phk@FreeBSD.ORG - 30. http://www4.informatik.uni-erlangen.de/%7ekardel - 31. mailto:%20kardel%20%28at%29%20ntp%20%28dot%29%20org - 32. mailto:kuehn@ntp.org - 33. mailto:%20jones@hermes.chpc.utexas.edu - 34. mailto:%20dkatz@cisco.com - 35. mailto:%20leres@ee.lbl.gov - 36. mailto:%20lindholm@ucs.ubc.ca - 37. mailto:%20louie@ni.umd.edu - 38. mailto:%20thorinn@diku.dk - 39. mailto:%20mayer@ntp.org - 40. mailto:%20mills@udel.edu - 41. mailto:%20moeller@gwdgv1.dnet.gwdg.de - 42. mailto:%20mogul@pa.dec.com - 43. mailto:%20tmoore@fievel.daytonoh.ncr.com - 44. mailto:%20kamal@whence.com - 45. mailto:%20derek@toybox.demon.co.uk - 46. mailto:%20d@hd.org - 47. mailto:%20neal@ntp.org - 48. mailto:%20Rainer.Pruy@informatik.uni-erlangen.de - 49. mailto:%20dirce@zk3.dec.com - 50. mailto:%20wsanchez@apple.com - 51. mailto:%20mrapple@quack.kfu.com - 52. mailto:%20jack@innovativeinternet.com - 53. mailto:%20schnitz@unipress.com - 54. mailto:%20shields@tembel.org - 55. mailto:%20pebbles.jpl.nasa.gov - 56. mailto:%20harlan@pfcs.com - 57. mailto:%20ken@sdd.hp.com - 58. mailto:%20ajit@ee.udel.edu - 59. mailto:%20tsuruoka@nc.fukuoka-u.ac.jp - 60. mailto:%20brian.utterback@oracle.com - 61. mailto:%20loganaden@gmail.com - 62. mailto:%20vixie@vix.com - 63. mailto:%20Ulrich.Windl@rz.uni-regensburg.de + 16. mailto:%20phdm@macqel.be + 17. mailto:%20Sven_Dietrich@trimble.COM + 18. mailto:%20dundas@salt.jpl.nasa.gov + 19. mailto:%20duwe@immd4.informatik.uni-erlangen.de + 20. mailto:%20dennis@mrbill.canet.ca + 21. mailto:%20jhay@icomtek.csir.co.za + 22. mailto:%20davehart@gmail.com + 23. mailto:%20neoclock4x@linum.com + 24. mailto:%20glenn@herald.usask.ca + 25. mailto:%20iglesias@uci.edu + 26. mailto:%20jagubox.gsfc.nasa.gov + 27. mailto:%20jbj@chatham.usdesign.com + 28. mailto:%20Hans.Lambermont@nl.origin-it.com + 29. mailto:H.Lambermont@chello.nl + 30. mailto:%20phk@FreeBSD.ORG + 31. http://www4.informatik.uni-erlangen.de/%7ekardel + 32. mailto:%20kardel%20%28at%29%20ntp%20%28dot%29%20org + 33. mailto:kuehn@ntp.org + 34. mailto:%20jones@hermes.chpc.utexas.edu + 35. mailto:%20dkatz@cisco.com + 36. mailto:%20leres@ee.lbl.gov + 37. mailto:%20lindholm@ucs.ubc.ca + 38. mailto:%20louie@ni.umd.edu + 39. mailto:%20thorinn@diku.dk + 40. mailto:%20mayer@ntp.org + 41. mailto:%20mills@udel.edu + 42. mailto:%20moeller@gwdgv1.dnet.gwdg.de + 43. mailto:%20mogul@pa.dec.com + 44. mailto:%20tmoore@fievel.daytonoh.ncr.com + 45. mailto:%20kamal@whence.com + 46. mailto:%20derek@toybox.demon.co.uk + 47. mailto:%20d@hd.org + 48. mailto:%20neal@ntp.org + 49. mailto:%20Rainer.Pruy@informatik.uni-erlangen.de + 50. mailto:%20dirce@zk3.dec.com + 51. mailto:%20wsanchez@apple.com + 52. mailto:%20mrapple@quack.kfu.com + 53. mailto:%20jack@innovativeinternet.com + 54. mailto:%20schnitz@unipress.com + 55. mailto:%20shields@tembel.org + 56. mailto:%20pebbles.jpl.nasa.gov + 57. mailto:%20harlan@pfcs.com + 58. mailto:%20ken@sdd.hp.com + 59. mailto:%20ajit@ee.udel.edu + 60. mailto:%20tsuruoka@nc.fukuoka-u.ac.jp + 61. mailto:%20brian.utterback@oracle.com + 62. mailto:%20loganaden@gmail.com + 63. mailto:%20vixie@vix.com + 64. mailto:%20Ulrich.Windl@rz.uni-regensburg.de diff --git a/ChangeLog b/ChangeLog index c0db6042c9fe..8e34d2a96696 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,113 @@ +--- +(4.2.8p16) 2023/05/31 Released by Harlan Stenn + +* [Sec 3808] Assertion failure in ntpq on malformed RT-11 date +* [Sec 3807] praecis_parse() in the Palisade refclock driver has a + hypothetical input buffer overflow. Reported by ... stenn@ +* [Sec 3806] libntp/mstolfp.c needs bounds checking + - solved numerically instead of using string manipulation +* [Sec 3767] An OOB KoD RATE value triggers an assertion when debug is enabled. + +* [Bug 3819] Updated libopts/Makefile.am was missing NTP_HARD_* values. +* [Bug 3817] Bounds-check "tos floor" configuration. +* [Bug 3814] First poll delay of new or cleared associations miscalculated. + +* [Bug 3802] ntp-keygen -I default identity modulus bits too small for + OpenSSL 3. Reported by rmsh1216@163.com +* [Bug 3801] gpsdjson refclock gps_open() device name mishandled. +* [Bug 3800] libopts-42.1.17 does not compile with Microsoft C. +* [Bug 3799] Enable libopts noreturn compiler advice for MSC. +* [Bug 3797] Windows getaddrinfo w/AI_ADDRCONFIG fails for localhost when + disconnected, breaking ntpq and ntpdc. +* [Bug 3795] pollskewlist documentation uses | when it shouldn't. + - ntp.conf manual page and miscopt.html corrections. +* [Bug 3793] Wrong variable type passed to record_raw_stats(). + - Report and patch by Yuezhen LUAN . +* [Bug 3786] Timer starvation on high-load Windows ntpd. +* [Bug 3784] high-load ntpd on Windows deaf after enough ICMP TTL exceeded. + +* [Bug 3781] log "Unable to listen for broadcasts" for IPv4 +* [Bug 3774] mode 6 packets corrupted in rawstats file + - Reported by Edward McGuire, fix identified by . +* [Bug 3758] Provide a 'device' config statement for refclocks +* [Bug 3757] Improve handling of Linux-PPS in NTPD +* [Bug 3741] 4.2.8p15 can't build with glibc 2.34 +* [Bug 3725] Make copyright of clk_wharton.c compatible with Debian. + Philippe De Muyter +* [Bug 3724] ntp-keygen with openSSL 1.1.1 fails on Windows + - openssl applink needed again for openSSL-1.1.1 +* [Bug 3719] configure.ac checks for closefrom() and getdtablesize() missing. + Reported by Brian Utterback, broken in 2010 by +* [Bug 3699] Problems handling drift file and restoring previous drifts + - command line options override config statements where applicable + - make initial frequency settings idempotent and reversible + - make sure kernel PLL gets a recovered drift componsation +* [Bug 3695] Fix memory leak with ntpq on Windows Server 2019 +* [Bug 3694] NMEA refclock seems to unnecessarily require location in messages + - misleading title; essentially a request to ignore the receiver status. + Added a mode bit for this. +* [Bug 3693] Improvement of error handling key lengths + - original patch by Richard Schmidt, with mods & unit test fixes +* [Bug 3692] /dev/gpsN requirement prevents KPPS + - implement/wrap 'realpath()' to resolve symlinks in device names +* [Bug 3691] Buffer Overflow reading GPSD output + - original patch by matt + - increased max PDU size to 4k to avoid truncation +* [Bug 3690] newline in ntp clock variable (parse) + - patch by Frank Kardel +* [Bug 3689] Extension for MD5, SHA-1 and other keys + - ntp{q,dc} now use the same password processing as ntpd does in the key + file, so having a binary secret >= 11 bytes is possible for all keys. + (This is a different approach to the problem than suggested) +* [Bug 3688] GCC 10 build errors in testsuite +* [Bug 3687] ntp_crypto_rand RNG status not known + - patch by Gerry Garvey +* [Bug 3682] Fixes for warnings when compiled without OpenSSL + - original patch by Gerry Garvey +* [Bug 3677] additional peer events not decoded in associations listing + - original patch by Gerry Garvey +* [Bug 3676] compiler warnings (CMAC, interrupt_buf, typo, fallthrough) + - applied patches by Gerry Garvey +* [Bug 3675] ntpq ccmds[] stores pointer to non-persistent storage +* [Bug 3674] ntpq command 'execute only' using '~' prefix + - idea+patch by Gerry Garvey +* [Bug 3672] fix biased selection in median cut +* [Bug 3666] avoid unlimited receive buffer allocation + - follow-up: fix inverted sense in check, reset shortfall counter +* [Bug 3660] Revert 4.2.8p15 change to manycast. +* [Bug 3640] document "discard monitor" and fix the code. + - fixed bug identified by Edward McGuire +* [Bug 3626] (SNTP) UTC offset calculation needs dst flag + - applied patch by Gerry Garvey +* [Bug 3428] ntpd spinning consuming CPU on Linux router with full table. + Reported by Israel G. Lugo. +* [Bug 3103] libopts zsave_warn format string too few arguments +* [Bug 2990] multicastclient incorrectly causes bind to broadcast address. + Integrated patch from Brian Utterback. +* [Bug 2525] Turn on automake subdir-objects across the project. +* [Bug 2410] syslog an error message on panic exceeded. +* Use correct rounding in mstolfp(). perlinger/hart +* M_ADDF should use u_int32. +* Only define tv_fmt_libbuf() if we will use it. +* Use recv_buffer instead of the longer recv_space.X_recv_buffer. hart/stenn +* Make sure the value returned by refid_str() prints cleanly. +* If DEBUG is enabled, the startup banner now says that debug assertions + are in force and that ntpd will abort if any are violated. +* syslog valid incoming KoDs. +* Rename a poorly-named variable. +* Disable "embedded NUL in string" messages in libopts, when we can. +* Use https in the AC_INIT URLs in configure.ac. +* Implement NTP_FUNC_REALPATH. +* Lose a gmake construct in ntpd/Makefile.am. +* upgrade to: autogen-5.18.16 +* upgrade to: libopts-42.1.17 +* upgrade to: autoconf-2.71 +* upgrade to: automake-1.16.15 +* Upgrade to libevent-2.1.12-stable +* Support OpenSSL-3.0 + --- (4.2.8p15) 2020/06/23 Released by Harlan Stenn -(4.2.8p15) 2020/06/23 Released by Harlan Stenn * [Sec 3661] memory leak with AES128CMAC keys * [Bug 3670] Regression from bad merge of 3592 and 3596 @@ -14,8 +121,7 @@ * [Bug 3662] Fix build errors on Windows with VS2008 * [Bug 3660] Manycast orphan mode startup discovery problem. - integrated patch from Charles Claggett -* [Bug 3659] Move definition of psl[] from ntp_config.h to - ntp_config.h +* [Bug 3659] Move definition of psl[] from ntp_config.h to ntp_config.c * [Bug 3657] Wrong "Autokey group mismatch" debug message * [Bug 3655] ntpdc memstats hash counts - fix by Gerry garvey @@ -26,6 +132,8 @@ * [Bug 3644] Unsynchronized server [...] selected as candidate * [Bug 3639] refclock_jjy: TS-JJY0x can skip time sync depending on the STUS reply. - applied patch by Takao Abe +* [Bug 3432] refclocks that 'write()' should check the result + - plus some more work on warnings for unchecked results --- (4.2.8p14) 2020/03/03 Released by Harlan Stenn diff --git a/CommitLog b/CommitLog index 80104bc8d78c..54bf0f9a45fc 100644 --- a/CommitLog +++ b/CommitLog @@ -1,3 +1,5578 @@ +ChangeSet@1.3996, 2023-05-31 20:05:32-07:00, ntpreleng@ntp-build.tal1.ntfo.org + NTP_4_2_8P16 + TAG: NTP_4_2_8P16 + + ChangeLog@1.2048 +1 -0 + NTP_4_2_8P16 + + ntpd/invoke-ntp.conf.texi@1.224 +1 -1 + NTP_4_2_8P16 + + ntpd/invoke-ntp.keys.texi@1.209 +1 -1 + NTP_4_2_8P16 + + ntpd/invoke-ntpd.texi@1.523 +2 -2 + NTP_4_2_8P16 + + ntpd/ntp.conf.5man@1.258 +2 -2 + NTP_4_2_8P16 + + ntpd/ntp.conf.5mdoc@1.258 +2 -2 + NTP_4_2_8P16 + + ntpd/ntp.conf.html@1.206 +68 -121 + NTP_4_2_8P16 + + ntpd/ntp.conf.man.in@1.258 +2 -2 + NTP_4_2_8P16 + + ntpd/ntp.conf.mdoc.in@1.258 +2 -2 + NTP_4_2_8P16 + + ntpd/ntp.keys.5man@1.243 +2 -2 + NTP_4_2_8P16 + + ntpd/ntp.keys.5mdoc@1.243 +3 -3 + NTP_4_2_8P16 + + ntpd/ntp.keys.html@1.203 +23 -43 + NTP_4_2_8P16 + + ntpd/ntp.keys.man.in@1.243 +2 -2 + NTP_4_2_8P16 + + ntpd/ntp.keys.mdoc.in@1.243 +3 -3 + NTP_4_2_8P16 + + ntpd/ntpd-opts.c@1.548 +7 -7 + NTP_4_2_8P16 + + ntpd/ntpd-opts.h@1.547 +3 -3 + NTP_4_2_8P16 + + ntpd/ntpd.1ntpdman@1.352 +2 -2 + NTP_4_2_8P16 + + ntpd/ntpd.1ntpdmdoc@1.352 +2 -2 + NTP_4_2_8P16 + + ntpd/ntpd.html@1.197 +162 -254 + NTP_4_2_8P16 + + ntpd/ntpd.man.in@1.352 +2 -2 + NTP_4_2_8P16 + + ntpd/ntpd.mdoc.in@1.352 +2 -2 + NTP_4_2_8P16 + + ntpdc/invoke-ntpdc.texi@1.522 +2 -2 + NTP_4_2_8P16 + + ntpdc/ntpdc-opts.c@1.543 +7 -7 + NTP_4_2_8P16 + + ntpdc/ntpdc-opts.h@1.542 +3 -3 + NTP_4_2_8P16 + + ntpdc/ntpdc.1ntpdcman@1.353 +2 -2 + NTP_4_2_8P16 + + ntpdc/ntpdc.1ntpdcmdoc@1.353 +2 -2 + NTP_4_2_8P16 + + ntpdc/ntpdc.html@1.367 +79 -129 + NTP_4_2_8P16 + + ntpdc/ntpdc.man.in@1.353 +2 -2 + NTP_4_2_8P16 + + ntpdc/ntpdc.mdoc.in@1.353 +2 -2 + NTP_4_2_8P16 + + ntpq/invoke-ntpq.texi@1.532 +2 -2 + NTP_4_2_8P16 + + ntpq/ntpq-opts.c@1.552 +7 -7 + NTP_4_2_8P16 + + ntpq/ntpq-opts.h@1.550 +3 -3 + NTP_4_2_8P16 + + ntpq/ntpq.1ntpqman@1.360 +2 -2 + NTP_4_2_8P16 + + ntpq/ntpq.1ntpqmdoc@1.360 +2 -2 + NTP_4_2_8P16 + + ntpq/ntpq.html@1.197 +149 -215 + NTP_4_2_8P16 + + ntpq/ntpq.man.in@1.360 +2 -2 + NTP_4_2_8P16 + + ntpq/ntpq.mdoc.in@1.360 +2 -2 + NTP_4_2_8P16 + + ntpsnmpd/invoke-ntpsnmpd.texi@1.522 +2 -2 + NTP_4_2_8P16 + + ntpsnmpd/ntpsnmpd-opts.c@1.543 +7 -7 + NTP_4_2_8P16 + + ntpsnmpd/ntpsnmpd-opts.h@1.542 +3 -3 + NTP_4_2_8P16 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.351 +2 -2 + NTP_4_2_8P16 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.351 +2 -2 + NTP_4_2_8P16 + + ntpsnmpd/ntpsnmpd.html@1.189 +14 -29 + NTP_4_2_8P16 + + ntpsnmpd/ntpsnmpd.man.in@1.351 +2 -2 + NTP_4_2_8P16 + + ntpsnmpd/ntpsnmpd.mdoc.in@1.351 +2 -2 + NTP_4_2_8P16 + + packageinfo.sh@1.548 +2 -2 + NTP_4_2_8P16 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.112 +2 -2 + NTP_4_2_8P16 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.114 +2 -2 + NTP_4_2_8P16 + + scripts/calc_tickadj/calc_tickadj.html@1.113 +30 -51 + NTP_4_2_8P16 + + scripts/calc_tickadj/calc_tickadj.man.in@1.111 +2 -2 + NTP_4_2_8P16 + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.114 +2 -2 + NTP_4_2_8P16 + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.116 +1 -1 + NTP_4_2_8P16 + + scripts/invoke-plot_summary.texi@1.134 +2 -2 + NTP_4_2_8P16 + + scripts/invoke-summary.texi@1.133 +2 -2 + NTP_4_2_8P16 + + scripts/ntp-wait/invoke-ntp-wait.texi@1.345 +2 -2 + NTP_4_2_8P16 + + scripts/ntp-wait/ntp-wait-opts@1.81 +2 -2 + NTP_4_2_8P16 + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.340 +2 -2 + NTP_4_2_8P16 + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.342 +2 -2 + NTP_4_2_8P16 + + scripts/ntp-wait/ntp-wait.html@1.361 +37 -63 + NTP_4_2_8P16 + + scripts/ntp-wait/ntp-wait.man.in@1.340 +2 -2 + NTP_4_2_8P16 + + scripts/ntp-wait/ntp-wait.mdoc.in@1.342 +2 -2 + NTP_4_2_8P16 + + scripts/ntpsweep/invoke-ntpsweep.texi@1.131 +2 -2 + NTP_4_2_8P16 + + scripts/ntpsweep/ntpsweep-opts@1.84 +2 -2 + NTP_4_2_8P16 + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.119 +2 -2 + NTP_4_2_8P16 + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.119 +2 -2 + NTP_4_2_8P16 + + scripts/ntpsweep/ntpsweep.html@1.133 +39 -65 + NTP_4_2_8P16 + + scripts/ntpsweep/ntpsweep.man.in@1.119 +2 -2 + NTP_4_2_8P16 + + scripts/ntpsweep/ntpsweep.mdoc.in@1.120 +2 -2 + NTP_4_2_8P16 + + scripts/ntptrace/invoke-ntptrace.texi@1.134 +2 -2 + NTP_4_2_8P16 + + scripts/ntptrace/ntptrace-opts@1.84 +2 -2 + NTP_4_2_8P16 + + scripts/ntptrace/ntptrace.1ntptraceman@1.119 +2 -2 + NTP_4_2_8P16 + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.121 +2 -2 + NTP_4_2_8P16 + + scripts/ntptrace/ntptrace.html@1.134 +36 -59 + NTP_4_2_8P16 + + scripts/ntptrace/ntptrace.man.in@1.119 +2 -2 + NTP_4_2_8P16 + + scripts/ntptrace/ntptrace.mdoc.in@1.122 +2 -2 + NTP_4_2_8P16 + + scripts/plot_summary-opts@1.85 +2 -2 + NTP_4_2_8P16 + + scripts/plot_summary.1plot_summaryman@1.132 +2 -2 + NTP_4_2_8P16 + + scripts/plot_summary.1plot_summarymdoc@1.132 +2 -2 + NTP_4_2_8P16 + + scripts/plot_summary.html@1.136 +46 -73 + NTP_4_2_8P16 + + scripts/plot_summary.man.in@1.132 +2 -2 + NTP_4_2_8P16 + + scripts/plot_summary.mdoc.in@1.132 +2 -2 + NTP_4_2_8P16 + + scripts/summary-opts@1.84 +2 -2 + NTP_4_2_8P16 + + scripts/summary.1summaryman@1.131 +2 -2 + NTP_4_2_8P16 + + scripts/summary.1summarymdoc@1.131 +2 -2 + NTP_4_2_8P16 + + scripts/summary.html@1.135 +41 -66 + NTP_4_2_8P16 + + scripts/summary.man.in@1.131 +2 -2 + NTP_4_2_8P16 + + scripts/summary.mdoc.in@1.131 +2 -2 + NTP_4_2_8P16 + + scripts/update-leap/invoke-update-leap.texi@1.32 +1 -1 + NTP_4_2_8P16 + + scripts/update-leap/update-leap-opts@1.34 +2 -2 + NTP_4_2_8P16 + + scripts/update-leap/update-leap.1update-leapman@1.32 +2 -2 + NTP_4_2_8P16 + + scripts/update-leap/update-leap.1update-leapmdoc@1.33 +2 -2 + NTP_4_2_8P16 + + scripts/update-leap/update-leap.html@1.32 +48 -80 + NTP_4_2_8P16 + + scripts/update-leap/update-leap.man.in@1.32 +2 -2 + NTP_4_2_8P16 + + scripts/update-leap/update-leap.mdoc.in@1.33 +2 -2 + NTP_4_2_8P16 + + sntp/invoke-sntp.texi@1.522 +2 -2 + NTP_4_2_8P16 + + sntp/sntp-opts.c@1.544 +7 -7 + NTP_4_2_8P16 + + sntp/sntp-opts.h@1.542 +3 -3 + NTP_4_2_8P16 + + sntp/sntp.1sntpman@1.357 +2 -2 + NTP_4_2_8P16 + + sntp/sntp.1sntpmdoc@1.357 +2 -2 + NTP_4_2_8P16 + + sntp/sntp.html@1.538 +93 -149 + NTP_4_2_8P16 + + sntp/sntp.man.in@1.357 +2 -2 + NTP_4_2_8P16 + + sntp/sntp.mdoc.in@1.357 +2 -2 + NTP_4_2_8P16 + + util/invoke-ntp-keygen.texi@1.525 +2 -2 + NTP_4_2_8P16 + + util/ntp-keygen-opts.c@1.546 +7 -7 + NTP_4_2_8P16 + + util/ntp-keygen-opts.h@1.544 +3 -3 + NTP_4_2_8P16 + + util/ntp-keygen.1ntp-keygenman@1.353 +2 -2 + NTP_4_2_8P16 + + util/ntp-keygen.1ntp-keygenmdoc@1.353 +2 -2 + NTP_4_2_8P16 + + util/ntp-keygen.html@1.198 +156 -234 + NTP_4_2_8P16 + + util/ntp-keygen.man.in@1.353 +2 -2 + NTP_4_2_8P16 + + util/ntp-keygen.mdoc.in@1.353 +2 -2 + NTP_4_2_8P16 + +ChangeSet@1.3995, 2023-05-30 06:27:39-07:00, ntpreleng@ntp-build.tal1.ntfo.org + Prep for roll of p16 + + packageinfo.sh@1.547 +1 -1 + Prep for roll of p16 + +ChangeSet@1.3993, 2023-05-30 02:06:11-05:00, stenn@stenn.chi1.ntfo.org + Update NEWS file for ntp-4.2.8p16 + + NEWS@1.218 +1 -0 + Update NEWS file for ntp-4.2.8p16 + +ChangeSet@1.3992, 2023-05-30 01:37:16-05:00, stenn@stenn.chi1.ntfo.org + Update NEWS file for ntp-4.2.8p16 + + NEWS@1.217 +1 -0 + Update NEWS file for ntp-4.2.8p16 + +ChangeSet@1.3990, 2023-05-29 22:30:00-05:00, stenn@stenn.chi1.ntfo.org + Note OpenSSL-3.0 support + + NEWS@1.216 +121 -0 + Note OpenSSL-3.0 support + +ChangeSet@1.3989, 2023-05-29 22:29:10-05:00, stenn@stenn.chi1.ntfo.org + Note OpenSSL-3.0 support + + ChangeLog@1.2046 +2 -0 + Note OpenSSL-3.0 support + +ChangeSet@1.3971.2.11, 2023-05-29 21:21:01-05:00, stenn@stenn.chi1.ntfo.org + Updated libopts/Makefile.am was missing NTP_HARD_* values + + ChangeLog@1.2031.3.5 +1 -0 + Updated libopts/Makefile.am was missing NTP_HARD_* values + + README.leapsmear@1.3 +0 -0 + Change mode to -rw-rw-r-- + + sntp/libopts/Makefile.am@1.31 +6 -3 + Updated libopts/Makefile.am was missing NTP_HARD_* values + +ChangeSet@1.3912.22.1, 2023-05-19 05:17:41-07:00, ntpreleng@ntp-build.tal1.ntfo.org + Update the 2mirrors script + + BitKeeper/triggers/2mirrors@1.12 +8 -6 + Update the 2mirrors script + +ChangeSet@1.3971.2.10, 2023-05-13 17:18:57-05:00, stenn@stenn.chi1.ntfo.org + Put 3432 in the right place in the ChangeLog + + ChangeLog@1.2031.3.4 +2 -2 + Put 3432 in the right place in the ChangeLog + +ChangeSet@1.3988, 2023-05-10 18:03:29-05:00, stenn@stenn.chi1.ntfo.org + remove duplicate line from ChangeLog + + ChangeLog@1.2045 +0 -1 + remove duplicate line from ChangeLog + +ChangeSet@1.3971.2.9, 2023-05-10 04:46:32+00:00, davehart@tl.davehart.net + [Bug 3817] Bounds-check "tos floor" configuration. + + ChangeLog@1.2031.3.3 +1 -0 + [Bug 3817] Bounds-check "tos floor" configuration. + + ntpd/ntp_config.c@1.380.1.1 +45 -16 + [Bug 3817] Bounds-check "tos floor" configuration. + Also sanity check floor < ceiling and correct ceiling lower bound check and message. + +ChangeSet@1.3986, 2023-05-07 03:46:52-05:00, stenn@ntp-devbuild.chi1.ntfo.org + Make sure the value returned by refid_str() prints cleanly + + ChangeLog@1.2043 +1 -0 + Make sure the value returned by refid_str() prints cleanly + + libntp/numtoa.c@1.8 +16 -0 + Make sure the value returned by refid_str() prints cleanly + +ChangeSet@1.3985, 2023-05-07 02:21:55-05:00, stenn@ntp-devbuild.chi1.ntfo.org + Validate pkt->ppoll + + ntpd/ntp_proto.c@1.445 +32 -2 + Validate pkt->ppoll + +ChangeSet@1.3971.2.8, 2023-05-07 02:10:38-05:00, stenn@ntp-devbuild.chi1.ntfo.org + Startup banner now notes when debug assertions are in force + + ChangeLog@1.2031.3.2 +2 -0 + Startup banner now notes when debug assertions are in force + + ntpd/ntpd.c@1.188 +4 -0 + Startup banner now notes when debug assertions are in force + +ChangeSet@1.3983, 2023-05-06 06:34:11-05:00, stenn@ntp-devbuild.chi1.ntfo.org + Bug 3767: An OOB KoD RATE value triggers an assertion when debug is enabled. + + ChangeLog@1.2041 +4 -2 + Bug 3767: An OOB KoD RATE value triggers an assertion when debug is enabled. + + configure.ac@1.629 +18 -0 + Bug 3767: An OOB KoD RATE value triggers an assertion when debug is enabled. + + ntpd/ntp_config.c@1.381 +2 -0 + Bug 3767: An OOB KoD RATE value triggers an assertion when debug is enabled. + +ChangeSet@1.3971.5.1, 2023-05-03 21:16:16+00:00, davehart@tl.davehart.net + [Bug 3814] First poll delay of new or cleared associations miscalculated. + Switch NONEMPTY_TRANSLATION_UNIT extern reference from exit() to abs() to avoid + warning on VS 2022 due to mismatching declaration as exit() is now noreturn. + Minimum supported Visual Studio has been 2005, remove code for earlier. + + BitKeeper/deleted/21/ntptrace.dsp~29080509@1.11 +0 -0 + Delete: ports/winnt/ntptrace/ntptrace.dsp + + ChangeLog@1.2031.3.1 +2 -0 + [Bug 3814] First poll delay of new or cleared associations miscalculated. + + include/ntp_types.h@1.37.1.1 +4 -3 + Switch NONEMPTY_TRANSLATION_UNIT extern reference from exit() to abs() to avoid + warning on VS 2022 due to mismatching declaration as exit() is now noreturn. + + libntp/mktime.c@1.14 +2 -2 + Use NONEMPTY_TRANSLATION_UNIT + + libntp/systime.c@1.76.1.1 +3 -0 + #if out code unused with 64-bit time_t + + ntpd/ntp_proto.c@1.442.1.1 +6 -6 + [Bug 3814] First poll delay of new or cleared associations miscalculated. + + ports/winnt/include/config.h@1.119 +2 -10 + Minimum supported Visual Studio has been 2005, remove code for earlier. + +ChangeSet@1.3971.3.1, 2023-04-30 08:54:37+02:00, perlinger@ntp.org + [Bug 3808] Assertion failure in ntpq on malformed RT-11 date + + ChangeLog@1.2031.2.4 +1 -0 + [Bug 3808] Assertion failure in ntpq on malformed RT-11 date + + libntp/caltontp.c@1.9 +18 -14 + [Bug 3808] Assertion failure in ntpq on malformed RT-11 date + - set 'errno' instead of blowing up! + + ntpq/ntpq.c@1.197 +4 -2 + [Bug 3808] Assertion failure in ntpq on malformed RT-11 date + - check 'errno' after calling 'caltontp()' + +ChangeSet@1.3971.2.5, 2023-04-30 03:28:14+00:00, davehart@tl.davehart.net + Updated Solaris-specific patch from Brian Utterback + + ntpd/ntp_proto.c@1.443 +4 -3 + Patch from [Bug 2410] was not quite done. + +ChangeSet@1.3971.2.4, 2023-04-28 03:01:47-05:00, stenn@ntp-devbuild.chi1.ntfo.org + typo fix + + libntp/caltontp.c@1.8 +1 -1 + typo fix + +ChangeSet@1.3971.2.3, 2023-04-28 03:00:57-05:00, stenn@ntp-devbuild.chi1.ntfo.org + syslog valid incoming KoDs + + ChangeLog@1.2031.2.3 +1 -0 + syslog valid incoming KoDs + + ntpd/ntp_proto.c@1.442 +28 -24 + syslog valid incoming KoDs + +ChangeSet@1.3971.2.2, 2023-04-19 02:37:17-05:00, stenn@ntp-devbuild.chi1.ntfo.org + Rename a poorly-named variable + + ChangeLog@1.2031.2.2 +1 -0 + Rename a poorly-named variable + + ntpd/ntp_crypto.c@1.193 +4 -4 + Rename a poorly-named variable + +ChangeSet@1.3976, 2023-04-17 04:19:46-05:00, stenn@ntp-devbuild.chi1.ntfo.org + Use correct rounding in mstolfp() + + ChangeLog@1.2036 +1 -0 + Use correct rounding in mstolfp() + + libntp/mstolfp.c@1.9 +3 -9 + Use correct rounding in mstolfp() + +ChangeSet@1.3975, 2023-04-17 04:14:15-05:00, stenn@ntp-devbuild.chi1.ntfo.org + M_ADDF should use u_int32 + + ChangeLog@1.2035 +1 -0 + M_ADDF should use u_int32 + + include/ntp_fp.h@1.36 +2 -2 + M_ADDF should use u_int32 + +ChangeSet@1.3974, 2023-04-16 03:27:34-05:00, stenn@ntp-devbuild.chi1.ntfo.org + cleanups + + ChangeLog@1.2034 +4 -3 + + libntp/mstolfp.c@1.8 +4 -3 + + libntp/systime.c@1.77 +3 -0 + +ChangeSet@1.3971.1.3, 2023-04-16 02:30:18-05:00, stenn@ntp-devbuild.chi1.ntfo.org + Use recv_buffer instead of the longer recv_space.X_recv_buffer + + ChangeLog@1.2031.1.3 +2 -1 + Use recv_buffer instead of the longer recv_space.X_recv_buffer + + ntpd/refclock_fg.c@1.17 +2 -2 + Use recv_buffer instead of the longer recv_space.X_recv_buffer + + ntpd/refclock_palisade.c@1.51 +1 -1 + Use recv_buffer instead of the longer recv_space.X_recv_buffer + +ChangeSet@1.3971.2.1, 2023-04-16 02:12:16-05:00, stenn@ntp-devbuild.chi1.ntfo.org + Disable "embedded NUL in string" messages in libopts, when we can. + + ChangeLog@1.2031.2.1 +1 -0 + Disable "embedded NUL in string" messages in libopts, when we can. + + sntp/libopts/Makefile.am@1.30 +2 -0 + Disable "embedded NUL in string" messages in libopts, when we can. + + sntp/m4/ntp_compiler.m4@1.8 +29 -1 + Disable "embedded NUL in string" messages in libopts, when we can. + +ChangeSet@1.3971.1.1, 2023-04-15 06:41:21-05:00, stenn@ntp-devbuild.chi1.ntfo.org + Bug 3807: praecis_parse() input buffer + + ChangeLog@1.2031.1.1 +2 -0 + Bug 3807: praecis_parse() input buffer + + ntpd/refclock_palisade.c@1.50 +37 -4 + Bug 3807: praecis_parse() input buffer + +ChangeSet@1.3972, 2023-04-15 10:54:14+02:00, perlinger@ntp.org + [Bug 3806] libntp/mstolfp.c needs bounds checking + + ChangeLog@1.2032 +2 -0 + [Bug 3806] libntp/mstolfp.c needs bounds checking + + libntp/mstolfp.c@1.7 +45 -68 + [Bug 3806] libntp/mstolfp.c needs bounds checking + - soved numerically instead of using string manipulation + + tests/libntp/strtolfp.c@1.8 +19 -14 + [Bug 3806] libntp/mstolfp.c needs bounds checking + - dump numerical values on failed number comparison + +ChangeSet@1.3964.4.1, 2023-04-11 10:21:33+00:00, davehart@tl.davehart.net + Remove unused cruft from BitKeeper ignore file. + Clean up redundancy in VS 2015 project files. + Correct lingering instances of references to lib/isc to libntp/lib/isc [Bug 2525]. + Prevent spurious rebuild of ntp_keyword.h and keyword_gen_utd during clean build or rebuild. + Enable vs2015 randomized base address and data execution prevention. + Use vs2015 link-time whole program optimization for release builds. + + BitKeeper/etc/ignore@1.96 +1 -77 + + include/ntp_types.h@1.38 +2 -2 + Fix comment typo (confirmed by perlinger@ntp.org) + + libntp/msyslog.c@1.56 +1 -1 + Comment typo + + ntpd/ntp_control.c@1.240 +0 -4 + Scrap unused MAX() macro, ours is max() + + ntpd/ntp_parser.c@1.119 +1 -1 + Use sizeof buffer + + ntpd/ntp_parser.y@1.107 +1 -1 + Use sizeof buffer + + ports/winnt/ppsapi/loopback/src/loopback-ppsapi.c@1.1.1.1 +1 -1 + Update email address + + ports/winnt/scripts/mkver.bat@1.19 +116 -36 + Enable splitting out fetching ChangeSet revision as a first step before generating + version.c. This is used by vs2015 build to enable proper dependency checking of + the revision so stale revisions aren't kept in version.c. Separate rules are used + to get the revision from scm-rev (from tarball) or from bk directly. + + ports/winnt/vs2013/libntp/libntp.vcxproj.filters@1.15 +50 -50 + Account for [Bug 2525] move of lib/isc under libntp + + ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj@1.5 +1 -1 + Account for [Bug 2525] move of lib/isc under libntp + + ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj.filters@1.2 +1 -1 + Account for [Bug 2525] move of lib/isc under libntp + + ports/winnt/vs2013/ntpd/ntpd.vcxproj@1.13 +14 -14 + Account for [Bug 2525] move of lib/isc under libntp + + ports/winnt/vs2013/ntpd/ntpd.vcxproj.filters@1.10 +14 -14 + Account for [Bug 2525] move of lib/isc under libntp + + ports/winnt/vs2013/ntpdate/ntpdate.vcxproj@1.7 +1 -1 + Account for [Bug 2525] move of lib/isc under libntp + + ports/winnt/vs2013/ntpdate/ntpdate.vcxproj.filters@1.4 +1 -1 + Account for [Bug 2525] move of lib/isc under libntp + + ports/winnt/vs2015/common.props@1.2.1.1 +2 -3 + Enable randomized base address and data execution prevention.. + Use link-time code generation for release builds only. + + ports/winnt/vs2015/debug-x64.props@1.3.1.1 +0 -1 + minimize + + ports/winnt/vs2015/debug.props@1.3.1.1 +0 -1 + minimize + + ports/winnt/vs2015/instsrv/instsrv.vcxproj@1.1.1.1 +21 -163 + Eliminate redundancy, include common.props first. + instsrv doesn't use version string. + + ports/winnt/vs2015/instsrv/instsrv.vcxproj.filters@1.1.1.1 +0 -6 + instsrv doesn't use version string. + + ports/winnt/vs2015/libntp/libntp.vcxproj@1.7.1.1 +25 -141 + Eliminate redundancy, include common.props first. + + ports/winnt/vs2015/libntp/libntp.vcxproj.filters@1.7.1.1 +1 -1 + Move override libisc mem.h to libisc Header Files. + + ports/winnt/vs2015/loopback-pps/loopback-ppsapi-provider.vcxproj@1.1.1.1 +16 -148 + Eliminate redundancy, include common.props first. + + ports/winnt/vs2015/mkver.props@1.1 +25 -0 + Centralize version.c dependencies for all consumer .vcxproj files. + + ports/winnt/vs2015/mkver.props@1.0 +0 -0 + + ports/winnt/vs2015/ntp-keygen/ntp-keygen.vcxproj@1.1.1.1 +20 -154 + Eliminate redundancy, include common.props first. + Improve version.c dependency checking. + + ports/winnt/vs2015/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj@1.1.1.1 +17 -122 + Eliminate redundancy, include common.props first. + Correct path to libntp/lib/isc. + + ports/winnt/vs2015/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj.filters@1.1.1.1 +3 -3 + Correct lib/isc path + + ports/winnt/vs2015/ntpd/gen-ntp_keyword.bat@1.1.1.1 +14 -2 + Prevent spurious rebuild of ntp_keyword.h and keyword_gen_utd during clean build or rebuild. + + ports/winnt/vs2015/ntpd/ntpd.vcxproj@1.5.3.1 +38 -239 + Eliminate redundancy, include common.props first. + Improve version.c dependency checking. + Correct lib\isc to libntp\lib\isc + Remove uselesss message resource references. + + ports/winnt/vs2015/ntpd/ntpd.vcxproj.filters@1.4.2.1 +14 -14 + Correct lib/isc path + + ports/winnt/vs2015/ntpdate/ntpdate.vcxproj@1.1.1.1 +25 -162 + Eliminate redundancy, include common.props first. + Improve version.c dependency checking. + Correct path to libntp/lib/isc. + + ports/winnt/vs2015/ntpdate/ntpdate.vcxproj.filters@1.1.1.1 +1 -1 + Correct path to libntp/lib/isc. + + ports/winnt/vs2015/ntpdc/ntpdc.vcxproj@1.1.1.1 +24 -160 + Eliminate redundancy, include common.props first. + Improve version.c dependency checking. + + ports/winnt/vs2015/ntpq/ntpq.vcxproj@1.1.1.1 +23 -160 + Eliminate redundancy, include common.props first. + Improve version.c dependency checking. + + ports/winnt/vs2015/release-x64.props@1.3.1.1 +4 -1 + Use link-time code generation for release builds only. + + ports/winnt/vs2015/release.props@1.3.1.1 +4 -4 + Use link-time code generation for release builds only. + +ChangeSet@1.3969.1.2, 2023-03-28 18:17:07+00:00, davehart@tl.davehart.net + Consolidate and correct check-scm-rev invocations. + Quiet -Wunused-function warnings in ntp_config.c building ntpdsim. + Quiet -Warray-bounds warning in ntpdc.c. + Fix make distcheck failure due to leftover version.Po files. + Use silent rules for Autogen invocations. + Remove other write permissions, e.g. chmod o-w + Add missing comma in configure.ac syscall() test. + Remove remnant of the no-longer-used Google Test framework. + + BitKeeper/deleted/7c/ntp_googletest.m4~54a23ec15985e26c@1.5 +0 -0 + Rename: sntp/m4/ntp_googletest.m4 -> BitKeeper/deleted/7c/ntp_googletest.m4~54a23ec15985e26c + + check-libntp.mf@1.2 +0 -0 + Change mode to -rw-rw-r-- + + check-libntpd.mf@1.2 +0 -0 + Change mode to -rw-rw-r-- + + check-libopts.mf@1.3 +0 -0 + Change mode to -rw-rw-r-- + + check-libunity.mf@1.2 +0 -0 + Change mode to -rw-rw-r-- + + check-scm-rev.mf@1.1 +8 -0 + Consolidate and correct check-scm-rev invocations + + check-scm-rev.mf@1.0 +0 -0 + + configure.ac@1.628 +2 -9 + Add missing comma to declare syscall() test. + Remove remnant of the no-longer-used Google Test framework. + + depsver.mf@1.6 +2 -2 + Use silent rules for deps-ver cp + + include/declcond.h@1.3 +0 -0 + Change mode to -rw-rw-r-- + + include/ntp_intres.h@1.3 +0 -0 + Change mode to -rw-rw-r-- + + include/ntp_lineedit.h@1.2 +0 -0 + Change mode to -rw-rw-r-- + + include/ntp_lists.h@1.16 +0 -0 + Change mode to -rw-rw-r-- + + include/safecast.h@1.2 +0 -0 + Change mode to -rw-rw-r-- + + includes.mf@1.3 +0 -0 + Change mode to -rw-rw-r-- + + libntp/ntp_lineedit.c@1.15 +0 -0 + Change mode to -rw-rw-r-- + + libntp/strl_obsd.c@1.2 +0 -0 + Change mode to -rw-rw-r-- + + libparse/Makefile.am@1.35 +2 -2 + Use silent rules for VPATH hack + + ntpd/Makefile.am@1.146 +49 -36 + Ensure bk revision is up-to-date in version + Use distinct progname for ntpdsim version string + Use silent rules for VPATH hack + Use silent rules for Autogen invocations. + + ntpd/complete.conf.in@1.38 +0 -0 + Change mode to -rw-rw-r-- + + ntpd/declcond.h@1.3 +0 -0 + Change mode to -rw-rw-r-- + + ntpd/ntp_config.c@1.380 +23 -18 + Quiet -Wunused-function warnings building ntpdsim. + Quiet string truncation warning with our one use of strncpy. + + ntpdate/Makefile.am@1.41 +8 -9 + Ensure bk revision is up-to-date in version + Use silent rules for Autogen invocations. + + ntpdc/Makefile.am@1.80 +28 -17 + Ensure bk revision is up-to-date in version + Use silent rules for Autogen invocations and ntpdc-layout + + ntpdc/ntpdc.c@1.116 +1 -2 + Quiet warning from gcc 11.3.0: + + In file included from ../../ntpdc/ntpdc.h:4, + from ../../ntpdc/ntpdc.c:22: + ../../ntpdc/ntpdc.c: In function 'doquery': + ../../include/ntp_fp.h:86:22: warning: array subscript -1 is outside array bounds of 'struct req_pkt[1]' [-Warray-bounds] + 86 | (ni) = htonl(hi); \ + | ^ + ../../include/ntp_fp.h:91:9: note: in expansion of macro 'HTONL_MFP' + 91 | HTONL_MFP((h)->l_ui, (h)->l_uf, (n)->l_ui, (n)->l_uf) + | ^~~~~~~~~ + ../../ntpdc/ntpdc.c:968:9: note: in expansion of macro 'HTONL_FP' + 968 | HTONL_FP(&ts, ptstamp); + | ^~~~~~~~ + ../../ntpdc/ntpdc.c:900:24: note: while referencing 'qpkt' + 900 | struct req_pkt qpkt; + | ^~~~ + + ntpq/Makefile.am@1.78 +15 -16 + Ensure bk revision is up-to-date in version + Use silent rules for Autogen invocations. + + ntpsnmpd/Makefile.am@1.44 +4 -4 + Use silent rules for Autogen invocations. + + ports/winnt/include/msvc_ssl_autolib.h@1.3 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/include/ntp_iocplmem.h@1.2 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/include/ntp_iocpltypes.h@1.5 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/include/ntservice.h@1.6 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/include/stdint.h@1.3 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/include/timepps.h@1.5 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/libntp/arc4wrap.c@1.2 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/ntpd/nt_ppsimpl.c@1.5 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/ntpd/ntp_iocplmem.c@1.2 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/ntpd/ntp_iocpltypes.c@1.4 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.h@1.3 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.txt@1.3 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/ppsapi/loopback/src/loopback-ppsapi.c@1.2 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/ppsapi/loopback/src/loopback-ppsapi.def@1.5 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/ppsapi/loopback/src/loopback-ppsapi.h@1.3 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/ppsapi/loopback/src/sys/time.h@1.3 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/ppsapi/loopback/src/timepps.h@1.4 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2008/common.vsprops@1.4 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2008/debug-x64.vsprops@1.4 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2008/debug.vsprops@1.4 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2008/loopback-pps/loopback-ppsapi-provider.vcproj@1.4 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2008/ntpd-keyword-gen/ntpd-keyword-gen.vcproj@1.4 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2008/release-x64.vsprops@1.4 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2008/release.vsprops@1.4 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2013/common.props@1.5 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2013/debug-x64.props@1.5 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2013/debug.props@1.4 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2013/release-x64.props@1.5 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2013/release.props@1.4 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/common.props@1.3 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/debug-x64.props@1.4 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/debug.props@1.4 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/instsrv/instsrv.vcxproj@1.2 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/instsrv/instsrv.vcxproj.filters@1.2 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/libntp/libntp.vcxproj@1.8 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/libntp/libntp.vcxproj.filters@1.8 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/loopback-pps/loopback-ppsapi-provider.vcxproj@1.2 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/loopback-pps/loopback-ppsapi-provider.vcxproj.filters@1.2 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/ntp-keygen/ntp-keygen.vcxproj@1.2 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/ntp-keygen/ntp-keygen.vcxproj.filters@1.2 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/ntp.sln@1.3 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj@1.2 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj.filters@1.2 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/ntpd/gen-ntp_keyword.bat@1.2 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/ntpd/ntpd.vcxproj@1.7.1.1 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/ntpd/ntpd.vcxproj.filters@1.7 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/ntpdate/ntpdate.vcxproj@1.2 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/ntpdate/ntpdate.vcxproj.filters@1.2 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/ntpdc/ntpdc.vcxproj@1.2 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/ntpdc/ntpdc.vcxproj.filters@1.2 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/ntpq/ntpq.vcxproj@1.2 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/ntpq/ntpq.vcxproj.filters@1.2 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/release-x64.props@1.4 +0 -0 + Change mode to -rw-rw-r-- + + ports/winnt/vs2015/release.props@1.4 +0 -0 + Change mode to -rw-rw-r-- + + scripts/Makefile.am@1.42 +8 -8 + Use silent rules for Autogen invocations. + + scripts/calc_tickadj/Makefile.am@1.13 +4 -4 + Use silent rules for Autogen invocations. + + scripts/ntp-wait/Makefile.am@1.11 +4 -4 + Use silent rules for Autogen invocations. + + scripts/ntpsweep/Makefile.am@1.12 +4 -4 + Use silent rules for Autogen invocations. + + scripts/ntptrace/Makefile.am@1.12 +4 -4 + Use silent rules for Autogen invocations. + + scripts/update-leap/Makefile.am@1.6 +4 -4 + Use silent rules for Autogen invocations. + + sntp/Makefile.am@1.94 +23 -26 + Ensure bk revision is up-to-date in version + Use silent rules for Autogen invocations. + + sntp/check-libntp.mf@1.5 +0 -0 + Change mode to -rw-rw-r-- + + sntp/check-libopts.mf@1.3 +0 -0 + Change mode to -rw-rw-r-- + + sntp/check-libsntp.mf@1.2 +0 -0 + Change mode to -rw-rw-r-- + + sntp/check-libunity.mf@1.2 +0 -0 + Change mode to -rw-rw-r-- + + sntp/configure.ac@1.89 +0 -3 + Remove remnant of the no-longer-used Google Test framework. + + sntp/include/Makefile.am@1.6 +0 -0 + Change mode to -rw-rw-r-- + + sntp/include/debug-opt.def@1.9 +0 -0 + Change mode to -rw-rw-r-- + + sntp/includes.mf@1.3 +0 -0 + Change mode to -rw-rw-r-- + + sntp/libevent/m4/libevent_openssl.m4@1.4 +0 -0 + Change mode to -rw-rw-r-- + + sntp/libevent/m4/ntp_pkg_config.m4@1.2 +0 -0 + Change mode to -rw-rw-r-- + + sntp/m4/LICENSE-OPENLDAP@1.3 +0 -0 + Change mode to -rw-rw-r-- + + sntp/m4/ntp_cacheversion.m4@1.16 +2 -7 + Update now that Autoconf should support AS_UNSET instead of hand-rolled. + + sntp/m4/ntp_cacheversion.m4@1.15 +0 -0 + Change mode to -rw-rw-r-- + + sntp/m4/ntp_compiler.m4@1.7 +0 -0 + Change mode to -rw-rw-r-- + + sntp/m4/ntp_crosscompile.m4@1.2 +0 -0 + Change mode to -rw-rw-r-- + + sntp/m4/ntp_debug.m4@1.2 +0 -0 + Change mode to -rw-rw-r-- + + sntp/m4/ntp_ipv6.m4@1.9 +0 -0 + Change mode to -rw-rw-r-- + + sntp/m4/ntp_lib_m.m4@1.4 +0 -0 + Change mode to -rw-rw-r-- + + sntp/m4/ntp_libntp.m4@1.39 +0 -0 + Change mode to -rw-rw-r-- + + sntp/m4/ntp_pkg_config.m4@1.3 +0 -0 + Change mode to -rw-rw-r-- + + sntp/m4/ntp_sntp.m4@1.2 +0 -0 + Change mode to -rw-rw-r-- + + sntp/m4/openldap-thread-check.m4@1.8 +0 -0 + Change mode to -rw-rw-r-- + + sntp/m4/openldap.m4@1.3 +0 -0 + Change mode to -rw-rw-r-- + + sntp/m4/snprintf.m4@1.4 +0 -0 + Change mode to -rw-rw-r-- + + sntp/main.h@1.8 +0 -0 + Change mode to -rw-rw-r-- + + sntp/sntp.c@1.6 +0 -0 + Change mode to -rw-rw-r-- + + sntp/tests/Makefile.am@1.74 +30 -15 + Ensure bk revision is up-to-date in version. + + sntp/tests/packetProcessing.c@1.19 +0 -2 + Use the real version string rather than a stub. + + sntp/tests/packetProcessing.c@1.18 +0 -0 + Change mode to -rw-rw-r-- + + sntp/tests/sntptest.c@1.2 +1 -3 + Remove redundant includes, use COUNTOF() + + sntp/tests/sntptest.h@1.7 +1 -0 + ntp_types.h for COUNTOF() + + sntp/tests/utilities.c@1.6 +0 -3 + Use the real version string rather than a stub. + + sntp/unity/auto/parseOutput.rb@1.2 +0 -0 + Change mode to -rw-rw-r-- + + sntp/unity/auto/type_sanitizer.rb@1.2 +0 -0 + Change mode to -rw-rw-r-- + + sntp/unity/auto/unity_test_summary.py@1.2 +0 -0 + Change mode to -rw-rw-r-- + + sntp/unity/libpkgver-colcomp.c@1.2 +0 -0 + Change mode to -rw-rw-r-- + + tests/libntp/caltontp.c@1.4 +0 -0 + Change mode to -rw-rw-r-- + + tests/libntp/humandate.c@1.8 +0 -0 + Change mode to -rw-rw-r-- + + tests/libntp/msyslog.c@1.8 +0 -0 + Change mode to -rw-rw-r-- + + tests/libntp/prettydate.c@1.7 +0 -0 + Change mode to -rw-rw-r-- + + tests/libntp/recvbuff.c@1.9 +0 -0 + Change mode to -rw-rw-r-- + + tests/libntp/sfptostr.c@1.7 +0 -0 + Change mode to -rw-rw-r-- + + tests/libntp/tstotv.c@1.5 +0 -0 + Change mode to -rw-rw-r-- + + tests/libntp/tvtots.c@1.7 +0 -0 + Change mode to -rw-rw-r-- + + tests/ntpd/ntp_prio_q.c@1.5 +0 -0 + Change mode to -rw-rw-r-- + + tests/ntpd/ntp_restrict.c@1.8 +0 -0 + Change mode to -rw-rw-r-- + + tests/ntpd/test-libntp.c@1.2 +0 -0 + Change mode to -rw-rw-r-- + + tests/sandbox/smeartest.c@1.12 +0 -0 + Change mode to -rw-rw-r-- + + util/Makefile.am@1.83 +7 -10 + Ensure bk revision is up-to-date in version + +ChangeSet@1.3969.1.1, 2023-03-25 01:48:40-04:00, davehart@tl.davehart.net + [Bug 3428] ntpd spinning consuming CPU on Linux router with full table. + + ChangeLog@1.2029.1.1 +2 -0 + [Bug 3428] ntpd spinning consuming CPU on Linux router with full table. + + libntp/work_thread.c@1.26 +1 -1 + Typo + + ntpd/ntp_io.c@1.434.1.1 +28 -7 + [Bug 3428] ntpd spinning consuming CPU on Linux router with full table. + +ChangeSet@1.3964.3.3, 2023-03-19 15:58:02-04:00, davehart@tl.davehart.net + [Bug 3725] Make copyright of clk_wharton.c compatible with Debian. + + ChangeLog@1.2025.3.1 +4 -0 + [Bug 3725] Make copyright of clk_wharton.c compatible with Debian. + + html/copyright.html@1.73 +1 -0 + Add Philippe De Muyter + + libparse/clk_wharton.c@1.12 +0 -7 + [Bug 3725] Make copyright of clk_wharton.c compatible with Debian. + +ChangeSet@1.3964.3.2, 2023-03-19 15:15:02-04:00, davehart@z4.davehart.net + Fix mkver.bat invocation + + ports/winnt/vs2015/ntpd/ntpd.vcxproj@1.5.2.1 +2 -2 + 'fix + +ChangeSet@1.3964.3.1, 2023-03-19 13:54:01-04:00, davehart@tl.davehart.net + [Bug 2990] multicastclient incorrectly causes bind to broadcast address. + + include/ntpd.h@1.208 +1 -0 + Add sys_mclient for multicast to avoid overloading sys_bclient meaning. + + ntpd/ntp_io.c@1.435 +1 -1 + Add sys_mclient for multicast to avoid overloading sys_bclient meaning. + + ntpd/ntp_proto.c@1.441 +6 -4 + Separate sys_bclient into sys_mclient and sys_bclient. (from Brian Utterback) + + ntpd/ntp_request.c@1.133 +1 -1 + Backwards compat, signal broadcast client to ntpdc with either sys_bclient or sys_mclient lit. + +ChangeSet@1.3964.2.2, 2023-03-19 01:05:11-04:00, davehart@tl.davehart.net + Don't cast size_t to int, update contract for followlink(). + Make ssize_t size match size_t, provide SSIZE_MAX on Windows. + + ports/winnt/include/config.h@1.118 +8 -2 + Make ssize_t size match size_t, provide SSIZE_MAX + + util/ntp-keygen.c@1.112 +4 -4 + Don't cast size_t to int, update contract for followlink(). + +ChangeSet@1.3963.2.4, 2023-03-18 16:10:54+00:00, hart@ntp-devbuild.chi1.ntfo.org + [Bug 3719] configure.ac checks for closefrom() and getdtablesize() missing. + + ChangeLog@1.2024.2.2 +2 -0 + [Bug 3719] configure.ac checks for closefrom() and getdtablesize() missing. + + configure.ac@1.625.1.1 +3 -1 + [Bug 3719] configure.ac checks for closefrom() and getdtablesize() missing. + +ChangeSet@1.3963.2.3, 2023-03-18 11:37:40+00:00, hart@ntp-devbuild.chi1.ntfo.org + Autogen'd files + + ntpd/invoke-ntp.conf.texi@1.223 +22 -10 + Autogen output + + ntpd/invoke-ntp.keys.texi@1.208 +1 -1 + Autogen output + + ntpd/invoke-ntpd.texi@1.522 +3 -3 + Autogen output + + ntpd/ntp.conf.5man@1.257 +25 -13 + Autogen output + + ntpd/ntp.conf.5mdoc@1.257 +26 -14 + Autogen output + + ntpd/ntp.conf.html@1.205 +21 -9 + Autogen output + + ntpd/ntp.conf.man.in@1.257 +25 -13 + Autogen output + + ntpd/ntp.conf.mdoc.in@1.257 +26 -14 + Autogen output + + ntpd/ntp.keys.5man@1.242 +4 -4 + Autogen output + + ntpd/ntp.keys.5mdoc@1.242 +4 -4 + Autogen output + + ntpd/ntp.keys.man.in@1.242 +4 -4 + Autogen output + + ntpd/ntp.keys.mdoc.in@1.242 +4 -4 + Autogen output + + ntpd/ntpd-opts.c@1.547 +7 -7 + Autogen output + + ntpd/ntpd-opts.h@1.546 +1 -1 + Autogen output + + ntpd/ntpd.1ntpdman@1.351 +4 -4 + Autogen output + + ntpd/ntpd.1ntpdmdoc@1.351 +4 -4 + Autogen output + + ntpd/ntpd.html@1.196 +2 -2 + Autogen output + + ntpd/ntpd.man.in@1.351 +4 -4 + Autogen output + + ntpd/ntpd.mdoc.in@1.351 +4 -4 + Autogen output + + ntpdc/invoke-ntpdc.texi@1.521 +3 -3 + Autogen output + + ntpdc/ntpdc-opts.c@1.542 +7 -7 + Autogen output + + ntpdc/ntpdc-opts.h@1.541 +1 -1 + Autogen output + + ntpdc/ntpdc.1ntpdcman@1.352 +701 -9 + Autogen output + + ntpdc/ntpdc.1ntpdcmdoc@1.352 +668 -9 + Autogen output + + ntpdc/ntpdc.html@1.366 +2 -2 + Autogen output + + ntpdc/ntpdc.man.in@1.352 +701 -9 + Autogen output + + ntpdc/ntpdc.mdoc.in@1.352 +668 -9 + Autogen output + + ntpq/invoke-ntpq.texi@1.531 +5 -4 + Autogen output + + ntpq/ntpq-opts.c@1.551 +7 -7 + Autogen output + + ntpq/ntpq-opts.h@1.549 +1 -1 + Autogen output + + ntpq/ntpq.1ntpqman@1.359 +1393 -5 + Autogen output + + ntpq/ntpq.1ntpqmdoc@1.359 +891 -5 + Autogen output + + ntpq/ntpq.html@1.196 +28 -9 + Autogen output + + ntpq/ntpq.man.in@1.359 +1393 -5 + Autogen output + + ntpq/ntpq.mdoc.in@1.359 +891 -5 + Autogen output + + ntpsnmpd/invoke-ntpsnmpd.texi@1.521 +4 -4 + Autogen output + + ntpsnmpd/ntpsnmpd-opts.c@1.542 +7 -7 + Autogen output + + ntpsnmpd/ntpsnmpd-opts.h@1.541 +1 -1 + Autogen output + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.350 +4 -4 + Autogen output + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.350 +4 -4 + Autogen output + + ntpsnmpd/ntpsnmpd.man.in@1.350 +4 -4 + Autogen output + + ntpsnmpd/ntpsnmpd.mdoc.in@1.350 +4 -4 + Autogen output + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.113 +2 -2 + Autogen output + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.113 +2 -2 + Autogen output + + scripts/ntp-wait/invoke-ntp-wait.texi@1.344 +1 -1 + Autogen output + + scripts/ntp-wait/ntp-wait-opts@1.80 +1 -1 + Autogen output + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.341 +2 -2 + Autogen output + + scripts/ntp-wait/ntp-wait.mdoc.in@1.341 +2 -2 + Autogen output + + scripts/ntpsweep/ntpsweep-opts@1.83 +1 -1 + Autogen output + + scripts/ntptrace/invoke-ntptrace.texi@1.133 +1 -1 + Autogen output + + scripts/ntptrace/ntptrace-opts@1.83 +1 -1 + Autogen output + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.120 +2 -2 + Autogen output + + scripts/ntptrace/ntptrace.mdoc.in@1.121 +2 -2 + Autogen output + + scripts/plot_summary-opts@1.84 +1 -1 + Autogen output + + scripts/summary-opts@1.83 +1 -1 + Autogen output + + scripts/update-leap/update-leap.1update-leapmdoc@1.32 +2 -2 + Autogen output + + scripts/update-leap/update-leap.mdoc.in@1.32 +2 -2 + Autogen output + + sntp/invoke-sntp.texi@1.521 +3 -3 + Autogen output + + sntp/sntp-opts.c@1.543 +7 -7 + Autogen output + + sntp/sntp-opts.h@1.541 +1 -1 + Autogen output + + sntp/sntp.1sntpman@1.356 +5 -5 + Autogen output + + sntp/sntp.1sntpmdoc@1.356 +5 -5 + Autogen output + + sntp/sntp.html@1.537 +2 -2 + Autogen output + + sntp/sntp.man.in@1.356 +5 -5 + Autogen output + + sntp/sntp.mdoc.in@1.356 +5 -5 + Autogen output + + util/invoke-ntp-keygen.texi@1.524 +4 -4 + Autogen output + + util/ntp-keygen-opts.c@1.545 +8 -8 + Autogen output + + util/ntp-keygen-opts.h@1.543 +1 -1 + Autogen output + + util/ntp-keygen.1ntp-keygenman@1.352 +5 -5 + Autogen output + + util/ntp-keygen.1ntp-keygenmdoc@1.352 +5 -5 + Autogen output + + util/ntp-keygen.html@1.197 +4 -4 + Autogen output + + util/ntp-keygen.man.in@1.352 +5 -5 + Autogen output + + util/ntp-keygen.mdoc.in@1.352 +5 -5 + Autogen output + +ChangeSet@1.3963.2.2, 2023-03-18 07:05:37-04:00, davehart@tl.davehart.net + Clean up generated .html dependences. + + ntpdc/Makefile.am@1.77.1.1 +1 -1 + Clean up generated .html dependences. + + ntpq/Makefile.am@1.75.1.1 +1 -1 + Clean up generated .html dependences. + + ntpsnmpd/Makefile.am@1.43 +1 -1 + Clean up generated .html dependences. + + scripts/Makefile.am@1.41 +1 -1 + Clean up generated .html dependences. + + scripts/calc_tickadj/Makefile.am@1.12 +1 -1 + Clean up generated .html dependences. + + scripts/ntp-wait/Makefile.am@1.10 +1 -1 + Clean up generated .html dependences. + + scripts/ntpsweep/Makefile.am@1.11 +1 -1 + Clean up generated .html dependences. + + scripts/ntptrace/Makefile.am@1.11 +1 -1 + Clean up generated .html dependences. + + scripts/update-leap/Makefile.am@1.5 +1 -1 + Clean up generated .html dependences. + + sntp/Makefile.am@1.91.1.1 +1 -1 + Clean up generated .html dependences. + + util/Makefile.am@1.80.1.1 +1 -1 + Clean up generated .html dependences. + +ChangeSet@1.3963.2.1, 2023-03-18 06:23:34-04:00, davehart@tl.davehart.net + [Bug 3802] ntp-keygen -I default identity modulus bits too small for OpenSSL 3. + ntp-keygen.c: + Use different buffers for in/out args to readlink() to respect "restrict" modifiers and avoid undefined behavior. + smeartest.c: + clean up warning re: main() vs main(void) + + ChangeLog@1.2024.2.1 +3 -0 + [Bug 3802] ntp-keygen -I default identity modulus bits too small for OpenSSL 3. + [Bug 3103] libopts zsave_warn format string too few arguments. + + sntp/include/copyright.def@1.31 +1 -1 + http://bugs.ntp.org/ -> https + + tests/sandbox/smeartest.c@1.11 +1 -1 + clean up warning re: main() vs main(void) + + util/ntp-keygen-opts.def@1.33 +1 -1 + Increase IFF default modulus bits to 512 for OpenSSL 3 compatibility. + + util/ntp-keygen.c@1.111 +8 -4 + Increase IFF default modulus bits to 512 for OpenSSL 3 compatibility. + Use different buffers for in/out args to readlink() to respect "restrict" modifiers and avoid undefined behavior. + +ChangeSet@1.3968, 2023-03-16 08:06:24+00:00, hart@hart.chi1.ntfo.org + unity_internals.h: + FreeBSD11 stdnoreturn.h #define noreturn _Noreturn breaks hint + + sntp/unity/unity_internals.h@1.7 +1 -1 + Fix problem with FreeBSD #define noreturn _Noreturn expanding to invalid __attribute((_Noreturn)), upstreamed to Unity github. + +ChangeSet@1.3967, 2023-03-13 11:17:46+00:00, hart@ntp-devbuild.chi1.ntfo.org + ntp_config.c: + avoid problems with #define noreturn _Noreturn + + ntpd/ntp_config.c@1.379 +1 -1 + avoid problems with #define noreturn _Noreturn + +ChangeSet@1.3963.1.2, 2023-03-13 08:50:22+00:00, hart@ntp-devbuild.chi1.ntfo.org + Use silent rules for version.c files. + Correct configure.ac test and bump cache version to flush bad results. + Silence gcc format-truncation warning in refclock_leitch.c. + + configure.ac@1.626 +2 -2 + Correct ntp_cv_struct_nlist_u_un test + + ntpd/Makefile.am@1.145 +0 -3 + use Automake silent rules for version.c + + ntpd/refclock_leitch.c@1.16 +1 -1 + silence gcc warning for printf %d potential truncation + + ntpdate/Makefile.am@1.40 +0 -3 + use Automake silent rules for version.c + + ntpdc/Makefile.am@1.78 +0 -3 + use Automake silent rules for version.c + + ntpq/Makefile.am@1.76 +0 -3 + use Automake silent rules for version.c + + sntp/Makefile.am@1.92 +0 -3 + use Automake silent rules for version.c + + util/Makefile.am@1.81 +0 -3 + use Automake silent rules for version.c + +ChangeSet@1.3963.1.1, 2023-03-12 16:43:24-04:00, davehart@tl.davehart.net + [Bug 3801] gpsdjson refclock gps_open() device name mishandled. + + ChangeLog@1.2024.1.1 +3 -1 + [Bug 3801] gpsdjson refclock gps_open() device name mishandled. + + ntpd/refclock_gpsdjson.c@1.34 +3 -2 + Pass correct device name to ntp_realpath. + + ports/winnt/vs2015/ntpd/ntpd.vcxproj@1.5.1.1 +2 -1 + Add reference to refclock_gpsdjson.c + + ports/winnt/vs2015/ntpd/ntpd.vcxproj.filters@1.4.1.1 +4 -1 + Add reference to refclock_gpsdjson.c + +ChangeSet@1.3965, 2023-03-11 03:23:55-05:00, davehart@tl.davehart.net + [Bug 3799] Enable libopts noreturn compiler advice for MSC. + Add ChangeLog to ntpd project for easy editing within VS. + + ChangeLog@1.2026 +1 -0 + [Bug 3799] Enable libopts noreturn compiler advice for MSC. + + ports/winnt/vs2015/ntpd/ntpd.vcxproj@1.6 +2 -1 + Add ChangeLog to ntpd project for easy editing within VS. + + ports/winnt/vs2015/ntpd/ntpd.vcxproj.filters@1.5 +2 -1 + Add ChangeLog to ntpd project for easy editing within VS. + + sntp/libopts/autoopts.h@1.23 +6 -6 + Use lo_noreturn instead of noreturn for MSC compatibility. + + sntp/libopts/autoopts/project.h@1.10 +6 -0 + Preserve noreturn hint for Microsoft C compiler. + + sntp/libopts/makeshell.c@1.23 +3 -3 + Use lo_noreturn instead of noreturn for MSC compatibility. + + sntp/libopts/proto.h@1.33 +3 -3 + Use lo_noreturn instead of noreturn for MSC compatibility. + + sntp/libopts/usage.c@1.23 +1 -1 + Use lo_noreturn instead of noreturn for MSC compatibility. + +ChangeSet@1.3964, 2023-03-10 23:31:42-05:00, davehart@tl.davehart.net + [Bug 3800] libopts-42.1.17 does not compile with Microsoft C. + Clean up [Bug 2525] changes by moving libisc source and header files into + separate groups in the Visual Studio IDE. + + ChangeLog@1.2025 +1 -0 + [Bug 3800] libopts-42.1.17 does not compile with Microsoft C. + + ports/winnt/vs2015/libntp/libntp.vcxproj.filters@1.7 +152 -149 + Clean up [Bug 2525] changes by moving libisc source and header files into + separate groups in the Visual Studio IDE. + + sntp/libopts/save.c@1.21 +24 -0 + Implement truncate() for Microsoft C + + sntp/libopts/text_mmap.c@1.19 +1 -1 + Use _O_BINARY not O_BINARY to fix MSC compile + +ChangeSet@1.3960.2.1, 2023-03-06 01:47:00-06:00, stenn@ntp-devbuild.chi1.ntfo.org + pollskewlist bug is 3795, not 3595 + + ChangeLog@1.2021.2.1 +2 -2 + pollskewlist bug is 3795, not 3595 + +ChangeSet@1.3960.1.1, 2023-03-06 01:45:12-06:00, stenn@ntp-devbuild.chi1.ntfo.org + Use https URLs for AC_INIT + + ChangeLog@1.2021.1.1 +1 -0 + Use https URLs for AC_INIT + +ChangeSet@1.3960, 2023-03-06 00:15:49-06:00, stenn@ntp-devbuild.chi1.ntfo.org + Use https in AC_INIT URLs + + configure.ac@1.625 +2 -2 + Use https in AC_INIT URLs + + sntp/configure.ac@1.88 +2 -2 + Use https in AC_INIT URLs + +ChangeSet@1.3958, 2023-03-05 22:03:49-06:00, stenn@ntp-devbuild.chi1.ntfo.org + Cleanup ChangeLog + + ChangeLog@1.2020 +10 -10 + Cleanup ChangeLog + +ChangeSet@1.3940.3.5, 2023-03-05 21:44:20-06:00, stenn@ntp-devbuild.chi1.ntfo.org + Check in missing libopts/ files + + sntp/libopts/save-flags.c@1.1 +248 -0 + BitKeeper file sntp/libopts/save-flags.c + + sntp/libopts/save-flags.c@1.0 +0 -0 + + sntp/libopts/save-flags.h@1.1 +68 -0 + BitKeeper file sntp/libopts/save-flags.h + + sntp/libopts/save-flags.h@1.0 +0 -0 + +ChangeSet@1.3955, 2023-03-05 15:28:23-05:00, davehart@tl.davehart.net + Correct const usage of strtouv64 endp argument. + + include/vint64ops.h@1.3 +1 -1 + Correct const usage of strtouv64 endp argument. + + libntp/vint64ops.c@1.3 +3 -3 + Correct const usage of strtouv64 endp argument. + + ntpd/ntp_leapsec.c@1.25 +8 -7 + Correct const usage of strtouv64 endp argument. + Use INT16_MAX, INT16_MIN for int16_t. + + tests/libntp/vi64ops.c@1.7 +3 -3 + Correct const usage of strtouv64 endp argument. + +ChangeSet@1.3940.3.4, 2023-03-05 02:26:19-06:00, stenn@ntp-devbuild.chi1.ntfo.org + autogen upgrade + + ntpd/ntpd-opts.c@1.546 +1 -1 + autogen upgrade + + ntpd/ntpd-opts.h@1.545 +1 -1 + autogen upgrade + + ntpd/ntpdsim-opts.c@1.31 +1 -1 + autogen upgrade + + ntpd/ntpdsim-opts.h@1.31 +1 -1 + autogen upgrade + + ntpdc/ntpdc-opts.c@1.541 +1 -1 + autogen upgrade + + ntpdc/ntpdc-opts.h@1.540 +1 -1 + autogen upgrade + + ntpq/ntpq-opts.c@1.550 +1 -1 + autogen upgrade + + ntpq/ntpq-opts.h@1.548 +1 -1 + autogen upgrade + + ntpsnmpd/ntpsnmpd-opts.c@1.541 +1 -1 + autogen upgrade + + ntpsnmpd/ntpsnmpd-opts.h@1.540 +1 -1 + autogen upgrade + + scripts/calc_tickadj/calc_tickadj-opts@1.12 +1 -1 + autogen upgrade + + scripts/ntpsweep/ntpsweep-opts@1.82 +1 -1 + autogen upgrade + + scripts/ntptrace/ntptrace-opts@1.82 +1 -1 + autogen upgrade + + scripts/plot_summary-opts@1.83 +1 -1 + autogen upgrade + + scripts/summary-opts@1.82 +1 -1 + autogen upgrade + + scripts/update-leap/update-leap-opts@1.33 +1 -1 + autogen upgrade + + sntp/sntp-opts.c@1.542 +1 -1 + autogen upgrade + + sntp/sntp-opts.h@1.540 +1 -1 + autogen upgrade + + util/ntp-keygen-opts.c@1.544 +1 -1 + autogen upgrade + + util/ntp-keygen-opts.h@1.542 +1 -1 + autogen upgrade + +ChangeSet@1.3940.3.3, 2023-03-05 00:23:04-06:00, stenn@ntp-devbuild.chi1.ntfo.org + Updated to autogen-5.16.18 and libopts-42.1.17 + + html/copyright.html@1.69.1.1 +3 -3 + Updated to autogen-5.16.18 and libopts-42.1.17 + + ntpd/ntpd-opts.c@1.545 +115 -114 + Updated to autogen-5.16.18 and libopts-42.1.17 + + ntpd/ntpd-opts.h@1.544 +13 -4 + Updated to autogen-5.16.18 and libopts-42.1.17 + + ntpd/ntpdsim-opts.c@1.30 +121 -120 + Updated to autogen-5.16.18 and libopts-42.1.17 + + ntpd/ntpdsim-opts.h@1.30 +15 -6 + Updated to autogen-5.16.18 and libopts-42.1.17 + + ntpdc/ntpdc-opts.c@1.540 +115 -114 + Updated to autogen-5.16.18 and libopts-42.1.17 + + ntpdc/ntpdc-opts.h@1.539 +13 -4 + Updated to autogen-5.16.18 and libopts-42.1.17 + + ntpq/ntpq-opts.c@1.549 +115 -114 + Updated to autogen-5.16.18 and libopts-42.1.17 + + ntpq/ntpq-opts.h@1.547 +13 -4 + Updated to autogen-5.16.18 and libopts-42.1.17 + + ntpsnmpd/ntpsnmpd-opts.c@1.540 +115 -114 + Updated to autogen-5.16.18 and libopts-42.1.17 + + ntpsnmpd/ntpsnmpd-opts.h@1.539 +13 -4 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/calc_tickadj/calc_tickadj-opts@1.11 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.111 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.112 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/calc_tickadj/calc_tickadj.html@1.112 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/calc_tickadj/calc_tickadj.man.in@1.110 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.112 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.115 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/invoke-plot_summary.texi@1.133 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/invoke-summary.texi@1.132 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/ntp-wait/invoke-ntp-wait.texi@1.343 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/ntp-wait/ntp-wait-opts@1.79 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.339 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.340 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/ntp-wait/ntp-wait.man.in@1.339 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/ntp-wait/ntp-wait.mdoc.in@1.340 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/ntpsweep/invoke-ntpsweep.texi@1.130 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/ntpsweep/ntpsweep-opts@1.81 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.118 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.118 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/ntpsweep/ntpsweep.man.in@1.118 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/ntpsweep/ntpsweep.mdoc.in@1.119 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/ntptrace/invoke-ntptrace.texi@1.132 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/ntptrace/ntptrace-opts@1.81 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/ntptrace/ntptrace.1ntptraceman@1.118 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.119 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/ntptrace/ntptrace.man.in@1.118 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/ntptrace/ntptrace.mdoc.in@1.120 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/plot_summary-opts@1.82 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/plot_summary.1plot_summaryman@1.131 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/plot_summary.1plot_summarymdoc@1.131 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/plot_summary.man.in@1.131 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/plot_summary.mdoc.in@1.131 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/summary-opts@1.81 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/summary.1summaryman@1.130 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/summary.1summarymdoc@1.130 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/summary.man.in@1.130 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/summary.mdoc.in@1.130 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/update-leap/invoke-update-leap.texi@1.31 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/update-leap/update-leap-opts@1.32 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/update-leap/update-leap.1update-leapman@1.31 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/update-leap/update-leap.1update-leapmdoc@1.31 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/update-leap/update-leap.man.in@1.31 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + scripts/update-leap/update-leap.mdoc.in@1.31 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/include/autogen-version.def@1.23 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/include/copyright.def@1.28.1.1 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/COPYING.gplv3@1.9 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/COPYING.lgplv3@1.9 +3 -3 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/COPYING.mbsd@1.4 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/Makefile.am@1.29 +18 -21 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/README@1.11 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/ag-char-map.h@1.32 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/alias.c@1.9 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/ao-strs.c@1.18 +143 -138 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/ao-strs.h@1.17 +152 -144 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/autoopts.c@1.21 +8 -14 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/autoopts.h@1.22 +11 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/autoopts/options.h@1.33 +9 -7 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/autoopts/project.h@1.9 +5 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/autoopts/usage-txt.h@1.30 +249 -255 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/boolean.c@1.16 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/check.c@1.9 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/compat/compat.h@1.17 +4 -4 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/compat/pathfind.c@1.14 +1 -12 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/compat/windows-config.h@1.15 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/configfile.c@1.25 +61 -105 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/cook.c@1.16 +24 -29 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/enum.c@1.15 +10 -34 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/env.c@1.10 +3 -9 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/file.c@1.17 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/find.c@1.14 +24 -39 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/genshell.c@1.32 +114 -113 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/genshell.h@1.33 +18 -3 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/gettext.h@1.5 +13 -7 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/init.c@1.10 +7 -11 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/intprops.h@1.3 +200 -67 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/libopts.c@1.10 +4 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/load.c@1.23 +29 -39 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/m4/libopts.m4@1.36 +10 -16 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/m4/liboptschk.m4@1.14 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/m4/stdnoreturn.m4@1.3 +38 -28 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/makeshell.c@1.22 +16 -54 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/nested.c@1.18 +24 -57 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/numeric.c@1.16 +9 -8 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/option-value-type.c@1.19 +5 -5 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/option-xat-attribute.c@1.19 +5 -5 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/parse-duration.c@1.16 +4 -10 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/parse-duration.h@1.11 +3 -3 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/pgusage.c@1.19 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/proto.h@1.32 +491 -17 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/putshell.c@1.16 +13 -29 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/reset.c@1.19 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/restore.c@1.15 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/save.c@1.20 +319 -212 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/sort.c@1.15 +2 -16 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/stack.c@1.17 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/stdnoreturn.in.h@1.3 +21 -11 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/streqvcmp.c@1.17 +2 -2 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/text_mmap.c@1.18 +9 -6 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/time.c@1.16 +5 -3 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/tokenize.c@1.15 +2 -19 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/usage.c@1.22 +16 -67 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/libopts/version.c@1.20 +7 -4 + Updated to autogen-5.16.18 and libopts-42.1.17 + + util/ntp-keygen-opts.c@1.543 +115 -115 + Updated to autogen-5.16.18 and libopts-42.1.17 + + util/ntp-keygen-opts.h@1.541 +13 -4 + Updated to autogen-5.16.18 and libopts-42.1.17 + +ChangeSet@1.3940.3.2, 2023-03-04 23:57:28-06:00, stenn@ntp-devbuild.chi1.ntfo.org + Updated to autogen-5.16.18 and libopts-42.1.17 + + configure.ac@1.622.1.1 +1 -1 + Updated to autogen-5.16.18 and libopts-42.1.17 + +ChangeSet@1.3940.3.1, 2023-03-04 23:56:19-06:00, stenn@ntp-devbuild.chi1.ntfo.org + Updated to autogen-5.16.18 and libopts-42.1.17 + + ChangeLog@1.2009.3.1 +4 -0 + auto* and libopts upgrade + + ntpd/Makefile.am@1.141.1.1 +1 -0 + + sntp/libopts/_Noreturn.h@1.2 +0 -0 + Rename: sntp/libopts/compat/_Noreturn.h -> sntp/libopts/_Noreturn.h + + sntp/sntp-opts.c@1.541 +115 -115 + Updated to autogen-5.16.18 and libopts-42.1.17 + + sntp/sntp-opts.h@1.539 +13 -4 + Updated to autogen-5.16.18 and libopts-42.1.17 + +ChangeSet@1.3954, 2023-02-27 03:04:43-05:00, davehart@tl.davehart.net + [Bug 3781] log "Unable to listen for broadcasts" for IPv4 + + ChangeLog@1.2018 +1 -0 + [Bug 3781] log "Unable to listen for broadcasts" for IPv4 + + ntpd/ntp_io.c@1.432.1.2 +6 -8 + Log "Unable to listen for broadcasts" on dual-stack systems with at least one IPv4 interface in use by ntpd. + +ChangeSet@1.3953, 2023-02-23 04:55:50-05:00, davehart@tl.davehart.net + Bugs 3774 and 3793 + [Bug 3595] pollskewlist documentation uses | when it shouldn't. + [Bug 3797] Windows getaddrinfo w/AI_ADDRCONFIG fails for localhost when disconnected + [Bug 3774] mode 6 packets corrupted in rawstats file + [Bug 3793] Wrong variable type passed to record_raw_stats(). + Remove inappropriate copyright notice in Windows messages.mc and messages.h + + ChangeLog@1.2017 +8 -1 + Bugs 3774, 3793, 3595, 3597 + + html/copyright.html@1.71 +2 -2 + Update copyright year. + + html/miscopt.html@1.94 +3 -6 + [Bug 3595] pollskewlist documentation uses | when it shouldn't. + + include/vint64ops.h@1.2 +1 -1 + Remove unneccessary noconst union hack. + + libntp/socktoa.c@1.19 +1 -1 + Correct comment to match code for sock_hash() + + libntp/vint64ops.c@1.2 +4 -23 + Remove unneccessary noconst union hack. + + ntpd/ntp.conf.def@1.36 +6 -4 + [Bug 3595] pollskewlist documentation uses | when it shouldn't. + + ntpd/ntp_io.c@1.432.1.1 +3 -2 + [Bug 3793] Wrong variable type passed to record_raw_stats(). + - Report and patch by Yuezhen LUAN . + Cast time_t to use with with format %ld. + + ntpd/ntp_util.c@1.123 +7 -0 + [Bug 3774] mode 6 packets corrupted in rawstats file + - Reported by Edward McGuire, fix identified by . + + ntpdc/ntpdc.c@1.115 +21 -2 + [Bug 3797] Windows getaddrinfo w/AI_ADDRCONFIG fails for localhost when disconnected + + ntpq/ntpq-subs.c@1.134 +24 -21 + Remove unnecessary work for *peers when querying a single host, avoiding + a spurious message before the succhessful output on disconnected Windows: + ***Can't find host localhost + + ntpq/ntpq.c@1.196 +25 -6 + [Bug 3797] Windows getaddrinfo w/AI_ADDRCONFIG fails for localhost when disconnected + + ports/winnt/libntp/messages.h@1.4 +8 -133 + Remove inapplicable Microsoft boilerplate copyright from developer support sample code. + + ports/winnt/libntp/messages.mc@1.4 +5 -133 + Remove inapplicable Microsoft boilerplate copyright from developer support sample code. + + sntp/include/copyright.def@1.29 +1 -1 + Update copyright year. + + tests/libntp/decodenetnum.c@1.14 +40 -40 + Quiet warnings suggesting braces on FreeBSD where in6_addr has a union. + + tests/libntp/socktoa.c@1.14 +14 -14 + Quiet warnings suggesting braces on FreeBSD where in6_addr has a union. + +ChangeSet@1.3952, 2023-02-22 01:00:47-05:00, davehart@tl.davehart.net + Fix missing format specifier to msyslog in Windows port. + Comment clarification in ntp_proto.c + + ntpd/ntp_proto.c@1.438.1.3 +1 -1 + Comment clarification + + ports/winnt/ntpd/ntp_iocompletionport.c@1.85 +1 -1 + Fix missing format specifier to msyslog in Windows port. + +ChangeSet@1.3951, 2023-02-20 14:12:24-05:00, davehart@tl.davehart.net + Finish the change for [Bug 3786] + + ports/winnt/ntpd/ntp_iocompletionport.c@1.84 +2 -2 + Finish the change for [Bug 3786] + +ChangeSet@1.3912.21.1, 2023-02-20 13:53:27-05:00, davehart@tl.davehart.net + [Bug 3640] document "discard monitor" and fix the code. + - fixed bug identified by Edward McGuire + + ChangeLog@1.1986.21.1 +3 -0 + [Bug 3640] document "discard monitor" and fix the code. + - fixed bug identified by Edward McGuire + + ntpd/ntp.conf.def@1.35 +16 -6 + Documentation by Dave Hart + + ntpd/ntp_monitor.c@1.44.1.1 +5 -3 + Bugfix identified by Edward McGuire + +ChangeSet@1.3949, 2023-02-20 13:00:45-05:00, davehart@tl.davehart.net + minor cleanup, correct winsock error number range + + libntp/lib/isc/win32/strerror.c@1.16 +1 -1 + Correct range check for winsock error numbers + + ports/winnt/ntpd/nt_ppsimpl.c@1.4 +29 -45 + Use emalloc(), estrdup() and remove unneeded checks for NULL return. + Remove unneeded op[-1] \0 check. + +ChangeSet@1.3948, 2023-02-20 12:11:06-05:00, davehart@tl.davehart.net + [Bug 3660] Revert 4.2.8p15 change to manycast. + + ChangeLog@1.2015 +1 -1 + [Bug 3660] Revert 4.2.8p15 change to manycast. + + ntpd/ntp_proto.c@1.438.1.2 +1 -1 + [Bug 3660] Revert 4.2.8p15 change to manycast. + This was due to a misundersstanding of orphan mode, documentation could be better. + +ChangeSet@1.3947, 2023-02-20 12:05:44-05:00, davehart@tl.davehart.net + [Bug 3786] Timer starvation on high-load Windows ntpd. + + ChangeLog@1.2014 +2 -1 + [Bug 3786] Timer starvation on high-load Windows ntpd. + + ports/winnt/ntpd/ntp_iocompletionport.c@1.83 +5 -5 + [Bug 3786] Timer starvation on high-load Windows ntpd. + +ChangeSet@1.3946, 2023-02-20 12:03:02-05:00, davehart@tl.davehart.net + [Bug 2410] syslog an error message on panic exceeded. + Update email address. + + ChangeLog@1.2013 +1 -0 + [Bug 2410] syslog an error message on panic exceeded. + + html/copyright.html@1.70 +1 -1 + Update my email address. + + ntpd/ntp_proto.c@1.438.1.1 +4 -0 + [Bug 2410] syslog an error message on panic exceeded. + +ChangeSet@1.3944, 2023-01-26 03:09:16-05:00, davehart@tl.davehart.net + Enable Automake's subdir-objects option quieting warnings and + building .o files in corresponding build subdirs to the source + subdirs. [Bug 2525] + Centralize more logic to build prereq. libraries in included .mf files. + Fix building without OpenSSL where arc4random() is available. + Fix building without refclock support. + Fix make maintainer-clean and thereby distcheck re deps-ver files. + + ChangeLog@1.2011 +5 -5 + Add [Bug 2525] and fix a few previous typos. + + Makefile.am@1.137 +0 -1 + Move lib/isc/ under libntp/ and be more selective about which files are distributed. + + adjtimed/Makefile.am@1.17 +2 -1 + Initialize DISTCLEANFILES so that depsver.mf can append to it. + Use top-level check-libntp.mf + + check-libntp.mf@1.1 +14 -0 + Split check-libntp.mf into main and sntp versions and remove duplicated logic in many Makefile.am files. + + check-libntp.mf@1.0 +0 -0 + + check-libntpd.mf@1.1 +19 -0 + Centralize makefile fragment to ensure libntpd.a is built. + + check-libntpd.mf@1.0 +0 -0 + + check-libunity.mf@1.1 +13 -0 + Centralize makefile logic to build libunity.a before dependents. + + check-libunity.mf@1.0 +0 -0 + + clockstuff/Makefile.am@1.23 +2 -1 + Initialize DISTCLEANFILES so that depsver.mf can append to it. + Use top-level check-libntp.mf + + configure.ac@1.623 +2 -6 + Turn on Automake subdir-objects option to build subdir *.o files in corresponding + build subdirs instead of all in the Makefile directory. + Remove conditionalization of AM_PROG_AR needed for pre-1.12 automake. + + deps-ver@1.7 +1 -1 + Bump deps-ver to clean .deps directories as files have moved. + + depsver.mf@1.5 +3 -2 + Add deps-ver to DISTCLEANFILES to fix make distcheck. + Do not give group write permission when making deps-ver writable. + + includes.mf@1.2 +3 -3 + Account for new path to lib/isc/ + + libntp/Makefile.am@1.86 +158 -36 + Initialize DISTCLEANFILES so that depsver.mf can append to it. + Move lib/isc/ under libntp/ and be more selective about which files are distributed. + Build libevent if needed before libntp. + + libntp/lib/isc/Atffile@1.3 +0 -0 + Rename: libntp/lib/isc/Atffile -> libntp/lib/isc/Atffile + + libntp/lib/isc/Atffile@1.2 +0 -0 + Rename: lib/isc/Atffile -> libntp/lib/isc/Atffile + + libntp/lib/isc/alpha/include/isc/atomic.h@1.4 +0 -0 + Rename: libntp/lib/isc/alpha/include/isc/atomic.h -> libntp/lib/isc/alpha/include/isc/atomic.h + + libntp/lib/isc/alpha/include/isc/atomic.h@1.3 +0 -0 + Rename: lib/isc/alpha/include/isc/atomic.h -> libntp/lib/isc/alpha/include/isc/atomic.h + + libntp/lib/isc/api@1.4 +0 -0 + Rename: libntp/lib/isc/api -> libntp/lib/isc/api + + libntp/lib/isc/api@1.3 +0 -0 + Rename: lib/isc/api -> libntp/lib/isc/api + + libntp/lib/isc/app_api.c@1.3 +0 -0 + Rename: libntp/lib/isc/app_api.c -> libntp/lib/isc/app_api.c + + libntp/lib/isc/app_api.c@1.2 +0 -0 + Rename: lib/isc/app_api.c -> libntp/lib/isc/app_api.c + + libntp/lib/isc/assertions.c@1.9 +0 -0 + Rename: libntp/lib/isc/assertions.c -> libntp/lib/isc/assertions.c + + libntp/lib/isc/assertions.c@1.8 +0 -0 + Rename: lib/isc/assertions.c -> libntp/lib/isc/assertions.c + + libntp/lib/isc/backtrace-emptytbl.c@1.3 +0 -0 + Rename: libntp/lib/isc/backtrace-emptytbl.c -> libntp/lib/isc/backtrace-emptytbl.c + + libntp/lib/isc/backtrace-emptytbl.c@1.2 +0 -0 + Rename: lib/isc/backtrace-emptytbl.c -> libntp/lib/isc/backtrace-emptytbl.c + + libntp/lib/isc/backtrace.c@1.5 +0 -0 + Rename: libntp/lib/isc/backtrace.c -> libntp/lib/isc/backtrace.c + + libntp/lib/isc/backtrace.c@1.4 +0 -0 + Rename: lib/isc/backtrace.c -> libntp/lib/isc/backtrace.c + + libntp/lib/isc/base32.c@1.4 +0 -0 + Rename: libntp/lib/isc/base32.c -> libntp/lib/isc/base32.c + + libntp/lib/isc/base32.c@1.3 +0 -0 + Rename: lib/isc/base32.c -> libntp/lib/isc/base32.c + + libntp/lib/isc/base64.c@1.4 +0 -0 + Rename: libntp/lib/isc/base64.c -> libntp/lib/isc/base64.c + + libntp/lib/isc/base64.c@1.3 +0 -0 + Rename: lib/isc/base64.c -> libntp/lib/isc/base64.c + + libntp/lib/isc/bitstring.c@1.3 +0 -0 + Rename: libntp/lib/isc/bitstring.c -> libntp/lib/isc/bitstring.c + + libntp/lib/isc/bitstring.c@1.2 +0 -0 + Rename: lib/isc/bitstring.c -> libntp/lib/isc/bitstring.c + + libntp/lib/isc/buffer.c@1.4 +0 -0 + Rename: libntp/lib/isc/buffer.c -> libntp/lib/isc/buffer.c + + libntp/lib/isc/buffer.c@1.3 +0 -0 + Rename: lib/isc/buffer.c -> libntp/lib/isc/buffer.c + + libntp/lib/isc/bufferlist.c@1.3 +0 -0 + Rename: libntp/lib/isc/bufferlist.c -> libntp/lib/isc/bufferlist.c + + libntp/lib/isc/bufferlist.c@1.2 +0 -0 + Rename: lib/isc/bufferlist.c -> libntp/lib/isc/bufferlist.c + + libntp/lib/isc/commandline.c@1.3 +0 -0 + Rename: libntp/lib/isc/commandline.c -> libntp/lib/isc/commandline.c + + libntp/lib/isc/commandline.c@1.2 +0 -0 + Rename: lib/isc/commandline.c -> libntp/lib/isc/commandline.c + + libntp/lib/isc/entropy.c@1.4 +0 -0 + Rename: libntp/lib/isc/entropy.c -> libntp/lib/isc/entropy.c + + libntp/lib/isc/entropy.c@1.3 +0 -0 + Rename: lib/isc/entropy.c -> libntp/lib/isc/entropy.c + + libntp/lib/isc/error.c@1.6 +0 -0 + Rename: libntp/lib/isc/error.c -> libntp/lib/isc/error.c + + libntp/lib/isc/error.c@1.5 +0 -0 + Rename: lib/isc/error.c -> libntp/lib/isc/error.c + + libntp/lib/isc/event.c@1.4 +0 -0 + Rename: libntp/lib/isc/event.c -> libntp/lib/isc/event.c + + libntp/lib/isc/event.c@1.3 +0 -0 + Rename: lib/isc/event.c -> libntp/lib/isc/event.c + + libntp/lib/isc/fsaccess.c@1.3 +0 -0 + Rename: libntp/lib/isc/fsaccess.c -> libntp/lib/isc/fsaccess.c + + libntp/lib/isc/fsaccess.c@1.2 +0 -0 + Rename: lib/isc/fsaccess.c -> libntp/lib/isc/fsaccess.c + + libntp/lib/isc/hash.c@1.4 +0 -0 + Rename: libntp/lib/isc/hash.c -> libntp/lib/isc/hash.c + + libntp/lib/isc/hash.c@1.3 +0 -0 + Rename: lib/isc/hash.c -> libntp/lib/isc/hash.c + + libntp/lib/isc/heap.c@1.4 +0 -0 + Rename: libntp/lib/isc/heap.c -> libntp/lib/isc/heap.c + + libntp/lib/isc/heap.c@1.3 +0 -0 + Rename: lib/isc/heap.c -> libntp/lib/isc/heap.c + + libntp/lib/isc/hex.c@1.3 +0 -0 + Rename: libntp/lib/isc/hex.c -> libntp/lib/isc/hex.c + + libntp/lib/isc/hex.c@1.2 +0 -0 + Rename: lib/isc/hex.c -> libntp/lib/isc/hex.c + + libntp/lib/isc/hmacmd5.c@1.5 +0 -0 + Rename: libntp/lib/isc/hmacmd5.c -> libntp/lib/isc/hmacmd5.c + + libntp/lib/isc/hmacmd5.c@1.4 +0 -0 + Rename: lib/isc/hmacmd5.c -> libntp/lib/isc/hmacmd5.c + + libntp/lib/isc/hmacsha.c@1.5 +0 -0 + Rename: libntp/lib/isc/hmacsha.c -> libntp/lib/isc/hmacsha.c + + libntp/lib/isc/hmacsha.c@1.4 +0 -0 + Rename: lib/isc/hmacsha.c -> libntp/lib/isc/hmacsha.c + + libntp/lib/isc/httpd.c@1.4 +0 -0 + Rename: libntp/lib/isc/httpd.c -> libntp/lib/isc/httpd.c + + libntp/lib/isc/httpd.c@1.3 +0 -0 + Rename: lib/isc/httpd.c -> libntp/lib/isc/httpd.c + + libntp/lib/isc/ia64/include/isc/atomic.h@1.4 +0 -0 + Rename: libntp/lib/isc/ia64/include/isc/atomic.h -> libntp/lib/isc/ia64/include/isc/atomic.h + + libntp/lib/isc/ia64/include/isc/atomic.h@1.3 +0 -0 + Rename: lib/isc/ia64/include/isc/atomic.h -> libntp/lib/isc/ia64/include/isc/atomic.h + + libntp/lib/isc/include/isc/app.h@1.7 +0 -0 + Rename: libntp/lib/isc/include/isc/app.h -> libntp/lib/isc/include/isc/app.h + + libntp/lib/isc/include/isc/app.h@1.6 +0 -0 + Rename: lib/isc/include/isc/app.h -> libntp/lib/isc/include/isc/app.h + + libntp/lib/isc/include/isc/assertions.h@1.9 +0 -0 + Rename: libntp/lib/isc/include/isc/assertions.h -> libntp/lib/isc/include/isc/assertions.h + + libntp/lib/isc/include/isc/assertions.h@1.8 +0 -0 + Rename: lib/isc/include/isc/assertions.h -> libntp/lib/isc/include/isc/assertions.h + + libntp/lib/isc/include/isc/backtrace.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/backtrace.h -> libntp/lib/isc/include/isc/backtrace.h + + libntp/lib/isc/include/isc/backtrace.h@1.3 +0 -0 + Rename: lib/isc/include/isc/backtrace.h -> libntp/lib/isc/include/isc/backtrace.h + + libntp/lib/isc/include/isc/base32.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/base32.h -> libntp/lib/isc/include/isc/base32.h + + libntp/lib/isc/include/isc/base32.h@1.2 +0 -0 + Rename: lib/isc/include/isc/base32.h -> libntp/lib/isc/include/isc/base32.h + + libntp/lib/isc/include/isc/base64.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/base64.h -> libntp/lib/isc/include/isc/base64.h + + libntp/lib/isc/include/isc/base64.h@1.2 +0 -0 + Rename: lib/isc/include/isc/base64.h -> libntp/lib/isc/include/isc/base64.h + + libntp/lib/isc/include/isc/bind9.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/bind9.h -> libntp/lib/isc/include/isc/bind9.h + + libntp/lib/isc/include/isc/bind9.h@1.2 +0 -0 + Rename: lib/isc/include/isc/bind9.h -> libntp/lib/isc/include/isc/bind9.h + + libntp/lib/isc/include/isc/bitstring.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/bitstring.h -> libntp/lib/isc/include/isc/bitstring.h + + libntp/lib/isc/include/isc/bitstring.h@1.2 +0 -0 + Rename: lib/isc/include/isc/bitstring.h -> libntp/lib/isc/include/isc/bitstring.h + + libntp/lib/isc/include/isc/boolean.h@1.6 +0 -0 + Rename: libntp/lib/isc/include/isc/boolean.h -> libntp/lib/isc/include/isc/boolean.h + + libntp/lib/isc/include/isc/boolean.h@1.5 +0 -0 + Rename: lib/isc/include/isc/boolean.h -> libntp/lib/isc/include/isc/boolean.h + + libntp/lib/isc/include/isc/buffer.h@1.7 +0 -0 + Rename: libntp/lib/isc/include/isc/buffer.h -> libntp/lib/isc/include/isc/buffer.h + + libntp/lib/isc/include/isc/buffer.h@1.6 +0 -0 + Rename: lib/isc/include/isc/buffer.h -> libntp/lib/isc/include/isc/buffer.h + + libntp/lib/isc/include/isc/bufferlist.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/bufferlist.h -> libntp/lib/isc/include/isc/bufferlist.h + + libntp/lib/isc/include/isc/bufferlist.h@1.2 +0 -0 + Rename: lib/isc/include/isc/bufferlist.h -> libntp/lib/isc/include/isc/bufferlist.h + + libntp/lib/isc/include/isc/commandline.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/commandline.h -> libntp/lib/isc/include/isc/commandline.h + + libntp/lib/isc/include/isc/commandline.h@1.2 +0 -0 + Rename: lib/isc/include/isc/commandline.h -> libntp/lib/isc/include/isc/commandline.h + + libntp/lib/isc/include/isc/entropy.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/entropy.h -> libntp/lib/isc/include/isc/entropy.h + + libntp/lib/isc/include/isc/entropy.h@1.3 +0 -0 + Rename: lib/isc/include/isc/entropy.h -> libntp/lib/isc/include/isc/entropy.h + + libntp/lib/isc/include/isc/error.h@1.7 +0 -0 + Rename: libntp/lib/isc/include/isc/error.h -> libntp/lib/isc/include/isc/error.h + + libntp/lib/isc/include/isc/error.h@1.6 +0 -0 + Rename: lib/isc/include/isc/error.h -> libntp/lib/isc/include/isc/error.h + + libntp/lib/isc/include/isc/event.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/event.h -> libntp/lib/isc/include/isc/event.h + + libntp/lib/isc/include/isc/event.h@1.2 +0 -0 + Rename: lib/isc/include/isc/event.h -> libntp/lib/isc/include/isc/event.h + + libntp/lib/isc/include/isc/eventclass.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/eventclass.h -> libntp/lib/isc/include/isc/eventclass.h + + libntp/lib/isc/include/isc/eventclass.h@1.2 +0 -0 + Rename: lib/isc/include/isc/eventclass.h -> libntp/lib/isc/include/isc/eventclass.h + + libntp/lib/isc/include/isc/file.h@1.8 +0 -0 + Rename: libntp/lib/isc/include/isc/file.h -> libntp/lib/isc/include/isc/file.h + + libntp/lib/isc/include/isc/file.h@1.7 +0 -0 + Rename: lib/isc/include/isc/file.h -> libntp/lib/isc/include/isc/file.h + + libntp/lib/isc/include/isc/formatcheck.h@1.6 +0 -0 + Rename: libntp/lib/isc/include/isc/formatcheck.h -> libntp/lib/isc/include/isc/formatcheck.h + + libntp/lib/isc/include/isc/formatcheck.h@1.5 +0 -0 + Rename: lib/isc/include/isc/formatcheck.h -> libntp/lib/isc/include/isc/formatcheck.h + + libntp/lib/isc/include/isc/fsaccess.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/fsaccess.h -> libntp/lib/isc/include/isc/fsaccess.h + + libntp/lib/isc/include/isc/fsaccess.h@1.3 +0 -0 + Rename: lib/isc/include/isc/fsaccess.h -> libntp/lib/isc/include/isc/fsaccess.h + + libntp/lib/isc/include/isc/hash.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/hash.h -> libntp/lib/isc/include/isc/hash.h + + libntp/lib/isc/include/isc/hash.h@1.3 +0 -0 + Rename: lib/isc/include/isc/hash.h -> libntp/lib/isc/include/isc/hash.h + + libntp/lib/isc/include/isc/heap.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/heap.h -> libntp/lib/isc/include/isc/heap.h + + libntp/lib/isc/include/isc/heap.h@1.3 +0 -0 + Rename: lib/isc/include/isc/heap.h -> libntp/lib/isc/include/isc/heap.h + + libntp/lib/isc/include/isc/hex.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/hex.h -> libntp/lib/isc/include/isc/hex.h + + libntp/lib/isc/include/isc/hex.h@1.2 +0 -0 + Rename: lib/isc/include/isc/hex.h -> libntp/lib/isc/include/isc/hex.h + + libntp/lib/isc/include/isc/hmacmd5.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/hmacmd5.h -> libntp/lib/isc/include/isc/hmacmd5.h + + libntp/lib/isc/include/isc/hmacmd5.h@1.3 +0 -0 + Rename: lib/isc/include/isc/hmacmd5.h -> libntp/lib/isc/include/isc/hmacmd5.h + + libntp/lib/isc/include/isc/hmacsha.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/hmacsha.h -> libntp/lib/isc/include/isc/hmacsha.h + + libntp/lib/isc/include/isc/hmacsha.h@1.3 +0 -0 + Rename: lib/isc/include/isc/hmacsha.h -> libntp/lib/isc/include/isc/hmacsha.h + + libntp/lib/isc/include/isc/httpd.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/httpd.h -> libntp/lib/isc/include/isc/httpd.h + + libntp/lib/isc/include/isc/httpd.h@1.2 +0 -0 + Rename: lib/isc/include/isc/httpd.h -> libntp/lib/isc/include/isc/httpd.h + + libntp/lib/isc/include/isc/interfaceiter.h@1.10 +0 -0 + Rename: libntp/lib/isc/include/isc/interfaceiter.h -> libntp/lib/isc/include/isc/interfaceiter.h + + libntp/lib/isc/include/isc/interfaceiter.h@1.9 +0 -0 + Rename: lib/isc/include/isc/interfaceiter.h -> libntp/lib/isc/include/isc/interfaceiter.h + + libntp/lib/isc/include/isc/ipv6.h@1.11 +0 -0 + Rename: libntp/lib/isc/include/isc/ipv6.h -> libntp/lib/isc/include/isc/ipv6.h + + libntp/lib/isc/include/isc/ipv6.h@1.10 +0 -0 + Rename: lib/isc/include/isc/ipv6.h -> libntp/lib/isc/include/isc/ipv6.h + + libntp/lib/isc/include/isc/iterated_hash.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/iterated_hash.h -> libntp/lib/isc/include/isc/iterated_hash.h + + libntp/lib/isc/include/isc/iterated_hash.h@1.2 +0 -0 + Rename: lib/isc/include/isc/iterated_hash.h -> libntp/lib/isc/include/isc/iterated_hash.h + + libntp/lib/isc/include/isc/lang.h@1.6 +0 -0 + Rename: libntp/lib/isc/include/isc/lang.h -> libntp/lib/isc/include/isc/lang.h + + libntp/lib/isc/include/isc/lang.h@1.5 +0 -0 + Rename: lib/isc/include/isc/lang.h -> libntp/lib/isc/include/isc/lang.h + + libntp/lib/isc/include/isc/lex.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/lex.h -> libntp/lib/isc/include/isc/lex.h + + libntp/lib/isc/include/isc/lex.h@1.2 +0 -0 + Rename: lib/isc/include/isc/lex.h -> libntp/lib/isc/include/isc/lex.h + + libntp/lib/isc/include/isc/lfsr.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/lfsr.h -> libntp/lib/isc/include/isc/lfsr.h + + libntp/lib/isc/include/isc/lfsr.h@1.2 +0 -0 + Rename: lib/isc/include/isc/lfsr.h -> libntp/lib/isc/include/isc/lfsr.h + + libntp/lib/isc/include/isc/lib.h@1.7 +0 -0 + Rename: libntp/lib/isc/include/isc/lib.h -> libntp/lib/isc/include/isc/lib.h + + libntp/lib/isc/include/isc/lib.h@1.6 +0 -0 + Rename: lib/isc/include/isc/lib.h -> libntp/lib/isc/include/isc/lib.h + + libntp/lib/isc/include/isc/list.h@1.7 +0 -0 + Rename: libntp/lib/isc/include/isc/list.h -> libntp/lib/isc/include/isc/list.h + + libntp/lib/isc/include/isc/list.h@1.6 +0 -0 + Rename: lib/isc/include/isc/list.h -> libntp/lib/isc/include/isc/list.h + + libntp/lib/isc/include/isc/log.h@1.6 +0 -0 + Rename: libntp/lib/isc/include/isc/log.h -> libntp/lib/isc/include/isc/log.h + + libntp/lib/isc/include/isc/log.h@1.5 +0 -0 + Rename: lib/isc/include/isc/log.h -> libntp/lib/isc/include/isc/log.h + + libntp/lib/isc/include/isc/magic.h@1.6 +0 -0 + Rename: libntp/lib/isc/include/isc/magic.h -> libntp/lib/isc/include/isc/magic.h + + libntp/lib/isc/include/isc/magic.h@1.5 +0 -0 + Rename: lib/isc/include/isc/magic.h -> libntp/lib/isc/include/isc/magic.h + + libntp/lib/isc/include/isc/md5.h@1.5 +0 -0 + Rename: libntp/lib/isc/include/isc/md5.h -> libntp/lib/isc/include/isc/md5.h + + libntp/lib/isc/include/isc/md5.h@1.4 +0 -0 + Rename: lib/isc/include/isc/md5.h -> libntp/lib/isc/include/isc/md5.h + + libntp/lib/isc/include/isc/mem.h@1.8 +0 -0 + Rename: libntp/lib/isc/include/isc/mem.h -> libntp/lib/isc/include/isc/mem.h + + libntp/lib/isc/include/isc/mem.h@1.7 +0 -0 + Rename: lib/isc/include/isc/mem.h -> libntp/lib/isc/include/isc/mem.h + + libntp/lib/isc/include/isc/msgcat.h@1.6 +0 -0 + Rename: libntp/lib/isc/include/isc/msgcat.h -> libntp/lib/isc/include/isc/msgcat.h + + libntp/lib/isc/include/isc/msgcat.h@1.5 +0 -0 + Rename: lib/isc/include/isc/msgcat.h -> libntp/lib/isc/include/isc/msgcat.h + + libntp/lib/isc/include/isc/msgs.h@1.9 +0 -0 + Rename: libntp/lib/isc/include/isc/msgs.h -> libntp/lib/isc/include/isc/msgs.h + + libntp/lib/isc/include/isc/msgs.h@1.8 +0 -0 + Rename: lib/isc/include/isc/msgs.h -> libntp/lib/isc/include/isc/msgs.h + + libntp/lib/isc/include/isc/mutexblock.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/mutexblock.h -> libntp/lib/isc/include/isc/mutexblock.h + + libntp/lib/isc/include/isc/mutexblock.h@1.2 +0 -0 + Rename: lib/isc/include/isc/mutexblock.h -> libntp/lib/isc/include/isc/mutexblock.h + + libntp/lib/isc/include/isc/namespace.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/namespace.h -> libntp/lib/isc/include/isc/namespace.h + + libntp/lib/isc/include/isc/namespace.h@1.2 +0 -0 + Rename: lib/isc/include/isc/namespace.h -> libntp/lib/isc/include/isc/namespace.h + + libntp/lib/isc/include/isc/netaddr.h@1.9 +0 -0 + Rename: libntp/lib/isc/include/isc/netaddr.h -> libntp/lib/isc/include/isc/netaddr.h + + libntp/lib/isc/include/isc/netaddr.h@1.8 +0 -0 + Rename: lib/isc/include/isc/netaddr.h -> libntp/lib/isc/include/isc/netaddr.h + + libntp/lib/isc/include/isc/netscope.h@1.6 +0 -0 + Rename: libntp/lib/isc/include/isc/netscope.h -> libntp/lib/isc/include/isc/netscope.h + + libntp/lib/isc/include/isc/netscope.h@1.5 +0 -0 + Rename: lib/isc/include/isc/netscope.h -> libntp/lib/isc/include/isc/netscope.h + + libntp/lib/isc/include/isc/ondestroy.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/ondestroy.h -> libntp/lib/isc/include/isc/ondestroy.h + + libntp/lib/isc/include/isc/ondestroy.h@1.2 +0 -0 + Rename: lib/isc/include/isc/ondestroy.h -> libntp/lib/isc/include/isc/ondestroy.h + + libntp/lib/isc/include/isc/os.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/os.h -> libntp/lib/isc/include/isc/os.h + + libntp/lib/isc/include/isc/os.h@1.2 +0 -0 + Rename: lib/isc/include/isc/os.h -> libntp/lib/isc/include/isc/os.h + + libntp/lib/isc/include/isc/parseint.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/parseint.h -> libntp/lib/isc/include/isc/parseint.h + + libntp/lib/isc/include/isc/parseint.h@1.2 +0 -0 + Rename: lib/isc/include/isc/parseint.h -> libntp/lib/isc/include/isc/parseint.h + + libntp/lib/isc/include/isc/platform.h@1.5 +0 -0 + Rename: libntp/lib/isc/include/isc/platform.h -> libntp/lib/isc/include/isc/platform.h + + libntp/lib/isc/include/isc/platform.h@1.4 +0 -0 + Rename: lib/isc/include/isc/platform.h -> libntp/lib/isc/include/isc/platform.h + + libntp/lib/isc/include/isc/platform.h.in@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/platform.h.in -> libntp/lib/isc/include/isc/platform.h.in + + libntp/lib/isc/include/isc/platform.h.in@1.3 +0 -0 + Rename: lib/isc/include/isc/platform.h.in -> libntp/lib/isc/include/isc/platform.h.in + + libntp/lib/isc/include/isc/portset.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/portset.h -> libntp/lib/isc/include/isc/portset.h + + libntp/lib/isc/include/isc/portset.h@1.3 +0 -0 + Rename: lib/isc/include/isc/portset.h -> libntp/lib/isc/include/isc/portset.h + + libntp/lib/isc/include/isc/print.h@1.6 +0 -0 + Rename: libntp/lib/isc/include/isc/print.h -> libntp/lib/isc/include/isc/print.h + + libntp/lib/isc/include/isc/print.h@1.5 +0 -0 + Rename: lib/isc/include/isc/print.h -> libntp/lib/isc/include/isc/print.h + + libntp/lib/isc/include/isc/queue.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/queue.h -> libntp/lib/isc/include/isc/queue.h + + libntp/lib/isc/include/isc/queue.h@1.2 +0 -0 + Rename: lib/isc/include/isc/queue.h -> libntp/lib/isc/include/isc/queue.h + + libntp/lib/isc/include/isc/quota.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/quota.h -> libntp/lib/isc/include/isc/quota.h + + libntp/lib/isc/include/isc/quota.h@1.2 +0 -0 + Rename: lib/isc/include/isc/quota.h -> libntp/lib/isc/include/isc/quota.h + + libntp/lib/isc/include/isc/radix.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/radix.h -> libntp/lib/isc/include/isc/radix.h + + libntp/lib/isc/include/isc/radix.h@1.3 +0 -0 + Rename: lib/isc/include/isc/radix.h -> libntp/lib/isc/include/isc/radix.h + + libntp/lib/isc/include/isc/random.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/random.h -> libntp/lib/isc/include/isc/random.h + + libntp/lib/isc/include/isc/random.h@1.3 +0 -0 + Rename: lib/isc/include/isc/random.h -> libntp/lib/isc/include/isc/random.h + + libntp/lib/isc/include/isc/ratelimiter.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/ratelimiter.h -> libntp/lib/isc/include/isc/ratelimiter.h + + libntp/lib/isc/include/isc/ratelimiter.h@1.3 +0 -0 + Rename: lib/isc/include/isc/ratelimiter.h -> libntp/lib/isc/include/isc/ratelimiter.h + + libntp/lib/isc/include/isc/refcount.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/refcount.h -> libntp/lib/isc/include/isc/refcount.h + + libntp/lib/isc/include/isc/refcount.h@1.3 +0 -0 + Rename: lib/isc/include/isc/refcount.h -> libntp/lib/isc/include/isc/refcount.h + + libntp/lib/isc/include/isc/region.h@1.5 +0 -0 + Rename: libntp/lib/isc/include/isc/region.h -> libntp/lib/isc/include/isc/region.h + + libntp/lib/isc/include/isc/region.h@1.4 +0 -0 + Rename: lib/isc/include/isc/region.h -> libntp/lib/isc/include/isc/region.h + + libntp/lib/isc/include/isc/resource.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/resource.h -> libntp/lib/isc/include/isc/resource.h + + libntp/lib/isc/include/isc/resource.h@1.2 +0 -0 + Rename: lib/isc/include/isc/resource.h -> libntp/lib/isc/include/isc/resource.h + + libntp/lib/isc/include/isc/result.h@1.8 +0 -0 + Rename: libntp/lib/isc/include/isc/result.h -> libntp/lib/isc/include/isc/result.h + + libntp/lib/isc/include/isc/result.h@1.7 +0 -0 + Rename: lib/isc/include/isc/result.h -> libntp/lib/isc/include/isc/result.h + + libntp/lib/isc/include/isc/resultclass.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/resultclass.h -> libntp/lib/isc/include/isc/resultclass.h + + libntp/lib/isc/include/isc/resultclass.h@1.3 +0 -0 + Rename: lib/isc/include/isc/resultclass.h -> libntp/lib/isc/include/isc/resultclass.h + + libntp/lib/isc/include/isc/rwlock.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/rwlock.h -> libntp/lib/isc/include/isc/rwlock.h + + libntp/lib/isc/include/isc/rwlock.h@1.2 +0 -0 + Rename: lib/isc/include/isc/rwlock.h -> libntp/lib/isc/include/isc/rwlock.h + + libntp/lib/isc/include/isc/serial.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/serial.h -> libntp/lib/isc/include/isc/serial.h + + libntp/lib/isc/include/isc/serial.h@1.3 +0 -0 + Rename: lib/isc/include/isc/serial.h -> libntp/lib/isc/include/isc/serial.h + + libntp/lib/isc/include/isc/sha1.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/sha1.h -> libntp/lib/isc/include/isc/sha1.h + + libntp/lib/isc/include/isc/sha1.h@1.3 +0 -0 + Rename: lib/isc/include/isc/sha1.h -> libntp/lib/isc/include/isc/sha1.h + + libntp/lib/isc/include/isc/sha2.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/sha2.h -> libntp/lib/isc/include/isc/sha2.h + + libntp/lib/isc/include/isc/sha2.h@1.3 +0 -0 + Rename: lib/isc/include/isc/sha2.h -> libntp/lib/isc/include/isc/sha2.h + + libntp/lib/isc/include/isc/sockaddr.h@1.8 +0 -0 + Rename: libntp/lib/isc/include/isc/sockaddr.h -> libntp/lib/isc/include/isc/sockaddr.h + + libntp/lib/isc/include/isc/sockaddr.h@1.7 +0 -0 + Rename: lib/isc/include/isc/sockaddr.h -> libntp/lib/isc/include/isc/sockaddr.h + + libntp/lib/isc/include/isc/socket.h@1.5 +0 -0 + Rename: libntp/lib/isc/include/isc/socket.h -> libntp/lib/isc/include/isc/socket.h + + libntp/lib/isc/include/isc/socket.h@1.4 +0 -0 + Rename: lib/isc/include/isc/socket.h -> libntp/lib/isc/include/isc/socket.h + + libntp/lib/isc/include/isc/stats.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/stats.h -> libntp/lib/isc/include/isc/stats.h + + libntp/lib/isc/include/isc/stats.h@1.3 +0 -0 + Rename: lib/isc/include/isc/stats.h -> libntp/lib/isc/include/isc/stats.h + + libntp/lib/isc/include/isc/stdio.h@1.5 +0 -0 + Rename: libntp/lib/isc/include/isc/stdio.h -> libntp/lib/isc/include/isc/stdio.h + + libntp/lib/isc/include/isc/stdio.h@1.4 +0 -0 + Rename: lib/isc/include/isc/stdio.h -> libntp/lib/isc/include/isc/stdio.h + + libntp/lib/isc/include/isc/stdlib.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/stdlib.h -> libntp/lib/isc/include/isc/stdlib.h + + libntp/lib/isc/include/isc/stdlib.h@1.2 +0 -0 + Rename: lib/isc/include/isc/stdlib.h -> libntp/lib/isc/include/isc/stdlib.h + + libntp/lib/isc/include/isc/string.h@1.7 +0 -0 + Rename: libntp/lib/isc/include/isc/string.h -> libntp/lib/isc/include/isc/string.h + + libntp/lib/isc/include/isc/string.h@1.6 +0 -0 + Rename: lib/isc/include/isc/string.h -> libntp/lib/isc/include/isc/string.h + + libntp/lib/isc/include/isc/symtab.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/symtab.h -> libntp/lib/isc/include/isc/symtab.h + + libntp/lib/isc/include/isc/symtab.h@1.3 +0 -0 + Rename: lib/isc/include/isc/symtab.h -> libntp/lib/isc/include/isc/symtab.h + + libntp/lib/isc/include/isc/task.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/task.h -> libntp/lib/isc/include/isc/task.h + + libntp/lib/isc/include/isc/task.h@1.3 +0 -0 + Rename: lib/isc/include/isc/task.h -> libntp/lib/isc/include/isc/task.h + + libntp/lib/isc/include/isc/taskpool.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/taskpool.h -> libntp/lib/isc/include/isc/taskpool.h + + libntp/lib/isc/include/isc/taskpool.h@1.3 +0 -0 + Rename: lib/isc/include/isc/taskpool.h -> libntp/lib/isc/include/isc/taskpool.h + + libntp/lib/isc/include/isc/timer.h@1.4 +0 -0 + Rename: libntp/lib/isc/include/isc/timer.h -> libntp/lib/isc/include/isc/timer.h + + libntp/lib/isc/include/isc/timer.h@1.3 +0 -0 + Rename: lib/isc/include/isc/timer.h -> libntp/lib/isc/include/isc/timer.h + + libntp/lib/isc/include/isc/types.h@1.7 +0 -0 + Rename: libntp/lib/isc/include/isc/types.h -> libntp/lib/isc/include/isc/types.h + + libntp/lib/isc/include/isc/types.h@1.6 +0 -0 + Rename: lib/isc/include/isc/types.h -> libntp/lib/isc/include/isc/types.h + + libntp/lib/isc/include/isc/util.h@1.9 +0 -0 + Rename: libntp/lib/isc/include/isc/util.h -> libntp/lib/isc/include/isc/util.h + + libntp/lib/isc/include/isc/util.h@1.8 +0 -0 + Rename: lib/isc/include/isc/util.h -> libntp/lib/isc/include/isc/util.h + + libntp/lib/isc/include/isc/version.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/version.h -> libntp/lib/isc/include/isc/version.h + + libntp/lib/isc/include/isc/version.h@1.2 +0 -0 + Rename: lib/isc/include/isc/version.h -> libntp/lib/isc/include/isc/version.h + + libntp/lib/isc/include/isc/xml.h@1.3 +0 -0 + Rename: libntp/lib/isc/include/isc/xml.h -> libntp/lib/isc/include/isc/xml.h + + libntp/lib/isc/include/isc/xml.h@1.2 +0 -0 + Rename: lib/isc/include/isc/xml.h -> libntp/lib/isc/include/isc/xml.h + + libntp/lib/isc/inet_aton.c@1.8 +0 -0 + Rename: libntp/lib/isc/inet_aton.c -> libntp/lib/isc/inet_aton.c + + libntp/lib/isc/inet_aton.c@1.7 +0 -0 + Rename: lib/isc/inet_aton.c -> libntp/lib/isc/inet_aton.c + + libntp/lib/isc/inet_ntop.c@1.16 +0 -0 + Rename: libntp/lib/isc/inet_ntop.c -> libntp/lib/isc/inet_ntop.c + + libntp/lib/isc/inet_ntop.c@1.15 +0 -0 + Rename: lib/isc/inet_ntop.c -> libntp/lib/isc/inet_ntop.c + + libntp/lib/isc/inet_pton.c@1.10 +0 -0 + Rename: libntp/lib/isc/inet_pton.c -> libntp/lib/isc/inet_pton.c + + libntp/lib/isc/inet_pton.c@1.9 +0 -0 + Rename: lib/isc/inet_pton.c -> libntp/lib/isc/inet_pton.c + + libntp/lib/isc/iterated_hash.c@1.4 +0 -0 + Rename: libntp/lib/isc/iterated_hash.c -> libntp/lib/isc/iterated_hash.c + + libntp/lib/isc/iterated_hash.c@1.3 +0 -0 + Rename: lib/isc/iterated_hash.c -> libntp/lib/isc/iterated_hash.c + + libntp/lib/isc/lex.c@1.3 +0 -0 + Rename: libntp/lib/isc/lex.c -> libntp/lib/isc/lex.c + + libntp/lib/isc/lex.c@1.2 +0 -0 + Rename: lib/isc/lex.c -> libntp/lib/isc/lex.c + + libntp/lib/isc/lfsr.c@1.3 +0 -0 + Rename: libntp/lib/isc/lfsr.c -> libntp/lib/isc/lfsr.c + + libntp/lib/isc/lfsr.c@1.2 +0 -0 + Rename: lib/isc/lfsr.c -> libntp/lib/isc/lfsr.c + + libntp/lib/isc/lib.c@1.7 +0 -0 + Rename: libntp/lib/isc/lib.c -> libntp/lib/isc/lib.c + + libntp/lib/isc/lib.c@1.6 +0 -0 + Rename: lib/isc/lib.c -> libntp/lib/isc/lib.c + + libntp/lib/isc/log.c@1.11 +0 -0 + Rename: libntp/lib/isc/log.c -> libntp/lib/isc/log.c + + libntp/lib/isc/log.c@1.10 +0 -0 + Rename: lib/isc/log.c -> libntp/lib/isc/log.c + + libntp/lib/isc/md5.c@1.5 +0 -0 + Rename: libntp/lib/isc/md5.c -> libntp/lib/isc/md5.c + + libntp/lib/isc/md5.c@1.4 +0 -0 + Rename: lib/isc/md5.c -> libntp/lib/isc/md5.c + + libntp/lib/isc/mem.c@1.8 +0 -0 + Rename: libntp/lib/isc/mem.c -> libntp/lib/isc/mem.c + + libntp/lib/isc/mem.c@1.7 +0 -0 + Rename: lib/isc/mem.c -> libntp/lib/isc/mem.c + + libntp/lib/isc/mem_api.c@1.3 +0 -0 + Rename: libntp/lib/isc/mem_api.c -> libntp/lib/isc/mem_api.c + + libntp/lib/isc/mem_api.c@1.2 +0 -0 + Rename: lib/isc/mem_api.c -> libntp/lib/isc/mem_api.c + + libntp/lib/isc/mips/include/isc/atomic.h@1.3 +0 -0 + Rename: libntp/lib/isc/mips/include/isc/atomic.h -> libntp/lib/isc/mips/include/isc/atomic.h + + libntp/lib/isc/mips/include/isc/atomic.h@1.2 +0 -0 + Rename: lib/isc/mips/include/isc/atomic.h -> libntp/lib/isc/mips/include/isc/atomic.h + + libntp/lib/isc/mutexblock.c@1.4 +0 -0 + Rename: libntp/lib/isc/mutexblock.c -> libntp/lib/isc/mutexblock.c + + libntp/lib/isc/mutexblock.c@1.3 +0 -0 + Rename: lib/isc/mutexblock.c -> libntp/lib/isc/mutexblock.c + + libntp/lib/isc/netaddr.c@1.17 +0 -0 + Rename: libntp/lib/isc/netaddr.c -> libntp/lib/isc/netaddr.c + + libntp/lib/isc/netaddr.c@1.16 +0 -0 + Rename: lib/isc/netaddr.c -> libntp/lib/isc/netaddr.c + + libntp/lib/isc/netscope.c@1.5 +0 -0 + Rename: libntp/lib/isc/netscope.c -> libntp/lib/isc/netscope.c + + libntp/lib/isc/netscope.c@1.4 +0 -0 + Rename: lib/isc/netscope.c -> libntp/lib/isc/netscope.c + + libntp/lib/isc/nls/msgcat.c@1.8 +0 -0 + Rename: libntp/lib/isc/nls/msgcat.c -> libntp/lib/isc/nls/msgcat.c + + libntp/lib/isc/nls/msgcat.c@1.7 +0 -0 + Rename: lib/isc/nls/msgcat.c -> libntp/lib/isc/nls/msgcat.c + + libntp/lib/isc/noatomic/include/isc/atomic.h@1.3 +0 -0 + Rename: libntp/lib/isc/noatomic/include/isc/atomic.h -> libntp/lib/isc/noatomic/include/isc/atomic.h + + libntp/lib/isc/noatomic/include/isc/atomic.h@1.2 +0 -0 + Rename: lib/isc/noatomic/include/isc/atomic.h -> libntp/lib/isc/noatomic/include/isc/atomic.h + + libntp/lib/isc/nothreads/condition.c@1.3 +0 -0 + Rename: libntp/lib/isc/nothreads/condition.c -> libntp/lib/isc/nothreads/condition.c + + libntp/lib/isc/nothreads/condition.c@1.2 +0 -0 + Rename: lib/isc/nothreads/condition.c -> libntp/lib/isc/nothreads/condition.c + + libntp/lib/isc/nothreads/include/isc/condition.h@1.3 +0 -0 + Rename: libntp/lib/isc/nothreads/include/isc/condition.h -> libntp/lib/isc/nothreads/include/isc/condition.h + + libntp/lib/isc/nothreads/include/isc/condition.h@1.2 +0 -0 + Rename: lib/isc/nothreads/include/isc/condition.h -> libntp/lib/isc/nothreads/include/isc/condition.h + + libntp/lib/isc/nothreads/include/isc/mutex.h@1.8 +0 -0 + Rename: libntp/lib/isc/nothreads/include/isc/mutex.h -> libntp/lib/isc/nothreads/include/isc/mutex.h + + libntp/lib/isc/nothreads/include/isc/mutex.h@1.7 +0 -0 + Rename: lib/isc/nothreads/include/isc/mutex.h -> libntp/lib/isc/nothreads/include/isc/mutex.h + + libntp/lib/isc/nothreads/include/isc/once.h@1.8 +0 -0 + Rename: libntp/lib/isc/nothreads/include/isc/once.h -> libntp/lib/isc/nothreads/include/isc/once.h + + libntp/lib/isc/nothreads/include/isc/once.h@1.7 +0 -0 + Rename: lib/isc/nothreads/include/isc/once.h -> libntp/lib/isc/nothreads/include/isc/once.h + + libntp/lib/isc/nothreads/include/isc/thread.h@1.3 +0 -0 + Rename: libntp/lib/isc/nothreads/include/isc/thread.h -> libntp/lib/isc/nothreads/include/isc/thread.h + + libntp/lib/isc/nothreads/include/isc/thread.h@1.2 +0 -0 + Rename: lib/isc/nothreads/include/isc/thread.h -> libntp/lib/isc/nothreads/include/isc/thread.h + + libntp/lib/isc/nothreads/mutex.c@1.3 +0 -0 + Rename: libntp/lib/isc/nothreads/mutex.c -> libntp/lib/isc/nothreads/mutex.c + + libntp/lib/isc/nothreads/mutex.c@1.2 +0 -0 + Rename: lib/isc/nothreads/mutex.c -> libntp/lib/isc/nothreads/mutex.c + + libntp/lib/isc/nothreads/thread.c@1.3 +0 -0 + Rename: libntp/lib/isc/nothreads/thread.c -> libntp/lib/isc/nothreads/thread.c + + libntp/lib/isc/nothreads/thread.c@1.2 +0 -0 + Rename: lib/isc/nothreads/thread.c -> libntp/lib/isc/nothreads/thread.c + + libntp/lib/isc/ondestroy.c@1.3 +0 -0 + Rename: libntp/lib/isc/ondestroy.c -> libntp/lib/isc/ondestroy.c + + libntp/lib/isc/ondestroy.c@1.2 +0 -0 + Rename: lib/isc/ondestroy.c -> libntp/lib/isc/ondestroy.c + + libntp/lib/isc/parseint.c@1.3 +0 -0 + Rename: libntp/lib/isc/parseint.c -> libntp/lib/isc/parseint.c + + libntp/lib/isc/parseint.c@1.2 +0 -0 + Rename: lib/isc/parseint.c -> libntp/lib/isc/parseint.c + + libntp/lib/isc/portset.c@1.3 +0 -0 + Rename: libntp/lib/isc/portset.c -> libntp/lib/isc/portset.c + + libntp/lib/isc/portset.c@1.2 +0 -0 + Rename: lib/isc/portset.c -> libntp/lib/isc/portset.c + + libntp/lib/isc/powerpc/include/isc/atomic.h@1.4 +0 -0 + Rename: libntp/lib/isc/powerpc/include/isc/atomic.h -> libntp/lib/isc/powerpc/include/isc/atomic.h + + libntp/lib/isc/powerpc/include/isc/atomic.h@1.3 +0 -0 + Rename: lib/isc/powerpc/include/isc/atomic.h -> libntp/lib/isc/powerpc/include/isc/atomic.h + + libntp/lib/isc/print.c@1.4 +0 -0 + Rename: libntp/lib/isc/print.c -> libntp/lib/isc/print.c + + libntp/lib/isc/print.c@1.3 +0 -0 + Rename: lib/isc/print.c -> libntp/lib/isc/print.c + + libntp/lib/isc/pthreads/condition.c@1.3 +0 -0 + Rename: libntp/lib/isc/pthreads/condition.c -> libntp/lib/isc/pthreads/condition.c + + libntp/lib/isc/pthreads/condition.c@1.2 +0 -0 + Rename: lib/isc/pthreads/condition.c -> libntp/lib/isc/pthreads/condition.c + + libntp/lib/isc/pthreads/include/isc/condition.h@1.3 +0 -0 + Rename: libntp/lib/isc/pthreads/include/isc/condition.h -> libntp/lib/isc/pthreads/include/isc/condition.h + + libntp/lib/isc/pthreads/include/isc/condition.h@1.2 +0 -0 + Rename: lib/isc/pthreads/include/isc/condition.h -> libntp/lib/isc/pthreads/include/isc/condition.h + + libntp/lib/isc/pthreads/include/isc/mutex.h@1.3 +0 -0 + Rename: libntp/lib/isc/pthreads/include/isc/mutex.h -> libntp/lib/isc/pthreads/include/isc/mutex.h + + libntp/lib/isc/pthreads/include/isc/mutex.h@1.2 +0 -0 + Rename: lib/isc/pthreads/include/isc/mutex.h -> libntp/lib/isc/pthreads/include/isc/mutex.h + + libntp/lib/isc/pthreads/include/isc/once.h@1.3 +0 -0 + Rename: libntp/lib/isc/pthreads/include/isc/once.h -> libntp/lib/isc/pthreads/include/isc/once.h + + libntp/lib/isc/pthreads/include/isc/once.h@1.2 +0 -0 + Rename: lib/isc/pthreads/include/isc/once.h -> libntp/lib/isc/pthreads/include/isc/once.h + + libntp/lib/isc/pthreads/include/isc/thread.h@1.3 +0 -0 + Rename: libntp/lib/isc/pthreads/include/isc/thread.h -> libntp/lib/isc/pthreads/include/isc/thread.h + + libntp/lib/isc/pthreads/include/isc/thread.h@1.2 +0 -0 + Rename: lib/isc/pthreads/include/isc/thread.h -> libntp/lib/isc/pthreads/include/isc/thread.h + + libntp/lib/isc/pthreads/mutex.c@1.5 +0 -0 + Rename: libntp/lib/isc/pthreads/mutex.c -> libntp/lib/isc/pthreads/mutex.c + + libntp/lib/isc/pthreads/mutex.c@1.4 +0 -0 + Rename: lib/isc/pthreads/mutex.c -> libntp/lib/isc/pthreads/mutex.c + + libntp/lib/isc/pthreads/thread.c@1.3 +0 -0 + Rename: libntp/lib/isc/pthreads/thread.c -> libntp/lib/isc/pthreads/thread.c + + libntp/lib/isc/pthreads/thread.c@1.2 +0 -0 + Rename: lib/isc/pthreads/thread.c -> libntp/lib/isc/pthreads/thread.c + + libntp/lib/isc/quota.c@1.3 +0 -0 + Rename: libntp/lib/isc/quota.c -> libntp/lib/isc/quota.c + + libntp/lib/isc/quota.c@1.2 +0 -0 + Rename: lib/isc/quota.c -> libntp/lib/isc/quota.c + + libntp/lib/isc/radix.c@1.4 +0 -0 + Rename: libntp/lib/isc/radix.c -> libntp/lib/isc/radix.c + + libntp/lib/isc/radix.c@1.3 +0 -0 + Rename: lib/isc/radix.c -> libntp/lib/isc/radix.c + + libntp/lib/isc/random.c@1.4 +0 -0 + Rename: libntp/lib/isc/random.c -> libntp/lib/isc/random.c + + libntp/lib/isc/random.c@1.3 +0 -0 + Rename: lib/isc/random.c -> libntp/lib/isc/random.c + + libntp/lib/isc/ratelimiter.c@1.3 +0 -0 + Rename: libntp/lib/isc/ratelimiter.c -> libntp/lib/isc/ratelimiter.c + + libntp/lib/isc/ratelimiter.c@1.2 +0 -0 + Rename: lib/isc/ratelimiter.c -> libntp/lib/isc/ratelimiter.c + + libntp/lib/isc/refcount.c@1.3 +0 -0 + Rename: libntp/lib/isc/refcount.c -> libntp/lib/isc/refcount.c + + libntp/lib/isc/refcount.c@1.2 +0 -0 + Rename: lib/isc/refcount.c -> libntp/lib/isc/refcount.c + + libntp/lib/isc/region.c@1.3 +0 -0 + Rename: libntp/lib/isc/region.c -> libntp/lib/isc/region.c + + libntp/lib/isc/region.c@1.2 +0 -0 + Rename: lib/isc/region.c -> libntp/lib/isc/region.c + + libntp/lib/isc/result.c@1.6 +0 -0 + Rename: libntp/lib/isc/result.c -> libntp/lib/isc/result.c + + libntp/lib/isc/result.c@1.5 +0 -0 + Rename: lib/isc/result.c -> libntp/lib/isc/result.c + + libntp/lib/isc/rwlock.c@1.4 +0 -0 + Rename: libntp/lib/isc/rwlock.c -> libntp/lib/isc/rwlock.c + + libntp/lib/isc/rwlock.c@1.3 +0 -0 + Rename: lib/isc/rwlock.c -> libntp/lib/isc/rwlock.c + + libntp/lib/isc/serial.c@1.3 +0 -0 + Rename: libntp/lib/isc/serial.c -> libntp/lib/isc/serial.c + + libntp/lib/isc/serial.c@1.2 +0 -0 + Rename: lib/isc/serial.c -> libntp/lib/isc/serial.c + + libntp/lib/isc/sha1.c@1.4 +0 -0 + Rename: libntp/lib/isc/sha1.c -> libntp/lib/isc/sha1.c + + libntp/lib/isc/sha1.c@1.3 +0 -0 + Rename: lib/isc/sha1.c -> libntp/lib/isc/sha1.c + + libntp/lib/isc/sha2.c@1.4 +0 -0 + Rename: libntp/lib/isc/sha2.c -> libntp/lib/isc/sha2.c + + libntp/lib/isc/sha2.c@1.3 +0 -0 + Rename: lib/isc/sha2.c -> libntp/lib/isc/sha2.c + + libntp/lib/isc/sockaddr.c@1.16 +0 -0 + Rename: libntp/lib/isc/sockaddr.c -> libntp/lib/isc/sockaddr.c + + libntp/lib/isc/sockaddr.c@1.15 +0 -0 + Rename: lib/isc/sockaddr.c -> libntp/lib/isc/sockaddr.c + + libntp/lib/isc/socket_api.c@1.3 +0 -0 + Rename: libntp/lib/isc/socket_api.c -> libntp/lib/isc/socket_api.c + + libntp/lib/isc/socket_api.c@1.2 +0 -0 + Rename: lib/isc/socket_api.c -> libntp/lib/isc/socket_api.c + + libntp/lib/isc/sparc64/include/isc/atomic.h@1.3 +0 -0 + Rename: libntp/lib/isc/sparc64/include/isc/atomic.h -> libntp/lib/isc/sparc64/include/isc/atomic.h + + libntp/lib/isc/sparc64/include/isc/atomic.h@1.2 +0 -0 + Rename: lib/isc/sparc64/include/isc/atomic.h -> libntp/lib/isc/sparc64/include/isc/atomic.h + + libntp/lib/isc/stats.c@1.4 +0 -0 + Rename: libntp/lib/isc/stats.c -> libntp/lib/isc/stats.c + + libntp/lib/isc/stats.c@1.3 +0 -0 + Rename: lib/isc/stats.c -> libntp/lib/isc/stats.c + + libntp/lib/isc/string.c@1.4 +0 -0 + Rename: libntp/lib/isc/string.c -> libntp/lib/isc/string.c + + libntp/lib/isc/string.c@1.3 +0 -0 + Rename: lib/isc/string.c -> libntp/lib/isc/string.c + + libntp/lib/isc/strtoul.c@1.3 +0 -0 + Rename: libntp/lib/isc/strtoul.c -> libntp/lib/isc/strtoul.c + + libntp/lib/isc/strtoul.c@1.2 +0 -0 + Rename: lib/isc/strtoul.c -> libntp/lib/isc/strtoul.c + + libntp/lib/isc/symtab.c@1.4 +0 -0 + Rename: libntp/lib/isc/symtab.c -> libntp/lib/isc/symtab.c + + libntp/lib/isc/symtab.c@1.3 +0 -0 + Rename: lib/isc/symtab.c -> libntp/lib/isc/symtab.c + + libntp/lib/isc/task.c@1.10 +0 -0 + Rename: libntp/lib/isc/task.c -> libntp/lib/isc/task.c + + libntp/lib/isc/task.c@1.9 +0 -0 + Rename: lib/isc/task.c -> libntp/lib/isc/task.c + + libntp/lib/isc/task_api.c@1.3 +0 -0 + Rename: libntp/lib/isc/task_api.c -> libntp/lib/isc/task_api.c + + libntp/lib/isc/task_api.c@1.2 +0 -0 + Rename: lib/isc/task_api.c -> libntp/lib/isc/task_api.c + + libntp/lib/isc/task_p.h@1.4 +0 -0 + Rename: libntp/lib/isc/task_p.h -> libntp/lib/isc/task_p.h + + libntp/lib/isc/task_p.h@1.3 +0 -0 + Rename: lib/isc/task_p.h -> libntp/lib/isc/task_p.h + + libntp/lib/isc/taskpool.c@1.4 +0 -0 + Rename: libntp/lib/isc/taskpool.c -> libntp/lib/isc/taskpool.c + + libntp/lib/isc/taskpool.c@1.3 +0 -0 + Rename: lib/isc/taskpool.c -> libntp/lib/isc/taskpool.c + + libntp/lib/isc/tests/Atffile@1.3 +0 -0 + Rename: libntp/lib/isc/tests/Atffile -> libntp/lib/isc/tests/Atffile + + libntp/lib/isc/tests/Atffile@1.2 +0 -0 + Rename: lib/isc/tests/Atffile -> libntp/lib/isc/tests/Atffile + + libntp/lib/isc/tests/hash_test.c@1.3 +0 -0 + Rename: libntp/lib/isc/tests/hash_test.c -> libntp/lib/isc/tests/hash_test.c + + libntp/lib/isc/tests/hash_test.c@1.2 +0 -0 + Rename: lib/isc/tests/hash_test.c -> libntp/lib/isc/tests/hash_test.c + + libntp/lib/isc/tests/isctest.c@1.3 +0 -0 + Rename: libntp/lib/isc/tests/isctest.c -> libntp/lib/isc/tests/isctest.c + + libntp/lib/isc/tests/isctest.c@1.2 +0 -0 + Rename: lib/isc/tests/isctest.c -> libntp/lib/isc/tests/isctest.c + + libntp/lib/isc/tests/isctest.h@1.3 +0 -0 + Rename: libntp/lib/isc/tests/isctest.h -> libntp/lib/isc/tests/isctest.h + + libntp/lib/isc/tests/isctest.h@1.2 +0 -0 + Rename: lib/isc/tests/isctest.h -> libntp/lib/isc/tests/isctest.h + + libntp/lib/isc/tests/queue_test.c@1.3 +0 -0 + Rename: libntp/lib/isc/tests/queue_test.c -> libntp/lib/isc/tests/queue_test.c + + libntp/lib/isc/tests/queue_test.c@1.2 +0 -0 + Rename: lib/isc/tests/queue_test.c -> libntp/lib/isc/tests/queue_test.c + + libntp/lib/isc/tests/socket_test.c@1.3 +0 -0 + Rename: libntp/lib/isc/tests/socket_test.c -> libntp/lib/isc/tests/socket_test.c + + libntp/lib/isc/tests/socket_test.c@1.2 +0 -0 + Rename: lib/isc/tests/socket_test.c -> libntp/lib/isc/tests/socket_test.c + + libntp/lib/isc/tests/symtab_test.c@1.3 +0 -0 + Rename: libntp/lib/isc/tests/symtab_test.c -> libntp/lib/isc/tests/symtab_test.c + + libntp/lib/isc/tests/symtab_test.c@1.2 +0 -0 + Rename: lib/isc/tests/symtab_test.c -> libntp/lib/isc/tests/symtab_test.c + + libntp/lib/isc/tests/task_test.c@1.3 +0 -0 + Rename: libntp/lib/isc/tests/task_test.c -> libntp/lib/isc/tests/task_test.c + + libntp/lib/isc/tests/task_test.c@1.2 +0 -0 + Rename: lib/isc/tests/task_test.c -> libntp/lib/isc/tests/task_test.c + + libntp/lib/isc/tests/taskpool_test.c@1.3 +0 -0 + Rename: libntp/lib/isc/tests/taskpool_test.c -> libntp/lib/isc/tests/taskpool_test.c + + libntp/lib/isc/tests/taskpool_test.c@1.2 +0 -0 + Rename: lib/isc/tests/taskpool_test.c -> libntp/lib/isc/tests/taskpool_test.c + + libntp/lib/isc/timer.c@1.4 +0 -0 + Rename: libntp/lib/isc/timer.c -> libntp/lib/isc/timer.c + + libntp/lib/isc/timer.c@1.3 +0 -0 + Rename: lib/isc/timer.c -> libntp/lib/isc/timer.c + + libntp/lib/isc/timer_api.c@1.3 +0 -0 + Rename: libntp/lib/isc/timer_api.c -> libntp/lib/isc/timer_api.c + + libntp/lib/isc/timer_api.c@1.2 +0 -0 + Rename: lib/isc/timer_api.c -> libntp/lib/isc/timer_api.c + + libntp/lib/isc/timer_p.h@1.4 +0 -0 + Rename: libntp/lib/isc/timer_p.h -> libntp/lib/isc/timer_p.h + + libntp/lib/isc/timer_p.h@1.3 +0 -0 + Rename: lib/isc/timer_p.h -> libntp/lib/isc/timer_p.h + + libntp/lib/isc/tsmemcmp.c@1.3 +0 -0 + Rename: libntp/lib/isc/tsmemcmp.c -> libntp/lib/isc/tsmemcmp.c + + libntp/lib/isc/tsmemcmp.c@1.2 +0 -0 + Rename: lib/isc/tsmemcmp.c -> libntp/lib/isc/tsmemcmp.c + + libntp/lib/isc/unix/app.c@1.4 +0 -0 + Rename: libntp/lib/isc/unix/app.c -> libntp/lib/isc/unix/app.c + + libntp/lib/isc/unix/app.c@1.3 +0 -0 + Rename: lib/isc/unix/app.c -> libntp/lib/isc/unix/app.c + + libntp/lib/isc/unix/dir.c@1.6 +0 -0 + Rename: libntp/lib/isc/unix/dir.c -> libntp/lib/isc/unix/dir.c + + libntp/lib/isc/unix/dir.c@1.5 +0 -0 + Rename: lib/isc/unix/dir.c -> libntp/lib/isc/unix/dir.c + + libntp/lib/isc/unix/entropy.c@1.4 +0 -0 + Rename: libntp/lib/isc/unix/entropy.c -> libntp/lib/isc/unix/entropy.c + + libntp/lib/isc/unix/entropy.c@1.3 +0 -0 + Rename: lib/isc/unix/entropy.c -> libntp/lib/isc/unix/entropy.c + + libntp/lib/isc/unix/errno2result.c@1.4 +0 -0 + Rename: libntp/lib/isc/unix/errno2result.c -> libntp/lib/isc/unix/errno2result.c + + libntp/lib/isc/unix/errno2result.c@1.3 +0 -0 + Rename: lib/isc/unix/errno2result.c -> libntp/lib/isc/unix/errno2result.c + + libntp/lib/isc/unix/errno2result.h@1.4 +0 -0 + Rename: libntp/lib/isc/unix/errno2result.h -> libntp/lib/isc/unix/errno2result.h + + libntp/lib/isc/unix/errno2result.h@1.3 +0 -0 + Rename: lib/isc/unix/errno2result.h -> libntp/lib/isc/unix/errno2result.h + + libntp/lib/isc/unix/file.c@1.9 +0 -0 + Rename: libntp/lib/isc/unix/file.c -> libntp/lib/isc/unix/file.c + + libntp/lib/isc/unix/file.c@1.8 +0 -0 + Rename: lib/isc/unix/file.c -> libntp/lib/isc/unix/file.c + + libntp/lib/isc/unix/fsaccess.c@1.3 +0 -0 + Rename: libntp/lib/isc/unix/fsaccess.c -> libntp/lib/isc/unix/fsaccess.c + + libntp/lib/isc/unix/fsaccess.c@1.2 +0 -0 + Rename: lib/isc/unix/fsaccess.c -> libntp/lib/isc/unix/fsaccess.c + + libntp/lib/isc/unix/ifiter_getifaddrs.c@1.18 +0 -0 + Rename: libntp/lib/isc/unix/ifiter_getifaddrs.c -> libntp/lib/isc/unix/ifiter_getifaddrs.c + + libntp/lib/isc/unix/ifiter_getifaddrs.c@1.17 +0 -0 + Rename: lib/isc/unix/ifiter_getifaddrs.c -> libntp/lib/isc/unix/ifiter_getifaddrs.c + + libntp/lib/isc/unix/ifiter_ioctl.c@1.36 +0 -0 + Rename: libntp/lib/isc/unix/ifiter_ioctl.c -> libntp/lib/isc/unix/ifiter_ioctl.c + + libntp/lib/isc/unix/ifiter_ioctl.c@1.35 +0 -0 + Rename: lib/isc/unix/ifiter_ioctl.c -> libntp/lib/isc/unix/ifiter_ioctl.c + + libntp/lib/isc/unix/ifiter_sysctl.c@1.20 +0 -0 + Rename: libntp/lib/isc/unix/ifiter_sysctl.c -> libntp/lib/isc/unix/ifiter_sysctl.c + + libntp/lib/isc/unix/ifiter_sysctl.c@1.19 +0 -0 + Rename: lib/isc/unix/ifiter_sysctl.c -> libntp/lib/isc/unix/ifiter_sysctl.c + + libntp/lib/isc/unix/include/isc/dir.h@1.5 +0 -0 + Rename: libntp/lib/isc/unix/include/isc/dir.h -> libntp/lib/isc/unix/include/isc/dir.h + + libntp/lib/isc/unix/include/isc/dir.h@1.4 +0 -0 + Rename: lib/isc/unix/include/isc/dir.h -> libntp/lib/isc/unix/include/isc/dir.h + + libntp/lib/isc/unix/include/isc/int.h@1.6 +0 -0 + Rename: libntp/lib/isc/unix/include/isc/int.h -> libntp/lib/isc/unix/include/isc/int.h + + libntp/lib/isc/unix/include/isc/int.h@1.5 +0 -0 + Rename: lib/isc/unix/include/isc/int.h -> libntp/lib/isc/unix/include/isc/int.h + + libntp/lib/isc/unix/include/isc/keyboard.h@1.3 +0 -0 + Rename: libntp/lib/isc/unix/include/isc/keyboard.h -> libntp/lib/isc/unix/include/isc/keyboard.h + + libntp/lib/isc/unix/include/isc/keyboard.h@1.2 +0 -0 + Rename: lib/isc/unix/include/isc/keyboard.h -> libntp/lib/isc/unix/include/isc/keyboard.h + + libntp/lib/isc/unix/include/isc/net.h@1.14 +0 -0 + Rename: libntp/lib/isc/unix/include/isc/net.h -> libntp/lib/isc/unix/include/isc/net.h + + libntp/lib/isc/unix/include/isc/net.h@1.13 +0 -0 + Rename: lib/isc/unix/include/isc/net.h -> libntp/lib/isc/unix/include/isc/net.h + + libntp/lib/isc/unix/include/isc/netdb.h@1.3 +0 -0 + Rename: libntp/lib/isc/unix/include/isc/netdb.h -> libntp/lib/isc/unix/include/isc/netdb.h + + libntp/lib/isc/unix/include/isc/netdb.h@1.2 +0 -0 + Rename: lib/isc/unix/include/isc/netdb.h -> libntp/lib/isc/unix/include/isc/netdb.h + + libntp/lib/isc/unix/include/isc/offset.h@1.7 +0 -0 + Rename: libntp/lib/isc/unix/include/isc/offset.h -> libntp/lib/isc/unix/include/isc/offset.h + + libntp/lib/isc/unix/include/isc/offset.h@1.6 +0 -0 + Rename: lib/isc/unix/include/isc/offset.h -> libntp/lib/isc/unix/include/isc/offset.h + + libntp/lib/isc/unix/include/isc/stat.h@1.5 +0 -0 + Rename: libntp/lib/isc/unix/include/isc/stat.h -> libntp/lib/isc/unix/include/isc/stat.h + + libntp/lib/isc/unix/include/isc/stat.h@1.4 +0 -0 + Rename: lib/isc/unix/include/isc/stat.h -> libntp/lib/isc/unix/include/isc/stat.h + + libntp/lib/isc/unix/include/isc/stdtime.h@1.4 +0 -0 + Rename: libntp/lib/isc/unix/include/isc/stdtime.h -> libntp/lib/isc/unix/include/isc/stdtime.h + + libntp/lib/isc/unix/include/isc/stdtime.h@1.3 +0 -0 + Rename: lib/isc/unix/include/isc/stdtime.h -> libntp/lib/isc/unix/include/isc/stdtime.h + + libntp/lib/isc/unix/include/isc/strerror.h@1.7 +0 -0 + Rename: libntp/lib/isc/unix/include/isc/strerror.h -> libntp/lib/isc/unix/include/isc/strerror.h + + libntp/lib/isc/unix/include/isc/strerror.h@1.6 +0 -0 + Rename: lib/isc/unix/include/isc/strerror.h -> libntp/lib/isc/unix/include/isc/strerror.h + + libntp/lib/isc/unix/include/isc/syslog.h@1.3 +0 -0 + Rename: libntp/lib/isc/unix/include/isc/syslog.h -> libntp/lib/isc/unix/include/isc/syslog.h + + libntp/lib/isc/unix/include/isc/syslog.h@1.2 +0 -0 + Rename: lib/isc/unix/include/isc/syslog.h -> libntp/lib/isc/unix/include/isc/syslog.h + + libntp/lib/isc/unix/include/isc/time.h@1.6 +0 -0 + Rename: libntp/lib/isc/unix/include/isc/time.h -> libntp/lib/isc/unix/include/isc/time.h + + libntp/lib/isc/unix/include/isc/time.h@1.5 +0 -0 + Rename: lib/isc/unix/include/isc/time.h -> libntp/lib/isc/unix/include/isc/time.h + + libntp/lib/isc/unix/interfaceiter.c@1.27 +0 -0 + Rename: libntp/lib/isc/unix/interfaceiter.c -> libntp/lib/isc/unix/interfaceiter.c + + libntp/lib/isc/unix/interfaceiter.c@1.26 +0 -0 + Rename: lib/isc/unix/interfaceiter.c -> libntp/lib/isc/unix/interfaceiter.c + + libntp/lib/isc/unix/ipv6.c@1.3 +0 -0 + Rename: libntp/lib/isc/unix/ipv6.c -> libntp/lib/isc/unix/ipv6.c + + libntp/lib/isc/unix/ipv6.c@1.2 +0 -0 + Rename: lib/isc/unix/ipv6.c -> libntp/lib/isc/unix/ipv6.c + + libntp/lib/isc/unix/keyboard.c@1.3 +0 -0 + Rename: libntp/lib/isc/unix/keyboard.c -> libntp/lib/isc/unix/keyboard.c + + libntp/lib/isc/unix/keyboard.c@1.2 +0 -0 + Rename: lib/isc/unix/keyboard.c -> libntp/lib/isc/unix/keyboard.c + + libntp/lib/isc/unix/net.c@1.21 +0 -0 + Rename: libntp/lib/isc/unix/net.c -> libntp/lib/isc/unix/net.c + + libntp/lib/isc/unix/net.c@1.20 +0 -0 + Rename: lib/isc/unix/net.c -> libntp/lib/isc/unix/net.c + + libntp/lib/isc/unix/os.c@1.3 +0 -0 + Rename: libntp/lib/isc/unix/os.c -> libntp/lib/isc/unix/os.c + + libntp/lib/isc/unix/os.c@1.2 +0 -0 + Rename: lib/isc/unix/os.c -> libntp/lib/isc/unix/os.c + + libntp/lib/isc/unix/resource.c@1.4 +0 -0 + Rename: libntp/lib/isc/unix/resource.c -> libntp/lib/isc/unix/resource.c + + libntp/lib/isc/unix/resource.c@1.3 +0 -0 + Rename: lib/isc/unix/resource.c -> libntp/lib/isc/unix/resource.c + + libntp/lib/isc/unix/socket.c@1.4 +0 -0 + Rename: libntp/lib/isc/unix/socket.c -> libntp/lib/isc/unix/socket.c + + libntp/lib/isc/unix/socket.c@1.3 +0 -0 + Rename: lib/isc/unix/socket.c -> libntp/lib/isc/unix/socket.c + + libntp/lib/isc/unix/socket_p.h@1.4 +0 -0 + Rename: libntp/lib/isc/unix/socket_p.h -> libntp/lib/isc/unix/socket_p.h + + libntp/lib/isc/unix/socket_p.h@1.3 +0 -0 + Rename: lib/isc/unix/socket_p.h -> libntp/lib/isc/unix/socket_p.h + + libntp/lib/isc/unix/stdio.c@1.4 +0 -0 + Rename: libntp/lib/isc/unix/stdio.c -> libntp/lib/isc/unix/stdio.c + + libntp/lib/isc/unix/stdio.c@1.3 +0 -0 + Rename: lib/isc/unix/stdio.c -> libntp/lib/isc/unix/stdio.c + + libntp/lib/isc/unix/stdtime.c@1.3 +0 -0 + Rename: libntp/lib/isc/unix/stdtime.c -> libntp/lib/isc/unix/stdtime.c + + libntp/lib/isc/unix/stdtime.c@1.2 +0 -0 + Rename: lib/isc/unix/stdtime.c -> libntp/lib/isc/unix/stdtime.c + + libntp/lib/isc/unix/strerror.c@1.9 +0 -0 + Rename: libntp/lib/isc/unix/strerror.c -> libntp/lib/isc/unix/strerror.c + + libntp/lib/isc/unix/strerror.c@1.8 +0 -0 + Rename: lib/isc/unix/strerror.c -> libntp/lib/isc/unix/strerror.c + + libntp/lib/isc/unix/syslog.c@1.3 +0 -0 + Rename: libntp/lib/isc/unix/syslog.c -> libntp/lib/isc/unix/syslog.c + + libntp/lib/isc/unix/syslog.c@1.2 +0 -0 + Rename: lib/isc/unix/syslog.c -> libntp/lib/isc/unix/syslog.c + + libntp/lib/isc/unix/time.c@1.4 +0 -0 + Rename: libntp/lib/isc/unix/time.c -> libntp/lib/isc/unix/time.c + + libntp/lib/isc/unix/time.c@1.3 +0 -0 + Rename: lib/isc/unix/time.c -> libntp/lib/isc/unix/time.c + + libntp/lib/isc/version.c@1.3 +0 -0 + Rename: libntp/lib/isc/version.c -> libntp/lib/isc/version.c + + libntp/lib/isc/version.c@1.2 +0 -0 + Rename: lib/isc/version.c -> libntp/lib/isc/version.c + + libntp/lib/isc/win32/DLLMain.c@1.3 +0 -0 + Rename: libntp/lib/isc/win32/DLLMain.c -> libntp/lib/isc/win32/DLLMain.c + + libntp/lib/isc/win32/DLLMain.c@1.2 +0 -0 + Rename: lib/isc/win32/DLLMain.c -> libntp/lib/isc/win32/DLLMain.c + + libntp/lib/isc/win32/app.c@1.4 +0 -0 + Rename: libntp/lib/isc/win32/app.c -> libntp/lib/isc/win32/app.c + + libntp/lib/isc/win32/app.c@1.3 +0 -0 + Rename: lib/isc/win32/app.c -> libntp/lib/isc/win32/app.c + + libntp/lib/isc/win32/condition.c@1.3 +0 -0 + Rename: libntp/lib/isc/win32/condition.c -> libntp/lib/isc/win32/condition.c + + libntp/lib/isc/win32/condition.c@1.2 +0 -0 + Rename: lib/isc/win32/condition.c -> libntp/lib/isc/win32/condition.c + + libntp/lib/isc/win32/dir.c@1.4 +0 -0 + Rename: libntp/lib/isc/win32/dir.c -> libntp/lib/isc/win32/dir.c + + libntp/lib/isc/win32/dir.c@1.3 +0 -0 + Rename: lib/isc/win32/dir.c -> libntp/lib/isc/win32/dir.c + + libntp/lib/isc/win32/entropy.c@1.4 +0 -0 + Rename: libntp/lib/isc/win32/entropy.c -> libntp/lib/isc/win32/entropy.c + + libntp/lib/isc/win32/entropy.c@1.3 +0 -0 + Rename: lib/isc/win32/entropy.c -> libntp/lib/isc/win32/entropy.c + + libntp/lib/isc/win32/errno2result.c@1.3 +0 -0 + Rename: libntp/lib/isc/win32/errno2result.c -> libntp/lib/isc/win32/errno2result.c + + libntp/lib/isc/win32/errno2result.c@1.2 +0 -0 + Rename: lib/isc/win32/errno2result.c -> libntp/lib/isc/win32/errno2result.c + + libntp/lib/isc/win32/errno2result.h@1.3 +0 -0 + Rename: libntp/lib/isc/win32/errno2result.h -> libntp/lib/isc/win32/errno2result.h + + libntp/lib/isc/win32/errno2result.h@1.2 +0 -0 + Rename: lib/isc/win32/errno2result.h -> libntp/lib/isc/win32/errno2result.h + + libntp/lib/isc/win32/file.c@1.4 +0 -0 + Rename: libntp/lib/isc/win32/file.c -> libntp/lib/isc/win32/file.c + + libntp/lib/isc/win32/file.c@1.3 +0 -0 + Rename: lib/isc/win32/file.c -> libntp/lib/isc/win32/file.c + + libntp/lib/isc/win32/fsaccess.c@1.3 +0 -0 + Rename: libntp/lib/isc/win32/fsaccess.c -> libntp/lib/isc/win32/fsaccess.c + + libntp/lib/isc/win32/fsaccess.c@1.2 +0 -0 + Rename: lib/isc/win32/fsaccess.c -> libntp/lib/isc/win32/fsaccess.c + + libntp/lib/isc/win32/include/isc/bind_registry.h@1.3 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/bind_registry.h -> libntp/lib/isc/win32/include/isc/bind_registry.h + + libntp/lib/isc/win32/include/isc/bind_registry.h@1.2 +0 -0 + Rename: lib/isc/win32/include/isc/bind_registry.h -> libntp/lib/isc/win32/include/isc/bind_registry.h + + libntp/lib/isc/win32/include/isc/bindevt.h@1.3 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/bindevt.h -> libntp/lib/isc/win32/include/isc/bindevt.h + + libntp/lib/isc/win32/include/isc/bindevt.h@1.2 +0 -0 + Rename: lib/isc/win32/include/isc/bindevt.h -> libntp/lib/isc/win32/include/isc/bindevt.h + + libntp/lib/isc/win32/include/isc/condition.h@1.3 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/condition.h -> libntp/lib/isc/win32/include/isc/condition.h + + libntp/lib/isc/win32/include/isc/condition.h@1.2 +0 -0 + Rename: lib/isc/win32/include/isc/condition.h -> libntp/lib/isc/win32/include/isc/condition.h + + libntp/lib/isc/win32/include/isc/dir.h@1.3 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/dir.h -> libntp/lib/isc/win32/include/isc/dir.h + + libntp/lib/isc/win32/include/isc/dir.h@1.2 +0 -0 + Rename: lib/isc/win32/include/isc/dir.h -> libntp/lib/isc/win32/include/isc/dir.h + + libntp/lib/isc/win32/include/isc/int.h@1.7 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/int.h -> libntp/lib/isc/win32/include/isc/int.h + + libntp/lib/isc/win32/include/isc/int.h@1.6 +0 -0 + Rename: lib/isc/win32/include/isc/int.h -> libntp/lib/isc/win32/include/isc/int.h + + libntp/lib/isc/win32/include/isc/ipv6.h@1.13 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/ipv6.h -> libntp/lib/isc/win32/include/isc/ipv6.h + + libntp/lib/isc/win32/include/isc/ipv6.h@1.12 +0 -0 + Rename: lib/isc/win32/include/isc/ipv6.h -> libntp/lib/isc/win32/include/isc/ipv6.h + + libntp/lib/isc/win32/include/isc/keyboard.h@1.3 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/keyboard.h -> libntp/lib/isc/win32/include/isc/keyboard.h + + libntp/lib/isc/win32/include/isc/keyboard.h@1.2 +0 -0 + Rename: lib/isc/win32/include/isc/keyboard.h -> libntp/lib/isc/win32/include/isc/keyboard.h + + libntp/lib/isc/win32/include/isc/mutex.h@1.7 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/mutex.h -> libntp/lib/isc/win32/include/isc/mutex.h + + libntp/lib/isc/win32/include/isc/mutex.h@1.6 +0 -0 + Rename: lib/isc/win32/include/isc/mutex.h -> libntp/lib/isc/win32/include/isc/mutex.h + + libntp/lib/isc/win32/include/isc/net.h@1.13 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/net.h -> libntp/lib/isc/win32/include/isc/net.h + + libntp/lib/isc/win32/include/isc/net.h@1.12 +0 -0 + Rename: lib/isc/win32/include/isc/net.h -> libntp/lib/isc/win32/include/isc/net.h + + libntp/lib/isc/win32/include/isc/netdb.h@1.3 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/netdb.h -> libntp/lib/isc/win32/include/isc/netdb.h + + libntp/lib/isc/win32/include/isc/netdb.h@1.2 +0 -0 + Rename: lib/isc/win32/include/isc/netdb.h -> libntp/lib/isc/win32/include/isc/netdb.h + + libntp/lib/isc/win32/include/isc/ntgroups.h@1.3 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/ntgroups.h -> libntp/lib/isc/win32/include/isc/ntgroups.h + + libntp/lib/isc/win32/include/isc/ntgroups.h@1.2 +0 -0 + Rename: lib/isc/win32/include/isc/ntgroups.h -> libntp/lib/isc/win32/include/isc/ntgroups.h + + libntp/lib/isc/win32/include/isc/ntpaths.h@1.4 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/ntpaths.h -> libntp/lib/isc/win32/include/isc/ntpaths.h + + libntp/lib/isc/win32/include/isc/ntpaths.h@1.3 +0 -0 + Rename: lib/isc/win32/include/isc/ntpaths.h -> libntp/lib/isc/win32/include/isc/ntpaths.h + + libntp/lib/isc/win32/include/isc/offset.h@1.6 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/offset.h -> libntp/lib/isc/win32/include/isc/offset.h + + libntp/lib/isc/win32/include/isc/offset.h@1.5 +0 -0 + Rename: lib/isc/win32/include/isc/offset.h -> libntp/lib/isc/win32/include/isc/offset.h + + libntp/lib/isc/win32/include/isc/once.h@1.7 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/once.h -> libntp/lib/isc/win32/include/isc/once.h + + libntp/lib/isc/win32/include/isc/once.h@1.6 +0 -0 + Rename: lib/isc/win32/include/isc/once.h -> libntp/lib/isc/win32/include/isc/once.h + + libntp/lib/isc/win32/include/isc/platform.h@1.11 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/platform.h -> libntp/lib/isc/win32/include/isc/platform.h + + libntp/lib/isc/win32/include/isc/platform.h@1.10 +0 -0 + Rename: lib/isc/win32/include/isc/platform.h -> libntp/lib/isc/win32/include/isc/platform.h + + libntp/lib/isc/win32/include/isc/stat.h@1.7 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/stat.h -> libntp/lib/isc/win32/include/isc/stat.h + + libntp/lib/isc/win32/include/isc/stat.h@1.6 +0 -0 + Rename: lib/isc/win32/include/isc/stat.h -> libntp/lib/isc/win32/include/isc/stat.h + + libntp/lib/isc/win32/include/isc/stdtime.h@1.4 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/stdtime.h -> libntp/lib/isc/win32/include/isc/stdtime.h + + libntp/lib/isc/win32/include/isc/stdtime.h@1.3 +0 -0 + Rename: lib/isc/win32/include/isc/stdtime.h -> libntp/lib/isc/win32/include/isc/stdtime.h + + libntp/lib/isc/win32/include/isc/strerror.h@1.6 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/strerror.h -> libntp/lib/isc/win32/include/isc/strerror.h + + libntp/lib/isc/win32/include/isc/strerror.h@1.5 +0 -0 + Rename: lib/isc/win32/include/isc/strerror.h -> libntp/lib/isc/win32/include/isc/strerror.h + + libntp/lib/isc/win32/include/isc/syslog.h@1.3 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/syslog.h -> libntp/lib/isc/win32/include/isc/syslog.h + + libntp/lib/isc/win32/include/isc/syslog.h@1.2 +0 -0 + Rename: lib/isc/win32/include/isc/syslog.h -> libntp/lib/isc/win32/include/isc/syslog.h + + libntp/lib/isc/win32/include/isc/thread.h@1.5 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/thread.h -> libntp/lib/isc/win32/include/isc/thread.h + + libntp/lib/isc/win32/include/isc/thread.h@1.4 +0 -0 + Rename: lib/isc/win32/include/isc/thread.h -> libntp/lib/isc/win32/include/isc/thread.h + + libntp/lib/isc/win32/include/isc/time.h@1.4 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/time.h -> libntp/lib/isc/win32/include/isc/time.h + + libntp/lib/isc/win32/include/isc/time.h@1.3 +0 -0 + Rename: lib/isc/win32/include/isc/time.h -> libntp/lib/isc/win32/include/isc/time.h + + libntp/lib/isc/win32/include/isc/win32os.h@1.7 +0 -0 + Rename: libntp/lib/isc/win32/include/isc/win32os.h -> libntp/lib/isc/win32/include/isc/win32os.h + + libntp/lib/isc/win32/include/isc/win32os.h@1.6 +0 -0 + Rename: lib/isc/win32/include/isc/win32os.h -> libntp/lib/isc/win32/include/isc/win32os.h + + libntp/lib/isc/win32/interfaceiter.c@1.25 +0 -0 + Rename: libntp/lib/isc/win32/interfaceiter.c -> libntp/lib/isc/win32/interfaceiter.c + + libntp/lib/isc/win32/interfaceiter.c@1.24 +0 -0 + Rename: lib/isc/win32/interfaceiter.c -> libntp/lib/isc/win32/interfaceiter.c + + libntp/lib/isc/win32/ipv6.c@1.3 +0 -0 + Rename: libntp/lib/isc/win32/ipv6.c -> libntp/lib/isc/win32/ipv6.c + + libntp/lib/isc/win32/ipv6.c@1.2 +0 -0 + Rename: lib/isc/win32/ipv6.c -> libntp/lib/isc/win32/ipv6.c + + libntp/lib/isc/win32/keyboard.c@1.3 +0 -0 + Rename: libntp/lib/isc/win32/keyboard.c -> libntp/lib/isc/win32/keyboard.c + + libntp/lib/isc/win32/keyboard.c@1.2 +0 -0 + Rename: lib/isc/win32/keyboard.c -> libntp/lib/isc/win32/keyboard.c + + libntp/lib/isc/win32/libgen.h@1.3 +0 -0 + Rename: libntp/lib/isc/win32/libgen.h -> libntp/lib/isc/win32/libgen.h + + libntp/lib/isc/win32/libgen.h@1.2 +0 -0 + Rename: lib/isc/win32/libgen.h -> libntp/lib/isc/win32/libgen.h + + libntp/lib/isc/win32/libisc.def@1.4 +0 -0 + Rename: libntp/lib/isc/win32/libisc.def -> libntp/lib/isc/win32/libisc.def + + libntp/lib/isc/win32/libisc.def@1.3 +0 -0 + Rename: lib/isc/win32/libisc.def -> libntp/lib/isc/win32/libisc.def + + libntp/lib/isc/win32/libisc.dsp@1.4 +0 -0 + Rename: libntp/lib/isc/win32/libisc.dsp -> libntp/lib/isc/win32/libisc.dsp + + libntp/lib/isc/win32/libisc.dsp@1.3 +0 -0 + Rename: lib/isc/win32/libisc.dsp -> libntp/lib/isc/win32/libisc.dsp + + libntp/lib/isc/win32/libisc.dsw@1.3 +0 -0 + Rename: libntp/lib/isc/win32/libisc.dsw -> libntp/lib/isc/win32/libisc.dsw + + libntp/lib/isc/win32/libisc.dsw@1.2 +0 -0 + Rename: lib/isc/win32/libisc.dsw -> libntp/lib/isc/win32/libisc.dsw + + libntp/lib/isc/win32/libisc.mak@1.4 +0 -0 + Rename: libntp/lib/isc/win32/libisc.mak -> libntp/lib/isc/win32/libisc.mak + + libntp/lib/isc/win32/libisc.mak@1.3 +0 -0 + Rename: lib/isc/win32/libisc.mak -> libntp/lib/isc/win32/libisc.mak + + libntp/lib/isc/win32/net.c@1.19 +0 -0 + Rename: libntp/lib/isc/win32/net.c -> libntp/lib/isc/win32/net.c + + libntp/lib/isc/win32/net.c@1.18 +0 -0 + Rename: lib/isc/win32/net.c -> libntp/lib/isc/win32/net.c + + libntp/lib/isc/win32/netdb.h@1.4 +0 -0 + Rename: libntp/lib/isc/win32/netdb.h -> libntp/lib/isc/win32/netdb.h + + libntp/lib/isc/win32/netdb.h@1.3 +0 -0 + Rename: lib/isc/win32/netdb.h -> libntp/lib/isc/win32/netdb.h + + libntp/lib/isc/win32/ntgroups.c@1.4 +0 -0 + Rename: libntp/lib/isc/win32/ntgroups.c -> libntp/lib/isc/win32/ntgroups.c + + libntp/lib/isc/win32/ntgroups.c@1.3 +0 -0 + Rename: lib/isc/win32/ntgroups.c -> libntp/lib/isc/win32/ntgroups.c + + libntp/lib/isc/win32/ntpaths.c@1.4 +0 -0 + Rename: libntp/lib/isc/win32/ntpaths.c -> libntp/lib/isc/win32/ntpaths.c + + libntp/lib/isc/win32/ntpaths.c@1.3 +0 -0 + Rename: lib/isc/win32/ntpaths.c -> libntp/lib/isc/win32/ntpaths.c + + libntp/lib/isc/win32/once.c@1.6 +0 -0 + Rename: libntp/lib/isc/win32/once.c -> libntp/lib/isc/win32/once.c + + libntp/lib/isc/win32/once.c@1.5 +0 -0 + Rename: lib/isc/win32/once.c -> libntp/lib/isc/win32/once.c + + libntp/lib/isc/win32/os.c@1.3 +0 -0 + Rename: libntp/lib/isc/win32/os.c -> libntp/lib/isc/win32/os.c + + libntp/lib/isc/win32/os.c@1.2 +0 -0 + Rename: lib/isc/win32/os.c -> libntp/lib/isc/win32/os.c + + libntp/lib/isc/win32/resource.c@1.3 +0 -0 + Rename: libntp/lib/isc/win32/resource.c -> libntp/lib/isc/win32/resource.c + + libntp/lib/isc/win32/resource.c@1.2 +0 -0 + Rename: lib/isc/win32/resource.c -> libntp/lib/isc/win32/resource.c + + libntp/lib/isc/win32/socket.c@1.4 +0 -0 + Rename: libntp/lib/isc/win32/socket.c -> libntp/lib/isc/win32/socket.c + + libntp/lib/isc/win32/socket.c@1.3 +0 -0 + Rename: lib/isc/win32/socket.c -> libntp/lib/isc/win32/socket.c + + libntp/lib/isc/win32/stdio.c@1.3 +0 -0 + Rename: libntp/lib/isc/win32/stdio.c -> libntp/lib/isc/win32/stdio.c + + libntp/lib/isc/win32/stdio.c@1.2 +0 -0 + Rename: lib/isc/win32/stdio.c -> libntp/lib/isc/win32/stdio.c + + libntp/lib/isc/win32/stdtime.c@1.4 +0 -0 + Rename: libntp/lib/isc/win32/stdtime.c -> libntp/lib/isc/win32/stdtime.c + + libntp/lib/isc/win32/stdtime.c@1.3 +0 -0 + Rename: lib/isc/win32/stdtime.c -> libntp/lib/isc/win32/stdtime.c + + libntp/lib/isc/win32/strerror.c@1.15 +0 -0 + Rename: libntp/lib/isc/win32/strerror.c -> libntp/lib/isc/win32/strerror.c + + libntp/lib/isc/win32/strerror.c@1.14 +0 -0 + Rename: lib/isc/win32/strerror.c -> libntp/lib/isc/win32/strerror.c + + libntp/lib/isc/win32/syslog.c@1.3 +0 -0 + Rename: libntp/lib/isc/win32/syslog.c -> libntp/lib/isc/win32/syslog.c + + libntp/lib/isc/win32/syslog.c@1.2 +0 -0 + Rename: lib/isc/win32/syslog.c -> libntp/lib/isc/win32/syslog.c + + libntp/lib/isc/win32/syslog.h@1.3 +0 -0 + Rename: libntp/lib/isc/win32/syslog.h -> libntp/lib/isc/win32/syslog.h + + libntp/lib/isc/win32/syslog.h@1.2 +0 -0 + Rename: lib/isc/win32/syslog.h -> libntp/lib/isc/win32/syslog.h + + libntp/lib/isc/win32/thread.c@1.4 +0 -0 + Rename: libntp/lib/isc/win32/thread.c -> libntp/lib/isc/win32/thread.c + + libntp/lib/isc/win32/thread.c@1.3 +0 -0 + Rename: lib/isc/win32/thread.c -> libntp/lib/isc/win32/thread.c + + libntp/lib/isc/win32/time.c@1.4 +0 -0 + Rename: libntp/lib/isc/win32/time.c -> libntp/lib/isc/win32/time.c + + libntp/lib/isc/win32/time.c@1.3 +0 -0 + Rename: lib/isc/win32/time.c -> libntp/lib/isc/win32/time.c + + libntp/lib/isc/win32/unistd.h@1.4 +0 -0 + Rename: libntp/lib/isc/win32/unistd.h -> libntp/lib/isc/win32/unistd.h + + libntp/lib/isc/win32/unistd.h@1.3 +0 -0 + Rename: lib/isc/win32/unistd.h -> libntp/lib/isc/win32/unistd.h + + libntp/lib/isc/win32/version.c@1.3 +0 -0 + Rename: libntp/lib/isc/win32/version.c -> libntp/lib/isc/win32/version.c + + libntp/lib/isc/win32/version.c@1.2 +0 -0 + Rename: lib/isc/win32/version.c -> libntp/lib/isc/win32/version.c + + libntp/lib/isc/win32/win32os.c@1.6 +0 -0 + Rename: libntp/lib/isc/win32/win32os.c -> libntp/lib/isc/win32/win32os.c + + libntp/lib/isc/win32/win32os.c@1.5 +0 -0 + Rename: lib/isc/win32/win32os.c -> libntp/lib/isc/win32/win32os.c + + libntp/lib/isc/x86_32/include/isc/atomic.h@1.3 +0 -0 + Rename: libntp/lib/isc/x86_32/include/isc/atomic.h -> libntp/lib/isc/x86_32/include/isc/atomic.h + + libntp/lib/isc/x86_32/include/isc/atomic.h@1.2 +0 -0 + Rename: lib/isc/x86_32/include/isc/atomic.h -> libntp/lib/isc/x86_32/include/isc/atomic.h + + libntp/lib/isc/x86_64/include/isc/atomic.h@1.3 +0 -0 + Rename: libntp/lib/isc/x86_64/include/isc/atomic.h -> libntp/lib/isc/x86_64/include/isc/atomic.h + + libntp/lib/isc/x86_64/include/isc/atomic.h@1.2 +0 -0 + Rename: lib/isc/x86_64/include/isc/atomic.h -> libntp/lib/isc/x86_64/include/isc/atomic.h + + libntp/ntp_crypto_rnd.c@1.7 +30 -42 + Enable building without OpenSSL when arc4random_buf() is available. + + libparse/Makefile.am@1.34 +2 -1 + Initialize DISTCLEANFILES so that depsver.mf can append to it. + Use top-level check-libntp.mf + + ntpd/Makefile.am@1.143 +1 -1 + Use top-level check-libntp.mf + + ntpd/ntp_ppsdev.c@1.5 +6 -0 + Fix building without refclock support. + + ntpdate/Makefile.am@1.39 +1 -1 + Use top-level check-libntp.mf + + ntpdc/Makefile.am@1.77 +1 -1 + Use top-level check-libntp.mf + + ntpq/Makefile.am@1.75 +1 -1 + Use top-level check-libntp.mf + + ntpsnmpd/Makefile.am@1.42 +1 -1 + Use top-level check-libntp.mf + + ports/winnt/vs2005/libntp.vcproj@1.30 +45 -49 + Move lib/isc/ under libntp/ + + ports/winnt/vs2005/ntpd.vcproj@1.25 +8 -8 + Move lib/isc/ under libntp/ + + ports/winnt/vs2005/ntpdate.vcproj@1.6 +2 -2 + Move lib/isc/ under libntp/ + + ports/winnt/vs2005/ntpdc.vcproj@1.8 +2 -2 + Move lib/isc/ under libntp/ + + ports/winnt/vs2005/ntpkeygen.vcproj@1.8 +2 -2 + Move lib/isc/ under libntp/ + + ports/winnt/vs2005/ntpq.vcproj@1.8 +2 -2 + Move lib/isc/ under libntp/ + + ports/winnt/vs2008/common.vsprops@1.3 +1 -1 + Move lib/isc/ under libntp/ + + ports/winnt/vs2008/libntp/libntp.vcproj@1.61 +50 -54 + Move lib/isc/ under libntp/ + + ports/winnt/vs2013/common.props@1.4 +1 -1 + Move lib/isc/ under libntp/ + + ports/winnt/vs2013/libntp/libntp.vcxproj@1.17 +49 -50 + Move lib/isc/ under libntp/ + + ports/winnt/vs2015/common.props@1.2 +1 -1 + Move lib/isc/ under libntp/ + + ports/winnt/vs2015/libntp/libntp.vcxproj@1.7 +49 -50 + Move lib/isc/ under libntp/ + + sntp/check-libntp.mf@1.4 +7 -6 + Split check-libntp.mf into main and sntp versions and remove duplicated logic in many Makefile.am files. + + sntp/check-libsntp.mf@1.1 +13 -0 + Centralize makefile logic to build libsntp.a before dependents + + sntp/check-libsntp.mf@1.0 +0 -0 + + sntp/check-libunity.mf@1.1 +15 -0 + Centralize makefile logic to build libunity.a before dependents. + + sntp/check-libunity.mf@1.0 +0 -0 + + sntp/configure.ac@1.87 +2 -6 + Turn on Automake subdir-objects option to build subdir *.o files in corresponding + build subdirs instead of all in the Makefile directory. + Remove conditionalization of AM_PROG_AR needed for pre-1.12 automake. + + sntp/deps-ver@1.4 +1 -1 + Bump deps-ver to clean .deps directories as files have moved. + + sntp/includes.mf@1.2 +3 -3 + Account for new path to lib/isc/ + + sntp/m4/ntp_crypto_rand.m4@1.3 +3 -2 + Fix building without OpenSSL. + + sntp/tests/Makefile.am@1.73 +19 -39 + Build our own version.c rather than reusing a parent directory's. + Centralize logic to build prerequisite libraries in included .mf files. + + sntp/unity/Makefile.am@1.12 +2 -2 + Initialize DISTCLEANFILES so that depsver.mf can append to it. + subdir-objects needs sources in this dir or subdirs. + + sntp/unity/libpkgver-colcomp.c@1.1 +1 -0 + subdir-objects breaks with sources from parent or sibling dir. + + sntp/unity/libpkgver-colcomp.c@1.0 +0 -0 + + tests/bug-2803/Makefile.am@1.20 +3 -19 + Initialize DISTCLEANFILES so that depsver.mf can append to it. + Centralize logic to build prerequisite libraries in included .mf files. + + tests/libntp/Makefile.am@1.102 +3 -18 + Initialize DISTCLEANFILES so that depsver.mf can append to it. + Centralize logic to build prerequisite libraries in included .mf files. + + tests/ntpd/Makefile.am@1.37 +12 -35 + Initialize DISTCLEANFILES so that depsver.mf can append to it. + Centralize logic to build prerequisite libraries in included .mf files. + subdir-objects sources in parent or sibling dir break. + + tests/ntpd/test-libntp.c@1.1 +2 -0 + subdir-objects doesn't work with sources from parent or sibling dir + + tests/ntpd/test-libntp.c@1.0 +0 -0 + + tests/ntpq/Makefile.am@1.15 +3 -28 + Initialize DISTCLEANFILES so that depsver.mf can append to it. + Centralize logic to build prerequisite libraries in included .mf files. + + tests/sandbox/Makefile.am@1.14 +3 -20 + Initialize DISTCLEANFILES so that depsver.mf can append to it. + Centralize logic to build prerequisite libraries in included .mf files. + + tests/sec-2853/Makefile.am@1.10 +5 -25 + Link against libntpd.a instead of ntpd/rc_cmdlength.o + Initialize DISTCLEANFILES so that depsver.mf can append to it. + Centralize logic to build prerequisite libraries in included .mf files. + + util/Makefile.am@1.80 +1 -1 + Use top-level check-libntp.mf + +ChangeSet@1.3943, 2023-01-20 00:42:52-05:00, davehart@tl.davehart.net + Fix 'make distcheck' failure from missing ntpd/ntp_clockdev.h in tarball. + + ntpd/Makefile.am@1.142 +2 -0 + Add ntp_clockdev.h to ntpd/Makefile.am noinst_HEADERS to fix 'make distcheck' + +ChangeSet@1.3912.20.1, 2022-12-31 02:00:09-05:00, davehart@z4.davehart.net + [Bug 3784] high-load ntpd on Windows deaf after enough ICMP TTL exceeded + + ChangeLog@1.1986.20.1 +2 -0 + [Bug 3784] high-load ntpd on Windows deaf after enough ICMP TTL exceeded + + ntpd/ntp_keyword.h@1.38.1.1 +1 -1 + [Bug 3784] high-load ntpd on Windows deaf after enough ICMP TTL exceeded + + ports/winnt/ntpd/ntp_iocompletionport.c@1.82 +12 -4 + high-load ntpd on Windows deaf after enough ICMP TTL exceeded + +ChangeSet@1.3940.2.2, 2022-11-13 09:47:08+01:00, perlinger@ntp.org + [Bug 3640] sidekick: fixed "discard monitor" implementation + + ChangeLog@1.2009.2.1 +2 -0 + [Bug 3640] sidekick: fixed "discard monitor" implementation + + include/ntp_random.h@1.4 +1 -0 + [Bug 3640] sidekick: fixed "discard monitor" implementation + + libntp/ntp_random.c@1.12 +15 -0 + [Bug 3640] sidekick: fixed "discard monitor" implementation + + libntp/systime.c@1.76 +1 -1 + [Bug 3640] sidekick: fixed "discard monitor" implementation + + ntpd/ntp_io.c@1.433 +1 -1 + [Bug 3640] sidekick: fixed "discard monitor" implementation + + ntpd/ntp_monitor.c@1.45 +1 -1 + [Bug 3640] sidekick: fixed "discard monitor" implementation + + ntpd/ntp_proto.c@1.439 +1 -1 + [Bug 3640] sidekick: fixed "discard monitor" implementation + +ChangeSet@1.3940.2.1, 2022-09-06 19:15:41+02:00, perlinger@ntp.org + [4.2.8p16 rc] c99-ism breaks VS2008 build + + libntp/ntp_crypto_rnd.c@1.6 +2 -6 + [4.2.8p16 rc] c99-ism breaks VS2008 build + +ChangeSet@1.3940.1.2, 2022-09-01 02:57:43-05:00, stenn@stenn.chi1.ntfo.org + Merge stenn.chi1.ntfo.org:/home/nfs1.chi1/stenn/ntp-stable-libevent + into stenn.chi1.ntfo.org:/home/nfs1.chi1/stenn/ntp-stable + + BitKeeper/deleted/78/test-driver~3d169fff1185c4af@1.2 +0 -0 + Merge rename: sntp/libevent/build-aux/test-driver -> /home/nfs1.chi1/stenn/ntp-stable/RESYNC/BitKeeper/deleted/78/test-driver~3d169fff1185c4af + +ChangeSet@1.3940.1.1, 2022-09-01 02:56:37-05:00, stenn@stenn.chi1.ntfo.org + libevent-2.1.12-stable + + ChangeLog@1.2009.1.1 +1 -0 + libevent-2.1.12-stable + + sntp/libevent/CMakeLists.txt@1.1 +1575 -0 + BitKeeper file sntp/libevent/CMakeLists.txt + + sntp/libevent/CMakeLists.txt@1.0 +0 -0 + + sntp/libevent/ChangeLog@1.10 +760 -0 + libevent-2.1.12-stable + + sntp/libevent/ChangeLog-1.4@1.2 +1 -1 + libevent-2.1.12-stable + + sntp/libevent/ChangeLog-2.0@1.3 +1 -1 + libevent-2.1.12-stable + + sntp/libevent/Doxyfile@1.4 +23 -23 + libevent-2.1.12-stable + + sntp/libevent/Makefile.am@1.16 +59 -20 + libevent-2.1.12-stable + + sntp/libevent/README.md@1.2 +197 -28 + libevent-2.1.12-stable + + sntp/libevent/WIN32-Code/getopt_long.c@1.2 +4 -3 + libevent-2.1.12-stable + + sntp/libevent/WIN32-Code/nmake/event2/event-config.h@1.3 +8 -18 + libevent-2.1.12-stable + + sntp/libevent/arc4random.c@1.7 +15 -25 + libevent-2.1.12-stable + + sntp/libevent/autogen.sh@1.2 +7 -0 + libevent-2.1.12-stable + + sntp/libevent/buffer.c@1.11 +59 -31 + libevent-2.1.12-stable + + sntp/libevent/buffer_iocp.c@1.6 +1 -0 + libevent-2.1.12-stable + + sntp/libevent/bufferevent-internal.h@1.8 +72 -4 + libevent-2.1.12-stable + + sntp/libevent/bufferevent.c@1.9 +98 -51 + libevent-2.1.12-stable + + sntp/libevent/bufferevent_async.c@1.8 +43 -23 + libevent-2.1.12-stable + + sntp/libevent/bufferevent_filter.c@1.8 +91 -11 + libevent-2.1.12-stable + + sntp/libevent/bufferevent_openssl.c@1.10 +179 -159 + libevent-2.1.12-stable + + sntp/libevent/bufferevent_pair.c@1.9 +13 -6 + libevent-2.1.12-stable + + sntp/libevent/bufferevent_ratelim.c@1.6 +3 -6 + libevent-2.1.12-stable + + sntp/libevent/bufferevent_sock.c@1.8 +87 -89 + libevent-2.1.12-stable + + sntp/libevent/build-aux/test-driver@1.1 +148 -0 + BitKeeper file sntp/libevent/build-aux/test-driver + + sntp/libevent/build-aux/test-driver@1.0 +0 -0 + + sntp/libevent/checkpatch.sh@1.1 +299 -0 + BitKeeper file sntp/libevent/checkpatch.sh + + sntp/libevent/checkpatch.sh@1.0 +0 -0 + + sntp/libevent/cmake/AddCompilerFlags.cmake@1.1 +13 -0 + BitKeeper file sntp/libevent/cmake/AddCompilerFlags.cmake + + sntp/libevent/cmake/AddCompilerFlags.cmake@1.0 +0 -0 + + sntp/libevent/cmake/AddEventLibrary.cmake@1.1 +193 -0 + BitKeeper file sntp/libevent/cmake/AddEventLibrary.cmake + + sntp/libevent/cmake/AddEventLibrary.cmake@1.0 +0 -0 + + sntp/libevent/cmake/COPYING-CMAKE-SCRIPTS@1.1 +22 -0 + BitKeeper file sntp/libevent/cmake/COPYING-CMAKE-SCRIPTS + + sntp/libevent/cmake/COPYING-CMAKE-SCRIPTS@1.0 +0 -0 + + sntp/libevent/cmake/CheckConstExists.cmake@1.1 +25 -0 + BitKeeper file sntp/libevent/cmake/CheckConstExists.cmake + + sntp/libevent/cmake/CheckConstExists.cmake@1.0 +0 -0 + + sntp/libevent/cmake/CheckFileOffsetBits.c@1.1 +14 -0 + BitKeeper file sntp/libevent/cmake/CheckFileOffsetBits.c + + sntp/libevent/cmake/CheckFileOffsetBits.c@1.0 +0 -0 + + sntp/libevent/cmake/CheckFileOffsetBits.cmake@1.1 +43 -0 + BitKeeper file sntp/libevent/cmake/CheckFileOffsetBits.cmake + + sntp/libevent/cmake/CheckFileOffsetBits.cmake@1.0 +0 -0 + + sntp/libevent/cmake/CheckFunctionKeywords.cmake@1.1 +14 -0 + BitKeeper file sntp/libevent/cmake/CheckFunctionKeywords.cmake + + sntp/libevent/cmake/CheckFunctionKeywords.cmake@1.0 +0 -0 + + sntp/libevent/cmake/CheckPrototypeDefinition.c.in@1.1 +29 -0 + BitKeeper file sntp/libevent/cmake/CheckPrototypeDefinition.c.in + + sntp/libevent/cmake/CheckPrototypeDefinition.c.in@1.0 +0 -0 + + sntp/libevent/cmake/CheckPrototypeDefinition.cmake@1.1 +82 -0 + BitKeeper file sntp/libevent/cmake/CheckPrototypeDefinition.cmake + + sntp/libevent/cmake/CheckPrototypeDefinition.cmake@1.0 +0 -0 + + sntp/libevent/cmake/CheckWorkingKqueue.cmake@1.1 +52 -0 + BitKeeper file sntp/libevent/cmake/CheckWorkingKqueue.cmake + + sntp/libevent/cmake/CheckWorkingKqueue.cmake@1.0 +0 -0 + + sntp/libevent/cmake/CodeCoverage.cmake@1.1 +165 -0 + BitKeeper file sntp/libevent/cmake/CodeCoverage.cmake + + sntp/libevent/cmake/CodeCoverage.cmake@1.0 +0 -0 + + sntp/libevent/cmake/Copyright.txt@1.1 +57 -0 + BitKeeper file sntp/libevent/cmake/Copyright.txt + + sntp/libevent/cmake/Copyright.txt@1.0 +0 -0 + + sntp/libevent/cmake/LibeventConfig.cmake.in@1.1 +183 -0 + BitKeeper file sntp/libevent/cmake/LibeventConfig.cmake.in + + sntp/libevent/cmake/LibeventConfig.cmake.in@1.0 +0 -0 + + sntp/libevent/cmake/LibeventConfigVersion.cmake.in@1.1 +11 -0 + BitKeeper file sntp/libevent/cmake/LibeventConfigVersion.cmake.in + + sntp/libevent/cmake/LibeventConfigVersion.cmake.in@1.0 +0 -0 + + sntp/libevent/cmake/Macros.cmake@1.1 +36 -0 + BitKeeper file sntp/libevent/cmake/Macros.cmake + + sntp/libevent/cmake/Macros.cmake@1.0 +0 -0 + + sntp/libevent/cmake/Uninstall.cmake.in@1.1 +23 -0 + BitKeeper file sntp/libevent/cmake/Uninstall.cmake.in + + sntp/libevent/cmake/Uninstall.cmake.in@1.0 +0 -0 + + sntp/libevent/cmake/UseDoxygen.cmake@1.1 +111 -0 + BitKeeper file sntp/libevent/cmake/UseDoxygen.cmake + + sntp/libevent/cmake/UseDoxygen.cmake@1.0 +0 -0 + + sntp/libevent/cmake/VersionViaGit.cmake@1.1 +66 -0 + BitKeeper file sntp/libevent/cmake/VersionViaGit.cmake + + sntp/libevent/cmake/VersionViaGit.cmake@1.0 +0 -0 + + sntp/libevent/compile@1.1 +347 -0 + BitKeeper file sntp/libevent/compile + + sntp/libevent/compile@1.0 +0 -0 + + sntp/libevent/config.guess@1.1 +1433 -0 + BitKeeper file sntp/libevent/config.guess + + sntp/libevent/config.guess@1.0 +0 -0 + + sntp/libevent/config.sub@1.1 +1804 -0 + BitKeeper file sntp/libevent/config.sub + + sntp/libevent/config.sub@1.0 +0 -0 + + sntp/libevent/configure.ac@1.19 +210 -123 + libevent-2.1.12-stable + + sntp/libevent/defer-internal.h@1.6 +4 -1 + libevent-2.1.12-stable + + sntp/libevent/depcomp@1.1 +791 -0 + BitKeeper file sntp/libevent/depcomp + + sntp/libevent/depcomp@1.0 +0 -0 + + sntp/libevent/doxygen.am@1.1 +55 -0 + BitKeeper file sntp/libevent/doxygen.am + + sntp/libevent/doxygen.am@1.0 +0 -0 + + sntp/libevent/epoll.c@1.7 +29 -25 + libevent-2.1.12-stable + + sntp/libevent/epolltable-internal.h@1.2 +1 -1 + libevent-2.1.12-stable + + sntp/libevent/evbuffer-internal.h@1.9 +1 -1 + libevent-2.1.12-stable + + sntp/libevent/evconfig-private.h.cmake@1.1 +40 -0 + BitKeeper file sntp/libevent/evconfig-private.h.cmake + + sntp/libevent/evconfig-private.h.cmake@1.0 +0 -0 + + sntp/libevent/evconfig-private.h.in@1.3 +7 -0 + libevent-2.1.12-stable + + sntp/libevent/evdns.c@1.12 +165 -75 + libevent-2.1.12-stable + + sntp/libevent/event-config.h.cmake@1.1 +513 -0 + BitKeeper file sntp/libevent/event-config.h.cmake + + sntp/libevent/event-config.h.cmake@1.0 +0 -0 + + sntp/libevent/event-internal.h@1.10 +19 -5 + libevent-2.1.12-stable + + sntp/libevent/event.c@1.14 +309 -179 + libevent-2.1.12-stable + + sntp/libevent/event_iocp.c@1.7 +1 -1 + libevent-2.1.12-stable + + sntp/libevent/event_rpcgen.py@1.4 +1112 -915 + libevent-2.1.12-stable + + sntp/libevent/event_tagging.c@1.6 +7 -2 + libevent-2.1.12-stable + + sntp/libevent/evmap.c@1.8 +25 -18 + libevent-2.1.12-stable + + sntp/libevent/evrpc.c@1.7 +3 -3 + libevent-2.1.12-stable + + sntp/libevent/evthread-internal.h@1.9 +15 -1 + libevent-2.1.12-stable + + sntp/libevent/evthread.c@1.9 +41 -7 + libevent-2.1.12-stable + + sntp/libevent/evutil.c@1.11 +158 -56 + libevent-2.1.12-stable + + sntp/libevent/evutil_rand.c@1.8 +3 -3 + libevent-2.1.12-stable + + sntp/libevent/evutil_time.c@1.6 +88 -5 + libevent-2.1.12-stable + + sntp/libevent/http-internal.h@1.7 +17 -17 + libevent-2.1.12-stable + + sntp/libevent/http.c@1.11 +438 -167 + libevent-2.1.12-stable + + sntp/libevent/include/event.h@1.6 +0 -2 + libevent-2.1.12-stable + + sntp/libevent/include/event2/buffer.h@1.8 +2 -1 + libevent-2.1.12-stable + + sntp/libevent/include/event2/buffer_compat.h@1.5 +3 -2 + libevent-2.1.12-stable + + sntp/libevent/include/event2/bufferevent.h@1.7 +33 -4 + libevent-2.1.12-stable + + sntp/libevent/include/event2/bufferevent_compat.h@1.4 +4 -0 + libevent-2.1.12-stable + + sntp/libevent/include/event2/dns.h@1.8 +40 -6 + libevent-2.1.12-stable + + sntp/libevent/include/event2/dns_compat.h@1.5 +23 -1 + libevent-2.1.12-stable + + sntp/libevent/include/event2/event.h@1.12 +37 -44 + libevent-2.1.12-stable + + sntp/libevent/include/event2/http.h@1.8 +46 -8 + libevent-2.1.12-stable + + sntp/libevent/include/event2/http_compat.h@1.4 +7 -3 + libevent-2.1.12-stable + + sntp/libevent/include/event2/listener.h@1.5 +12 -0 + libevent-2.1.12-stable + + sntp/libevent/include/event2/rpc.h@1.4 +39 -9 + libevent-2.1.12-stable + + sntp/libevent/include/event2/rpc_struct.h@1.4 +14 -0 + libevent-2.1.12-stable + + sntp/libevent/include/event2/util.h@1.8 +57 -6 + libevent-2.1.12-stable + + sntp/libevent/include/event2/visibility.h@1.2 +29 -17 + libevent-2.1.12-stable + + sntp/libevent/include/include.am@1.3 +5 -2 + libevent-2.1.12-stable + + sntp/libevent/iocp-internal.h@1.4 +14 -0 + libevent-2.1.12-stable + + sntp/libevent/kqueue.c@1.8 +19 -5 + libevent-2.1.12-stable + + sntp/libevent/libevent_core.pc.in@1.1 +16 -0 + BitKeeper file sntp/libevent/libevent_core.pc.in + + sntp/libevent/libevent_core.pc.in@1.0 +0 -0 + + sntp/libevent/libevent_extra.pc.in@1.1 +16 -0 + BitKeeper file sntp/libevent/libevent_extra.pc.in + + sntp/libevent/libevent_extra.pc.in@1.0 +0 -0 + + sntp/libevent/listener.c@1.9 +20 -10 + libevent-2.1.12-stable + + sntp/libevent/log-internal.h@1.4 +18 -7 + libevent-2.1.12-stable + + sntp/libevent/log.c@1.7 +1 -10 + libevent-2.1.12-stable + + sntp/libevent/ltmain.sh@1.1 +11147 -0 + BitKeeper file sntp/libevent/ltmain.sh + + sntp/libevent/ltmain.sh@1.0 +0 -0 + + sntp/libevent/m4/ax_check_funcs_ex.m4@1.1 +22 -0 + BitKeeper file sntp/libevent/m4/ax_check_funcs_ex.m4 + + sntp/libevent/m4/ax_check_funcs_ex.m4@1.0 +0 -0 + + sntp/libevent/m4/ax_prog_doxygen.m4@1.1 +600 -0 + BitKeeper file sntp/libevent/m4/ax_prog_doxygen.m4 + + sntp/libevent/m4/ax_prog_doxygen.m4@1.0 +0 -0 + + sntp/libevent/m4/libevent_openssl.m4@1.3 +20 -6 + libevent-2.1.12-stable + + sntp/libevent/make-event-config.sed@1.2 +7 -3 + libevent-2.1.12-stable + + sntp/libevent/minheap-internal.h@1.7 +5 -1 + libevent-2.1.12-stable + + sntp/libevent/missing@1.1 +215 -0 + BitKeeper file sntp/libevent/missing + + sntp/libevent/missing@1.0 +0 -0 + + sntp/libevent/mm-internal.h@1.3 +5 -0 + libevent-2.1.12-stable + + sntp/libevent/openssl-compat.h@1.1 +47 -0 + BitKeeper file sntp/libevent/openssl-compat.h + + sntp/libevent/openssl-compat.h@1.0 +0 -0 + + sntp/libevent/poll.c@1.4 +22 -5 + libevent-2.1.12-stable + + sntp/libevent/sample/dns-example.c@1.8 +59 -43 + libevent-2.1.12-stable + + sntp/libevent/sample/event-read-fifo.c@1.6 +2 -2 + libevent-2.1.12-stable + + sntp/libevent/sample/hello-world.c@1.5 +2 -3 + libevent-2.1.12-stable + + sntp/libevent/sample/http-connect.c@1.1 +131 -0 + BitKeeper file sntp/libevent/sample/http-connect.c + + sntp/libevent/sample/http-connect.c@1.0 +0 -0 + + sntp/libevent/sample/http-server.c@1.13 +229 -69 + libevent-2.1.12-stable + + sntp/libevent/sample/https-client.c@1.3 +147 -42 + libevent-2.1.12-stable + + sntp/libevent/sample/include.am@1.4 +10 -7 + libevent-2.1.12-stable + + sntp/libevent/sample/le-proxy.c@1.4 +18 -1 + libevent-2.1.12-stable + + sntp/libevent/sample/openssl_hostname_validation.c@1.2 +9 -3 + libevent-2.1.12-stable + + sntp/libevent/sample/signal-test.c@1.5 +19 -11 + libevent-2.1.12-stable + + sntp/libevent/sample/time-test.c@1.5 +5 -2 + libevent-2.1.12-stable + + sntp/libevent/select.c@1.7 +1 -1 + libevent-2.1.12-stable + + sntp/libevent/signal.c@1.8 +2 -0 + libevent-2.1.12-stable + + sntp/libevent/strlcpy-internal.h@1.4 +2 -0 + libevent-2.1.12-stable + + sntp/libevent/test-driver@1.1 +148 -0 + BitKeeper file sntp/libevent/test-driver + + sntp/libevent/test-driver@1.0 +0 -0 + + sntp/libevent/test/bench.c@1.6 +44 -16 + libevent-2.1.12-stable + + sntp/libevent/test/bench_cascade.c@1.6 +4 -4 + libevent-2.1.12-stable + + sntp/libevent/test/bench_http.c@1.6 +6 -1 + libevent-2.1.12-stable + + sntp/libevent/test/bench_httpclient.c@1.9 +13 -7 + libevent-2.1.12-stable + + sntp/libevent/test/check-dumpevents.py@1.4 +5 -5 + libevent-2.1.12-stable + + sntp/libevent/test/include.am@1.5 +37 -7 + libevent-2.1.12-stable + + sntp/libevent/test/print-winsock-errors.c@1.2 +2 -0 + libevent-2.1.12-stable + + sntp/libevent/test/regress.c@1.9 +393 -112 + libevent-2.1.12-stable + + sntp/libevent/test/regress.h@1.6 +13 -0 + libevent-2.1.12-stable + + sntp/libevent/test/regress_buffer.c@1.9 +633 -44 + libevent-2.1.12-stable + + sntp/libevent/test/regress_bufferevent.c@1.7 +416 -111 + libevent-2.1.12-stable + + sntp/libevent/test/regress_dns.c@1.11 +587 -119 + libevent-2.1.12-stable + + sntp/libevent/test/regress_et.c@1.6 +106 -44 + libevent-2.1.12-stable + + sntp/libevent/test/regress_finalize.c@1.3 +48 -0 + libevent-2.1.12-stable + + sntp/libevent/test/regress_http.c@1.11 +1096 -284 + libevent-2.1.12-stable + + sntp/libevent/test/regress_listener.c@1.7 +138 -4 + libevent-2.1.12-stable + + sntp/libevent/test/regress_main.c@1.8 +68 -6 + libevent-2.1.12-stable + + sntp/libevent/test/regress_minheap.c@1.6 +0 -1 + libevent-2.1.12-stable + + sntp/libevent/test/regress_rpc.c@1.7 +48 -1 + libevent-2.1.12-stable + + sntp/libevent/test/regress_ssl.c@1.9 +694 -108 + libevent-2.1.12-stable + + sntp/libevent/test/regress_testutils.c@1.7 +18 -4 + libevent-2.1.12-stable + + sntp/libevent/test/regress_testutils.h@1.3 +1 -0 + libevent-2.1.12-stable + + sntp/libevent/test/regress_thread.c@1.7 +10 -5 + libevent-2.1.12-stable + + sntp/libevent/test/regress_thread.h@1.2 +21 -13 + libevent-2.1.12-stable + + sntp/libevent/test/regress_util.c@1.8 +270 -2 + libevent-2.1.12-stable + + sntp/libevent/test/regress_zlib.c@1.6 +4 -4 + libevent-2.1.12-stable + + sntp/libevent/test/rpcgen_wrapper.sh@1.5 +1 -10 + libevent-2.1.12-stable + + sntp/libevent/test/test-changelist.c@1.6 +2 -2 + libevent-2.1.12-stable + + sntp/libevent/test/test-closed.c@1.2 +3 -9 + libevent-2.1.12-stable + + sntp/libevent/test/test-eof.c@1.7 +4 -11 + libevent-2.1.12-stable + + sntp/libevent/test/test-fdleak.c@1.3 +9 -6 + libevent-2.1.12-stable + + sntp/libevent/test/test-init.c@1.5 +1 -1 + libevent-2.1.12-stable + + sntp/libevent/test/test-ratelim.c@1.12 +88 -5 + libevent-2.1.12-stable + + sntp/libevent/test/test-time.c@1.8 +17 -11 + libevent-2.1.12-stable + + sntp/libevent/test/test-weof.c@1.5 +3 -6 + libevent-2.1.12-stable + + sntp/libevent/test/test.sh@1.11 +57 -13 + libevent-2.1.12-stable + + sntp/libevent/test/tinytest.c@1.7 +143 -26 + libevent-2.1.12-stable + + sntp/libevent/test/tinytest.h@1.5 +4 -1 + libevent-2.1.12-stable + + sntp/libevent/test/tinytest_demo.c@1.2 +3 -1 + libevent-2.1.12-stable + + sntp/libevent/test/tinytest_macros.h@1.4 +16 -2 + libevent-2.1.12-stable + + sntp/libevent/time-internal.h@1.3 +3 -0 + libevent-2.1.12-stable + + sntp/libevent/util-internal.h@1.11 +79 -7 + libevent-2.1.12-stable + + sntp/libevent/whatsnew-2.1.txt@1.5 +83 -5 + libevent-2.1.12-stable + + sntp/libevent/win32select.c@1.6 +3 -2 + libevent-2.1.12-stable + +ChangeSet@1.3936.1.1, 2022-08-27 05:04:31-05:00, stenn@stenn.chi1.ntfo.org + ChangeLog: + [Bug 3695] Fix memory leak with ntpq on Windows Server 2019 + + ChangeLog@1.2008 +1 -0 + [Bug 3695] Fix memory leak with ntpq on Windows Server 2019 + +ChangeSet@1.3938, 2022-08-27 04:27:52-05:00, stenn@stenn.chi1.ntfo.org + sntp.c, main.c: + Bug 3688 (-fno-common) fixes + + sntp/main.c@1.108 +1 -1 + Bug 3688 (-fno-common) fixes + + sntp/sntp.c@1.5 +2 -0 + Bug 3688 (-fno-common) fixes + +ChangeSet@1.3937, 2022-08-27 03:36:11-05:00, stenn@stenn.chi1.ntfo.org + main.c: + One more fix for Bug 3695 + + sntp/main.c@1.107 +1 -1 + One more fix for Bug 3695 + +ChangeSet@1.3935, 2022-08-27 03:03:40-05:00, stenn@stenn.chi1.ntfo.org + test-libntp.h: + Bug 3688 - one more fix + + tests/libntp/test-libntp.h@1.8 +5 -1 + Bug 3688 - one more fix + +ChangeSet@1.3912.19.9, 2022-06-27 00:02:54-05:00, stenn@stenn.chi1.ntfo.org + Add -u option for ntpq/ntpdc + + ntpdc/invoke-ntpdc.texi@1.520 +10 -1 + Add -u option for ntpq/ntpdc + + ntpdc/ntpdc-opts.c@1.539 +73 -43 + Add -u option for ntpq/ntpdc + + ntpdc/ntpdc-opts.def@1.24 +10 -0 + Add -u option for ntpq/ntpdc + + ntpdc/ntpdc-opts.h@1.538 +14 -7 + Add -u option for ntpq/ntpdc + + ntpdc/ntpdc.1ntpdcman@1.351 +8 -2 + Add -u option for ntpq/ntpdc + + ntpdc/ntpdc.1ntpdcmdoc@1.351 +7 -2 + Add -u option for ntpq/ntpdc + + ntpdc/ntpdc.html@1.365 +24 -8 + Add -u option for ntpq/ntpdc + + ntpdc/ntpdc.man.in@1.351 +8 -2 + Add -u option for ntpq/ntpdc + + ntpdc/ntpdc.mdoc.in@1.351 +7 -2 + Add -u option for ntpq/ntpdc + + ntpq/invoke-ntpq.texi@1.530 +10 -1 + Add -u option for ntpq/ntpdc + + ntpq/ntpq-opts.c@1.548 +81 -51 + Add -u option for ntpq/ntpdc + + ntpq/ntpq-opts.def@1.33 +10 -0 + Add -u option for ntpq/ntpdc + + ntpq/ntpq-opts.h@1.546 +15 -8 + Add -u option for ntpq/ntpdc + + ntpq/ntpq.1ntpqman@1.358 +8 -2 + Add -u option for ntpq/ntpdc + + ntpq/ntpq.1ntpqmdoc@1.358 +7 -2 + Add -u option for ntpq/ntpdc + + ntpq/ntpq.man.in@1.358 +8 -2 + Add -u option for ntpq/ntpdc + + ntpq/ntpq.mdoc.in@1.358 +7 -2 + Add -u option for ntpq/ntpdc + +ChangeSet@1.3912.19.8, 2022-06-26 05:46:50-05:00, stenn@stenn.chi1.ntfo.org + Check in autogen files for the -u flag to ntpdc/ntpq + + ntpdc/invoke-ntpdc.texi@1.519 +1 -1 + Check in autogen files for the -u flag to ntpdc/ntpq + + ntpdc/ntpdc-opts.c@1.538 +1 -1 + Check in autogen files for the -u flag to ntpdc/ntpq + + ntpdc/ntpdc-opts.h@1.537 +1 -1 + Check in autogen files for the -u flag to ntpdc/ntpq + + ntpdc/ntpdc.1ntpdcman@1.350 +7 -699 + Check in autogen files for the -u flag to ntpdc/ntpq + + ntpdc/ntpdc.1ntpdcmdoc@1.350 +7 -666 + Check in autogen files for the -u flag to ntpdc/ntpq + + ntpdc/ntpdc.man.in@1.350 +7 -699 + Check in autogen files for the -u flag to ntpdc/ntpq + + ntpdc/ntpdc.mdoc.in@1.350 +7 -666 + Check in autogen files for the -u flag to ntpdc/ntpq + + ntpq/invoke-ntpq.texi@1.529 +1 -1 + Check in autogen files for the -u flag to ntpdc/ntpq + + ntpq/ntpq-opts.c@1.547 +1 -1 + Check in autogen files for the -u flag to ntpdc/ntpq + + ntpq/ntpq-opts.h@1.545 +1 -1 + Check in autogen files for the -u flag to ntpdc/ntpq + + ntpq/ntpq.1ntpqman@1.357 +3 -1391 + Check in autogen files for the -u flag to ntpdc/ntpq + + ntpq/ntpq.1ntpqmdoc@1.357 +3 -889 + Check in autogen files for the -u flag to ntpdc/ntpq + + ntpq/ntpq.man.in@1.357 +3 -1391 + Check in autogen files for the -u flag to ntpdc/ntpq + + ntpq/ntpq.mdoc.in@1.357 +3 -889 + Check in autogen files for the -u flag to ntpdc/ntpq + +ChangeSet@1.3912.19.7, 2022-04-14 08:07:58+02:00, perlinger@ntp.org + [Bug 3758] Provide a 'device' config statement for refclocks + - update docs on refclock-gpsdjson + + html/drivers/driver46.html@1.8 +19 -12 + [Bug 3758] Provide a 'device' config statement for refclocks + - update docs on refclock-gpsdjson + +ChangeSet@1.3912.19.6, 2022-04-13 21:57:26+02:00, perlinger@ntp.org + [Bug 3758] Provide a 'device' config statement for refclocks + hook up refclock_gpsdjson to device redirection + + ntpd/ntp_clockdev.c@1.2 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - comment typo + + ntpd/refclock_gpsdjson.c@1.28.3.1 +14 -9 + [Bug 3758] Provide a 'device' config statement for refclocks + - hook up to device redirection (this driver is special) + - increase receive/assembly buffer: Multi GNSS reports are HUGE + - fix regression in buffer handling (overflow) + +ChangeSet@1.3912.19.5, 2022-03-28 09:18:23+02:00, perlinger@ntp.org + [Bug 3758] Provide a 'device' config statement for refclocks + + ChangeLog@1.1986.19.3 +1 -0 + [Bug 3758] Provide a 'device' config statement for refclocks + --- + merge with 3757 (magic PPS) as there are overlpped changes otherwise + + html/clockopt.html@1.29 +39 -0 + [Bug 3758] Provide a 'device' config statement for refclocks + - document 'device' syntax + + html/scripts/clockopt.txt@1.4 +1 -0 + [Bug 3758] Provide a 'device' config statement for refclocks + - document 'device' syntax + + include/ntp_config.h@1.91 +1 -0 + [Bug 3758] Provide a 'device' config statement for refclocks + - add 'device' list to config + + include/ntp_refclock.h@1.38.1.6 +3 -2 + [Bug 3758] Provide a 'device' config statement for refclocks + - have 'ppsdev_reopen()' lookup alternative device names, too + + include/ntp_stdlib.h@1.86.4.1 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - make 'refnumtoa()' take a const pointer + + libntp/refnumtoa.c@1.10.1.1 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - make 'refnumtoa()' take a const pointer + + ntpd/Makefile.am@1.138.1.2 +1 -0 + [Bug 3758] Provide a 'device' config statement for refclocks + - add 'ntp_clockdev.c' to source list + + ntpd/keyword-gen-utd@1.36 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - auto-update + + ntpd/keyword-gen.c@1.43 +4 -0 + [Bug 3758] Provide a 'device' config statement for refclocks + - add 'device', 'ppsdata', 'timedata' keywords + + ntpd/ntp_clockdev.c@1.1 +187 -0 + [Bug 3758] Provide a 'device' config statement for refclocks + - implement device table + info-logging the redirections + - add callback for windows port + + ntpd/ntp_clockdev.c@1.0 +0 -0 + + ntpd/ntp_clockdev.h@1.1 +25 -0 + [Bug 3758] Provide a 'device' config statement for refclocks + - API dt set&query clock-specific device redirections + + ntpd/ntp_clockdev.h@1.0 +0 -0 + + ntpd/ntp_config.c@1.376.1.1 +110 -0 + [Bug 3758] Provide a 'device' config statement for refclocks + - handle the device redirections in the config tree + + ntpd/ntp_keyword.h@1.39 +1034 -1017 + [[Bug 3758] Provide a 'device' config statement for refclocks + - regenerated + + ntpd/ntp_parser.c@1.118 +2261 -2016 + [Bug 3758] Provide a 'device' config statement for refclocks + - regenerated + + ntpd/ntp_parser.h@1.80 +421 -402 + [Bug 3758] Provide a 'device' config statement for refclocks + - regenerated + + ntpd/ntp_parser.y@1.106 +44 -0 + [Bug 3758] Provide a 'device' config statement for refclocks + - add grammar supoort for 'device' statement + + ntpd/ntp_ppsdev.c@1.4 +16 -3 + [Bug 3758] Provide a 'device' config statement for refclocks + - have 'ppsdev_reopen()' lookup alternative device names, too + - unclutter include + + ntpd/ntp_refclock.c@1.126.3.1 +56 -2 + [Bug 3758] Provide a 'device' config statement for refclocks + - add conversion between symbolic and numeric baud rates + - log open of refclock devices + + ntpd/refclock_acts.c@1.54.1.1 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_arbiter.c@1.20.1.1 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_arc.c@1.34 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_as2201.c@1.16.1.1 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_chronolog.c@1.13 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_chu.c@1.59 +2 -2 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_dumbclock.c@1.18.1.1 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_fg.c@1.16 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_heath.c@1.19.1.1 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_hopfser.c@1.17.1.1 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_hpgps.c@1.16.1.1 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_jjy.c@1.38 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_jupiter.c@1.35 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_mx4200.c@1.32 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_neoclock4x.c@1.24 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_nmea.c@1.79.2.3 +3 -15 + [Bug 3758] Provide a 'device' config statement for refclocks + - let refclock_open() do the logging + - 'refclock_open()' API change + + ntpd/refclock_oncore.c@1.104.1.3 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_palisade.c@1.46.1.4 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_parse.c@1.89.1.1 +16 -2 + [Bug 3758] Provide a 'device' config statement for refclocks + - use new refclock_open() API + + ntpd/refclock_pst.c@1.14 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_ripencc.c@1.19 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_true.c@1.25.1.2 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_ulink.c@1.20 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_wwvb.c@1.36 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ntpd/refclock_zyfer.c@1.12 +1 -1 + [Bug 3758] Provide a 'device' config statement for refclocks + - 'refclock_open()' API change + + ports/winnt/libntp/termios.c@1.35 +16 -2 + [Bug 3758] Provide a 'device' config statement for refclocks + - new refclock_open() signature + - add device name lookup callback + - support '\\.\COMxxx' windows device name space + + ports/winnt/vs2005/ntpd.vcproj@1.24 +22 -0 + [Bug 3758] Provide a 'device' config statement for refclocks + - add 'ntp_clockdev.c' to project + + ports/winnt/vs2008/ntpd/ntpd.vcproj@1.54 +4 -0 + [Bug 3758] Provide a 'device' config statement for refclocks + - add 'ntp_clockdev.c' to project + + ports/winnt/vs2013/ntpd/ntpd.vcxproj@1.12 +1 -0 + [Bug 3758] Provide a 'device' config statement for refclocks + - add 'ntp_clockdev.c' to project + + ports/winnt/vs2013/ntpd/ntpd.vcxproj.filters@1.9 +3 -0 + [Bug 3758] Provide a 'device' config statement for refclocks + - add 'ntp_clockdev.c' to project + + ports/winnt/vs2015/ntpd/ntpd.vcxproj@1.2.1.2 +1 -0 + [Bug 3758] Provide a 'device' config statement for refclocks + - add 'ntp_clockdev.c' to project + + ports/winnt/vs2015/ntpd/ntpd.vcxproj.filters@1.4 +3 -0 + [Bug 3758] Provide a 'device' config statement for refclocks + - add 'ntp_clockdev.c' to project + +ChangeSet@1.3912.19.4, 2022-03-27 10:21:50+02:00, perlinger@ntp.org + [bug 3757] final cleanup + + ntpd/ntp_ppsdev.c@1.3 +79 -49 + [bug 3757] final cleanup + +ChangeSet@1.3912.19.3, 2022-03-13 08:38:51+01:00, perlinger@ntp.org + [Bug 3757] Improve handling of Linux-PPS in NTPD + cleanup + + include/ntp_refclock.h@1.38.1.5 +4 -6 + [Bug 3757] Improve handling of Linux-PPS in NTPD + + ntpd/ntp_ppsdev.c@1.2 +33 -7 + [Bug 3757] Improve handling of Linux-PPS in NTPD + + ntpd/refclock_nmea.c@1.79.2.2 +9 -26 + [Bug 3757] Improve handling of Linux-PPS in NTPD + + ntpd/refclock_oncore.c@1.104.1.2 +2 -2 + indent cleanup + + ports/winnt/vs2005/ntpd.vcproj@1.23 +22 -0 + [Bug 3757] Improve handling of Linux-PPS in NTPD + + ports/winnt/vs2008/ntpd/ntpd.vcproj@1.53 +4 -0 + [Bug 3757] Improve handling of Linux-PPS in NTPD + + ports/winnt/vs2013/ntpd/ntpd.vcxproj@1.11 +2 -1 + [Bug 3757] Improve handling of Linux-PPS in NTPD + + ports/winnt/vs2013/ntpd/ntpd.vcxproj.filters@1.8 +4 -1 + [Bug 3757] Improve handling of Linux-PPS in NTPD + + ports/winnt/vs2015/ntpd/ntpd.vcxproj@1.2.1.1 +2 -1 + [Bug 3757] Improve handling of Linux-PPS in NTPD + + ports/winnt/vs2015/ntpd/ntpd.vcxproj.filters@1.3 +4 -1 + [Bug 3757] Improve handling of Linux-PPS in NTPD + +ChangeSet@1.3912.19.2, 2022-03-07 07:54:01+01:00, perlinger@ntp.org + [Bug 3757] Improve handling of Linux-PPS in NTPD + + ChangeLog@1.1986.19.2 +1 -0 + [Bug 3757] Improve handling of Linux-PPS in NTPD + + configure.ac@1.619.2.1 +20 -0 + [Bug 3757] Improve handling of Linux-PPS in NTPD + - add '--enable-magicpps' with default=yes to config options + - check for the necessary functions to implement it + + include/ntp_refclock.h@1.38.1.4 +6 -0 + [Bug 3757] Improve handling of Linux-PPS in NTPD + - add prototype for 'ppsdev_open()' function + + ntpd/Makefile.am@1.138.1.1 +1 -0 + [Bug 3757] Improve handling of Linux-PPS in NTPD + + ntpd/ntp_ppsdev.c@1.1 +384 -0 + [Bug 3757] Improve handling of Linux-PPS in NTPD + - implement 'ppsdev_open()' function + - implement tty<-->pps mapping for Linux + - implement 'magic' pps instantiation for Linux + + ntpd/ntp_ppsdev.c@1.0 +0 -0 + + ntpd/refclock_nmea.c@1.79.2.1 +33 -16 + [Bug 3757] Improve handling of Linux-PPS in NTPD + +ChangeSet@1.3912.19.1, 2022-01-16 11:35:06+01:00, perlinger@ntp.org + [Bug 3741] 4.2.8p15 can't build with glibc 2.34 + PTHREAD stack sizes can be runtime variant, so make all size adjustments + runtime checks (as opposed to the compile time checks they were before) + + ChangeLog@1.1986.19.1 +3 -0 + [Bug 3741] 4.2.8p15 can't build with glibc 2.34 + + libntp/work_thread.c@1.23.1.1 +18 -15 + [Bug 3741] 4.2.8p15 can't build with glibc 2.34 + PTHREAD stack sizes can be runtime variant, so make all size adjustments + runtime checks (as opposed to the compile time checks they were before) + +ChangeSet@1.3912.18.1, 2021-03-14 09:31:22+01:00, perlinger@ntp.org + [Bug 3724] ntp-keygen with openSSL 1.1.1 fails on Windows + + ChangeLog@1.1986.18.1 +4 -0 + [Bug 3724] ntp-keygen with openSSL 1.1.1 fails on Windows + + include/ssl_applink.c@1.7 +1 -1 + [Bug 3724] ntp-keygen with openSSL 1.1.1 fails on Windows + - omit openssl/applink.c only for openSSL-1.1.0 (was giving linker trouble there) + +ChangeSet@1.3931, 2020-12-10 02:41:35-08:00, harlan@max-e0.pfcs.com + Lose a gmake construct in ntpd/Makefile.am + + ChangeLog@1.2004 +1 -0 + Lose a gmake construct in ntpd/Makefile.am + + ntpd/Makefile.am@1.139 +9 -9 + Lose a gmake construct in ntpd/Makefile.am + +ChangeSet@1.3912.17.2, 2020-11-29 16:31:39+01:00, perlinger@ntp.org + [Bug 3699] Problems handling drift file and restoring previous drifts + - a bit of cleanup on command line option locking + + ChangeLog@1.1986.17.1 +6 -0 + [Bug 3699] Problems handling drift file and restoring previous drifts + + ntpd/ntp_util.c@1.122 +39 -40 + [Bug 3699] Problems handling drift file and restoring previous drifts + - a bit of cleanup on command line option locking + +ChangeSet@1.3912.17.1, 2020-11-29 10:41:07+01:00, perlinger@ntp.org + [Bug 3699] Problems handling drift file and restoring previous drifts + - command line options override config statements where applicable + - make initial frequency settings idempotent and reversible + - make sure kernel PLL gets a revovered drift componsation + + include/ntp.h@1.234 +1 -0 + [Bug 3699] Problems handling drift file and restoring previous drifts + - support removing an initial drift spec from loop filter + + ntpd/cmd_args.c@1.64 +3 -3 + [Bug 3699] Problems handling drift file and restoring previous drifts + - tag calls to 'stats_config()' as coming from command line + + ntpd/ntp_config.c@1.377 +2 -4 + [Bug 3699] Problems handling drift file and restoring previous drifts + - avoid memory leaks with driftfile specs, and let cleanup/override be done in 'stats_config()' + + ntpd/ntp_loopfilter.c@1.196 +11 -1 + [Bug 3699] Problems handling drift file and restoring previous drifts + - support removing an initial drift spec from loop filter + - make sure kernel PLL starts with proper initial drift if given + + ntpd/ntp_util.c@1.121 +53 -9 + [Bug 3699] Problems handling drift file and restoring previous drifts + - make sure command line options have precedence over corresponding config options + +ChangeSet@1.3912.15.2, 2020-10-26 08:30:46+01:00, perlinger@ntp.org + [Bug 3677] additional peer events not decoded in associations listing + - add numeric formatting to default branch + + ChangeLog@1.1986.15.2 +1 -1 + [Bug 3677] additional peer events not decoded in associations listing + - add numeric formatting to default branch + + ntpq/ntpq-subs.c@1.133 +3 -1 + [Bug 3677] additional peer events not decoded in associations listing + - add numeric formatting to default branch + +ChangeSet@1.3912.16.1, 2020-10-26 07:58:13+01:00, perlinger@ntp.org + [Bug 3674] ntpq command 'execute only' using '~' prefix + + ChangeLog@1.1986.16.1 +4 -0 + [Bug 3674] ntpq command 'execute only' using '~' prefix + + ntpq/ntpq.c@1.192.2.1 +19 -0 + [Bug 3674] ntpq command 'execute only' using '~' prefix + +ChangeSet@1.3912.15.1, 2020-10-26 07:38:57+01:00, perlinger@ntp.org + [Bug 3677] additional peer events not decoded in associations listing + + ChangeLog@1.1986.15.1 +4 -0 + [Bug 3677] additional peer events not decoded in associations listing + + ntpq/ntpq-subs.c@1.132 +16 -0 + [Bug 3677] additional peer events not decoded in associations listing + +ChangeSet@1.3927, 2020-10-25 12:25:51+01:00, perlinger@ntp.org + [mysterious problem] disable realpath() resolving of /dev/std* links + + tests/libntp/realpath.c@1.3 +9 -0 + [mysterious problem] disable realpath() resolving of /dev/std* links + +ChangeSet@1.3912.14.2, 2020-10-25 08:43:17+01:00, perlinger@ntp.org + [bug 3432] backport to 4.2.8-p15 + - check 'write' for daemon wait pipe + + ntpd/ntp_proto.c@1.438 +2 -1 + [bug 3432] backport to 4.2.8-p15 + - check 'write' for daemon wait pipe + + ntpd/ntpd.c@1.185.1.1 +4 -2 + [bug 3432] backport to 4.2.8-p15 + - check 'write' for daemon wait pipe + +ChangeSet@1.3912.13.1, 2020-10-24 08:52:24+02:00, perlinger@ntp.org + [Bug 3682] Fixes for warnings when compiled without OpenSSL + + ChangeLog@1.1986.13.1 +4 -0 + [Bug 3682] Fixes for warnings when compiled without OpenSSL + + libntp/a_md5encrypt.c@1.52.1.1 +14 -12 + [Bug 3682] Fixes for warnings when compiled without OpenSSL + + ntpd/ntp_control.c@1.239 +8 -2 + [Bug 3682] Fixes for warnings when compiled without OpenSSL + + ntpd/ntpd.c@1.186 +1 -2 + [Bug 3682] Fixes for warnings when compiled without OpenSSL + + ntpq/ntpq.c@1.192.1.1 +5 -3 + [Bug 3682] Fixes for warnings when compiled without OpenSSL + + sntp/crypto.c@1.41 +15 -11 + [Bug 3682] Fixes for warnings when compiled without OpenSSL + +ChangeSet@1.3912.12.1, 2020-10-24 07:49:18+02:00, perlinger@ntp.org + [Bug 3687] ntp_crypto_rand RNG status not known + + ChangeLog@1.1986.12.1 +4 -0 + [Bug 3687] ntp_crypto_rand RNG status not known + + libntp/ntp_crypto_rnd.c@1.5 +23 -6 + [Bug 3687] ntp_crypto_rand RNG status not known + +ChangeSet@1.3923, 2020-10-21 02:36:52-04:00, stenn@psp-deb2.ntp.org + ChangeLog tweak + + ChangeLog@1.1997 +1 -0 + ChangeLog tweak + +ChangeSet@1.3914, 2020-10-20 07:35:29+00:00, stenn@psp-deb1.ntp.org + cleanup + + ChangeLog@1.1988 +1 -0 + cleanup + +ChangeSet@1.3912.5.4, 2020-10-20 07:12:32+00:00, stenn@psp-deb1.ntp.org + typo + + sntp/m4/realpath.m4@1.2 +1 -1 + typo + +ChangeSet@1.3912.11.1, 2020-10-20 06:48:48+02:00, perlinger@ntp.org + [Bug 3693] Improvement of error handling key lengths + + ChangeLog@1.1986.11.1 +4 -0 + [Bug 3693] Improvement of error handling key lengths + + include/ntp_stdlib.h@1.86.3.1 +1 -1 + [Bug 3693] Improvement of error handling key lengths + + libntp/a_md5encrypt.c@1.53 +4 -2 + [Bug 3693] Improvement of error handling key lengths + + libntp/authkeys.c@1.41.1.1 +1 -1 + [Bug 3693] Improvement of error handling key lengths + + tests/libntp/a_md5encrypt.c@1.17 +4 -3 + [Bug 3693] Improvement of error handling key lengths + + tests/libntp/run-a_md5encrypt.c@1.18 +5 -5 + [Bug 3693] Improvement of error handling key lengths + - auto-regenerated + +ChangeSet@1.3912.10.2, 2020-10-19 20:27:38+02:00, perlinger@ntp.org + [Bug 3689] Extension for MD5, SHA-1 and other keys + - enum for password encoding, symdef for secret size + - update docs + + html/authentic.html@1.19 +8 -7 + [Bug 3689] Extension for MD5, SHA-1 and other keys + - update docs + + html/ntpdc.html@1.40 +2 -1 + [Bug 3689] Extension for MD5, SHA-1 and other keys + - update docs + + html/ntpq.html@1.53 +2 -1 + [Bug 3689] Extension for MD5, SHA-1 and other keys + - update docs + + include/ntp_stdlib.h@1.86.2.2 +8 -4 + [Bug 3689] Extension for MD5, SHA-1 and other keys + - enum for password encoding, symdef for secret size + + libntp/authkeys.c@1.43 +14 -14 + [Bug 3689] Extension for MD5, SHA-1 and other keys + - enum for password encoding, symdef for secret size + + libntp/authreadkeys.c@1.35 +1 -1 + [Bug 3689] Extension for MD5, SHA-1 and other keys + - enum for password encoding, symdef for secret size + + libntp/authusekey.c@1.13 +3 -3 + [Bug 3689] Extension for MD5, SHA-1 and other keys + - enum for password encoding, symdef for secret size + +ChangeSet@1.3912.10.1, 2020-10-19 08:15:03+02:00, perlinger@ntp.org + [Bug 3689] Extension for MD5, SHA-1 and other keys + - refactor decoding a passwd string / secret + - have ntp{q,dc} use the same password decoding ntpd uses + + ChangeLog@1.1986.10.1 +6 -0 + [Bug 3689] Extension for MD5, SHA-1 and other keys + + include/ntp_stdlib.h@1.86.2.1 +5 -0 + [Bug 3689] Extension for MD5, SHA-1 and other keys + - refactor decoding a passwd string / secret + + libntp/authkeys.c@1.42 +92 -0 + [Bug 3689] Extension for MD5, SHA-1 and other keys + + libntp/authreadkeys.c@1.34 +33 -46 + [Bug 3689] Extension for MD5, SHA-1 and other keys + - refactor decoding a passwd string / secret + + libntp/authusekey.c@1.12 +10 -10 + [Bug 3689] Extension for MD5, SHA-1 and other keys + - have ntp{q,dc} use the same password decoding ntpd uses + +ChangeSet@1.3912.9.1, 2020-10-18 07:23:45+02:00, perlinger@ntp.org + [Bug 3690] newline in ntp clock variable + + ChangeLog@1.1986.9.1 +4 -0 + [Bug 3690] newline in ntp clock variable + + ntpd/refclock_parse.c@1.90 +1 -1 + [Bug 3690] newline in ntp clock variable + +ChangeSet@1.3912.8.1, 2020-10-17 16:06:54+02:00, perlinger@ntp.org + [Bug 3694] NMEA refclock appears to unnecessarily require location in messages + - add/describe 'ignore receiver status' bit + + ChangeLog@1.1986.8.1 +5 -0 + [Bug 3694] NMEA refclock appears to unnecessarily require location in messages + + html/drivers/driver20.html@1.35 +10 -1 + [Bug 3694] NMEA refclock appears to unnecessarily require location in messages + - add/describe 'ignore receiver status' bit + + ntpd/refclock_nmea.c@1.79.1.7 +6 -0 + [Bug 3694] NMEA refclock appears to unnecessarily require location in messages + - add/describe 'ignore receiver status' bit + +ChangeSet@1.3912.6.3, 2020-10-17 10:39:53+02:00, perlinger@ntp.org + [Bug 3692] /dev/gpsN requirement prevents KPPS + - implement 'ntp_realpath()' for windows, too + - increase path buffer for unit tests + + libntp/ntp_realpath.c@1.2 +42 -36 + [Bug 3692] /dev/gpsN requirement prevents KPPS + - implement 'ntp_realpath()' for windows, too + + libntp/xsbprintf.c@1.3 +3 -3 + [Bug 3692] /dev/gpsN requirement prevents KPPS + - sidekick: bad indentations + + ports/winnt/vs2005/libntp.vcproj@1.29 +4 -0 + [Bug 3692] /dev/gpsN requirement prevents KPPS + - implement 'ntp_realpath()' for windows, too + + ports/winnt/vs2008/libntp/libntp.vcproj@1.60 +11 -7 + [Bug 3692] /dev/gpsN requirement prevents KPPS + - implement 'ntp_realpath()' for windows, too + + ports/winnt/vs2013/libntp/libntp.vcxproj@1.16 +3 -2 + [Bug 3692] /dev/gpsN requirement prevents KPPS + - implement 'ntp_realpath()' for windows, too + + ports/winnt/vs2013/libntp/libntp.vcxproj.filters@1.14 +5 -2 + [Bug 3692] /dev/gpsN requirement prevents KPPS + - implement 'ntp_realpath()' for windows, too + + ports/winnt/vs2015/libntp/libntp.vcxproj@1.6 +3 -2 + [Bug 3692] /dev/gpsN requirement prevents KPPS + - implement 'ntp_realpath()' for windows, too + + ports/winnt/vs2015/libntp/libntp.vcxproj.filters@1.6 +5 -2 + [Bug 3692] /dev/gpsN requirement prevents KPPS + - implement 'ntp_realpath()' for windows, too + + tests/libntp/realpath.c@1.2 +2 -2 + Bug 3692 - /dev/gpsN requirement prevents KPPS + increase path buffer for unit tests + +ChangeSet@1.3912.6.2, 2020-10-16 08:11:40+02:00, perlinger@ntp.org + [Bug 3692] /dev/gpsN requirement prevents KPPS + - first unit tests (not applicable for windows so far) + + tests/libntp/Makefile.am@1.101 +12 -0 + [Bug 3692] /dev/gpsN requirement prevents KPPS + - first unit tests (not applicable for windows so far) + + tests/libntp/realpath.c@1.1 +85 -0 + [Bug 3692] /dev/gpsN requirement prevents KPPS + - first unit tests (not applicable for windows so far) + + tests/libntp/realpath.c@1.0 +0 -0 + + tests/libntp/run-realpath.c@1.1 +70 -0 + [Bug 3692] /dev/gpsN requirement prevents KPPS + - first unit tests (not applicable for windows so far) + + tests/libntp/run-realpath.c@1.0 +0 -0 + +ChangeSet@1.3912.7.2, 2020-10-15 20:29:32+02:00, perlinger@ntp.org + [Bug 3688] GCC 10 build errors in testsuite + - fix the real issue -- 'progname' defined in wrong file + + sntp/log.c@1.26 +1 -3 + [Bug 3688] GCC 10 build errors in testsuite + - fix the real issue -- 'progname' defined in wrong file + + sntp/main.c@1.106 +1 -0 + [Bug 3688] GCC 10 build errors in testsuite + - fix the real issue -- 'progname' defined in wrong file + + sntp/tests/t-log.c@1.9 +0 -1 + [Bug 3688] GCC 10 build errors in testsuite + - fix the real issue -- 'progname' defined in wrong file + +ChangeSet@1.3912.7.1, 2020-10-15 08:39:12+02:00, perlinger@ntp.org + [Bug 3688] GCC 10 build errors in testsuite + + ChangeLog@1.1986.7.1 +3 -0 + [Bug 3688] GCC 10 build errors in testsuite + + sntp/log.c@1.25 +2 -0 + [Bug 3688] GCC 10 build errors in testsuite + - skip local definition of 'progname' in sntp/log.c when running unit tests + + sntp/tests/t-log.c@1.8 +1 -1 + [Bug 3688] GCC 10 build errors in testsuite + - skip local definition of 'progname' in sntp/log.c when running unit tests + +ChangeSet@1.3912.6.1, 2020-10-14 18:40:09+02:00, perlinger@ntp.org + [Bug 3692] /dev/gpsN requirement prevents KPPS + - resolve symlinks in device names for GPSD_JSON driver + + ChangeLog@1.1986.6.1 +5 -0 + [Bug 3692] /dev/gpsN requirement prevents KPPS + - resolve symlinks in device names for GPSD_JSON driver + + configure.ac@1.619.1.1 +1 -0 + [Bug 3692] /dev/gpsN requirement prevents KPPS + - Implement NTP_FUNC_REALPATH + + include/ntp_stdlib.h@1.86.1.3 +2 -0 + [Bug 3692] /dev/gpsN requirement prevents KPPS + - implement wrapper for 'realpath()' + + libntp/Makefile.am@1.85 +1 -0 + [Bug 3692] /dev/gpsN requirement prevents KPPS + - add 'realpath()' wrapper + + libntp/ntp_realpath.c@1.1 +273 -0 + -[Bug 3692] /dev/gpsN requirement prevents KPPS + - implement wrapper around 'realpath()' or a replacement plugged from FreeBSD + + libntp/ntp_realpath.c@1.0 +0 -0 + + ntpd/refclock_gpsdjson.c@1.28.2.1 +20 -5 + [Bug 3692] /dev/gpsN requirement prevents KPPS + - use 'ntp_realpath()' to resolve symlinks + + ntpsnmpd/ntpsnmpd.c@1.11 +1 -1 + [Bug 3692] /dev/gpsN requirement prevents KPPS + - sidekick: remove indentation warning + + sntp/m4/realpath.m4@1.1 +49 -0 + [Bug 3692] /dev/gpsN requirement prevents KPPS + autoconf: test for POSIX-2008 compliant 'realpath()' + + sntp/m4/realpath.m4@1.0 +0 -0 + +ChangeSet@1.3912.5.2, 2020-10-14 06:15:18+00:00, stenn@psp-deb1.ntp.org + fix typos + + sntp/m4/realpath.m4@1.2 +4 -5 + fix typos + +ChangeSet@1.3912.5.1, 2020-10-14 05:52:43+00:00, stenn@psp-deb1.ntp.org + Implement NTP_FUNC_REALPATH + + ChangeLog@1.1986.5.1 +4 -0 + Implement NTP_FUNC_REALPATH + + configure.ac@1.620 +1 -0 + Implement NTP_FUNC_REALPATH + + sntp/m4/realpath.m4@1.1 +50 -0 + BitKeeper file sntp/m4/realpath.m4 + + sntp/m4/realpath.m4@1.0 +0 -0 + +ChangeSet@1.3912.4.1, 2020-10-12 08:01:45+02:00, perlinger@ntp.org + [Bug 3691] Buffer Overflow reading GPSD output + + ChangeLog@1.1986.4.1 +5 -0 + [Bug 3691] Buffer Overflow reading GPSD output + + ntpd/refclock_gpsdjson.c@1.28.1.3 +2 -2 + [Bug 3691] Buffer Overflow reading GPSD output + - fixed bad buffer end calculation + - increased max PDU size + +ChangeSet@1.3912.3.1, 2020-07-20 07:35:48+02:00, perlinger@ntp.org + [Bug 3666] avoid unlimited receive buffer allocation + - follow-up: fix inverted sense in check, reset shortfall counter + + ChangeLog@1.1986.3.1 +4 -0 + [Bug 3666] avoid unlimited receive buffer allocation + - follow-up: fix inverted sense in check, reset shortfall counter + + libntp/recvbuff.c@1.45 +5 -4 + [Bug 3666] avoid unlimited receive buffer allocation + - follow-up: fix inverted sense in check, reset shortfall counter + +ChangeSet@1.3912.2.1, 2020-07-18 08:33:48+02:00, perlinger@ntp.org + [Bug 3675] ntpq ccmds[] stores pointer to non-persistent storage + [Bug 3676] compiler warnings (CMAC, interrupt_buf, typo, fallthrough) + + ChangeLog@1.1986.2.1 +5 -0 + [Bug 3675] ntpq ccmds[] stores pointer to non-persistent storage + [Bug 3676] compiler warnings (CMAC, interrupt_buf, typo, fallthrough) + + ntpq/ntpq.c@1.193 +80 -67 + [Bug 3675] ntpq ccmds[] stores pointer to non-persistent storage + [Bug 3676] compiler warnings (CMAC, interrupt_buf, typo, fallthrough) + + sntp/libevent/evdns.c@1.11 +1 -0 + [Bug 3675] ntpq ccmds[] stores pointer to non-persistent storage + [Bug 3676] compiler warnings (CMAC, interrupt_buf, typo, fallthrough) + +ChangeSet@1.3912.1.1, 2020-06-28 08:39:28+02:00, perlinger@ntp.org + [Bug 3672] fix biased selection in median cut + + ChangeLog@1.1986.1.1 +3 -0 + [Bug 3672] fix biased selection in median cut + + ntpd/ntp_refclock.c@1.126.1.7 +7 -4 + [Bug 3672] fix biased selection in median cut + +ChangeSet@1.3913, 2020-06-24 19:39:47+02:00, perlinger@ntp.org + [Bug 3626] (SNTP) UTC offset calculation needs dst flag + + ChangeLog@1.1987 +4 -0 + [Bug 3626] (SNTP) UTC offset calculation needs dst flag + + sntp/utilities.c@1.21 +15 -10 + [Bug 3626] (SNTP) UTC offset calculation needs dst flag + +ChangeSet@1.3912, 2020-06-23 02:27:53-07:00, ntpreleng@ntp-build.tal1.ntfo.org + typo + + ChangeLog@1.1986 +0 -1 + typo + ChangeSet@1.3911, 2020-06-23 02:22:19-07:00, ntpreleng@ntp-build.tal1.ntfo.org NTP_4_2_8P15 TAG: NTP_4_2_8P15 @@ -622,13 +6197,13 @@ ChangeSet@1.3896.6.2, 2020-04-07 17:48:25+02:00, burnicki@psp-deb1.ntp.org Fix compiling refclock_palisade.c Don't have variable declarations after code. - ntpd/refclock_palisade.c@1.49 +25 -23 + ntpd/refclock_palisade.c@1.46.1.3 +25 -23 Don't have variable declarations after code. ChangeSet@1.3896.6.1, 2020-04-07 17:47:02+02:00, burnicki@psp-deb1.ntp.org Fix prototype in ntpd/refclock_nmea.c - ntpd/refclock_nmea.c@1.85 +1 -1 + ntpd/refclock_nmea.c@1.79.1.6 +1 -1 Fix prototype in ntpd/refclock_nmea.c ChangeSet@1.3896.5.1, 2020-04-05 10:10:12+02:00, perlinger@ntp.org @@ -646,7 +6221,7 @@ ChangeSet@1.3896.4.1, 2020-04-05 09:53:25+02:00, perlinger@ntp.org ChangeLog@1.1974.4.1 +4 -0 [Bug 3653] Refclock jitter RMS calculation - ntpd/ntp_refclock.c@1.132 +36 -36 + ntpd/ntp_refclock.c@1.126.1.6 +36 -36 [Bug 3653] Refclock jitter RMS calculation ChangeSet@1.3896.3.1, 2020-04-04 08:57:51+02:00, perlinger@ntp.org @@ -1535,7 +7110,7 @@ ChangeSet@1.3880, 2020-02-17 08:48:45+00:00, stenn@psp-deb1.ntp.org include/ntp_request.h@1.54 +2 -1 srvfuzrft patches - include/ntp_stdlib.h@1.88 +1 -1 + include/ntp_stdlib.h@1.86.1.2 +1 -1 randomizepoll/server response fuzz reftime fixes include/ntpd.h@1.207 +1 -1 @@ -1578,7 +7153,7 @@ ChangeSet@1.3880, 2020-02-17 08:48:45+00:00, stenn@psp-deb1.ntp.org ntpd/ntp_proto.c@1.427.1.2 +183 -36 bug3596: pollskewlist, server response fuzz, xmtnonce - ntpd/ntp_refclock.c@1.131 +1 -1 + ntpd/ntp_refclock.c@1.126.1.5 +1 -1 pollskew upodates ntpd/ntp_request.c@1.131 +2 -2 @@ -2035,7 +7610,7 @@ ChangeSet@1.3873.2.2, 2020-01-17 06:59:50+01:00, perlinger@ntp.org libntp/ntp_calgps.c@1.4 +31 -20 [Bug 3636] NMEA: combine time/date from multiple sentences - ntpd/refclock_nmea.c@1.84 +158 -97 + ntpd/refclock_nmea.c@1.79.1.5 +158 -97 [Bug 3636] NMEA: combine time/date from multiple sentences ChangeSet@1.3873.3.2, 2020-01-12 07:10:55+01:00, perlinger@ntp.org @@ -2218,7 +7793,7 @@ ChangeSet@1.3871.1.5, 2019-10-03 10:04:23+02:00, perlinger@ntp.org ChangeLog@1.1968.25.3 +1 -0 [Bug 3594] ntpd discards messages coming through nmead - ntpd/refclock_nmea.c@1.83 +110 -28 + ntpd/refclock_nmea.c@1.79.1.4 +110 -28 [Bug 3594] ntpd discards messages coming through nmead - make socket I/O for NMEAD nonblocking - do local line split / record assembly as TCP does not preserve boundaries @@ -2245,7 +7820,7 @@ ChangeSet@1.3870.1.1, 2019-09-21 07:31:44+02:00, perlinger@ntp.org ChangeLog@1.1968.25.1 +1 -0 [Bug 3615] accelerate refclock startup - include/ntp_refclock.h@1.39.1.1 +1 -0 + include/ntp_refclock.h@1.38.2.1 +1 -0 [Bug 3615] accelerate refclock startup - add 'inpoll' flag @@ -2253,12 +7828,12 @@ ChangeSet@1.3870.1.1, 2019-09-21 07:31:44+02:00, perlinger@ntp.org [Bug 3615] accelerate refclock startup - time boxed stepping of sys_poll (avoid quick sys_poll overshoot) - ntpd/ntp_refclock.c@1.128.1.1 +77 -6 + ntpd/ntp_refclock.c@1.126.2.1 +77 -6 [Bug 3615] accelerate refclock startup - check if clock status could benefit from early poll - 'unsolicited' calls to refclock_receive add bits to the reach mask - ntpd/refclock_nmea.c@1.82 +14 -10 + ntpd/refclock_nmea.c@1.79.1.3 +14 -10 [Bug 3615] accelerate refclock startup - minor sidekick: different order of data integrity checks reduces number of clock events during signal dropout @@ -2278,7 +7853,7 @@ ChangeSet@1.3872, 2019-09-13 08:18:14+02:00, perlinger@ntp.org html/drivers/driver29.html@1.18 +68 -10 [Bug 3617] Add support for ACE III and Copernicus II receivers - ntpd/refclock_palisade.c@1.48 +197 -11 + ntpd/refclock_palisade.c@1.46.1.2 +197 -11 [Bug 3617] Add support for ACE III and Copernicus II receivers ntpd/refclock_palisade.h@1.16 +5 -2 @@ -2318,7 +7893,7 @@ ChangeSet@1.3867.1.1, 2019-09-05 22:24:53+02:00, perlinger@ntp.org [Bug 3609] Fixing wrong falseticker in case of non-statistic jitter - implementing 'fudge minjitter' - include/ntp_refclock.h@1.40 +4 -1 + include/ntp_refclock.h@1.38.1.2 +4 -1 [Bug 3609] Fixing wrong falseticker in case of non-statistic jitter - implementing 'fudge minjitter' @@ -2354,7 +7929,7 @@ ChangeSet@1.3867.1.1, 2019-09-05 22:24:53+02:00, perlinger@ntp.org [Bug 3609] Fixing wrong falseticker in case of non-statistic jitter - implementing 'fudge minjitter' - ntpd/ntp_refclock.c@1.129 +19 -0 + ntpd/ntp_refclock.c@1.126.1.3 +19 -0 [Bug 3609] Fixing wrong falseticker in case of non-statistic jitter - implementing 'fudge minjitter' @@ -2380,7 +7955,7 @@ ChangeSet@1.3868, 2019-09-04 21:40:55+02:00, perlinger@ntp.org [Bug 3611] NMEA time interpreted incorrectly - make GPS era folding a runtime decision ("date trust" support) - ntpd/refclock_nmea.c@1.81 +5 -4 + ntpd/refclock_nmea.c@1.79.1.2 +5 -4 [Bug 3611] NMEA time interpreted incorrectly - restore hitherto undocumented "date trust" feature (was lost in [bug 3577]) - move "date trust" to mode bit 18 @@ -2513,7 +8088,7 @@ ChangeSet@1.3844.19.1, 2019-06-04 07:59:30+02:00, perlinger@ntp.org ChangeLog@1.1968.18.1 +4 -0 [Bug 3490] Patch to support Trimble Resolution Receivers - ntpd/refclock_palisade.c@1.47 +45 -1 + ntpd/refclock_palisade.c@1.46.1.1 +45 -1 [Bug 3490] Patch to support Trimble Resolution Receivers - original patch by Richard Steedman - fixed bitwise AND vs boolean AND operation (not a real bug, but confusing) @@ -2683,7 +8258,7 @@ ChangeSet@1.3844.3.10, 2019-05-13 07:44:52+02:00, perlinger@ntp.org libntp/ntp_calgps.c@1.2 +29 -5 [Bug 3590] Update refclock_oncore.c to the new GPS date API - ntpd/refclock_oncore.c@1.105 +54 -2 + ntpd/refclock_oncore.c@1.104.1.1 +54 -2 [Bug 3590] Update refclock_oncore.c to the new GPS date API - use GPS era remapping @@ -2873,7 +8448,7 @@ ChangeSet@1.3844.7.1, 2019-04-28 09:50:11+02:00, perlinger@ntp.org [Bug 3585] Unity tests mix buffered and unbuffered output - regenrated test runner - tests/libntp/run-caljulian.c@1.15 +2 -0 + tests/libntp/run-caljulian.c@1.14.1.1 +2 -0 [Bug 3585] Unity tests mix buffered and unbuffered output - regenrated test runner @@ -3090,7 +8665,7 @@ ChangeSet@1.3844.5.5, 2019-04-23 08:17:58+02:00, perlinger@ntp.org ChangeLog@1.1968.4.1 +3 -0 [Bug 3582] gpsdjson refclock fudgetime1 adjustment is doubled - ntpd/refclock_gpsdjson.c@1.30 +1 -1 + ntpd/refclock_gpsdjson.c@1.28.1.2 +1 -1 [Bug 3582] gpsdjson refclock fudgetime1 adjustment is doubled ChangeSet@1.3844.3.9, 2019-04-22 11:57:53+02:00, perlinger@ntp.org @@ -3152,7 +8727,7 @@ ChangeSet@1.3844.3.7, 2019-04-20 08:38:11+02:00, perlinger@ntp.org ntpd/refclock_jupiter.c@1.33 +312 -409 [Bug 3577] Update refclock_zyfer.c to the new GPS date API - ntpd/refclock_nmea.c@1.80 +434 -703 + ntpd/refclock_nmea.c@1.79.1.1 +434 -703 [Bug 3577] Update refclock_zyfer.c to the new GPS date API - use new API to wrap/warp GPS time stamps - implement silent PPS mode & data expiration @@ -3177,7 +8752,7 @@ ChangeSet@1.3844.3.6, 2019-04-20 08:18:00+02:00, perlinger@ntp.org include/ntp_calgps.h@1.0 +0 -0 - include/ntp_refclock.h@1.39 +20 -9 + include/ntp_refclock.h@1.38.1.1 +20 -9 [Bug 3576] New GPS date function API - filter stage count is power of two now - new functions for buffer handling @@ -3206,7 +8781,7 @@ ChangeSet@1.3844.3.6, 2019-04-20 08:18:00+02:00, perlinger@ntp.org libntp/timespecops.c@1.0 +0 -0 - ntpd/ntp_refclock.c@1.128 +309 -7 + ntpd/ntp_refclock.c@1.126.1.2 +309 -7 [Bug 3576] New GPS date function API - filter stage count is power of two now - new functions for buffer handling @@ -3215,7 +8790,7 @@ ChangeSet@1.3844.3.6, 2019-04-20 08:18:00+02:00, perlinger@ntp.org [Bug 3576] New GPS date function API - side kick: remove unused variables - parseutil/dcfd.c@1.30 +10 -10 + parseutil/dcfd.c@1.29.1.1 +10 -10 [Bug 3576] New GPS date function API - side kick: fix compiler warnings (dprintf is a function and not the same as DPRINTF) @@ -3992,7 +9567,7 @@ ChangeSet@1.3827.11.1, 2018-12-01 12:10:51+01:00, perlinger@ntp.org [Bug 3556] ntp_loopfilter.c snprintf compilation warnings - provide better function for incremental string formatting - include/ntp_stdlib.h@1.87 +3 -0 + include/ntp_stdlib.h@1.86.1.1 +3 -0 [Bug 3556] ntp_loopfilter.c snprintf compilation warnings - provide better API for incremental string formatting @@ -4828,19 +10403,19 @@ ChangeSet@1.3813, 2018-07-03 18:46:27+02:00, perlinger@ntp.org ntpq/ntpq.c@1.188 +10 -13 [Sec 3505] CVE-2018-12327 - Arbitrary Code Execution Vulnerability -ChangeSet@1.3790.6.3, 2018-06-19 13:00:54+02:00, burnicki@pc-martin4.py.meinberg.de +ChangeSet@1.3790.7.3, 2018-06-19 13:00:54+02:00, burnicki@pc-martin4.py.meinberg.de Fixes for ntpdate as discussed in bug #3442. - ChangeLog@1.1920.6.2 +2 -0 + ChangeLog@1.1920.7.2 +2 -0 Fixes for ntpdate as discussed in bug #3442. ntpdate/ntpdate.c@1.101 +96 -73 Fixes for ntpdate as discussed in bug #3442. -ChangeSet@1.3790.6.2, 2018-06-19 12:30:58+02:00, burnicki@pc-martin4.py.meinberg.de +ChangeSet@1.3790.7.2, 2018-06-19 12:30:58+02:00, burnicki@pc-martin4.py.meinberg.de New macro REFID_IS_TEXT(). - ChangeLog@1.1920.6.1 +3 -1 + ChangeLog@1.1920.7.1 +3 -1 New macro REFID_IS_TEXT(). include/ntp.h@1.231 +12 -0 @@ -4849,7 +10424,7 @@ ChangeSet@1.3790.6.2, 2018-06-19 12:30:58+02:00, burnicki@pc-martin4.py.meinberg ntpd/ntp_control.c@1.226.1.2 +6 -7 Use new macro REFID_IS_TEXT(). -ChangeSet@1.3790.6.1, 2018-06-19 11:40:42+02:00, burnicki@pc-martin4.py.meinberg.de +ChangeSet@1.3790.7.1, 2018-06-19 11:40:42+02:00, burnicki@pc-martin4.py.meinberg.de Removed trailing spaces in some files. ntpd/ntp_config.c@1.360.2.1 +9 -9 @@ -5046,7 +10621,7 @@ ChangeSet@1.3797, 2018-04-08 12:17:35+02:00, perlinger@ntp.org [Bug 3461] refclock_shm.c: clear error status on clock recovery - fixed minor (non-functional) regression - ntpd/ntp_refclock.c@1.127 +1 -1 + ntpd/ntp_refclock.c@1.126.1.1 +1 -1 [Bug 3461] refclock_shm.c: clear error status on clock recovery - dont't step 'lastevent' if NOMINAL @@ -5101,17 +10676,25 @@ ChangeSet@1.3795, 2018-04-08 11:07:13+02:00, perlinger@ntp.org - use 'sig{set,long}jmp()' instead of '{set,long}jmp()' when possible - unclutter jumping out of signal handler -ChangeSet@1.3790.5.2, 2018-04-07 09:39:54+00:00, stenn@psp-deb1.ntp.org +ChangeSet@1.3790.3.3, 2018-04-07 13:54:34+02:00, perlinger@ntp.org + [Bug 3432] - refclocks that 'write()' should check the result + - sidekick: unchecked write in async resover code + + libntp/work_thread.c@1.22.1.1 +4 -2 + [Bug 3432] - refclocks that 'write()' should check the result + - sidekick: unchecked write in async resover code + +ChangeSet@1.3790.6.2, 2018-04-07 09:39:54+00:00, stenn@psp-deb1.ntp.org tweak the Changelog - ChangeLog@1.1920.5.2 +1 -0 + ChangeLog@1.1920.6.2 +1 -0 tweak -ChangeSet@1.3790.5.1, 2018-04-07 10:03:14+02:00, jnperlin@hydra.localnet +ChangeSet@1.3790.6.1, 2018-04-07 10:03:14+02:00, jnperlin@hydra.localnet [Bug 2821] minor build issues + bug fixes - ChangeLog@1.1920.5.1 +4 -0 + ChangeLog@1.1920.6.1 +4 -0 [Bug 2821] minor build issues + bug fixes @@ -5139,7 +10722,7 @@ ChangeSet@1.3790.5.1, 2018-04-07 10:03:14+02:00, jnperlin@hydra.localnet [Bug 2821] minor build issues + bug fixes - ntpd/refclock_gpsdjson.c@1.29 +2 -2 + ntpd/refclock_gpsdjson.c@1.28.1.1 +2 -2 [Bug 2821] minor build issues + bug fixes @@ -5147,7 +10730,7 @@ ChangeSet@1.3790.5.1, 2018-04-07 10:03:14+02:00, jnperlin@hydra.localnet [Bug 2821] minor build issues + bug fixes - ntpd/refclock_true.c@1.26 +1 -1 + ntpd/refclock_true.c@1.25.1.1 +1 -1 [Bug 2821] minor build issues + bug fixes @@ -5163,13 +10746,13 @@ ChangeSet@1.3790.5.1, 2018-04-07 10:03:14+02:00, jnperlin@hydra.localnet [Bug 2821] minor build issues + bug fixes -ChangeSet@1.3790.4.1, 2018-03-16 06:37:19+01:00, perlinger@ntp.org +ChangeSet@1.3790.5.1, 2018-03-16 06:37:19+01:00, perlinger@ntp.org [Bug 3471] Check for openssl/[ch]mac.h - cond-compile if CMAC not supported - fix tests when CMAC not available - add #define ENABLE_CMAC support in configure - ChangeLog@1.1920.4.1 +4 -0 + ChangeLog@1.1920.5.1 +4 -0 [Bug 3471] Check for openssl/[ch]mac.h --- Bug 3471: add --enable-cmac support in configure @@ -5219,33 +10802,121 @@ ChangeSet@1.3790.4.1, 2018-03-16 06:37:19+01:00, perlinger@ntp.org [Bug 3471] Check for openssl/[ch]mac.h - fix tests when CMAC not available -ChangeSet@1.3790.3.3, 2018-03-15 23:16:22+00:00, stenn@psp-deb1.ntp.org +ChangeSet@1.3790.4.3, 2018-03-15 23:16:22+00:00, stenn@psp-deb1.ntp.org Bug 3471: add #define ENABLE_CMAC support in configure - ChangeLog@1.1920.3.3 +1 -1 + ChangeLog@1.1920.4.3 +1 -1 Bug 3471: add #define ENABLE_CMAC support in configure configure.ac@1.612 +6 -13 Bug 3471: add #define ENABLE_CMAC support in configure -ChangeSet@1.3790.3.2, 2018-03-15 07:55:58+00:00, stenn@psp-deb1.ntp.org +ChangeSet@1.3790.4.2, 2018-03-15 07:55:58+00:00, stenn@psp-deb1.ntp.org Bug 3471: add --enable-cmac support in configure - ChangeLog@1.1920.3.2 +1 -0 + ChangeLog@1.1920.4.2 +1 -0 Bug 3471: add --enable-cmac support in configure configure.ac@1.611 +18 -0 Bug 3471: add --enable-cmac support in configure -ChangeSet@1.3790.3.1, 2018-03-15 06:55:28+00:00, stenn@psp-deb1.ntp.org +ChangeSet@1.3790.4.1, 2018-03-15 06:55:28+00:00, stenn@psp-deb1.ntp.org [Bug 3471] Check for openssl/[ch]mac.h - ChangeLog@1.1920.3.1 +3 -0 + ChangeLog@1.1920.4.1 +3 -0 [Bug 3471] Check for openssl/[ch]mac.h sntp/m4/ntp_openssl.m4@1.30 +1 -0 [Bug 3471] Check for openssl/[ch]mac.h +ChangeSet@1.3790.3.1, 2018-03-15 06:29:23+01:00, perlinger@ntp.org + [Bug 3432] refclocks that 'write()' should check the result + - also fixed some more compiler warnings + + ChangeLog@1.1920.3.1 +4 -0 + [Bug 3432] refclocks that 'write()' should check the result + + include/ntp_refclock.h@1.39 +6 -0 + [Bug 3432] refclocks that 'write()' should check the result + - add 'refclock_[fd]write()' functions + - define FDWRITE_ERROR + + include/ntp_stdlib.h@1.87 +1 -1 + [Bug 3432] refclocks that 'write()' should check the result + - 'refnumtoa()' arg can be 'const' + + libntp/refnumtoa.c@1.11 +1 -1 + [Bug 3432] refclocks that 'write()' should check the result + - 'refnumtoa()' arg can be 'const' + + ntpd/ntp_refclock.c@1.127 +67 -0 + [Bug 3432] refclocks that 'write()' should check the result + - add 'refclock_[fd]write()' functions + + ntpd/refclock_acts.c@1.55 +9 -19 + [Bug 3432] refclocks that 'write()' should check the result + - use 'refclock_[fd]write()' functions, not 'write()' + + ntpd/refclock_arbiter.c@1.21 +17 -19 + [Bug 3432] refclocks that 'write()' should check the result + - use 'refclock_[fd]write()' functions, not 'write()' + + ntpd/refclock_as2201.c@1.17 +3 -2 + [Bug 3432] refclocks that 'write()' should check the result + - use 'refclock_[fd]write()' functions, not 'write()' + + ntpd/refclock_dumbclock.c@1.19 +1 -7 + [Bug 3432] refclocks that 'write()' should check the result + - use 'refclock_[fd]write()' functions, not 'write()' + + ntpd/refclock_gpsdjson.c@1.29 +1 -1 + [Bug 3432] refclocks that 'write()' should check the result + - comment typo + + ntpd/refclock_heath.c@1.20 +1 -1 + [Bug 3432] refclocks that 'write()' should check the result + - use 'refclock_[fd]write()' functions, not 'write()' + + ntpd/refclock_hopfser.c@1.18 +0 -6 + [Bug 3432] refclocks that 'write()' should check the result + - this clock does not write at all, remove unused defs + + ntpd/refclock_hpgps.c@1.17 +8 -8 + [Bug 3432] refclocks that 'write()' should check the result + - use 'refclock_[fd]write()' functions, not 'write()' + + ntpd/refclock_nmea.c@1.80 +1 -8 + [Bug 3432] refclocks that 'write()' should check the result + - use 'refclock_[fd]write()' functions, not 'write()' + + ntpd/refclock_oncore.c@1.105 +12 -7 + [Bug 3432] refclocks that 'write()' should check the result + - use 'refclock_[fd]write()' functions, not 'write()' + + ntpd/refclock_palisade.c@1.47 +6 -3 + [Bug 3432] refclocks that 'write()' should check the result + - use 'refclock_[fd]write()' functions, not 'write()' + + ntpd/refclock_true.c@1.26 +1 -7 + [Bug 3432] refclocks that 'write()' should check the result + - use 'refclock_[fd]write()' functions, not 'write()' + + parseutil/dcfd.c@1.30 +6 -2 + [Bug 3432] refclocks that 'write()' should check the result + - sidekick: check result of 'fscanf()' and 'daemon()' + + ports/winnt/vs2015/ntpd/ntpd.vcxproj@1.3 +1 -0 + Bug 3432 - refclocks that 'write()' should check the result + - sidekick: refclock_arc warnings on integer const overflow + + tests/libntp/caljulian.c@1.15 +17 -57 + [Bug 3432] refclocks that 'write()' should check the result + - fix warnings and rather mechanic translation from C++ to C + + tests/libntp/run-caljulian.c@1.15 +5 -4 + [Bug 3432] refclocks that 'write()' should check the result + - regenerated file + ChangeSet@1.3790.2.1, 2018-03-12 16:36:51+01:00, perlinger@ntp.org [Bug 3456] Use uintptr_t rather than size_t to store an integer in a pointer diff --git a/Makefile.am b/Makefile.am index 7c95863d8a1d..72c35cb0e45d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -52,7 +52,6 @@ EXTRA_DIST = \ \ conf \ html \ - lib/isc \ libjsmn \ ports \ \ diff --git a/Makefile.in b/Makefile.in index 7353076ae838..4307d8bebee9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -107,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_debug.m4 \ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \ - $(top_srcdir)/sntp/m4/ntp_googletest.m4 \ $(top_srcdir)/sntp/m4/ntp_harden.m4 \ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \ @@ -127,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ + $(top_srcdir)/sntp/m4/realpath.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -173,9 +173,9 @@ am__recursive_targets = \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir dist dist-all distcheck -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)config.h.in + cscope distdir distdir-am dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ + config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. @@ -192,9 +192,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/sntp/libevent/build-aux/ar-lib \ @@ -250,6 +247,8 @@ am__relativize = \ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -271,6 +270,7 @@ CALC_TICKADJ_MS = @CALC_TICKADJ_MS@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CC_NOFORMAT = @CC_NOFORMAT@ CFLAGS = @CFLAGS@ CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@ CFLAGS_NTP = @CFLAGS_NTP@ @@ -280,6 +280,8 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ CPPFLAGS_NTP = @CPPFLAGS_NTP@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ DEFS = @DEFS@ @@ -292,14 +294,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EDITLINE_LIBS = @EDITLINE_LIBS@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ -GTEST_CONFIG = @GTEST_CONFIG@ -GTEST_CPPFLAGS = @GTEST_CPPFLAGS@ -GTEST_CXXFLAGS = @GTEST_CXXFLAGS@ -GTEST_LDFLAGS = @GTEST_LDFLAGS@ -GTEST_LIBS = @GTEST_LIBS@ HAVE_INLINE = @HAVE_INLINE@ HAVE_LEAPSMEARINTERVAL = @HAVE_LEAPSMEARINTERVAL@ HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@ @@ -510,6 +508,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -570,7 +569,6 @@ EXTRA_DIST = \ \ conf \ html \ - lib/isc \ libjsmn \ ports \ \ @@ -619,8 +617,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -761,8 +759,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -845,6 +845,10 @@ dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @@ -887,6 +891,8 @@ distcheck: dist eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) @@ -902,7 +908,7 @@ distcheck: dist $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ @@ -961,7 +967,8 @@ installdirs: installdirs-recursive installdirs-am: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive -install-exec: install-exec-recursive +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive @@ -1064,13 +1071,13 @@ ps-am: uninstall-am: uninstall-local .MAKE: $(am__recursive_targets) all check install install-am \ - install-strip + install-exec install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \ - dist-tarZ dist-xz dist-zip distcheck distclean \ + dist-tarZ dist-xz dist-zip dist-zstd distcheck distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ diff --git a/NEWS b/NEWS index caf9ea664df5..d9d8a0987ab6 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,126 @@ +--- +NTP 4.2.8p16 (Harlan Stenn , 2023 May 30) + +Focus: Security, Bug fixes + +Severity: LOW + +This release: + +- fixes 4 vulnerabilities (3 LOW and 1 None severity), +- fixes 46 bugs +- includes 15 general improvements +- adds support for OpenSSL-3.0 + +Details below: + +* [Sec 3808] Assertion failure in ntpq on malformed RT-11 date +* [Sec 3807] praecis_parse() in the Palisade refclock driver has a + hypothetical input buffer overflow. Reported by ... stenn@ +* [Sec 3806] libntp/mstolfp.c needs bounds checking + - solved numerically instead of using string manipulation +* [Sec 3767] An OOB KoD RATE value triggers an assertion when debug is enabled. + +* [Bug 3819] Updated libopts/Makefile.am was missing NTP_HARD_* values. +* [Bug 3817] Bounds-check "tos floor" configuration. +* [Bug 3814] First poll delay of new or cleared associations miscalculated. + +* [Bug 3802] ntp-keygen -I default identity modulus bits too small for + OpenSSL 3. Reported by rmsh1216@163.com +* [Bug 3801] gpsdjson refclock gps_open() device name mishandled. +* [Bug 3800] libopts-42.1.17 does not compile with Microsoft C. +* [Bug 3799] Enable libopts noreturn compiler advice for MSC. +* [Bug 3797] Windows getaddrinfo w/AI_ADDRCONFIG fails for localhost when + disconnected, breaking ntpq and ntpdc. +* [Bug 3795] pollskewlist documentation uses | when it shouldn't. + - ntp.conf manual page and miscopt.html corrections. +* [Bug 3793] Wrong variable type passed to record_raw_stats(). + - Report and patch by Yuezhen LUAN . +* [Bug 3786] Timer starvation on high-load Windows ntpd. +* [Bug 3784] high-load ntpd on Windows deaf after enough ICMP TTL exceeded. + +* [Bug 3781] log "Unable to listen for broadcasts" for IPv4 +* [Bug 3774] mode 6 packets corrupted in rawstats file + - Reported by Edward McGuire, fix identified by . +* [Bug 3758] Provide a 'device' config statement for refclocks +* [Bug 3757] Improve handling of Linux-PPS in NTPD +* [Bug 3741] 4.2.8p15 can't build with glibc 2.34 +* [Bug 3725] Make copyright of clk_wharton.c compatible with Debian. + Philippe De Muyter +* [Bug 3724] ntp-keygen with openSSL 1.1.1 fails on Windows + - openssl applink needed again for openSSL-1.1.1 +* [Bug 3719] configure.ac checks for closefrom() and getdtablesize() missing. + Reported by Brian Utterback, broken in 2010 by +* [Bug 3699] Problems handling drift file and restoring previous drifts + - command line options override config statements where applicable + - make initial frequency settings idempotent and reversible + - make sure kernel PLL gets a recovered drift componsation +* [Bug 3695] Fix memory leak with ntpq on Windows Server 2019 +* [Bug 3694] NMEA refclock seems to unnecessarily require location in messages + - misleading title; essentially a request to ignore the receiver status. + Added a mode bit for this. +* [Bug 3693] Improvement of error handling key lengths + - original patch by Richard Schmidt, with mods & unit test fixes +* [Bug 3692] /dev/gpsN requirement prevents KPPS + - implement/wrap 'realpath()' to resolve symlinks in device names +* [Bug 3691] Buffer Overflow reading GPSD output + - original patch by matt + - increased max PDU size to 4k to avoid truncation +* [Bug 3690] newline in ntp clock variable (parse) + - patch by Frank Kardel +* [Bug 3689] Extension for MD5, SHA-1 and other keys + - ntp{q,dc} now use the same password processing as ntpd does in the key + file, so having a binary secret >= 11 bytes is possible for all keys. + (This is a different approach to the problem than suggested) +* [Bug 3688] GCC 10 build errors in testsuite +* [Bug 3687] ntp_crypto_rand RNG status not known + - patch by Gerry Garvey +* [Bug 3682] Fixes for warnings when compiled without OpenSSL + - original patch by Gerry Garvey +* [Bug 3677] additional peer events not decoded in associations listing + - original patch by Gerry Garvey +* [Bug 3676] compiler warnings (CMAC, interrupt_buf, typo, fallthrough) + - applied patches by Gerry Garvey +* [Bug 3675] ntpq ccmds[] stores pointer to non-persistent storage +* [Bug 3674] ntpq command 'execute only' using '~' prefix + - idea+patch by Gerry Garvey +* [Bug 3672] fix biased selection in median cut +* [Bug 3666] avoid unlimited receive buffer allocation + - follow-up: fix inverted sense in check, reset shortfall counter +* [Bug 3660] Revert 4.2.8p15 change to manycast. +* [Bug 3640] document "discard monitor" and fix the code. + - fixed bug identified by Edward McGuire +* [Bug 3626] (SNTP) UTC offset calculation needs dst flag + - applied patch by Gerry Garvey +* [Bug 3432] refclocks that 'write()' should check the result + - backport from -dev, plus some more work on warnings for unchecked results +* [Bug 3428] ntpd spinning consuming CPU on Linux router with full table. + Reported by Israel G. Lugo. +* [Bug 3103] libopts zsave_warn format string too few arguments +* [Bug 2990] multicastclient incorrectly causes bind to broadcast address. + Integrated patch from Brian Utterback. +* [Bug 2525] Turn on automake subdir-objects across the project. +* [Bug 2410] syslog an error message on panic exceeded. +* Use correct rounding in mstolfp(). perlinger/hart +* M_ADDF should use u_int32. +* Only define tv_fmt_libbuf() if we will use it. +* Use recv_buffer instead of the longer recv_space.X_recv_buffer. hart/stenn +* Make sure the value returned by refid_str() prints cleanly. +* If DEBUG is enabled, the startup banner now says that debug assertions + are in force and that ntpd will abort if any are violated. +* syslog valid incoming KoDs. +* Rename a poorly-named variable. +* Disable "embedded NUL in string" messages in libopts, when we can. +* Use https in the AC_INIT URLs in configure.ac. +* Implement NTP_FUNC_REALPATH. +* Lose a gmake construct in ntpd/Makefile.am. +* upgrade to: autogen-5.18.16 +* upgrade to: libopts-42.1.17 +* upgrade to: autoconf-2.71 +* upgrade to: automake-1.16.15 +* Upgrade to libevent-2.1.12-stable +* Support OpenSSL-3.0 + --- NTP 4.2.8p15 (Harlan Stenn , 2020 Jun 23) diff --git a/aclocal.m4 b/aclocal.m4 index ec9f3a527ca3..6d97d06e2a52 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,127 +14,13 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, +[m4_warning([this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# longlong.m4 serial 17 -dnl Copyright (C) 1999-2007, 2009-2016 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Paul Eggert. - -# Define HAVE_LONG_LONG_INT if 'long long int' works. -# This fixes a bug in Autoconf 2.61, and can be faster -# than what's in Autoconf 2.62 through 2.68. - -# Note: If the type 'long long int' exists but is only 32 bits large -# (as on some very old compilers), HAVE_LONG_LONG_INT will not be -# defined. In this case you can treat 'long long int' like 'long int'. - -AC_DEFUN([AC_TYPE_LONG_LONG_INT], -[ - AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) - AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], - [ac_cv_type_long_long_int=yes - if test "x${ac_cv_prog_cc_c99-no}" = xno; then - ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int - if test $ac_cv_type_long_long_int = yes; then - dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. - dnl If cross compiling, assume the bug is not important, since - dnl nobody cross compiles for this platform as far as we know. - AC_RUN_IFELSE( - [AC_LANG_PROGRAM( - [[@%:@include - @%:@ifndef LLONG_MAX - @%:@ define HALF \ - (1LL << (sizeof (long long int) * CHAR_BIT - 2)) - @%:@ define LLONG_MAX (HALF - 1 + HALF) - @%:@endif]], - [[long long int n = 1; - int i; - for (i = 0; ; i++) - { - long long int m = n << i; - if (m >> i != n) - return 1; - if (LLONG_MAX / 2 < m) - break; - } - return 0;]])], - [], - [ac_cv_type_long_long_int=no], - [:]) - fi - fi]) - if test $ac_cv_type_long_long_int = yes; then - AC_DEFINE([HAVE_LONG_LONG_INT], [1], - [Define to 1 if the system has the type 'long long int'.]) - fi -]) - -# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. -# This fixes a bug in Autoconf 2.61, and can be faster -# than what's in Autoconf 2.62 through 2.68. - -# Note: If the type 'unsigned long long int' exists but is only 32 bits -# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT -# will not be defined. In this case you can treat 'unsigned long long int' -# like 'unsigned long int'. - -AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], -[ - AC_CACHE_CHECK([for unsigned long long int], - [ac_cv_type_unsigned_long_long_int], - [ac_cv_type_unsigned_long_long_int=yes - if test "x${ac_cv_prog_cc_c99-no}" = xno; then - AC_LINK_IFELSE( - [_AC_TYPE_LONG_LONG_SNIPPET], - [], - [ac_cv_type_unsigned_long_long_int=no]) - fi]) - if test $ac_cv_type_unsigned_long_long_int = yes; then - AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], - [Define to 1 if the system has the type 'unsigned long long int'.]) - fi -]) - -# Expands to a C program that can be used to test for simultaneous support -# of 'long long' and 'unsigned long long'. We don't want to say that -# 'long long' is available if 'unsigned long long' is not, or vice versa, -# because too many programs rely on the symmetry between signed and unsigned -# integer types (excluding 'bool'). -AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET], -[ - AC_LANG_PROGRAM( - [[/* For now, do not test the preprocessor; as of 2007 there are too many - implementations with broken preprocessors. Perhaps this can - be revisited in 2012. In the meantime, code should not expect - #if to work with literals wider than 32 bits. */ - /* Test literals. */ - long long int ll = 9223372036854775807ll; - long long int nll = -9223372036854775807LL; - unsigned long long int ull = 18446744073709551615ULL; - /* Test constant expressions. */ - typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) - ? 1 : -1)]; - typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 - ? 1 : -1)]; - int i = 63;]], - [[/* Test availability of runtime routines for shift and division. */ - long long int llmax = 9223372036854775807ll; - unsigned long long int ullmax = 18446744073709551615ull; - return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) - | (llmax / ll) | (llmax % ll) - | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) - | (ullmax / ull) | (ullmax % ull));]]) -]) - -# Copyright (C) 2002-2017 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -146,10 +32,10 @@ AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET], # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.15' +[am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.15.1], [], +m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -165,12 +51,12 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.15.1])dnl +[AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -# Copyright (C) 2011-2017 Free Software Foundation, Inc. +# Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -232,7 +118,7 @@ AC_SUBST([AR])dnl # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -284,7 +170,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2017 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -315,7 +201,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -506,13 +392,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. - # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], @@ -520,49 +405,43 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -571,18 +450,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will -# need in order to bootstrap the dependency handling code. +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -610,6 +488,10 @@ m4_defn([AC_PROG_CC]) # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -646,7 +528,7 @@ m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl @@ -669,8 +551,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. @@ -698,6 +580,20 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This @@ -737,7 +633,7 @@ END Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -779,7 +675,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -800,7 +696,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2017 Free Software Foundation, Inc. +# Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -821,7 +717,7 @@ AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -829,49 +725,42 @@ AC_SUBST([am__leading_dot])]) # AM_MAKE_INCLUDE() # ----------------- -# Check to see how make treats includes. +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2017 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -892,12 +781,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then @@ -910,7 +794,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -939,7 +823,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -986,7 +870,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1005,7 +889,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1086,7 +970,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2017 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1146,7 +1030,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1174,7 +1058,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2017 Free Software Foundation, Inc. +# Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1193,7 +1077,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2017 Free Software Foundation, Inc. +# Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1342,7 +1226,6 @@ m4_include([sntp/m4/ntp_crypto_rand.m4]) m4_include([sntp/m4/ntp_debug.m4]) m4_include([sntp/m4/ntp_dir_sep.m4]) m4_include([sntp/m4/ntp_facilitynames.m4]) -m4_include([sntp/m4/ntp_googletest.m4]) m4_include([sntp/m4/ntp_harden.m4]) m4_include([sntp/m4/ntp_ipv6.m4]) m4_include([sntp/m4/ntp_lib_m.m4]) @@ -1362,4 +1245,5 @@ m4_include([sntp/m4/ntp_vpathhack.m4]) m4_include([sntp/m4/openldap-thread-check.m4]) m4_include([sntp/m4/openldap.m4]) m4_include([sntp/m4/os_cflags.m4]) +m4_include([sntp/m4/realpath.m4]) m4_include([sntp/m4/snprintf.m4]) diff --git a/adjtimed/Makefile.am b/adjtimed/Makefile.am index 19bfe0c952cd..87c12b393e76 100644 --- a/adjtimed/Makefile.am +++ b/adjtimed/Makefile.am @@ -6,6 +6,7 @@ sbin_PROGRAMS = $(ADJTIMED_DS) BUILT_SOURCES = CLEANFILES = +DISTCLEANFILES = EXTRA_PROGRAMS = adjtimed AM_CFLAGS = $(CFLAGS_NTP) @@ -19,6 +20,6 @@ LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) AM_LDFLAGS = $(NTP_HARD_LDFLAGS) include $(top_srcdir)/bincheck.mf -include $(top_srcdir)/sntp/check-libntp.mf +include $(top_srcdir)/check-libntp.mf include $(top_srcdir)/depsver.mf include $(top_srcdir)/includes.mf diff --git a/adjtimed/Makefile.in b/adjtimed/Makefile.in index 87e1fba23032..7e7469c4f1b6 100644 --- a/adjtimed/Makefile.in +++ b/adjtimed/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -116,7 +116,6 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_debug.m4 \ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \ - $(top_srcdir)/sntp/m4/ntp_googletest.m4 \ $(top_srcdir)/sntp/m4/ntp_harden.m4 \ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \ @@ -136,6 +135,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ + $(top_srcdir)/sntp/m4/realpath.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -172,7 +172,8 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/sntp/libevent/build-aux/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/adjtimed.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -216,11 +217,9 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/bincheck.mf \ - $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf \ - $(top_srcdir)/sntp/check-libntp.mf \ + $(top_srcdir)/check-libntp.mf $(top_srcdir)/depsver.mf \ + $(top_srcdir)/includes.mf \ $(top_srcdir)/sntp/libevent/build-aux/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -240,6 +239,7 @@ CALC_TICKADJ_MS = @CALC_TICKADJ_MS@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CC_NOFORMAT = @CC_NOFORMAT@ CFLAGS = @CFLAGS@ CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@ CFLAGS_NTP = @CFLAGS_NTP@ @@ -249,6 +249,8 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ CPPFLAGS_NTP = @CPPFLAGS_NTP@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ DEFS = @DEFS@ @@ -261,14 +263,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EDITLINE_LIBS = @EDITLINE_LIBS@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ -GTEST_CONFIG = @GTEST_CONFIG@ -GTEST_CPPFLAGS = @GTEST_CPPFLAGS@ -GTEST_CXXFLAGS = @GTEST_CXXFLAGS@ -GTEST_LDFLAGS = @GTEST_LDFLAGS@ -GTEST_LIBS = @GTEST_LIBS@ HAVE_INLINE = @HAVE_INLINE@ HAVE_LEAPSMEARINTERVAL = @HAVE_LEAPSMEARINTERVAL@ HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@ @@ -479,6 +477,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -490,19 +489,21 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ BUILT_SOURCES = check-libntp .deps-ver CLEANFILES = check-libntp .deps-ver +DISTCLEANFILES = $(DEPDIR)/deps-ver AM_CFLAGS = $(CFLAGS_NTP) $(NTP_HARD_CFLAGS) AM_CPPFLAGS = $(NTP_INCS) $(CPPFLAGS_NTP) $(NTP_HARD_CPPFLAGS) LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) AM_LDFLAGS = $(NTP_HARD_LDFLAGS) -NTP_INCS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ - -I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ - -I$(top_srcdir)/lib/isc/unix/include +NTP_INCS = -I$(top_srcdir)/include \ + -I$(top_srcdir)/libntp/lib/isc/include \ + -I$(top_srcdir)/libntp/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ + -I$(top_srcdir)/libntp/lib/isc/unix/include all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/sntp/check-libntp.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/check-libntp.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -519,10 +520,10 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; -$(top_srcdir)/bincheck.mf $(top_srcdir)/sntp/check-libntp.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): +$(top_srcdir)/bincheck.mf $(top_srcdir)/check-libntp.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -690,25 +691,34 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtimed.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtimed.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @@ -770,8 +780,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -811,7 +823,8 @@ installdirs: done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -837,6 +850,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -848,7 +862,7 @@ clean-am: clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \ clean-libtool clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/adjtimed.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -896,7 +910,7 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/adjtimed.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -916,9 +930,10 @@ ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-libexecPROGRAMS \ uninstall-sbinPROGRAMS -.MAKE: all check install install-am install-exec-am install-strip +.MAKE: all check install install-am install-exec install-exec-am \ + install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \ clean-libtool clean-sbinPROGRAMS cscopelist-am ctags ctags-am \ distclean distclean-compile distclean-generic \ @@ -952,17 +967,18 @@ install-exec-hook: # -check-libntp: ../libntp/libntp.a +check-libntp: $(top_builddir)/libntp/libntp.a + @: avoid default SCCS get by some make implementations -../libntp/libntp.a: - cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a +$(top_builddir)/libntp/libntp.a: + cd $(top_builddir)/libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ - chmod ug+w $@ + chmod u+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ - $(MAKE) $(AM_MAKEFLAGS) clean && \ + $(MAKE) $(AM_MAKEFLAGS) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ @@ -980,7 +996,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) - cp $(top_srcdir)/deps-ver $@ + $(AM_V_at)cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/deps-ver @@ -1010,7 +1026,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # -# This comment block follows rather than leads the related code so that +# This comment block follows rather than leads the related rules so that # it stays with it in the generated Makefile.in and Makefile. # diff --git a/check-libntp.mf b/check-libntp.mf new file mode 100644 index 000000000000..07c855b4be78 --- /dev/null +++ b/check-libntp.mf @@ -0,0 +1,14 @@ +## check-libntp.mf - automake fragment +## +## sntp/check-libntp.mf +## The above file has a version of this for the sntp tree. + +BUILT_SOURCES += check-libntp +CLEANFILES += check-libntp + +check-libntp: $(top_builddir)/libntp/libntp.a + @: avoid default SCCS get by some make implementations + +$(top_builddir)/libntp/libntp.a: + cd $(top_builddir)/libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a + diff --git a/check-libntpd.mf b/check-libntpd.mf new file mode 100644 index 000000000000..46304dd5f236 --- /dev/null +++ b/check-libntpd.mf @@ -0,0 +1,19 @@ +## +## check-libntpd.mf - automake fragment +## + +BUILT_SOURCES += check-libntpd + +# CLEANFILES addition below won't be needed after a while. +# Leave it in for now for folks tracking the source repo +# who have the file from a former version of the rule. +# DLH Jan 2023 + +CLEANFILES += check-libntpd + +check-libntpd: $(top_builddir)/ntpd/libntpd.a + @: avoid default SCCS get by some make implementations + +$(top_builddir)/ntpd/libntpd.a: + cd $(top_builddir)/ntpd && $(MAKE) $(AM_MAKEFLAGS) libntpd.a + diff --git a/check-libunity.mf b/check-libunity.mf new file mode 100644 index 000000000000..4e052058c0c3 --- /dev/null +++ b/check-libunity.mf @@ -0,0 +1,13 @@ +## check-libunity.mf - automake fragment +## +## sntp/check-libunity.mf +## The above file has a version of this for the sntp tree. + +BUILT_SOURCES += check-libunity + +check-libunity: $(top_builddir)/sntp/unity/libunity.a + @: avoid default SCCS get by some make implementations + +$(top_builddir)/sntp/unity/libunity.a: + cd $(top_builddir)/sntp/unity && $(MAKE) $(AM_MAKEFLAGS) libunity.a + diff --git a/check-scm-rev.mf b/check-scm-rev.mf new file mode 100644 index 000000000000..e2abbf0e452c --- /dev/null +++ b/check-scm-rev.mf @@ -0,0 +1,8 @@ +$(top_srcdir)/sntp/scm-rev: FRC.scm-rev + $(AM_V_GEN)cd $(top_builddir)/sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev + +FRC.scm-rev: + @: FRC.scm-rev "force" depends on nothing and is not a file, so is \ + always out-of-date causing targets which depend on it to also \ + be outdated so their rules to fire each time they are built. + diff --git a/clockstuff/Makefile.am b/clockstuff/Makefile.am index 27984e9df718..5b3f59f841eb 100644 --- a/clockstuff/Makefile.am +++ b/clockstuff/Makefile.am @@ -14,7 +14,8 @@ propdelay_LDADD = $(LDADD) BUILT_SOURCES = CLEANFILES = +DISTCLEANFILES = -include $(top_srcdir)/sntp/check-libntp.mf +include $(top_srcdir)/check-libntp.mf include $(top_srcdir)/depsver.mf include $(top_srcdir)/includes.mf diff --git a/clockstuff/Makefile.in b/clockstuff/Makefile.in index 0775b9ae8060..f33483eb59c8 100644 --- a/clockstuff/Makefile.in +++ b/clockstuff/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -109,7 +109,6 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_debug.m4 \ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \ - $(top_srcdir)/sntp/m4/ntp_googletest.m4 \ $(top_srcdir)/sntp/m4/ntp_harden.m4 \ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \ @@ -129,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ + $(top_srcdir)/sntp/m4/realpath.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -168,7 +168,8 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/sntp/libevent/build-aux/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/chutest.Po ./$(DEPDIR)/propdelay.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -212,10 +213,8 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depsver.mf \ - $(top_srcdir)/includes.mf $(top_srcdir)/sntp/check-libntp.mf \ +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/check-libntp.mf \ + $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf \ $(top_srcdir)/sntp/libevent/build-aux/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -235,6 +234,7 @@ CALC_TICKADJ_MS = @CALC_TICKADJ_MS@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CC_NOFORMAT = @CC_NOFORMAT@ CFLAGS = @CFLAGS@ CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@ CFLAGS_NTP = @CFLAGS_NTP@ @@ -244,6 +244,8 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ CPPFLAGS_NTP = @CPPFLAGS_NTP@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ DEFS = @DEFS@ @@ -256,14 +258,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EDITLINE_LIBS = @EDITLINE_LIBS@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ -GTEST_CONFIG = @GTEST_CONFIG@ -GTEST_CPPFLAGS = @GTEST_CPPFLAGS@ -GTEST_CXXFLAGS = @GTEST_CXXFLAGS@ -GTEST_LDFLAGS = @GTEST_LDFLAGS@ -GTEST_LIBS = @GTEST_LIBS@ HAVE_INLINE = @HAVE_INLINE@ HAVE_LEAPSMEARINTERVAL = @HAVE_LEAPSMEARINTERVAL@ HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@ @@ -474,6 +472,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -491,15 +490,17 @@ AM_LDFLAGS = $(NTP_HARD_LDFLAGS) propdelay_LDADD = $(LDADD) BUILT_SOURCES = check-libntp .deps-ver CLEANFILES = check-libntp .deps-ver -NTP_INCS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ - -I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ - -I$(top_srcdir)/lib/isc/unix/include +DISTCLEANFILES = $(DEPDIR)/deps-ver +NTP_INCS = -I$(top_srcdir)/include \ + -I$(top_srcdir)/libntp/lib/isc/include \ + -I$(top_srcdir)/libntp/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ + -I$(top_srcdir)/libntp/lib/isc/unix/include all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/sntp/check-libntp.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/check-libntp.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -516,10 +517,10 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; -$(top_srcdir)/sntp/check-libntp.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): +$(top_srcdir)/check-libntp.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -553,26 +554,35 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chutest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/propdelay.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chutest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/propdelay.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @@ -634,8 +644,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -672,7 +684,8 @@ all-am: Makefile $(PROGRAMS) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -698,6 +711,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -709,7 +723,8 @@ clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/chutest.Po + -rm -f ./$(DEPDIR)/propdelay.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -755,7 +770,8 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/chutest.Po + -rm -f ./$(DEPDIR)/propdelay.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -774,11 +790,11 @@ ps-am: uninstall-am: -.MAKE: all check install install-am install-strip +.MAKE: all check install install-am install-exec install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ @@ -793,17 +809,18 @@ uninstall-am: .PRECIOUS: Makefile -check-libntp: ../libntp/libntp.a +check-libntp: $(top_builddir)/libntp/libntp.a + @: avoid default SCCS get by some make implementations -../libntp/libntp.a: - cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a +$(top_builddir)/libntp/libntp.a: + cd $(top_builddir)/libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ - chmod ug+w $@ + chmod u+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ - $(MAKE) $(AM_MAKEFLAGS) clean && \ + $(MAKE) $(AM_MAKEFLAGS) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ @@ -821,7 +838,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) - cp $(top_srcdir)/deps-ver $@ + $(AM_V_at)cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/deps-ver @@ -851,7 +868,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # -# This comment block follows rather than leads the related code so that +# This comment block follows rather than leads the related rules so that # it stays with it in the generated Makefile.in and Makefile. # diff --git a/config.h.in b/config.h.in index 4fa8c3188377..c00eba442298 100644 --- a/config.h.in +++ b/config.h.in @@ -171,12 +171,7 @@ /* Zyfer GPStarplus */ #undef CLOCK_ZYFER -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP - systems. This function is required for `alloca.c' support on those systems. - */ -#undef CRAY_STACKSEG_END - -/* Define to 1 if using `alloca.c'. */ +/* Define to 1 if using 'alloca.c'. */ #undef C_ALLOCA /* Enable debugging code? */ @@ -299,6 +294,9 @@ /* use old autokey session key behavior? */ #undef DISABLE_BUG3527_FIX +/* Disable debug assertion on OOB KoD RATE value? */ +#undef DISABLE_BUG3767_FIX + /* synch TODR hourly? */ #undef DOSYNCTODR @@ -317,6 +315,9 @@ /* Enable CMAC support? */ #undef ENABLE_CMAC +/* auto-instantiate missing PPS devices on Linux */ +#undef ENABLE_MAGICPPS + /* nls support in libopts */ #undef ENABLE_NLS @@ -332,11 +333,10 @@ /* via __adjtimex */ #undef HAVE_ADJTIMEX -/* Define to 1 if you have `alloca', as a function or macro. */ +/* Define to 1 if you have 'alloca', as a function or macro. */ #undef HAVE_ALLOCA -/* Define to 1 if you have and it should be used (not on Ultrix). - */ +/* Define to 1 if works. */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the `arc4random_buf' function. */ @@ -372,6 +372,9 @@ /* Define to 1 if you have the `clock_settime' function. */ #undef HAVE_CLOCK_SETTIME +/* Define to 1 if you have the `closefrom' function. */ +#undef HAVE_CLOSEFROM + /* Define to 1 if you have the header file. */ #undef HAVE_CTHREADS_H @@ -418,6 +421,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H +/* Define to 1 if you have the `fdopendir' function. */ +#undef HAVE_FDOPENDIR + /* Define to 1 if you have the `finite' function. */ #undef HAVE_FINITE @@ -433,6 +439,12 @@ /* Define to 1 if you have the `fstat' function. */ #undef HAVE_FSTAT +/* Define to 1 if you have the `fstatat' function. */ +#undef HAVE_FSTATAT + +/* Define to 1 if we have realpath() that supports NULL as the 2nd argument */ +#undef HAVE_FUNC_POSIX_REALPATH + /* Define to 1 if you have the `getbootfile' function. */ #undef HAVE_GETBOOTFILE @@ -553,7 +565,7 @@ /* Define to 1 if the system has the type `long long'. */ #undef HAVE_LONG_LONG -/* Define to 1 if the system has the type 'long long int'. */ +/* Define to 1 if the system has the type `long long int'. */ #undef HAVE_LONG_LONG_INT /* if you have SunOS LWP package */ @@ -592,6 +604,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H +/* Define to 1 if you have the header file. */ +#undef HAVE_MINIX_CONFIG_H + /* Define to 1 if you have the `mkstemp' function. */ #undef HAVE_MKSTEMP @@ -670,6 +685,9 @@ /* if you have NT Threads */ #undef HAVE_NT_THREADS +/* Define to 1 if you have the `openat' function. */ +#undef HAVE_OPENAT + /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_CMAC_H @@ -868,6 +886,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H @@ -883,7 +904,7 @@ /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR -/* Define to 1 if you have the `strerror_r' function. */ +/* Define if you have `strerror_r'. */ #undef HAVE_STRERROR_R /* Define to 1 if you have the header file. */ @@ -1179,7 +1200,7 @@ /* deviant sigwait? */ #undef HAVE_UNIXWARE_SIGWAIT -/* Define to 1 if the system has the type 'unsigned long long int'. */ +/* Define to 1 if the system has the type `unsigned long long int'. */ #undef HAVE_UNSIGNED_LONG_LONG_INT /* Define to 1 if you have the `updwtmp' function. */ @@ -1566,7 +1587,9 @@ STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Step, then slew the clock? */ @@ -1596,7 +1619,8 @@ /* Is K_TICK_NAME in nanoseconds? */ #undef TICK_NANO -/* Define to 1 if you can safely include both and . */ +/* Define to 1 if you can safely include both and . This + macro is obsolete. */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ @@ -1627,21 +1651,87 @@ typedef unsigned int uintptr_t; #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif +/* Enable general extensions on macOS. */ +#ifndef _DARWIN_C_SOURCE +# undef _DARWIN_C_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif -/* Enable threading extensions on Solaris. */ +/* Enable X/Open compliant socket functions that do not require linking + with -lxnet on HP-UX 11.11. */ +#ifndef _HPUX_ALT_XOPEN_SOCKET_API +# undef _HPUX_ALT_XOPEN_SOCKET_API +#endif +/* Identify the host operating system as Minix. + This macro does not affect the system headers' behavior. + A future release of Autoconf may stop defining this macro. */ +#ifndef _MINIX +# undef _MINIX +#endif +/* Enable general extensions on NetBSD. + Enable NetBSD compatibility extensions on Minix. */ +#ifndef _NETBSD_SOURCE +# undef _NETBSD_SOURCE +#endif +/* Enable OpenBSD compatibility extensions on NetBSD. + Oddly enough, this does nothing on OpenBSD. */ +#ifndef _OPENBSD_SOURCE +# undef _OPENBSD_SOURCE +#endif +/* Define to 1 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_SOURCE +# undef _POSIX_SOURCE +#endif +/* Define to 2 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_1_SOURCE +# undef _POSIX_1_SOURCE +#endif +/* Enable POSIX-compatible threading on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# undef __STDC_WANT_IEC_60559_BFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# undef __STDC_WANT_IEC_60559_DFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# undef __STDC_WANT_IEC_60559_FUNCS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# undef __STDC_WANT_IEC_60559_TYPES_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# undef __STDC_WANT_LIB_EXT2__ +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# undef __STDC_WANT_MATH_SPEC_FUNCS__ +#endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ +/* Enable X/Open extensions. Define to 500 only if necessary + to make mbstate_t available. */ +#ifndef _XOPEN_SOURCE +# undef _XOPEN_SOURCE #endif @@ -1675,16 +1765,6 @@ typedef unsigned int uintptr_t; /* routine worker child proc uses to exit. */ #undef WORKER_CHILD_EXIT -/* Define to 1 if on MINIX. */ -#undef _MINIX - -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -#undef _POSIX_1_SOURCE - -/* Define to 1 if you need to in order for `stat' and other things to work. */ -#undef _POSIX_SOURCE - /* enable thread safety */ #undef _REENTRANT @@ -1700,7 +1780,8 @@ typedef unsigned int uintptr_t; /* Are we _special_? */ #undef __APPLE_USE_RFC_3542 -/* Define to 1 if type `char' is unsigned and you are not using gcc. */ +/* Define to 1 if type `char' is unsigned and your compiler does not + predefine this macro. */ #ifndef __CHAR_UNSIGNED__ # undef __CHAR_UNSIGNED__ #endif @@ -1733,7 +1814,7 @@ typedef unsigned int uintptr_t; /* Define to `long int' if does not define. */ #undef off_t -/* Define to `int' if does not define. */ +/* Define as a signed integer type capable of holding a process identifier. */ #undef pid_t /* Define to `unsigned int' if does not define. */ diff --git a/configure b/configure index 71b0d0c29167..a8c2ba593aa3 100755 --- a/configure +++ b/configure @@ -1,11 +1,12 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ntp 4.2.8p15. +# Generated by GNU Autoconf 2.71 for ntp 4.2.8p16. # -# Report bugs to . +# Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -16,14 +17,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -33,46 +36,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -81,13 +84,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -96,8 +92,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -109,30 +109,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -154,20 +134,22 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else +else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -187,12 +169,15 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else +else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO @@ -207,30 +192,38 @@ test \$(( 1 + 1 )) = 2 || exit 1 PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" - if (eval "$as_required") 2>/dev/null; then : + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else +else $as_nop as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -238,14 +231,21 @@ fi esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi - if test "x$CONFIG_SHELL" != x; then : + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -263,19 +263,20 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: http://bugs.ntp.org./ about your system, including any + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and +$0: https://bugs.ntp.org/ about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." @@ -302,6 +303,7 @@ as_fn_unset () } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -319,6 +321,14 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -333,7 +343,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -342,7 +352,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -381,12 +391,13 @@ as_fn_executable_p () # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -398,18 +409,27 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -421,9 +441,9 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -450,7 +470,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -494,7 +514,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -508,6 +528,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -521,6 +545,13 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -590,48 +621,44 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='ntp' PACKAGE_TARNAME='ntp' -PACKAGE_VERSION='4.2.8p15' -PACKAGE_STRING='ntp 4.2.8p15' -PACKAGE_BUGREPORT='http://bugs.ntp.org./' -PACKAGE_URL='http://www.ntp.org./' +PACKAGE_VERSION='4.2.8p16' +PACKAGE_STRING='ntp 4.2.8p16' +PACKAGE_BUGREPORT='https://bugs.ntp.org/' +PACKAGE_URL='https://www.ntp.org/' # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include +#include +#ifdef HAVE_STDIO_H +# include #endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS +#ifdef HAVE_STDLIB_H # include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif #endif #ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif" -ac_header_list= +ac_header_c_list= +ac_func_c_list= enable_option_checking=no ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE @@ -645,13 +672,6 @@ BUILD_TEST_NTP_SCANNER_FALSE BUILD_TEST_NTP_SCANNER_TRUE BUILD_TEST_NTP_RESTRICT_FALSE BUILD_TEST_NTP_RESTRICT_TRUE -GTEST_AVAILABLE_FALSE -GTEST_AVAILABLE_TRUE -GTEST_CPPFLAGS -GTEST_CXXFLAGS -GTEST_LIBS -GTEST_LDFLAGS -GTEST_CONFIG UNITYBUILD_AVAILABLE_FALSE UNITYBUILD_AVAILABLE_TRUE PATH_RUBY @@ -841,6 +861,7 @@ LDFLAGS_NTP LDADD_NTP CPPFLAGS_NTP CFLAGS_NTP +CC_NOFORMAT EGREP GREP CPP @@ -851,7 +872,6 @@ am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE -am__quote am__include DEPDIR OBJEXT @@ -873,6 +893,9 @@ AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V +CSCOPE +ETAGS +CTAGS am__untar am__tar AMTAR @@ -915,6 +938,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -933,7 +957,8 @@ PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR -SHELL' +SHELL +am__quote' ac_subst_files='calc_tickadj_opts ntp_wait_opts ntpsweep_opts @@ -1053,16 +1078,17 @@ enable_kernel_fll_bug enable_bug1243_fix enable_bug3020_fix enable_bug3527_fix +enable_bug3767_fix enable_irig_sawtooth enable_nist enable_ntp_signd +enable_magicpps enable_ipv6 with_kame enable_getifaddrs enable_saveconfig enable_leap_smear enable_dynamic_interleave -with_gtest enable_problem_tests ' ac_precious_vars='build_alias @@ -1115,6 +1141,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1144,8 +1171,6 @@ do *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -1186,9 +1211,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1212,9 +1237,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1367,6 +1392,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1416,9 +1450,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1432,9 +1466,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1478,9 +1512,9 @@ Try \`$0 --help' for more information" *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1496,7 +1530,7 @@ if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1504,7 +1538,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1560,7 +1594,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1617,7 +1651,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ntp 4.2.8p15 to adapt to many kinds of systems. +\`configure' configures ntp 4.2.8p16 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1657,6 +1691,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1687,7 +1722,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ntp 4.2.8p15:";; + short | recursive ) echo "Configuration of ntp 4.2.8p16:";; esac cat <<\_ACEOF @@ -1830,10 +1865,12 @@ Optional Features and Packages: --enable-bug1243-fix + use unmodified autokey session keys --enable-bug3020-fix + Provide the explicit 127.0.0.0/8 martian filter --enable-bug3527-fix + provide correct mode7 fudgetime2 behavior + --enable-bug3767-fix + Disable debug assertion on OOB KoD RATE value --enable-irig-sawtooth s if we should enable the IRIG sawtooth filter --enable-nist - if we should enable the NIST lockclock scheme --enable-ntp-signd - Provide support for Samba's signing daemon, =/var/run/ntp_signd + --enable-magicpps + try to auto-instantiate PPS devices on Linux --enable-ipv6 s use IPv6? --with-kame - =/usr/local/v6 @@ -1842,7 +1879,6 @@ Optional Features and Packages: --enable-leap-smear - experimental leap smear code --enable-dynamic-interleave - dynamic interleave support - --with-gtest Use the gtest framework (Default: if it's available) --enable-problem-tests + enable tests with undiagnosed problems Some influential environment variables: @@ -1866,8 +1902,8 @@ Some influential environment variables: Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to . -ntp home page: . +Report bugs to . +ntp home page: . _ACEOF ac_status=$? fi @@ -1883,9 +1919,9 @@ if test "$ac_init_help" = "recursive"; then case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1913,7 +1949,8 @@ esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1921,7 +1958,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1930,10 +1967,10 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ntp configure 4.2.8p15 -generated by GNU Autoconf 2.69 +ntp configure 4.2.8p16 +generated by GNU Autoconf 2.71 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1950,14 +1987,14 @@ fi ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1965,14 +2002,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1982,6 +2020,39 @@ fi } # ac_fn_c_try_compile +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. @@ -1994,7 +2065,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2002,14 +2073,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -2019,184 +2091,20 @@ fi } # ac_fn_c_try_cpp -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ------------------------------------ ## -## Report this to http://bugs.ntp.org./ ## -## ------------------------------------ ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2204,17 +2112,18 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -2229,17 +2138,61 @@ fi } # ac_fn_c_try_link +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. @@ -2247,16 +2200,9 @@ else #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $2 (); below. */ +#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -2274,24 +2220,25 @@ choke me #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func @@ -2303,17 +2250,18 @@ $as_echo "$ac_res" >&6; } ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof ($2)) return 0; @@ -2321,12 +2269,13 @@ if (sizeof ($2)) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof (($2))) return 0; @@ -2334,18 +2283,19 @@ if (sizeof (($2))) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop eval "$3=yes" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type @@ -2364,7 +2314,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; @@ -2374,14 +2324,15 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; @@ -2391,9 +2342,10 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=$ac_mid; break -else +else $as_nop as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= @@ -2401,14 +2353,14 @@ else fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; @@ -2418,14 +2370,15 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; @@ -2435,9 +2388,10 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_lo=$ac_mid; break -else +else $as_nop as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= @@ -2445,14 +2399,14 @@ else fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else +else $as_nop ac_lo= ac_hi= fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val @@ -2460,7 +2414,7 @@ while test "x$ac_lo" != "x$ac_hi"; do /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; @@ -2470,12 +2424,13 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=$ac_mid -else +else $as_nop as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; @@ -2485,12 +2440,12 @@ esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } +static long int longval (void) { return $2; } +static unsigned long int ulongval (void) { return $2; } #include #include int -main () +main (void) { FILE *f = fopen ("conftest.val", "w"); @@ -2518,9 +2473,10 @@ main () return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : echo >>conftest.val; read $3 &5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { #ifndef $as_decl_name #ifdef __cplusplus @@ -2565,19 +2524,22 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_decl +} # ac_fn_check_decl # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- @@ -2586,16 +2548,17 @@ $as_echo "$ac_res" >&6; } ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 -$as_echo_n "checking for $2.$3... " >&6; } -if eval \${$4+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +printf %s "checking for $2.$3... " >&6; } +if eval test \${$4+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int -main () +main (void) { static $2 ac_aggr; if (ac_aggr.$3) @@ -2604,14 +2567,15 @@ return 0; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$4=yes" -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int -main () +main (void) { static $2 ac_aggr; if (sizeof ac_aggr.$3) @@ -2620,29 +2584,50 @@ return 0; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$4=yes" -else +else $as_nop eval "$4=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$4 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ntp $as_me 4.2.8p15, which was -generated by GNU Autoconf 2.69. Invocation command line was +It was created by ntp $as_me 4.2.8p16, which was +generated by GNU Autoconf 2.71. Invocation command line was - $ $0 $@ + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -2675,8 +2660,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -2711,7 +2700,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -2746,11 +2735,13 @@ done # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -2761,8 +2752,8 @@ trap 'exit_status=$? case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2786,7 +2777,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2794,14 +2785,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2809,15 +2800,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2825,8 +2816,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2840,63 +2831,48 @@ ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi @@ -2906,20 +2882,442 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi -as_fn_append ac_header_list " stdarg.h" +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif + +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H" +as_fn_append ac_header_c_list " minix/config.h minix_config_h HAVE_MINIX_CONFIG_H" +as_fn_append ac_func_c_list " vprintf HAVE_VPRINTF" +as_fn_append ac_header_c_list " vfork.h vfork_h HAVE_VFORK_H" +as_fn_append ac_func_c_list " fork HAVE_FORK" +as_fn_append ac_func_c_list " vfork HAVE_VFORK" +as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H" +as_fn_append ac_header_c_list " stdarg.h stdarg_h HAVE_STDARG_H" + +# Auxiliary files required by this configure script. +ac_aux_files="ltmain.sh ar-lib compile config.guess config.sub missing install-sh" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}/sntp/libevent/build-aux" + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false @@ -2930,12 +3328,12 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) @@ -2944,24 +3342,24 @@ $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -2971,11 +3369,12 @@ $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2989,34 +3388,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_aux_dir= -for ac_dir in sntp/libevent/build-aux "$srcdir"/sntp/libevent/build-aux; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in sntp/libevent/build-aux \"$srcdir\"/sntp/libevent/build-aux" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3049,7 +3420,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # the date YYYYMMDD optionally with -HHMM if there is more than one # bump in a day. -ntp_configure_cache_version=20120806 +ntp_configure_cache_version=20230326 # When the cache version of config.cache and configure do not # match, NTP_CACHEVERSION will flush the cache. @@ -3130,15 +3501,15 @@ ntp_configure_cache_version=20120806 for c_varname in $c_varname_list do - { eval $c_varname=; unset $c_varname; } + { eval $c_varname=; unset $c_varname;} done - { $as_echo "$as_me:${as_lineno-$LINENO}: $cache_file saved by another version, ignored." >&5 -$as_echo "$as_me: $cache_file saved by another version, ignored." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: configure script cache version: $ntp_configure_cache_version" >&5 -$as_echo "$as_me: configure script cache version: $ntp_configure_cache_version" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: $cache_file version: $c_version" >&5 -$as_echo "$as_me: $cache_file version: $c_version" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $cache_file saved by another version, ignored." >&5 +printf "%s\n" "$as_me: $cache_file saved by another version, ignored." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: configure script cache version: $ntp_configure_cache_version" >&5 +printf "%s\n" "$as_me: configure script cache version: $ntp_configure_cache_version" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $cache_file version: $c_version" >&5 +printf "%s\n" "$as_me: $cache_file version: $c_version" >&6;} { c_varname=; unset c_varname;} { c_varname_list=; unset c_varname_list;} { c_version=; unset c_version;} @@ -3154,9 +3525,11 @@ $as_echo "$as_me: $cache_file version: $c_version" >&6;} NTP_CACHEVERSION_PARENT='main' ; export NTP_CACHEVERSION_PARENT -am__api_version='1.15' +am__api_version='1.16' -# Find a good install program. We prefer a C program (faster), + + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install @@ -3170,20 +3543,25 @@ am__api_version='1.15' # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; @@ -3193,13 +3571,13 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else @@ -3207,12 +3585,12 @@ case $as_dir/ in #(( echo one > conftest.one echo two > conftest.two mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi @@ -3228,7 +3606,7 @@ IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi - if test "${ac_cv_path_install+set}" = set; then + if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a @@ -3238,8 +3616,8 @@ fi INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -3249,8 +3627,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -3304,8 +3682,8 @@ else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= @@ -3324,26 +3702,23 @@ test "$program_suffix" != NONE && # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then @@ -3363,11 +3738,12 @@ if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else @@ -3375,11 +3751,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3390,11 +3770,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3403,11 +3783,12 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else @@ -3415,11 +3796,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3430,11 +3815,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -3442,8 +3827,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -3455,25 +3840,31 @@ fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done @@ -3484,7 +3875,7 @@ IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then + if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a @@ -3494,18 +3885,19 @@ fi MKDIR_P="$ac_install_sh -d" fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else @@ -3513,11 +3905,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3528,24 +3924,25 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @@ -3561,12 +3958,12 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -3580,7 +3977,8 @@ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : +if test ${enable_silent_rules+y} +then : enableval=$enable_silent_rules; fi @@ -3590,12 +3988,13 @@ case $enable_silent_rules in # ((( *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 @@ -3607,8 +4006,8 @@ else am_cv_make_support_nested_variables=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' @@ -3640,17 +4039,13 @@ fi # Define the identity of the package. PACKAGE='ntp' - VERSION='4.2.8p15' + VERSION='4.2.8p16' -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF +printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF +printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. @@ -3670,8 +4065,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The @@ -3690,6 +4085,20 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile @@ -3722,7 +4131,7 @@ END Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -3735,7 +4144,8 @@ fi # Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : +if test ${enable_silent_rules+y} +then : enableval=$enable_silent_rules; fi @@ -3745,12 +4155,13 @@ case $enable_silent_rules in # ((( *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 @@ -3762,8 +4173,8 @@ else am_cv_make_support_nested_variables=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' @@ -3774,26 +4185,29 @@ fi AM_BACKSLASH='\' -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; @@ -3812,21 +4226,22 @@ IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; @@ -3846,9 +4261,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -cat >>confdefs.h <<_ACEOF -#define STR_SYSTEM "$host" -_ACEOF +printf "%s\n" "#define STR_SYSTEM \"$host\"" >>confdefs.h ac_config_headers="$ac_config_headers config.h" @@ -3859,52 +4272,62 @@ ntp_parse_ok=${ntp_parse_ok=no} ntp_ripe_ncc_ok=${ntp_parse_ok=no} ntp_jupiter_ok=${ntp_jupiter_ok=no} + + + + + + + + + DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" - -am_make=${MAKE-make} -cat > confinc << 'END' +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : +if test ${enable_dependency_tracking+y} +then : enableval=$enable_dependency_tracking; fi @@ -3945,11 +4368,12 @@ if test -n "$ac_tool_prefix"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3957,11 +4381,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3972,11 +4400,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3989,11 +4417,12 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -4001,11 +4430,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4016,11 +4449,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4032,8 +4465,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -4041,23 +4474,23 @@ esac fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -4067,7 +4500,7 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -4075,7 +4508,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -4087,9 +4520,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -4110,11 +4543,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -4131,7 +4565,7 @@ do # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -4147,44 +4581,46 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else +else $as_nop ac_file='' fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -4198,15 +4634,15 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -4215,7 +4651,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -4227,8 +4663,8 @@ _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -4236,10 +4672,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -4247,39 +4683,40 @@ $as_echo "$ac_try_echo"; } >&5 *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -4293,11 +4730,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -4306,31 +4744,32 @@ $as_echo "$ac_try_echo"; } >&5 break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -4340,29 +4779,33 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -4371,57 +4814,60 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -4436,94 +4882,144 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} +$ac_c_conftest_c89_program _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC - fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi fi ac_ext=c @@ -4532,21 +5028,23 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=c + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -4574,8 +5072,8 @@ _ACEOF rm -f core conftest* unset am_i fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. @@ -4593,11 +5091,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For @@ -4704,8 +5203,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if @@ -4722,45 +5221,212 @@ fi +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + +fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test ${ac_cv_safe_to_define___extensions__+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_safe_to_define___extensions__=yes +else $as_nop + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 +printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } +if test ${ac_cv_should_define__xopen_source+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_should_define__xopen_source=no + if test $ac_cv_header_wchar_h = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define _XOPEN_SOURCE 500 + #include + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_should_define__xopen_source=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 +printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } + + printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h + + printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _OPENBSD_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h + + printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h + + if test $ac_cv_header_minix_config_h = yes +then : + MINIX=yes + printf "%s\n" "#define _MINIX 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h + +else $as_nop + MINIX= +fi + if test $ac_cv_safe_to_define___extensions__ = yes +then : + printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h + +fi + if test $ac_cv_should_define__xopen_source = yes +then : + printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h + +fi + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -4772,10 +5438,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -4785,7 +5452,8 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : break fi @@ -4797,29 +5465,24 @@ fi else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -4831,10 +5494,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -4844,11 +5508,12 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi @@ -4860,11 +5525,12 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST @@ -4872,10 +5538,15 @@ else for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP @@ -4884,13 +5555,13 @@ case `"$ac_path_GREP" --version 2>&1` in ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4918,16 +5589,17 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else @@ -4938,10 +5610,15 @@ else for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP @@ -4950,13 +5627,13 @@ case `"$ac_path_EGREP" --version 2>&1` in ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4985,493 +5662,11 @@ fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" -if test "x$ac_cv_header_minix_config_h" = xyes; then : - MINIX=yes -else - MINIX= -fi - - - if test "$MINIX" = yes; then - -$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h - - -$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h - - -$as_echo "#define _MINIX 1" >>confdefs.h - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 -$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if ${ac_cv_safe_to_define___extensions__+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# define __EXTENSIONS__ 1 - $ac_includes_default -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_safe_to_define___extensions__=yes -else - ac_cv_safe_to_define___extensions__=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 -$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } - test $ac_cv_safe_to_define___extensions__ = yes && - $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h - - $as_echo "#define _ALL_SOURCE 1" >>confdefs.h - - $as_echo "#define _GNU_SOURCE 1" >>confdefs.h - - $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h - - $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h - - - - case $ac_cv_prog_cc_stdc in #( - no) : - ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( - *) : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 -$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } -if ${ac_cv_prog_cc_c99+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c99=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -#include - -// Check varargs macros. These examples are taken from C99 6.10.3.5. -#define debug(...) fprintf (stderr, __VA_ARGS__) -#define showlist(...) puts (#__VA_ARGS__) -#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) -static void -test_varargs_macros (void) -{ - int x = 1234; - int y = 5678; - debug ("Flag"); - debug ("X = %d\n", x); - showlist (The first, second, and third items.); - report (x>y, "x is %d but y is %d", x, y); -} - -// Check long long types. -#define BIG64 18446744073709551615ull -#define BIG32 4294967295ul -#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) -#if !BIG_OK - your preprocessor is broken; -#endif -#if BIG_OK -#else - your preprocessor is broken; -#endif -static long long int bignum = -9223372036854775807LL; -static unsigned long long int ubignum = BIG64; - -struct incomplete_array -{ - int datasize; - double data[]; -}; - -struct named_init { - int number; - const wchar_t *name; - double average; -}; - -typedef const char *ccp; - -static inline int -test_restrict (ccp restrict text) -{ - // See if C++-style comments work. - // Iterate through items via the restricted pointer. - // Also check for declarations in for loops. - for (unsigned int i = 0; *(text+i) != '\0'; ++i) - continue; - return 0; -} - -// Check varargs and va_copy. -static void -test_varargs (const char *format, ...) -{ - va_list args; - va_start (args, format); - va_list args_copy; - va_copy (args_copy, args); - - const char *str; - int number; - float fnumber; - - while (*format) - { - switch (*format++) - { - case 's': // string - str = va_arg (args_copy, const char *); - break; - case 'd': // int - number = va_arg (args_copy, int); - break; - case 'f': // float - fnumber = va_arg (args_copy, double); - break; - default: - break; - } - } - va_end (args_copy); - va_end (args); -} - -int -main () -{ - - // Check bool. - _Bool success = false; - - // Check restrict. - if (test_restrict ("String literal") == 0) - success = true; - char *restrict newvar = "Another string"; - - // Check varargs. - test_varargs ("s, d' f .", "string", 65, 34.234); - test_varargs_macros (); - - // Check flexible array members. - struct incomplete_array *ia = - malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); - ia->datasize = 10; - for (int i = 0; i < ia->datasize; ++i) - ia->data[i] = i * 1.234; - - // Check named initializers. - struct named_init ni = { - .number = 34, - .name = L"Test wide string", - .average = 543.34343, - }; - - ni.number = 58; - - int dynamic_array[ni.number]; - dynamic_array[ni.number - 1] = 543; - - // work around unused variable warnings - return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' - || dynamic_array[ni.number - 1] != 543); - - ; - return 0; -} -_ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c99=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c99" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c99" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c99" != xno; then : - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 -else - ac_cv_prog_cc_stdc=no -fi - -fi - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 -$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } - if ${ac_cv_prog_cc_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -fi - - case $ac_cv_prog_cc_stdc in #( - no) : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; #( - '') : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; #( - *) : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 -$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; -esac @@ -5481,11 +5676,12 @@ esac # AM_PROG_CC_C_O supersets AC_PROG_CC_C_O if test $ac_cv_c_compiler_gnu = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 -$as_echo_n "checking whether $CC needs -traditional... " >&6; } -if ${ac_cv_prog_gcc_traditional+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 +printf %s "checking whether $CC needs -traditional... " >&6; } +if test ${ac_cv_prog_gcc_traditional+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_pattern="Autoconf.*'x'" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5493,12 +5689,13 @@ else Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then : + $EGREP "$ac_pattern" >/dev/null 2>&1 +then : ac_cv_prog_gcc_traditional=yes -else +else $as_nop ac_cv_prog_gcc_traditional=no fi -rm -f conftest* +rm -rf conftest* if test $ac_cv_prog_gcc_traditional = no; then @@ -5508,15 +5705,16 @@ rm -f conftest* Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then : + $EGREP "$ac_pattern" >/dev/null 2>&1 +then : ac_cv_prog_gcc_traditional=yes fi -rm -f conftest* +rm -rf conftest* fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 -$as_echo "$ac_cv_prog_gcc_traditional" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 +printf "%s\n" "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi @@ -5524,6 +5722,7 @@ fi +CC_NOFORMAT= CFLAGS_NTP= CPPFLAGS_NTP= LDADD_NTP= @@ -5533,59 +5732,63 @@ LDFLAGS_NTP= + case "$ac_cv_prog_cc_c89" in no) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ANSI C89/ISO C90 is the minimum to compile NTP + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ANSI C89/ISO C90 is the minimum to compile NTP version 4.2.5 and higher." >&5 -$as_echo "$as_me: WARNING: ANSI C89/ISO C90 is the minimum to compile NTP +printf "%s\n" "$as_me: WARNING: ANSI C89/ISO C90 is the minimum to compile NTP version 4.2.5 and higher." >&2;} ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle #warning" >&5 -$as_echo_n "checking if $CC can handle #warning... " >&6; } -if ${ntp_cv_cpp_warning+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC can handle #warning" >&5 +printf %s "checking if $CC can handle #warning... " >&6; } +if test ${ntp_cv_cpp_warning+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #warning foo ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_cpp_warning=yes -else +else $as_nop ntp_cv_cpp_warning=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_cpp_warning" >&5 -$as_echo "$ntp_cv_cpp_warning" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_cpp_warning" >&5 +printf "%s\n" "$ntp_cv_cpp_warning" >&6; } case "$ntp_cv_cpp_warning" in no) -$as_echo "#define NO_OPTION_NAME_WARNINGS 1" >>confdefs.h +printf "%s\n" "#define NO_OPTION_NAME_WARNINGS 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports __attribute__((...))" >&5 -$as_echo_n "checking if $CC supports __attribute__((...))... " >&6; } -if ${ntp_cv_cc_attribute+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports __attribute__((...))" >&5 +printf %s "checking if $CC supports __attribute__((...))... " >&6; } +if test ${ntp_cv_cc_attribute+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { void foo(void) __attribute__((__noreturn__)); @@ -5593,21 +5796,22 @@ void foo(void) __attribute__((__noreturn__)); return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_cc_attribute=yes -else +else $as_nop ntp_cv_cc_attribute=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_cc_attribute" >&5 -$as_echo "$ntp_cv_cc_attribute" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_cc_attribute" >&5 +printf "%s\n" "$ntp_cv_cc_attribute" >&6; } case "$ntp_cv_cc_attribute" in yes) -$as_echo "#define HAVE___ATTRIBUTE__ /**/" >>confdefs.h +printf "%s\n" "#define HAVE___ATTRIBUTE__ /**/" >>confdefs.h esac @@ -5615,79 +5819,130 @@ esac case "$GCC" in yes) SAVED_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Wstrict-overflow" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle -Wstrict-overflow" >&5 -$as_echo_n "checking if $CC can handle -Wstrict-overflow... " >&6; } -if ${ntp_cv_gcc_Wstrict_overflow+:} false; then : - $as_echo_n "(cached) " >&6 -else + CFLAGS="$SAVED_CFLAGS -Wstrict-overflow" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC can handle -Wstrict-overflow" >&5 +printf %s "checking if $CC can handle -Wstrict-overflow... " >&6; } +if test ${ntp_cv_gcc_Wstrict_overflow+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_gcc_Wstrict_overflow=yes -else +else $as_nop ntp_cv_gcc_Wstrict_overflow=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gcc_Wstrict_overflow" >&5 -$as_echo "$ntp_cv_gcc_Wstrict_overflow" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gcc_Wstrict_overflow" >&5 +printf "%s\n" "$ntp_cv_gcc_Wstrict_overflow" >&6; } # # $ntp_cv_gcc_Wstrict_overflow is tested later to add the # flag to CFLAGS. # CFLAGS="$SAVED_CFLAGS -Winit-self" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle -Winit-self" >&5 -$as_echo_n "checking if $CC can handle -Winit-self... " >&6; } -if ${ntp_cv_gcc_Winit_self+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC can handle -Winit-self" >&5 +printf %s "checking if $CC can handle -Winit-self... " >&6; } +if test ${ntp_cv_gcc_Winit_self+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_gcc_Winit_self=yes -else +else $as_nop ntp_cv_gcc_Winit_self=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gcc_Winit_self" >&5 -$as_echo "$ntp_cv_gcc_Winit_self" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gcc_Winit_self" >&5 +printf "%s\n" "$ntp_cv_gcc_Winit_self" >&6; } + # + # libopts specifically builds a string with embedded NULs. + # This causes a bunch of distracting warnings due to -Wformat. + # Let's see if we can figure out how to disable these. + # + CFLAGS="$SAVED_CFLAGS -Wno-format" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC can handle -Wno-format" >&5 +printf %s "checking if $CC can handle -Wno-format... " >&6; } +if test ${ntp_cv_gcc_Wno_format+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ntp_cv_gcc_Wno_format=yes +else $as_nop + ntp_cv_gcc_Wno_format=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gcc_Wno_format" >&5 +printf "%s\n" "$ntp_cv_gcc_Wno_format" >&6; } + + case "$ntp_cv_gcc_Wno_format" in + yes) + CC_NOFORMAT="$CC_NOFORMAT -Wno-format" + ;; + no) + ;; + esac + CFLAGS="$SAVED_CFLAGS" { SAVED_CFLAGS=; unset SAVED_CFLAGS;} # # $ntp_cv_gcc_Winit_self is tested later to add the # flag to CFLAGS_NTP. # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linker supports omitting unused code and data" >&5 -$as_echo_n "checking if linker supports omitting unused code and data... " >&6; } -if ${ntp_cv_gc_sections_runs+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if linker supports omitting unused code and data" >&5 +printf %s "checking if linker supports omitting unused code and data... " >&6; } +if test ${ntp_cv_gc_sections_runs+y} +then : + printf %s "(cached) " >&6 +else $as_nop origCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wl,--gc-sections" @@ -5698,7 +5953,7 @@ else #include int -main () +main (void) { FILE * fpC; @@ -5727,7 +5982,8 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : if test "X$cross_compiling" = "Xyes" || grep gc-sections conftest.err ; then ntp_cv_gc_sections_runs=no @@ -5736,19 +5992,19 @@ if ac_fn_c_try_link "$LINENO"; then : ./conftest >/dev/null 2>&1 && ntp_cv_gc_sections_runs=yes fi -else +else $as_nop ntp_cv_gc_sections_runs=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$origCFLAGS" { origCFLAGS=; unset origCFLAGS;} fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gc_sections_runs" >&5 -$as_echo "$ntp_cv_gc_sections_runs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gc_sections_runs" >&5 +printf "%s\n" "$ntp_cv_gc_sections_runs" >&6; } case "$ntp_cv_gc_sections_runs" in yes) LDADD_LIBNTP="-Wl,--gc-sections" @@ -5782,8 +6038,8 @@ $as_echo "$ntp_cv_gc_sections_runs" >&6; } esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking additional compiler flags" >&5 -$as_echo_n "checking additional compiler flags... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking additional compiler flags" >&5 +printf %s "checking additional compiler flags... " >&6; } # allow ntp_os_cflags to be preset to skip this stuff case "${ntp_os_cflags+set}" in set) @@ -5880,12 +6136,12 @@ $as_echo_n "checking additional compiler flags... " >&6; } ntp_os_cflags_msg="$ntp_os_cflags" esac CFLAGS_NTP="$CFLAGS_NTP $ntp_os_cflags" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_os_cflags_msg" >&5 -$as_echo "$ntp_os_cflags_msg" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_os_cflags_msg" >&5 +printf "%s\n" "$ntp_os_cflags_msg" >&6; } { ntp_os_cflags_msg=; unset ntp_os_cflags_msg;} ### - { $as_echo "$as_me:${as_lineno-$LINENO}: checking additional linker flags" >&5 -$as_echo_n "checking additional linker flags... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking additional linker flags" >&5 +printf %s "checking additional linker flags... " >&6; } # HMS: The following might still need tweaking # allow ntp_os_ldflags to be preset to skip this stuff case "${ntp_os_ldflags+set}" in @@ -5912,16 +6168,17 @@ $as_echo_n "checking additional linker flags... " >&6; } ntp_os_ldflags_msg="$ntp_os_ldflags" esac LDFLAGS_NTP="$LDFLAGS_NTP $ntp_os_ldflags" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_os_ldflags_msg" >&5 -$as_echo "$ntp_os_ldflags_msg" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_os_ldflags_msg" >&5 +printf "%s\n" "$ntp_os_ldflags_msg" >&6; } { ntp_os_ldflags_msg=; unset ntp_os_ldflags_msg;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if ${ac_cv_c_bigendian+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5932,7 +6189,8 @@ else typedef int dummy; _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. @@ -5956,7 +6214,7 @@ if ac_fn_c_try_compile "$LINENO"; then : fi done fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5965,7 +6223,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext #include int -main () +main (void) { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ @@ -5977,7 +6235,8 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5985,7 +6244,7 @@ if ac_fn_c_try_compile "$LINENO"; then : #include int -main () +main (void) { #if BYTE_ORDER != BIG_ENDIAN not big endian @@ -5995,14 +6254,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_bigendian=yes -else +else $as_nop ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). @@ -6011,7 +6271,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext #include int -main () +main (void) { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros @@ -6021,14 +6281,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { #ifndef _BIG_ENDIAN not big endian @@ -6038,31 +6299,33 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_bigendian=yes -else +else $as_nop ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -short int ascii_mm[] = +unsigned short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = + unsigned short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } - short int ebcdic_ii[] = + unsigned short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = + unsigned short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; @@ -6070,14 +6333,15 @@ short int ascii_mm[] = extern int foo; int -main () +main (void) { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi @@ -6090,13 +6354,13 @@ if ac_fn_c_try_compile "$LINENO"; then : fi fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { /* Are we little or big endian? From Harbison&Steele. */ @@ -6112,9 +6376,10 @@ main () return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_c_bigendian=no -else +else $as_nop ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -6123,17 +6388,17 @@ fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf "%s\n" "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h + printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h +printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) @@ -6141,16 +6406,17 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 -$as_echo_n "checking for working volatile... " >&6; } -if ${ac_cv_c_volatile+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 +printf %s "checking for working volatile... " >&6; } +if test ${ac_cv_c_volatile+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { volatile int x; @@ -6160,18 +6426,19 @@ return !x && !y; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_volatile=yes -else +else $as_nop ac_cv_c_volatile=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 -$as_echo "$ac_cv_c_volatile" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 +printf "%s\n" "$ac_cv_c_volatile" >&6; } if test $ac_cv_c_volatile = no; then -$as_echo "#define volatile /**/" >>confdefs.h +printf "%s\n" "#define volatile /**/" >>confdefs.h fi @@ -6180,40 +6447,36 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -6225,10 +6488,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -6238,7 +6502,8 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : break fi @@ -6250,29 +6515,24 @@ fi else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -6284,10 +6544,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -6297,11 +6558,12 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi @@ -6319,11 +6581,12 @@ for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_YACC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_YACC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else @@ -6331,11 +6594,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6346,11 +6613,11 @@ fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 -$as_echo "$YACC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 +printf "%s\n" "$YACC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6358,186 +6625,10 @@ fi done test -n "$YACC" || YACC="yacc" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 -$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } -if ${ac_cv_prog_cc_c99+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c99=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -#include - -// Check varargs macros. These examples are taken from C99 6.10.3.5. -#define debug(...) fprintf (stderr, __VA_ARGS__) -#define showlist(...) puts (#__VA_ARGS__) -#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) -static void -test_varargs_macros (void) -{ - int x = 1234; - int y = 5678; - debug ("Flag"); - debug ("X = %d\n", x); - showlist (The first, second, and third items.); - report (x>y, "x is %d but y is %d", x, y); -} - -// Check long long types. -#define BIG64 18446744073709551615ull -#define BIG32 4294967295ul -#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) -#if !BIG_OK - your preprocessor is broken; -#endif -#if BIG_OK -#else - your preprocessor is broken; -#endif -static long long int bignum = -9223372036854775807LL; -static unsigned long long int ubignum = BIG64; - -struct incomplete_array -{ - int datasize; - double data[]; -}; - -struct named_init { - int number; - const wchar_t *name; - double average; -}; - -typedef const char *ccp; - -static inline int -test_restrict (ccp restrict text) -{ - // See if C++-style comments work. - // Iterate through items via the restricted pointer. - // Also check for declarations in for loops. - for (unsigned int i = 0; *(text+i) != '\0'; ++i) - continue; - return 0; -} - -// Check varargs and va_copy. -static void -test_varargs (const char *format, ...) -{ - va_list args; - va_start (args, format); - va_list args_copy; - va_copy (args_copy, args); - - const char *str; - int number; - float fnumber; - - while (*format) - { - switch (*format++) - { - case 's': // string - str = va_arg (args_copy, const char *); - break; - case 'd': // int - number = va_arg (args_copy, int); - break; - case 'f': // float - fnumber = va_arg (args_copy, double); - break; - default: - break; - } - } - va_end (args_copy); - va_end (args); -} - -int -main () -{ - - // Check bool. - _Bool success = false; - - // Check restrict. - if (test_restrict ("String literal") == 0) - success = true; - char *restrict newvar = "Another string"; - - // Check varargs. - test_varargs ("s, d' f .", "string", 65, 34.234); - test_varargs_macros (); - - // Check flexible array members. - struct incomplete_array *ia = - malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); - ia->datasize = 10; - for (int i = 0; i < ia->datasize; ++i) - ia->data[i] = i * 1.234; - - // Check named initializers. - struct named_init ni = { - .number = 34, - .name = L"Test wide string", - .average = 543.34343, - }; - - ni.number = 58; - - int dynamic_array[ni.number]; - dynamic_array[ni.number - 1] = 543; - - // work around unused variable warnings - return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' - || dynamic_array[ni.number - 1] != 543); - - ; - return 0; -} -_ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c99=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c99" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c99" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c99" != xno; then : - -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports C99 structure initialization" >&5 -$as_echo_n "checking whether the compiler supports C99 structure initialization... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports C99 structure initialization" >&5 +printf %s "checking whether the compiler supports C99 structure initialization... " >&6; } ac_ext=c @@ -6554,17 +6645,18 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu int main() { struct foo_s foo[] = { { .i1 = 1, .i2 = 1 }, { .i1 = 2, .i2 = 2 }, { .i1 = 0, .i2 = 0 } }; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -$as_echo "#define MISSING_C99_STRUCT_INIT 1" >>confdefs.h +printf "%s\n" "#define MISSING_C99_STRUCT_INIT 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -6576,14 +6668,15 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compile/link hardening flags" >&5 -$as_echo_n "checking for compile/link hardening flags... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compile/link hardening flags" >&5 +printf %s "checking for compile/link hardening flags... " >&6; } # Check whether --with-hardenfile was given. -if test "${with_hardenfile+set}" = set; then : +if test ${with_hardenfile+y} +then : withval=$with_hardenfile; -else +else $as_nop with_hardenfile=no fi @@ -6605,13 +6698,13 @@ fi case "$GENHARDFLAG" in OK) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: in file $GENHARDFLAGFILE" >&5 -$as_echo "in file $GENHARDFLAGFILE" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: in file $GENHARDFLAGFILE" >&5 +printf "%s\n" "in file $GENHARDFLAGFILE" >&6; } rm genHardFlags.err genHardFlags.i ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed." >&5 -$as_echo "failed." >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed." >&5 +printf "%s\n" "failed." >&6; } as_fn_error $? "Problem with genHardFlags!" "$LINENO" 5 ;; esac @@ -6623,8 +6716,8 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if we need ylwrap VPATH hack" >&5 -$as_echo_n "checking to see if we need ylwrap VPATH hack... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking to see if we need ylwrap VPATH hack" >&5 +printf %s "checking to see if we need ylwrap VPATH hack... " >&6; } ntp_vpath_hack="no" case "$srcdir::${force_ntp_vpath_hack-no}" in .::*) @@ -6638,8 +6731,8 @@ case "$srcdir::${force_ntp_vpath_hack-no}" in ntp_vpath_hack="yes" esac esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_vpath_hack" >&5 -$as_echo "$ntp_vpath_hack" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_vpath_hack" >&5 +printf "%s\n" "$ntp_vpath_hack" >&6; } if test x$ntp_vpath_hack = xyes; then VPATH_HACK_TRUE= VPATH_HACK_FALSE='#' @@ -6651,14 +6744,15 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for install dir and man conventions" >&5 -$as_echo_n "checking for install dir and man conventions... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for install dir and man conventions" >&5 +printf %s "checking for install dir and man conventions... " >&6; } # Check whether --with-locfile was given. -if test "${with_locfile+set}" = set; then : +if test ${with_locfile+y} +then : withval=$with_locfile; -else +else $as_nop with_locfile=no fi @@ -6680,13 +6774,13 @@ fi case "$GENLOCINFO" in OK) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: in file $GENLOCINFOFILE" >&5 -$as_echo "in file $GENLOCINFOFILE" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: in file $GENLOCINFOFILE" >&5 +printf "%s\n" "in file $GENLOCINFOFILE" >&6; } rm genLocInfo.err genLocInfo.i ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed." >&5 -$as_echo "failed." >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed." >&5 +printf "%s\n" "failed." >&6; } as_fn_error $? "Problem with genLocInfo!" "$LINENO" 5 ;; esac @@ -6799,16 +6893,18 @@ fi -if test -n "$ac_tool_prefix"; then + + if test -n "$ac_tool_prefix"; then for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -6816,11 +6912,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6831,11 +6931,11 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6848,11 +6948,12 @@ if test -z "$AR"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else @@ -6860,11 +6961,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6875,11 +6980,11 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6891,8 +6996,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -6901,11 +7006,12 @@ fi : ${AR=ar} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 -$as_echo_n "checking the archiver ($AR) interface... " >&6; } -if ${am_cv_ar_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 +printf %s "checking the archiver ($AR) interface... " >&6; } +if test ${am_cv_ar_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -6917,12 +7023,13 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu /* end confdefs.h. */ int some_variable = 0; _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=ar @@ -6931,7 +7038,7 @@ if ac_fn_c_try_compile "$LINENO"; then : { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=lib @@ -6942,7 +7049,7 @@ if ac_fn_c_try_compile "$LINENO"; then : rm -f conftest.lib libconftest.a fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -6950,8 +7057,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 -$as_echo "$am_cv_ar_interface" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 +printf "%s\n" "$am_cv_ar_interface" >&6; } case $am_cv_ar_interface in ar) @@ -6971,11 +7078,11 @@ unknown) esac - # So far, the only shared library we might use is libopts. # It's a small library - we might as well use a static version of it. # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : +if test ${enable_shared+y} +then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; @@ -6993,7 +7100,7 @@ if test "${enable_shared+set}" = set; then : IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_shared=no fi @@ -7007,8 +7114,8 @@ fi case `pwd` in *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac @@ -7028,6 +7135,7 @@ macro_revision='2.4.6' + ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within @@ -7051,8 +7159,8 @@ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +printf %s "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then @@ -7078,12 +7186,12 @@ func_echo_all () } case $ECHO in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; + printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +printf "%s\n" "printf" >&6; } ;; + print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +printf "%s\n" "print -r" >&6; } ;; + *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +printf "%s\n" "cat" >&6; } ;; esac @@ -7099,11 +7207,12 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" @@ -7117,10 +7226,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED @@ -7129,13 +7243,13 @@ case `"$ac_path_SED" --version 2>&1` in ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" + printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -7163,8 +7277,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed @@ -7181,11 +7295,12 @@ Xsed="$SED -e 1s/^X//" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +printf %s "checking for fgrep... " >&6; } +if test ${ac_cv_path_FGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else @@ -7196,10 +7311,15 @@ else for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in fgrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP @@ -7208,13 +7328,13 @@ case `"$ac_path_FGREP" --version 2>&1` in ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" + printf "%s\n" 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -7243,8 +7363,8 @@ fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +printf "%s\n" "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" @@ -7269,17 +7389,18 @@ test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : +if test ${with_gnu_ld+y} +then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else +else $as_nop with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw @@ -7308,15 +7429,16 @@ $as_echo_n "checking for ld used by $CC... " >&6; } ;; esac elif test yes = "$with_gnu_ld"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do @@ -7345,18 +7467,19 @@ fi LD=$lt_cv_path_LD if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld @@ -7379,11 +7502,12 @@ with_gnu_ld=$lt_cv_prog_gnu_ld -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test ${lt_cv_path_NM+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM @@ -7433,8 +7557,8 @@ else : ${lt_cv_path_NM=no} fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +printf "%s\n" "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else @@ -7447,11 +7571,12 @@ else do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else @@ -7459,11 +7584,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7474,11 +7603,11 @@ fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +printf "%s\n" "$DUMPBIN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7491,11 +7620,12 @@ if test -z "$DUMPBIN"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else @@ -7503,11 +7633,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7518,11 +7652,11 @@ fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7534,8 +7668,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN @@ -7563,11 +7697,12 @@ test -z "$NM" && NM=nm -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +printf %s "checking the name lister ($NM) interface... " >&6; } +if test ${lt_cv_nm_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) @@ -7583,26 +7718,27 @@ else fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +printf "%s\n" "$lt_cv_nm_interface" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +printf %s "checking the maximum length of command line arguments... " >&6; } +if test ${lt_cv_sys_max_cmd_len+y} +then : + printf %s "(cached) " >&6 +else $as_nop i=0 teststring=ABCD @@ -7729,11 +7865,11 @@ else fi if test -n "$lt_cv_sys_max_cmd_len"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 +printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len @@ -7777,11 +7913,12 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +printf %s "checking how to convert $build file names to $host format... " >&6; } +if test ${lt_cv_to_host_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $host in *-*-mingw* ) case $build in @@ -7817,18 +7954,19 @@ esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +printf %s "checking how to convert $build file names to toolchain format... " >&6; } +if test ${lt_cv_to_tool_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in @@ -7844,22 +7982,23 @@ esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +printf %s "checking for $LD option to reload object files... " >&6; } +if test ${lt_cv_ld_reload_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_reload_flag='-r' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; @@ -7892,11 +8031,12 @@ esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else @@ -7904,11 +8044,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7919,11 +8063,11 @@ fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7932,11 +8076,12 @@ if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else @@ -7944,11 +8089,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7959,11 +8108,11 @@ fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then @@ -7971,8 +8120,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP @@ -7991,11 +8140,12 @@ test -z "$OBJDUMP" && OBJDUMP=objdump -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +printf %s "checking how to recognize dependent libraries... " >&6; } +if test ${lt_cv_deplibs_check_method+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' @@ -8191,8 +8341,8 @@ os2*) esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no @@ -8236,11 +8386,12 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else @@ -8248,11 +8399,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8263,11 +8418,11 @@ fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8276,11 +8431,12 @@ if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else @@ -8288,11 +8444,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8303,11 +8463,11 @@ fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then @@ -8315,8 +8475,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL @@ -8336,11 +8496,12 @@ test -z "$DLLTOOL" && DLLTOOL=dlltool -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +printf %s "checking how to associate runtime and link libraries... " >&6; } +if test ${lt_cv_sharedlib_from_linklib_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in @@ -8363,8 +8524,8 @@ cygwin* | mingw* | pw32* | cegcc*) esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO @@ -8379,11 +8540,12 @@ if test -n "$ac_tool_prefix"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -8391,11 +8553,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8406,11 +8572,11 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8423,11 +8589,12 @@ if test -z "$AR"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else @@ -8435,11 +8602,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8450,11 +8621,11 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8466,8 +8637,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -8487,30 +8658,32 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +printf %s "checking for archiver @FILE support... " >&6; } +if test ${lt_cv_ar_at_file+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. @@ -8518,7 +8691,7 @@ if ac_fn_c_try_compile "$LINENO"; then : { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ @@ -8527,11 +8700,11 @@ if ac_fn_c_try_compile "$LINENO"; then : rm -f conftest.* libconftest.a fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +printf "%s\n" "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= @@ -8548,11 +8721,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else @@ -8560,11 +8734,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8575,11 +8753,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8588,11 +8766,12 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else @@ -8600,11 +8779,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8615,11 +8798,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -8627,8 +8810,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -8647,11 +8830,12 @@ test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else @@ -8659,11 +8843,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8674,11 +8862,11 @@ fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8687,11 +8875,12 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else @@ -8699,11 +8888,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8714,11 +8907,11 @@ fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -8726,8 +8919,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -8816,11 +9009,12 @@ compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +printf %s "checking command to parse $NM output from $compiler object... " >&6; } +if test ${lt_cv_sys_global_symbol_pipe+y} +then : + printf %s "(cached) " >&6 +else $as_nop # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] @@ -8972,14 +9166,14 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then @@ -9048,7 +9242,7 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi @@ -9083,11 +9277,11 @@ if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +printf "%s\n" "failed" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +printf "%s\n" "ok" >&6; } fi # Response file support. @@ -9133,13 +9327,14 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : +if test ${with_sysroot+y} +then : withval=$with_sysroot; -else +else $as_nop with_sysroot=no fi @@ -9157,24 +9352,25 @@ case $with_sysroot in #( no|'') ;; #( *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 -$as_echo "$with_sysroot" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +printf "%s\n" "${lt_sysroot:-no}" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 -$as_echo_n "checking for a working dd... " >&6; } -if ${ac_cv_path_lt_DD+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +printf %s "checking for a working dd... " >&6; } +if test ${ac_cv_path_lt_DD+y} +then : + printf %s "(cached) " >&6 +else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} @@ -9185,10 +9381,15 @@ if test -z "$lt_DD"; then for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in dd; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in dd + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ @@ -9208,15 +9409,16 @@ fi rm -f conftest.i conftest2.i conftest.out fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 -$as_echo "$ac_cv_path_lt_DD" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +printf "%s\n" "$ac_cv_path_lt_DD" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 -$as_echo_n "checking how to truncate binary pipes... " >&6; } -if ${lt_cv_truncate_bin+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +printf %s "checking how to truncate binary pipes... " >&6; } +if test ${lt_cv_truncate_bin+y} +then : + printf %s "(cached) " >&6 +else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= @@ -9227,8 +9429,8 @@ fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 -$as_echo "$lt_cv_truncate_bin" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +printf "%s\n" "$lt_cv_truncate_bin" >&6; } @@ -9251,7 +9453,8 @@ func_cc_basename () } # Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : +if test ${enable_libtool_lock+y} +then : enableval=$enable_libtool_lock; fi @@ -9267,7 +9470,7 @@ ia64-*-hpux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) @@ -9287,7 +9490,7 @@ ia64-*-hpux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in @@ -9325,7 +9528,7 @@ mips64*-*linux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in @@ -9366,7 +9569,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) @@ -9429,11 +9632,12 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +printf %s "checking whether the C compiler needs -belf... " >&6; } +if test ${lt_cv_cc_needs_belf+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -9444,19 +9648,20 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_cc_needs_belf=yes -else +else $as_nop lt_cv_cc_needs_belf=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -9465,8 +9670,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS @@ -9479,7 +9684,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) @@ -9516,11 +9721,12 @@ need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else @@ -9528,11 +9734,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9543,11 +9753,11 @@ fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +printf "%s\n" "$MANIFEST_TOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9556,11 +9766,12 @@ if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else @@ -9568,11 +9779,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9583,11 +9798,11 @@ fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then @@ -9595,8 +9810,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL @@ -9606,11 +9821,12 @@ else fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if test ${lt_cv_path_mainfest_tool+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out @@ -9620,8 +9836,8 @@ else fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi @@ -9636,11 +9852,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else @@ -9648,11 +9865,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9663,11 +9884,11 @@ fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +printf "%s\n" "$DSYMUTIL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9676,11 +9897,12 @@ if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else @@ -9688,11 +9910,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9703,11 +9929,11 @@ fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then @@ -9715,8 +9941,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL @@ -9728,11 +9954,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else @@ -9740,11 +9967,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9755,11 +9986,11 @@ fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +printf "%s\n" "$NMEDIT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9768,11 +9999,12 @@ if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else @@ -9780,11 +10012,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9795,11 +10031,11 @@ fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +printf "%s\n" "$ac_ct_NMEDIT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then @@ -9807,8 +10043,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT @@ -9820,11 +10056,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else @@ -9832,11 +10069,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9847,11 +10088,11 @@ fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +printf "%s\n" "$LIPO" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9860,11 +10101,12 @@ if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else @@ -9872,11 +10114,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9887,11 +10133,11 @@ fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +printf "%s\n" "$ac_ct_LIPO" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then @@ -9899,8 +10145,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO @@ -9912,11 +10158,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else @@ -9924,11 +10171,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9939,11 +10190,11 @@ fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +printf "%s\n" "$OTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9952,11 +10203,12 @@ if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else @@ -9964,11 +10216,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9979,11 +10235,11 @@ fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +printf "%s\n" "$ac_ct_OTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then @@ -9991,8 +10247,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL @@ -10004,11 +10260,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else @@ -10016,11 +10273,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10031,11 +10292,11 @@ fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +printf "%s\n" "$OTOOL64" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -10044,11 +10305,12 @@ if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else @@ -10056,11 +10318,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10071,11 +10337,11 @@ fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +printf "%s\n" "$ac_ct_OTOOL64" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then @@ -10083,8 +10349,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 @@ -10119,11 +10385,12 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +printf %s "checking for -single_module linker flag... " >&6; } +if test ${lt_cv_apple_cc_single_mod+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override @@ -10152,14 +10419,15 @@ else rm -f conftest.* fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +printf %s "checking for -exported_symbols_list linker flag... " >&6; } +if test ${lt_cv_ld_exported_symbols_list+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym @@ -10168,31 +10436,33 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_ld_exported_symbols_list=yes -else +else $as_nop lt_cv_ld_exported_symbols_list=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +printf %s "checking for -force_load linker flag... " >&6; } +if test ${lt_cv_ld_force_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} @@ -10220,8 +10490,8 @@ _LT_EOF rm -rf conftest.dSYM fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +printf "%s\n" "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; @@ -10292,19 +10562,14 @@ func_munge_path_list () esac } -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF +if test "x$ac_cv_header_dlfcn_h" = xyes +then : + printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi -done - @@ -10321,7 +10586,8 @@ done # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : +if test ${enable_static+y} +then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; @@ -10339,7 +10605,7 @@ if test "${enable_static+set}" = set; then : IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_static=yes fi @@ -10353,7 +10619,8 @@ fi # Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : +if test ${with_pic+y} +then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; @@ -10370,7 +10637,7 @@ if test "${with_pic+set}" = set; then : IFS=$lt_save_ifs ;; esac -else +else $as_nop pic_mode=default fi @@ -10382,7 +10649,8 @@ fi # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : +if test ${enable_fast_install+y} +then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; @@ -10400,7 +10668,7 @@ if test "${enable_fast_install+set}" = set; then : IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_fast_install=yes fi @@ -10414,11 +10682,12 @@ fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 -$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +printf %s "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. -if test "${with_aix_soname+set}" = set; then : +if test ${with_aix_soname+y} +then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; @@ -10427,18 +10696,19 @@ if test "${with_aix_soname+set}" = set; then : ;; esac lt_cv_with_aix_soname=$with_aix_soname -else - if ${lt_cv_with_aix_soname+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + if test ${lt_cv_with_aix_soname+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 -$as_echo "$with_aix_soname" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', @@ -10520,11 +10790,12 @@ if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +printf %s "checking for objdir... " >&6; } +if test ${lt_cv_objdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then @@ -10535,17 +10806,15 @@ else fi rmdir .libs 2>/dev/null fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF +printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h @@ -10591,11 +10860,12 @@ test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +printf %s "checking for ${ac_tool_prefix}file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. @@ -10644,11 +10914,11 @@ fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -10657,11 +10927,12 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +printf %s "checking for file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. @@ -10710,11 +10981,11 @@ fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -10799,11 +11070,12 @@ if test yes = "$GCC"; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test ${lt_cv_prog_compiler_rtti_exceptions+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -10834,8 +11106,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" @@ -11192,26 +11464,28 @@ case $host_os in ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -11242,8 +11516,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in @@ -11271,11 +11545,12 @@ fi # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" @@ -11299,8 +11574,8 @@ else LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : @@ -11314,11 +11589,12 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest @@ -11361,19 +11637,20 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest @@ -11416,8 +11693,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } @@ -11425,19 +11702,19 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else @@ -11449,8 +11726,8 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= @@ -12005,21 +12282,23 @@ _LT_EOF if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -12034,7 +12313,7 @@ if ac_fn_c_try_link "$LINENO"; then : lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib @@ -12058,21 +12337,23 @@ fi if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -12087,7 +12368,7 @@ if ac_fn_c_try_link "$LINENO"; then : lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib @@ -12338,11 +12619,12 @@ fi # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +printf %s "checking if $CC understands -b... " >&6; } +if test ${lt_cv_prog_compiler__b+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" @@ -12366,8 +12648,8 @@ else LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' @@ -12407,28 +12689,30 @@ fi # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if test ${lt_cv_irix_exported_symbol+y} +then : + printf %s "(cached) " >&6 +else $as_nop save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_irix_exported_symbol=yes -else +else $as_nop lt_cv_irix_exported_symbol=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi @@ -12708,8 +12992,8 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +printf "%s\n" "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld @@ -12745,18 +13029,19 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc+y} +then : + printf %s "(cached) " >&6 +else $as_nop $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest @@ -12774,7 +13059,7 @@ else if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no @@ -12788,8 +13073,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac @@ -12948,8 +13233,8 @@ esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in @@ -13510,9 +13795,10 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir @@ -13522,19 +13808,21 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : +if ac_fn_c_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : lt_cv_shlibpath_overrides_runpath=yes fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir @@ -13766,8 +14054,8 @@ uts4*) dynamic_linker=no ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -13888,8 +14176,8 @@ configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || @@ -13913,8 +14201,8 @@ else # directories. hardcode_action=unsupported fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +printf "%s\n" "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then @@ -13958,11 +14246,12 @@ else darwin*) # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -13971,32 +14260,31 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dlopen (); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlopen=yes -else +else $as_nop ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else +else $as_nop lt_cv_dlopen=dyld lt_cv_dlopen_libs= @@ -14016,14 +14304,16 @@ fi *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : +if test "x$ac_cv_func_shl_load" = xyes +then : lt_cv_dlopen=shl_load -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +printf %s "checking for shl_load in -ldld... " >&6; } +if test ${ac_cv_lib_dld_shl_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14032,41 +14322,42 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char shl_load (); int -main () +main (void) { return shl_load (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dld_shl_load=yes -else +else $as_nop ac_cv_lib_dld_shl_load=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes +then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld -else +else $as_nop ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : +if test "x$ac_cv_func_dlopen" = xyes +then : lt_cv_dlopen=dlopen -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14075,37 +14366,37 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dlopen (); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlopen=yes -else +else $as_nop ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +printf %s "checking for dlopen in -lsvld... " >&6; } +if test ${ac_cv_lib_svld_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14114,37 +14405,37 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dlopen (); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_svld_dlopen=yes -else +else $as_nop ac_cv_lib_svld_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +printf %s "checking for dld_link in -ldld... " >&6; } +if test ${ac_cv_lib_dld_dld_link+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14153,30 +14444,29 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dld_link (); int -main () +main (void) { return dld_link (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dld_dld_link=yes -else +else $as_nop ac_cv_lib_dld_dld_link=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes +then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi @@ -14215,11 +14505,12 @@ fi save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +printf %s "checking whether a program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else @@ -14298,7 +14589,7 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -14316,16 +14607,17 @@ rm -fr conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +printf "%s\n" "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +printf %s "checking whether a statically linked program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self_static+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else @@ -14404,7 +14696,7 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -14422,8 +14714,8 @@ rm -fr conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS @@ -14461,13 +14753,13 @@ fi striplib= old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +printf %s "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in @@ -14475,16 +14767,16 @@ else if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; esac fi @@ -14501,13 +14793,13 @@ fi # Report what library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +printf %s "checking if libtool supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +printf "%s\n" "$can_build_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and @@ -14531,15 +14823,15 @@ $as_echo_n "checking whether to build shared libraries... " >&6; } fi ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +printf "%s\n" "$enable_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +printf "%s\n" "$enable_static" >&6; } @@ -14592,34 +14884,154 @@ case "${enable_libopts_install+set}" in *) enable_libopts_install=no ;; esac enable_nls=no -ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -if test "x$ac_cv_type_pid_t" = xyes; then : +# Autoupdate added the next two lines to ensure that your configure +# script's behavior did not change. They are probably safe to remove. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + + +ac_func= +for ac_item in $ac_func_c_list +do + if test $ac_func; then + ac_fn_c_check_func "$LINENO" $ac_func ac_cv_func_$ac_func + if eval test \"x\$ac_cv_func_$ac_func\" = xyes; then + echo "#define $ac_item 1" >> confdefs.h + fi + ac_func= + else + ac_func=$ac_item + fi +done + + ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default +" +if test "x$ac_cv_type_pid_t" = xyes +then : + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + +int +main (void) +{ + + ; + return 0; +} -cat >>confdefs.h <<_ACEOF -#define pid_t int _ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_pid_type='int' +else $as_nop + ac_pid_type='__int64' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h + fi + + + + ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 -$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if eval \${$as_ac_Header+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +printf %s "checking for $ac_hdr that defines DIR... " >&6; } +if eval test \${$as_ac_Header+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int -main () +main (void) { if ((DIR *) 0) return 0; @@ -14627,19 +15039,21 @@ return 0; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$as_ac_Header=yes" -else +else $as_nop eval "$as_ac_Header=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$as_ac_Header - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break @@ -14648,11 +15062,12 @@ fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14660,56 +15075,59 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char opendir (); int -main () +main (void) { return opendir (); ; return 0; } _ACEOF -for ac_lib in '' dir; do +for ac_lib in '' dir +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_opendir=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : + if test ${ac_cv_search_opendir+y} +then : break fi done -if ${ac_cv_search_opendir+:} false; then : +if test ${ac_cv_search_opendir+y} +then : -else +else $as_nop ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14717,46 +15135,48 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char opendir (); int -main () +main (void) { return opendir (); ; return 0; } _ACEOF -for ac_lib in '' x; do +for ac_lib in '' x +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_opendir=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : + if test ${ac_cv_search_opendir+y} +then : break fi done -if ${ac_cv_search_opendir+:} false; then : +if test ${ac_cv_search_opendir+y} +then : -else +else $as_nop ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi @@ -14767,135 +15187,258 @@ fi # ================= # AC_CHECK_HEADERS # ================= - for ac_header in \ - sys/mman.h sys/param.h sys/poll.h sys/procset.h \ - sys/select.h sys/socket.h sys/stropts.h sys/time.h \ - sys/un.h sys/wait.h dlfcn.h errno.h \ - fcntl.h libgen.h libintl.h memory.h \ - netinet/in.h setjmp.h stdbool.h sysexits.h \ - unistd.h utime.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mman_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_MMAN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/poll.h" "ac_cv_header_sys_poll_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_poll_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_POLL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/procset.h" "ac_cv_header_sys_procset_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_procset_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PROCSET_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_select_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SELECT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_socket_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/stropts.h" "ac_cv_header_sys_stropts_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_stropts_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_STROPTS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/un.h" "ac_cv_header_sys_un_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_un_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_UN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_wait_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_WAIT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" +if test "x$ac_cv_header_dlfcn_h" = xyes +then : + printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_errno_h" = xyes +then : + printf "%s\n" "#define HAVE_ERRNO_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" +if test "x$ac_cv_header_fcntl_h" = xyes +then : + printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "libgen.h" "ac_cv_header_libgen_h" "$ac_includes_default" +if test "x$ac_cv_header_libgen_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBGEN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBINTL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "memory.h" "ac_cv_header_memory_h" "$ac_includes_default" +if test "x$ac_cv_header_memory_h" = xyes +then : + printf "%s\n" "#define HAVE_MEMORY_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "setjmp.h" "ac_cv_header_setjmp_h" "$ac_includes_default" +if test "x$ac_cv_header_setjmp_h" = xyes +then : + printf "%s\n" "#define HAVE_SETJMP_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" "$ac_includes_default" +if test "x$ac_cv_header_stdbool_h" = xyes +then : + printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sysexits.h" "ac_cv_header_sysexits_h" "$ac_includes_default" +if test "x$ac_cv_header_sysexits_h" = xyes +then : + printf "%s\n" "#define HAVE_SYSEXITS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "utime.h" "ac_cv_header_utime_h" "$ac_includes_default" +if test "x$ac_cv_header_utime_h" = xyes +then : + printf "%s\n" "#define HAVE_UTIME_H 1" >>confdefs.h fi -done - - for ac_header in stdarg.h varargs.h + for ac_header in stdarg.h varargs.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF lo_have_arg_hdr=true;break -else +else $as_nop lo_have_arg_hdr=false fi done - - for ac_header in string.h strings.h + for ac_header in string.h strings.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF lo_have_str_hdr=true;break -else +else $as_nop lo_have_str_hdr=false fi done - - for ac_header in limits.h sys/limits.h values.h + for ac_header in limits.h sys/limits.h values.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF lo_have_lim_hdr=true;break -else +else $as_nop lo_have_lim_hdr=false fi done - - for ac_header in inttypes.h stdint.h + for ac_header in inttypes.h stdint.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF lo_have_typ_hdr=true;break -else +else $as_nop lo_have_typ_hdr=false fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stdnoreturn.h" >&5 -$as_echo_n "checking for working stdnoreturn.h... " >&6; } -if ${gl_cv_header_working_stdnoreturn_h+:} false; then : - $as_echo_n "(cached) " >&6 -else + case "$host_os" in + cygwin*) + STDNORETURN_H='stdnoreturn.h' + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working stdnoreturn.h" >&5 +printf %s "checking for working stdnoreturn.h... " >&6; } +if test ${gl_cv_header_working_stdnoreturn_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - #include - /* Do not check for 'noreturn' after the return type. - C11 allows it, but it's rarely done that way - and circa-2012 bleeding-edge GCC rejects it when given - -Werror=old-style-declaration. */ - noreturn void foo1 (void) { exit (0); } - _Noreturn void foo2 (void) { exit (0); } - int testit (int argc, char **argv) { - if (argc & 1) - return 0; - (argv[0][0] ? foo1 : foo2) (); - } + #include + /* Do not check for 'noreturn' after the return type. + C11 allows it, but it's rarely done that way + and circa-2012 bleeding-edge GCC rejects it when given + -Werror=old-style-declaration. */ + noreturn void foo1 (void) { exit (0); } + _Noreturn void foo2 (void) { exit (0); } + int testit (int argc, char **argv) + { + if (argc & 1) + return 0; + (argv[0][0] ? foo1 : foo2) (); + } int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : gl_cv_header_working_stdnoreturn_h=yes -else +else $as_nop gl_cv_header_working_stdnoreturn_h=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdnoreturn_h" >&5 -$as_echo "$gl_cv_header_working_stdnoreturn_h" >&6; } - - if test $gl_cv_header_working_stdnoreturn_h = yes; then - STDNORETURN_H='' - else - STDNORETURN_H='stdnoreturn.h' - fi - +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdnoreturn_h" >&5 +printf "%s\n" "$gl_cv_header_working_stdnoreturn_h" >&6; } + if test $gl_cv_header_working_stdnoreturn_h = yes; then + STDNORETURN_H='' + else + STDNORETURN_H='stdnoreturn.h' + fi + ;; + esac if test -n "$STDNORETURN_H"; then GL_GENERATE_STDNORETURN_H_TRUE= @@ -14911,36 +15454,44 @@ fi # check for various programs used during the build. # On OS/X, "wchar.h" needs "runetype.h" to work properly. # ---------------------------------------------------------------------- - for ac_header in runetype.h wchar.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " + ac_fn_c_check_header_compile "$LINENO" "runetype.h" "ac_cv_header_runetype_h" " $ac_includes_default #if HAVE_RUNETYPE_H # include #endif " -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +if test "x$ac_cv_header_runetype_h" = xyes +then : + printf "%s\n" "#define HAVE_RUNETYPE_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "wchar.h" "ac_cv_header_wchar_h" " + $ac_includes_default + #if HAVE_RUNETYPE_H + # include + #endif + +" +if test "x$ac_cv_header_wchar_h" = xyes +then : + printf "%s\n" "#define HAVE_WCHAR_H 1" >>confdefs.h fi -done - # Check whether --enable-nls was given. -if test "${enable_nls+set}" = set; then : +if test ${enable_nls+y} +then : enableval=$enable_nls; fi if test "x$enable_nls" != "xno" && \ - test "X${ac_cv_header_libintl_h}" = Xyes; then : + test "X${ac_cv_header_libintl_h}" = Xyes +then : -$as_echo "#define ENABLE_NLS 1" >>confdefs.h +printf "%s\n" "#define ENABLE_NLS 1" >>confdefs.h fi @@ -14972,11 +15523,10 @@ fi # Checks for typedefs # ---------------------------------------------------------------------- ac_fn_c_check_type "$LINENO" "wchar_t" "ac_cv_type_wchar_t" "$ac_includes_default" -if test "x$ac_cv_type_wchar_t" = xyes; then : +if test "x$ac_cv_type_wchar_t" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_WCHAR_T 1 -_ACEOF +printf "%s\n" "#define HAVE_WCHAR_T 1" >>confdefs.h fi @@ -14991,120 +15541,107 @@ fi #endif " -if test "x$ac_cv_type_wint_t" = xyes; then : +if test "x$ac_cv_type_wint_t" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_WINT_T 1 -_ACEOF +printf "%s\n" "#define HAVE_WINT_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "int8_t" "ac_cv_type_int8_t" "$ac_includes_default" -if test "x$ac_cv_type_int8_t" = xyes; then : +if test "x$ac_cv_type_int8_t" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_INT8_T 1 -_ACEOF +printf "%s\n" "#define HAVE_INT8_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "uint8_t" "ac_cv_type_uint8_t" "$ac_includes_default" -if test "x$ac_cv_type_uint8_t" = xyes; then : +if test "x$ac_cv_type_uint8_t" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_UINT8_T 1 -_ACEOF +printf "%s\n" "#define HAVE_UINT8_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "int16_t" "ac_cv_type_int16_t" "$ac_includes_default" -if test "x$ac_cv_type_int16_t" = xyes; then : +if test "x$ac_cv_type_int16_t" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_INT16_T 1 -_ACEOF +printf "%s\n" "#define HAVE_INT16_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "uint16_t" "ac_cv_type_uint16_t" "$ac_includes_default" -if test "x$ac_cv_type_uint16_t" = xyes; then : +if test "x$ac_cv_type_uint16_t" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_UINT16_T 1 -_ACEOF +printf "%s\n" "#define HAVE_UINT16_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "$ac_includes_default" -if test "x$ac_cv_type_int32_t" = xyes; then : +if test "x$ac_cv_type_int32_t" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_INT32_T 1 -_ACEOF +printf "%s\n" "#define HAVE_INT32_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default" -if test "x$ac_cv_type_uint32_t" = xyes; then : +if test "x$ac_cv_type_uint32_t" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_UINT32_T 1 -_ACEOF +printf "%s\n" "#define HAVE_UINT32_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default" -if test "x$ac_cv_type_intptr_t" = xyes; then : +if test "x$ac_cv_type_intptr_t" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_INTPTR_T 1 -_ACEOF +printf "%s\n" "#define HAVE_INTPTR_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" -if test "x$ac_cv_type_uintptr_t" = xyes; then : +if test "x$ac_cv_type_uintptr_t" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_UINTPTR_T 1 -_ACEOF +printf "%s\n" "#define HAVE_UINTPTR_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "uint_t" "ac_cv_type_uint_t" "$ac_includes_default" -if test "x$ac_cv_type_uint_t" = xyes; then : +if test "x$ac_cv_type_uint_t" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_UINT_T 1 -_ACEOF +printf "%s\n" "#define HAVE_UINT_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -if test "x$ac_cv_type_pid_t" = xyes; then : +if test "x$ac_cv_type_pid_t" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_PID_T 1 -_ACEOF +printf "%s\n" "#define HAVE_PID_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : +if test "x$ac_cv_type_size_t" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_SIZE_T 1 -_ACEOF +printf "%s\n" "#define HAVE_SIZE_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" -if test "x$ac_cv_type_ptrdiff_t" = xyes; then : +if test "x$ac_cv_type_ptrdiff_t" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_PTRDIFF_T 1 -_ACEOF +printf "%s\n" "#define HAVE_PTRDIFF_T 1" >>confdefs.h fi @@ -15113,17 +15650,19 @@ fi # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char *" >&5 -$as_echo_n "checking size of char *... " >&6; } -if ${ac_cv_sizeof_char_p+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char *))" "ac_cv_sizeof_char_p" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of char *" >&5 +printf %s "checking size of char *... " >&6; } +if test ${ac_cv_sizeof_char_p+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char *))" "ac_cv_sizeof_char_p" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_char_p" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (char *) See \`config.log' for more details" "$LINENO" 5; } else @@ -15132,31 +15671,31 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char_p" >&5 -$as_echo "$ac_cv_sizeof_char_p" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char_p" >&5 +printf "%s\n" "$ac_cv_sizeof_char_p" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_CHAR_P $ac_cv_sizeof_char_p -_ACEOF +printf "%s\n" "#define SIZEOF_CHAR_P $ac_cv_sizeof_char_p" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 -$as_echo_n "checking size of int... " >&6; } -if ${ac_cv_sizeof_int+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +printf %s "checking size of int... " >&6; } +if test ${ac_cv_sizeof_int+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_int" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else @@ -15165,31 +15704,31 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 -$as_echo "$ac_cv_sizeof_int" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +printf "%s\n" "$ac_cv_sizeof_int" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT $ac_cv_sizeof_int -_ACEOF +printf "%s\n" "#define SIZEOF_INT $ac_cv_sizeof_int" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if ${ac_cv_sizeof_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +printf %s "checking size of long... " >&6; } +if test ${ac_cv_sizeof_long+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else @@ -15198,31 +15737,31 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +printf "%s\n" "$ac_cv_sizeof_long" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF +printf "%s\n" "#define SIZEOF_LONG $ac_cv_sizeof_long" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 -$as_echo_n "checking size of short... " >&6; } -if ${ac_cv_sizeof_short+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 +printf %s "checking size of short... " >&6; } +if test ${ac_cv_sizeof_short+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_short" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (short) See \`config.log' for more details" "$LINENO" 5; } else @@ -15231,25 +15770,24 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 -$as_echo "$ac_cv_sizeof_short" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 +printf "%s\n" "$ac_cv_sizeof_short" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SHORT $ac_cv_sizeof_short -_ACEOF +printf "%s\n" "#define SIZEOF_SHORT $ac_cv_sizeof_short" >>confdefs.h # ------------ # AC_CHECK_LIB # ------------ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pathfind in -lgen" >&5 -$as_echo_n "checking for pathfind in -lgen... " >&6; } -if ${ac_cv_lib_gen_pathfind+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pathfind in -lgen" >&5 +printf %s "checking for pathfind in -lgen... " >&6; } +if test ${ac_cv_lib_gen_pathfind+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lgen $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15258,43 +15796,41 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pathfind (); int -main () +main (void) { return pathfind (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_gen_pathfind=yes -else +else $as_nop ac_cv_lib_gen_pathfind=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gen_pathfind" >&5 -$as_echo "$ac_cv_lib_gen_pathfind" >&6; } -if test "x$ac_cv_lib_gen_pathfind" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBGEN 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gen_pathfind" >&5 +printf "%s\n" "$ac_cv_lib_gen_pathfind" >&6; } +if test "x$ac_cv_lib_gen_pathfind" = xyes +then : + printf "%s\n" "#define HAVE_LIBGEN 1" >>confdefs.h LIBS="-lgen $LIBS" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettext in -lintl" >&5 -$as_echo_n "checking for gettext in -lintl... " >&6; } -if ${ac_cv_lib_intl_gettext+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gettext in -lintl" >&5 +printf %s "checking for gettext in -lintl... " >&6; } +if test ${ac_cv_lib_intl_gettext+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15303,95 +15839,65 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char gettext (); int -main () +main (void) { return gettext (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_intl_gettext=yes -else +else $as_nop ac_cv_lib_intl_gettext=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_gettext" >&5 -$as_echo "$ac_cv_lib_intl_gettext" >&6; } -if test "x$ac_cv_lib_intl_gettext" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBINTL 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_gettext" >&5 +printf "%s\n" "$ac_cv_lib_intl_gettext" >&6; } +if test "x$ac_cv_lib_intl_gettext" = xyes +then : + printf "%s\n" "#define HAVE_LIBINTL 1" >>confdefs.h LIBS="-lintl $LIBS" fi - for ac_func in vprintf -do : - ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" -if test "x$ac_cv_func_vprintf" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_VPRINTF 1 -_ACEOF -ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" -if test "x$ac_cv_func__doprnt" = xyes; then : +if test "x$ac_cv_func_vprintf" = xno +then : + ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" +if test "x$ac_cv_func__doprnt" = xyes +then : -$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h +printf "%s\n" "#define HAVE_DOPRNT 1" >>confdefs.h fi fi -done - for ac_header in vfork.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" -if test "x$ac_cv_header_vfork_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_VFORK_H 1 -_ACEOF - -fi - -done - -for ac_func in fork vfork -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - if test "x$ac_cv_func_fork" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 -$as_echo_n "checking for working fork... " >&6; } -if ${ac_cv_func_fork_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 +printf %s "checking for working fork... " >&6; } +if test ${ac_cv_func_fork_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_func_fork_works=cross -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { /* By Ruediger Kuhlmann. */ @@ -15401,9 +15907,10 @@ main () return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_func_fork_works=yes -else +else $as_nop ac_cv_func_fork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -15411,8 +15918,8 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 -$as_echo "$ac_cv_func_fork_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 +printf "%s\n" "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork @@ -15427,27 +15934,37 @@ if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_fork_works=yes ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 -$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 +printf "%s\n" "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 -$as_echo_n "checking for working vfork... " >&6; } -if ${ac_cv_func_vfork_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 +printf %s "checking for working vfork... " >&6; } +if test ${ac_cv_func_vfork_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_func_vfork_works=cross -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default +#include #include #ifdef HAVE_VFORK_H # include #endif + +static void +do_nothing (int sig) +{ + (void) sig; +} + /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers @@ -15455,11 +15972,7 @@ $ac_includes_default static variable whose address is put into a register that is clobbered by the vfork. */ static void -#ifdef __cplusplus sparc_address_test (int arg) -# else -sparc_address_test (arg) int arg; -#endif { static pid_t child; if (!child) { @@ -15477,13 +15990,18 @@ sparc_address_test (arg) int arg; } int -main () +main (void) { pid_t parent = getpid (); pid_t child; sparc_address_test (0); + /* On Solaris 2.4, changes by the child to the signal handler + also munge signal handlers in the parent. To detect this, + start by putting the parent's handler in a known state. */ + signal (SIGTERM, SIG_DFL); + child = vfork (); if (child == 0) { @@ -15505,6 +16023,10 @@ main () || p != p5 || p != p6 || p != p7) _exit(1); + /* Alter the child's signal handler. */ + if (signal (SIGTERM, do_nothing) != SIG_DFL) + _exit(1); + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor @@ -15520,6 +16042,9 @@ main () /* Was there some problem with vforking? */ child < 0 + /* Did the child munge the parent's signal handler? */ + || signal (SIGTERM, SIG_DFL) != SIG_DFL + /* Did the child fail? (This shouldn't happen.) */ || status @@ -15532,9 +16057,10 @@ main () } } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_func_vfork_works=yes -else +else $as_nop ac_cv_func_vfork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -15542,49 +16068,98 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 -$as_echo "$ac_cv_func_vfork_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 +printf "%s\n" "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 -$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 +printf "%s\n" "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then -$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h +printf "%s\n" "#define HAVE_WORKING_VFORK 1" >>confdefs.h else -$as_echo "#define vfork fork" >>confdefs.h +printf "%s\n" "#define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then -$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h +printf "%s\n" "#define HAVE_WORKING_FORK 1" >>confdefs.h fi - for ac_func in mmap canonicalize_file_name snprintf strdup strchr \ - strrchr strsignal fchmod fstat chmod -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + printf "%s\n" "#define HAVE_MMAP 1" >>confdefs.h fi -done +ac_fn_c_check_func "$LINENO" "canonicalize_file_name" "ac_cv_func_canonicalize_file_name" +if test "x$ac_cv_func_canonicalize_file_name" = xyes +then : + printf "%s\n" "#define HAVE_CANONICALIZE_FILE_NAME 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else +fi +ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes +then : + printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" +if test "x$ac_cv_func_strdup" = xyes +then : + printf "%s\n" "#define HAVE_STRDUP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strchr" "ac_cv_func_strchr" +if test "x$ac_cv_func_strchr" = xyes +then : + printf "%s\n" "#define HAVE_STRCHR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strrchr" "ac_cv_func_strrchr" +if test "x$ac_cv_func_strrchr" = xyes +then : + printf "%s\n" "#define HAVE_STRRCHR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strsignal" "ac_cv_func_strsignal" +if test "x$ac_cv_func_strsignal" = xyes +then : + printf "%s\n" "#define HAVE_STRSIGNAL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fchmod" "ac_cv_func_fchmod" +if test "x$ac_cv_func_fchmod" = xyes +then : + printf "%s\n" "#define HAVE_FCHMOD 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fstat" "ac_cv_func_fstat" +if test "x$ac_cv_func_fstat" = xyes +then : + printf "%s\n" "#define HAVE_FSTAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "chmod" "ac_cv_func_chmod" +if test "x$ac_cv_func_chmod" = xyes +then : + printf "%s\n" "#define HAVE_CHMOD 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" @@ -15598,10 +16173,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED @@ -15610,13 +16190,13 @@ case `"$ac_path_SED" --version 2>&1` in ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" + printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -15644,13 +16224,14 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed while : do + test -x "$POSIX_SHELL" && break POSIX_SHELL=`which bash` test -x "$POSIX_SHELL" && break POSIX_SHELL=`which dash` @@ -15665,9 +16246,7 @@ $as_echo "$ac_cv_path_SED" >&6; } as_fn_error $? "cannot locate a working POSIX shell" "$LINENO" 5 done -cat >>confdefs.h <<_ACEOF -#define POSIX_SHELL "${POSIX_SHELL}" -_ACEOF +printf "%s\n" "#define POSIX_SHELL \"${POSIX_SHELL}\"" >>confdefs.h @@ -15679,11 +16258,12 @@ _ACEOF NEED_LIBOPTS_DIR='' # Check whether --enable-local-libopts was given. -if test "${enable_local_libopts+set}" = set; then : +if test ${enable_local_libopts+y} +then : enableval=$enable_local_libopts; if test x$enableval = xyes ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Using supplied libopts tearoff" >&5 -$as_echo "$as_me: Using supplied libopts tearoff" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Using supplied libopts tearoff" >&5 +printf "%s\n" "$as_me: Using supplied libopts tearoff" >&6;} LIBOPTS_CFLAGS='-I$(top_srcdir)/sntp/libopts' NEED_LIBOPTS_DIR=true LIBOPTS_LDADD='$(top_builddir)/sntp/libopts/libopts.la' @@ -15692,7 +16272,8 @@ fi # Check whether --enable-libopts-install was given. -if test "${enable_libopts_install+set}" = set; then : +if test ${enable_libopts_install+y} +then : enableval=$enable_libopts_install; fi @@ -15706,33 +16287,36 @@ fi if test -z "${NEED_LIBOPTS_DIR}" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether autoopts-config can be found" >&5 -$as_echo_n "checking whether autoopts-config can be found... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether autoopts-config can be found" >&5 +printf %s "checking whether autoopts-config can be found... " >&6; } # Check whether --with-autoopts-config was given. -if test "${with_autoopts_config+set}" = set; then : +if test ${with_autoopts_config+y} +then : withval=$with_autoopts_config; lo_cv_with_autoopts_config=${with_autoopts_config} -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether autoopts-config is specified" >&5 -$as_echo_n "checking whether autoopts-config is specified... " >&6; } -if ${lo_cv_with_autoopts_config+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether autoopts-config is specified" >&5 +printf %s "checking whether autoopts-config is specified... " >&6; } +if test ${lo_cv_with_autoopts_config+y} +then : + printf %s "(cached) " >&6 +else $as_nop if autoopts-config --help 2>/dev/null 1>&2 then lo_cv_with_autoopts_config=autoopts-config elif libopts-config --help 2>/dev/null 1>&2 then lo_cv_with_autoopts_config=libopts-config else lo_cv_with_autoopts_config=no ; fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lo_cv_with_autoopts_config" >&5 -$as_echo "$lo_cv_with_autoopts_config" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lo_cv_with_autoopts_config" >&5 +printf "%s\n" "$lo_cv_with_autoopts_config" >&6; } fi # end of AC_ARG_WITH - if ${lo_cv_test_autoopts+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lo_cv_test_autoopts+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "${lo_cv_with_autoopts_config}" \ -o X"${lo_cv_with_autoopts_config}" = Xno @@ -15750,8 +16334,8 @@ else fi # end of CACHE_VAL - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lo_cv_test_autoopts}" >&5 -$as_echo "${lo_cv_test_autoopts}" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lo_cv_test_autoopts}" >&5 +printf "%s\n" "${lo_cv_test_autoopts}" >&6; } if test "X${lo_cv_test_autoopts}" != Xno then @@ -15790,11 +16374,12 @@ ntp_pkgconfig_min_version='0.15.0' if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. @@ -15804,11 +16389,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -15820,11 +16409,11 @@ esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +printf "%s\n" "$PKG_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -15833,11 +16422,12 @@ if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. @@ -15847,11 +16437,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -15863,11 +16457,11 @@ esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then @@ -15875,8 +16469,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG @@ -15890,14 +16484,14 @@ fi case "$PKG_CONFIG" in /*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pkg-config is at least version $ntp_pkgconfig_min_version" >&5 -$as_echo_n "checking if pkg-config is at least version $ntp_pkgconfig_min_version... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if pkg-config is at least version $ntp_pkgconfig_min_version" >&5 +printf %s "checking if pkg-config is at least version $ntp_pkgconfig_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $ntp_pkgconfig_min_version; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PKG_CONFIG="" fi ;; @@ -15907,9 +16501,10 @@ esac # Check whether --enable-local-libevent was given. -if test "${enable_local_libevent+set}" = set; then : +if test ${enable_local_libevent+y} +then : enableval=$enable_local_libevent; ntp_use_local_libevent=$enableval -else +else $as_nop ntp_use_local_libevent=${ntp_use_local_libevent-detect} fi @@ -15931,8 +16526,8 @@ case "$ntp_use_local_libevent" in *) # If we have (a good enough) pkg-config, see if it can find libevent case "$PKG_CONFIG" in /*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libevent $ntp_libevent_min_version or later is installed" >&5 -$as_echo_n "checking if libevent $ntp_libevent_min_version or later is installed... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libevent $ntp_libevent_min_version or later is installed" >&5 +printf %s "checking if libevent $ntp_libevent_min_version or later is installed... " >&6; } if $PKG_CONFIG --atleast-version=$ntp_libevent_min_version libevent then ntp_use_local_libevent=no @@ -15941,8 +16536,8 @@ $as_echo_n "checking if libevent $ntp_libevent_min_version or later is installed *.*) ;; *) ntp_libevent_version='(unknown)' ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, version $ntp_libevent_version" >&5 -$as_echo "yes, version $ntp_libevent_version" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes, version $ntp_libevent_version" >&5 +printf "%s\n" "yes, version $ntp_libevent_version" >&6; } CFLAGS_LIBEVENT=`$PKG_CONFIG --cflags libevent_pthreads` CPPFLAGS_LIBEVENT=`$PKG_CONFIG --cflags-only-I libevent` # HMS: I hope the following is accurate. @@ -15975,8 +16570,8 @@ $as_echo "yes, version $ntp_libevent_version" >&6; } # HMS: do we only need to do this if LIBISC_PTHREADS_NOTHREADS # is "pthreads"? CFLAGS_LIBEVENT=`$PKG_CONFIG --cflags libevent_pthreads` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi ;; *) @@ -15988,8 +16583,8 @@ esac case "$ntp_use_local_libevent" in yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: Using libevent tearoff" >&5 -$as_echo "$as_me: Using libevent tearoff" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Using libevent tearoff" >&5 +printf "%s\n" "$as_me: Using libevent tearoff" >&6;} CPPFLAGS_LIBEVENT="-I\$(top_builddir)/$ntp_libevent_tearoff/include -I\$(top_srcdir)/$ntp_libevent_tearoff/include" case "$LIBISC_PTHREADS_NOTHREADS" in pthreads) @@ -16026,21 +16621,111 @@ fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : +if test "x$ac_cv_type_size_t" = xyes +then : -else +else $as_nop -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF +printf "%s\n" "#define size_t unsigned int" >>confdefs.h fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +extern void ac_decl (int, char *); + +int +main (void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else $as_nop + ac_cv_c_undeclared_builtin_options=$ac_arg +fi + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in #( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See \`config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; #( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac + +ac_fn_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strerror_r" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_STRERROR_R $ac_have_decl" >>confdefs.h + + # Check whether --enable-c99-snprintf was given. -if test "${enable_c99_snprintf+set}" = set; then : +if test ${enable_c99_snprintf+y} +then : enableval=$enable_c99_snprintf; force_c99_snprintf=$enableval -else +else $as_nop force_c99_snprintf=no fi @@ -16056,99 +16741,89 @@ fi - for ac_header in $ac_header_list -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 -$as_echo_n "checking for unsigned long long int... " >&6; } -if ${ac_cv_type_unsigned_long_long_int+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 +printf %s "checking for unsigned long long int... " >&6; } +if test ${ac_cv_type_unsigned_long_long_int+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_type_unsigned_long_long_int=yes - if test "x${ac_cv_prog_cc_c99-no}" = xno; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + case $ac_prog_cc_stdc in + no | c89) ;; + *) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* For now, do not test the preprocessor; as of 2007 there are too many - implementations with broken preprocessors. Perhaps this can - be revisited in 2012. In the meantime, code should not expect - #if to work with literals wider than 32 bits. */ + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) - ? 1 : -1)]; + ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 - ? 1 : -1)]; + ? 1 : -1)]; int i = 63; int -main () +main (void) { /* Test availability of runtime routines for shift and division. */ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) - | (llmax / ll) | (llmax % ll) - | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) - | (ullmax / ull) | (ullmax % ull)); + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : -else +else $as_nop ac_cv_type_unsigned_long_long_int=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext;; + esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 -$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 +printf "%s\n" "$ac_cv_type_unsigned_long_long_int" >&6; } if test $ac_cv_type_unsigned_long_long_int = yes; then -$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h +printf "%s\n" "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf" -if test "x$ac_cv_func_vsnprintf" = xyes; then : +if test "x$ac_cv_func_vsnprintf" = xyes +then : hw_cv_func_vsnprintf=yes -else +else $as_nop hw_cv_func_vsnprintf=no fi - if test "$hw_cv_func_vsnprintf" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vsnprintf is C99 compliant" >&5 -$as_echo_n "checking whether vsnprintf is C99 compliant... " >&6; } -if ${hw_cv_func_vsnprintf_c99+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : + if test "$hw_cv_func_vsnprintf" = yes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether vsnprintf is C99 compliant" >&5 +printf %s "checking whether vsnprintf is C99 compliant... " >&6; } +if test ${hw_cv_func_vsnprintf_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : hw_cv_func_vsnprintf_c99=no -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_STDARG_H @@ -16165,7 +16840,7 @@ else return result; } int -main () +main (void) { char buf[43]; if (testprintf(buf, 4, "The answer is %27.2g.", 42.0) != 42 || @@ -16176,9 +16851,10 @@ char buf[43]; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : hw_cv_func_vsnprintf_c99=yes -else +else $as_nop hw_cv_func_vsnprintf_c99=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16186,72 +16862,86 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_cv_func_vsnprintf_c99" >&5 -$as_echo "$hw_cv_func_vsnprintf_c99" >&6; } -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hw_cv_func_vsnprintf_c99" >&5 +printf "%s\n" "$hw_cv_func_vsnprintf_c99" >&6; } +else $as_nop hw_cv_func_vsnprintf_c99=no fi -$as_echo "#define HAVE_VSNPRINTF 1" >>confdefs.h +printf "%s\n" "#define HAVE_VSNPRINTF 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if C99-snprintf replacement vsnprintf will be used" >&5 -$as_echo_n "checking if C99-snprintf replacement vsnprintf will be used... " >&6; } - if test "${hw_force_rpl_vsnprintf=no}" = yes -o "$hw_cv_func_vsnprintf_c99" = no; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if C99-snprintf replacement vsnprintf will be used" >&5 +printf %s "checking if C99-snprintf replacement vsnprintf will be used... " >&6; } + if test "${hw_force_rpl_vsnprintf=no}" = yes -o "$hw_cv_func_vsnprintf_c99" = no +then : hw_use_rpl_vsnprintf=yes -else +else $as_nop hw_use_rpl_vsnprintf=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_use_rpl_vsnprintf" >&5 -$as_echo "$hw_use_rpl_vsnprintf" >&6; } - if test "$hw_use_rpl_vsnprintf" = yes; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hw_use_rpl_vsnprintf" >&5 +printf "%s\n" "$hw_use_rpl_vsnprintf" >&6; } + if test "$hw_use_rpl_vsnprintf" = yes +then : -$as_echo "#define HW_WANT_RPL_VSNPRINTF 1" >>confdefs.h +printf "%s\n" "#define HW_WANT_RPL_VSNPRINTF 1" >>confdefs.h - if test ${hw_nodef_vsnprintf=no} = no; then : + if test ${hw_nodef_vsnprintf=no} = no +then : -$as_echo "#define vsnprintf rpl_vsnprintf" >>confdefs.h +printf "%s\n" "#define vsnprintf rpl_vsnprintf" >>confdefs.h fi - for ac_header in inttypes.h locale.h stddef.h stdint.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_inttypes_h" = xyes +then : + printf "%s\n" "#define HAVE_INTTYPES_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" +if test "x$ac_cv_header_locale_h" = xyes +then : + printf "%s\n" "#define HAVE_LOCALE_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "stddef.h" "ac_cv_header_stddef_h" "$ac_includes_default" +if test "x$ac_cv_header_stddef_h" = xyes +then : + printf "%s\n" "#define HAVE_STDDEF_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "#define HAVE_STDINT_H 1" >>confdefs.h + +fi ac_fn_c_check_member "$LINENO" "struct lconv" "decimal_point" "ac_cv_member_struct_lconv_decimal_point" "#include " -if test "x$ac_cv_member_struct_lconv_decimal_point" = xyes; then : +if test "x$ac_cv_member_struct_lconv_decimal_point" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_LCONV_DECIMAL_POINT 1 -_ACEOF +printf "%s\n" "#define HAVE_STRUCT_LCONV_DECIMAL_POINT 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct lconv" "thousands_sep" "ac_cv_member_struct_lconv_thousands_sep" "#include " -if test "x$ac_cv_member_struct_lconv_thousands_sep" = xyes; then : +if test "x$ac_cv_member_struct_lconv_thousands_sep" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_LCONV_THOUSANDS_SEP 1 -_ACEOF +printf "%s\n" "#define HAVE_STRUCT_LCONV_THOUSANDS_SEP 1" >>confdefs.h fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double" >&5 -$as_echo_n "checking for long double... " >&6; } -if ${ac_cv_type_long_double+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long double" >&5 +printf %s "checking for long double... " >&6; } +if test ${ac_cv_type_long_double+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "$GCC" = yes; then ac_cv_type_long_double=yes else @@ -16261,7 +16951,7 @@ else not support it. */ long double foo = 0.0L; int -main () +main (void) { static int test_array [1 - 2 * !(/* On Ultrix 4.3 cc, long double is 4 and double is 8. */ sizeof (double) <= sizeof (long double))]; @@ -16272,165 +16962,173 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_type_long_double=yes -else +else $as_nop ac_cv_type_long_double=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double" >&5 -$as_echo "$ac_cv_type_long_double" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double" >&5 +printf "%s\n" "$ac_cv_type_long_double" >&6; } if test $ac_cv_type_long_double = yes; then -$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h +printf "%s\n" "#define HAVE_LONG_DOUBLE 1" >>confdefs.h fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 -$as_echo_n "checking for long long int... " >&6; } -if ${ac_cv_type_long_long_int+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 +printf %s "checking for long long int... " >&6; } +if test ${ac_cv_type_long_long_int+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_type_long_long_int=yes - if test "x${ac_cv_prog_cc_c99-no}" = xno; then - ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int - if test $ac_cv_type_long_long_int = yes; then - if test "$cross_compiling" = yes; then : + case $ac_prog_cc_stdc in + no | c89) ;; + *) + ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int + if test $ac_cv_type_long_long_int = yes; then + if test "$cross_compiling" = yes +then : : -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - #ifndef LLONG_MAX - # define HALF \ - (1LL << (sizeof (long long int) * CHAR_BIT - 2)) - # define LLONG_MAX (HALF - 1 + HALF) - #endif + #ifndef LLONG_MAX + # define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + # define LLONG_MAX (HALF - 1 + HALF) + #endif int -main () +main (void) { long long int n = 1; - int i; - for (i = 0; ; i++) - { - long long int m = n << i; - if (m >> i != n) - return 1; - if (LLONG_MAX / 2 < m) - break; - } - return 0; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0; ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : -else +else $as_nop ac_cv_type_long_long_int=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi - fi + fi;; + esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 -$as_echo "$ac_cv_type_long_long_int" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 +printf "%s\n" "$ac_cv_type_long_long_int" >&6; } if test $ac_cv_type_long_long_int = yes; then -$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h +printf "%s\n" "#define HAVE_LONG_LONG_INT 1" >>confdefs.h fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 -$as_echo_n "checking for unsigned long long int... " >&6; } -if ${ac_cv_type_unsigned_long_long_int+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 +printf %s "checking for unsigned long long int... " >&6; } +if test ${ac_cv_type_unsigned_long_long_int+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_type_unsigned_long_long_int=yes - if test "x${ac_cv_prog_cc_c99-no}" = xno; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + case $ac_prog_cc_stdc in + no | c89) ;; + *) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* For now, do not test the preprocessor; as of 2007 there are too many - implementations with broken preprocessors. Perhaps this can - be revisited in 2012. In the meantime, code should not expect - #if to work with literals wider than 32 bits. */ + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) - ? 1 : -1)]; + ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 - ? 1 : -1)]; + ? 1 : -1)]; int i = 63; int -main () +main (void) { /* Test availability of runtime routines for shift and division. */ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) - | (llmax / ll) | (llmax % ll) - | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) - | (ullmax / ull) | (ullmax % ull)); + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : -else +else $as_nop ac_cv_type_unsigned_long_long_int=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext;; + esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 -$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 +printf "%s\n" "$ac_cv_type_unsigned_long_long_int" >&6; } if test $ac_cv_type_unsigned_long_long_int = yes; then -$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h +printf "%s\n" "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : +if test "x$ac_cv_type_size_t" = xyes +then : -else +else $as_nop -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF +printf "%s\n" "#define size_t unsigned int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "intmax_t" "ac_cv_type_intmax_t" "$ac_includes_default" -if test "x$ac_cv_type_intmax_t" = xyes; then : +if test "x$ac_cv_type_intmax_t" = xyes +then : -$as_echo "#define HAVE_INTMAX_T 1" >>confdefs.h +printf "%s\n" "#define HAVE_INTMAX_T 1" >>confdefs.h -else +else $as_nop test $ac_cv_type_long_long_int = yes \ && ac_type='long long int' \ || ac_type='long int' -cat >>confdefs.h <<_ACEOF -#define intmax_t $ac_type -_ACEOF +printf "%s\n" "#define intmax_t $ac_type" >>confdefs.h fi @@ -16438,36 +17136,36 @@ fi ac_fn_c_check_type "$LINENO" "uintmax_t" "ac_cv_type_uintmax_t" "$ac_includes_default" -if test "x$ac_cv_type_uintmax_t" = xyes; then : +if test "x$ac_cv_type_uintmax_t" = xyes +then : -$as_echo "#define HAVE_UINTMAX_T 1" >>confdefs.h +printf "%s\n" "#define HAVE_UINTMAX_T 1" >>confdefs.h -else +else $as_nop test $ac_cv_type_unsigned_long_long_int = yes \ && ac_type='unsigned long long int' \ || ac_type='unsigned long int' -cat >>confdefs.h <<_ACEOF -#define uintmax_t $ac_type -_ACEOF +printf "%s\n" "#define uintmax_t $ac_type" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" -if test "x$ac_cv_type_uintptr_t" = xyes; then : +if test "x$ac_cv_type_uintptr_t" = xyes +then : -$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h +printf "%s\n" "#define HAVE_UINTPTR_T 1" >>confdefs.h -else +else $as_nop for ac_type in 'unsigned int' 'unsigned long int' \ 'unsigned long long int'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))]; test_array [0] = 0; @@ -16477,53 +17175,49 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -cat >>confdefs.h <<_ACEOF -#define uintptr_t $ac_type -_ACEOF +printf "%s\n" "#define uintptr_t $ac_type" >>confdefs.h ac_type= fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test -z "$ac_type" && break done fi ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" -if test "x$ac_cv_type_ptrdiff_t" = xyes; then : +if test "x$ac_cv_type_ptrdiff_t" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_PTRDIFF_T 1 -_ACEOF +printf "%s\n" "#define HAVE_PTRDIFF_T 1" >>confdefs.h fi - for ac_func in localeconv -do : - ac_fn_c_check_func "$LINENO" "localeconv" "ac_cv_func_localeconv" -if test "x$ac_cv_func_localeconv" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LOCALECONV 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "localeconv" "ac_cv_func_localeconv" +if test "x$ac_cv_func_localeconv" = xyes +then : + printf "%s\n" "#define HAVE_LOCALECONV 1" >>confdefs.h fi -done - if test "x$_hw_cv_func_xprintf_replace_done" != xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if ${ac_cv_c_const+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$_hw_cv_func_xprintf_replace_done" != xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +printf %s "checking for an ANSI C-conforming const... " >&6; } +if test ${ac_cv_c_const+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __cplusplus @@ -16536,7 +17230,7 @@ main () /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. + /* IBM XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ @@ -16564,7 +17258,7 @@ main () iptr p = 0; ++p; } - { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; @@ -16580,18 +17274,19 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_const=yes -else +else $as_nop ac_cv_c_const=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +printf "%s\n" "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then -$as_echo "#define const /**/" >>confdefs.h +printf "%s\n" "#define const /**/" >>confdefs.h fi @@ -16611,26 +17306,30 @@ fi ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" -if test "x$ac_cv_func_snprintf" = xyes; then : +if test "x$ac_cv_func_snprintf" = xyes +then : hw_cv_func_snprintf=yes -else +else $as_nop hw_cv_func_snprintf=no fi - if test "$hw_cv_func_snprintf" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf is C99 compliant" >&5 -$as_echo_n "checking whether snprintf is C99 compliant... " >&6; } -if ${hw_cv_func_snprintf_c99+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : + if test "$hw_cv_func_snprintf" = yes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether snprintf is C99 compliant" >&5 +printf %s "checking whether snprintf is C99 compliant... " >&6; } +if test ${hw_cv_func_snprintf_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : hw_cv_func_snprintf_c99=no -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { char buf[43]; if (snprintf(buf, 4, "The answer is %27.2g.", 42.0) != 42 || @@ -16641,9 +17340,10 @@ char buf[43]; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : hw_cv_func_snprintf_c99=yes -else +else $as_nop hw_cv_func_snprintf_c99=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16651,44 +17351,49 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_cv_func_snprintf_c99" >&5 -$as_echo "$hw_cv_func_snprintf_c99" >&6; } -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hw_cv_func_snprintf_c99" >&5 +printf "%s\n" "$hw_cv_func_snprintf_c99" >&6; } +else $as_nop hw_cv_func_snprintf_c99=no fi -$as_echo "#define HAVE_SNPRINTF 1" >>confdefs.h +printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if C99-snprintf replacement snprintf will be used" >&5 -$as_echo_n "checking if C99-snprintf replacement snprintf will be used... " >&6; } - if test "${hw_force_rpl_snprintf=no}" = yes -o "$hw_cv_func_snprintf_c99" = no; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if C99-snprintf replacement snprintf will be used" >&5 +printf %s "checking if C99-snprintf replacement snprintf will be used... " >&6; } + if test "${hw_force_rpl_snprintf=no}" = yes -o "$hw_cv_func_snprintf_c99" = no +then : hw_use_rpl_snprintf=yes -else +else $as_nop hw_use_rpl_snprintf=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_use_rpl_snprintf" >&5 -$as_echo "$hw_use_rpl_snprintf" >&6; } - if test "$hw_use_rpl_snprintf" = yes; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hw_use_rpl_snprintf" >&5 +printf "%s\n" "$hw_use_rpl_snprintf" >&6; } + if test "$hw_use_rpl_snprintf" = yes +then : -$as_echo "#define HW_WANT_RPL_SNPRINTF 1" >>confdefs.h +printf "%s\n" "#define HW_WANT_RPL_SNPRINTF 1" >>confdefs.h - if test ${hw_nodef_snprintf=no} = no; then : + if test ${hw_nodef_snprintf=no} = no +then : -$as_echo "#define snprintf rpl_snprintf" >>confdefs.h +printf "%s\n" "#define snprintf rpl_snprintf" >>confdefs.h fi - if test "x$_hw_cv_func_xprintf_replace_done" != xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if ${ac_cv_c_const+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$_hw_cv_func_xprintf_replace_done" != xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +printf %s "checking for an ANSI C-conforming const... " >&6; } +if test ${ac_cv_c_const+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __cplusplus @@ -16701,7 +17406,7 @@ main () /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. + /* IBM XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ @@ -16729,7 +17434,7 @@ main () iptr p = 0; ++p; } - { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; @@ -16745,18 +17450,19 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_const=yes -else +else $as_nop ac_cv_c_const=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +printf "%s\n" "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then -$as_echo "#define const /**/" >>confdefs.h +printf "%s\n" "#define const /**/" >>confdefs.h fi @@ -16790,17 +17496,18 @@ LIBS= # Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : +if test ${with_gnu_ld+y} +then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else +else $as_nop with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw @@ -16829,15 +17536,16 @@ $as_echo_n "checking for ld used by $CC... " >&6; } ;; esac elif test yes = "$with_gnu_ld"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do @@ -16866,18 +17574,19 @@ fi LD=$lt_cv_path_LD if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld @@ -16899,11 +17608,12 @@ with_gnu_ld=$lt_cv_prog_gnu_ld -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for directory path separator" >&5 -$as_echo_n "checking for directory path separator... " >&6; } -if ${ntp_cv_dir_sep+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for directory path separator" >&5 +printf %s "checking for directory path separator... " >&6; } +if test ${ntp_cv_dir_sep+y} +then : + printf %s "(cached) " >&6 +else $as_nop case "$ntp_cv_dir_sep" in '') @@ -16919,29 +17629,28 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_dir_sep" >&5 -$as_echo "$ntp_cv_dir_sep" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_dir_sep" >&5 +printf "%s\n" "$ntp_cv_dir_sep" >&6; } -cat >>confdefs.h <<_ACEOF -#define DIR_SEP $ntp_cv_dir_sep -_ACEOF +printf "%s\n" "#define DIR_SEP $ntp_cv_dir_sep" >>confdefs.h NTP_ORIG_LIBS="$LIBS" # Check whether --with-lineeditlibs was given. -if test "${with_lineeditlibs+set}" = set; then : +if test ${with_lineeditlibs+y} +then : withval=$with_lineeditlibs; use_lineeditlibs="$withval" -else +else $as_nop use_lineeditlibs="edit,editline" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking line editing libraries" >&5 -$as_echo_n "checking line editing libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_lineeditlibs" >&5 -$as_echo "$use_lineeditlibs" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking line editing libraries" >&5 +printf %s "checking line editing libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $use_lineeditlibs" >&5 +printf "%s\n" "$use_lineeditlibs" >&6; } case "$use_lineeditlibs" in no) ntp_lib_lineedit=no @@ -16958,40 +17667,38 @@ $as_echo "$use_lineeditlibs" >&6; } ;; esac LIBS="$NTP_ORIG_LIBS $TRY_LIB" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline() with $TRY_LIB" >&5 -$as_echo_n "checking for readline() with $TRY_LIB... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for readline() with $TRY_LIB" >&5 +printf %s "checking for readline() with $TRY_LIB... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char readline (); int -main () +main (void) { return readline (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ntp_lib_lineedit="$TRY_LIB" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext case "$ntp_lib_lineedit" in '') - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; *) # Use readline() - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } break esac case "$term_lib" in @@ -16999,39 +17706,37 @@ $as_echo "yes" >&6; } # do not try el_gets without a terminal library ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for el_gets() with $TRY_LIB" >&5 -$as_echo_n "checking for el_gets() with $TRY_LIB... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for el_gets() with $TRY_LIB" >&5 +printf %s "checking for el_gets() with $TRY_LIB... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char el_gets (); int -main () +main (void) { return el_gets (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ntp_lib_lineedit="$TRY_LIB" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext case "$ntp_lib_lineedit" in '') - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; *) # Use el_gets() - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } break ;; esac # $ntp_lib_lineedit @@ -17065,40 +17770,47 @@ $as_echo "yes" >&6; } no) ;; *) - for ac_header in readline.h readline/readline.h histedit.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "readline.h" "ac_cv_header_readline_h" "$ac_includes_default" +if test "x$ac_cv_header_readline_h" = xyes +then : + printf "%s\n" "#define HAVE_READLINE_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default" +if test "x$ac_cv_header_readline_readline_h" = xyes +then : + printf "%s\n" "#define HAVE_READLINE_READLINE_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "histedit.h" "ac_cv_header_histedit_h" "$ac_includes_default" +if test "x$ac_cv_header_histedit_h" = xyes +then : + printf "%s\n" "#define HAVE_HISTEDIT_H 1" >>confdefs.h fi -done - - for ac_header in history.h readline/history.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "history.h" "ac_cv_header_history_h" "$ac_includes_default" +if test "x$ac_cv_header_history_h" = xyes +then : + printf "%s\n" "#define HAVE_HISTORY_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default" +if test "x$ac_cv_header_readline_history_h" = xyes +then : + printf "%s\n" "#define HAVE_READLINE_HISTORY_H 1" >>confdefs.h -done +fi case "$ac_cv_header_histedit_h" in yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking number of arguments to el_init()" >&5 -$as_echo_n "checking number of arguments to el_init()... " >&6; } -if ${ntp_cv_el_init_args+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking number of arguments to el_init()" >&5 +printf %s "checking number of arguments to el_init()... " >&6; } +if test ${ntp_cv_el_init_args+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17106,7 +17818,7 @@ else #include int -main () +main (void) { el_init("conftest", stdin, stdout, stderr); @@ -17116,26 +17828,25 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_el_init_args=4 -else +else $as_nop ntp_cv_el_init_args=3 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_el_init_args" >&5 -$as_echo "$ntp_cv_el_init_args" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_el_init_args" >&5 +printf "%s\n" "$ntp_cv_el_init_args" >&6; } -cat >>confdefs.h <<_ACEOF -#define EL_INIT_ARGS $ntp_cv_el_init_args -_ACEOF +printf "%s\n" "#define EL_INIT_ARGS $ntp_cv_el_init_args" >>confdefs.h esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readline supports history" >&5 -$as_echo_n "checking whether readline supports history... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether readline supports history" >&5 +printf %s "checking whether readline supports history... " >&6; } ntp_lib_lineedit_history="no" ORIG_LIBS="$LIBS" @@ -17146,32 +17857,30 @@ $as_echo_n "checking whether readline supports history... " >&6; } /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char add_history (); int -main () +main (void) { return add_history (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ntp_lib_lineedit_history="yes" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$ORIG_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_lib_lineedit_history" >&5 -$as_echo "$ntp_lib_lineedit_history" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_lib_lineedit_history" >&5 +printf "%s\n" "$ntp_lib_lineedit_history" >&6; } case "$ntp_lib_lineedit_history" in yes) -$as_echo "#define HAVE_READLINE_HISTORY 1" >>confdefs.h +printf "%s\n" "#define HAVE_READLINE_HISTORY 1" >>confdefs.h esac esac # $ntp_lib_lineedit @@ -17187,11 +17896,12 @@ case "$host" in ;; *) _libs=$LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing cos" >&5 -$as_echo_n "checking for library containing cos... " >&6; } -if ${ac_cv_search_cos+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing cos" >&5 +printf %s "checking for library containing cos... " >&6; } +if test ${ac_cv_search_cos+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17199,46 +17909,48 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char cos (); int -main () +main (void) { return cos (); ; return 0; } _ACEOF -for ac_lib in '' m; do +for ac_lib in '' m +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_cos=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_cos+:} false; then : + if test ${ac_cv_search_cos+y} +then : break fi done -if ${ac_cv_search_cos+:} false; then : +if test ${ac_cv_search_cos+y} +then : -else +else $as_nop ac_cv_search_cos=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_cos" >&5 -$as_echo "$ac_cv_search_cos" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_cos" >&5 +printf "%s\n" "$ac_cv_search_cos" >&6; } ac_res=$ac_cv_search_cos -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" LIBM="-lm" fi @@ -17250,44 +17962,24 @@ esac { _libs=; unset _libs;} -for ac_header in vfork.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" -if test "x$ac_cv_header_vfork_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_VFORK_H 1 -_ACEOF -fi - -done - -for ac_func in fork vfork -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done if test "x$ac_cv_func_fork" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 -$as_echo_n "checking for working fork... " >&6; } -if ${ac_cv_func_fork_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 +printf %s "checking for working fork... " >&6; } +if test ${ac_cv_func_fork_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_func_fork_works=cross -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { /* By Ruediger Kuhlmann. */ @@ -17297,9 +17989,10 @@ main () return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_func_fork_works=yes -else +else $as_nop ac_cv_func_fork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -17307,8 +18000,8 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 -$as_echo "$ac_cv_func_fork_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 +printf "%s\n" "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork @@ -17323,27 +18016,37 @@ if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_fork_works=yes ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 -$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 +printf "%s\n" "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 -$as_echo_n "checking for working vfork... " >&6; } -if ${ac_cv_func_vfork_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 +printf %s "checking for working vfork... " >&6; } +if test ${ac_cv_func_vfork_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_func_vfork_works=cross -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default +#include #include #ifdef HAVE_VFORK_H # include #endif + +static void +do_nothing (int sig) +{ + (void) sig; +} + /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers @@ -17351,11 +18054,7 @@ $ac_includes_default static variable whose address is put into a register that is clobbered by the vfork. */ static void -#ifdef __cplusplus sparc_address_test (int arg) -# else -sparc_address_test (arg) int arg; -#endif { static pid_t child; if (!child) { @@ -17373,13 +18072,18 @@ sparc_address_test (arg) int arg; } int -main () +main (void) { pid_t parent = getpid (); pid_t child; sparc_address_test (0); + /* On Solaris 2.4, changes by the child to the signal handler + also munge signal handlers in the parent. To detect this, + start by putting the parent's handler in a known state. */ + signal (SIGTERM, SIG_DFL); + child = vfork (); if (child == 0) { @@ -17401,6 +18105,10 @@ main () || p != p5 || p != p6 || p != p7) _exit(1); + /* Alter the child's signal handler. */ + if (signal (SIGTERM, do_nothing) != SIG_DFL) + _exit(1); + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor @@ -17416,6 +18124,9 @@ main () /* Was there some problem with vforking? */ child < 0 + /* Did the child munge the parent's signal handler? */ + || signal (SIGTERM, SIG_DFL) != SIG_DFL + /* Did the child fail? (This shouldn't happen.) */ || status @@ -17428,9 +18139,10 @@ main () } } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_func_vfork_works=yes -else +else $as_nop ac_cv_func_vfork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -17438,43 +18150,44 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 -$as_echo "$ac_cv_func_vfork_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 +printf "%s\n" "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 -$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 +printf "%s\n" "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then -$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h +printf "%s\n" "#define HAVE_WORKING_VFORK 1" >>confdefs.h else -$as_echo "#define vfork fork" >>confdefs.h +printf "%s\n" "#define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then -$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h +printf "%s\n" "#define HAVE_WORKING_FORK 1" >>confdefs.h fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 -$as_echo_n "checking for working alloca.h... " >&6; } -if ${ac_cv_working_alloca_h+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +printf %s "checking for working alloca.h... " >&6; } +if test ${ac_cv_working_alloca_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; @@ -17482,52 +18195,52 @@ char *p = (char *) alloca (2 * sizeof (int)); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_working_alloca_h=yes -else +else $as_nop ac_cv_working_alloca_h=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 -$as_echo "$ac_cv_working_alloca_h" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +printf "%s\n" "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then -$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 -$as_echo_n "checking for alloca... " >&6; } -if ${ac_cv_func_alloca_works+:} false; then : - $as_echo_n "(cached) " >&6 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +printf %s "checking for alloca... " >&6; } +if test ${ac_cv_func_alloca_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test $ac_cv_working_alloca_h = yes; then + ac_cv_func_alloca_works=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER +#include +#include +#ifndef alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _MSC_VER # include # define alloca _alloca # else -# ifdef HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -void *alloca (size_t); -# endif -# endif +# ifdef __cplusplus +extern "C" # endif +void *alloca (size_t); # endif #endif int -main () +main (void) { char *p = (char *) alloca (1); if (p) return 0; @@ -17535,20 +18248,22 @@ char *p = (char *) alloca (1); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_func_alloca_works=yes -else +else $as_nop ac_cv_func_alloca_works=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 -$as_echo "$ac_cv_func_alloca_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +printf "%s\n" "$ac_cv_func_alloca_works" >&6; } +fi if test $ac_cv_func_alloca_works = yes; then -$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h +printf "%s\n" "#define HAVE_ALLOCA 1" >>confdefs.h else # The SVR3 libPW and SVR4 libucb both contain incompatible functions @@ -17558,58 +18273,19 @@ else ALLOCA=\${LIBOBJDIR}alloca.$ac_objext -$as_echo "#define C_ALLOCA 1" >>confdefs.h +printf "%s\n" "#define C_ALLOCA 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 -$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } -if ${ac_cv_os_cray+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined CRAY && ! defined CRAY2 -webecray -#else -wenotbecray -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then : - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 -$as_echo "$ac_cv_os_cray" >&6; } -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func -_ACEOF - - break -fi - - done -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 -$as_echo_n "checking stack direction for C alloca... " >&6; } -if ${ac_cv_c_stack_direction+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +printf %s "checking stack direction for C alloca... " >&6; } +if test ${ac_cv_c_stack_direction+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_c_stack_direction=0 -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default @@ -17630,9 +18306,10 @@ main (int argc, char **argv) return find_stack_direction (0, argc + !argv + 20) < 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_c_stack_direction=1 -else +else $as_nop ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -17640,50 +18317,37 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 -$as_echo "$ac_cv_c_stack_direction" >&6; } -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +printf "%s\n" "$ac_cv_c_stack_direction" >&6; } +printf "%s\n" "#define STACK_DIRECTION $ac_cv_c_stack_direction" >>confdefs.h fi -ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" -if test "x$ac_cv_have_decl_strerror_r" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR_R $ac_have_decl -_ACEOF +if test $ac_cv_have_decl_strerror_r = yes; then + # For backward compatibility's sake, define HAVE_STRERROR_R. + # (We used to run AC_CHECK_FUNCS_ONCE for strerror_r, as well + # as AC_CHECK_DECLS_ONCE.) -for ac_func in strerror_r -do : - ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" -if test "x$ac_cv_func_strerror_r" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STRERROR_R 1 -_ACEOF +printf "%s\n" "#define HAVE_STRERROR_R 1" >>confdefs.h fi -done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 -$as_echo_n "checking whether strerror_r returns char *... " >&6; } -if ${ac_cv_func_strerror_r_char_p+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 +printf %s "checking whether strerror_r returns char *... " >&6; } +if test ${ac_cv_func_strerror_r_char_p+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_func_strerror_r_char_p=no if test $ac_cv_have_decl_strerror_r = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include int -main () +main (void) { char buf[100]; @@ -17695,49 +18359,20 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_func_strerror_r_char_p=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - else - # strerror_r is not declared. Choose between - # systems that have relatively inaccessible declarations for the - # function. BeOS and DEC UNIX 4.0 fall in this category, but the - # former has a strerror_r that returns char*, while the latter - # has a strerror_r that returns `int'. - # This test should segfault on the DEC system. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - extern char *strerror_r (); -int -main () -{ -char buf[100]; - char x = *strerror_r (0, buf, sizeof buf); - return ! isalpha (x); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_strerror_r_char_p=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 -$as_echo "$ac_cv_func_strerror_r_char_p" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 +printf "%s\n" "$ac_cv_func_strerror_r_char_p" >&6; } if test $ac_cv_func_strerror_r_char_p = yes; then -$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h +printf "%s\n" "#define STRERROR_R_CHAR_P 1" >>confdefs.h fi @@ -17783,11 +18418,12 @@ case "$host" in # instead to try to set the time to itself and check errno. ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 -$as_echo_n "checking for library containing clock_gettime... " >&6; } -if ${ac_cv_search_clock_gettime+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 +printf %s "checking for library containing clock_gettime... " >&6; } +if test ${ac_cv_search_clock_gettime+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17795,46 +18431,48 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char clock_gettime (); int -main () +main (void) { return clock_gettime (); ; return 0; } _ACEOF -for ac_lib in '' rt; do +for ac_lib in '' rt +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_clock_gettime=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_clock_gettime+:} false; then : + if test ${ac_cv_search_clock_gettime+y} +then : break fi done -if ${ac_cv_search_clock_gettime+:} false; then : +if test ${ac_cv_search_clock_gettime+y} +then : -else +else $as_nop ac_cv_search_clock_gettime=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 -$as_echo "$ac_cv_search_clock_gettime" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 +printf "%s\n" "$ac_cv_search_clock_gettime" >&6; } ac_res=$ac_cv_search_clock_gettime -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" case "$ac_cv_search_clock_gettime" in 'none required') ;; @@ -17844,42 +18482,69 @@ if test "$ac_res" != no; then : fi - for ac_func in clock_getres clock_gettime clock_settime -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "clock_getres" "ac_cv_func_clock_getres" +if test "x$ac_cv_func_clock_getres" = xyes +then : + printf "%s\n" "#define HAVE_CLOCK_GETRES 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" +if test "x$ac_cv_func_clock_gettime" = xyes +then : + printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "clock_settime" "ac_cv_func_clock_settime" +if test "x$ac_cv_func_clock_settime" = xyes +then : + printf "%s\n" "#define HAVE_CLOCK_SETTIME 1" >>confdefs.h fi -done ;; esac -for ac_func in getclock stime timegm strlcpy strlcat -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "getclock" "ac_cv_func_getclock" +if test "x$ac_cv_func_getclock" = xyes +then : + printf "%s\n" "#define HAVE_GETCLOCK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "stime" "ac_cv_func_stime" +if test "x$ac_cv_func_stime" = xyes +then : + printf "%s\n" "#define HAVE_STIME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "timegm" "ac_cv_func_timegm" +if test "x$ac_cv_func_timegm" = xyes +then : + printf "%s\n" "#define HAVE_TIMEGM 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy" +if test "x$ac_cv_func_strlcpy" = xyes +then : + printf "%s\n" "#define HAVE_STRLCPY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat" +if test "x$ac_cv_func_strlcat" = xyes +then : + printf "%s\n" "#define HAVE_STRLCAT 1" >>confdefs.h fi -done # Bug 2713 LDADD_LIBUTIL= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing snprintb" >&5 -$as_echo_n "checking for library containing snprintb... " >&6; } -if ${ac_cv_search_snprintb+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing snprintb" >&5 +printf %s "checking for library containing snprintb... " >&6; } +if test ${ac_cv_search_snprintb+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17887,46 +18552,48 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char snprintb (); int -main () +main (void) { return snprintb (); ; return 0; } _ACEOF -for ac_lib in '' util; do +for ac_lib in '' util +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_snprintb=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_snprintb+:} false; then : + if test ${ac_cv_search_snprintb+y} +then : break fi done -if ${ac_cv_search_snprintb+:} false; then : +if test ${ac_cv_search_snprintb+y} +then : -else +else $as_nop ac_cv_search_snprintb=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_snprintb" >&5 -$as_echo "$ac_cv_search_snprintb" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_snprintb" >&5 +printf "%s\n" "$ac_cv_search_snprintb" >&6; } ac_res=$ac_cv_search_snprintb -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" case "$ac_cv_search_snprintb" in 'none required') ;; @@ -17934,49 +18601,57 @@ if test "$ac_res" != no; then : *) LDADD_LIBUTIL="$ac_cv_search_snprintb $LDADD_LIBUTIL" ;; esac -$as_echo "#define USE_SNPRINTB 1" >>confdefs.h +printf "%s\n" "#define USE_SNPRINTB 1" >>confdefs.h fi # -for ac_header in errno.h sys/socket.h sys/types.h time.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_errno_h" = xyes +then : + printf "%s\n" "#define HAVE_ERRNO_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_socket_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "time.h" "ac_cv_header_time_h" "$ac_includes_default" +if test "x$ac_cv_header_time_h" = xyes +then : + printf "%s\n" "#define HAVE_TIME_H 1" >>confdefs.h fi -done - -for ac_header in net/if.h -do : - ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" " +ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" " #ifdef HAVE_SYS_SOCKET_H # include #endif " -if test "x$ac_cv_header_net_if_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NET_IF_H 1 -_ACEOF +if test "x$ac_cv_header_net_if_h" = xyes +then : + printf "%s\n" "#define HAVE_NET_IF_H 1" >>confdefs.h fi -done - case "$host" in *-hp-hpux*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if net/if.h requires mpinfou predeclaration" >&5 -$as_echo_n "checking if net/if.h requires mpinfou predeclaration... " >&6; } -if ${ntp_cv_predecl_mpinfou+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if net/if.h requires mpinfou predeclaration" >&5 +printf %s "checking if net/if.h requires mpinfou predeclaration... " >&6; } +if test ${ntp_cv_predecl_mpinfou+y} +then : + printf %s "(cached) " >&6 +else $as_nop np_cv_predecl_mpinfou=no case "$ac_cv_header_net_if_h" in @@ -17994,7 +18669,7 @@ else #include int -main () +main (void) { @@ -18003,20 +18678,21 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_predecl_mpinfou=yes ac_cv_header_net_if_h=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_predecl_mpinfou" >&5 -$as_echo "$ntp_cv_predecl_mpinfou" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_predecl_mpinfou" >&5 +printf "%s\n" "$ntp_cv_predecl_mpinfou" >&6; } case "$ntp_cv_predecl_mpinfou" in yes) cat >>confdefs.h <<_ACEOF @@ -18034,76 +18710,82 @@ esac case "$host" in *-linux*) - for ac_header in linux/if_addr.h -do : - ac_fn_c_check_header_compile "$LINENO" "linux/if_addr.h" "ac_cv_header_linux_if_addr_h" " + ac_fn_c_check_header_compile "$LINENO" "linux/if_addr.h" "ac_cv_header_linux_if_addr_h" " #ifdef HAVE_SYS_SOCKET_H # include #endif " -if test "x$ac_cv_header_linux_if_addr_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LINUX_IF_ADDR_H 1 -_ACEOF +if test "x$ac_cv_header_linux_if_addr_h" = xyes +then : + printf "%s\n" "#define HAVE_LINUX_IF_ADDR_H 1" >>confdefs.h fi -done - -$as_echo "#define NEED_EARLY_FORK 1" >>confdefs.h +printf "%s\n" "#define NEED_EARLY_FORK 1" >>confdefs.h esac -for ac_header in arpa/nameser.h sys/param.h sys/time.h sys/timers.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "arpa/nameser.h" "ac_cv_header_arpa_nameser_h" "$ac_includes_default" +if test "x$ac_cv_header_arpa_nameser_h" = xyes +then : + printf "%s\n" "#define HAVE_ARPA_NAMESER_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/timers.h" "ac_cv_header_sys_timers_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_timers_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TIMERS_H 1" >>confdefs.h fi -done - # sys/sysctl.h depends on sys/param.h on OpenBSD - Bug 1576 -for ac_header in sys/sysctl.h -do : - ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" " +ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" " #if defined HAVE_SYS_PARAM_H # include #endif " -if test "x$ac_cv_header_sys_sysctl_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_SYSCTL_H 1 -_ACEOF +if test "x$ac_cv_header_sys_sysctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SYSCTL_H 1" >>confdefs.h fi -done +ac_fn_c_check_header_compile "$LINENO" "netinet/in_system.h" "ac_cv_header_netinet_in_system_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_system_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_SYSTEM_H 1" >>confdefs.h -for ac_header in netinet/in_system.h netinet/in_systm.h netinet/in.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +fi +ac_fn_c_check_header_compile "$LINENO" "netinet/in_systm.h" "ac_cv_header_netinet_in_systm_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_systm_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_SYSTM_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h fi -done - -for ac_header in resolv.h -do : - ac_fn_c_check_header_compile "$LINENO" "resolv.h" "ac_cv_header_resolv_h" " +ac_fn_c_check_header_compile "$LINENO" "resolv.h" "ac_cv_header_resolv_h" " #ifdef HAVE_SYS_TYPES_H # include #endif @@ -18115,19 +18797,14 @@ do : #endif " -if test "x$ac_cv_header_resolv_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_RESOLV_H 1 -_ACEOF +if test "x$ac_cv_header_resolv_h" = xyes +then : + printf "%s\n" "#define HAVE_RESOLV_H 1" >>confdefs.h fi -done - -for ac_header in net/if_var.h -do : - ac_fn_c_check_header_compile "$LINENO" "net/if_var.h" "ac_cv_header_net_if_var_h" " +ac_fn_c_check_header_compile "$LINENO" "net/if_var.h" "ac_cv_header_net_if_var_h" " #if HAVE_SYS_TYPES_H # include #endif @@ -18142,20 +18819,14 @@ do : #endif " -if test "x$ac_cv_header_net_if_var_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NET_IF_VAR_H 1 -_ACEOF +if test "x$ac_cv_header_net_if_var_h" = xyes +then : + printf "%s\n" "#define HAVE_NET_IF_VAR_H 1" >>confdefs.h fi -done - -for ac_header in netinet/ip.h netinet/in_var.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " +ac_fn_c_check_header_compile "$LINENO" "netinet/ip.h" "ac_cv_header_netinet_ip_h" " #ifdef HAVE_SYS_TYPES_H # include #endif @@ -18176,22 +18847,46 @@ ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " #endif " -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +if test "x$ac_cv_header_netinet_ip_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IP_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "netinet/in_var.h" "ac_cv_header_netinet_in_var_h" " + #ifdef HAVE_SYS_TYPES_H + # include + #endif + #ifdef HAVE_SYS_SOCKET_H + # include + #endif + #ifdef HAVE_NET_IF_H + # include + #endif + #ifdef HAVE_NETINET_IN_H + # include + #endif + #ifdef HAVE_NET_IF_VAR_H + # include + #endif + #ifdef HAVE_NETINET_IN_SYSTM_H + # include + #endif + +" +if test "x$ac_cv_header_netinet_in_var_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_VAR_H 1" >>confdefs.h fi -done - # HMS: Do we need to check for -lsocket before or after these tests? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_pton" >&5 -$as_echo_n "checking for library containing inet_pton... " >&6; } -if ${ac_cv_search_inet_pton+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing inet_pton" >&5 +printf %s "checking for library containing inet_pton... " >&6; } +if test ${ac_cv_search_inet_pton+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18199,46 +18894,48 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char inet_pton (); int -main () +main (void) { return inet_pton (); ; return 0; } _ACEOF -for ac_lib in '' nsl; do +for ac_lib in '' nsl +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_inet_pton=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_inet_pton+:} false; then : + if test ${ac_cv_search_inet_pton+y} +then : break fi done -if ${ac_cv_search_inet_pton+:} false; then : +if test ${ac_cv_search_inet_pton+y} +then : -else +else $as_nop ac_cv_search_inet_pton=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_pton" >&5 -$as_echo "$ac_cv_search_inet_pton" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_pton" >&5 +printf "%s\n" "$ac_cv_search_inet_pton" >&6; } ac_res=$ac_cv_search_inet_pton -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" case "$ac_cv_search_inet_pton" in 'none required') ;; @@ -18248,11 +18945,12 @@ if test "$ac_res" != no; then : fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5 -$as_echo_n "checking for library containing inet_ntop... " >&6; } -if ${ac_cv_search_inet_ntop+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5 +printf %s "checking for library containing inet_ntop... " >&6; } +if test ${ac_cv_search_inet_ntop+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18260,46 +18958,48 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char inet_ntop (); int -main () +main (void) { return inet_ntop (); ; return 0; } _ACEOF -for ac_lib in '' resolv; do +for ac_lib in '' resolv +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib -lnsl $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_inet_ntop=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_inet_ntop+:} false; then : + if test ${ac_cv_search_inet_ntop+y} +then : break fi done -if ${ac_cv_search_inet_ntop+:} false; then : +if test ${ac_cv_search_inet_ntop+y} +then : -else +else $as_nop ac_cv_search_inet_ntop=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5 -$as_echo "$ac_cv_search_inet_ntop" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5 +printf "%s\n" "$ac_cv_search_inet_ntop" >&6; } ac_res=$ac_cv_search_inet_ntop -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" case "$ac_cv_search_inet_ntop" in 'none required') ;; @@ -18317,11 +19017,12 @@ fi # functions there and never add libsocket. See also [Bug 660] # http://bugs.ntp.org/show_bug.cgi?id=660#c9 saved_LIBS=$LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5 -$as_echo_n "checking for library containing setsockopt... " >&6; } -if ${ac_cv_search_setsockopt+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5 +printf %s "checking for library containing setsockopt... " >&6; } +if test ${ac_cv_search_setsockopt+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18329,46 +19030,48 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char setsockopt (); int -main () +main (void) { return setsockopt (); ; return 0; } _ACEOF -for ac_lib in '' socket; do +for ac_lib in '' socket +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_setsockopt=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_setsockopt+:} false; then : + if test ${ac_cv_search_setsockopt+y} +then : break fi done -if ${ac_cv_search_setsockopt+:} false; then : +if test ${ac_cv_search_setsockopt+y} +then : -else +else $as_nop ac_cv_search_setsockopt=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setsockopt" >&5 -$as_echo "$ac_cv_search_setsockopt" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setsockopt" >&5 +printf "%s\n" "$ac_cv_search_setsockopt" >&6; } ac_res=$ac_cv_search_setsockopt -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" case "$ac_cv_search_setsockopt" in 'none required') ;; @@ -18381,11 +19084,12 @@ fi case "$ac_cv_search_setsockopt" in -lsocket) LIBS="$saved_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getsockopt" >&5 -$as_echo_n "checking for library containing getsockopt... " >&6; } -if ${ac_cv_search_getsockopt+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing getsockopt" >&5 +printf %s "checking for library containing getsockopt... " >&6; } +if test ${ac_cv_search_getsockopt+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18393,46 +19097,48 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char getsockopt (); int -main () +main (void) { return getsockopt (); ; return 0; } _ACEOF -for ac_lib in '' xnet; do +for ac_lib in '' xnet +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_getsockopt=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_getsockopt+:} false; then : + if test ${ac_cv_search_getsockopt+y} +then : break fi done -if ${ac_cv_search_getsockopt+:} false; then : +if test ${ac_cv_search_getsockopt+y} +then : -else +else $as_nop ac_cv_search_getsockopt=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getsockopt" >&5 -$as_echo "$ac_cv_search_getsockopt" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getsockopt" >&5 +printf "%s\n" "$ac_cv_search_getsockopt" >&6; } ac_res=$ac_cv_search_getsockopt -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" case "$ac_cv_search_getsockopt" in 'none required') ;; @@ -18458,44 +19164,42 @@ esac { saved_LIBS=; unset saved_LIBS;} # Bug 2427 - look for recvmsg here. -for ac_func in recvmsg -do : - ac_fn_c_check_func "$LINENO" "recvmsg" "ac_cv_func_recvmsg" -if test "x$ac_cv_func_recvmsg" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_RECVMSG 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "recvmsg" "ac_cv_func_recvmsg" +if test "x$ac_cv_func_recvmsg" = xyes +then : + printf "%s\n" "#define HAVE_RECVMSG 1" >>confdefs.h fi -done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } +static $ac_kw foo_t static_foo (void) {return 0; } +$ac_kw foo_t foo (void) {return 0; } #endif _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_inline=$ac_kw fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; @@ -18518,61 +19222,37 @@ case "$ac_cv_c_inline" in ;; *) -$as_echo "#define HAVE_INLINE 1" >>confdefs.h +printf "%s\n" "#define HAVE_INLINE 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if ${ac_cv_header_time+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_time=yes -else - ac_cv_header_time=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then +# Obsolete code to be removed. +if test $ac_cv_header_sys_time_h = yes; then -$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h +printf "%s\n" "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi +# End of obsolete code. # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5 -$as_echo_n "checking size of time_t... " >&6; } -if ${ac_cv_sizeof_time_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5 +printf %s "checking size of time_t... " >&6; } +if test ${ac_cv_sizeof_time_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_time_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (time_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -18581,26 +19261,25 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5 -$as_echo "$ac_cv_sizeof_time_t" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5 +printf "%s\n" "$ac_cv_sizeof_time_t" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_TIME_T $ac_cv_sizeof_time_t -_ACEOF +printf "%s\n" "#define SIZEOF_TIME_T $ac_cv_sizeof_time_t" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 -$as_echo_n "checking whether char is unsigned... " >&6; } -if ${ac_cv_c_char_unsigned+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 +printf %s "checking whether char is unsigned... " >&6; } +if test ${ac_cv_c_char_unsigned+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { static int test_array [1 - 2 * !(((char) -1) < 0)]; test_array [0] = 0; @@ -18610,34 +19289,37 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_char_unsigned=no -else +else $as_nop ac_cv_c_char_unsigned=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 -$as_echo "$ac_cv_c_char_unsigned" >&6; } -if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then - $as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 +printf "%s\n" "$ac_cv_c_char_unsigned" >&6; } +if test $ac_cv_c_char_unsigned = yes; then + printf "%s\n" "#define __CHAR_UNSIGNED__ 1" >>confdefs.h fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed char" >&5 -$as_echo_n "checking size of signed char... " >&6; } -if ${ac_cv_sizeof_signed_char+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed char))" "ac_cv_sizeof_signed_char" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of signed char" >&5 +printf %s "checking size of signed char... " >&6; } +if test ${ac_cv_sizeof_signed_char+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed char))" "ac_cv_sizeof_signed_char" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_signed_char" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (signed char) See \`config.log' for more details" "$LINENO" 5; } else @@ -18646,31 +19328,27 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_char" >&5 -$as_echo "$ac_cv_sizeof_signed_char" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_char" >&5 +printf "%s\n" "$ac_cv_sizeof_signed_char" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char -_ACEOF +printf "%s\n" "#define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char" >>confdefs.h ac_fn_c_check_type "$LINENO" "s_char" "ac_cv_type_s_char" "$ac_includes_default" -if test "x$ac_cv_type_s_char" = xyes; then : +if test "x$ac_cv_type_s_char" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_S_CHAR 1 -_ACEOF +printf "%s\n" "#define HAVE_S_CHAR 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" -if test "x$ac_cv_type_long_long" = xyes; then : +if test "x$ac_cv_type_long_long" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_LONG_LONG 1 -_ACEOF +printf "%s\n" "#define HAVE_LONG_LONG 1" >>confdefs.h fi @@ -18679,17 +19357,19 @@ fi # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 -$as_echo_n "checking size of short... " >&6; } -if ${ac_cv_sizeof_short+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 +printf %s "checking size of short... " >&6; } +if test ${ac_cv_sizeof_short+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_short" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (short) See \`config.log' for more details" "$LINENO" 5; } else @@ -18698,31 +19378,31 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 -$as_echo "$ac_cv_sizeof_short" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 +printf "%s\n" "$ac_cv_sizeof_short" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SHORT $ac_cv_sizeof_short -_ACEOF +printf "%s\n" "#define SIZEOF_SHORT $ac_cv_sizeof_short" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 -$as_echo_n "checking size of int... " >&6; } -if ${ac_cv_sizeof_int+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +printf %s "checking size of int... " >&6; } +if test ${ac_cv_sizeof_int+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_int" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else @@ -18731,31 +19411,31 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 -$as_echo "$ac_cv_sizeof_int" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +printf "%s\n" "$ac_cv_sizeof_int" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT $ac_cv_sizeof_int -_ACEOF +printf "%s\n" "#define SIZEOF_INT $ac_cv_sizeof_int" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if ${ac_cv_sizeof_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +printf %s "checking size of long... " >&6; } +if test ${ac_cv_sizeof_long+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else @@ -18764,14 +19444,12 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +printf "%s\n" "$ac_cv_sizeof_long" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF +printf "%s\n" "#define SIZEOF_LONG $ac_cv_sizeof_long" >>confdefs.h @@ -18783,17 +19461,19 @@ case "$ac_cv_type_long_long" in # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 -$as_echo_n "checking size of long long... " >&6; } -if ${ac_cv_sizeof_long_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +printf %s "checking size of long long... " >&6; } +if test ${ac_cv_sizeof_long_long+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_long_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long long) See \`config.log' for more details" "$LINENO" 5; } else @@ -18802,14 +19482,12 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 -$as_echo "$ac_cv_sizeof_long_long" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +printf "%s\n" "$ac_cv_sizeof_long_long" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long -_ACEOF +printf "%s\n" "#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long" >>confdefs.h ;; @@ -18822,13 +19500,13 @@ case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in no0no) # We have signed chars, can't say 'signed char', no s_char typedef. -$as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h +printf "%s\n" "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h ;; no1no) # We have signed chars, can say 'signed char', no s_char typedef. -$as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h +printf "%s\n" "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h ;; yes0no) @@ -18838,38 +19516,40 @@ $as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h yes1no) # We have unsigned chars, can say 'signed char', no s_char typedef. -$as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h +printf "%s\n" "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 -$as_echo_n "checking for uid_t in sys/types.h... " >&6; } -if ${ac_cv_type_uid_t+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +printf %s "checking for uid_t in sys/types.h... " >&6; } +if test ${ac_cv_type_uid_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1; then : + $EGREP "uid_t" >/dev/null 2>&1 +then : ac_cv_type_uid_t=yes -else +else $as_nop ac_cv_type_uid_t=no fi -rm -f conftest* +rm -rf conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 -$as_echo "$ac_cv_type_uid_t" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +printf "%s\n" "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then -$as_echo "#define uid_t int" >>confdefs.h +printf "%s\n" "#define uid_t int" >>confdefs.h -$as_echo "#define gid_t int" >>confdefs.h +printf "%s\n" "#define gid_t int" >>confdefs.h fi @@ -18878,12 +19558,13 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we're including debugging code" >&5 -$as_echo_n "checking if we're including debugging code... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we're including debugging code" >&5 +printf %s "checking if we're including debugging code... " >&6; } # Check whether --enable-debugging was given. -if test "${enable_debugging+set}" = set; then : +if test ${enable_debugging+y} +then : enableval=$enable_debugging; ntp_ok=$enableval -else +else $as_nop ntp_ok=yes fi @@ -18891,42 +19572,34 @@ fi case "$ntp_ok" in yes) -$as_echo "#define DEBUG 1" >>confdefs.h +printf "%s\n" "#define DEBUG 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } # check if we can compile with pthreads -for ac_header in semaphore.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "semaphore.h" "ac_cv_header_semaphore_h" "$ac_includes_default" -if test "x$ac_cv_header_semaphore_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SEMAPHORE_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "semaphore.h" "ac_cv_header_semaphore_h" "$ac_includes_default" +if test "x$ac_cv_header_semaphore_h" = xyes +then : + printf "%s\n" "#define HAVE_SEMAPHORE_H 1" >>confdefs.h fi -done - -for ac_func in socketpair -do : - ac_fn_c_check_func "$LINENO" "socketpair" "ac_cv_func_socketpair" -if test "x$ac_cv_func_socketpair" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SOCKETPAIR 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "socketpair" "ac_cv_func_socketpair" +if test "x$ac_cv_func_socketpair" = xyes +then : + printf "%s\n" "#define HAVE_SOCKETPAIR 1" >>confdefs.h fi -done # Check whether --enable-thread-support was given. -if test "${enable_thread_support+set}" = set; then : +if test ${enable_thread_support+y} +then : enableval=$enable_thread_support; -else +else $as_nop enable_thread_support=yes fi @@ -18948,7 +19621,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # OpenLDAP --with-threads # Check whether --with-threads was given. -if test "${with_threads+set}" = set; then : +if test ${with_threads+y} +then : withval=$with_threads; ol_arg=invalid for ol_val in auto nt posix mach pth lwp yes no manual ; do @@ -18961,7 +19635,7 @@ if test "${with_threads+set}" = set; then : fi ol_with_threads="$ol_arg" -else +else $as_nop ol_with_threads="auto" fi # end --with-threads @@ -18990,11 +19664,12 @@ if test $ol_aix_threads = yes ; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -19002,11 +19677,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -19017,11 +19696,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -19033,8 +19712,8 @@ done if test $ol_with_threads != auto ; then as_fn_error $? "--with-threads requires cc_r (or other suitable compiler) on AIX" "$LINENO" 5 else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling threads, no cc_r on AIX" >&5 -$as_echo "$as_me: WARNING: disabling threads, no cc_r on AIX" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: disabling threads, no cc_r on AIX" >&5 +printf "%s\n" "$as_me: WARNING: disabling threads, no cc_r on AIX" >&2;} fi ol_with_threads=no fi @@ -19051,7 +19730,8 @@ ol_link_threads=no # OpenLDAP --with-yielding_select # Check whether --with-yielding_select was given. -if test "${with_yielding_select+set}" = set; then : +if test ${with_yielding_select+y} +then : withval=$with_yielding_select; ol_arg=invalid for ol_val in auto yes no manual ; do @@ -19064,7 +19744,7 @@ if test "${with_yielding_select+set}" = set; then : fi ol_with_yielding_select="$ol_arg" -else +else $as_nop ol_with_yielding_select="auto" fi # end --with-yielding_select @@ -19074,14 +19754,15 @@ case $ol_with_threads in auto | yes | nt) ac_fn_c_check_func "$LINENO" "_beginthread" "ac_cv_func__beginthread" -if test "x$ac_cv_func__beginthread" = xyes; then : +if test "x$ac_cv_func__beginthread" = xyes +then : fi if test $ac_cv_func__beginthread = yes ; then -$as_echo "#define HAVE_NT_THREADS 1" >>confdefs.h +printf "%s\n" "#define HAVE_NT_THREADS 1" >>confdefs.h ol_cv_nt_threads=yes fi @@ -19093,10 +19774,10 @@ $as_echo "#define HAVE_NT_THREADS 1" >>confdefs.h ol_with_yielding_select=yes -$as_echo "#define HAVE_NT_SERVICE_MANAGER 1" >>confdefs.h +printf "%s\n" "#define HAVE_NT_SERVICE_MANAGER 1" >>confdefs.h -$as_echo "#define HAVE_NT_EVENT_LOG 1" >>confdefs.h +printf "%s\n" "#define HAVE_NT_EVENT_LOG 1" >>confdefs.h fi @@ -19108,25 +19789,21 @@ esac case $ol_with_threads in auto | yes | posix) - for ac_header in pthread.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREAD_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_H 1" >>confdefs.h fi -done - if test $ac_cv_header_pthread_h = yes ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking POSIX thread version" >&5 -$as_echo_n "checking POSIX thread version... " >&6; } -if ${ol_cv_pthread_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking POSIX thread version" >&5 +printf %s "checking POSIX thread version... " >&6; } +if test ${ol_cv_pthread_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19134,7 +19811,7 @@ else # include int -main () +main (void) { int i = PTHREAD_CREATE_JOINABLE; @@ -19143,7 +19820,8 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19151,14 +19829,15 @@ if ac_fn_c_try_compile "$LINENO"; then : _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "pthread_detach" >/dev/null 2>&1; then : + $EGREP "pthread_detach" >/dev/null 2>&1 +then : ol_cv_pthread_version=10 -else +else $as_nop ol_cv_pthread_version=8 fi -rm -f conftest* +rm -rf conftest* -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19170,9 +19849,10 @@ else _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "draft7" >/dev/null 2>&1; then : + $EGREP "draft7" >/dev/null 2>&1 +then : ol_cv_pthread_version=7 -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19180,9 +19860,10 @@ else _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "pthread_attr_init" >/dev/null 2>&1; then : + $EGREP "pthread_attr_init" >/dev/null 2>&1 +then : ol_cv_pthread_version=6 -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19194,32 +19875,31 @@ else _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "draft5" >/dev/null 2>&1; then : + $EGREP "draft5" >/dev/null 2>&1 +then : ol_cv_pthread_version=5 -else +else $as_nop ol_cv_pthread_version=4 fi -rm -f conftest* +rm -rf conftest* fi -rm -f conftest* +rm -rf conftest* fi -rm -f conftest* +rm -rf conftest* fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_version" >&5 -$as_echo "$ol_cv_pthread_version" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_version" >&5 +printf "%s\n" "$ol_cv_pthread_version" >&6; } if test $ol_cv_pthread_version != 0 ; then -cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREADS $ol_cv_pthread_version -_ACEOF +printf "%s\n" "#define HAVE_PTHREADS $ol_cv_pthread_version" >>confdefs.h else as_fn_error $? "unknown pthread version" "$LINENO" 5 @@ -19229,39 +19909,42 @@ _ACEOF ol_with_threads=found - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads pthread.h" >&5 -$as_echo_n "checking for LinuxThreads pthread.h... " >&6; } -if ${ol_cv_header_linux_threads+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads pthread.h" >&5 +printf %s "checking for LinuxThreads pthread.h... " >&6; } +if test ${ol_cv_header_linux_threads+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "pthread_kill_other_threads_np" >/dev/null 2>&1; then : + $EGREP "pthread_kill_other_threads_np" >/dev/null 2>&1 +then : ol_cv_header_linux_threads=yes -else +else $as_nop ol_cv_header_linux_threads=no fi -rm -f conftest* +rm -rf conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_linux_threads" >&5 -$as_echo "$ol_cv_header_linux_threads" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_linux_threads" >&5 +printf "%s\n" "$ol_cv_header_linux_threads" >&6; } if test $ol_cv_header_linux_threads = yes; then -$as_echo "#define HAVE_LINUX_THREADS 1" >>confdefs.h +printf "%s\n" "#define HAVE_LINUX_THREADS 1" >>confdefs.h fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU Pth pthread.h" >&5 -$as_echo_n "checking for GNU Pth pthread.h... " >&6; } -if ${ol_cv_header_gnu_pth_pthread_h+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU Pth pthread.h" >&5 +printf %s "checking for GNU Pth pthread.h... " >&6; } +if test ${ol_cv_header_gnu_pth_pthread_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -19271,42 +19954,40 @@ else _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "__gnu_pth__" >/dev/null 2>&1; then : + $EGREP "__gnu_pth__" >/dev/null 2>&1 +then : ol_cv_header_gnu_pth_pthread_h=yes -else +else $as_nop ol_cv_header_gnu_pth_pthread_h=no fi -rm -f conftest* +rm -rf conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_gnu_pth_pthread_h" >&5 -$as_echo "$ol_cv_header_gnu_pth_pthread_h" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_gnu_pth_pthread_h" >&5 +printf "%s\n" "$ol_cv_header_gnu_pth_pthread_h" >&6; } if test $ol_cv_header_gnu_pth_pthread_h = no ; then - for ac_header in sched.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default" -if test "x$ac_cv_header_sched_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SCHED_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default" +if test "x$ac_cv_header_sched_h" = xyes +then : + printf "%s\n" "#define HAVE_SCHED_H 1" >>confdefs.h fi -done - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in default libraries" >&5 -$as_echo_n "checking for pthread_create in default libraries... " >&6; } -if ${ol_cv_pthread_create+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in default libraries" >&5 +printf %s "checking for pthread_create in default libraries... " >&6; } +if test ${ol_cv_pthread_create+y} +then : + printf %s "(cached) " >&6 +else $as_nop - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19326,7 +20007,7 @@ static void *task(p) } int -main () +main (void) { /* pthread test function */ @@ -19379,14 +20060,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_pthread_create=yes -else +else $as_nop ol_cv_pthread_create=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19461,9 +20143,10 @@ int main(argc, argv) } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ol_cv_pthread_create=yes -else +else $as_nop ol_cv_pthread_create=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -19471,8 +20154,8 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_create" >&5 -$as_echo "$ol_cv_pthread_create" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_create" >&5 +printf "%s\n" "$ol_cv_pthread_create" >&6; } if test $ol_cv_pthread_create != no ; then ol_link_threads=posix @@ -19482,17 +20165,19 @@ $as_echo "$ol_cv_pthread_create" >&6; } # Pthread try link: -kthread (ol_cv_pthread_kthread) if test "$ol_link_threads" = no ; then # try -kthread - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -kthread" >&5 -$as_echo_n "checking for pthread link with -kthread... " >&6; } -if ${ol_cv_pthread_kthread+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread link with -kthread" >&5 +printf %s "checking for pthread link with -kthread... " >&6; } +if test ${ol_cv_pthread_kthread+y} +then : + printf %s "(cached) " >&6 +else $as_nop # save the flags ol_LIBS="$LIBS" LIBS="-kthread $LIBS" - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19512,7 +20197,7 @@ static void *task(p) } int -main () +main (void) { /* pthread test function */ @@ -19565,14 +20250,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_pthread_kthread=yes -else +else $as_nop ol_cv_pthread_kthread=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19647,9 +20333,10 @@ int main(argc, argv) } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ol_cv_pthread_kthread=yes -else +else $as_nop ol_cv_pthread_kthread=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -19661,8 +20348,8 @@ fi LIBS="$ol_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_kthread" >&5 -$as_echo "$ol_cv_pthread_kthread" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_kthread" >&5 +printf "%s\n" "$ol_cv_pthread_kthread" >&6; } if test $ol_cv_pthread_kthread = yes ; then ol_link_pthreads="-kthread" @@ -19673,17 +20360,19 @@ fi # Pthread try link: -pthread (ol_cv_pthread_pthread) if test "$ol_link_threads" = no ; then # try -pthread - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -pthread" >&5 -$as_echo_n "checking for pthread link with -pthread... " >&6; } -if ${ol_cv_pthread_pthread+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread link with -pthread" >&5 +printf %s "checking for pthread link with -pthread... " >&6; } +if test ${ol_cv_pthread_pthread+y} +then : + printf %s "(cached) " >&6 +else $as_nop # save the flags ol_LIBS="$LIBS" LIBS="-pthread $LIBS" - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19703,7 +20392,7 @@ static void *task(p) } int -main () +main (void) { /* pthread test function */ @@ -19756,14 +20445,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_pthread_pthread=yes -else +else $as_nop ol_cv_pthread_pthread=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19838,9 +20528,10 @@ int main(argc, argv) } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ol_cv_pthread_pthread=yes -else +else $as_nop ol_cv_pthread_pthread=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -19852,8 +20543,8 @@ fi LIBS="$ol_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_pthread" >&5 -$as_echo "$ol_cv_pthread_pthread" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_pthread" >&5 +printf "%s\n" "$ol_cv_pthread_pthread" >&6; } if test $ol_cv_pthread_pthread = yes ; then ol_link_pthreads="-pthread" @@ -19864,17 +20555,19 @@ fi # Pthread try link: -pthreads (ol_cv_pthread_pthreads) if test "$ol_link_threads" = no ; then # try -pthreads - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -pthreads" >&5 -$as_echo_n "checking for pthread link with -pthreads... " >&6; } -if ${ol_cv_pthread_pthreads+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread link with -pthreads" >&5 +printf %s "checking for pthread link with -pthreads... " >&6; } +if test ${ol_cv_pthread_pthreads+y} +then : + printf %s "(cached) " >&6 +else $as_nop # save the flags ol_LIBS="$LIBS" LIBS="-pthreads $LIBS" - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19894,7 +20587,7 @@ static void *task(p) } int -main () +main (void) { /* pthread test function */ @@ -19947,14 +20640,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_pthread_pthreads=yes -else +else $as_nop ol_cv_pthread_pthreads=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -20029,9 +20723,10 @@ int main(argc, argv) } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ol_cv_pthread_pthreads=yes -else +else $as_nop ol_cv_pthread_pthreads=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -20043,8 +20738,8 @@ fi LIBS="$ol_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_pthreads" >&5 -$as_echo "$ol_cv_pthread_pthreads" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_pthreads" >&5 +printf "%s\n" "$ol_cv_pthread_pthreads" >&6; } if test $ol_cv_pthread_pthreads = yes ; then ol_link_pthreads="-pthreads" @@ -20055,17 +20750,19 @@ fi # Pthread try link: -mthreads (ol_cv_pthread_mthreads) if test "$ol_link_threads" = no ; then # try -mthreads - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -mthreads" >&5 -$as_echo_n "checking for pthread link with -mthreads... " >&6; } -if ${ol_cv_pthread_mthreads+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread link with -mthreads" >&5 +printf %s "checking for pthread link with -mthreads... " >&6; } +if test ${ol_cv_pthread_mthreads+y} +then : + printf %s "(cached) " >&6 +else $as_nop # save the flags ol_LIBS="$LIBS" LIBS="-mthreads $LIBS" - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -20085,7 +20782,7 @@ static void *task(p) } int -main () +main (void) { /* pthread test function */ @@ -20138,14 +20835,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_pthread_mthreads=yes -else +else $as_nop ol_cv_pthread_mthreads=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -20220,9 +20918,10 @@ int main(argc, argv) } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ol_cv_pthread_mthreads=yes -else +else $as_nop ol_cv_pthread_mthreads=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -20234,8 +20933,8 @@ fi LIBS="$ol_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_mthreads" >&5 -$as_echo "$ol_cv_pthread_mthreads" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_mthreads" >&5 +printf "%s\n" "$ol_cv_pthread_mthreads" >&6; } if test $ol_cv_pthread_mthreads = yes ; then ol_link_pthreads="-mthreads" @@ -20246,17 +20945,19 @@ fi # Pthread try link: -thread (ol_cv_pthread_thread) if test "$ol_link_threads" = no ; then # try -thread - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -thread" >&5 -$as_echo_n "checking for pthread link with -thread... " >&6; } -if ${ol_cv_pthread_thread+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread link with -thread" >&5 +printf %s "checking for pthread link with -thread... " >&6; } +if test ${ol_cv_pthread_thread+y} +then : + printf %s "(cached) " >&6 +else $as_nop # save the flags ol_LIBS="$LIBS" LIBS="-thread $LIBS" - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -20276,7 +20977,7 @@ static void *task(p) } int -main () +main (void) { /* pthread test function */ @@ -20329,14 +21030,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_pthread_thread=yes -else +else $as_nop ol_cv_pthread_thread=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -20411,9 +21113,10 @@ int main(argc, argv) } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ol_cv_pthread_thread=yes -else +else $as_nop ol_cv_pthread_thread=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -20425,8 +21128,8 @@ fi LIBS="$ol_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_thread" >&5 -$as_echo "$ol_cv_pthread_thread" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_thread" >&5 +printf "%s\n" "$ol_cv_pthread_thread" >&6; } if test $ol_cv_pthread_thread = yes ; then ol_link_pthreads="-thread" @@ -20438,17 +21141,19 @@ fi # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r) if test "$ol_link_threads" = no ; then # try -lpthread -lmach -lexc -lc_r - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5 -$as_echo_n "checking for pthread link with -lpthread -lmach -lexc -lc_r... " >&6; } -if ${ol_cv_pthread_lpthread_lmach_lexc_lc_r+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5 +printf %s "checking for pthread link with -lpthread -lmach -lexc -lc_r... " >&6; } +if test ${ol_cv_pthread_lpthread_lmach_lexc_lc_r+y} +then : + printf %s "(cached) " >&6 +else $as_nop # save the flags ol_LIBS="$LIBS" LIBS="-lpthread -lmach -lexc -lc_r $LIBS" - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -20468,7 +21173,7 @@ static void *task(p) } int -main () +main (void) { /* pthread test function */ @@ -20521,14 +21226,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes -else +else $as_nop ol_cv_pthread_lpthread_lmach_lexc_lc_r=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -20603,9 +21309,10 @@ int main(argc, argv) } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes -else +else $as_nop ol_cv_pthread_lpthread_lmach_lexc_lc_r=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -20617,8 +21324,8 @@ fi LIBS="$ol_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread_lmach_lexc_lc_r" >&5 -$as_echo "$ol_cv_pthread_lpthread_lmach_lexc_lc_r" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread_lmach_lexc_lc_r" >&5 +printf "%s\n" "$ol_cv_pthread_lpthread_lmach_lexc_lc_r" >&6; } if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then ol_link_pthreads="-lpthread -lmach -lexc -lc_r" @@ -20629,17 +21336,19 @@ fi # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc) if test "$ol_link_threads" = no ; then # try -lpthread -lmach -lexc - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -lmach -lexc" >&5 -$as_echo_n "checking for pthread link with -lpthread -lmach -lexc... " >&6; } -if ${ol_cv_pthread_lpthread_lmach_lexc+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -lmach -lexc" >&5 +printf %s "checking for pthread link with -lpthread -lmach -lexc... " >&6; } +if test ${ol_cv_pthread_lpthread_lmach_lexc+y} +then : + printf %s "(cached) " >&6 +else $as_nop # save the flags ol_LIBS="$LIBS" LIBS="-lpthread -lmach -lexc $LIBS" - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -20659,7 +21368,7 @@ static void *task(p) } int -main () +main (void) { /* pthread test function */ @@ -20712,14 +21421,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_pthread_lpthread_lmach_lexc=yes -else +else $as_nop ol_cv_pthread_lpthread_lmach_lexc=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -20794,9 +21504,10 @@ int main(argc, argv) } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ol_cv_pthread_lpthread_lmach_lexc=yes -else +else $as_nop ol_cv_pthread_lpthread_lmach_lexc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -20808,8 +21519,8 @@ fi LIBS="$ol_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread_lmach_lexc" >&5 -$as_echo "$ol_cv_pthread_lpthread_lmach_lexc" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread_lmach_lexc" >&5 +printf "%s\n" "$ol_cv_pthread_lpthread_lmach_lexc" >&6; } if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then ol_link_pthreads="-lpthread -lmach -lexc" @@ -20821,17 +21532,19 @@ fi # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff) if test "$ol_link_threads" = no ; then # try -lpthread -Wl,-woff,85 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -Wl,-woff,85" >&5 -$as_echo_n "checking for pthread link with -lpthread -Wl,-woff,85... " >&6; } -if ${ol_cv_pthread_lib_lpthread_woff+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -Wl,-woff,85" >&5 +printf %s "checking for pthread link with -lpthread -Wl,-woff,85... " >&6; } +if test ${ol_cv_pthread_lib_lpthread_woff+y} +then : + printf %s "(cached) " >&6 +else $as_nop # save the flags ol_LIBS="$LIBS" LIBS="-lpthread -Wl,-woff,85 $LIBS" - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -20851,7 +21564,7 @@ static void *task(p) } int -main () +main (void) { /* pthread test function */ @@ -20904,14 +21617,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_pthread_lib_lpthread_woff=yes -else +else $as_nop ol_cv_pthread_lib_lpthread_woff=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -20986,9 +21700,10 @@ int main(argc, argv) } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ol_cv_pthread_lib_lpthread_woff=yes -else +else $as_nop ol_cv_pthread_lib_lpthread_woff=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -21000,8 +21715,8 @@ fi LIBS="$ol_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lib_lpthread_woff" >&5 -$as_echo "$ol_cv_pthread_lib_lpthread_woff" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lib_lpthread_woff" >&5 +printf "%s\n" "$ol_cv_pthread_lib_lpthread_woff" >&6; } if test $ol_cv_pthread_lib_lpthread_woff = yes ; then ol_link_pthreads="-lpthread -Wl,-woff,85" @@ -21013,17 +21728,19 @@ fi # Pthread try link: -lpthread (ol_cv_pthread_lpthread) if test "$ol_link_threads" = no ; then # try -lpthread - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread" >&5 -$as_echo_n "checking for pthread link with -lpthread... " >&6; } -if ${ol_cv_pthread_lpthread+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread" >&5 +printf %s "checking for pthread link with -lpthread... " >&6; } +if test ${ol_cv_pthread_lpthread+y} +then : + printf %s "(cached) " >&6 +else $as_nop # save the flags ol_LIBS="$LIBS" LIBS="-lpthread $LIBS" - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -21043,7 +21760,7 @@ static void *task(p) } int -main () +main (void) { /* pthread test function */ @@ -21096,14 +21813,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_pthread_lpthread=yes -else +else $as_nop ol_cv_pthread_lpthread=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -21178,9 +21896,10 @@ int main(argc, argv) } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ol_cv_pthread_lpthread=yes -else +else $as_nop ol_cv_pthread_lpthread=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -21192,8 +21911,8 @@ fi LIBS="$ol_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread" >&5 -$as_echo "$ol_cv_pthread_lpthread" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread" >&5 +printf "%s\n" "$ol_cv_pthread_lpthread" >&6; } if test $ol_cv_pthread_lpthread = yes ; then ol_link_pthreads="-lpthread" @@ -21204,17 +21923,19 @@ fi # Pthread try link: -lc_r (ol_cv_pthread_lc_r) if test "$ol_link_threads" = no ; then # try -lc_r - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lc_r" >&5 -$as_echo_n "checking for pthread link with -lc_r... " >&6; } -if ${ol_cv_pthread_lc_r+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lc_r" >&5 +printf %s "checking for pthread link with -lc_r... " >&6; } +if test ${ol_cv_pthread_lc_r+y} +then : + printf %s "(cached) " >&6 +else $as_nop # save the flags ol_LIBS="$LIBS" LIBS="-lc_r $LIBS" - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -21234,7 +21955,7 @@ static void *task(p) } int -main () +main (void) { /* pthread test function */ @@ -21287,14 +22008,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_pthread_lc_r=yes -else +else $as_nop ol_cv_pthread_lc_r=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -21369,9 +22091,10 @@ int main(argc, argv) } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ol_cv_pthread_lc_r=yes -else +else $as_nop ol_cv_pthread_lc_r=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -21383,8 +22106,8 @@ fi LIBS="$ol_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lc_r" >&5 -$as_echo "$ol_cv_pthread_lc_r" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lc_r" >&5 +printf "%s\n" "$ol_cv_pthread_lc_r" >&6; } if test $ol_cv_pthread_lc_r = yes ; then ol_link_pthreads="-lc_r" @@ -21396,17 +22119,19 @@ fi # Pthread try link: -threads (ol_cv_pthread_threads) if test "$ol_link_threads" = no ; then # try -threads - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -threads" >&5 -$as_echo_n "checking for pthread link with -threads... " >&6; } -if ${ol_cv_pthread_threads+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread link with -threads" >&5 +printf %s "checking for pthread link with -threads... " >&6; } +if test ${ol_cv_pthread_threads+y} +then : + printf %s "(cached) " >&6 +else $as_nop # save the flags ol_LIBS="$LIBS" LIBS="-threads $LIBS" - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -21426,7 +22151,7 @@ static void *task(p) } int -main () +main (void) { /* pthread test function */ @@ -21479,14 +22204,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_pthread_threads=yes -else +else $as_nop ol_cv_pthread_threads=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -21561,9 +22287,10 @@ int main(argc, argv) } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ol_cv_pthread_threads=yes -else +else $as_nop ol_cv_pthread_threads=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -21575,8 +22302,8 @@ fi LIBS="$ol_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_threads" >&5 -$as_echo "$ol_cv_pthread_threads" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_threads" >&5 +printf "%s\n" "$ol_cv_pthread_threads" >&6; } if test $ol_cv_pthread_threads = yes ; then ol_link_pthreads="-threads" @@ -21588,17 +22315,19 @@ fi # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r) if test "$ol_link_threads" = no ; then # try -lpthreads -lmach -lexc -lc_r - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5 -$as_echo_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r... " >&6; } -if ${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5 +printf %s "checking for pthread link with -lpthreads -lmach -lexc -lc_r... " >&6; } +if test ${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+y} +then : + printf %s "(cached) " >&6 +else $as_nop # save the flags ol_LIBS="$LIBS" LIBS="-lpthreads -lmach -lexc -lc_r $LIBS" - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -21618,7 +22347,7 @@ static void *task(p) } int -main () +main (void) { /* pthread test function */ @@ -21671,14 +22400,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes -else +else $as_nop ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -21753,9 +22483,10 @@ int main(argc, argv) } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes -else +else $as_nop ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -21767,8 +22498,8 @@ fi LIBS="$ol_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lmach_lexc_lc_r" >&5 -$as_echo "$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lmach_lexc_lc_r" >&5 +printf "%s\n" "$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" >&6; } if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then ol_link_pthreads="-lpthreads -lmach -lexc -lc_r" @@ -21779,17 +22510,19 @@ fi # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc) if test "$ol_link_threads" = no ; then # try -lpthreads -lmach -lexc - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lmach -lexc" >&5 -$as_echo_n "checking for pthread link with -lpthreads -lmach -lexc... " >&6; } -if ${ol_cv_pthread_lpthreads_lmach_lexc+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lmach -lexc" >&5 +printf %s "checking for pthread link with -lpthreads -lmach -lexc... " >&6; } +if test ${ol_cv_pthread_lpthreads_lmach_lexc+y} +then : + printf %s "(cached) " >&6 +else $as_nop # save the flags ol_LIBS="$LIBS" LIBS="-lpthreads -lmach -lexc $LIBS" - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -21809,7 +22542,7 @@ static void *task(p) } int -main () +main (void) { /* pthread test function */ @@ -21862,14 +22595,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_pthread_lpthreads_lmach_lexc=yes -else +else $as_nop ol_cv_pthread_lpthreads_lmach_lexc=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -21944,9 +22678,10 @@ int main(argc, argv) } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ol_cv_pthread_lpthreads_lmach_lexc=yes -else +else $as_nop ol_cv_pthread_lpthreads_lmach_lexc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -21958,8 +22693,8 @@ fi LIBS="$ol_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lmach_lexc" >&5 -$as_echo "$ol_cv_pthread_lpthreads_lmach_lexc" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lmach_lexc" >&5 +printf "%s\n" "$ol_cv_pthread_lpthreads_lmach_lexc" >&6; } if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then ol_link_pthreads="-lpthreads -lmach -lexc" @@ -21970,17 +22705,19 @@ fi # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc) if test "$ol_link_threads" = no ; then # try -lpthreads -lexc - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lexc" >&5 -$as_echo_n "checking for pthread link with -lpthreads -lexc... " >&6; } -if ${ol_cv_pthread_lpthreads_lexc+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lexc" >&5 +printf %s "checking for pthread link with -lpthreads -lexc... " >&6; } +if test ${ol_cv_pthread_lpthreads_lexc+y} +then : + printf %s "(cached) " >&6 +else $as_nop # save the flags ol_LIBS="$LIBS" LIBS="-lpthreads -lexc $LIBS" - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -22000,7 +22737,7 @@ static void *task(p) } int -main () +main (void) { /* pthread test function */ @@ -22053,14 +22790,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_pthread_lpthreads_lexc=yes -else +else $as_nop ol_cv_pthread_lpthreads_lexc=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -22135,9 +22873,10 @@ int main(argc, argv) } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ol_cv_pthread_lpthreads_lexc=yes -else +else $as_nop ol_cv_pthread_lpthreads_lexc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -22149,8 +22888,8 @@ fi LIBS="$ol_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lexc" >&5 -$as_echo "$ol_cv_pthread_lpthreads_lexc" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lexc" >&5 +printf "%s\n" "$ol_cv_pthread_lpthreads_lexc" >&6; } if test $ol_cv_pthread_lpthreads_lexc = yes ; then ol_link_pthreads="-lpthreads -lexc" @@ -22162,17 +22901,19 @@ fi # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads) if test "$ol_link_threads" = no ; then # try -lpthreads - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads" >&5 -$as_echo_n "checking for pthread link with -lpthreads... " >&6; } -if ${ol_cv_pthread_lib_lpthreads+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads" >&5 +printf %s "checking for pthread link with -lpthreads... " >&6; } +if test ${ol_cv_pthread_lib_lpthreads+y} +then : + printf %s "(cached) " >&6 +else $as_nop # save the flags ol_LIBS="$LIBS" LIBS="-lpthreads $LIBS" - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -22192,7 +22933,7 @@ static void *task(p) } int -main () +main (void) { /* pthread test function */ @@ -22245,14 +22986,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_pthread_lib_lpthreads=yes -else +else $as_nop ol_cv_pthread_lib_lpthreads=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -22327,9 +23069,10 @@ int main(argc, argv) } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ol_cv_pthread_lib_lpthreads=yes -else +else $as_nop ol_cv_pthread_lib_lpthreads=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -22341,8 +23084,8 @@ fi LIBS="$ol_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lib_lpthreads" >&5 -$as_echo "$ol_cv_pthread_lib_lpthreads" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lib_lpthreads" >&5 +printf "%s\n" "$ol_cv_pthread_lib_lpthreads" >&6; } if test $ol_cv_pthread_lib_lpthreads = yes ; then ol_link_pthreads="-lpthreads" @@ -22351,8 +23094,8 @@ $as_echo "$ol_cv_pthread_lib_lpthreads" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: ol_link_threads: <$ol_link_threads> ol_link_pthreads <$ol_link_pthreads>" >&5 -$as_echo "$as_me: ol_link_threads: <$ol_link_threads> ol_link_pthreads <$ol_link_pthreads>" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ol_link_threads: <$ol_link_threads> ol_link_pthreads <$ol_link_pthreads>" >&5 +printf "%s\n" "$as_me: ol_link_threads: <$ol_link_threads> ol_link_pthreads <$ol_link_pthreads>" >&6;} if test $ol_link_threads != no ; then LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads" @@ -22361,27 +23104,35 @@ $as_echo "$as_me: ol_link_threads: <$ol_link_threads> ol_link_pthreads <$ol_link save_LIBS="$LIBS" LIBS="$LTHREAD_LIBS $LIBS" - for ac_func in sched_yield pthread_yield thr_yield -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "sched_yield" "ac_cv_func_sched_yield" +if test "x$ac_cv_func_sched_yield" = xyes +then : + printf "%s\n" "#define HAVE_SCHED_YIELD 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pthread_yield" "ac_cv_func_pthread_yield" +if test "x$ac_cv_func_pthread_yield" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_YIELD 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "thr_yield" "ac_cv_func_thr_yield" +if test "x$ac_cv_func_thr_yield" = xyes +then : + printf "%s\n" "#define HAVE_THR_YIELD 1" >>confdefs.h fi -done if test $ac_cv_func_sched_yield = no && test $ac_cv_func_pthread_yield = no && test $ac_cv_func_thr_yield = no ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5 -$as_echo_n "checking for sched_yield in -lrt... " >&6; } -if ${ac_cv_lib_rt_sched_yield+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5 +printf %s "checking for sched_yield in -lrt... " >&6; } +if test ${ac_cv_lib_rt_sched_yield+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22390,36 +23141,35 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char sched_yield (); int -main () +main (void) { return sched_yield (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_rt_sched_yield=yes -else +else $as_nop ac_cv_lib_rt_sched_yield=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5 -$as_echo "$ac_cv_lib_rt_sched_yield" >&6; } -if test "x$ac_cv_lib_rt_sched_yield" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5 +printf "%s\n" "$ac_cv_lib_rt_sched_yield" >&6; } +if test "x$ac_cv_lib_rt_sched_yield" = xyes +then : LTHREAD_LIBS="$LTHREAD_LIBS -lrt" -$as_echo "#define HAVE_SCHED_YIELD 1" >>confdefs.h +printf "%s\n" "#define HAVE_SCHED_YIELD 1" >>confdefs.h ac_cv_func_sched_yield=yes -else +else $as_nop ac_cv_func_sched_yield=no fi @@ -22427,27 +23177,24 @@ fi if test $ac_cv_func_sched_yield = no && test $ac_cv_func_pthread_yield = no && test "$ac_cv_func_thr_yield" = no ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not locate sched_yield() or pthread_yield()" >&5 -$as_echo "$as_me: WARNING: could not locate sched_yield() or pthread_yield()" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: could not locate sched_yield() or pthread_yield()" >&5 +printf "%s\n" "$as_me: WARNING: could not locate sched_yield() or pthread_yield()" >&2;} fi - for ac_func in pthread_kill -do : - ac_fn_c_check_func "$LINENO" "pthread_kill" "ac_cv_func_pthread_kill" -if test "x$ac_cv_func_pthread_kill" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREAD_KILL 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "pthread_kill" "ac_cv_func_pthread_kill" +if test "x$ac_cv_func_pthread_kill" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_KILL 1" >>confdefs.h fi -done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_destroy with " >&5 -$as_echo_n "checking for pthread_rwlock_destroy with ... " >&6; } -if ${ol_cv_func_pthread_rwlock_destroy+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_destroy with " >&5 +printf %s "checking for pthread_rwlock_destroy with ... " >&6; } +if test ${ol_cv_func_pthread_rwlock_destroy+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -22456,35 +23203,37 @@ else pthread_rwlock_t rwlock; int -main () +main (void) { pthread_rwlock_destroy(&rwlock); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_func_pthread_rwlock_destroy=yes -else +else $as_nop ol_cv_func_pthread_rwlock_destroy=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_func_pthread_rwlock_destroy" >&5 -$as_echo "$ol_cv_func_pthread_rwlock_destroy" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_func_pthread_rwlock_destroy" >&5 +printf "%s\n" "$ol_cv_func_pthread_rwlock_destroy" >&6; } if test $ol_cv_func_pthread_rwlock_destroy = yes ; then -$as_echo "#define HAVE_PTHREAD_RWLOCK_DESTROY 1" >>confdefs.h +printf "%s\n" "#define HAVE_PTHREAD_RWLOCK_DESTROY 1" >>confdefs.h fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_detach with " >&5 -$as_echo_n "checking for pthread_detach with ... " >&6; } -if ${ol_cv_func_pthread_detach+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_detach with " >&5 +printf %s "checking for pthread_detach with ... " >&6; } +if test ${ol_cv_func_pthread_detach+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -22495,81 +23244,88 @@ else #endif int -main () +main (void) { pthread_detach(NULL); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_func_pthread_detach=yes -else +else $as_nop ol_cv_func_pthread_detach=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_func_pthread_detach" >&5 -$as_echo "$ol_cv_func_pthread_detach" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_func_pthread_detach" >&5 +printf "%s\n" "$ol_cv_func_pthread_detach" >&6; } if test $ol_cv_func_pthread_detach = no ; then as_fn_error $? "could not locate pthread_detach()" "$LINENO" 5 fi -$as_echo "#define HAVE_PTHREAD_DETACH 1" >>confdefs.h +printf "%s\n" "#define HAVE_PTHREAD_DETACH 1" >>confdefs.h - for ac_func in \ - pthread_setconcurrency \ - pthread_getconcurrency \ - thr_setconcurrency \ - thr_getconcurrency \ - -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "pthread_setconcurrency" "ac_cv_func_pthread_setconcurrency" +if test "x$ac_cv_func_pthread_setconcurrency" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_SETCONCURRENCY 1" >>confdefs.h fi -done - - - - for ac_func in pthread_kill_other_threads_np -do : - ac_fn_c_check_func "$LINENO" "pthread_kill_other_threads_np" "ac_cv_func_pthread_kill_other_threads_np" -if test "x$ac_cv_func_pthread_kill_other_threads_np" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREAD_KILL_OTHER_THREADS_NP 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "pthread_getconcurrency" "ac_cv_func_pthread_getconcurrency" +if test "x$ac_cv_func_pthread_getconcurrency" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_GETCONCURRENCY 1" >>confdefs.h fi -done +ac_fn_c_check_func "$LINENO" "thr_setconcurrency" "ac_cv_func_thr_setconcurrency" +if test "x$ac_cv_func_thr_setconcurrency" = xyes +then : + printf "%s\n" "#define HAVE_THR_SETCONCURRENCY 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads implementation" >&5 -$as_echo_n "checking for LinuxThreads implementation... " >&6; } -if ${ol_cv_sys_linux_threads+:} false; then : - $as_echo_n "(cached) " >&6 -else +fi +ac_fn_c_check_func "$LINENO" "thr_getconcurrency" "ac_cv_func_thr_getconcurrency" +if test "x$ac_cv_func_thr_getconcurrency" = xyes +then : + printf "%s\n" "#define HAVE_THR_GETCONCURRENCY 1" >>confdefs.h + +fi + + + + ac_fn_c_check_func "$LINENO" "pthread_kill_other_threads_np" "ac_cv_func_pthread_kill_other_threads_np" +if test "x$ac_cv_func_pthread_kill_other_threads_np" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_KILL_OTHER_THREADS_NP 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads implementation" >&5 +printf %s "checking for LinuxThreads implementation... " >&6; } +if test ${ol_cv_sys_linux_threads+y} +then : + printf %s "(cached) " >&6 +else $as_nop ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_sys_linux_threads" >&5 -$as_echo "$ol_cv_sys_linux_threads" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_sys_linux_threads" >&5 +printf "%s\n" "$ol_cv_sys_linux_threads" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads consistency" >&5 -$as_echo_n "checking for LinuxThreads consistency... " >&6; } -if ${ol_cv_linux_threads+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads consistency" >&5 +printf %s "checking for LinuxThreads consistency... " >&6; } +if test ${ol_cv_linux_threads+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test $ol_cv_header_linux_threads = yes && test $ol_cv_sys_linux_threads = yes; then @@ -22582,23 +23338,25 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_linux_threads" >&5 -$as_echo "$ol_cv_linux_threads" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_linux_threads" >&5 +printf "%s\n" "$ol_cv_linux_threads" >&6; } if test $ol_cv_linux_threads = error; then as_fn_error $? "LinuxThreads header/library mismatch" "$LINENO" 5; fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pthread_create() works" >&5 -$as_echo_n "checking if pthread_create() works... " >&6; } -if ${ol_cv_pthread_create_works+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if pthread_create() works" >&5 +printf %s "checking if pthread_create() works... " >&6; } +if test ${ol_cv_pthread_create_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : ol_cv_pthread_create_works=yes -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -22673,9 +23431,10 @@ int main(argc, argv) } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ol_cv_pthread_create_works=yes -else +else $as_nop ol_cv_pthread_create_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -22683,8 +23442,8 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_create_works" >&5 -$as_echo "$ol_cv_pthread_create_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_create_works" >&5 +printf "%s\n" "$ol_cv_pthread_create_works" >&6; } if test $ol_cv_pthread_create_works = no ; then as_fn_error $? "pthread_create is not usable, check environment settings" "$LINENO" 5 @@ -22694,20 +23453,22 @@ $as_echo "$ol_cv_pthread_create_works" >&6; } if test $ol_replace_broken_yield = yes ; then -$as_echo "#define REPLACE_BROKEN_YIELD 1" >>confdefs.h +printf "%s\n" "#define REPLACE_BROKEN_YIELD 1" >>confdefs.h fi if test x$ol_with_yielding_select = xauto ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if select yields when using pthreads" >&5 -$as_echo_n "checking if select yields when using pthreads... " >&6; } -if ${ol_cv_pthread_select_yields+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if select yields when using pthreads" >&5 +printf %s "checking if select yields when using pthreads... " >&6; } +if test ${ol_cv_pthread_select_yields+y} +then : + printf %s "(cached) " >&6 +else $as_nop - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : ol_cv_pthread_select_yields=cross -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -22785,9 +23546,10 @@ int main(argc, argv) exit(2); } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ol_cv_pthread_select_yields=no -else +else $as_nop ol_cv_pthread_select_yields=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -22795,8 +23557,8 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_select_yields" >&5 -$as_echo "$ol_cv_pthread_select_yields" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_select_yields" >&5 +printf "%s\n" "$ol_cv_pthread_select_yields" >&6; } if test $ol_cv_pthread_select_yields = cross ; then as_fn_error $? "crossing compiling: use --with-yielding-select=yes|no|manual" "$LINENO" 5 @@ -22822,34 +23584,36 @@ esac case $ol_with_threads in auto | yes | mach) - for ac_header in mach/cthreads.h cthreads.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "mach/cthreads.h" "ac_cv_header_mach_cthreads_h" "$ac_includes_default" +if test "x$ac_cv_header_mach_cthreads_h" = xyes +then : + printf "%s\n" "#define HAVE_MACH_CTHREADS_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "cthreads.h" "ac_cv_header_cthreads_h" "$ac_includes_default" +if test "x$ac_cv_header_cthreads_h" = xyes +then : + printf "%s\n" "#define HAVE_CTHREADS_H 1" >>confdefs.h -done +fi if test $ac_cv_header_mach_cthreads_h = yes ; then ol_with_threads=found ac_fn_c_check_func "$LINENO" "cthread_fork" "ac_cv_func_cthread_fork" -if test "x$ac_cv_func_cthread_fork" = xyes; then : +if test "x$ac_cv_func_cthread_fork" = xyes +then : ol_link_threads=yes fi if test $ol_link_threads = no ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cthread_fork with -all_load" >&5 -$as_echo_n "checking for cthread_fork with -all_load... " >&6; } -if ${ol_cv_cthread_all_load+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cthread_fork with -all_load" >&5 +printf %s "checking for cthread_fork with -all_load... " >&6; } +if test ${ol_cv_cthread_all_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop save_LIBS="$LIBS" LIBS="-all_load $LIBS" @@ -22857,7 +23621,7 @@ else /* end confdefs.h. */ #include int -main () +main (void) { cthread_fork((void *)0, (void *)0); @@ -22866,18 +23630,19 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_cthread_all_load=yes -else +else $as_nop ol_cv_cthread_all_load=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$save_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_cthread_all_load" >&5 -$as_echo "$ol_cv_cthread_all_load" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_cthread_all_load" >&5 +printf "%s\n" "$ol_cv_cthread_all_load" >&6; } if test $ol_cv_cthread_all_load = yes ; then LTHREAD_LIBS="$LTHREAD_LIBS -all_load" @@ -22893,7 +23658,8 @@ $as_echo "$ol_cv_cthread_all_load" >&6; } save_LIBS="$LIBS" LIBS="$LIBS -lthreads" ac_fn_c_check_func "$LINENO" "cthread_fork" "ac_cv_func_cthread_fork" -if test "x$ac_cv_func_cthread_fork" = xyes; then : +if test "x$ac_cv_func_cthread_fork" = xyes +then : ol_link_threads=yes fi @@ -22913,7 +23679,7 @@ fi if test $ol_link_threads = mach ; then -$as_echo "#define HAVE_MACH_CTHREADS 1" >>confdefs.h +printf "%s\n" "#define HAVE_MACH_CTHREADS 1" >>confdefs.h elif test $ol_with_threads = found ; then as_fn_error $? "could not link with Mach CThreads" "$LINENO" 5 @@ -22923,25 +23689,21 @@ esac case $ol_with_threads in auto | yes | pth) - for ac_header in pth.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "pth.h" "ac_cv_header_pth_h" "$ac_includes_default" -if test "x$ac_cv_header_pth_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PTH_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "pth.h" "ac_cv_header_pth_h" "$ac_includes_default" +if test "x$ac_cv_header_pth_h" = xyes +then : + printf "%s\n" "#define HAVE_PTH_H 1" >>confdefs.h fi -done - if test $ac_cv_header_pth_h = yes ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pth_version in -lpth" >&5 -$as_echo_n "checking for pth_version in -lpth... " >&6; } -if ${ac_cv_lib_pth_pth_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pth_version in -lpth" >&5 +printf %s "checking for pth_version in -lpth... " >&6; } +if test ${ac_cv_lib_pth_pth_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpth $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22950,39 +23712,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pth_version (); int -main () +main (void) { return pth_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pth_pth_version=yes -else +else $as_nop ac_cv_lib_pth_pth_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pth_pth_version" >&5 -$as_echo "$ac_cv_lib_pth_pth_version" >&6; } -if test "x$ac_cv_lib_pth_pth_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pth_pth_version" >&5 +printf "%s\n" "$ac_cv_lib_pth_pth_version" >&6; } +if test "x$ac_cv_lib_pth_pth_version" = xyes +then : have_pth=yes -else +else $as_nop have_pth=no fi if test $have_pth = yes ; then -$as_echo "#define HAVE_GNU_PTH 1" >>confdefs.h +printf "%s\n" "#define HAVE_GNU_PTH 1" >>confdefs.h LTHREAD_LIBS="$LTHREAD_LIBS -lpth" ol_link_threads=pth @@ -22998,26 +23759,27 @@ esac case $ol_with_threads in auto | yes | lwp) - for ac_header in thread.h synch.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "thread.h" "ac_cv_header_thread_h" "$ac_includes_default" +if test "x$ac_cv_header_thread_h" = xyes +then : + printf "%s\n" "#define HAVE_THREAD_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "synch.h" "ac_cv_header_synch_h" "$ac_includes_default" +if test "x$ac_cv_header_synch_h" = xyes +then : + printf "%s\n" "#define HAVE_SYNCH_H 1" >>confdefs.h fi -done - if test $ac_cv_header_thread_h = yes && test $ac_cv_header_synch_h = yes ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thr_create in -lthread" >&5 -$as_echo_n "checking for thr_create in -lthread... " >&6; } -if ${ac_cv_lib_thread_thr_create+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for thr_create in -lthread" >&5 +printf %s "checking for thr_create in -lthread... " >&6; } +if test ${ac_cv_lib_thread_thr_create+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23026,39 +23788,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char thr_create (); int -main () +main (void) { return thr_create (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_thread_thr_create=yes -else +else $as_nop ac_cv_lib_thread_thr_create=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_thread_thr_create" >&5 -$as_echo "$ac_cv_lib_thread_thr_create" >&6; } -if test "x$ac_cv_lib_thread_thr_create" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_thread_thr_create" >&5 +printf "%s\n" "$ac_cv_lib_thread_thr_create" >&6; } +if test "x$ac_cv_lib_thread_thr_create" = xyes +then : have_thr=yes -else +else $as_nop have_thr=no fi if test $have_thr = yes ; then -$as_echo "#define HAVE_THR 1" >>confdefs.h +printf "%s\n" "#define HAVE_THR 1" >>confdefs.h LTHREAD_LIBS="$LTHREAD_LIBS -lthread" ol_link_threads=thr @@ -23067,42 +23828,36 @@ $as_echo "#define HAVE_THR 1" >>confdefs.h ol_with_yielding_select=yes fi - for ac_func in \ - thr_setconcurrency \ - thr_getconcurrency \ - -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "thr_setconcurrency" "ac_cv_func_thr_setconcurrency" +if test "x$ac_cv_func_thr_setconcurrency" = xyes +then : + printf "%s\n" "#define HAVE_THR_SETCONCURRENCY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "thr_getconcurrency" "ac_cv_func_thr_getconcurrency" +if test "x$ac_cv_func_thr_getconcurrency" = xyes +then : + printf "%s\n" "#define HAVE_THR_GETCONCURRENCY 1" >>confdefs.h fi -done fi fi - for ac_header in lwp/lwp.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "lwp/lwp.h" "ac_cv_header_lwp_lwp_h" "$ac_includes_default" -if test "x$ac_cv_header_lwp_lwp_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LWP_LWP_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "lwp/lwp.h" "ac_cv_header_lwp_lwp_h" "$ac_includes_default" +if test "x$ac_cv_header_lwp_lwp_h" = xyes +then : + printf "%s\n" "#define HAVE_LWP_LWP_H 1" >>confdefs.h fi -done - if test $ac_cv_header_lwp_lwp_h = yes ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwp_create in -llwp" >&5 -$as_echo_n "checking for lwp_create in -llwp... " >&6; } -if ${ac_cv_lib_lwp_lwp_create+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lwp_create in -llwp" >&5 +printf %s "checking for lwp_create in -llwp... " >&6; } +if test ${ac_cv_lib_lwp_lwp_create+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-llwp $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23111,39 +23866,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char lwp_create (); int -main () +main (void) { return lwp_create (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_lwp_lwp_create=yes -else +else $as_nop ac_cv_lib_lwp_lwp_create=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lwp_lwp_create" >&5 -$as_echo "$ac_cv_lib_lwp_lwp_create" >&6; } -if test "x$ac_cv_lib_lwp_lwp_create" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lwp_lwp_create" >&5 +printf "%s\n" "$ac_cv_lib_lwp_lwp_create" >&6; } +if test "x$ac_cv_lib_lwp_lwp_create" = xyes +then : have_lwp=yes -else +else $as_nop have_lwp=no fi if test $have_lwp = yes ; then -$as_echo "#define HAVE_LWP 1" >>confdefs.h +printf "%s\n" "#define HAVE_LWP 1" >>confdefs.h LTHREAD_LIBS="$LTHREAD_LIBS -llwp" ol_link_threads=lwp @@ -23158,189 +23912,186 @@ esac if test $ol_with_yielding_select = yes ; then -$as_echo "#define HAVE_YIELDING_SELECT 1" >>confdefs.h +printf "%s\n" "#define HAVE_YIELDING_SELECT 1" >>confdefs.h fi if test $ol_with_threads = manual ; then ol_link_threads=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: thread defines and link options must be set manually" >&5 -$as_echo "$as_me: WARNING: thread defines and link options must be set manually" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: thread defines and link options must be set manually" >&5 +printf "%s\n" "$as_me: WARNING: thread defines and link options must be set manually" >&2;} - for ac_header in pthread.h sched.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default" +if test "x$ac_cv_header_sched_h" = xyes +then : + printf "%s\n" "#define HAVE_SCHED_H 1" >>confdefs.h fi -done - - for ac_func in sched_yield pthread_yield -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "sched_yield" "ac_cv_func_sched_yield" +if test "x$ac_cv_func_sched_yield" = xyes +then : + printf "%s\n" "#define HAVE_SCHED_YIELD 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pthread_yield" "ac_cv_func_pthread_yield" +if test "x$ac_cv_func_pthread_yield" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_YIELD 1" >>confdefs.h fi -done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads pthread.h" >&5 -$as_echo_n "checking for LinuxThreads pthread.h... " >&6; } -if ${ol_cv_header_linux_threads+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads pthread.h" >&5 +printf %s "checking for LinuxThreads pthread.h... " >&6; } +if test ${ol_cv_header_linux_threads+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "pthread_kill_other_threads_np" >/dev/null 2>&1; then : + $EGREP "pthread_kill_other_threads_np" >/dev/null 2>&1 +then : ol_cv_header_linux_threads=yes -else +else $as_nop ol_cv_header_linux_threads=no fi -rm -f conftest* +rm -rf conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_linux_threads" >&5 -$as_echo "$ol_cv_header_linux_threads" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_linux_threads" >&5 +printf "%s\n" "$ol_cv_header_linux_threads" >&6; } if test $ol_cv_header_linux_threads = yes; then -$as_echo "#define HAVE_LINUX_THREADS 1" >>confdefs.h +printf "%s\n" "#define HAVE_LINUX_THREADS 1" >>confdefs.h fi - for ac_header in mach/cthreads.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "mach/cthreads.h" "ac_cv_header_mach_cthreads_h" "$ac_includes_default" -if test "x$ac_cv_header_mach_cthreads_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MACH_CTHREADS_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "mach/cthreads.h" "ac_cv_header_mach_cthreads_h" "$ac_includes_default" +if test "x$ac_cv_header_mach_cthreads_h" = xyes +then : + printf "%s\n" "#define HAVE_MACH_CTHREADS_H 1" >>confdefs.h fi -done - - for ac_header in lwp/lwp.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "lwp/lwp.h" "ac_cv_header_lwp_lwp_h" "$ac_includes_default" -if test "x$ac_cv_header_lwp_lwp_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LWP_LWP_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "lwp/lwp.h" "ac_cv_header_lwp_lwp_h" "$ac_includes_default" +if test "x$ac_cv_header_lwp_lwp_h" = xyes +then : + printf "%s\n" "#define HAVE_LWP_LWP_H 1" >>confdefs.h fi -done - - for ac_header in thread.h synch.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "thread.h" "ac_cv_header_thread_h" "$ac_includes_default" +if test "x$ac_cv_header_thread_h" = xyes +then : + printf "%s\n" "#define HAVE_THREAD_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "synch.h" "ac_cv_header_synch_h" "$ac_includes_default" +if test "x$ac_cv_header_synch_h" = xyes +then : + printf "%s\n" "#define HAVE_SYNCH_H 1" >>confdefs.h -done +fi fi if test $ol_link_threads != no && test $ol_link_threads != nt ; then -$as_echo "#define REENTRANT 1" >>confdefs.h +printf "%s\n" "#define REENTRANT 1" >>confdefs.h -$as_echo "#define _REENTRANT 1" >>confdefs.h +printf "%s\n" "#define _REENTRANT 1" >>confdefs.h -$as_echo "#define THREAD_SAFE 1" >>confdefs.h +printf "%s\n" "#define THREAD_SAFE 1" >>confdefs.h -$as_echo "#define _THREAD_SAFE 1" >>confdefs.h +printf "%s\n" "#define _THREAD_SAFE 1" >>confdefs.h -$as_echo "#define THREADSAFE 1" >>confdefs.h +printf "%s\n" "#define THREADSAFE 1" >>confdefs.h -$as_echo "#define _THREADSAFE 1" >>confdefs.h +printf "%s\n" "#define _THREADSAFE 1" >>confdefs.h -$as_echo "#define _SGI_MP_SOURCE 1" >>confdefs.h +printf "%s\n" "#define _SGI_MP_SOURCE 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread specific errno" >&5 -$as_echo_n "checking for thread specific errno... " >&6; } -if ${ol_cv_errno_thread_specific+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for thread specific errno" >&5 +printf %s "checking for thread specific errno... " >&6; } +if test ${ol_cv_errno_thread_specific+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { errno = 0; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_errno_thread_specific=yes -else +else $as_nop ol_cv_errno_thread_specific=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_errno_thread_specific" >&5 -$as_echo "$ol_cv_errno_thread_specific" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_errno_thread_specific" >&5 +printf "%s\n" "$ol_cv_errno_thread_specific" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread specific h_errno" >&5 -$as_echo_n "checking for thread specific h_errno... " >&6; } -if ${ol_cv_h_errno_thread_specific+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for thread specific h_errno" >&5 +printf %s "checking for thread specific h_errno... " >&6; } +if test ${ol_cv_h_errno_thread_specific+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { h_errno = 0; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ol_cv_h_errno_thread_specific=yes -else +else $as_nop ol_cv_h_errno_thread_specific=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_h_errno_thread_specific" >&5 -$as_echo "$ol_cv_h_errno_thread_specific" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ol_cv_h_errno_thread_specific" >&5 +printf "%s\n" "$ol_cv_h_errno_thread_specific" >&6; } if test $ol_cv_errno_thread_specific != yes || test $ol_cv_h_errno_thread_specific != yes ; then @@ -23356,13 +24107,13 @@ if test $ol_link_threads = no ; then fi if test $ol_with_threads = auto ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no suitable thread support, disabling threads" >&5 -$as_echo "$as_me: WARNING: no suitable thread support, disabling threads" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: no suitable thread support, disabling threads" >&5 +printf "%s\n" "$as_me: WARNING: no suitable thread support, disabling threads" >&2;} ol_with_threads=no fi -$as_echo "#define NO_THREADS 1" >>confdefs.h +printf "%s\n" "#define NO_THREADS 1" >>confdefs.h LTHREAD_LIBS="" BUILD_THREAD=no @@ -23372,7 +24123,7 @@ fi if test $ol_link_threads != no ; then -$as_echo "#define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1" >>confdefs.h +printf "%s\n" "#define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1" >>confdefs.h fi @@ -23404,16 +24155,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu LIBS="$LTHREAD_LIBS $LIBS" saved_CFLAGS="$CFLAGS" CFLAGS="$PTHREAD_CFLAGS $CFLAGS" - for ac_func in sem_timedwait -do : - ac_fn_c_check_func "$LINENO" "sem_timedwait" "ac_cv_func_sem_timedwait" -if test "x$ac_cv_func_sem_timedwait" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SEM_TIMEDWAIT 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "sem_timedwait" "ac_cv_func_sem_timedwait" +if test "x$ac_cv_func_sem_timedwait" = xyes +then : + printf "%s\n" "#define HAVE_SEM_TIMEDWAIT 1" >>confdefs.h fi -done LIBS="$saved_LIBS" { saved_LIBS=; unset saved_LIBS;} @@ -23438,22 +24185,24 @@ case "$have_pthreads" in # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_t" >&5 -$as_echo_n "checking size of pthread_t... " >&6; } -if ${ac_cv_sizeof_pthread_t+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of pthread_t" >&5 +printf %s "checking size of pthread_t... " >&6; } +if test ${ac_cv_sizeof_pthread_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))" "ac_cv_sizeof_pthread_t" " $ac_includes_default #include -"; then : +" +then : -else +else $as_nop if test "$ac_cv_type_pthread_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (pthread_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -23462,32 +24211,32 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_t" >&5 -$as_echo "$ac_cv_sizeof_pthread_t" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_t" >&5 +printf "%s\n" "$ac_cv_sizeof_pthread_t" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t -_ACEOF +printf "%s\n" "#define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t" >>confdefs.h LIBISC_PTHREADS_NOTHREADS=pthreads -$as_echo "#define ISC_PLATFORM_USETHREADS 1" >>confdefs.h +printf "%s\n" "#define ISC_PLATFORM_USETHREADS 1" >>confdefs.h # # We'd like to use sigwait() too # ac_fn_c_check_func "$LINENO" "sigwait" "ac_cv_func_sigwait" -if test "x$ac_cv_func_sigwait" = xyes; then : +if test "x$ac_cv_func_sigwait" = xyes +then : have_sigwait=yes -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigwait in -lc" >&5 -$as_echo_n "checking for sigwait in -lc... " >&6; } -if ${ac_cv_lib_c_sigwait+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sigwait in -lc" >&5 +printf %s "checking for sigwait in -lc... " >&6; } +if test ${ac_cv_lib_c_sigwait+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23496,37 +24245,37 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char sigwait (); int -main () +main (void) { return sigwait (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_c_sigwait=yes -else +else $as_nop ac_cv_lib_c_sigwait=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_sigwait" >&5 -$as_echo "$ac_cv_lib_c_sigwait" >&6; } -if test "x$ac_cv_lib_c_sigwait" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_sigwait" >&5 +printf "%s\n" "$ac_cv_lib_c_sigwait" >&6; } +if test "x$ac_cv_lib_c_sigwait" = xyes +then : have_sigwait=yes -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigwait in -lpthread" >&5 -$as_echo_n "checking for sigwait in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_sigwait+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sigwait in -lpthread" >&5 +printf %s "checking for sigwait in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_sigwait+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23535,37 +24284,37 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char sigwait (); int -main () +main (void) { return sigwait (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_sigwait=yes -else +else $as_nop ac_cv_lib_pthread_sigwait=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_sigwait" >&5 -$as_echo "$ac_cv_lib_pthread_sigwait" >&6; } -if test "x$ac_cv_lib_pthread_sigwait" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_sigwait" >&5 +printf "%s\n" "$ac_cv_lib_pthread_sigwait" >&6; } +if test "x$ac_cv_lib_pthread_sigwait" = xyes +then : have_sigwait=yes -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _Psigwait in -lpthread" >&5 -$as_echo_n "checking for _Psigwait in -lpthread... " >&6; } -if ${ac_cv_lib_pthread__Psigwait+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _Psigwait in -lpthread" >&5 +printf %s "checking for _Psigwait in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread__Psigwait+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23574,32 +24323,31 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char _Psigwait (); int -main () +main (void) { return _Psigwait (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread__Psigwait=yes -else +else $as_nop ac_cv_lib_pthread__Psigwait=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread__Psigwait" >&5 -$as_echo "$ac_cv_lib_pthread__Psigwait" >&6; } -if test "x$ac_cv_lib_pthread__Psigwait" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread__Psigwait" >&5 +printf "%s\n" "$ac_cv_lib_pthread__Psigwait" >&6; } +if test "x$ac_cv_lib_pthread__Psigwait" = xyes +then : have_sigwait=yes -else +else $as_nop have_sigwait=no fi @@ -23615,11 +24363,12 @@ fi case "$host:$have_sigwait" in *-freebsd*:no) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigwait in -lc_r" >&5 -$as_echo_n "checking for sigwait in -lc_r... " >&6; } -if ${ac_cv_lib_c_r_sigwait+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sigwait in -lc_r" >&5 +printf %s "checking for sigwait in -lc_r... " >&6; } +if test ${ac_cv_lib_c_r_sigwait+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23628,30 +24377,29 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char sigwait (); int -main () +main (void) { return sigwait (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_c_r_sigwait=yes -else +else $as_nop ac_cv_lib_c_r_sigwait=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_sigwait" >&5 -$as_echo "$ac_cv_lib_c_r_sigwait" >&6; } -if test "x$ac_cv_lib_c_r_sigwait" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_sigwait" >&5 +printf "%s\n" "$ac_cv_lib_c_r_sigwait" >&6; } +if test "x$ac_cv_lib_c_r_sigwait" = xyes +then : have_sigwait=yes fi @@ -23661,32 +24409,29 @@ fi yes) ac_cv_func_sigwait=yes -$as_echo "#define HAVE_SIGWAIT 1" >>confdefs.h +printf "%s\n" "#define HAVE_SIGWAIT 1" >>confdefs.h esac - for ac_func in pthread_attr_getstacksize -do : - ac_fn_c_check_func "$LINENO" "pthread_attr_getstacksize" "ac_cv_func_pthread_attr_getstacksize" -if test "x$ac_cv_func_pthread_attr_getstacksize" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREAD_ATTR_GETSTACKSIZE 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "pthread_attr_getstacksize" "ac_cv_func_pthread_attr_getstacksize" +if test "x$ac_cv_func_pthread_attr_getstacksize" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_ATTR_GETSTACKSIZE 1" >>confdefs.h fi -done - for ac_func in pthread_attr_setstacksize sysconf -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "pthread_attr_setstacksize" "ac_cv_func_pthread_attr_setstacksize" +if test "x$ac_cv_func_pthread_attr_setstacksize" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sysconf" "ac_cv_func_sysconf" +if test "x$ac_cv_func_sysconf" = xyes +then : + printf "%s\n" "#define HAVE_SYSCONF 1" >>confdefs.h fi -done case "$host" in @@ -23694,43 +24439,39 @@ done ;; *-freebsd5.[3456789]|*-freebsd5.[3456789].*|*-freebsd6.*) -$as_echo "#define NEED_PTHREAD_SCOPE_SYSTEM 1" >>confdefs.h +printf "%s\n" "#define NEED_PTHREAD_SCOPE_SYSTEM 1" >>confdefs.h ;; *-bsdi3.*|*-bsdi4.0*) -$as_echo "#define NEED_PTHREAD_INIT 1" >>confdefs.h +printf "%s\n" "#define NEED_PTHREAD_INIT 1" >>confdefs.h ;; *-linux*) -$as_echo "#define HAVE_LINUXTHREADS 1" >>confdefs.h +printf "%s\n" "#define HAVE_LINUXTHREADS 1" >>confdefs.h ;; *-solaris*) - $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h - for ac_func in pthread_setconcurrency -do : - ac_fn_c_check_func "$LINENO" "pthread_setconcurrency" "ac_cv_func_pthread_setconcurrency" -if test "x$ac_cv_func_pthread_setconcurrency" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREAD_SETCONCURRENCY 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "pthread_setconcurrency" "ac_cv_func_pthread_setconcurrency" +if test "x$ac_cv_func_pthread_setconcurrency" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_SETCONCURRENCY 1" >>confdefs.h fi -done case "$ac_cv_func_pthread_setconcurrency" in yes) -$as_echo "#define CALL_PTHREAD_SETCONCURRENCY 1" >>confdefs.h +printf "%s\n" "#define CALL_PTHREAD_SETCONCURRENCY 1" >>confdefs.h esac ;; *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*) -$as_echo "#define HAVE_UNIXWARE_SIGWAIT 1" >>confdefs.h +printf "%s\n" "#define HAVE_UNIXWARE_SIGWAIT 1" >>confdefs.h ;; esac @@ -23743,18 +24484,19 @@ $as_echo "#define HAVE_UNIXWARE_SIGWAIT 1" >>confdefs.h hack_shutup_pthreadonceinit=yes ;; *-solaris2.1[0-9]) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if extra braces are needed for PTHREAD_ONCE_INIT" >&5 -$as_echo_n "checking if extra braces are needed for PTHREAD_ONCE_INIT... " >&6; } -if ${ntp_cv_braces_around_pthread_once_init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if extra braces are needed for PTHREAD_ONCE_INIT" >&5 +printf %s "checking if extra braces are needed for PTHREAD_ONCE_INIT... " >&6; } +if test ${ntp_cv_braces_around_pthread_once_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { static pthread_once_t once_test = @@ -23765,17 +24507,18 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_braces_around_pthread_once_init=no -else +else $as_nop ntp_cv_braces_around_pthread_once_init=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_braces_around_pthread_once_init" >&5 -$as_echo "$ntp_cv_braces_around_pthread_once_init" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_braces_around_pthread_once_init" >&5 +printf "%s\n" "$ntp_cv_braces_around_pthread_once_init" >&6; } case "$ntp_cv_braces_around_pthread_once_init" in yes) hack_shutup_pthreadonceinit=yes @@ -23785,7 +24528,7 @@ $as_echo "$ntp_cv_braces_around_pthread_once_init" >&6; } case "$hack_shutup_pthreadonceinit" in yes) -$as_echo "#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1" >>confdefs.h +printf "%s\n" "#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1" >>confdefs.h esac LIBS="$saved_LIBS" @@ -23814,15 +24557,17 @@ fi case "$hw_use_rpl_vsnprintf:$hw_cv_func_vsnprintf" in no:yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if vsnprintf expands \"%m\" to strerror(errno)" >&5 -$as_echo_n "checking if vsnprintf expands \"%m\" to strerror(errno)... " >&6; } -if ${ntp_cv_vsnprintf_percent_m+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if vsnprintf expands \"%m\" to strerror(errno)" >&5 +printf %s "checking if vsnprintf expands \"%m\" to strerror(errno)... " >&6; } +if test ${ntp_cv_vsnprintf_percent_m+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ntp_cv_vsnprintf_percent_m=no -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -23856,7 +24601,7 @@ else } int -main () +main (void) { char sbuf[512]; @@ -23874,9 +24619,10 @@ main () return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ntp_cv_vsnprintf_percent_m=yes -else +else $as_nop ntp_cv_vsnprintf_percent_m=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -23885,60 +24631,56 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_vsnprintf_percent_m" >&5 -$as_echo "$ntp_cv_vsnprintf_percent_m" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_vsnprintf_percent_m" >&5 +printf "%s\n" "$ntp_cv_vsnprintf_percent_m" >&6; } case "$ntp_cv_vsnprintf_percent_m" in yes) -$as_echo "#define VSNPRINTF_PERCENT_M 1" >>confdefs.h +printf "%s\n" "#define VSNPRINTF_PERCENT_M 1" >>confdefs.h esac esac -for ac_header in sys/clockctl.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/clockctl.h" "ac_cv_header_sys_clockctl_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_clockctl_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_CLOCKCTL_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "sys/clockctl.h" "ac_cv_header_sys_clockctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_clockctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_CLOCKCTL_H 1" >>confdefs.h fi -done - # Check whether --enable-clockctl was given. -if test "${enable_clockctl+set}" = set; then : +if test ${enable_clockctl+y} +then : enableval=$enable_clockctl; ntp_use_dev_clockctl=$enableval -else +else $as_nop ntp_use_dev_clockctl=$ac_cv_header_sys_clockctl_h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should use /dev/clockctl" >&5 -$as_echo_n "checking if we should use /dev/clockctl... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_use_dev_clockctl" >&5 -$as_echo "$ntp_use_dev_clockctl" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we should use /dev/clockctl" >&5 +printf %s "checking if we should use /dev/clockctl... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_use_dev_clockctl" >&5 +printf "%s\n" "$ntp_use_dev_clockctl" >&6; } -for ac_header in sys/capability.h sys/prctl.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "sys/capability.h" "ac_cv_header_sys_capability_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_capability_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_CAPABILITY_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/prctl.h" "ac_cv_header_sys_prctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_prctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PRCTL_H 1" >>confdefs.h fi -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have linux capabilities (libcap)" >&5 -$as_echo_n "checking if we have linux capabilities (libcap)... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we have linux capabilities (libcap)" >&5 +printf %s "checking if we have linux capabilities (libcap)... " >&6; } case "$ac_cv_header_sys_capability_h$ac_cv_header_sys_prctl_h" in yesyes) @@ -23956,45 +24698,42 @@ case "$ac_cv_header_sys_capability_h$ac_cv_header_sys_prctl_h" in esac # Check whether --enable-linuxcaps was given. -if test "${enable_linuxcaps+set}" = set; then : +if test ${enable_linuxcaps+y} +then : enableval=$enable_linuxcaps; ntp_have_linuxcaps=$enableval fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_have_linuxcaps" >&5 -$as_echo "$ntp_have_linuxcaps" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_have_linuxcaps" >&5 +printf "%s\n" "$ntp_have_linuxcaps" >&6; } case "$ntp_have_linuxcaps" in yes) -$as_echo "#define HAVE_LINUX_CAPABILITIES 1" >>confdefs.h +printf "%s\n" "#define HAVE_LINUX_CAPABILITIES 1" >>confdefs.h LIBS="$LIBS -lcap" ;; esac -for ac_header in priv.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "priv.h" "ac_cv_header_priv_h" "$ac_includes_default" -if test "x$ac_cv_header_priv_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PRIV_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "priv.h" "ac_cv_header_priv_h" "$ac_includes_default" +if test "x$ac_cv_header_priv_h" = xyes +then : + printf "%s\n" "#define HAVE_PRIV_H 1" >>confdefs.h fi -done - case "$ac_cv_header_priv_h" in yes) case "$host" in *-solaris*) ac_fn_c_check_func "$LINENO" "setppriv" "ac_cv_func_setppriv" -if test "x$ac_cv_func_setppriv" = xyes; then : +if test "x$ac_cv_func_setppriv" = xyes +then : ntp_have_solarisprivs=yes -else +else $as_nop ntp_have_solarisprivs=no fi @@ -24004,78 +24743,76 @@ fi esac # Check whether --enable-solarisprivs was given. -if test "${enable_solarisprivs+set}" = set; then : +if test ${enable_solarisprivs+y} +then : enableval=$enable_solarisprivs; ntp_have_solarisprivs=$enableval fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have solaris privileges" >&5 -$as_echo_n "checking if we have solaris privileges... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we have solaris privileges" >&5 +printf %s "checking if we have solaris privileges... " >&6; } case "$ntp_have_solarisprivs" in yes) -$as_echo "#define HAVE_SOLARIS_PRIVS 1" >>confdefs.h +printf "%s\n" "#define HAVE_SOLARIS_PRIVS 1" >>confdefs.h ;; '') ntp_have_solarisprivs="no" ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_have_solarisprivs" >&5 -$as_echo "$ntp_have_solarisprivs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_have_solarisprivs" >&5 +printf "%s\n" "$ntp_have_solarisprivs" >&6; } -for ac_header in sys/mac.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/mac.h" "ac_cv_header_sys_mac_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mac_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_MAC_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "sys/mac.h" "ac_cv_header_sys_mac_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mac_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_MAC_H 1" >>confdefs.h fi -done - # Check whether --enable-trustedbsd_mac was given. -if test "${enable_trustedbsd_mac+set}" = set; then : +if test ${enable_trustedbsd_mac+y} +then : enableval=$enable_trustedbsd_mac; ntp_use_trustedbsd_mac=$enableval fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should use TrustedBSD MAC privileges" >&5 -$as_echo_n "checking if we should use TrustedBSD MAC privileges... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we should use TrustedBSD MAC privileges" >&5 +printf %s "checking if we should use TrustedBSD MAC privileges... " >&6; } case "$ntp_use_trustedbsd_mac$ac_cv_header_sys_mac_h" in yesyes) -$as_echo "#define HAVE_TRUSTEDBSD_MAC 1" >>confdefs.h +printf "%s\n" "#define HAVE_TRUSTEDBSD_MAC 1" >>confdefs.h ;; *) ntp_use_trustedbsd_mac="no"; ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_use_trustedbsd_mac" >&5 -$as_echo "$ntp_use_trustedbsd_mac" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_use_trustedbsd_mac" >&5 +printf "%s\n" "$ntp_use_trustedbsd_mac" >&6; } case "$ntp_use_dev_clockctl$ntp_have_linuxcaps$ntp_have_solarisprivs$ntp_use_trustedbsd_mac" in *yes*) -$as_echo "#define HAVE_DROPROOT 1" >>confdefs.h +printf "%s\n" "#define HAVE_DROPROOT 1" >>confdefs.h esac case "$host" in *-*-darwin*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_9_init" >&5 -$as_echo_n "checking for library containing res_9_init... " >&6; } -if ${ac_cv_search_res_9_init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing res_9_init" >&5 +printf %s "checking for library containing res_9_init... " >&6; } +if test ${ac_cv_search_res_9_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24083,56 +24820,59 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char res_9_init (); int -main () +main (void) { return res_9_init (); ; return 0; } _ACEOF -for ac_lib in '' resolv; do +for ac_lib in '' resolv +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_res_9_init=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_res_9_init+:} false; then : + if test ${ac_cv_search_res_9_init+y} +then : break fi done -if ${ac_cv_search_res_9_init+:} false; then : +if test ${ac_cv_search_res_9_init+y} +then : -else +else $as_nop ac_cv_search_res_9_init=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_9_init" >&5 -$as_echo "$ac_cv_search_res_9_init" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_9_init" >&5 +printf "%s\n" "$ac_cv_search_res_9_init" >&6; } ac_res=$ac_cv_search_res_9_init -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_init" >&5 -$as_echo_n "checking for library containing res_init... " >&6; } -if ${ac_cv_search_res_init+:} false; then : - $as_echo_n "(cached) " >&6 -else + *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing res_init" >&5 +printf %s "checking for library containing res_init... " >&6; } +if test ${ac_cv_search_res_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24140,56 +24880,55 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char res_init (); int -main () +main (void) { return res_init (); ; return 0; } _ACEOF -for ac_lib in '' resolv; do +for ac_lib in '' resolv +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_res_init=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_res_init+:} false; then : + if test ${ac_cv_search_res_init+y} +then : break fi done -if ${ac_cv_search_res_init+:} false; then : +if test ${ac_cv_search_res_init+y} +then : -else +else $as_nop ac_cv_search_res_init=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_init" >&5 -$as_echo "$ac_cv_search_res_init" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_init" >&5 +printf "%s\n" "$ac_cv_search_res_init" >&6; } ac_res=$ac_cv_search_res_init -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi ;; esac -for ac_header in sys/types.h netinet/in.h arpa/nameser.h netdb.h resolv.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_TYPES_H +ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "#ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_NETINET_IN_H @@ -24202,85 +24941,149 @@ ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE # include #endif " -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include /* inet_ functions / structs */ +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include /* DNS HEADER struct */ +#endif +#ifdef HAVE_NETDB_H +# include +#endif +" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "arpa/nameser.h" "ac_cv_header_arpa_nameser_h" "#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include /* inet_ functions / structs */ +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include /* DNS HEADER struct */ +#endif +#ifdef HAVE_NETDB_H +# include +#endif +" +if test "x$ac_cv_header_arpa_nameser_h" = xyes +then : + printf "%s\n" "#define HAVE_ARPA_NAMESER_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include /* inet_ functions / structs */ +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include /* DNS HEADER struct */ +#endif +#ifdef HAVE_NETDB_H +# include +#endif +" +if test "x$ac_cv_header_netdb_h" = xyes +then : + printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "resolv.h" "ac_cv_header_resolv_h" "#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include /* inet_ functions / structs */ +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include /* DNS HEADER struct */ +#endif +#ifdef HAVE_NETDB_H +# include +#endif +" +if test "x$ac_cv_header_resolv_h" = xyes +then : + printf "%s\n" "#define HAVE_RESOLV_H 1" >>confdefs.h + +fi #HMS: Why do we do this check so "early"? -for ac_func in res_init + + for ac_func in res_init do : ac_fn_c_check_func "$LINENO" "res_init" "ac_cv_func_res_init" -if test "x$ac_cv_func_res_init" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_RES_INIT 1 -_ACEOF +if test "x$ac_cv_func_res_init" = xyes +then : + printf "%s\n" "#define HAVE_RES_INIT 1" >>confdefs.h -else - for ac_func in __res_init -do : +else $as_nop ac_fn_c_check_func "$LINENO" "__res_init" "ac_cv_func___res_init" -if test "x$ac_cv_func___res_init" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE___RES_INIT 1 -_ACEOF +if test "x$ac_cv_func___res_init" = xyes +then : + printf "%s\n" "#define HAVE___RES_INIT 1" >>confdefs.h fi -done fi -done +done # We also need -lsocket, but we have tested for that already. ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop" -if test "x$ac_cv_func_inet_ntop" = xyes; then : +if test "x$ac_cv_func_inet_ntop" = xyes +then : -else +else $as_nop -$as_echo "#define ISC_PLATFORM_NEEDNTOP 1" >>confdefs.h +printf "%s\n" "#define ISC_PLATFORM_NEEDNTOP 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton" -if test "x$ac_cv_func_inet_pton" = xyes; then : +if test "x$ac_cv_func_inet_pton" = xyes +then : -else +else $as_nop -$as_echo "#define ISC_PLATFORM_NEEDPTON 1" >>confdefs.h +printf "%s\n" "#define ISC_PLATFORM_NEEDPTON 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" -if test "x$ac_cv_type_uintptr_t" = xyes; then : +if test "x$ac_cv_type_uintptr_t" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_UINTPTR_T 1 -_ACEOF +printf "%s\n" "#define HAVE_UINTPTR_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "int32" "ac_cv_type_int32" "$ac_includes_default" -if test "x$ac_cv_type_int32" = xyes; then : +if test "x$ac_cv_type_int32" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_INT32 1 -_ACEOF +printf "%s\n" "#define HAVE_INT32 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "u_int32" "ac_cv_type_u_int32" "$ac_includes_default" -if test "x$ac_cv_type_u_int32" = xyes; then : +if test "x$ac_cv_type_u_int32" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_U_INT32 1 -_ACEOF +printf "%s\n" "#define HAVE_U_INT32 1" >>confdefs.h fi @@ -24290,11 +25093,12 @@ fi case "$ac_cv_type_int32::$ac_cv_header_resolv_h" in no::yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int32 with DNS headers included" >&5 -$as_echo_n "checking for int32 with DNS headers included... " >&6; } -if ${ntp_cv_type_int32_with_dns+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for int32 with DNS headers included" >&5 +printf %s "checking for int32 with DNS headers included... " >&6; } +if test ${ntp_cv_type_int32_with_dns+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24304,7 +25108,7 @@ else #include int -main () +main (void) { size_t cb = sizeof(int32); @@ -24314,32 +25118,34 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_type_int32_with_dns=yes -else +else $as_nop ntp_cv_type_int32_with_dns=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_type_int32_with_dns" >&5 -$as_echo "$ntp_cv_type_int32_with_dns" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_type_int32_with_dns" >&5 +printf "%s\n" "$ntp_cv_type_int32_with_dns" >&6; } case "$ntp_cv_type_int32_with_dns" in yes) -$as_echo "#define HAVE_INT32_ONLY_WITH_DNS 1" >>confdefs.h +printf "%s\n" "#define HAVE_INT32_ONLY_WITH_DNS 1" >>confdefs.h esac esac case "$ac_cv_type_u_int32::$ac_cv_header_resolv_h" in no::yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_int32 with DNS headers included" >&5 -$as_echo_n "checking for u_int32 with DNS headers included... " >&6; } -if ${ntp_cv_type_u_int32_with_dns+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for u_int32 with DNS headers included" >&5 +printf %s "checking for u_int32 with DNS headers included... " >&6; } +if test ${ntp_cv_type_u_int32_with_dns+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24349,7 +25155,7 @@ else #include int -main () +main (void) { size_t cb = sizeof(u_int32); @@ -24359,28 +25165,27 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_type_u_int32_with_dns=yes -else +else $as_nop ntp_cv_type_u_int32_with_dns=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_type_u_int32_with_dns" >&5 -$as_echo "$ntp_cv_type_u_int32_with_dns" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_type_u_int32_with_dns" >&5 +printf "%s\n" "$ntp_cv_type_u_int32_with_dns" >&6; } case "$ntp_cv_type_u_int32_with_dns" in yes) -$as_echo "#define HAVE_U_INT32_ONLY_WITH_DNS 1" >>confdefs.h +printf "%s\n" "#define HAVE_U_INT32_ONLY_WITH_DNS 1" >>confdefs.h esac esac -for ac_header in sys/timepps.h -do : - ac_fn_c_check_header_compile "$LINENO" "sys/timepps.h" "ac_cv_header_sys_timepps_h" " +ac_fn_c_check_header_compile "$LINENO" "sys/timepps.h" "ac_cv_header_sys_timepps_h" " #ifdef HAVE_SYS_TIME_H # include #endif @@ -24390,21 +25195,19 @@ do : " -if test "x$ac_cv_header_sys_timepps_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_TIMEPPS_H 1 -_ACEOF +if test "x$ac_cv_header_sys_timepps_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TIMEPPS_H 1" >>confdefs.h fi -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec" >&5 -$as_echo_n "checking for struct timespec... " >&6; } -if ${ntp_cv_struct_timespec+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec" >&5 +printf %s "checking for struct timespec... " >&6; } +if test ${ntp_cv_struct_timespec+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24420,7 +25223,7 @@ else #endif int -main () +main (void) { struct timespec n; @@ -24430,29 +25233,31 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_struct_timespec=yes -else +else $as_nop ntp_cv_struct_timespec=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_timespec" >&5 -$as_echo "$ntp_cv_struct_timespec" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_timespec" >&5 +printf "%s\n" "$ntp_cv_struct_timespec" >&6; } case "$ntp_cv_struct_timespec" in yes) -$as_echo "#define HAVE_STRUCT_TIMESPEC 1" >>confdefs.h +printf "%s\n" "#define HAVE_STRUCT_TIMESPEC 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct ntptimeval" >&5 -$as_echo_n "checking for struct ntptimeval... " >&6; } -if ${ntp_cv_struct_ntptimeval+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct ntptimeval" >&5 +printf %s "checking for struct ntptimeval... " >&6; } +if test ${ntp_cv_struct_ntptimeval+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24460,7 +25265,7 @@ else #include int -main () +main (void) { struct ntptimeval n; @@ -24470,48 +25275,45 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_struct_ntptimeval=yes -else +else $as_nop ntp_cv_struct_ntptimeval=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_ntptimeval" >&5 -$as_echo "$ntp_cv_struct_ntptimeval" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_ntptimeval" >&5 +printf "%s\n" "$ntp_cv_struct_ntptimeval" >&6; } case "$ntp_cv_struct_ntptimeval" in yes) -$as_echo "#define HAVE_STRUCT_NTPTIMEVAL 1" >>confdefs.h +printf "%s\n" "#define HAVE_STRUCT_NTPTIMEVAL 1" >>confdefs.h esac -for ac_header in md5.h -do : - ac_fn_c_check_header_compile "$LINENO" "md5.h" "ac_cv_header_md5_h" " +ac_fn_c_check_header_compile "$LINENO" "md5.h" "ac_cv_header_md5_h" " #ifdef HAVE_SYS_TYPES_H # include #endif " -if test "x$ac_cv_header_md5_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MD5_H 1 -_ACEOF +if test "x$ac_cv_header_md5_h" = xyes +then : + printf "%s\n" "#define HAVE_MD5_H 1" >>confdefs.h fi -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing MD5Init" >&5 -$as_echo_n "checking for library containing MD5Init... " >&6; } -if ${ac_cv_search_MD5Init+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing MD5Init" >&5 +printf %s "checking for library containing MD5Init... " >&6; } +if test ${ac_cv_search_MD5Init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24519,78 +25321,107 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char MD5Init (); int -main () +main (void) { return MD5Init (); ; return 0; } _ACEOF -for ac_lib in '' md5 md; do +for ac_lib in '' md5 md +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_MD5Init=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_MD5Init+:} false; then : + if test ${ac_cv_search_MD5Init+y} +then : break fi done -if ${ac_cv_search_MD5Init+:} false; then : +if test ${ac_cv_search_MD5Init+y} +then : -else +else $as_nop ac_cv_search_MD5Init=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_MD5Init" >&5 -$as_echo "$ac_cv_search_MD5Init" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_MD5Init" >&5 +printf "%s\n" "$ac_cv_search_MD5Init" >&6; } ac_res=$ac_cv_search_MD5Init -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -for ac_func in MD5Init sysconf getdtablesize sigaction sigset sigvec -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "MD5Init" "ac_cv_func_MD5Init" +if test "x$ac_cv_func_MD5Init" = xyes +then : + printf "%s\n" "#define HAVE_MD5INIT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sysconf" "ac_cv_func_sysconf" +if test "x$ac_cv_func_sysconf" = xyes +then : + printf "%s\n" "#define HAVE_SYSCONF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getdtablesize" "ac_cv_func_getdtablesize" +if test "x$ac_cv_func_getdtablesize" = xyes +then : + printf "%s\n" "#define HAVE_GETDTABLESIZE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sigaction" "ac_cv_func_sigaction" +if test "x$ac_cv_func_sigaction" = xyes +then : + printf "%s\n" "#define HAVE_SIGACTION 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sigset" "ac_cv_func_sigset" +if test "x$ac_cv_func_sigset" = xyes +then : + printf "%s\n" "#define HAVE_SIGSET 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sigvec" "ac_cv_func_sigvec" +if test "x$ac_cv_func_sigvec" = xyes +then : + printf "%s\n" "#define HAVE_SIGVEC 1" >>confdefs.h fi -done # HMS: does this need to be a cached variable? # Check whether --enable-signalled-io was given. -if test "${enable_signalled_io+set}" = set; then : +if test ${enable_signalled_io+y} +then : enableval=$enable_signalled_io; use_signalled_io=$enableval -else +else $as_nop use_signalled_io=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGIO" >&5 -$as_echo_n "checking for SIGIO... " >&6; } -if ${ntp_cv_hdr_def_sigio+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SIGIO" >&5 +printf %s "checking for SIGIO... " >&6; } +if test ${ntp_cv_hdr_def_sigio+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24601,20 +25432,21 @@ else #endif _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : ntp_cv_hdr_def_sigio=yes -else +else $as_nop ntp_cv_hdr_def_sigio=no fi rm -f conftest.err conftest.i conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_hdr_def_sigio" >&5 -$as_echo "$ntp_cv_hdr_def_sigio" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_hdr_def_sigio" >&5 +printf "%s\n" "$ntp_cv_hdr_def_sigio" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to use SIGIO" >&5 -$as_echo_n "checking if we want to use SIGIO... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want to use SIGIO" >&5 +printf %s "checking if we want to use SIGIO... " >&6; } ans=no case "$ntp_cv_hdr_def_sigio" in yes) @@ -24672,21 +25504,22 @@ case "$ans" in case "$use_signalled_io" in yes) -$as_echo "#define HAVE_SIGNALED_IO 1" >>confdefs.h +printf "%s\n" "#define HAVE_SIGNALED_IO 1" >>confdefs.h ;; *) ans="Allowed for $host but --disable-signalled-io was given" ;; esac esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGPOLL" >&5 -$as_echo_n "checking for SIGPOLL... " >&6; } -if ${ntp_cv_hdr_def_sigpoll+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SIGPOLL" >&5 +printf %s "checking for SIGPOLL... " >&6; } +if test ${ntp_cv_hdr_def_sigpoll+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24697,20 +25530,21 @@ else #endif _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : ntp_cv_hdr_def_sigpoll=yes -else +else $as_nop ntp_cv_hdr_def_sigpoll=no fi rm -f conftest.err conftest.i conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_hdr_def_sigpoll" >&5 -$as_echo "$ntp_cv_hdr_def_sigpoll" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_hdr_def_sigpoll" >&5 +printf "%s\n" "$ntp_cv_hdr_def_sigpoll" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can use SIGPOLL for UDP I/O" >&5 -$as_echo_n "checking if we can use SIGPOLL for UDP I/O... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can use SIGPOLL for UDP I/O" >&5 +printf %s "checking if we can use SIGPOLL for UDP I/O... " >&6; } ans=no case "$ntp_cv_hdr_def_sigpoll" in yes) @@ -24769,14 +25603,14 @@ esac case "$ans" in yes) -$as_echo "#define USE_UDP_SIGPOLL 1" >>confdefs.h +printf "%s\n" "#define USE_UDP_SIGPOLL 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can use SIGPOLL for TTY I/O" >&5 -$as_echo_n "checking if we can use SIGPOLL for TTY I/O... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can use SIGPOLL for TTY I/O" >&5 +printf %s "checking if we can use SIGPOLL for TTY I/O... " >&6; } ans=no case "$ntp_cv_hdr_def_sigpoll" in yes) @@ -24832,24 +25666,25 @@ esac case "$ans" in yes) -$as_echo "#define USE_TTY_SIGPOLL 1" >>confdefs.h +printf "%s\n" "#define USE_TTY_SIGPOLL 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking number of arguments to gettimeofday()" >&5 -$as_echo_n "checking number of arguments to gettimeofday()... " >&6; } -if ${ntp_cv_func_Xettimeofday_nargs+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking number of arguments to gettimeofday()" >&5 +printf %s "checking number of arguments to gettimeofday()... " >&6; } +if test ${ntp_cv_func_Xettimeofday_nargs+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { gettimeofday(0, 0); @@ -24860,44 +25695,45 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_func_Xettimeofday_nargs=2 -else +else $as_nop ntp_cv_func_Xettimeofday_nargs=1 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_func_Xettimeofday_nargs" >&5 -$as_echo "$ntp_cv_func_Xettimeofday_nargs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_func_Xettimeofday_nargs" >&5 +printf "%s\n" "$ntp_cv_func_Xettimeofday_nargs" >&6; } case "$ntp_cv_func_Xettimeofday_nargs" in 1) -$as_echo "#define SYSV_TIMEOFDAY 1" >>confdefs.h +printf "%s\n" "#define SYSV_TIMEOFDAY 1" >>confdefs.h esac -for ac_func in settimeofday + + for ac_func in settimeofday do : ac_fn_c_check_func "$LINENO" "settimeofday" "ac_cv_func_settimeofday" -if test "x$ac_cv_func_settimeofday" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SETTIMEOFDAY 1 -_ACEOF +if test "x$ac_cv_func_settimeofday" = xyes +then : + printf "%s\n" "#define HAVE_SETTIMEOFDAY 1" >>confdefs.h -else +else $as_nop case "$host" in *-*-mpeix*) ac_cv_func_settimeofday=yes esac fi + done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we'll use clock_settime or settimeofday or stime" >&5 -$as_echo_n "checking if we'll use clock_settime or settimeofday or stime... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we'll use clock_settime or settimeofday or stime" >&5 +printf %s "checking if we'll use clock_settime or settimeofday or stime... " >&6; } ntp_warning='GRONK' ans=none case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in @@ -24919,14 +25755,14 @@ case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in ntp_warning='Which leaves us with nothing to use!' esac esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } case "$ntp_warning" in '') ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** $ntp_warning ***" >&5 -$as_echo "$as_me: WARNING: *** $ntp_warning ***" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** $ntp_warning ***" >&5 +printf "%s\n" "$as_me: WARNING: *** $ntp_warning ***" >&2;} ;; esac @@ -24937,23 +25773,24 @@ LIBS=$__LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for deprecated --with-arlib" >&5 -$as_echo_n "checking for deprecated --with-arlib... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for deprecated --with-arlib" >&5 +printf %s "checking for deprecated --with-arlib... " >&6; } # Check whether --with-arlib was given. -if test "${with_arlib+set}" = set; then : +if test ${with_arlib+y} +then : withval=$with_arlib; ans=$withval -else +else $as_nop ans=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } case "$ans" in yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Please do not use --with-arlib, arlib is no longer included. In the future, --with-arlib will not be recognized." >&5 -$as_echo "$as_me: WARNING: Please do not use --with-arlib, arlib is no longer included. In the future, --with-arlib will not be recognized." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Please do not use --with-arlib, arlib is no longer included. In the future, --with-arlib will not be recognized." >&5 +printf "%s\n" "$as_me: WARNING: Please do not use --with-arlib, arlib is no longer included. In the future, --with-arlib will not be recognized." >&2;} ;; esac @@ -24961,11 +25798,12 @@ for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else @@ -24973,11 +25811,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -24988,11 +25830,11 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -25000,13 +25842,14 @@ fi done { ac_cv_prog_AWK=; unset ac_cv_prog_AWK;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @@ -25022,12 +25865,12 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -25035,22 +25878,23 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 -$as_echo_n "checking for library containing strerror... " >&6; } -if ${ac_cv_search_strerror+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 +printf %s "checking for library containing strerror... " >&6; } +if test ${ac_cv_search_strerror+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -25058,46 +25902,48 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char strerror (); int -main () +main (void) { return strerror (); ; return 0; } _ACEOF -for ac_lib in '' cposix; do +for ac_lib in '' cposix +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_strerror=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_strerror+:} false; then : + if test ${ac_cv_search_strerror+y} +then : break fi done -if ${ac_cv_search_strerror+:} false; then : +if test ${ac_cv_search_strerror+y} +then : -else +else $as_nop ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 -$as_echo "$ac_cv_search_strerror" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 +printf "%s\n" "$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi @@ -25106,11 +25952,12 @@ fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PATH_PERL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PATH_PERL+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PATH_PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PATH_PERL="$PATH_PERL" # Let the user override the test with a path. @@ -25120,11 +25967,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PATH_PERL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PATH_PERL="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -25136,22 +25987,23 @@ esac fi PATH_PERL=$ac_cv_path_PATH_PERL if test -n "$PATH_PERL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_PERL" >&5 -$as_echo "$PATH_PERL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PATH_PERL" >&5 +printf "%s\n" "$PATH_PERL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi { ac_cv_path_PATH_PERL=; unset ac_cv_path_PATH_PERL;} # Extract the first word of "test", so it can be a program name with args. set dummy test; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PATH_TEST+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PATH_TEST+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PATH_TEST in [\\/]* | ?:[\\/]*) ac_cv_path_PATH_TEST="$PATH_TEST" # Let the user override the test with a path. @@ -25161,11 +26013,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PATH_TEST="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PATH_TEST="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -25177,11 +26033,11 @@ esac fi PATH_TEST=$ac_cv_path_PATH_TEST if test -n "$PATH_TEST"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TEST" >&5 -$as_echo "$PATH_TEST" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PATH_TEST" >&5 +printf "%s\n" "$PATH_TEST" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -25190,9 +26046,10 @@ test -z "$CONFIG_SHELL" && CONFIG_SHELL=/bin/sh # Check whether --with-net-snmp-config was given. -if test "${with_net_snmp_config+set}" = set; then : +if test ${with_net_snmp_config+y} +then : withval=$with_net_snmp_config; ans=$withval -else +else $as_nop ans=yes fi @@ -25220,11 +26077,12 @@ case "$PROG_NET_SNMP_CONFIG" in *) # Extract the first word of "$PROG_NET_SNMP_CONFIG", so it can be a program name with args. set dummy $PROG_NET_SNMP_CONFIG; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PATH_NET_SNMP_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PATH_NET_SNMP_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PATH_NET_SNMP_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PATH_NET_SNMP_CONFIG="$PATH_NET_SNMP_CONFIG" # Let the user override the test with a path. @@ -25234,11 +26092,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PATH_NET_SNMP_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PATH_NET_SNMP_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -25250,33 +26112,34 @@ esac fi PATH_NET_SNMP_CONFIG=$ac_cv_path_PATH_NET_SNMP_CONFIG if test -n "$PATH_NET_SNMP_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_NET_SNMP_CONFIG" >&5 -$as_echo "$PATH_NET_SNMP_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PATH_NET_SNMP_CONFIG" >&5 +printf "%s\n" "$PATH_NET_SNMP_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi { ac_cv_path_PATH_NET_SNMP_CONFIG=; unset ac_cv_path_PATH_NET_SNMP_CONFIG;} ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for net-snmp-config path" >&5 -$as_echo_n "checking for net-snmp-config path... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_NET_SNMP_CONFIG" >&5 -$as_echo "$PATH_NET_SNMP_CONFIG" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for net-snmp-config path" >&5 +printf %s "checking for net-snmp-config path... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PATH_NET_SNMP_CONFIG" >&5 +printf "%s\n" "$PATH_NET_SNMP_CONFIG" >&6; } case "$PATH_NET_SNMP_CONFIG" in - /*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for net-snmp version" >&5 -$as_echo_n "checking for net-snmp version... " >&6; } -if ${ntp_cv_net_snmp_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + /*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for net-snmp version" >&5 +printf %s "checking for net-snmp version... " >&6; } +if test ${ntp_cv_net_snmp_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ntp_cv_net_snmp_version=`$PATH_NET_SNMP_CONFIG --version` fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_net_snmp_version" >&5 -$as_echo "$ntp_cv_net_snmp_version" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_net_snmp_version" >&5 +printf "%s\n" "$ntp_cv_net_snmp_version" >&6; } ;; esac @@ -25287,11 +26150,12 @@ case "$host" in esac # HMS: a check for -lnsl used to be here - now being done in NTP_LIBNTP -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing openlog" >&5 -$as_echo_n "checking for library containing openlog... " >&6; } -if ${ac_cv_search_openlog+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing openlog" >&5 +printf %s "checking for library containing openlog... " >&6; } +if test ${ac_cv_search_openlog+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -25299,46 +26163,48 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char openlog (); int -main () +main (void) { return openlog (); ; return 0; } _ACEOF -for ac_lib in '' gen syslog; do +for ac_lib in '' gen syslog +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_openlog=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_openlog+:} false; then : + if test ${ac_cv_search_openlog+y} +then : break fi done -if ${ac_cv_search_openlog+:} false; then : +if test ${ac_cv_search_openlog+y} +then : -else +else $as_nop ac_cv_search_openlog=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_openlog" >&5 -$as_echo "$ac_cv_search_openlog" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_openlog" >&5 +printf "%s\n" "$ac_cv_search_openlog" >&6; } ac_res=$ac_cv_search_openlog -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi @@ -25347,25 +26213,27 @@ fi # LIBSECCOMP is off by default -- needs testing with all the features # Please send bug reports to loganaden@gmail.com -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to use libseccomp sandboxing (EXPERIMENTAL)" >&5 -$as_echo_n "checking if we want to use libseccomp sandboxing (EXPERIMENTAL)... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want to use libseccomp sandboxing (EXPERIMENTAL)" >&5 +printf %s "checking if we want to use libseccomp sandboxing (EXPERIMENTAL)... " >&6; } # Check whether --enable-libseccomp was given. -if test "${enable_libseccomp+set}" = set; then : +if test ${enable_libseccomp+y} +then : enableval=$enable_libseccomp; ntp_ok=$enableval -else +else $as_nop ntp_ok=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok" in yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing seccomp_init" >&5 -$as_echo_n "checking for library containing seccomp_init... " >&6; } -if ${ac_cv_search_seccomp_init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing seccomp_init" >&5 +printf %s "checking for library containing seccomp_init... " >&6; } +if test ${ac_cv_search_seccomp_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -25373,59 +26241,62 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char seccomp_init (); int -main () +main (void) { return seccomp_init (); ; return 0; } _ACEOF -for ac_lib in '' seccomp; do +for ac_lib in '' seccomp +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_seccomp_init=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_seccomp_init+:} false; then : + if test ${ac_cv_search_seccomp_init+y} +then : break fi done -if ${ac_cv_search_seccomp_init+:} false; then : +if test ${ac_cv_search_seccomp_init+y} +then : -else +else $as_nop ac_cv_search_seccomp_init=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_seccomp_init" >&5 -$as_echo "$ac_cv_search_seccomp_init" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_seccomp_init" >&5 +printf "%s\n" "$ac_cv_search_seccomp_init" >&6; } ac_res=$ac_cv_search_seccomp_init -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -$as_echo "#define LIBSECCOMP 1" >>confdefs.h +printf "%s\n" "#define LIBSECCOMP 1" >>confdefs.h fi - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -25466,9 +26337,10 @@ return 1; _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : -$as_echo "#define KERN_SECCOMP 1" >>confdefs.h +printf "%s\n" "#define KERN_SECCOMP 1" >>confdefs.h fi @@ -25480,11 +26352,12 @@ fi esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for facilitynames in syslog.h" >&5 -$as_echo_n "checking for facilitynames in syslog.h... " >&6; } -if ${ac_cv_HAVE_SYSLOG_FACILITYNAMES+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for facilitynames in syslog.h" >&5 +printf %s "checking for facilitynames in syslog.h... " >&6; } +if test ${ac_cv_HAVE_SYSLOG_FACILITYNAMES+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -25494,35 +26367,36 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #include int -main () +main (void) { void *fnames; fnames = facilitynames; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_HAVE_SYSLOG_FACILITYNAMES=yes -else +else $as_nop ac_cv_HAVE_SYSLOG_FACILITYNAMES=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_HAVE_SYSLOG_FACILITYNAMES" >&5 -$as_echo "$ac_cv_HAVE_SYSLOG_FACILITYNAMES" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_HAVE_SYSLOG_FACILITYNAMES" >&5 +printf "%s\n" "$ac_cv_HAVE_SYSLOG_FACILITYNAMES" >&6; } case "$ac_cv_HAVE_SYSLOG_FACILITYNAMES" in yes) -$as_echo "#define HAVE_SYSLOG_FACILITYNAMES 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYSLOG_FACILITYNAMES 1" >>confdefs.h ;; no) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No facilitynames in " >&5 -$as_echo "$as_me: WARNING: No facilitynames in " >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: No facilitynames in " >&5 +printf "%s\n" "$as_me: WARNING: No facilitynames in " >&2;} ;; cross) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: facilitynames in - cross-compiling" >&5 -$as_echo "$as_me: WARNING: facilitynames in - cross-compiling" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: facilitynames in - cross-compiling" >&5 +printf "%s\n" "$as_me: WARNING: facilitynames in - cross-compiling" >&2;} ;; esac @@ -25537,11 +26411,12 @@ case "$host" in case "$ac_cv_search_clock_gettime" in '') as_fn_error $? "Internal Error: Haven't looked for clock_gettime() yet!" "$LINENO" 5 ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_setscheduler" >&5 -$as_echo_n "checking for library containing sched_setscheduler... " >&6; } -if ${ac_cv_search_sched_setscheduler+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing sched_setscheduler" >&5 +printf %s "checking for library containing sched_setscheduler... " >&6; } +if test ${ac_cv_search_sched_setscheduler+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -25549,46 +26424,48 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char sched_setscheduler (); int -main () +main (void) { return sched_setscheduler (); ; return 0; } _ACEOF -for ac_lib in '' rt posix4; do +for ac_lib in '' rt posix4 +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_sched_setscheduler=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_sched_setscheduler+:} false; then : + if test ${ac_cv_search_sched_setscheduler+y} +then : break fi done -if ${ac_cv_search_sched_setscheduler+:} false; then : +if test ${ac_cv_search_sched_setscheduler+y} +then : -else +else $as_nop ac_cv_search_sched_setscheduler=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sched_setscheduler" >&5 -$as_echo "$ac_cv_search_sched_setscheduler" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sched_setscheduler" >&5 +printf "%s\n" "$ac_cv_search_sched_setscheduler" >&6; } ac_res=$ac_cv_search_sched_setscheduler -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi @@ -25596,25 +26473,22 @@ fi ;; esac -for ac_header in bstring.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "bstring.h" "ac_cv_header_bstring_h" "$ac_includes_default" -if test "x$ac_cv_header_bstring_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_BSTRING_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "bstring.h" "ac_cv_header_bstring_h" "$ac_includes_default" +if test "x$ac_cv_header_bstring_h" = xyes +then : + printf "%s\n" "#define HAVE_BSTRING_H 1" >>confdefs.h fi -done - -ac_fn_c_check_header_mongrel "$LINENO" "dns_sd.h" "ac_cv_header_dns_sd_h" "$ac_includes_default" -if test "x$ac_cv_header_dns_sd_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing DNSServiceRegister" >&5 -$as_echo_n "checking for library containing DNSServiceRegister... " >&6; } -if ${ac_cv_search_DNSServiceRegister+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_fn_c_check_header_compile "$LINENO" "dns_sd.h" "ac_cv_header_dns_sd_h" "$ac_includes_default" +if test "x$ac_cv_header_dns_sd_h" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing DNSServiceRegister" >&5 +printf %s "checking for library containing DNSServiceRegister... " >&6; } +if test ${ac_cv_search_DNSServiceRegister+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -25622,49 +26496,51 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char DNSServiceRegister (); int -main () +main (void) { return DNSServiceRegister (); ; return 0; } _ACEOF -for ac_lib in '' dns_sd; do +for ac_lib in '' dns_sd +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_DNSServiceRegister=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_DNSServiceRegister+:} false; then : + if test ${ac_cv_search_DNSServiceRegister+y} +then : break fi done -if ${ac_cv_search_DNSServiceRegister+:} false; then : +if test ${ac_cv_search_DNSServiceRegister+y} +then : -else +else $as_nop ac_cv_search_DNSServiceRegister=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_DNSServiceRegister" >&5 -$as_echo "$ac_cv_search_DNSServiceRegister" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_DNSServiceRegister" >&5 +printf "%s\n" "$ac_cv_search_DNSServiceRegister" >&6; } ac_res=$ac_cv_search_DNSServiceRegister -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -$as_echo "#define HAVE_DNSREGISTRATION 1" >>confdefs.h +printf "%s\n" "#define HAVE_DNSREGISTRATION 1" >>confdefs.h fi @@ -25672,213 +26548,299 @@ fi fi +ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" +if test "x$ac_cv_header_fcntl_h" = xyes +then : + printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h -for ac_header in fcntl.h fnmatch.h ieeefp.h inttypes.h kvm.h math.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +fi +ac_fn_c_check_header_compile "$LINENO" "fnmatch.h" "ac_cv_header_fnmatch_h" "$ac_includes_default" +if test "x$ac_cv_header_fnmatch_h" = xyes +then : + printf "%s\n" "#define HAVE_FNMATCH_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "ieeefp.h" "ac_cv_header_ieeefp_h" "$ac_includes_default" +if test "x$ac_cv_header_ieeefp_h" = xyes +then : + printf "%s\n" "#define HAVE_IEEEFP_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_inttypes_h" = xyes +then : + printf "%s\n" "#define HAVE_INTTYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "kvm.h" "ac_cv_header_kvm_h" "$ac_includes_default" +if test "x$ac_cv_header_kvm_h" = xyes +then : + printf "%s\n" "#define HAVE_KVM_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "math.h" "ac_cv_header_math_h" "$ac_includes_default" +if test "x$ac_cv_header_math_h" = xyes +then : + printf "%s\n" "#define HAVE_MATH_H 1" >>confdefs.h fi -done +ac_fn_c_check_header_compile "$LINENO" "memory.h" "ac_cv_header_memory_h" "$ac_includes_default" +if test "x$ac_cv_header_memory_h" = xyes +then : + printf "%s\n" "#define HAVE_MEMORY_H 1" >>confdefs.h -for ac_header in memory.h netdb.h poll.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +fi +ac_fn_c_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" +if test "x$ac_cv_header_netdb_h" = xyes +then : + printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" +if test "x$ac_cv_header_poll_h" = xyes +then : + printf "%s\n" "#define HAVE_POLL_H 1" >>confdefs.h fi -done +ac_fn_c_check_header_compile "$LINENO" "sgtty.h" "ac_cv_header_sgtty_h" "$ac_includes_default" +if test "x$ac_cv_header_sgtty_h" = xyes +then : + printf "%s\n" "#define HAVE_SGTTY_H 1" >>confdefs.h -for ac_header in sgtty.h stdatomic.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +fi +ac_fn_c_check_header_compile "$LINENO" "stdatomic.h" "ac_cv_header_stdatomic_h" "$ac_includes_default" +if test "x$ac_cv_header_stdatomic_h" = xyes +then : + printf "%s\n" "#define HAVE_STDATOMIC_H 1" >>confdefs.h fi -done +ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes +then : -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 -$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } -if ${ac_cv_header_stdbool_h+:} false; then : - $as_echo_n "(cached) " >&6 -else +printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h + + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +printf %s "checking for stdbool.h that conforms to C99... " >&6; } +if test ${ac_cv_header_stdbool_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include - #include - #ifndef bool - "error: bool is not defined" + #ifndef __bool_true_false_are_defined + #error "__bool_true_false_are_defined is not defined" #endif - #ifndef false - "error: false is not defined" - #endif - #if false - "error: false is not 0" - #endif - #ifndef true - "error: true is not defined" + char a[__bool_true_false_are_defined == 1 ? 1 : -1]; + + /* Regardless of whether this is C++ or "_Bool" is a + valid type name, "true" and "false" should be usable + in #if expressions and integer constant expressions, + and "bool" should be a valid type name. */ + + #if !true + #error "'true' is not true" #endif #if true != 1 - "error: true is not 1" + #error "'true' is not equal to 1" #endif - #ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" + char b[true == 1 ? 1 : -1]; + char c[true]; + + #if false + #error "'false' is not false" #endif + #if false != 0 + #error "'false' is not equal to 0" + #endif + char d[false == 0 ? 1 : -1]; - struct s { _Bool s: 1; _Bool t; } s; + enum { e = false, f = true, g = false * true, h = true * 256 }; + + char i[(bool) 0.5 == true ? 1 : -1]; + char j[(bool) 0.0 == false ? 1 : -1]; + char k[sizeof (bool) > 0 ? 1 : -1]; + + struct sb { bool s: 1; bool t; } s; + char l[sizeof s.t > 0 ? 1 : -1]; - char a[true == 1 ? 1 : -1]; - char b[false == 0 ? 1 : -1]; - char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) 0.5 == true ? 1 : -1]; - /* See body of main program for 'e'. */ - char f[(_Bool) 0.0 == false ? 1 : -1]; - char g[true]; - char h[sizeof (_Bool)]; - char i[sizeof s.t]; - enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ - _Bool n[m]; - char o[sizeof n == m * sizeof n[0] ? 1 : -1]; - char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + bool m[h]; + char n[sizeof m == h * sizeof m[0] ? 1 : -1]; + char o[-1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See - http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ - _Bool q = true; - _Bool *pq = &q; + bool p = true; + bool *pp = &p; + + /* C 1999 specifies that bool, true, and false are to be + macros, but C++ 2011 and later overrule this. */ + #if __cplusplus < 201103 + #ifndef bool + #error "bool is not defined" + #endif + #ifndef false + #error "false is not defined" + #endif + #ifndef true + #error "true is not defined" + #endif + #endif + + /* If _Bool is available, repeat with it all the tests + above that used bool. */ + #ifdef HAVE__BOOL + struct sB { _Bool s: 1; _Bool t; } t; + + char q[(_Bool) 0.5 == true ? 1 : -1]; + char r[(_Bool) 0.0 == false ? 1 : -1]; + char u[sizeof (_Bool) > 0 ? 1 : -1]; + char v[sizeof t.t > 0 ? 1 : -1]; + + _Bool w[h]; + char x[sizeof m == h * sizeof m[0] ? 1 : -1]; + char y[-1 - (_Bool) 0 < 0 ? 1 : -1]; + _Bool z = true; + _Bool *pz = &p; + #endif int -main () +main (void) { - bool e = &s; - *pq |= q; - *pq |= ! q; - /* Refer to every declared value, to avoid compiler optimizations. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l - + !m + !n + !o + !p + !q + !pq); + bool ps = &s; + *pp |= p; + *pp |= ! p; + + #ifdef HAVE__BOOL + _Bool pt = &t; + *pz |= z; + *pz |= ! z; + #endif + + /* Refer to every declared value, so they cannot be + discarded as unused. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + + !l + !m + !n + !o + !p + !pp + !ps + #ifdef HAVE__BOOL + + !q + !r + !u + !v + !w + !x + !y + !z + !pt + #endif + ); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_header_stdbool_h=yes -else +else $as_nop ac_cv_header_stdbool_h=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 -$as_echo "$ac_cv_header_stdbool_h" >&6; } - ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" -if test "x$ac_cv_type__Bool" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE__BOOL 1 -_ACEOF - - -fi - +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } if test $ac_cv_header_stdbool_h = yes; then -$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h fi -for ac_header in stdlib.h string.h termio.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes +then : + printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" +if test "x$ac_cv_header_string_h" = xyes +then : + printf "%s\n" "#define HAVE_STRING_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "termio.h" "ac_cv_header_termio_h" "$ac_includes_default" +if test "x$ac_cv_header_termio_h" = xyes +then : + printf "%s\n" "#define HAVE_TERMIO_H 1" >>confdefs.h fi -done - -for ac_header in termios.h timepps.h timex.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" +if test "x$ac_cv_header_termios_h" = xyes +then : + printf "%s\n" "#define HAVE_TERMIOS_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "timepps.h" "ac_cv_header_timepps_h" "$ac_includes_default" +if test "x$ac_cv_header_timepps_h" = xyes +then : + printf "%s\n" "#define HAVE_TIMEPPS_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "timex.h" "ac_cv_header_timex_h" "$ac_includes_default" +if test "x$ac_cv_header_timex_h" = xyes +then : + printf "%s\n" "#define HAVE_TIMEX_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h + +fi case "$host" in *-*-aix*) - for ac_header in utmpx.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "utmpx.h" "ac_cv_header_utmpx_h" "$ac_includes_default" -if test "x$ac_cv_header_utmpx_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_UTMPX_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "utmpx.h" "ac_cv_header_utmpx_h" "$ac_includes_default" +if test "x$ac_cv_header_utmpx_h" = xyes +then : + printf "%s\n" "#define HAVE_UTMPX_H 1" >>confdefs.h fi -done - case "$ac_cv_header_utmpx_h" in yes) ;; *) - for ac_header in utmp.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "utmp.h" "ac_cv_header_utmp_h" "$ac_includes_default" -if test "x$ac_cv_header_utmp_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_UTMP_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "utmp.h" "ac_cv_header_utmp_h" "$ac_includes_default" +if test "x$ac_cv_header_utmp_h" = xyes +then : + printf "%s\n" "#define HAVE_UTMP_H 1" >>confdefs.h fi -done - ;; esac ;; *) - for ac_header in utmp.h utmpx.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "utmp.h" "ac_cv_header_utmp_h" "$ac_includes_default" +if test "x$ac_cv_header_utmp_h" = xyes +then : + printf "%s\n" "#define HAVE_UTMP_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "utmpx.h" "ac_cv_header_utmpx_h" "$ac_includes_default" +if test "x$ac_cv_header_utmpx_h" = xyes +then : + printf "%s\n" "#define HAVE_UTMPX_H 1" >>confdefs.h -done +fi ;; esac @@ -25893,273 +26855,303 @@ esac # case "$host" in *-*-sunos*|*-*-solaris*) - for ac_func in getpassphrase -do : - ac_fn_c_check_func "$LINENO" "getpassphrase" "ac_cv_func_getpassphrase" -if test "x$ac_cv_func_getpassphrase" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETPASSPHRASE 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "getpassphrase" "ac_cv_func_getpassphrase" +if test "x$ac_cv_func_getpassphrase" = xyes +then : + printf "%s\n" "#define HAVE_GETPASSPHRASE 1" >>confdefs.h fi -done esac -for ac_header in net/if6.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "net/if6.h" "ac_cv_header_net_if6_h" "$ac_includes_default" -if test "x$ac_cv_header_net_if6_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NET_IF6_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "net/if6.h" "ac_cv_header_net_if6_h" "$ac_includes_default" +if test "x$ac_cv_header_net_if6_h" = xyes +then : + printf "%s\n" "#define HAVE_NET_IF6_H 1" >>confdefs.h fi -done - -for ac_header in net/route.h -do : - ac_fn_c_check_header_compile "$LINENO" "net/route.h" "ac_cv_header_net_route_h" " +ac_fn_c_check_header_compile "$LINENO" "net/route.h" "ac_cv_header_net_route_h" " #include #include #include " -if test "x$ac_cv_header_net_route_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NET_ROUTE_H 1 -_ACEOF +if test "x$ac_cv_header_net_route_h" = xyes +then : + printf "%s\n" "#define HAVE_NET_ROUTE_H 1" >>confdefs.h fi -done - -for ac_header in netinfo/ni.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "netinfo/ni.h" "ac_cv_header_netinfo_ni_h" "$ac_includes_default" -if test "x$ac_cv_header_netinfo_ni_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NETINFO_NI_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "netinfo/ni.h" "ac_cv_header_netinfo_ni_h" "$ac_includes_default" +if test "x$ac_cv_header_netinfo_ni_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINFO_NI_H 1" >>confdefs.h fi -done - case "$ac_cv_header_netinfo_ni_h" in yes) -$as_echo "#define HAVE_NETINFO 1" >>confdefs.h +printf "%s\n" "#define HAVE_NETINFO 1" >>confdefs.h esac -for ac_header in sun/audioio.h sys/audioio.h sys/file.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "sun/audioio.h" "ac_cv_header_sun_audioio_h" "$ac_includes_default" +if test "x$ac_cv_header_sun_audioio_h" = xyes +then : + printf "%s\n" "#define HAVE_SUN_AUDIOIO_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "sys/audioio.h" "ac_cv_header_sys_audioio_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_audioio_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_AUDIOIO_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_file_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_FILE_H 1" >>confdefs.h + +fi case "$host" in *-*-sunos4*) ;; *) - for ac_header in sys/ioctl.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_ioctl_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_IOCTL_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ioctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h fi -done - ;; esac -for ac_header in sys/ipc.h sys/lock.h sys/mman.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "sys/ipc.h" "ac_cv_header_sys_ipc_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ipc_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_IPC_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "sys/lock.h" "ac_cv_header_sys_lock_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_lock_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_LOCK_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mman_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_MMAN_H 1" >>confdefs.h + +fi # HMS: Check sys/proc.h and sys/resource.h after some others -for ac_header in sys/modem.h sys/ppsclock.h sys/ppstime.h sched.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "sys/modem.h" "ac_cv_header_sys_modem_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_modem_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_MODEM_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "sys/ppsclock.h" "ac_cv_header_sys_ppsclock_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ppsclock_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PPSCLOCK_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "sys/ppstime.h" "ac_cv_header_sys_ppstime_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ppstime_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PPSTIME_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default" +if test "x$ac_cv_header_sched_h" = xyes +then : + printf "%s\n" "#define HAVE_SCHED_H 1" >>confdefs.h + +fi case "$ac_cv_header_sched_h" in yes) ;; *) - for ac_header in sys/sched.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/sched.h" "ac_cv_header_sys_sched_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_sched_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_SCHED_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "sys/sched.h" "ac_cv_header_sys_sched_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_sched_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SCHED_H 1" >>confdefs.h fi -done - ;; esac # HMS: Check sys/shm.h after some others -for ac_header in sys/select.h sys/signal.h sys/sockio.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_select_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SELECT_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "sys/signal.h" "ac_cv_header_sys_signal_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_signal_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SIGNAL_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "sys/sockio.h" "ac_cv_header_sys_sockio_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_sockio_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SOCKIO_H 1" >>confdefs.h + +fi # HMS: Checked sys/socket.h earlier case "$host" in *-*-netbsd*) ;; *) - for ac_header in machine/soundcard.h sys/soundcard.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "machine/soundcard.h" "ac_cv_header_machine_soundcard_h" "$ac_includes_default" +if test "x$ac_cv_header_machine_soundcard_h" = xyes +then : + printf "%s\n" "#define HAVE_MACHINE_SOUNDCARD_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "sys/soundcard.h" "ac_cv_header_sys_soundcard_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_soundcard_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SOUNDCARD_H 1" >>confdefs.h -done +fi ;; esac -for ac_header in sys/stat.h sys/stream.h stropts.h sys/stropts.h sys/syssgi.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_stat_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_STAT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/stream.h" "ac_cv_header_sys_stream_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_stream_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_STREAM_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stropts.h" "ac_cv_header_stropts_h" "$ac_includes_default" +if test "x$ac_cv_header_stropts_h" = xyes +then : + printf "%s\n" "#define HAVE_STROPTS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/stropts.h" "ac_cv_header_sys_stropts_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_stropts_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_STROPTS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/syssgi.h" "ac_cv_header_sys_syssgi_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_syssgi_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SYSSGI_H 1" >>confdefs.h fi -done +ac_fn_c_check_header_compile "$LINENO" "sys/systune.h" "ac_cv_header_sys_systune_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_systune_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SYSTUNE_H 1" >>confdefs.h -for ac_header in sys/systune.h sys/termios.h sys/tpro.h sys/wait.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +fi +ac_fn_c_check_header_compile "$LINENO" "sys/termios.h" "ac_cv_header_sys_termios_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_termios_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TERMIOS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/tpro.h" "ac_cv_header_sys_tpro_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_tpro_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TPRO_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_wait_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi -done - -for ac_func in waitpid -do : - ac_fn_c_check_func "$LINENO" "waitpid" "ac_cv_func_waitpid" -if test "x$ac_cv_func_waitpid" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_WAITPID 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "waitpid" "ac_cv_func_waitpid" +if test "x$ac_cv_func_waitpid" = xyes +then : + printf "%s\n" "#define HAVE_WAITPID 1" >>confdefs.h fi -done case "$host" in *-convex-*) - for ac_header in /sys/sync/queue.h /sys/sync/sema.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "/sys/sync/queue.h" "ac_cv_header__sys_sync_queue_h" "$ac_includes_default" +if test "x$ac_cv_header__sys_sync_queue_h" = xyes +then : + printf "%s\n" "#define HAVE__SYS_SYNC_QUEUE_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "/sys/sync/sema.h" "ac_cv_header__sys_sync_sema_h" "$ac_includes_default" +if test "x$ac_cv_header__sys_sync_sema_h" = xyes +then : + printf "%s\n" "#define HAVE__SYS_SYNC_SEMA_H 1" >>confdefs.h -done +fi ;; *-*-bsdi*) - for ac_header in machine/inline.h sys/pcl720.h sys/i8253.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "machine/inline.h" "ac_cv_header_machine_inline_h" "$ac_includes_default" +if test "x$ac_cv_header_machine_inline_h" = xyes +then : + printf "%s\n" "#define HAVE_MACHINE_INLINE_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "sys/pcl720.h" "ac_cv_header_sys_pcl720_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_pcl720_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PCL720_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "sys/i8253.h" "ac_cv_header_sys_i8253_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_i8253_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_I8253_H 1" >>confdefs.h + +fi ;; esac case "$ac_cv_header_stdatomic_h" in yes) - for ac_func in atomic_thread_fence -do : - ac_fn_c_check_func "$LINENO" "atomic_thread_fence" "ac_cv_func_atomic_thread_fence" -if test "x$ac_cv_func_atomic_thread_fence" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ATOMIC_THREAD_FENCE 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "atomic_thread_fence" "ac_cv_func_atomic_thread_fence" +if test "x$ac_cv_func_atomic_thread_fence" = xyes +then : + printf "%s\n" "#define HAVE_ATOMIC_THREAD_FENCE 1" >>confdefs.h fi -done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atomic_thread_fence()" >&5 -$as_echo_n "checking for atomic_thread_fence()... " >&6; } -if ${ntp_cv_func_atomic_thread_fence+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for atomic_thread_fence()" >&5 +printf %s "checking for atomic_thread_fence()... " >&6; } +if test ${ntp_cv_func_atomic_thread_fence+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { atomic_thread_fence(memory_order_seq_cst); @@ -26168,17 +27160,19 @@ main () ; return 0; } - ntp_cv_func_atomic_thread_fence=yes _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : + ntp_cv_func_atomic_thread_fence=yes +else $as_nop ntp_cv_func_atomic_thread_fence=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_func_atomic_thread_fence" >&5 -$as_echo "$ntp_cv_func_atomic_thread_fence" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_func_atomic_thread_fence" >&5 +printf "%s\n" "$ntp_cv_func_atomic_thread_fence" >&6; } ;; esac @@ -26187,17 +27181,18 @@ case "$host" in # Broken... ;; *) - for ac_func in ntp_adjtime ntp_gettime -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "ntp_adjtime" "ac_cv_func_ntp_adjtime" +if test "x$ac_cv_func_ntp_adjtime" = xyes +then : + printf "%s\n" "#define HAVE_NTP_ADJTIME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "ntp_gettime" "ac_cv_func_ntp_gettime" +if test "x$ac_cv_func_ntp_gettime" = xyes +then : + printf "%s\n" "#define HAVE_NTP_GETTIME 1" >>confdefs.h fi -done ;; esac @@ -26208,74 +27203,62 @@ case "$host" in yes) ;; *) - for ac_func in __ntp_gettime -do : - ac_fn_c_check_func "$LINENO" "__ntp_gettime" "ac_cv_func___ntp_gettime" -if test "x$ac_cv_func___ntp_gettime" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE___NTP_GETTIME 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "__ntp_gettime" "ac_cv_func___ntp_gettime" +if test "x$ac_cv_func___ntp_gettime" = xyes +then : + printf "%s\n" "#define HAVE___NTP_GETTIME 1" >>confdefs.h fi -done case "$ac_cv_func___ntp_gettime" in yes) -$as_echo "#define ntp_gettime __ntp_gettime" >>confdefs.h +printf "%s\n" "#define ntp_gettime __ntp_gettime" >>confdefs.h -$as_echo "#define HAVE_NTP_GETTIME 1" >>confdefs.h +printf "%s\n" "#define HAVE_NTP_GETTIME 1" >>confdefs.h esac ;; esac - for ac_func in adjtimex -do : - ac_fn_c_check_func "$LINENO" "adjtimex" "ac_cv_func_adjtimex" -if test "x$ac_cv_func_adjtimex" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ADJTIMEX 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "adjtimex" "ac_cv_func_adjtimex" +if test "x$ac_cv_func_adjtimex" = xyes +then : + printf "%s\n" "#define HAVE_ADJTIMEX 1" >>confdefs.h fi -done case "$ac_cv_func_adjtimex" in yes) -$as_echo "#define ntp_adjtime adjtimex" >>confdefs.h +printf "%s\n" "#define ntp_adjtime adjtimex" >>confdefs.h -$as_echo "#define HAVE_NTP_ADJTIME 1" >>confdefs.h +printf "%s\n" "#define HAVE_NTP_ADJTIME 1" >>confdefs.h have_adjtimex=1 ;; *) - for ac_func in __adjtimex -do : - ac_fn_c_check_func "$LINENO" "__adjtimex" "ac_cv_func___adjtimex" -if test "x$ac_cv_func___adjtimex" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE___ADJTIMEX 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "__adjtimex" "ac_cv_func___adjtimex" +if test "x$ac_cv_func___adjtimex" = xyes +then : + printf "%s\n" "#define HAVE___ADJTIMEX 1" >>confdefs.h fi -done case "$ac_cv_func___adjtimex" in yes) -$as_echo "#define ntp_adjtime __adjtimex" >>confdefs.h +printf "%s\n" "#define ntp_adjtime __adjtimex" >>confdefs.h -$as_echo "#define HAVE_NTP_ADJTIME 1" >>confdefs.h +printf "%s\n" "#define HAVE_NTP_ADJTIME 1" >>confdefs.h -$as_echo "#define adjtimex __adjtimex" >>confdefs.h +printf "%s\n" "#define adjtimex __adjtimex" >>confdefs.h -$as_echo "#define HAVE_ADJTIMEX 1" >>confdefs.h +printf "%s\n" "#define HAVE_ADJTIMEX 1" >>confdefs.h have_adjtimex=1 esac @@ -26287,11 +27270,12 @@ case "$have_adjtimex" in # nlist stuff is only needed for tickadj. saved_LIBS="$LIBS" LIBS= - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nlist" >&5 -$as_echo_n "checking for library containing nlist... " >&6; } -if ${ac_cv_search_nlist+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing nlist" >&5 +printf %s "checking for library containing nlist... " >&6; } +if test ${ac_cv_search_nlist+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -26299,56 +27283,59 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char nlist (); int -main () +main (void) { return nlist (); ; return 0; } _ACEOF -for ac_lib in '' elf ld mld; do +for ac_lib in '' elf ld mld +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_nlist=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_nlist+:} false; then : + if test ${ac_cv_search_nlist+y} +then : break fi done -if ${ac_cv_search_nlist+:} false; then : +if test ${ac_cv_search_nlist+y} +then : -else +else $as_nop ac_cv_search_nlist=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nlist" >&5 -$as_echo "$ac_cv_search_nlist" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nlist" >&5 +printf "%s\n" "$ac_cv_search_nlist" >&6; } ac_res=$ac_cv_search_nlist -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # XXX ac_cv_search_nlist will be 'none required', 'no', or '-l...' - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing kvm_open" >&5 -$as_echo_n "checking for library containing kvm_open... " >&6; } -if ${ac_cv_search_kvm_open+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing kvm_open" >&5 +printf %s "checking for library containing kvm_open... " >&6; } +if test ${ac_cv_search_kvm_open+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -26356,80 +27343,83 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char kvm_open (); int -main () +main (void) { return kvm_open (); ; return 0; } _ACEOF -for ac_lib in '' kvm; do +for ac_lib in '' kvm +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_kvm_open=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_kvm_open+:} false; then : + if test ${ac_cv_search_kvm_open+y} +then : break fi done -if ${ac_cv_search_kvm_open+:} false; then : +if test ${ac_cv_search_kvm_open+y} +then : -else +else $as_nop ac_cv_search_kvm_open=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_kvm_open" >&5 -$as_echo "$ac_cv_search_kvm_open" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_kvm_open" >&5 +printf "%s\n" "$ac_cv_search_kvm_open" >&6; } ac_res=$ac_cv_search_kvm_open -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # XXX ac_cv_search_kvm_open will be 'none required', 'no', or '-l...' - for ac_header in nlist.h sys/var.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "nlist.h" "ac_cv_header_nlist_h" "$ac_includes_default" +if test "x$ac_cv_header_nlist_h" = xyes +then : + printf "%s\n" "#define HAVE_NLIST_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "sys/var.h" "ac_cv_header_sys_var_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_var_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_VAR_H 1" >>confdefs.h -done +fi case "$ac_cv_header_nlist_h" in yes) -$as_echo "#define NLIST_STRUCT 1" >>confdefs.h +printf "%s\n" "#define NLIST_STRUCT 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for n_un in struct nlist" >&5 -$as_echo_n "checking for n_un in struct nlist... " >&6; } -if ${ntp_cv_struct_nlist_n_un+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for n_un in struct nlist" >&5 +printf %s "checking for n_un in struct nlist... " >&6; } +if test ${ntp_cv_struct_nlist_n_un+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { struct nlist n; @@ -26439,21 +27429,23 @@ main () ; return 0; } - ntp_cv_struct_nlist_n_un=yes _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : + ntp_cv_struct_nlist_n_un=yes +else $as_nop ntp_cv_struct_nlist_n_un=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_nlist_n_un" >&5 -$as_echo "$ntp_cv_struct_nlist_n_un" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_nlist_n_un" >&5 +printf "%s\n" "$ntp_cv_struct_nlist_n_un" >&6; } case "$ntp_cv_struct_nlist_n_un" in yes) -$as_echo "#define NLIST_NAME_UNION 1" >>confdefs.h +printf "%s\n" "#define NLIST_NAME_UNION 1" >>confdefs.h esac esac @@ -26463,9 +27455,7 @@ $as_echo "#define NLIST_NAME_UNION 1" >>confdefs.h { saved_LIBS=; unset saved_LIBS;} esac -for ac_header in sys/proc.h -do : - ac_fn_c_check_header_compile "$LINENO" "sys/proc.h" "ac_cv_header_sys_proc_h" " +ac_fn_c_check_header_compile "$LINENO" "sys/proc.h" "ac_cv_header_sys_proc_h" " #ifdef HAVE_SYS_TYPES_H # include #endif @@ -26474,37 +27464,27 @@ do : #endif " -if test "x$ac_cv_header_sys_proc_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_PROC_H 1 -_ACEOF +if test "x$ac_cv_header_sys_proc_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PROC_H 1" >>confdefs.h fi -done - -for ac_header in sys/resource.h -do : - ac_fn_c_check_header_compile "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" " +ac_fn_c_check_header_compile "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" " #ifdef HAVE_SYS_TIME_H # include #endif " -if test "x$ac_cv_header_sys_resource_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_RESOURCE_H 1 -_ACEOF +if test "x$ac_cv_header_sys_resource_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_RESOURCE_H 1" >>confdefs.h fi -done - -for ac_header in sys/shm.h -do : - ac_fn_c_check_header_compile "$LINENO" "sys/shm.h" "ac_cv_header_sys_shm_h" " +ac_fn_c_check_header_compile "$LINENO" "sys/shm.h" "ac_cv_header_sys_shm_h" " #ifdef HAVE_SYS_TYPES_H # include #endif @@ -26513,33 +27493,25 @@ do : #endif " -if test "x$ac_cv_header_sys_shm_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_SHM_H 1 -_ACEOF +if test "x$ac_cv_header_sys_shm_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SHM_H 1" >>confdefs.h fi -done - -for ac_header in sys/timex.h -do : - ac_fn_c_check_header_compile "$LINENO" "sys/timex.h" "ac_cv_header_sys_timex_h" " +ac_fn_c_check_header_compile "$LINENO" "sys/timex.h" "ac_cv_header_sys_timex_h" " #ifdef HAVE_SYS_TIME_H # include #endif " -if test "x$ac_cv_header_sys_timex_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_TIMEX_H 1 -_ACEOF +if test "x$ac_cv_header_sys_timex_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TIMEX_H 1" >>confdefs.h fi -done - @@ -26557,76 +27529,77 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #endif int -main () +main (void) { -{ $as_echo "$as_me:${as_lineno-$LINENO}: AF_UNSPEC is zero, as expected." >&5 -$as_echo "$as_me: AF_UNSPEC is zero, as expected." >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: AF_UNSPEC is zero, as expected." >&5 +printf "%s\n" "$as_me: AF_UNSPEC is zero, as expected." >&6;} ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 -$as_echo_n "checking return type of signal handlers... " >&6; } -if ${ac_cv_type_signal+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 +printf %s "checking return type of signal handlers... " >&6; } +if test ${ac_cv_type_signal+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main () +main (void) { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_type_signal=int -else +else $as_nop ac_cv_type_signal=void fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 -$as_echo "$ac_cv_type_signal" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 +printf "%s\n" "$ac_cv_type_signal" >&6; } -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF +printf "%s\n" "#define RETSIGTYPE $ac_cv_type_signal" >>confdefs.h ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" -if test "x$ac_cv_type_off_t" = xyes; then : +if test "x$ac_cv_type_off_t" = xyes +then : -else +else $as_nop -cat >>confdefs.h <<_ACEOF -#define off_t long int -_ACEOF +printf "%s\n" "#define off_t long int" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 -$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if ${ac_cv_struct_tm+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +printf %s "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if test ${ac_cv_struct_tm+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main () +main (void) { struct tm tm; int *p = &tm.tm_sec; @@ -26635,26 +27608,28 @@ struct tm tm; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_struct_tm=time.h -else +else $as_nop ac_cv_struct_tm=sys/time.h fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 -$as_echo "$ac_cv_struct_tm" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +printf "%s\n" "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then -$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h +printf "%s\n" "#define TM_IN_SYS_TIME 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a fallback value for HZ" >&5 -$as_echo_n "checking for a fallback value for HZ... " >&6; } -if ${ntp_cv_default_hz+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a fallback value for HZ" >&5 +printf %s "checking for a fallback value for HZ... " >&6; } +if test ${ntp_cv_default_hz+y} +then : + printf %s "(cached) " >&6 +else $as_nop ntp_cv_default_hz=100 case "$host" in @@ -26668,19 +27643,18 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_default_hz" >&5 -$as_echo "$ntp_cv_default_hz" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_default_hz" >&5 +printf "%s\n" "$ntp_cv_default_hz" >&6; } -cat >>confdefs.h <<_ACEOF -#define DEFAULT_HZ $ntp_cv_default_hz -_ACEOF +printf "%s\n" "#define DEFAULT_HZ $ntp_cv_default_hz" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to override the system's value for HZ" >&5 -$as_echo_n "checking if we need to override the system's value for HZ... " >&6; } -if ${ntp_cv_override_hz+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we need to override the system's value for HZ" >&5 +printf %s "checking if we need to override the system's value for HZ... " >&6; } +if test ${ntp_cv_override_hz+y} +then : + printf %s "(cached) " >&6 +else $as_nop ntp_cv_override_hz=no case "$host" in @@ -26703,22 +27677,23 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_override_hz" >&5 -$as_echo "$ntp_cv_override_hz" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_override_hz" >&5 +printf "%s\n" "$ntp_cv_override_hz" >&6; } case "$ntp_cv_override_hz" in yes) -$as_echo "#define OVERRIDE_HZ 1" >>confdefs.h +printf "%s\n" "#define OVERRIDE_HZ 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct rt_msghdr" >&5 -$as_echo_n "checking for struct rt_msghdr... " >&6; } -if ${ntp_cv_struct_rt_msghdr+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct rt_msghdr" >&5 +printf %s "checking for struct rt_msghdr... " >&6; } +if test ${ntp_cv_struct_rt_msghdr+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -26728,7 +27703,7 @@ else #include int -main () +main (void) { struct rt_msghdr p; @@ -26738,23 +27713,25 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_struct_rt_msghdr=yes -else +else $as_nop ntp_cv_struct_rt_msghdr=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_rt_msghdr" >&5 -$as_echo "$ntp_cv_struct_rt_msghdr" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_rt_msghdr" >&5 +printf "%s\n" "$ntp_cv_struct_rt_msghdr" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct rtattr" >&5 -$as_echo_n "checking for struct rtattr... " >&6; } -if ${ntp_cv_rtattr+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct rtattr" >&5 +printf %s "checking for struct rtattr... " >&6; } +if test ${ntp_cv_rtattr+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -26763,7 +27740,7 @@ else #include int -main () +main (void) { struct rtattr p; @@ -26773,43 +27750,45 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_rtattr=yes -else +else $as_nop ntp_cv_rtattr=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_rtattr" >&5 -$as_echo "$ntp_cv_rtattr" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_rtattr" >&5 +printf "%s\n" "$ntp_cv_rtattr" >&6; } case "$ntp_cv_struct_rt_msghdr$ntp_cv_rtattr" in *yes*) -$as_echo "#define HAS_ROUTING_SOCKET 1" >>confdefs.h +printf "%s\n" "#define HAS_ROUTING_SOCKET 1" >>confdefs.h case "$ntp_cv_rtattr" in yes) -$as_echo "#define HAVE_RTNETLINK 1" >>confdefs.h +printf "%s\n" "#define HAVE_RTNETLINK 1" >>confdefs.h esac esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sigaction for sa_sigaction" >&5 -$as_echo_n "checking struct sigaction for sa_sigaction... " >&6; } -if ${ntp_cv_struct_sigaction_has_sa_sigaction+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking struct sigaction for sa_sigaction" >&5 +printf %s "checking struct sigaction for sa_sigaction... " >&6; } +if test ${ntp_cv_struct_sigaction_has_sa_sigaction+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { struct sigaction act; @@ -26820,29 +27799,31 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_struct_sigaction_has_sa_sigaction=yes -else +else $as_nop ntp_cv_struct_sigaction_has_sa_sigaction=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_sigaction_has_sa_sigaction" >&5 -$as_echo "$ntp_cv_struct_sigaction_has_sa_sigaction" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_sigaction_has_sa_sigaction" >&5 +printf "%s\n" "$ntp_cv_struct_sigaction_has_sa_sigaction" >&6; } case "$ntp_cv_struct_sigaction_has_sa_sigaction" in yes) -$as_echo "#define HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION 1" >>confdefs.h +printf "%s\n" "#define HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct ppsclockev" >&5 -$as_echo_n "checking for struct ppsclockev... " >&6; } -if ${ntp_cv_struct_ppsclockev+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct ppsclockev" >&5 +printf %s "checking for struct ppsclockev... " >&6; } +if test ${ntp_cv_struct_ppsclockev+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -26860,7 +27841,7 @@ else #endif int -main () +main (void) { extern struct ppsclockev *pce; @@ -26871,31 +27852,33 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_struct_ppsclockev=yes -else +else $as_nop ntp_cv_struct_ppsclockev=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_ppsclockev" >&5 -$as_echo "$ntp_cv_struct_ppsclockev" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_ppsclockev" >&5 +printf "%s\n" "$ntp_cv_struct_ppsclockev" >&6; } case "$ntp_cv_struct_ppsclockev" in yes) -$as_echo "#define HAVE_STRUCT_PPSCLOCKEV 1" >>confdefs.h +printf "%s\n" "#define HAVE_STRUCT_PPSCLOCKEV 1" >>confdefs.h esac case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in *yes*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct snd_size" >&5 -$as_echo_n "checking for struct snd_size... " >&6; } -if ${ntp_cv_struct_snd_size+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct snd_size" >&5 +printf %s "checking for struct snd_size... " >&6; } +if test ${ntp_cv_struct_snd_size+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -26907,7 +27890,7 @@ else #endif int -main () +main (void) { extern struct snd_size *ss; @@ -26918,37 +27901,39 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_struct_snd_size=yes -else +else $as_nop ntp_cv_struct_snd_size=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_snd_size" >&5 -$as_echo "$ntp_cv_struct_snd_size" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_snd_size" >&5 +printf "%s\n" "$ntp_cv_struct_snd_size" >&6; } case "$ntp_cv_struct_snd_size" in yes) -$as_echo "#define HAVE_STRUCT_SND_SIZE 1" >>confdefs.h +printf "%s\n" "#define HAVE_STRUCT_SND_SIZE 1" >>confdefs.h esac esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct clockinfo for hz" >&5 -$as_echo_n "checking struct clockinfo for hz... " >&6; } -if ${ntp_cv_struct_clockinfo_has_hz+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking struct clockinfo for hz" >&5 +printf %s "checking struct clockinfo for hz... " >&6; } +if test ${ntp_cv_struct_clockinfo_has_hz+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { extern struct clockinfo *pc; @@ -26959,36 +27944,38 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_struct_clockinfo_has_hz=yes -else +else $as_nop ntp_cv_struct_clockinfo_has_hz=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_clockinfo_has_hz" >&5 -$as_echo "$ntp_cv_struct_clockinfo_has_hz" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_clockinfo_has_hz" >&5 +printf "%s\n" "$ntp_cv_struct_clockinfo_has_hz" >&6; } case "$ntp_cv_struct_clockinfo_has_hz" in yes) -$as_echo "#define HAVE_HZ_IN_STRUCT_CLOCKINFO 1" >>confdefs.h +printf "%s\n" "#define HAVE_HZ_IN_STRUCT_CLOCKINFO 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct clockinfo for tickadj" >&5 -$as_echo_n "checking struct clockinfo for tickadj... " >&6; } -if ${ntp_cv_struct_clockinfo_has_hz+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking struct clockinfo for tickadj" >&5 +printf %s "checking struct clockinfo for tickadj... " >&6; } +if test ${ntp_cv_struct_clockinfo_has_hz+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { extern struct clockinfo *pc; @@ -26999,21 +27986,22 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_struct_clockinfo_has_hz=yes -else +else $as_nop ntp_cv_struct_clockinfo_has_hz=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_clockinfo_has_hz" >&5 -$as_echo "$ntp_cv_struct_clockinfo_has_hz" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_clockinfo_has_hz" >&5 +printf "%s\n" "$ntp_cv_struct_clockinfo_has_hz" >&6; } case "$ntp_cv_struct_clockinfo_has_hz" in yes) -$as_echo "#define HAVE_TICKADJ_IN_STRUCT_CLOCKINFO 1" >>confdefs.h +printf "%s\n" "#define HAVE_TICKADJ_IN_STRUCT_CLOCKINFO 1" >>confdefs.h esac @@ -27037,11 +28025,10 @@ case "$ntp_cv_struct_ntptimeval" in " -if test "x$ac_cv_member_struct_ntptimeval_time_tv_nsec" = xyes; then : +if test "x$ac_cv_member_struct_ntptimeval_time_tv_nsec" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_NTPTIMEVAL_TIME_TV_NSEC 1 -_ACEOF +printf "%s\n" "#define HAVE_STRUCT_NTPTIMEVAL_TIME_TV_NSEC 1" >>confdefs.h fi @@ -27050,58 +28037,50 @@ esac #### -for ac_func in arc4random_buf -do : - ac_fn_c_check_func "$LINENO" "arc4random_buf" "ac_cv_func_arc4random_buf" -if test "x$ac_cv_func_arc4random_buf" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ARC4RANDOM_BUF 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "arc4random_buf" "ac_cv_func_arc4random_buf" +if test "x$ac_cv_func_arc4random_buf" = xyes +then : + printf "%s\n" "#define HAVE_ARC4RANDOM_BUF 1" >>confdefs.h fi -done #### saved_LIBS="$LIBS" LIBS="$LIBS $LDADD_LIBNTP" -for ac_func in daemon -do : - ac_fn_c_check_func "$LINENO" "daemon" "ac_cv_func_daemon" -if test "x$ac_cv_func_daemon" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DAEMON 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "daemon" "ac_cv_func_daemon" +if test "x$ac_cv_func_daemon" = xyes +then : + printf "%s\n" "#define HAVE_DAEMON 1" >>confdefs.h fi -done # XXX if we keep everything in LIBS and also keep separate lists, this simplifies. LIBS="$saved_LIBS" { saved_LIBS=; unset saved_LIBS;} -for ac_func in finite + + for ac_func in finite do : ac_fn_c_check_func "$LINENO" "finite" "ac_cv_func_finite" -if test "x$ac_cv_func_finite" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FINITE 1 -_ACEOF +if test "x$ac_cv_func_finite" = xyes +then : + printf "%s\n" "#define HAVE_FINITE 1" >>confdefs.h + +else $as_nop -else for ac_func in isfinite do : ac_fn_c_check_func "$LINENO" "isfinite" "ac_cv_func_isfinite" -if test "x$ac_cv_func_isfinite" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ISFINITE 1 -_ACEOF +if test "x$ac_cv_func_isfinite" = xyes +then : + printf "%s\n" "#define HAVE_ISFINITE 1" >>confdefs.h -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isfinite with " >&5 -$as_echo_n "checking for isfinite with ... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for isfinite with " >&5 +printf %s "checking for isfinite with ... " >&6; } _libs=$LIBS # XXX LIBS="$LIBS -lm" @@ -27111,7 +28090,7 @@ $as_echo_n "checking for isfinite with ... " >&6; } #include int -main () +main (void) { float f = 0.0; @@ -27122,58 +28101,99 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ans=yes -else +else $as_nop ans=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$_libs - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } case "$ans" in yes) - $as_echo "#define HAVE_ISFINITE 1" >>confdefs.h + printf "%s\n" "#define HAVE_ISFINITE 1" >>confdefs.h esac fi -done +done fi + done - -for ac_func in fnmatch getbootfile getuid getrusage nanosleep strsignal -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "fnmatch" "ac_cv_func_fnmatch" +if test "x$ac_cv_func_fnmatch" = xyes +then : + printf "%s\n" "#define HAVE_FNMATCH 1" >>confdefs.h fi -done +ac_fn_c_check_func "$LINENO" "getbootfile" "ac_cv_func_getbootfile" +if test "x$ac_cv_func_getbootfile" = xyes +then : + printf "%s\n" "#define HAVE_GETBOOTFILE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getuid" "ac_cv_func_getuid" +if test "x$ac_cv_func_getuid" = xyes +then : + printf "%s\n" "#define HAVE_GETUID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getrusage" "ac_cv_func_getrusage" +if test "x$ac_cv_func_getrusage" = xyes +then : + printf "%s\n" "#define HAVE_GETRUSAGE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep" +if test "x$ac_cv_func_nanosleep" = xyes +then : + printf "%s\n" "#define HAVE_NANOSLEEP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strsignal" "ac_cv_func_strsignal" +if test "x$ac_cv_func_strsignal" = xyes +then : + printf "%s\n" "#define HAVE_STRSIGNAL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strsignal" "ac_cv_func_strsignal" +if test "x$ac_cv_func_strsignal" = xyes +then : + printf "%s\n" "#define HAVE_STRSIGNAL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "closefrom" "ac_cv_func_closefrom" +if test "x$ac_cv_func_closefrom" = xyes +then : + printf "%s\n" "#define HAVE_CLOSEFROM 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getdtablesize" "ac_cv_func_getdtablesize" +if test "x$ac_cv_func_getdtablesize" = xyes +then : + printf "%s\n" "#define HAVE_GETDTABLESIZE 1" >>confdefs.h + +fi + # kvm_open() is only used by tickadj. Also see above. case "$ac_cv_header_kvm_h" in yes) - for ac_func in kvm_open -do : - ac_fn_c_check_func "$LINENO" "kvm_open" "ac_cv_func_kvm_open" -if test "x$ac_cv_func_kvm_open" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_KVM_OPEN 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "kvm_open" "ac_cv_func_kvm_open" +if test "x$ac_cv_func_kvm_open" = xyes +then : + printf "%s\n" "#define HAVE_KVM_OPEN 1" >>confdefs.h fi -done ;; esac @@ -27182,29 +28202,21 @@ case "$host" in *-*-sco3.2v5.0.*) # Just stubs. Sigh. ;; - *) for ac_func in mkstemp -do : - ac_fn_c_check_func "$LINENO" "mkstemp" "ac_cv_func_mkstemp" -if test "x$ac_cv_func_mkstemp" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MKSTEMP 1 -_ACEOF + *) ac_fn_c_check_func "$LINENO" "mkstemp" "ac_cv_func_mkstemp" +if test "x$ac_cv_func_mkstemp" = xyes +then : + printf "%s\n" "#define HAVE_MKSTEMP 1" >>confdefs.h fi -done ;; esac -for ac_func in mktime -do : - ac_fn_c_check_func "$LINENO" "mktime" "ac_cv_func_mktime" -if test "x$ac_cv_func_mktime" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MKTIME 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "mktime" "ac_cv_func_mktime" +if test "x$ac_cv_func_mktime" = xyes +then : + printf "%s\n" "#define HAVE_MKTIME 1" >>confdefs.h fi -done case "$host" in *-*-aix[4-9]*) @@ -27227,53 +28239,122 @@ case "$host" in alpha*-dec-osf4*|alpha*-dec-osf5*) # mlockall is there, as a #define calling memlk via # Not easy to test for - cheat. - for ac_func in memlk + + for ac_func in memlk do : ac_fn_c_check_func "$LINENO" "memlk" "ac_cv_func_memlk" -if test "x$ac_cv_func_memlk" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MEMLK 1 -_ACEOF +if test "x$ac_cv_func_memlk" = xyes +then : + printf "%s\n" "#define HAVE_MEMLK 1" >>confdefs.h ac_cv_func_mlockall=yes fi -done - for ac_func in mlockall -do : - ac_fn_c_check_func "$LINENO" "mlockall" "ac_cv_func_mlockall" -if test "x$ac_cv_func_mlockall" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MLOCKALL 1 -_ACEOF +done + ac_fn_c_check_func "$LINENO" "mlockall" "ac_cv_func_mlockall" +if test "x$ac_cv_func_mlockall" = xyes +then : + printf "%s\n" "#define HAVE_MLOCKALL 1" >>confdefs.h fi -done ;; - *) for ac_func in mlockall -do : - ac_fn_c_check_func "$LINENO" "mlockall" "ac_cv_func_mlockall" -if test "x$ac_cv_func_mlockall" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MLOCKALL 1 -_ACEOF + *) ac_fn_c_check_func "$LINENO" "mlockall" "ac_cv_func_mlockall" +if test "x$ac_cv_func_mlockall" = xyes +then : + printf "%s\n" "#define HAVE_MLOCKALL 1" >>confdefs.h fi -done ;; esac -for ac_func in nice plock pututline pututxline readlink rtprio -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "nice" "ac_cv_func_nice" +if test "x$ac_cv_func_nice" = xyes +then : + printf "%s\n" "#define HAVE_NICE 1" >>confdefs.h fi -done +ac_fn_c_check_func "$LINENO" "plock" "ac_cv_func_plock" +if test "x$ac_cv_func_plock" = xyes +then : + printf "%s\n" "#define HAVE_PLOCK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pututline" "ac_cv_func_pututline" +if test "x$ac_cv_func_pututline" = xyes +then : + printf "%s\n" "#define HAVE_PUTUTLINE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pututxline" "ac_cv_func_pututxline" +if test "x$ac_cv_func_pututxline" = xyes +then : + printf "%s\n" "#define HAVE_PUTUTXLINE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "readlink" "ac_cv_func_readlink" +if test "x$ac_cv_func_readlink" = xyes +then : + printf "%s\n" "#define HAVE_READLINK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "rtprio" "ac_cv_func_rtprio" +if test "x$ac_cv_func_rtprio" = xyes +then : + printf "%s\n" "#define HAVE_RTPRIO 1" >>confdefs.h + +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a POSIX-2008 compliant realpath()" >&5 +printf %s "checking for a POSIX-2008 compliant realpath()... " >&6; } + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + if test "$cross_compiling" = yes +then : + ans="CROSS COMPILE!" + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + int main() { return (NULL == realpath(".", NULL)); } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ans="yes" +else $as_nop + ans="no" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } + case "$ans" in + yes) + +printf "%s\n" "#define HAVE_FUNC_POSIX_REALPATH 1" >>confdefs.h + + ;; + esac + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + case "$host" in *-*-aix[4-9]*) @@ -27283,42 +28364,82 @@ case "$host" in *-*-solaris2.5*) # Just stubs in solaris2.5. Sigh. ;; - *) for ac_func in sched_setscheduler -do : - ac_fn_c_check_func "$LINENO" "sched_setscheduler" "ac_cv_func_sched_setscheduler" -if test "x$ac_cv_func_sched_setscheduler" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SCHED_SETSCHEDULER 1 -_ACEOF + *) ac_fn_c_check_func "$LINENO" "sched_setscheduler" "ac_cv_func_sched_setscheduler" +if test "x$ac_cv_func_sched_setscheduler" = xyes +then : + printf "%s\n" "#define HAVE_SCHED_SETSCHEDULER 1" >>confdefs.h fi -done ;; esac -for ac_func in setlinebuf setpgid setpriority setsid setvbuf -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "setlinebuf" "ac_cv_func_setlinebuf" +if test "x$ac_cv_func_setlinebuf" = xyes +then : + printf "%s\n" "#define HAVE_SETLINEBUF 1" >>confdefs.h fi -done - -for ac_func in strdup strnlen memchr strerror setrlimit strchr -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "setpgid" "ac_cv_func_setpgid" +if test "x$ac_cv_func_setpgid" = xyes +then : + printf "%s\n" "#define HAVE_SETPGID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setpriority" "ac_cv_func_setpriority" +if test "x$ac_cv_func_setpriority" = xyes +then : + printf "%s\n" "#define HAVE_SETPRIORITY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setsid" "ac_cv_func_setsid" +if test "x$ac_cv_func_setsid" = xyes +then : + printf "%s\n" "#define HAVE_SETSID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setvbuf" "ac_cv_func_setvbuf" +if test "x$ac_cv_func_setvbuf" = xyes +then : + printf "%s\n" "#define HAVE_SETVBUF 1" >>confdefs.h + +fi + +ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" +if test "x$ac_cv_func_strdup" = xyes +then : + printf "%s\n" "#define HAVE_STRDUP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strnlen" "ac_cv_func_strnlen" +if test "x$ac_cv_func_strnlen" = xyes +then : + printf "%s\n" "#define HAVE_STRNLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "memchr" "ac_cv_func_memchr" +if test "x$ac_cv_func_memchr" = xyes +then : + printf "%s\n" "#define HAVE_MEMCHR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" +if test "x$ac_cv_func_strerror" = xyes +then : + printf "%s\n" "#define HAVE_STRERROR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setrlimit" "ac_cv_func_setrlimit" +if test "x$ac_cv_func_setrlimit" = xyes +then : + printf "%s\n" "#define HAVE_SETRLIMIT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strchr" "ac_cv_func_strchr" +if test "x$ac_cv_func_strchr" = xyes +then : + printf "%s\n" "#define HAVE_STRCHR 1" >>confdefs.h fi -done case "$host" in *-*-aix[4-9]*) @@ -27335,27 +28456,24 @@ case "$host" in # Just stubs. Sigh. ;; *) - for ac_func in timer_create -do : - ac_fn_c_check_func "$LINENO" "timer_create" "ac_cv_func_timer_create" -if test "x$ac_cv_func_timer_create" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_TIMER_CREATE 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "timer_create" "ac_cv_func_timer_create" +if test "x$ac_cv_func_timer_create" = xyes +then : + printf "%s\n" "#define HAVE_TIMER_CREATE 1" >>confdefs.h fi -done ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RLIMIT_MEMLOCK" >&5 -$as_echo_n "checking for RLIMIT_MEMLOCK... " >&6; } -if ${ntp_cv_rlimit_memlock+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for RLIMIT_MEMLOCK" >&5 +printf %s "checking for RLIMIT_MEMLOCK... " >&6; } +if test ${ntp_cv_rlimit_memlock+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -27370,7 +28488,7 @@ else #endif int -main () +main (void) { getrlimit(RLIMIT_MEMLOCK, 0); @@ -27380,17 +28498,18 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_rlimit_memlock=yes -else +else $as_nop ntp_cv_rlimit_memlock=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_rlimit_memlock" >&5 -$as_echo "$ntp_cv_rlimit_memlock" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_rlimit_memlock" >&5 +printf "%s\n" "$ntp_cv_rlimit_memlock" >&6; } case "$host" in *-*-*linux*) ntp_dflt_rlimit_memlock="-1" ;; @@ -27402,11 +28521,12 @@ case "$ntp_cv_rlimit_memlock" in HAVE_RLIMIT_MEMLOCK=" memlock $ntp_dflt_rlimit_memlock" ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RLIMIT_STACK" >&5 -$as_echo_n "checking for RLIMIT_STACK... " >&6; } -if ${ntp_cv_rlimit_stack+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for RLIMIT_STACK" >&5 +printf %s "checking for RLIMIT_STACK... " >&6; } +if test ${ntp_cv_rlimit_stack+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -27421,7 +28541,7 @@ else #endif int -main () +main (void) { getrlimit(RLIMIT_STACK, 0); @@ -27431,17 +28551,18 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_rlimit_stack=yes -else +else $as_nop ntp_cv_rlimit_stack=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_rlimit_stack" >&5 -$as_echo "$ntp_cv_rlimit_stack" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_rlimit_stack" >&5 +printf "%s\n" "$ntp_cv_rlimit_stack" >&6; } case "$ntp_cv_rlimit_stack" in yes) @@ -27449,13 +28570,14 @@ case "$ntp_cv_rlimit_stack" in esac # HMS: Only if we are doing the MLOCKALL stuff... -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the default number of 4k stack pages" >&5 -$as_echo_n "checking for the default number of 4k stack pages... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the default number of 4k stack pages" >&5 +printf %s "checking for the default number of 4k stack pages... " >&6; } # Check whether --with-stack-limit was given. -if test "${with_stack_limit+set}" = set; then : +if test ${with_stack_limit+y} +then : withval=$with_stack_limit; ans=$withval -else +else $as_nop ans=yes fi @@ -27475,22 +28597,21 @@ case "$ans" in *) as_fn_error $? "\"--with-stack-limit requires an integer argument.\"" "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } -cat >>confdefs.h <<_ACEOF -#define DFLT_RLIMIT_STACK $ans -_ACEOF +printf "%s\n" "#define DFLT_RLIMIT_STACK $ans" >>confdefs.h # HMS: only if we have RLIMIT_MEMLOCK -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the default number of megabytes to MEMLOCK" >&5 -$as_echo_n "checking for the default number of megabytes to MEMLOCK... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the default number of megabytes to MEMLOCK" >&5 +printf %s "checking for the default number of megabytes to MEMLOCK... " >&6; } # Check whether --with-memlock was given. -if test "${with_memlock+set}" = set; then : +if test ${with_memlock+y} +then : withval=$with_memlock; ans=$withval -else +else $as_nop ans=yes fi @@ -27503,27 +28624,21 @@ case "$ans" in *) as_fn_error $? "\"--with-memlock requires an integer argument.\"" "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } -cat >>confdefs.h <<_ACEOF -#define DFLT_RLIMIT_MEMLOCK $ans -_ACEOF +printf "%s\n" "#define DFLT_RLIMIT_MEMLOCK $ans" >>confdefs.h # some OSes prefer _exit() in forked children to exit() -for ac_func in _exit -do : - ac_fn_c_check_func "$LINENO" "_exit" "ac_cv_func__exit" -if test "x$ac_cv_func__exit" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE__EXIT 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "_exit" "ac_cv_func__exit" +if test "x$ac_cv_func__exit" = xyes +then : + printf "%s\n" "#define HAVE__EXIT 1" >>confdefs.h fi -done ntp_worker_child_exit=exit case "$ac_cv_func__exit::$host_os" in @@ -27535,22 +28650,33 @@ case "$ac_cv_func__exit::$host_os" in ;; esac -cat >>confdefs.h <<_ACEOF -#define WORKER_CHILD_EXIT $ntp_worker_child_exit -_ACEOF +printf "%s\n" "#define WORKER_CHILD_EXIT $ntp_worker_child_exit" >>confdefs.h -for ac_func in umask uname updwtmp updwtmpx -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "umask" "ac_cv_func_umask" +if test "x$ac_cv_func_umask" = xyes +then : + printf "%s\n" "#define HAVE_UMASK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "uname" "ac_cv_func_uname" +if test "x$ac_cv_func_uname" = xyes +then : + printf "%s\n" "#define HAVE_UNAME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "updwtmp" "ac_cv_func_updwtmp" +if test "x$ac_cv_func_updwtmp" = xyes +then : + printf "%s\n" "#define HAVE_UPDWTMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "updwtmpx" "ac_cv_func_updwtmpx" +if test "x$ac_cv_func_updwtmpx" = xyes +then : + printf "%s\n" "#define HAVE_UPDWTMPX 1" >>confdefs.h fi -done ### @@ -27558,11 +28684,12 @@ done # http://bugs.ntp.org/737 case "$ac_cv_func_recvmsg" in yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need extra help to define struct iovec" >&5 -$as_echo_n "checking if we need extra help to define struct iovec... " >&6; } -if ${ntp_cv_struct_iovec_help+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we need extra help to define struct iovec" >&5 +printf %s "checking if we need extra help to define struct iovec... " >&6; } +if test ${ntp_cv_struct_iovec_help+y} +then : + printf %s "(cached) " >&6 +else $as_nop compiled=no for ntp_cv_struct_iovec_help in '0' '1'; do @@ -27580,7 +28707,7 @@ else #endif int -main () +main (void) { void foo(void) { @@ -27599,10 +28726,11 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : compiled=yes ; break 1 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done case "$compiled" in no) @@ -27612,21 +28740,22 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_iovec_help" >&5 -$as_echo "$ntp_cv_struct_iovec_help" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_iovec_help" >&5 +printf "%s\n" "$ntp_cv_struct_iovec_help" >&6; } case "$ntp_cv_struct_iovec_help" in 1) -$as_echo "#define HAVE_SYS_UIO_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYS_UIO_H 1" >>confdefs.h esac esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking number of arguments taken by setpgrp()" >&5 -$as_echo_n "checking number of arguments taken by setpgrp()... " >&6; } -if ${ntp_cv_func_setpgrp_nargs+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking number of arguments taken by setpgrp()" >&5 +printf %s "checking number of arguments taken by setpgrp()... " >&6; } +if test ${ntp_cv_func_setpgrp_nargs+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -27638,7 +28767,7 @@ else #endif int -main () +main (void) { setpgrp(0, 0); @@ -27648,29 +28777,31 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_func_setpgrp_nargs=2 -else +else $as_nop ntp_cv_func_setpgrp_nargs=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_func_setpgrp_nargs" >&5 -$as_echo "$ntp_cv_func_setpgrp_nargs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_func_setpgrp_nargs" >&5 +printf "%s\n" "$ntp_cv_func_setpgrp_nargs" >&6; } case "$ntp_cv_func_setpgrp_nargs" in 0) -$as_echo "#define HAVE_SETPGRP_0 1" >>confdefs.h +printf "%s\n" "#define HAVE_SETPGRP_0 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to declare 'errno'" >&5 -$as_echo_n "checking if we need to declare 'errno'... " >&6; } -if ${ntp_cv_decl_errno+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we need to declare 'errno'" >&5 +printf %s "checking if we need to declare 'errno'... " >&6; } +if test ${ntp_cv_decl_errno+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -27679,7 +28810,7 @@ else #endif int -main () +main (void) { errno = 0; @@ -27689,29 +28820,31 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_decl_errno=no -else +else $as_nop ntp_cv_decl_errno=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_decl_errno" >&5 -$as_echo "$ntp_cv_decl_errno" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_decl_errno" >&5 +printf "%s\n" "$ntp_cv_decl_errno" >&6; } case "$ntp_cv_decl_errno" in yes) -$as_echo "#define DECL_ERRNO 1" >>confdefs.h +printf "%s\n" "#define DECL_ERRNO 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we may declare 'h_errno'" >&5 -$as_echo_n "checking if we may declare 'h_errno'... " >&6; } -if ${ntp_cv_decl_h_errno+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we may declare 'h_errno'" >&5 +printf %s "checking if we may declare 'h_errno'... " >&6; } +if test ${ntp_cv_decl_h_errno+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -27730,7 +28863,7 @@ else #endif int -main () +main (void) { extern int h_errno; @@ -27740,29 +28873,31 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_decl_h_errno=yes -else +else $as_nop ntp_cv_decl_h_errno=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_decl_h_errno" >&5 -$as_echo "$ntp_cv_decl_h_errno" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_decl_h_errno" >&5 +printf "%s\n" "$ntp_cv_decl_h_errno" >&6; } case "$ntp_cv_decl_h_errno" in yes) -$as_echo "#define DECL_H_ERRNO 1" >>confdefs.h +printf "%s\n" "#define DECL_H_ERRNO 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if declaring 'syscall()' is ok" >&5 -$as_echo_n "checking if declaring 'syscall()' is ok... " >&6; } -if ${ntp_cv_decl_syscall+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if declaring 'syscall()' is ok" >&5 +printf %s "checking if declaring 'syscall()' is ok... " >&6; } +if test ${ntp_cv_decl_syscall+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -27774,7 +28909,7 @@ else #endif int -main () +main (void) { extern int syscall (int, ...); @@ -27783,242 +28918,244 @@ main () ; return 0; } - ntp_cv_decl_syscall=yes _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : + ntp_cv_decl_syscall=yes +else $as_nop ntp_cv_decl_syscall=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_decl_syscall" >&5 -$as_echo "$ntp_cv_decl_syscall" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_decl_syscall" >&5 +printf "%s\n" "$ntp_cv_decl_syscall" >&6; } case "$ntp_cv_decl_syscall" in yes) -$as_echo "#define DECL_SYSCALL 1" >>confdefs.h +printf "%s\n" "#define DECL_SYSCALL 1" >>confdefs.h esac case "$host" in *-*-aix4.3.*) -$as_echo "#define DECL_HSTRERROR_0 1" >>confdefs.h +printf "%s\n" "#define DECL_HSTRERROR_0 1" >>confdefs.h # Needed for XLC under AIX 4.3.2 ;; *-*-mpeix*) -$as_echo "#define DECL_ADJTIME_0 1" >>confdefs.h +printf "%s\n" "#define DECL_ADJTIME_0 1" >>confdefs.h -$as_echo "#define DECL_INET_NTOA_0 1" >>confdefs.h +printf "%s\n" "#define DECL_INET_NTOA_0 1" >>confdefs.h -$as_echo "#define DECL_MKTEMP_0 1" >>confdefs.h +printf "%s\n" "#define DECL_MKTEMP_0 1" >>confdefs.h -$as_echo "#define DECL_SELECT_0 1" >>confdefs.h +printf "%s\n" "#define DECL_SELECT_0 1" >>confdefs.h -$as_echo "#define DECL_SETITIMER_0 1" >>confdefs.h +printf "%s\n" "#define DECL_SETITIMER_0 1" >>confdefs.h -$as_echo "#define DECL_SYSLOG_0 1" >>confdefs.h +printf "%s\n" "#define DECL_SYSLOG_0 1" >>confdefs.h -$as_echo "#define DECL_TIMEOFDAY_0 1" >>confdefs.h +printf "%s\n" "#define DECL_TIMEOFDAY_0 1" >>confdefs.h ;; *-*-osf[45]*) -$as_echo "#define DECL_PLOCK_0 1" >>confdefs.h +printf "%s\n" "#define DECL_PLOCK_0 1" >>confdefs.h -$as_echo "#define DECL_STIME_1 1" >>confdefs.h +printf "%s\n" "#define DECL_STIME_1 1" >>confdefs.h ;; *-*-qnx*) -$as_echo "#define DECL_ADJTIME_0 1" >>confdefs.h +printf "%s\n" "#define DECL_ADJTIME_0 1" >>confdefs.h ;; *-*-riscos4*) -$as_echo "#define DECL_ADJTIME_0 1" >>confdefs.h +printf "%s\n" "#define DECL_ADJTIME_0 1" >>confdefs.h -$as_echo "#define DECL_BZERO_0 1" >>confdefs.h +printf "%s\n" "#define DECL_BZERO_0 1" >>confdefs.h -$as_echo "#define DECL_IOCTL_0 1" >>confdefs.h +printf "%s\n" "#define DECL_IOCTL_0 1" >>confdefs.h -$as_echo "#define DECL_IPC_0 1" >>confdefs.h +printf "%s\n" "#define DECL_IPC_0 1" >>confdefs.h -$as_echo "#define DECL_MEMMOVE_0 1" >>confdefs.h +printf "%s\n" "#define DECL_MEMMOVE_0 1" >>confdefs.h -$as_echo "#define DECL_MKTEMP_0 1" >>confdefs.h +printf "%s\n" "#define DECL_MKTEMP_0 1" >>confdefs.h -$as_echo "#define DECL_RENAME_0 1" >>confdefs.h +printf "%s\n" "#define DECL_RENAME_0 1" >>confdefs.h -$as_echo "#define DECL_SELECT_0 1" >>confdefs.h +printf "%s\n" "#define DECL_SELECT_0 1" >>confdefs.h -$as_echo "#define DECL_SETITIMER_0 1" >>confdefs.h +printf "%s\n" "#define DECL_SETITIMER_0 1" >>confdefs.h -$as_echo "#define DECL_SETPRIORITY_0 1" >>confdefs.h +printf "%s\n" "#define DECL_SETPRIORITY_0 1" >>confdefs.h -$as_echo "#define DECL_STDIO_0 1" >>confdefs.h +printf "%s\n" "#define DECL_STDIO_0 1" >>confdefs.h -$as_echo "#define DECL_STRTOL_0 1" >>confdefs.h +printf "%s\n" "#define DECL_STRTOL_0 1" >>confdefs.h -$as_echo "#define DECL_SYSLOG_0 1" >>confdefs.h +printf "%s\n" "#define DECL_SYSLOG_0 1" >>confdefs.h -$as_echo "#define DECL_TIME_0 1" >>confdefs.h +printf "%s\n" "#define DECL_TIME_0 1" >>confdefs.h -$as_echo "#define DECL_TIMEOFDAY_0 1" >>confdefs.h +printf "%s\n" "#define DECL_TIMEOFDAY_0 1" >>confdefs.h -$as_echo "#define DECL_TOLOWER_0 1" >>confdefs.h +printf "%s\n" "#define DECL_TOLOWER_0 1" >>confdefs.h ;; *-*-solaris2*) -$as_echo "#define DECL_MKSTEMP_0 1" >>confdefs.h +printf "%s\n" "#define DECL_MKSTEMP_0 1" >>confdefs.h -$as_echo "#define DECL_SETPRIORITY_1 1" >>confdefs.h +printf "%s\n" "#define DECL_SETPRIORITY_1 1" >>confdefs.h case "$host" in *-*-solaris2.4) -$as_echo "#define DECL_TIMEOFDAY_0 1" >>confdefs.h +printf "%s\n" "#define DECL_TIMEOFDAY_0 1" >>confdefs.h ;; esac ;; *-*-sunos4*) -$as_echo "#define DECL_ADJTIME_0 1" >>confdefs.h +printf "%s\n" "#define DECL_ADJTIME_0 1" >>confdefs.h -$as_echo "#define DECL_BCOPY_0 1" >>confdefs.h +printf "%s\n" "#define DECL_BCOPY_0 1" >>confdefs.h -$as_echo "#define DECL_BZERO_0 1" >>confdefs.h +printf "%s\n" "#define DECL_BZERO_0 1" >>confdefs.h -$as_echo "#define DECL_IOCTL_0 1" >>confdefs.h +printf "%s\n" "#define DECL_IOCTL_0 1" >>confdefs.h -$as_echo "#define DECL_IPC_0 1" >>confdefs.h +printf "%s\n" "#define DECL_IPC_0 1" >>confdefs.h -$as_echo "#define DECL_MEMMOVE_0 1" >>confdefs.h +printf "%s\n" "#define DECL_MEMMOVE_0 1" >>confdefs.h -$as_echo "#define DECL_MKTEMP_0 1" >>confdefs.h +printf "%s\n" "#define DECL_MKTEMP_0 1" >>confdefs.h -$as_echo "#define DECL_MKSTEMP_0 1" >>confdefs.h +printf "%s\n" "#define DECL_MKSTEMP_0 1" >>confdefs.h -$as_echo "#define DECL_RENAME_0 1" >>confdefs.h +printf "%s\n" "#define DECL_RENAME_0 1" >>confdefs.h -$as_echo "#define DECL_SELECT_0 1" >>confdefs.h +printf "%s\n" "#define DECL_SELECT_0 1" >>confdefs.h -$as_echo "#define DECL_SETITIMER_0 1" >>confdefs.h +printf "%s\n" "#define DECL_SETITIMER_0 1" >>confdefs.h -$as_echo "#define DECL_SETPRIORITY_0 1" >>confdefs.h +printf "%s\n" "#define DECL_SETPRIORITY_0 1" >>confdefs.h -$as_echo "#define DECL_SIGVEC_0 1" >>confdefs.h +printf "%s\n" "#define DECL_SIGVEC_0 1" >>confdefs.h case "`basename $ac_cv_prog_CC`" in acc*) ;; *) -$as_echo "#define DECL_STDIO_0 1" >>confdefs.h +printf "%s\n" "#define DECL_STDIO_0 1" >>confdefs.h ;; esac -$as_echo "#define DECL_STRTOL_0 1" >>confdefs.h +printf "%s\n" "#define DECL_STRTOL_0 1" >>confdefs.h -$as_echo "#define DECL_SYSLOG_0 1" >>confdefs.h +printf "%s\n" "#define DECL_SYSLOG_0 1" >>confdefs.h -$as_echo "#define DECL_TIME_0 1" >>confdefs.h +printf "%s\n" "#define DECL_TIME_0 1" >>confdefs.h -$as_echo "#define DECL_TIMEOFDAY_0 1" >>confdefs.h +printf "%s\n" "#define DECL_TIMEOFDAY_0 1" >>confdefs.h -$as_echo "#define DECL_TOLOWER_0 1" >>confdefs.h +printf "%s\n" "#define DECL_TOLOWER_0 1" >>confdefs.h -$as_echo "#define DECL_TOUPPER_0 1" >>confdefs.h +printf "%s\n" "#define DECL_TOUPPER_0 1" >>confdefs.h -$as_echo "#define DECL_STRERROR_0 1" >>confdefs.h +printf "%s\n" "#define DECL_STRERROR_0 1" >>confdefs.h ;; *-*-ultrix4*) -$as_echo "#define DECL_ADJTIME_0 1" >>confdefs.h +printf "%s\n" "#define DECL_ADJTIME_0 1" >>confdefs.h -$as_echo "#define DECL_BZERO_0 1" >>confdefs.h +printf "%s\n" "#define DECL_BZERO_0 1" >>confdefs.h -$as_echo "#define DECL_CFSETISPEED_0 1" >>confdefs.h +printf "%s\n" "#define DECL_CFSETISPEED_0 1" >>confdefs.h -$as_echo "#define DECL_IOCTL_0 1" >>confdefs.h +printf "%s\n" "#define DECL_IOCTL_0 1" >>confdefs.h -$as_echo "#define DECL_IPC_0 1" >>confdefs.h +printf "%s\n" "#define DECL_IPC_0 1" >>confdefs.h -$as_echo "#define DECL_MKTEMP_0 1" >>confdefs.h +printf "%s\n" "#define DECL_MKTEMP_0 1" >>confdefs.h -$as_echo "#define DECL_NLIST_0 1" >>confdefs.h +printf "%s\n" "#define DECL_NLIST_0 1" >>confdefs.h -$as_echo "#define DECL_PLOCK_0 1" >>confdefs.h +printf "%s\n" "#define DECL_PLOCK_0 1" >>confdefs.h -$as_echo "#define DECL_SELECT_0 1" >>confdefs.h +printf "%s\n" "#define DECL_SELECT_0 1" >>confdefs.h -$as_echo "#define DECL_SETITIMER_0 1" >>confdefs.h +printf "%s\n" "#define DECL_SETITIMER_0 1" >>confdefs.h -$as_echo "#define DECL_SETPRIORITY_0 1" >>confdefs.h +printf "%s\n" "#define DECL_SETPRIORITY_0 1" >>confdefs.h -$as_echo "#define DECL_STIME_0 1" >>confdefs.h +printf "%s\n" "#define DECL_STIME_0 1" >>confdefs.h -$as_echo "#define DECL_SYSLOG_0 1" >>confdefs.h +printf "%s\n" "#define DECL_SYSLOG_0 1" >>confdefs.h -$as_echo "#define DECL_TIMEOFDAY_0 1" >>confdefs.h +printf "%s\n" "#define DECL_TIMEOFDAY_0 1" >>confdefs.h ;; esac @@ -28026,7 +29163,7 @@ esac case "$host" in *-*-sco3.2*) -$as_echo "#define TERMIOS_NEEDS__SVID3 1" >>confdefs.h +printf "%s\n" "#define TERMIOS_NEEDS__SVID3 1" >>confdefs.h ;; esac @@ -28034,15 +29171,16 @@ esac case "$host" in *-*-hpux[567]*) -$as_echo "#define NEED_RCVBUF_SLOP 1" >>confdefs.h +printf "%s\n" "#define NEED_RCVBUF_SLOP 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we will open the broadcast socket" >&5 -$as_echo_n "checking if we will open the broadcast socket... " >&6; } -if ${ntp_cv_var_open_bcast_socket+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we will open the broadcast socket" >&5 +printf %s "checking if we will open the broadcast socket... " >&6; } +if test ${ntp_cv_var_open_bcast_socket+y} +then : + printf %s "(cached) " >&6 +else $as_nop ans=yes case "$host" in @@ -28053,27 +29191,28 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_open_bcast_socket" >&5 -$as_echo "$ntp_cv_var_open_bcast_socket" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_open_bcast_socket" >&5 +printf "%s\n" "$ntp_cv_var_open_bcast_socket" >&6; } case "$ntp_cv_var_open_bcast_socket" in yes) -$as_echo "#define OPEN_BCAST_SOCKET 1" >>confdefs.h +printf "%s\n" "#define OPEN_BCAST_SOCKET 1" >>confdefs.h esac case "$host" in *-*-hpux*) -$as_echo "#define NEED_HPUX_FINDCONFIG 1" >>confdefs.h +printf "%s\n" "#define NEED_HPUX_FINDCONFIG 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if process groups are set with -pid" >&5 -$as_echo_n "checking if process groups are set with -pid... " >&6; } -if ${ntp_cv_arg_setpgrp_negpid+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if process groups are set with -pid" >&5 +printf %s "checking if process groups are set with -pid... " >&6; } +if test ${ntp_cv_arg_setpgrp_negpid+y} +then : + printf %s "(cached) " >&6 +else $as_nop case "$host" in *-*-hpux[567]*) @@ -28099,20 +29238,21 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_arg_setpgrp_negpid" >&5 -$as_echo "$ntp_cv_arg_setpgrp_negpid" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_arg_setpgrp_negpid" >&5 +printf "%s\n" "$ntp_cv_arg_setpgrp_negpid" >&6; } case "$ntp_cv_arg_setpgrp_negpid" in yes) -$as_echo "#define UDP_BACKWARDS_SETOWN 1" >>confdefs.h +printf "%s\n" "#define UDP_BACKWARDS_SETOWN 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need a ctty for F_SETOWN" >&5 -$as_echo_n "checking if we need a ctty for F_SETOWN... " >&6; } -if ${ntp_cv_func_ctty_for_f_setown+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we need a ctty for F_SETOWN" >&5 +printf %s "checking if we need a ctty for F_SETOWN... " >&6; } +if test ${ntp_cv_func_ctty_for_f_setown+y} +then : + printf %s "(cached) " >&6 +else $as_nop case "$host" in *-*-bsdi[23]*) @@ -28148,20 +29288,21 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_func_ctty_for_f_setown" >&5 -$as_echo "$ntp_cv_func_ctty_for_f_setown" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_func_ctty_for_f_setown" >&5 +printf "%s\n" "$ntp_cv_func_ctty_for_f_setown" >&6; } case "$ntp_cv_func_ctty_for_f_setown" in yes) -$as_echo "#define USE_FSETOWNCTTY 1" >>confdefs.h +printf "%s\n" "#define USE_FSETOWNCTTY 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the OS clears cached routes when more specifics become available" >&5 -$as_echo_n "checking if the OS clears cached routes when more specifics become available... " >&6; } -if ${ntp_cv_os_routeupdates+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the OS clears cached routes when more specifics become available" >&5 +printf %s "checking if the OS clears cached routes when more specifics become available... " >&6; } +if test ${ntp_cv_os_routeupdates+y} +then : + printf %s "(cached) " >&6 +else $as_nop case "$host" in *-*-netbsd*) @@ -28175,20 +29316,21 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_os_routeupdates" >&5 -$as_echo "$ntp_cv_os_routeupdates" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_os_routeupdates" >&5 +printf "%s\n" "$ntp_cv_os_routeupdates" >&6; } case "$ntp_cv_os_routeupdates" in yes) -$as_echo "#define OS_MISSES_SPECIFIC_ROUTE_UPDATES 1" >>confdefs.h +printf "%s\n" "#define OS_MISSES_SPECIFIC_ROUTE_UPDATES 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the wildcard socket needs REUSEADDR to bind other addresses" >&5 -$as_echo_n "checking if the wildcard socket needs REUSEADDR to bind other addresses... " >&6; } -if ${ntp_cv_os_wildcardreuse+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the wildcard socket needs REUSEADDR to bind other addresses" >&5 +printf %s "checking if the wildcard socket needs REUSEADDR to bind other addresses... " >&6; } +if test ${ntp_cv_os_wildcardreuse+y} +then : + printf %s "(cached) " >&6 +else $as_nop case "$host" in *-*-*linux*) @@ -28201,27 +29343,28 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_os_wildcardreuse" >&5 -$as_echo "$ntp_cv_os_wildcardreuse" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_os_wildcardreuse" >&5 +printf "%s\n" "$ntp_cv_os_wildcardreuse" >&6; } case "$ntp_cv_os_wildcardreuse" in yes) -$as_echo "#define OS_NEEDS_REUSEADDR_FOR_IFADDRBIND 1" >>confdefs.h +printf "%s\n" "#define OS_NEEDS_REUSEADDR_FOR_IFADDRBIND 1" >>confdefs.h esac case "$host" in *-*-aix*) -$as_echo "#define NLIST_EXTRA_INDIRECTION 1" >>confdefs.h +printf "%s\n" "#define NLIST_EXTRA_INDIRECTION 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a minimum recommended value of tickadj" >&5 -$as_echo_n "checking for a minimum recommended value of tickadj... " >&6; } -if ${ntp_cv_var_min_rec_tickadj+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a minimum recommended value of tickadj" >&5 +printf %s "checking for a minimum recommended value of tickadj... " >&6; } +if test ${ntp_cv_var_min_rec_tickadj+y} +then : + printf %s "(cached) " >&6 +else $as_nop ans=no case "$host" in @@ -28233,24 +29376,23 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_min_rec_tickadj" >&5 -$as_echo "$ntp_cv_var_min_rec_tickadj" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_min_rec_tickadj" >&5 +printf "%s\n" "$ntp_cv_var_min_rec_tickadj" >&6; } case "$ntp_cv_var_min_rec_tickadj" in ''|no) ;; *) -cat >>confdefs.h <<_ACEOF -#define MIN_REC_TICKADJ $ntp_cv_var_min_rec_tickadj -_ACEOF +printf "%s\n" "#define MIN_REC_TICKADJ $ntp_cv_var_min_rec_tickadj" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the TTY code permits PARENB and IGNPAR" >&5 -$as_echo_n "checking if the TTY code permits PARENB and IGNPAR... " >&6; } -if ${ntp_cv_no_parenb_ignpar+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the TTY code permits PARENB and IGNPAR" >&5 +printf %s "checking if the TTY code permits PARENB and IGNPAR... " >&6; } +if test ${ntp_cv_no_parenb_ignpar+y} +then : + printf %s "(cached) " >&6 +else $as_nop ans=no case "$host" in @@ -28273,21 +29415,22 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_no_parenb_ignpar" >&5 -$as_echo "$ntp_cv_no_parenb_ignpar" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_no_parenb_ignpar" >&5 +printf "%s\n" "$ntp_cv_no_parenb_ignpar" >&6; } case "$ntp_cv_no_parenb_ignpar" in yes) -$as_echo "#define NO_PARENB_IGNPAR 1" >>confdefs.h +printf "%s\n" "#define NO_PARENB_IGNPAR 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we're including processing time debugging code" >&5 -$as_echo_n "checking if we're including processing time debugging code... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we're including processing time debugging code" >&5 +printf %s "checking if we're including processing time debugging code... " >&6; } # Check whether --enable-debug-timing was given. -if test "${enable_debug_timing+set}" = set; then : +if test ${enable_debug_timing+y} +then : enableval=$enable_debug_timing; ntp_ok=$enableval -else +else $as_nop ntp_ok=no fi @@ -28295,36 +29438,36 @@ fi case "$ntp_ok" in yes) -$as_echo "#define DEBUG_TIMING 1" >>confdefs.h +printf "%s\n" "#define DEBUG_TIMING 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a the number of minutes in a DST adjustment" >&5 -$as_echo_n "checking for a the number of minutes in a DST adjustment... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a the number of minutes in a DST adjustment" >&5 +printf %s "checking for a the number of minutes in a DST adjustment... " >&6; } # Check whether --enable-dst-minutes was given. -if test "${enable_dst_minutes+set}" = set; then : +if test ${enable_dst_minutes+y} +then : enableval=$enable_dst_minutes; ans=$enableval -else +else $as_nop ans=60 fi -cat >>confdefs.h <<_ACEOF -#define DSTMINUTES $ans -_ACEOF +printf "%s\n" "#define DSTMINUTES $ans" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if ntpd will retry permanent DNS failures" >&5 -$as_echo_n "checking if ntpd will retry permanent DNS failures... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ntpd will retry permanent DNS failures" >&5 +printf %s "checking if ntpd will retry permanent DNS failures... " >&6; } # Check whether --enable-ignore-dns-errors was given. -if test "${enable_ignore_dns_errors+set}" = set; then : +if test ${enable_ignore_dns_errors+y} +then : enableval=$enable_ignore_dns_errors; ans=$enableval -else +else $as_nop ans=no fi @@ -28332,17 +29475,18 @@ fi case "$ans" in yes) -$as_echo "#define IGNORE_DNS_ERRORS 1" >>confdefs.h +printf "%s\n" "#define IGNORE_DNS_ERRORS 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking availability of ntp_{adj,get}time()" >&5 -$as_echo_n "checking availability of ntp_{adj,get}time()... " >&6; } -if ${ntp_cv_var_ntp_syscalls+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking availability of ntp_{adj,get}time()" >&5 +printf %s "checking availability of ntp_{adj,get}time()... " >&6; } +if test ${ntp_cv_var_ntp_syscalls+y} +then : + printf %s "(cached) " >&6 +else $as_nop ntp_cv_var_ntp_syscalls=no case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime$ac_cv_func___adjtimex" in @@ -28362,7 +29506,8 @@ else #endif _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : ntp_cv_var_ntp_syscalls=kernel fi @@ -28372,26 +29517,27 @@ rm -f conftest.err conftest.i conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_ntp_syscalls" >&5 -$as_echo "$ntp_cv_var_ntp_syscalls" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_ntp_syscalls" >&5 +printf "%s\n" "$ntp_cv_var_ntp_syscalls" >&6; } case "$ntp_cv_var_ntp_syscalls" in libc) -$as_echo "#define NTP_SYSCALLS_LIBC 1" >>confdefs.h +printf "%s\n" "#define NTP_SYSCALLS_LIBC 1" >>confdefs.h ;; kernel) -$as_echo "#define NTP_SYSCALLS_STD 1" >>confdefs.h +printf "%s\n" "#define NTP_SYSCALLS_STD 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if sys/timex.h has STA_FLL" >&5 -$as_echo_n "checking if sys/timex.h has STA_FLL... " >&6; } -if ${ntp_cv_var_sta_fll+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sys/timex.h has STA_FLL" >&5 +printf %s "checking if sys/timex.h has STA_FLL... " >&6; } +if test ${ntp_cv_var_sta_fll+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -28401,23 +29547,25 @@ else #endif _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : ntp_cv_var_sta_fll=yes -else +else $as_nop ntp_cv_var_sta_fll=no fi rm -f conftest.err conftest.i conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_sta_fll" >&5 -$as_echo "$ntp_cv_var_sta_fll" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_sta_fll" >&5 +printf "%s\n" "$ntp_cv_var_sta_fll" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have kernel PLL support" >&5 -$as_echo_n "checking if we have kernel PLL support... " >&6; } -if ${ntp_cv_var_kernel_pll+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we have kernel PLL support" >&5 +printf %s "checking if we have kernel PLL support... " >&6; } +if test ${ntp_cv_var_kernel_pll+y} +then : + printf %s "(cached) " >&6 +else $as_nop case "$ac_cv_header_sys_timex_h$ntp_cv_struct_ntptimeval$ntp_cv_var_sta_fll$ntp_cv_var_ntp_syscalls" in *no*) ntp_cv_var_kernel_pll=no @@ -28428,20 +29576,21 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_kernel_pll" >&5 -$as_echo "$ntp_cv_var_kernel_pll" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_kernel_pll" >&5 +printf "%s\n" "$ntp_cv_var_kernel_pll" >&6; } case "$ntp_cv_var_kernel_pll" in yes) -$as_echo "#define KERNEL_PLL 1" >>confdefs.h +printf "%s\n" "#define KERNEL_PLL 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if SIOCGIFCONF returns buffer size in the buffer" >&5 -$as_echo_n "checking if SIOCGIFCONF returns buffer size in the buffer... " >&6; } -if ${ntp_cv_size_returned_in_buffer+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if SIOCGIFCONF returns buffer size in the buffer" >&5 +printf %s "checking if SIOCGIFCONF returns buffer size in the buffer... " >&6; } +if test ${ntp_cv_size_returned_in_buffer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ans=no case "$host" in @@ -28459,18 +29608,18 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_size_returned_in_buffer" >&5 -$as_echo "$ntp_cv_size_returned_in_buffer" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_size_returned_in_buffer" >&5 +printf "%s\n" "$ntp_cv_size_returned_in_buffer" >&6; } case "$ntp_cv_size_returned_in_buffer" in yes) -$as_echo "#define SIZE_RETURNED_IN_BUFFER 1" >>confdefs.h +printf "%s\n" "#define SIZE_RETURNED_IN_BUFFER 1" >>confdefs.h esac # Check for ioctls TIOCGPPSEV -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TTY PPS ioctl TIOCGPPSEV" >&5 -$as_echo_n "checking for TTY PPS ioctl TIOCGPPSEV... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TTY PPS ioctl TIOCGPPSEV" >&5 +printf %s "checking for TTY PPS ioctl TIOCGPPSEV... " >&6; } case "$ac_cv_header_termios_h" in yes) cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28482,9 +29631,10 @@ case "$ac_cv_header_termios_h" in #endif _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : ntp_ok=yes -else +else $as_nop ntp_ok=no fi @@ -28497,15 +29647,15 @@ esac case "$ntp_ok" in yes) -$as_echo "#define HAVE_TIOCGPPSEV 1" >>confdefs.h +printf "%s\n" "#define HAVE_TIOCGPPSEV 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } # Check for ioctls TIOCSPPS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TTY PPS ioctl TIOCSPPS" >&5 -$as_echo_n "checking for TTY PPS ioctl TIOCSPPS... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TTY PPS ioctl TIOCSPPS" >&5 +printf %s "checking for TTY PPS ioctl TIOCSPPS... " >&6; } case "$ac_cv_header_termios_h" in yes) cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28517,9 +29667,10 @@ case "$ac_cv_header_termios_h" in #endif _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : ntp_ok=yes -else +else $as_nop ntp_ok=no fi @@ -28532,15 +29683,15 @@ esac case "$ntp_ok" in yes) -$as_echo "#define HAVE_TIOCSPPS 1" >>confdefs.h +printf "%s\n" "#define HAVE_TIOCSPPS 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } # Check for ioctls CIOGETEV -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TTY PPS ioctl CIOGETEV" >&5 -$as_echo_n "checking for TTY PPS ioctl CIOGETEV... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TTY PPS ioctl CIOGETEV" >&5 +printf %s "checking for TTY PPS ioctl CIOGETEV... " >&6; } case "$ac_cv_header_sys_ppsclock_h" in yes) cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28552,9 +29703,10 @@ case "$ac_cv_header_sys_ppsclock_h" in #endif _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : ntp_ok=yes -else +else $as_nop ntp_ok=no fi @@ -28567,11 +29719,11 @@ esac case "$ntp_ok" in yes) -$as_echo "#define HAVE_CIOGETEV 1" >>confdefs.h +printf "%s\n" "#define HAVE_CIOGETEV 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } # ATOM/PPSAPI stuff. @@ -28588,7 +29740,7 @@ case "$ac_cv_c_inline$ntp_cv_struct_timespec" in case "$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h$host_os" in *yes* | *sunos* | *solaris* | *sco* | *netbsd* ) -$as_echo "#define HAVE_PPSAPI 1" >>confdefs.h +printf "%s\n" "#define HAVE_PPSAPI 1" >>confdefs.h ntp_jupiter_ok=yes ntp_oncore_ok=yes @@ -28600,16 +29752,16 @@ $as_echo "#define HAVE_PPSAPI 1" >>confdefs.h esac # Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG -ac_fn_c_check_header_mongrel "$LINENO" "linux/serial.h" "ac_cv_header_linux_serial_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_serial_h" = xyes; then : +ac_fn_c_check_header_compile "$LINENO" "linux/serial.h" "ac_cv_header_linux_serial_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_serial_h" = xyes +then : fi - case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in yesyes) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG" >&5 -$as_echo_n "checking ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG" >&5 +printf %s "checking ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -28635,15 +29787,16 @@ $as_echo_n "checking ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS #endif _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : ntp_ok=yes -else +else $as_nop ntp_ok=no fi rm -f conftest.err conftest.i conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } ;; *) ntp_ok=no @@ -28652,13 +29805,13 @@ esac case "$ntp_ok" in yes) -$as_echo "#define HAVE_TIO_SERIAL_STUFF 1" >>confdefs.h +printf "%s\n" "#define HAVE_TIO_SERIAL_STUFF 1" >>confdefs.h esac # Check for SHMEM_STATUS support -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SHMEM_STATUS support" >&5 -$as_echo_n "checking SHMEM_STATUS support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking SHMEM_STATUS support" >&5 +printf %s "checking SHMEM_STATUS support... " >&6; } case "$ac_cv_header_sys_mman_h" in yes) ntp_ok=yes @@ -28670,21 +29823,22 @@ esac case "$ntp_ok" in yes) -$as_echo "#define ONCORE_SHMEM_STATUS 1" >>confdefs.h +printf "%s\n" "#define ONCORE_SHMEM_STATUS 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } ntp_refclock=no # HPUX only, and by explicit request -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Datum/Bancomm bc635/VME interface" >&5 -$as_echo_n "checking Datum/Bancomm bc635/VME interface... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Datum/Bancomm bc635/VME interface" >&5 +printf %s "checking Datum/Bancomm bc635/VME interface... " >&6; } # Check whether --enable-BANCOMM was given. -if test "${enable_BANCOMM+set}" = set; then : +if test ${enable_BANCOMM+y} +then : enableval=$enable_BANCOMM; ntp_ok=$enableval -else +else $as_nop ntp_ok=no fi @@ -28693,13 +29847,14 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_BANC 1" >>confdefs.h +printf "%s\n" "#define CLOCK_BANC 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing bcStartPci" >&5 -$as_echo_n "checking for library containing bcStartPci... " >&6; } -if ${ac_cv_search_bcStartPci+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing bcStartPci" >&5 +printf %s "checking for library containing bcStartPci... " >&6; } +if test ${ac_cv_search_bcStartPci+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -28707,67 +29862,70 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char bcStartPci (); int -main () +main (void) { return bcStartPci (); ; return 0; } _ACEOF -for ac_lib in '' bcsdk; do +for ac_lib in '' bcsdk +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_bcStartPci=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_bcStartPci+:} false; then : + if test ${ac_cv_search_bcStartPci+y} +then : break fi done -if ${ac_cv_search_bcStartPci+:} false; then : +if test ${ac_cv_search_bcStartPci+y} +then : -else +else $as_nop ac_cv_search_bcStartPci=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_bcStartPci" >&5 -$as_echo "$ac_cv_search_bcStartPci" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_bcStartPci" >&5 +printf "%s\n" "$ac_cv_search_bcStartPci" >&6; } ac_res=$ac_cv_search_bcStartPci -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok$host" in yes*-*-hpux*) ;; - yes*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5 -$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;} ;; + yes*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5 +printf "%s\n" "$as_me: WARNING: *** But the expected answer is... no ***" >&2;} ;; esac #HPUX only, and only by explicit request -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking TrueTime GPS receiver/VME interface" >&5 -$as_echo_n "checking TrueTime GPS receiver/VME interface... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking TrueTime GPS receiver/VME interface" >&5 +printf %s "checking TrueTime GPS receiver/VME interface... " >&6; } # Check whether --enable-GPSVME was given. -if test "${enable_GPSVME+set}" = set; then : +if test ${enable_GPSVME+y} +then : enableval=$enable_GPSVME; ntp_ok=$enableval -else +else $as_nop ntp_ok=no fi @@ -28776,24 +29934,24 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_GPSVME 1" >>confdefs.h +printf "%s\n" "#define CLOCK_GPSVME 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok$host" in yes*-*-hpux*) ;; - yes*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5 -$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;} ;; + yes*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5 +printf "%s\n" "$as_me: WARNING: *** But the expected answer is... no ***" >&2;} ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCL720 clock support" >&5 -$as_echo_n "checking for PCL720 clock support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PCL720 clock support" >&5 +printf %s "checking for PCL720 clock support... " >&6; } case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in yesyesyes) -$as_echo "#define CLOCK_PPS720 1" >>confdefs.h +printf "%s\n" "#define CLOCK_PPS720 1" >>confdefs.h ans=yes ;; @@ -28801,25 +29959,26 @@ $as_echo "#define CLOCK_PPS720 1" >>confdefs.h ans=no ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for default inclusion of all suitable non-PARSE clocks" >&5 -$as_echo_n "checking for default inclusion of all suitable non-PARSE clocks... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for default inclusion of all suitable non-PARSE clocks" >&5 +printf %s "checking for default inclusion of all suitable non-PARSE clocks... " >&6; } # Check whether --enable-all-clocks was given. -if test "${enable_all_clocks+set}" = set; then : +if test ${enable_all_clocks+y} +then : enableval=$enable_all_clocks; ntp_eac=$enableval -else +else $as_nop ntp_eac=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_eac" >&5 -$as_echo "$ntp_eac" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_eac" >&5 +printf "%s\n" "$ntp_eac" >&6; } # HMS: Should we also require ntp_parse_ok? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have support for PARSE clocks" >&5 -$as_echo_n "checking if we have support for PARSE clocks... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we have support for PARSE clocks" >&5 +printf %s "checking if we have support for PARSE clocks... " >&6; } case "$ntp_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in yes*yes*) ntp_canparse=yes @@ -28827,40 +29986,41 @@ case "$ntp_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in *) ntp_canparse=no ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_canparse" >&5 -$as_echo "$ntp_canparse" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_canparse" >&5 +printf "%s\n" "$ntp_canparse" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have support for audio clocks" >&5 -$as_echo_n "checking if we have support for audio clocks... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we have support for audio clocks" >&5 +printf %s "checking if we have support for audio clocks... " >&6; } case "$ac_cv_header_sun_audioio_h$ac_cv_header_sys_audioio_h$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in *yes*) ntp_canaudio=yes -$as_echo "#define HAVE_AUDIO /**/" >>confdefs.h +printf "%s\n" "#define HAVE_AUDIO /**/" >>confdefs.h ;; *) ntp_canaudio=no ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_canaudio" >&5 -$as_echo "$ntp_canaudio" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_canaudio" >&5 +printf "%s\n" "$ntp_canaudio" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have support for the SHM refclock interface" >&5 -$as_echo_n "checking if we have support for the SHM refclock interface... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we have support for the SHM refclock interface" >&5 +printf %s "checking if we have support for the SHM refclock interface... " >&6; } case "$ac_cv_header_sys_ipc_h$ac_cv_header_sys_shm_h" in yesyes) ntp_canshm=yes ;; *) ntp_canshm=no ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_canshm" >&5 -$as_echo "$ntp_canshm" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_canshm" >&5 +printf "%s\n" "$ntp_canshm" >&6; } # Test for termios TIOCMBIS modem control (ACTS, Heath, Palisade) -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for termios modem control" >&5 -$as_echo_n "checking for termios modem control... " >&6; } -if ${ntp_cv_modem_control+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for termios modem control" >&5 +printf %s "checking for termios modem control... " >&6; } +if test ${ntp_cv_modem_control+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -28875,7 +30035,7 @@ else #endif int -main () +main (void) { int dtr = TIOCM_DTR; @@ -28887,17 +30047,18 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_modem_control=yes -else +else $as_nop ntp_cv_modem_control=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_modem_control" >&5 -$as_echo "$ntp_cv_modem_control" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_modem_control" >&5 +printf "%s\n" "$ntp_cv_modem_control" >&6; } case "$ntp_eac::$ntp_cv_modem_control" in yes::yes) ntp_enable_all_modem_control_clocks=yes @@ -28908,12 +30069,13 @@ case "$ntp_eac::$ntp_cv_modem_control" in esac # Requires modem control -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ACTS modem service" >&5 -$as_echo_n "checking ACTS modem service... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking ACTS modem service" >&5 +printf %s "checking ACTS modem service... " >&6; } # Check whether --enable-ACTS was given. -if test "${enable_ACTS+set}" = set; then : +if test ${enable_ACTS+y} +then : enableval=$enable_ACTS; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_enable_all_modem_control_clocks fi @@ -28922,19 +30084,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_ACTS 1" >>confdefs.h +printf "%s\n" "#define CLOCK_ACTS 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Arbiter 1088A/B GPS receiver" >&5 -$as_echo_n "checking Arbiter 1088A/B GPS receiver... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Arbiter 1088A/B GPS receiver" >&5 +printf %s "checking Arbiter 1088A/B GPS receiver... " >&6; } # Check whether --enable-ARBITER was given. -if test "${enable_ARBITER+set}" = set; then : +if test ${enable_ARBITER+y} +then : enableval=$enable_ARBITER; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -28943,19 +30106,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_ARBITER 1" >>confdefs.h +printf "%s\n" "#define CLOCK_ARBITER 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Arcron MSF receiver" >&5 -$as_echo_n "checking Arcron MSF receiver... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Arcron MSF receiver" >&5 +printf %s "checking Arcron MSF receiver... " >&6; } # Check whether --enable-ARCRON_MSF was given. -if test "${enable_ARCRON_MSF+set}" = set; then : +if test ${enable_ARCRON_MSF+y} +then : enableval=$enable_ARCRON_MSF; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -28964,19 +30128,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_ARCRON_MSF 1" >>confdefs.h +printf "%s\n" "#define CLOCK_ARCRON_MSF 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Austron 2200A/2201A GPS receiver" >&5 -$as_echo_n "checking Austron 2200A/2201A GPS receiver... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Austron 2200A/2201A GPS receiver" >&5 +printf %s "checking Austron 2200A/2201A GPS receiver... " >&6; } # Check whether --enable-AS2201 was given. -if test "${enable_AS2201+set}" = set; then : +if test ${enable_AS2201+y} +then : enableval=$enable_AS2201; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -28985,19 +30150,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_AS2201 1" >>confdefs.h +printf "%s\n" "#define CLOCK_AS2201 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ATOM PPS interface" >&5 -$as_echo_n "checking ATOM PPS interface... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking ATOM PPS interface" >&5 +printf %s "checking ATOM PPS interface... " >&6; } # Check whether --enable-ATOM was given. -if test "${enable_ATOM+set}" = set; then : +if test ${enable_ATOM+y} +then : enableval=$enable_ATOM; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29009,19 +30175,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_ATOM 1" >>confdefs.h +printf "%s\n" "#define CLOCK_ATOM 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Chrono-log K-series WWVB receiver" >&5 -$as_echo_n "checking Chrono-log K-series WWVB receiver... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Chrono-log K-series WWVB receiver" >&5 +printf %s "checking Chrono-log K-series WWVB receiver... " >&6; } # Check whether --enable-CHRONOLOG was given. -if test "${enable_CHRONOLOG+set}" = set; then : +if test ${enable_CHRONOLOG+y} +then : enableval=$enable_CHRONOLOG; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29030,19 +30197,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_CHRONOLOG 1" >>confdefs.h +printf "%s\n" "#define CLOCK_CHRONOLOG 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CHU modem/decoder" >&5 -$as_echo_n "checking CHU modem/decoder... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking CHU modem/decoder" >&5 +printf %s "checking CHU modem/decoder... " >&6; } # Check whether --enable-CHU was given. -if test "${enable_CHU+set}" = set; then : +if test ${enable_CHU+y} +then : enableval=$enable_CHU; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29051,20 +30219,21 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_CHU 1" >>confdefs.h +printf "%s\n" "#define CLOCK_CHU 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } ntp_refclock_chu=$ntp_ok -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CHU audio/decoder" >&5 -$as_echo_n "checking CHU audio/decoder... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking CHU audio/decoder" >&5 +printf %s "checking CHU audio/decoder... " >&6; } # Check whether --enable-AUDIO-CHU was given. -if test "${enable_AUDIO_CHU+set}" = set; then : +if test ${enable_AUDIO_CHU+y} +then : enableval=$enable_AUDIO_CHU; ntp_ok=$enableval -else +else $as_nop case "$ntp_eac$ntp_refclock_chu$ntp_canaudio" in *no*) ntp_ok=no ;; @@ -29074,21 +30243,22 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } # We used to check for sunos/solaris target... case "$ntp_ok$ntp_refclock_chu$ntp_canaudio" in - yes*no*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is...no ***" >&5 -$as_echo "$as_me: WARNING: *** But the expected answer is...no ***" >&2;} + yes*no*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is...no ***" >&5 +printf "%s\n" "$as_me: WARNING: *** But the expected answer is...no ***" >&2;} esac # Not under HP-UX -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Datum Programmable Time System" >&5 -$as_echo_n "checking Datum Programmable Time System... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Datum Programmable Time System" >&5 +printf %s "checking Datum Programmable Time System... " >&6; } # Check whether --enable-DATUM was given. -if test "${enable_DATUM+set}" = set; then : +if test ${enable_DATUM+y} +then : enableval=$enable_DATUM; ntp_ok=$enableval -else +else $as_nop case "$ac_cv_header_termios_h" in yes) @@ -29105,19 +30275,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_DATUM 1" >>confdefs.h +printf "%s\n" "#define CLOCK_DATUM 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Dumb generic hh:mm:ss local clock" >&5 -$as_echo_n "checking Dumb generic hh:mm:ss local clock... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Dumb generic hh:mm:ss local clock" >&5 +printf %s "checking Dumb generic hh:mm:ss local clock... " >&6; } # Check whether --enable-DUMBCLOCK was given. -if test "${enable_DUMBCLOCK+set}" = set; then : +if test ${enable_DUMBCLOCK+y} +then : enableval=$enable_DUMBCLOCK; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29126,19 +30297,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_DUMBCLOCK 1" >>confdefs.h +printf "%s\n" "#define CLOCK_DUMBCLOCK 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Forum Graphic GPS" >&5 -$as_echo_n "checking Forum Graphic GPS... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Forum Graphic GPS" >&5 +printf %s "checking Forum Graphic GPS... " >&6; } # Check whether --enable-FG was given. -if test "${enable_FG+set}" = set; then : +if test ${enable_FG+y} +then : enableval=$enable_FG; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29147,20 +30319,21 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_FG 1" >>confdefs.h +printf "%s\n" "#define CLOCK_FG 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } # Requires modem control -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Heath GC-1000 WWV/WWVH receiver" >&5 -$as_echo_n "checking Heath GC-1000 WWV/WWVH receiver... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Heath GC-1000 WWV/WWVH receiver" >&5 +printf %s "checking Heath GC-1000 WWV/WWVH receiver... " >&6; } # Check whether --enable-HEATH was given. -if test "${enable_HEATH+set}" = set; then : +if test ${enable_HEATH+y} +then : enableval=$enable_HEATH; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_enable_all_modem_control_clocks fi @@ -29169,19 +30342,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_HEATH 1" >>confdefs.h +printf "%s\n" "#define CLOCK_HEATH 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for hopf serial clock device" >&5 -$as_echo_n "checking for hopf serial clock device... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hopf serial clock device" >&5 +printf %s "checking for hopf serial clock device... " >&6; } # Check whether --enable-HOPFSERIAL was given. -if test "${enable_HOPFSERIAL+set}" = set; then : +if test ${enable_HOPFSERIAL+y} +then : enableval=$enable_HOPFSERIAL; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29190,19 +30364,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_HOPF_SERIAL 1" >>confdefs.h +printf "%s\n" "#define CLOCK_HOPF_SERIAL 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for hopf PCI clock 6039" >&5 -$as_echo_n "checking for hopf PCI clock 6039... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hopf PCI clock 6039" >&5 +printf %s "checking for hopf PCI clock 6039... " >&6; } # Check whether --enable-HOPFPCI was given. -if test "${enable_HOPFPCI+set}" = set; then : +if test ${enable_HOPFPCI+y} +then : enableval=$enable_HOPFPCI; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29211,19 +30386,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_HOPF_PCI 1" >>confdefs.h +printf "%s\n" "#define CLOCK_HOPF_PCI 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking HP 58503A GPS receiver" >&5 -$as_echo_n "checking HP 58503A GPS receiver... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking HP 58503A GPS receiver" >&5 +printf %s "checking HP 58503A GPS receiver... " >&6; } # Check whether --enable-HPGPS was given. -if test "${enable_HPGPS+set}" = set; then : +if test ${enable_HPGPS+y} +then : enableval=$enable_HPGPS; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29232,19 +30408,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_HPGPS 1" >>confdefs.h +printf "%s\n" "#define CLOCK_HPGPS 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking IRIG audio decoder" >&5 -$as_echo_n "checking IRIG audio decoder... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking IRIG audio decoder" >&5 +printf %s "checking IRIG audio decoder... " >&6; } # Check whether --enable-IRIG was given. -if test "${enable_IRIG+set}" = set; then : +if test ${enable_IRIG+y} +then : enableval=$enable_IRIG; ntp_ok=$enableval -else +else $as_nop case "$ntp_eac$ntp_canaudio" in *no*) ntp_ok=no ;; @@ -29258,23 +30435,24 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_IRIG 1" >>confdefs.h +printf "%s\n" "#define CLOCK_IRIG 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok$ntp_canaudio" in - yesno) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5 -$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;} + yesno) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5 +printf "%s\n" "$as_me: WARNING: *** But the expected answer is... no ***" >&2;} esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JJY receiver" >&5 -$as_echo_n "checking for JJY receiver... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for JJY receiver" >&5 +printf %s "checking for JJY receiver... " >&6; } # Check whether --enable-JJY was given. -if test "${enable_JJY+set}" = set; then : +if test ${enable_JJY+y} +then : enableval=$enable_JJY; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29283,19 +30461,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_JJY 1" >>confdefs.h +printf "%s\n" "#define CLOCK_JJY 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Rockwell Jupiter GPS receiver" >&5 -$as_echo_n "checking Rockwell Jupiter GPS receiver... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Rockwell Jupiter GPS receiver" >&5 +printf %s "checking Rockwell Jupiter GPS receiver... " >&6; } # Check whether --enable-JUPITER was given. -if test "${enable_JUPITER+set}" = set; then : +if test ${enable_JUPITER+y} +then : enableval=$enable_JUPITER; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29306,19 +30485,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_JUPITER 1" >>confdefs.h +printf "%s\n" "#define CLOCK_JUPITER 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Leitch CSD 5300 Master Clock System Driver" >&5 -$as_echo_n "checking Leitch CSD 5300 Master Clock System Driver... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Leitch CSD 5300 Master Clock System Driver" >&5 +printf %s "checking Leitch CSD 5300 Master Clock System Driver... " >&6; } # Check whether --enable-LEITCH was given. -if test "${enable_LEITCH+set}" = set; then : +if test ${enable_LEITCH+y} +then : enableval=$enable_LEITCH; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29327,19 +30507,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_LEITCH 1" >>confdefs.h +printf "%s\n" "#define CLOCK_LEITCH 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking local clock reference" >&5 -$as_echo_n "checking local clock reference... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking local clock reference" >&5 +printf %s "checking local clock reference... " >&6; } # Check whether --enable-LOCAL-CLOCK was given. -if test "${enable_LOCAL_CLOCK+set}" = set; then : +if test ${enable_LOCAL_CLOCK+y} +then : enableval=$enable_LOCAL_CLOCK; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29348,21 +30529,22 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_LOCAL 1" >>confdefs.h +printf "%s\n" "#define CLOCK_LOCAL 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } # Not Ultrix -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Magnavox MX4200 GPS receiver" >&5 -$as_echo_n "checking Magnavox MX4200 GPS receiver... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Magnavox MX4200 GPS receiver" >&5 +printf %s "checking Magnavox MX4200 GPS receiver... " >&6; } # Check whether --enable-MX4200 was given. -if test "${enable_MX4200+set}" = set; then : +if test ${enable_MX4200+y} +then : enableval=$enable_MX4200; ntp_ok=$enableval -else +else $as_nop case "$ac_cv_var_ppsclock" in yes) @@ -29380,23 +30562,24 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_MX4200 1" >>confdefs.h +printf "%s\n" "#define CLOCK_MX4200 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok$host" in - yes*-*-ultrix*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5 -$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;} + yes*-*-ultrix*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5 +printf "%s\n" "$as_me: WARNING: *** But the expected answer is... no ***" >&2;} esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NeoClock4X receiver" >&5 -$as_echo_n "checking for NeoClock4X receiver... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for NeoClock4X receiver" >&5 +printf %s "checking for NeoClock4X receiver... " >&6; } # Check whether --enable-NEOCLOCK4X was given. -if test "${enable_NEOCLOCK4X+set}" = set; then : +if test ${enable_NEOCLOCK4X+y} +then : enableval=$enable_NEOCLOCK4X; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29405,19 +30588,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_NEOCLOCK4X 1" >>confdefs.h +printf "%s\n" "#define CLOCK_NEOCLOCK4X 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking NMEA GPS receiver" >&5 -$as_echo_n "checking NMEA GPS receiver... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking NMEA GPS receiver" >&5 +printf %s "checking NMEA GPS receiver... " >&6; } # Check whether --enable-NMEA was given. -if test "${enable_NMEA+set}" = set; then : +if test ${enable_NMEA+y} +then : enableval=$enable_NMEA; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29426,30 +30610,27 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_NMEA 1" >>confdefs.h +printf "%s\n" "#define CLOCK_NMEA 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -for ac_func in strtoll -do : - ac_fn_c_check_func "$LINENO" "strtoll" "ac_cv_func_strtoll" -if test "x$ac_cv_func_strtoll" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STRTOLL 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "strtoll" "ac_cv_func_strtoll" +if test "x$ac_cv_func_strtoll" = xyes +then : + printf "%s\n" "#define HAVE_STRTOLL 1" >>confdefs.h fi -done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPSD JSON receiver" >&5 -$as_echo_n "checking for GPSD JSON receiver... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GPSD JSON receiver" >&5 +printf %s "checking for GPSD JSON receiver... " >&6; } # Check whether --enable-GPSD was given. -if test "${enable_GPSD+set}" = set; then : +if test ${enable_GPSD+y} +then : enableval=$enable_GPSD; ntp_ok=$enableval -else +else $as_nop case "$ac_cv_func_strtoll" in yes) ntp_ok=$ntp_eac ;; *) ntp_ok="no" ;; @@ -29461,19 +30642,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_GPSDJSON 1" >>confdefs.h +printf "%s\n" "#define CLOCK_GPSDJSON 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ONCORE Motorola VP/UT Oncore GPS" >&5 -$as_echo_n "checking for ONCORE Motorola VP/UT Oncore GPS... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ONCORE Motorola VP/UT Oncore GPS" >&5 +printf %s "checking for ONCORE Motorola VP/UT Oncore GPS... " >&6; } # Check whether --enable-ONCORE was given. -if test "${enable_ONCORE+set}" = set; then : +if test ${enable_ONCORE+y} +then : enableval=$enable_ONCORE; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29485,20 +30667,21 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_ONCORE 1" >>confdefs.h +printf "%s\n" "#define CLOCK_ONCORE 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } # Requires modem control -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Palisade clock" >&5 -$as_echo_n "checking for Palisade clock... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Palisade clock" >&5 +printf %s "checking for Palisade clock... " >&6; } # Check whether --enable-PALISADE was given. -if test "${enable_PALISADE+set}" = set; then : +if test ${enable_PALISADE+y} +then : enableval=$enable_PALISADE; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_enable_all_modem_control_clocks fi @@ -29507,19 +30690,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_PALISADE 1" >>confdefs.h +printf "%s\n" "#define CLOCK_PALISADE 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Conrad parallel port radio clock" >&5 -$as_echo_n "checking Conrad parallel port radio clock... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Conrad parallel port radio clock" >&5 +printf %s "checking Conrad parallel port radio clock... " >&6; } # Check whether --enable-PCF was given. -if test "${enable_PCF+set}" = set; then : +if test ${enable_PCF+y} +then : enableval=$enable_PCF; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29528,19 +30712,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_PCF 1" >>confdefs.h +printf "%s\n" "#define CLOCK_PCF 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking PST/Traconex 1020 WWV/WWVH receiver" >&5 -$as_echo_n "checking PST/Traconex 1020 WWV/WWVH receiver... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking PST/Traconex 1020 WWV/WWVH receiver" >&5 +printf %s "checking PST/Traconex 1020 WWV/WWVH receiver... " >&6; } # Check whether --enable-PST was given. -if test "${enable_PST+set}" = set; then : +if test ${enable_PST+y} +then : enableval=$enable_PST; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29549,19 +30734,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_PST 1" >>confdefs.h +printf "%s\n" "#define CLOCK_PST 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking RIPENCC specific Trimble driver" >&5 -$as_echo_n "checking RIPENCC specific Trimble driver... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking RIPENCC specific Trimble driver" >&5 +printf %s "checking RIPENCC specific Trimble driver... " >&6; } # Check whether --enable-RIPENCC was given. -if test "${enable_RIPENCC+set}" = set; then : +if test ${enable_RIPENCC+y} +then : enableval=$enable_RIPENCC; ntp_ok=$enableval -else +else $as_nop ntp_ok=no fi @@ -29574,21 +30760,22 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_RIPENCC /**/" >>confdefs.h +printf "%s\n" "#define CLOCK_RIPENCC /**/" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } # Danny Meyer says SHM compiles (with a few warnings) under Win32. # For *IX, we need sys/ipc.h and sys/shm.h. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHM clock attached thru shared memory" >&5 -$as_echo_n "checking for SHM clock attached thru shared memory... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SHM clock attached thru shared memory" >&5 +printf %s "checking for SHM clock attached thru shared memory... " >&6; } # Check whether --enable-SHM was given. -if test "${enable_SHM+set}" = set; then : +if test ${enable_SHM+y} +then : enableval=$enable_SHM; ntp_ok=$enableval -else +else $as_nop case "$ntp_eac$ntp_canshm" in *no*) ntp_ok=no ;; @@ -29602,19 +30789,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_SHM 1" >>confdefs.h +printf "%s\n" "#define CLOCK_SHM 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Spectracom 8170/Netclock/2 WWVB receiver" >&5 -$as_echo_n "checking Spectracom 8170/Netclock/2 WWVB receiver... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Spectracom 8170/Netclock/2 WWVB receiver" >&5 +printf %s "checking Spectracom 8170/Netclock/2 WWVB receiver... " >&6; } # Check whether --enable-SPECTRACOM was given. -if test "${enable_SPECTRACOM+set}" = set; then : +if test ${enable_SPECTRACOM+y} +then : enableval=$enable_SPECTRACOM; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29623,19 +30811,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_SPECTRACOM 1" >>confdefs.h +printf "%s\n" "#define CLOCK_SPECTRACOM 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking KSI/Odetics TPRO/S GPS receiver/IRIG interface" >&5 -$as_echo_n "checking KSI/Odetics TPRO/S GPS receiver/IRIG interface... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking KSI/Odetics TPRO/S GPS receiver/IRIG interface" >&5 +printf %s "checking KSI/Odetics TPRO/S GPS receiver/IRIG interface... " >&6; } # Check whether --enable-TPRO was given. -if test "${enable_TPRO+set}" = set; then : +if test ${enable_TPRO+y} +then : enableval=$enable_TPRO; ntp_ok=$enableval -else +else $as_nop case "$ac_cv_header_sys_tpro_h" in yes) @@ -29653,24 +30842,25 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_TPRO 1" >>confdefs.h +printf "%s\n" "#define CLOCK_TPRO 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok$ac_cv_header_sys_tpro" in - yesno) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5 -$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;} + yesno) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5 +printf "%s\n" "$as_me: WARNING: *** But the expected answer is... no ***" >&2;} esac # Not on a vax-dec-bsd -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Kinemetrics/TrueTime receivers" >&5 -$as_echo_n "checking Kinemetrics/TrueTime receivers... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Kinemetrics/TrueTime receivers" >&5 +printf %s "checking Kinemetrics/TrueTime receivers... " >&6; } # Check whether --enable-TRUETIME was given. -if test "${enable_TRUETIME+set}" = set; then : +if test ${enable_TRUETIME+y} +then : enableval=$enable_TRUETIME; ntp_ok=$enableval -else +else $as_nop case "$host" in vax-dec-bsd) @@ -29688,23 +30878,24 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_TRUETIME 1" >>confdefs.h +printf "%s\n" "#define CLOCK_TRUETIME 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok$host" in - yesvax-dec-bsd) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5 -$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;} + yesvax-dec-bsd) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5 +printf "%s\n" "$as_me: WARNING: *** But the expected answer is... no ***" >&2;} esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking TrueTime 560 IRIG-B decoder" >&5 -$as_echo_n "checking TrueTime 560 IRIG-B decoder... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking TrueTime 560 IRIG-B decoder" >&5 +printf %s "checking TrueTime 560 IRIG-B decoder... " >&6; } # Check whether --enable-TT560 was given. -if test "${enable_TT560+set}" = set; then : +if test ${enable_TT560+y} +then : enableval=$enable_TT560; ntp_ok=$enableval -else +else $as_nop ntp_ok=no fi @@ -29713,19 +30904,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_TT560 /**/" >>confdefs.h +printf "%s\n" "#define CLOCK_TT560 /**/" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Ultralink M320 WWVB receiver" >&5 -$as_echo_n "checking Ultralink M320 WWVB receiver... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Ultralink M320 WWVB receiver" >&5 +printf %s "checking Ultralink M320 WWVB receiver... " >&6; } # Check whether --enable-ULINK was given. -if test "${enable_ULINK+set}" = set; then : +if test ${enable_ULINK+y} +then : enableval=$enable_ULINK; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29734,19 +30926,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_ULINK 1" >>confdefs.h +printf "%s\n" "#define CLOCK_ULINK 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Spectracom TSYNC PCI timing board" >&5 -$as_echo_n "checking Spectracom TSYNC PCI timing board... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Spectracom TSYNC PCI timing board" >&5 +printf %s "checking Spectracom TSYNC PCI timing board... " >&6; } # Check whether --enable-TSYNCPCI was given. -if test "${enable_TSYNCPCI+set}" = set; then : +if test ${enable_TSYNCPCI+y} +then : enableval=$enable_TSYNCPCI; ntp_ok=$enableval -else +else $as_nop case "$host" in *-*-*linux*) @@ -29763,19 +30956,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_TSYNCPCI 1" >>confdefs.h +printf "%s\n" "#define CLOCK_TSYNCPCI 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking WWV receiver" >&5 -$as_echo_n "checking WWV receiver... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking WWV receiver" >&5 +printf %s "checking WWV receiver... " >&6; } # Check whether --enable-WWV was given. -if test "${enable_WWV+set}" = set; then : +if test ${enable_WWV+y} +then : enableval=$enable_WWV; ntp_ok=$enableval -else +else $as_nop case "$ntp_eac$ntp_canaudio" in *no*) ntp_ok=no ;; @@ -29789,23 +30983,24 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_WWV 1" >>confdefs.h +printf "%s\n" "#define CLOCK_WWV 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok$ntp_canaudio" in - yesno) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5 -$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;} + yesno) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5 +printf "%s\n" "$as_me: WARNING: *** But the expected answer is... no ***" >&2;} esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Zyfer receiver" >&5 -$as_echo_n "checking for Zyfer receiver... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Zyfer receiver" >&5 +printf %s "checking for Zyfer receiver... " >&6; } # Check whether --enable-ZYFER was given. -if test "${enable_ZYFER+set}" = set; then : +if test ${enable_ZYFER+y} +then : enableval=$enable_ZYFER; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eac fi @@ -29814,19 +31009,20 @@ case "$ntp_ok" in yes) ntp_refclock=yes -$as_echo "#define CLOCK_ZYFER 1" >>confdefs.h +printf "%s\n" "#define CLOCK_ZYFER 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for default inclusion of all suitable PARSE clocks" >&5 -$as_echo_n "checking for default inclusion of all suitable PARSE clocks... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for default inclusion of all suitable PARSE clocks" >&5 +printf %s "checking for default inclusion of all suitable PARSE clocks... " >&6; } # Check whether --enable-parse-clocks was given. -if test "${enable_parse_clocks+set}" = set; then : +if test ${enable_parse_clocks+y} +then : enableval=$enable_parse_clocks; ntp_eapc=$enableval -else +else $as_nop case "$ntp_eac" in yes) ntp_eapc=$ntp_canparse ;; @@ -29838,8 +31034,8 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_eapc" >&5 -$as_echo "$ntp_eapc" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_eapc" >&5 +printf "%s\n" "$ntp_eapc" >&6; } case "$ntp_eac$ntp_eapc$ntp_canparse" in noyes*) @@ -29854,12 +31050,13 @@ ntp_libparse=no ntp_parseutil=no ntp_rawdcf=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Diem Computime Radio Clock" >&5 -$as_echo_n "checking Diem Computime Radio Clock... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Diem Computime Radio Clock" >&5 +printf %s "checking Diem Computime Radio Clock... " >&6; } # Check whether --enable-COMPUTIME was given. -if test "${enable_COMPUTIME+set}" = set; then : +if test ${enable_COMPUTIME+y} +then : enableval=$enable_COMPUTIME; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eapc fi @@ -29869,23 +31066,24 @@ case "$ntp_ok" in ntp_libparse=yes ntp_refclock=yes -$as_echo "#define CLOCK_COMPUTIME 1" >>confdefs.h +printf "%s\n" "#define CLOCK_COMPUTIME 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in yesno) as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5 esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ELV/DCF7000 clock" >&5 -$as_echo_n "checking ELV/DCF7000 clock... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking ELV/DCF7000 clock" >&5 +printf %s "checking ELV/DCF7000 clock... " >&6; } # Check whether --enable-DCF7000 was given. -if test "${enable_DCF7000+set}" = set; then : +if test ${enable_DCF7000+y} +then : enableval=$enable_DCF7000; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eapc fi @@ -29895,23 +31093,24 @@ case "$ntp_ok" in ntp_libparse=yes ntp_refclock=yes -$as_echo "#define CLOCK_DCF7000 1" >>confdefs.h +printf "%s\n" "#define CLOCK_DCF7000 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in yesno) as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5 esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking HOPF 6021 clock" >&5 -$as_echo_n "checking HOPF 6021 clock... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking HOPF 6021 clock" >&5 +printf %s "checking HOPF 6021 clock... " >&6; } # Check whether --enable-HOPF6021 was given. -if test "${enable_HOPF6021+set}" = set; then : +if test ${enable_HOPF6021+y} +then : enableval=$enable_HOPF6021; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eapc fi @@ -29921,23 +31120,24 @@ case "$ntp_ok" in ntp_libparse=yes ntp_refclock=yes -$as_echo "#define CLOCK_HOPF6021 1" >>confdefs.h +printf "%s\n" "#define CLOCK_HOPF6021 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in yesno) as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5 esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Meinberg clocks" >&5 -$as_echo_n "checking Meinberg clocks... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Meinberg clocks" >&5 +printf %s "checking Meinberg clocks... " >&6; } # Check whether --enable-MEINBERG was given. -if test "${enable_MEINBERG+set}" = set; then : +if test ${enable_MEINBERG+y} +then : enableval=$enable_MEINBERG; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eapc fi @@ -29947,23 +31147,24 @@ case "$ntp_ok" in ntp_libparse=yes ntp_refclock=yes -$as_echo "#define CLOCK_MEINBERG 1" >>confdefs.h +printf "%s\n" "#define CLOCK_MEINBERG 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in yesno) as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5 esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking DCF77 raw time code" >&5 -$as_echo_n "checking DCF77 raw time code... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking DCF77 raw time code" >&5 +printf %s "checking DCF77 raw time code... " >&6; } # Check whether --enable-RAWDCF was given. -if test "${enable_RAWDCF+set}" = set; then : +if test ${enable_RAWDCF+y} +then : enableval=$enable_RAWDCF; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eapc fi @@ -29975,12 +31176,12 @@ case "$ntp_ok" in ntp_refclock=yes ntp_rawdcf=yes -$as_echo "#define CLOCK_RAWDCF 1" >>confdefs.h +printf "%s\n" "#define CLOCK_RAWDCF 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in yesno) as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5 @@ -29988,11 +31189,12 @@ esac case "$ntp_rawdcf" in yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we must enable parity for RAWDCF" >&5 -$as_echo_n "checking if we must enable parity for RAWDCF... " >&6; } -if ${ntp_cv_rawdcf_parity+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we must enable parity for RAWDCF" >&5 +printf %s "checking if we must enable parity for RAWDCF... " >&6; } +if test ${ntp_cv_rawdcf_parity+y} +then : + printf %s "(cached) " >&6 +else $as_nop ans=no case "$host" in @@ -30004,22 +31206,23 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_rawdcf_parity" >&5 -$as_echo "$ntp_cv_rawdcf_parity" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_rawdcf_parity" >&5 +printf "%s\n" "$ntp_cv_rawdcf_parity" >&6; } case "$ntp_cv_rawdcf_parity" in yes) -$as_echo "#define RAWDCF_NO_IGNPAR 1" >>confdefs.h +printf "%s\n" "#define RAWDCF_NO_IGNPAR 1" >>confdefs.h ;; esac esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking RCC 8000 clock" >&5 -$as_echo_n "checking RCC 8000 clock... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking RCC 8000 clock" >&5 +printf %s "checking RCC 8000 clock... " >&6; } # Check whether --enable-RCC8000 was given. -if test "${enable_RCC8000+set}" = set; then : +if test ${enable_RCC8000+y} +then : enableval=$enable_RCC8000; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eapc fi @@ -30029,23 +31232,24 @@ case "$ntp_ok" in ntp_libparse=yes ntp_refclock=yes -$as_echo "#define CLOCK_RCC8000 1" >>confdefs.h +printf "%s\n" "#define CLOCK_RCC8000 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in yesno) as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5 esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Schmid DCF77 clock" >&5 -$as_echo_n "checking Schmid DCF77 clock... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Schmid DCF77 clock" >&5 +printf %s "checking Schmid DCF77 clock... " >&6; } # Check whether --enable-SCHMID was given. -if test "${enable_SCHMID+set}" = set; then : +if test ${enable_SCHMID+y} +then : enableval=$enable_SCHMID; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eapc fi @@ -30055,23 +31259,24 @@ case "$ntp_ok" in ntp_libparse=yes ntp_refclock=yes -$as_echo "#define CLOCK_SCHMID 1" >>confdefs.h +printf "%s\n" "#define CLOCK_SCHMID 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in yesno) as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5 esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Trimble GPS receiver/TAIP protocol" >&5 -$as_echo_n "checking Trimble GPS receiver/TAIP protocol... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Trimble GPS receiver/TAIP protocol" >&5 +printf %s "checking Trimble GPS receiver/TAIP protocol... " >&6; } # Check whether --enable-TRIMTAIP was given. -if test "${enable_TRIMTAIP+set}" = set; then : +if test ${enable_TRIMTAIP+y} +then : enableval=$enable_TRIMTAIP; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eapc fi @@ -30081,23 +31286,24 @@ case "$ntp_ok" in ntp_libparse=yes ntp_refclock=yes -$as_echo "#define CLOCK_TRIMTAIP 1" >>confdefs.h +printf "%s\n" "#define CLOCK_TRIMTAIP 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in yesno) as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5 esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Trimble GPS receiver/TSIP protocol" >&5 -$as_echo_n "checking Trimble GPS receiver/TSIP protocol... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Trimble GPS receiver/TSIP protocol" >&5 +printf %s "checking Trimble GPS receiver/TSIP protocol... " >&6; } # Check whether --enable-TRIMTSIP was given. -if test "${enable_TRIMTSIP+set}" = set; then : +if test ${enable_TRIMTSIP+y} +then : enableval=$enable_TRIMTSIP; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eapc fi @@ -30107,23 +31313,24 @@ case "$ntp_ok" in ntp_libparse=yes ntp_refclock=yes -$as_echo "#define CLOCK_TRIMTSIP 1" >>confdefs.h +printf "%s\n" "#define CLOCK_TRIMTSIP 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in yesno) as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5 esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking WHARTON 400A Series clock" >&5 -$as_echo_n "checking WHARTON 400A Series clock... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking WHARTON 400A Series clock" >&5 +printf %s "checking WHARTON 400A Series clock... " >&6; } # Check whether --enable-WHARTON was given. -if test "${enable_WHARTON+set}" = set; then : +if test ${enable_WHARTON+y} +then : enableval=$enable_WHARTON; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eapc fi @@ -30133,23 +31340,24 @@ case "$ntp_ok" in ntp_libparse=yes ntp_refclock=yes -$as_echo "#define CLOCK_WHARTON_400A 1" >>confdefs.h +printf "%s\n" "#define CLOCK_WHARTON_400A 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in yesno) as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5 esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking VARITEXT clock" >&5 -$as_echo_n "checking VARITEXT clock... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking VARITEXT clock" >&5 +printf %s "checking VARITEXT clock... " >&6; } # Check whether --enable-VARITEXT was given. -if test "${enable_VARITEXT+set}" = set; then : +if test ${enable_VARITEXT+y} +then : enableval=$enable_VARITEXT; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eapc fi @@ -30159,23 +31367,24 @@ case "$ntp_ok" in ntp_libparse=yes ntp_refclock=yes -$as_echo "#define CLOCK_VARITEXT 1" >>confdefs.h +printf "%s\n" "#define CLOCK_VARITEXT 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in yesno) as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5 esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SEL240X clock" >&5 -$as_echo_n "checking SEL240X clock... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking SEL240X clock" >&5 +printf %s "checking SEL240X clock... " >&6; } # Check whether --enable-SEL240X was given. -if test "${enable_SEL240X+set}" = set; then : +if test ${enable_SEL240X+y} +then : enableval=$enable_SEL240X; ntp_ok=$enableval -else +else $as_nop ntp_ok=$ntp_eapc fi @@ -30183,11 +31392,11 @@ if test "$ntp_ok" = "yes"; then ntp_libparse=yes ntp_refclock=yes -$as_echo "#define CLOCK_SEL240X 1" >>confdefs.h +printf "%s\n" "#define CLOCK_SEL240X 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } case "$ntp_ok$ntp_canparse" in yesno) as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5 @@ -30199,22 +31408,22 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to make and use the parse libraries" >&5 -$as_echo_n "checking if we need to make and use the parse libraries... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we need to make and use the parse libraries" >&5 +printf %s "checking if we need to make and use the parse libraries... " >&6; } ans=no case "$ntp_libparse" in yes) ans=yes -$as_echo "#define CLOCK_PARSE 1" >>confdefs.h +printf "%s\n" "#define CLOCK_PARSE 1" >>confdefs.h LIBPARSE=../libparse/libparse.a MAKE_LIBPARSE=libparse.a # HMS: check_y2k trips the 34 year problem now... false && MAKE_CHECK_Y2K=check_y2k esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } @@ -30225,25 +31434,29 @@ VER_SUFFIX= # Check whether --with-crypto was given. -if test "${with_crypto+set}" = set; then : +if test ${with_crypto+y} +then : withval=$with_crypto; fi # Check whether --with-openssl-libdir was given. -if test "${with_openssl_libdir+set}" = set; then : +if test ${with_openssl_libdir+y} +then : withval=$with_openssl_libdir; fi # Check whether --with-openssl-incdir was given. -if test "${with_openssl_incdir+set}" = set; then : +if test ${with_openssl_incdir+y} +then : withval=$with_openssl_incdir; fi # Check whether --with-rpath was given. -if test "${with_rpath+set}" = set; then : +if test ${with_rpath+y} +then : withval=$with_rpath; fi @@ -30262,8 +31475,8 @@ case "$with_crypto:${PKG_CONFIG:+notempty}:${with_openssl_libdir-notgiven}:${wit no:*) ;; *:notempty:notgiven:notgiven) for pkg in `echo $with_crypto | sed -e 's/,/ /'`; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config for $pkg" >&5 -$as_echo_n "checking pkg-config for $pkg... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config for $pkg" >&5 +printf %s "checking pkg-config for $pkg... " >&6; } if $PKG_CONFIG --exists $pkg ; then CPPFLAGS_NTP="$CPPFLAGS_NTP `$PKG_CONFIG --cflags-only-I $pkg`" CFLAGS_NTP="$CFLAGS_NTP `$PKG_CONFIG --cflags-only-other $pkg`" @@ -30278,13 +31491,13 @@ $as_echo_n "checking pkg-config for $pkg... " >&6; } *.*) ;; *) ntp_openssl_version='(unknown)' ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, version $ntp_openssl_version" >&5 -$as_echo "yes, version $ntp_openssl_version" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes, version $ntp_openssl_version" >&5 +printf "%s\n" "yes, version $ntp_openssl_version" >&6; } break fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } done esac case "$with_crypto:$ntp_openssl" in @@ -30313,8 +31526,8 @@ case "$with_crypto:$ntp_openssl" in ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl library directory" >&5 -$as_echo_n "checking for openssl library directory... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openssl library directory" >&5 +printf %s "checking for openssl library directory... " >&6; } with_openssl_libdir=${with_openssl_libdir-notgiven} case "$with_openssl_libdir" in notgiven) @@ -30353,17 +31566,17 @@ $as_echo_n "checking for openssl library directory... " >&6; } openssl_libdir=$i ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $openssl_libdir" >&5 -$as_echo "$openssl_libdir" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $openssl_libdir" >&5 +printf "%s\n" "$openssl_libdir" >&6; } case "$openssl_libdir" in no) openssl_libdir= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcrypto and libssl not found in any of $with_openssl_libdir" >&5 -$as_echo "$as_me: WARNING: libcrypto and libssl not found in any of $with_openssl_libdir" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libcrypto and libssl not found in any of $with_openssl_libdir" >&5 +printf "%s\n" "$as_me: WARNING: libcrypto and libssl not found in any of $with_openssl_libdir" >&2;} esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl include directory" >&5 -$as_echo_n "checking for openssl include directory... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openssl include directory" >&5 +printf %s "checking for openssl include directory... " >&6; } with_openssl_incdir=${with_openssl_incdir-notgiven} case "$with_openssl_incdir" in notgiven) @@ -30384,13 +31597,13 @@ $as_echo_n "checking for openssl include directory... " >&6; } ;; esac { i=; unset i;} - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $openssl_incdir" >&5 -$as_echo "$openssl_incdir" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $openssl_incdir" >&5 +printf "%s\n" "$openssl_incdir" >&6; } case "$openssl_incdir" in no) openssl_incdir= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: did not find openssl/evp.h in any of $with_openssl_incdir" >&5 -$as_echo "$as_me: WARNING: did not find openssl/evp.h in any of $with_openssl_incdir" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: did not find openssl/evp.h in any of $with_openssl_incdir" >&5 +printf "%s\n" "$as_me: WARNING: did not find openssl/evp.h in any of $with_openssl_incdir" >&2;} esac if test -z "$openssl_libdir" -o -z "$openssl_incdir" then @@ -30428,28 +31641,28 @@ $as_echo "$as_me: WARNING: did not find openssl/evp.h in any of $with_openssl_in esac esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we will use crypto" >&5 -$as_echo_n "checking if we will use crypto... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_openssl" >&5 -$as_echo "$ntp_openssl" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we will use crypto" >&5 +printf %s "checking if we will use crypto... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_openssl" >&5 +printf "%s\n" "$ntp_openssl" >&6; } case "$ntp_openssl" in yes) - for ac_header in openssl/cmac.h openssl/hmac.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "openssl/cmac.h" "ac_cv_header_openssl_cmac_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_cmac_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENSSL_CMAC_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "openssl/hmac.h" "ac_cv_header_openssl_hmac_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_hmac_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENSSL_HMAC_H 1" >>confdefs.h fi -done - -$as_echo "#define OPENSSL /**/" >>confdefs.h +printf "%s\n" "#define OPENSSL /**/" >>confdefs.h case "$VER_SUFFIX" in *o*) ;; @@ -30469,11 +31682,12 @@ NTPO_SAVED_LIBS="$LIBS" case "$ntp_openssl:$ntp_openssl_from_pkg_config" in yes:no) LIBS="$NTPO_SAVED_LIBS $LDADD_NTP" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linking with -lcrypto alone works" >&5 -$as_echo_n "checking if linking with -lcrypto alone works... " >&6; } -if ${ntp_cv_bare_lcrypto+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if linking with -lcrypto alone works" >&5 +printf %s "checking if linking with -lcrypto alone works... " >&6; } +if test ${ntp_cv_bare_lcrypto+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -30481,7 +31695,7 @@ else #include "openssl/evp.h" int -main () +main (void) { ERR_load_crypto_strings(); @@ -30492,26 +31706,28 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ntp_cv_bare_lcrypto=yes -else +else $as_nop ntp_cv_bare_lcrypto=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_bare_lcrypto" >&5 -$as_echo "$ntp_cv_bare_lcrypto" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_bare_lcrypto" >&5 +printf "%s\n" "$ntp_cv_bare_lcrypto" >&6; } case "$ntp_cv_bare_lcrypto" in no) LIBS="$NTPO_SAVED_LIBS $LDADD_NTP -lz" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linking with -lcrypto -lz works" >&5 -$as_echo_n "checking if linking with -lcrypto -lz works... " >&6; } -if ${ntp_cv_lcrypto_lz+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if linking with -lcrypto -lz works" >&5 +printf %s "checking if linking with -lcrypto -lz works... " >&6; } +if test ${ntp_cv_lcrypto_lz+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -30519,7 +31735,7 @@ else #include "openssl/evp.h" int -main () +main (void) { ERR_load_crypto_strings(); @@ -30530,18 +31746,19 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ntp_cv_lcrypto_lz=yes -else +else $as_nop ntp_cv_lcrypto_lz=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_lcrypto_lz" >&5 -$as_echo "$ntp_cv_lcrypto_lz" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_lcrypto_lz" >&5 +printf "%s\n" "$ntp_cv_lcrypto_lz" >&6; } case "$ntp_cv_lcrypto_lz" in yes) LDADD_NTP="$LDADD_NTP -lz" @@ -30573,7 +31790,7 @@ case "$ntp_openssl:$GCC" in int -main () +main (void) { /* see if -Werror breaks gcc */ @@ -30583,13 +31800,14 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : gcc_handles_Werror=yes -else +else $as_nop gcc_handles_Werror=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext case "$gcc_handles_Werror" in no) # if this gcc doesn't do -Werror go ahead and use @@ -30610,7 +31828,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext #include "openssl/x509v3.h" int -main () +main (void) { /* empty body */ @@ -30620,13 +31838,14 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : openssl_triggers_warnings=no -else +else $as_nop openssl_triggers_warnings=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext esac case "$openssl_triggers_warnings" in yes) @@ -30647,16 +31866,12 @@ CFLAGS="$NTPO_SAVED_CFLAGS" case "$ntp_openssl" in yes) LIBS="$NTPO_SAVED_LIBS $LDADD_NTP" - for ac_func in EVP_MD_do_all_sorted -do : - ac_fn_c_check_func "$LINENO" "EVP_MD_do_all_sorted" "ac_cv_func_EVP_MD_do_all_sorted" -if test "x$ac_cv_func_EVP_MD_do_all_sorted" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_EVP_MD_DO_ALL_SORTED 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "EVP_MD_do_all_sorted" "ac_cv_func_EVP_MD_do_all_sorted" +if test "x$ac_cv_func_EVP_MD_do_all_sorted" = xyes +then : + printf "%s\n" "#define HAVE_EVP_MD_DO_ALL_SORTED 1" >>confdefs.h fi -done ;; esac @@ -30671,57 +31886,59 @@ LIBS="$NTPO_SAVED_LIBS" { ntp_openssl_from_pkg_config=; unset ntp_openssl_from_pkg_config;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to enable CMAC support" >&5 -$as_echo_n "checking if we want to enable CMAC support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want to enable CMAC support" >&5 +printf %s "checking if we want to enable CMAC support... " >&6; } case "$ac_cv_header_openssl_cmac_h" in yes) -$as_echo "#define ENABLE_CMAC 1" >>confdefs.h +printf "%s\n" "#define ENABLE_CMAC 1" >>confdefs.h ans="yes" ;; *) ans="no" ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to use OpenSSL's crypto random (if available)" >&5 -$as_echo_n "checking if we want to use OpenSSL's crypto random (if available)... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want to use OpenSSL's crypto random (if available)" >&5 +printf %s "checking if we want to use OpenSSL's crypto random (if available)... " >&6; } # Check whether --enable-openssl-random was given. -if test "${enable_openssl_random+set}" = set; then : +if test ${enable_openssl_random+y} +then : enableval=$enable_openssl_random; ntp_use_openssl_random=$enableval -else +else $as_nop ntp_use_openssl_random=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_use_openssl_random" >&5 -$as_echo "$ntp_use_openssl_random" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_use_openssl_random" >&5 +printf "%s\n" "$ntp_use_openssl_random" >&6; } # The following might need extra libraries NTPO_SAVED_LIBS="$LIBS" LIBS="$NTPO_SAVED_LIBS $LDADD_NTP" -for ac_func in RAND_bytes RAND_poll -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "RAND_bytes" "ac_cv_func_RAND_bytes" +if test "x$ac_cv_func_RAND_bytes" = xyes +then : + printf "%s\n" "#define HAVE_RAND_BYTES 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "RAND_poll" "ac_cv_func_RAND_poll" +if test "x$ac_cv_func_RAND_poll" = xyes +then : + printf "%s\n" "#define HAVE_RAND_POLL 1" >>confdefs.h fi -done LIBS="$NTPO_SAVED_LIBS" -case "$ntp_use_openssl_random$ac_cv_func_RAND_bytes$ac_cv_func_RAND_poll" in - yesyesyes) +case "$ntp_openssl$ntp_use_openssl_random$ac_cv_func_RAND_bytes$ac_cv_func_RAND_poll" in + yesyesyesyes) -$as_echo "#define USE_OPENSSL_CRYPTO_RAND 1" >>confdefs.h +printf "%s\n" "#define USE_OPENSSL_CRYPTO_RAND 1" >>confdefs.h ;; *) ntp_use_openssl_random=no ;; @@ -30730,12 +31947,13 @@ esac # if we are using OpenSSL (--with-crypto), by default Autokey is enabled -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to include NTP Autokey protocol support" >&5 -$as_echo_n "checking if we want to include NTP Autokey protocol support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want to include NTP Autokey protocol support" >&5 +printf %s "checking if we want to include NTP Autokey protocol support... " >&6; } # Check whether --enable-autokey was given. -if test "${enable_autokey+set}" = set; then : +if test ${enable_autokey+y} +then : enableval=$enable_autokey; ntp_autokey=$enableval -else +else $as_nop ntp_autokey=$ntp_openssl fi @@ -30746,25 +31964,25 @@ case "$ntp_autokey" in *) case "$ntp_openssl" in no) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling Autokey, --enable-autokey requires --with-crypto." >&5 -$as_echo "$as_me: WARNING: Disabling Autokey, --enable-autokey requires --with-crypto." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Disabling Autokey, --enable-autokey requires --with-crypto." >&5 +printf "%s\n" "$as_me: WARNING: Disabling Autokey, --enable-autokey requires --with-crypto." >&2;} ntp_autokey=no ;; *) -$as_echo "#define AUTOKEY 1" >>confdefs.h +printf "%s\n" "#define AUTOKEY 1" >>confdefs.h ntp_autokey=yes ;; esac ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_autokey" >&5 -$as_echo "$ntp_autokey" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_autokey" >&5 +printf "%s\n" "$ntp_autokey" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to run check-layout" >&5 -$as_echo_n "checking if we want to run check-layout... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want to run check-layout" >&5 +printf %s "checking if we want to run check-layout... " >&6; } case "$cross_compiling$PATH_PERL" in no/*) MAKE_CHECK_LAYOUT=check-layout @@ -30774,13 +31992,13 @@ case "$cross_compiling$PATH_PERL" in ans=no ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can make dcf parse utilities" >&5 -$as_echo_n "checking if we can make dcf parse utilities... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can make dcf parse utilities" >&5 +printf %s "checking if we can make dcf parse utilities... " >&6; } ans=no case "$ntp_parseutil" in yes) @@ -30792,12 +32010,12 @@ case "$ntp_parseutil" in esac ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can build kernel streams modules for parse" >&5 -$as_echo_n "checking if we can build kernel streams modules for parse... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can build kernel streams modules for parse" >&5 +printf %s "checking if we can build kernel streams modules for parse... " >&6; } ans=no case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in yesyes) @@ -30806,7 +32024,7 @@ case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in case "$ntp_cv_var_kernel_pll" in yes) -$as_echo "#define PPS_SYNC 1" >>confdefs.h +printf "%s\n" "#define PPS_SYNC 1" >>confdefs.h ;; esac @@ -30816,43 +32034,38 @@ $as_echo "#define PPS_SYNC 1" >>confdefs.h sparc-*-solaris2*) ans=parsesolaris MAKE_PARSEKMODULE=parse - for ac_header in strings.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "strings.h" "ac_cv_header_strings_h" "$ac_includes_default" -if test "x$ac_cv_header_strings_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STRINGS_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "strings.h" "ac_cv_header_strings_h" "$ac_includes_default" +if test "x$ac_cv_header_strings_h" = xyes +then : + printf "%s\n" "#define HAVE_STRINGS_H 1" >>confdefs.h fi -done - ;; esac ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need basic refclock support" >&5 -$as_echo_n "checking if we need basic refclock support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we need basic refclock support" >&5 +printf %s "checking if we need basic refclock support... " >&6; } case "$ntp_refclock" in yes) -$as_echo "#define REFCLOCK 1" >>confdefs.h +printf "%s\n" "#define REFCLOCK 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_refclock" >&5 -$as_echo "$ntp_refclock" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_refclock" >&5 +printf "%s\n" "$ntp_refclock" >&6; } PROPDELAY=propdelay -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want HP-UX adjtimed support" >&5 -$as_echo_n "checking if we want HP-UX adjtimed support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want HP-UX adjtimed support" >&5 +printf %s "checking if we want HP-UX adjtimed support... " >&6; } case "$host" in *-*-hpux[56789]*) ans=yes @@ -30864,7 +32077,7 @@ case "$ans" in yes) MAKE_ADJTIMED=adjtimed -$as_echo "#define NEED_HPUX_ADJTIME 1" >>confdefs.h +printf "%s\n" "#define NEED_HPUX_ADJTIME 1" >>confdefs.h ;; *) ADJTIMED_DB= @@ -30873,11 +32086,11 @@ $as_echo "#define NEED_HPUX_ADJTIME 1" >>confdefs.h ADJTIMED_MS= ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want QNX adjtime support" >&5 -$as_echo_n "checking if we want QNX adjtime support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want QNX adjtime support" >&5 +printf %s "checking if we want QNX adjtime support... " >&6; } case "$host" in *-*-qnx*) ans=yes @@ -30888,15 +32101,15 @@ esac case "$ans" in yes) -$as_echo "#define NEED_QNX_ADJTIME 1" >>confdefs.h +printf "%s\n" "#define NEED_QNX_ADJTIME 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can read kmem" >&5 -$as_echo_n "checking if we can read kmem... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can read kmem" >&5 +printf %s "checking if we can read kmem... " >&6; } # the default is to enable it if the system has the capability @@ -30931,14 +32144,15 @@ esac # --enable-kmem / --disable-kmem controls if present # Check whether --enable-kmem was given. -if test "${enable_kmem+set}" = set; then : +if test ${enable_kmem+y} +then : enableval=$enable_kmem; ans=$enableval fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } case "$ans" in yes) @@ -30947,13 +32161,13 @@ case "$ans" in *) can_kmem=no -$as_echo "#define NOKMEM 1" >>confdefs.h +printf "%s\n" "#define NOKMEM 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if adjtime is accurate" >&5 -$as_echo_n "checking if adjtime is accurate... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if adjtime is accurate" >&5 +printf %s "checking if adjtime is accurate... " >&6; } # target-dependent defaults @@ -30993,19 +32207,20 @@ esac # --enable-accurate-adjtime / --disable-accurate-adjtime # override the default # Check whether --enable-accurate-adjtime was given. -if test "${enable_accurate_adjtime+set}" = set; then : +if test ${enable_accurate_adjtime+y} +then : enableval=$enable_accurate_adjtime; ans=$enableval fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } case "$ans" in yes) -$as_echo "#define ADJTIME_IS_ACCURATE 1" >>confdefs.h +printf "%s\n" "#define ADJTIME_IS_ACCURATE 1" >>confdefs.h adjtime_is_accurate=yes ;; @@ -31014,11 +32229,12 @@ $as_echo "#define ADJTIME_IS_ACCURATE 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name of 'tick' in the kernel" >&5 -$as_echo_n "checking the name of 'tick' in the kernel... " >&6; } -if ${ntp_cv_nlist_tick+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name of 'tick' in the kernel" >&5 +printf %s "checking the name of 'tick' in the kernel... " >&6; } +if test ${ntp_cv_nlist_tick+y} +then : + printf %s "(cached) " >&6 +else $as_nop ans=_tick case "$host" in @@ -31055,24 +32271,23 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_nlist_tick" >&5 -$as_echo "$ntp_cv_nlist_tick" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_nlist_tick" >&5 +printf "%s\n" "$ntp_cv_nlist_tick" >&6; } case "$ntp_cv_nlist_tick" in ''|no) ;; # HMS: I think we can only get 'no' here... *) -cat >>confdefs.h <<_ACEOF -#define K_TICK_NAME "$ntp_cv_nlist_tick" -_ACEOF +printf "%s\n" "#define K_TICK_NAME \"$ntp_cv_nlist_tick\"" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the units of 'tick'" >&5 -$as_echo_n "checking for the units of 'tick'... " >&6; } -if ${ntp_cv_tick_nano+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the units of 'tick'" >&5 +printf %s "checking for the units of 'tick'... " >&6; } +if test ${ntp_cv_tick_nano+y} +then : + printf %s "(cached) " >&6 +else $as_nop ans=usec case "$host" in @@ -31084,20 +32299,21 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_tick_nano" >&5 -$as_echo "$ntp_cv_tick_nano" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_tick_nano" >&5 +printf "%s\n" "$ntp_cv_tick_nano" >&6; } case "$ntp_cv_tick_nano" in nsec) -$as_echo "#define TICK_NANO 1" >>confdefs.h +printf "%s\n" "#define TICK_NANO 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name of 'tickadj' in the kernel" >&5 -$as_echo_n "checking the name of 'tickadj' in the kernel... " >&6; } -if ${ntp_cv_nlist_tickadj+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name of 'tickadj' in the kernel" >&5 +printf %s "checking the name of 'tickadj' in the kernel... " >&6; } +if test ${ntp_cv_nlist_tickadj+y} +then : + printf %s "(cached) " >&6 +else $as_nop ans=_tickadj case "$host" in @@ -31142,24 +32358,23 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_nlist_tickadj" >&5 -$as_echo "$ntp_cv_nlist_tickadj" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_nlist_tickadj" >&5 +printf "%s\n" "$ntp_cv_nlist_tickadj" >&6; } case "$ntp_cv_nlist_tickadj" in ''|no) ;; # HMS: I think we can only get 'no' here... *) -cat >>confdefs.h <<_ACEOF -#define K_TICKADJ_NAME "$ntp_cv_nlist_tickadj" -_ACEOF +printf "%s\n" "#define K_TICKADJ_NAME \"$ntp_cv_nlist_tickadj\"" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the units of 'tickadj'" >&5 -$as_echo_n "checking for the units of 'tickadj'... " >&6; } -if ${ntp_cv_tickadj_nano+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the units of 'tickadj'" >&5 +printf %s "checking for the units of 'tickadj'... " >&6; } +if test ${ntp_cv_tickadj_nano+y} +then : + printf %s "(cached) " >&6 +else $as_nop ans=usec case "$host" in @@ -31171,20 +32386,21 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_tickadj_nano" >&5 -$as_echo "$ntp_cv_tickadj_nano" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_tickadj_nano" >&5 +printf "%s\n" "$ntp_cv_tickadj_nano" >&6; } case "$ntp_cv_tickadj_nano" in nsec) -$as_echo "#define TICKADJ_NANO 1" >>confdefs.h +printf "%s\n" "#define TICKADJ_NANO 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking half-heartedly for 'dosynctodr' in the kernel" >&5 -$as_echo_n "checking half-heartedly for 'dosynctodr' in the kernel... " >&6; } -if ${ntp_cv_nlist_dosynctodr+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking half-heartedly for 'dosynctodr' in the kernel" >&5 +printf %s "checking half-heartedly for 'dosynctodr' in the kernel... " >&6; } +if test ${ntp_cv_nlist_dosynctodr+y} +then : + printf %s "(cached) " >&6 +else $as_nop case "$host" in *-apple-aux[23]*) @@ -31231,25 +32447,24 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_nlist_dosynctodr" >&5 -$as_echo "$ntp_cv_nlist_dosynctodr" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_nlist_dosynctodr" >&5 +printf "%s\n" "$ntp_cv_nlist_dosynctodr" >&6; } case "$ntp_cv_nlist_dosynctodr" in no) ;; *) -cat >>confdefs.h <<_ACEOF -#define K_DOSYNCTODR_NAME "$ntp_cv_nlist_dosynctodr" -_ACEOF +printf "%s\n" "#define K_DOSYNCTODR_NAME \"$ntp_cv_nlist_dosynctodr\"" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking half-heartedly for 'noprintf' in the kernel" >&5 -$as_echo_n "checking half-heartedly for 'noprintf' in the kernel... " >&6; } -if ${ntp_cv_nlist_noprintf+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking half-heartedly for 'noprintf' in the kernel" >&5 +printf %s "checking half-heartedly for 'noprintf' in the kernel... " >&6; } +if test ${ntp_cv_nlist_noprintf+y} +then : + printf %s "(cached) " >&6 +else $as_nop case "$host" in *-apple-aux[23]*) @@ -31290,16 +32505,14 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_nlist_noprintf" >&5 -$as_echo "$ntp_cv_nlist_noprintf" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_nlist_noprintf" >&5 +printf "%s\n" "$ntp_cv_nlist_noprintf" >&6; } case "$ntp_cv_nlist_noprintf" in no) ;; *) -cat >>confdefs.h <<_ACEOF -#define K_NOPRINTF_NAME "$ntp_cv_nlist_noprintf" -_ACEOF +printf "%s\n" "#define K_NOPRINTF_NAME \"$ntp_cv_nlist_noprintf\"" >>confdefs.h ;; esac @@ -31307,8 +32520,8 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a default value for 'tick'" >&5 -$as_echo_n "checking for a default value for 'tick'... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a default value for 'tick'" >&5 +printf %s "checking for a default value for 'tick'... " >&6; } # target-dependent default for tick @@ -31340,28 +32553,27 @@ case "$host" in esac # Check whether --enable-tick was given. -if test "${enable_tick+set}" = set; then : +if test ${enable_tick+y} +then : enableval=$enable_tick; ans=$enableval fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } case "$ans" in ''|no) ;; # HMS: I think we can only get 'no' here... *) -cat >>confdefs.h <<_ACEOF -#define PRESET_TICK $ans -_ACEOF +printf "%s\n" "#define PRESET_TICK $ans" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a default value for 'tickadj'" >&5 -$as_echo_n "checking for a default value for 'tickadj'... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a default value for 'tickadj'" >&5 +printf %s "checking for a default value for 'tickadj'... " >&6; } # target-specific default ans='500/hz' @@ -31414,14 +32626,15 @@ case "$host" in esac # Check whether --enable-tickadj was given. -if test "${enable_tickadj+set}" = set; then : +if test ${enable_tickadj+y} +then : enableval=$enable_tickadj; ans=$enableval fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } default_tickadj=$ans @@ -31430,9 +32643,7 @@ case "$default_tickadj" in ;; # HMS: I think we can only get 'no' here... *) -cat >>confdefs.h <<_ACEOF -#define PRESET_TICKADJ $default_tickadj -_ACEOF +printf "%s\n" "#define PRESET_TICKADJ $default_tickadj" >>confdefs.h ;; esac @@ -31443,32 +32654,32 @@ esac case "$host" in mips-sni-sysv4*) -$as_echo "#define RELIANTUNIX_CLOCK 1" >>confdefs.h +printf "%s\n" "#define RELIANTUNIX_CLOCK 1" >>confdefs.h esac case "$host" in *-*-sco3.2v5*) -$as_echo "#define SCO5_CLOCK 1" >>confdefs.h +printf "%s\n" "#define SCO5_CLOCK 1" >>confdefs.h esac ntp_cv_make_tickadj=yes case "$can_kmem$ac_cv_var_tick$default_tickadj" in nonono) # Don't read KMEM, no presets. Bogus. - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj." >&5 -$as_echo "$as_me: WARNING: Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj." >&5 +printf "%s\n" "$as_me: WARNING: Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj." >&2;} ntp_cv_make_tickadj=no ;; nono*) # Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus. - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't read kmem but no PRESET_TICK. No tickadj." >&5 -$as_echo "$as_me: WARNING: Can't read kmem but no PRESET_TICK. No tickadj." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Can't read kmem but no PRESET_TICK. No tickadj." >&5 +printf "%s\n" "$as_me: WARNING: Can't read kmem but no PRESET_TICK. No tickadj." >&2;} ntp_cv_make_tickadj=no ;; no*no) # Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ. Bogus. - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't read kmem but no PRESET_TICKADJ. No tickadj." >&5 -$as_echo "$as_me: WARNING: Can't read kmem but no PRESET_TICKADJ. No tickadj." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Can't read kmem but no PRESET_TICKADJ. No tickadj." >&5 +printf "%s\n" "$as_me: WARNING: Can't read kmem but no PRESET_TICKADJ. No tickadj." >&2;} ntp_cv_make_tickadj=no ;; no*) # Don't read KMEM, PRESET_TICK and PRESET_TICKADJ. Cool. @@ -31476,8 +32687,8 @@ $as_echo "$as_me: WARNING: Can't read kmem but no PRESET_TICKADJ. No tickadj." yesnono) # Read KMEM, no presets. Cool. ;; yesno*) # Read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus. - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: PRESET_TICKADJ is defined but not PRESET_TICK. Please report this." >&5 -$as_echo "$as_me: WARNING: PRESET_TICKADJ is defined but not PRESET_TICK. Please report this." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: PRESET_TICKADJ is defined but not PRESET_TICK. Please report this." >&5 +printf "%s\n" "$as_me: WARNING: PRESET_TICKADJ is defined but not PRESET_TICK. Please report this." >&2;} ;; yes*no) # Read KMEM, PRESET_TICK but no PRESET_TICKADJ. Cool. ;; @@ -31489,11 +32700,12 @@ $as_echo "$as_me: WARNING: PRESET_TICKADJ is defined but not PRESET_TICK. Pleas esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want and can make the ntptime utility" >&5 -$as_echo_n "checking if we want and can make the ntptime utility... " >&6; } -if ${ac_cv_make_ntptime+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want and can make the ntptime utility" >&5 +printf %s "checking if we want and can make the ntptime utility... " >&6; } +if test ${ac_cv_make_ntptime+y} +then : + printf %s "(cached) " >&6 +else $as_nop case "$host" in *) case "$ntp_cv_struct_ntptimeval$ntp_cv_var_kernel_pll" in yesyes) @@ -31507,8 +32719,8 @@ else esac ac_cv_make_ntptime=$ans fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_make_ntptime" >&5 -$as_echo "$ac_cv_make_ntptime" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_make_ntptime" >&5 +printf "%s\n" "$ac_cv_make_ntptime" >&6; } case "$ac_cv_make_ntptime" in yes) MAKE_NTPTIME=ntptime @@ -31555,16 +32767,17 @@ esac # { ntp_cv_make_tickadj=; unset ntp_cv_make_tickadj;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want and can make the tickadj utility" >&5 -$as_echo_n "checking if we want and can make the tickadj utility... " >&6; } -if ${ntp_cv_make_tickadj+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want and can make the tickadj utility" >&5 +printf %s "checking if we want and can make the tickadj utility... " >&6; } +if test ${ntp_cv_make_tickadj+y} +then : + printf %s "(cached) " >&6 +else $as_nop ntp_cv_make_tickadj=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_make_tickadj" >&5 -$as_echo "$ntp_cv_make_tickadj" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_make_tickadj" >&5 +printf "%s\n" "$ntp_cv_make_tickadj" >&6; } case "$ntp_cv_make_tickadj" in yes) MAKE_TICKADJ=tickadj @@ -31582,11 +32795,12 @@ case "$ntp_cv_make_tickadj" in esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want and can make the timetrim utility" >&5 -$as_echo_n "checking if we want and can make the timetrim utility... " >&6; } -if ${ntp_cv_make_timetrim+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want and can make the timetrim utility" >&5 +printf %s "checking if we want and can make the timetrim utility... " >&6; } +if test ${ntp_cv_make_timetrim+y} +then : + printf %s "(cached) " >&6 +else $as_nop case "$host" in *-*-irix*) @@ -31602,8 +32816,8 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_make_timetrim" >&5 -$as_echo "$ntp_cv_make_timetrim" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_make_timetrim" >&5 +printf "%s\n" "$ntp_cv_make_timetrim" >&6; } case "$ntp_cv_make_timetrim" in yes) MAKE_TIMETRIM=timetrim @@ -31618,18 +32832,19 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to build the NTPD simulator" >&5 -$as_echo_n "checking if we want to build the NTPD simulator... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want to build the NTPD simulator" >&5 +printf %s "checking if we want to build the NTPD simulator... " >&6; } # Check whether --enable-simulator was given. -if test "${enable_simulator+set}" = set; then : +if test ${enable_simulator+y} +then : enableval=$enable_simulator; ans=$enableval -else +else $as_nop ans=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } case "$ans" in yes) MAKE_NTPDSIM=ntpdsim @@ -31656,13 +32871,14 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if sntp will be built" >&5 -$as_echo_n "checking if sntp will be built... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sntp will be built" >&5 +printf %s "checking if sntp will be built... " >&6; } # Check whether --with-sntp was given. -if test "${with_sntp+set}" = set; then : +if test ${with_sntp+y} +then : withval=$with_sntp; -else +else $as_nop with_sntp="${withsntp=yes}" fi @@ -31684,18 +32900,19 @@ else BUILD_SNTP_FALSE= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sntp" >&5 -$as_echo "$with_sntp" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sntp" >&5 +printf "%s\n" "$with_sntp" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to build ntpsnmpd" >&5 -$as_echo_n "checking if we want to build ntpsnmpd... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want to build ntpsnmpd" >&5 +printf %s "checking if we want to build ntpsnmpd... " >&6; } # Check whether --with-ntpsnmpd was given. -if test "${with_ntpsnmpd+set}" = set; then : +if test ${with_ntpsnmpd+y} +then : withval=$with_ntpsnmpd; ans=$withval -else +else $as_nop case "$PATH_NET_SNMP_CONFIG" in /*) ans=yes ;; @@ -31705,8 +32922,8 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } case "$ans" in yes) case "$PATH_NET_SNMP_CONFIG" in @@ -31740,25 +32957,26 @@ case "$ans" in CFLAGS=$SNMP_CFLAGS CPPFLAGS=$SNMP_CPPFLAGS - ac_fn_c_check_header_mongrel "$LINENO" "net-snmp/net-snmp-config.h" "ac_cv_header_net_snmp_net_snmp_config_h" "$ac_includes_default" -if test "x$ac_cv_header_net_snmp_net_snmp_config_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "net-snmp/net-snmp-config.h" "ac_cv_header_net_snmp_net_snmp_config_h" "$ac_includes_default" +if test "x$ac_cv_header_net_snmp_net_snmp_config_h" = xyes +then : MAKE_NTPSNMPD=ntpsnmpd -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: net-snmp-config present but net-snmp headers are not available!" >&5 -$as_echo "$as_me: WARNING: net-snmp-config present but net-snmp headers are not available!" >&2;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: net-snmp-config present but net-snmp headers are not available!" >&5 +printf "%s\n" "$as_me: WARNING: net-snmp-config present but net-snmp headers are not available!" >&2;} fi - # Do this last, as we're messing up LIBS. # check -lnetsnmp for netsnmp_daemonize LIBS=`$PATH_NET_SNMP_CONFIG --libs` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for netsnmp_daemonize in -lnetsnmp" >&5 -$as_echo_n "checking for netsnmp_daemonize in -lnetsnmp... " >&6; } -if ${ac_cv_lib_netsnmp_netsnmp_daemonize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for netsnmp_daemonize in -lnetsnmp" >&5 +printf %s "checking for netsnmp_daemonize in -lnetsnmp... " >&6; } +if test ${ac_cv_lib_netsnmp_netsnmp_daemonize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lnetsnmp $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31767,32 +32985,31 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char netsnmp_daemonize (); int -main () +main (void) { return netsnmp_daemonize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_netsnmp_netsnmp_daemonize=yes -else +else $as_nop ac_cv_lib_netsnmp_netsnmp_daemonize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netsnmp_netsnmp_daemonize" >&5 -$as_echo "$ac_cv_lib_netsnmp_netsnmp_daemonize" >&6; } -if test "x$ac_cv_lib_netsnmp_netsnmp_daemonize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netsnmp_netsnmp_daemonize" >&5 +printf "%s\n" "$ac_cv_lib_netsnmp_netsnmp_daemonize" >&6; } +if test "x$ac_cv_lib_netsnmp_netsnmp_daemonize" = xyes +then : ans=yes -else +else $as_nop ans=no fi @@ -31800,7 +33017,7 @@ fi case "$ans" in no) -$as_echo "#define NEED_NETSNMP_DAEMONIZE 1" >>confdefs.h +printf "%s\n" "#define NEED_NETSNMP_DAEMONIZE 1" >>confdefs.h esac @@ -31812,8 +33029,8 @@ $as_echo "#define NEED_NETSNMP_DAEMONIZE 1" >>confdefs.h { save_LIBS=; unset save_LIBS;} ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot build ntpsnmpd - net-snmp-config cannot be found" >&5 -$as_echo "$as_me: WARNING: Cannot build ntpsnmpd - net-snmp-config cannot be found" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Cannot build ntpsnmpd - net-snmp-config cannot be found" >&5 +printf "%s\n" "$as_me: WARNING: Cannot build ntpsnmpd - net-snmp-config cannot be found" >&2;} ;; esac ;; @@ -31829,8 +33046,8 @@ case "$MAKE_NTPSNMPD" in ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should always slew the time" >&5 -$as_echo_n "checking if we should always slew the time... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we should always slew the time" >&5 +printf %s "checking if we should always slew the time... " >&6; } # target-specific defaults @@ -31854,24 +33071,25 @@ esac # --enable-slew-always / --disable-slew-always overrides default # Check whether --enable-slew-always was given. -if test "${enable_slew_always+set}" = set; then : +if test ${enable_slew_always+y} +then : enableval=$enable_slew_always; ans=$enableval fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } case "$ans" in yes) -$as_echo "#define SLEWALWAYS 1" >>confdefs.h +printf "%s\n" "#define SLEWALWAYS 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should step and slew the time" >&5 -$as_echo_n "checking if we should step and slew the time... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we should step and slew the time" >&5 +printf %s "checking if we should step and slew the time... " >&6; } case "$host" in *-sni-sysv*) @@ -31900,24 +33118,25 @@ case "$host" in esac # Check whether --enable-step-slew was given. -if test "${enable_step_slew+set}" = set; then : +if test ${enable_step_slew+y} +then : enableval=$enable_step_slew; ans=$enableval fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } case "$ans" in yes) -$as_echo "#define STEP_SLEW 1" >>confdefs.h +printf "%s\n" "#define STEP_SLEW 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if ntpdate should step the time" >&5 -$as_echo_n "checking if ntpdate should step the time... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ntpdate should step the time" >&5 +printf %s "checking if ntpdate should step the time... " >&6; } case "$host" in *-apple-aux[23]*) @@ -31928,25 +33147,26 @@ case "$host" in esac # Check whether --enable-ntpdate-step was given. -if test "${enable_ntpdate_step+set}" = set; then : +if test ${enable_ntpdate_step+y} +then : enableval=$enable_ntpdate_step; ans=$enableval fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } case "$ans" in yes) -$as_echo "#define FORCE_NTPDATE_STEP 1" >>confdefs.h +printf "%s\n" "#define FORCE_NTPDATE_STEP 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should sync TODR clock every hour" >&5 -$as_echo_n "checking if we should sync TODR clock every hour... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we should sync TODR clock every hour" >&5 +printf %s "checking if we should sync TODR clock every hour... " >&6; } case "$host" in *-*-nextstep*) @@ -31961,25 +33181,26 @@ case "$host" in esac # Check whether --enable-hourly-todr-sync was given. -if test "${enable_hourly_todr_sync+set}" = set; then : +if test ${enable_hourly_todr_sync+y} +then : enableval=$enable_hourly_todr_sync; ans=$enableval fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } case "$ac_cv_var_sync_todr" in yes) -$as_echo "#define DOSYNCTODR 1" >>confdefs.h +printf "%s\n" "#define DOSYNCTODR 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should avoid kernel FLL bug" >&5 -$as_echo_n "checking if we should avoid kernel FLL bug... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we should avoid kernel FLL bug" >&5 +printf %s "checking if we should avoid kernel FLL bug... " >&6; } case "$host" in *-*-solaris2.6) @@ -32030,85 +33251,110 @@ case "$host" in esac # Check whether --enable-kernel-fll-bug was given. -if test "${enable_kernel_fll_bug+set}" = set; then : +if test ${enable_kernel_fll_bug+y} +then : enableval=$enable_kernel_fll_bug; ans=$enableval fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } case "$ans" in yes) -$as_echo "#define KERNEL_FLL_BUG 1" >>confdefs.h +printf "%s\n" "#define KERNEL_FLL_BUG 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want new session key behavior" >&5 -$as_echo_n "checking if we want new session key behavior... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want new session key behavior" >&5 +printf %s "checking if we want new session key behavior... " >&6; } # Check whether --enable-bug1243-fix was given. -if test "${enable_bug1243_fix+set}" = set; then : +if test ${enable_bug1243_fix+y} +then : enableval=$enable_bug1243_fix; ans=$enableval -else +else $as_nop ans=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } case "$ans" in no) -$as_echo "#define DISABLE_BUG1243_FIX 1" >>confdefs.h +printf "%s\n" "#define DISABLE_BUG1243_FIX 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want the explicit 127.0.0.0/8 martian filter" >&5 -$as_echo_n "checking if we want the explicit 127.0.0.0/8 martian filter... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want the explicit 127.0.0.0/8 martian filter" >&5 +printf %s "checking if we want the explicit 127.0.0.0/8 martian filter... " >&6; } # Check whether --enable-bug3020-fix was given. -if test "${enable_bug3020_fix+set}" = set; then : +if test ${enable_bug3020_fix+y} +then : enableval=$enable_bug3020_fix; ans=$enableval -else +else $as_nop ans=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } case "$ans" in yes) -$as_echo "#define ENABLE_BUG3020_FIX 1" >>confdefs.h +printf "%s\n" "#define ENABLE_BUG3020_FIX 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want correct mode7 fudgetime2 behavior" >&5 -$as_echo_n "checking if we want correct mode7 fudgetime2 behavior... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want correct mode7 fudgetime2 behavior" >&5 +printf %s "checking if we want correct mode7 fudgetime2 behavior... " >&6; } # Check whether --enable-bug3527-fix was given. -if test "${enable_bug3527_fix+set}" = set; then : +if test ${enable_bug3527_fix+y} +then : enableval=$enable_bug3527_fix; ans=$enableval -else +else $as_nop ans=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } case "$ans" in no) -$as_echo "#define DISABLE_BUG3527_FIX 1" >>confdefs.h +printf "%s\n" "#define DISABLE_BUG3527_FIX 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should use the IRIG sawtooth filter" >&5 -$as_echo_n "checking if we should use the IRIG sawtooth filter... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want a debug assert on an OOB KoD RATE value" >&5 +printf %s "checking if we want a debug assert on an OOB KoD RATE value... " >&6; } +# Check whether --enable-bug3767-fix was given. +if test ${enable_bug3767_fix+y} +then : + enableval=$enable_bug3767_fix; ans=$enableval +else $as_nop + ans=yes + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } +case "$ans" in + no) + +printf "%s\n" "#define DISABLE_BUG3767_FIX 1" >>confdefs.h + +esac + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we should use the IRIG sawtooth filter" >&5 +printf %s "checking if we should use the IRIG sawtooth filter... " >&6; } case "$host" in *-*-solaris2.[89]) @@ -32122,56 +33368,59 @@ case "$host" in esac # Check whether --enable-irig-sawtooth was given. -if test "${enable_irig_sawtooth+set}" = set; then : +if test ${enable_irig_sawtooth+y} +then : enableval=$enable_irig_sawtooth; ans=$enableval fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } case "$ans" in yes) -$as_echo "#define IRIG_SUCKS 1" >>confdefs.h +printf "%s\n" "#define IRIG_SUCKS 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should enable NIST lockclock scheme" >&5 -$as_echo_n "checking if we should enable NIST lockclock scheme... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we should enable NIST lockclock scheme" >&5 +printf %s "checking if we should enable NIST lockclock scheme... " >&6; } # Check whether --enable-nist was given. -if test "${enable_nist+set}" = set; then : +if test ${enable_nist+y} +then : enableval=$enable_nist; ans=$enableval -else +else $as_nop ans=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } case "$ans" in yes) -$as_echo "#define LOCKCLOCK 1" >>confdefs.h +printf "%s\n" "#define LOCKCLOCK 1" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want support for Samba's signing daemon" >&5 -$as_echo_n "checking if we want support for Samba's signing daemon... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want support for Samba's signing daemon" >&5 +printf %s "checking if we want support for Samba's signing daemon... " >&6; } # Check whether --enable-ntp-signd was given. -if test "${enable_ntp_signd+set}" = set; then : +if test ${enable_ntp_signd+y} +then : enableval=$enable_ntp_signd; ans=$enableval -else +else $as_nop ans=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 -$as_echo "$ans" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } case "$ans" in no) @@ -32189,27 +33438,60 @@ case "$ntp_signd_path" in ;; *) -$as_echo "#define HAVE_NTP_SIGND 1" >>confdefs.h +printf "%s\n" "#define HAVE_NTP_SIGND 1" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define NTP_SIGND_PATH "$ntp_signd_path" -_ACEOF +printf "%s\n" "#define NTP_SIGND_PATH \"$ntp_signd_path\"" >>confdefs.h ;; esac -for ac_header in libscf.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libscf.h" "ac_cv_header_libscf_h" "$ac_includes_default" -if test "x$ac_cv_header_libscf_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSCF_H 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want 'magic' PPS support" >&5 +printf %s "checking if we want 'magic' PPS support... " >&6; } +# Check whether --enable-magicpps was given. +if test ${enable_magicpps+y} +then : + enableval=$enable_magicpps; ans=$enableval +else $as_nop + ans=yes fi -done +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +printf "%s\n" "$ans" >&6; } +case "$ans" in + yes) + +printf "%s\n" "#define ENABLE_MAGICPPS 1" >>confdefs.h + + ac_fn_c_check_func "$LINENO" "openat" "ac_cv_func_openat" +if test "x$ac_cv_func_openat" = xyes +then : + printf "%s\n" "#define HAVE_OPENAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fdopendir" "ac_cv_func_fdopendir" +if test "x$ac_cv_func_fdopendir" = xyes +then : + printf "%s\n" "#define HAVE_FDOPENDIR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fstatat" "ac_cv_func_fstatat" +if test "x$ac_cv_func_fstatat" = xyes +then : + printf "%s\n" "#define HAVE_FSTATAT 1" >>confdefs.h + +fi + + ;; +esac + +ac_fn_c_check_header_compile "$LINENO" "libscf.h" "ac_cv_header_libscf_h" "$ac_includes_default" +if test "x$ac_cv_header_libscf_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBSCF_H 1" >>confdefs.h + +fi LSCF= case "$ac_cv_header_libscf_h" in @@ -32220,11 +33502,12 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockaddr_storage" >&5 -$as_echo_n "checking for struct sockaddr_storage... " >&6; } -if ${ntp_cv_sockaddr_storage+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct sockaddr_storage" >&5 +printf %s "checking for struct sockaddr_storage... " >&6; } +if test ${ntp_cv_sockaddr_storage+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -32239,7 +33522,7 @@ else #endif int -main () +main (void) { struct sockaddr_storage n; @@ -32249,27 +33532,29 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_sockaddr_storage=yes -else +else $as_nop ntp_cv_sockaddr_storage=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_sockaddr_storage" >&5 -$as_echo "$ntp_cv_sockaddr_storage" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_sockaddr_storage" >&5 +printf "%s\n" "$ntp_cv_sockaddr_storage" >&6; } case "$ntp_cv_sockaddr_storage" in yes) -$as_echo "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h +printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage.__ss_family" >&5 -$as_echo_n "checking for sockaddr_storage.__ss_family... " >&6; } -if ${ntp_cv_have___ss_family+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage.__ss_family" >&5 +printf %s "checking for sockaddr_storage.__ss_family... " >&6; } +if test ${ntp_cv_have___ss_family+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -32284,7 +33569,7 @@ else #endif int -main () +main (void) { struct sockaddr_storage s; @@ -32295,21 +33580,22 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_have___ss_family=yes -else +else $as_nop ntp_cv_have___ss_family=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_have___ss_family" >&5 -$as_echo "$ntp_cv_have___ss_family" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_have___ss_family" >&5 +printf "%s\n" "$ntp_cv_have___ss_family" >&6; } case "$ntp_cv_have___ss_family" in yes) -$as_echo "#define HAVE___SS_FAMILY_IN_SS 1" >>confdefs.h +printf "%s\n" "#define HAVE___SS_FAMILY_IN_SS 1" >>confdefs.h esac @@ -32319,11 +33605,12 @@ esac # # Look for in_port_t. # -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in_port_t" >&5 -$as_echo_n "checking for in_port_t... " >&6; } -if ${isc_cv_have_in_port_t+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for in_port_t" >&5 +printf %s "checking for in_port_t... " >&6; } +if test ${isc_cv_have_in_port_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -32331,7 +33618,7 @@ else #include int -main () +main (void) { in_port_t port = 25; @@ -32342,29 +33629,31 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : isc_cv_have_in_port_t=yes -else +else $as_nop isc_cv_have_in_port_t=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_in_port_t" >&5 -$as_echo "$isc_cv_have_in_port_t" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_in_port_t" >&5 +printf "%s\n" "$isc_cv_have_in_port_t" >&6; } case "$isc_cv_have_in_port_t" in no) -$as_echo "#define ISC_PLATFORM_NEEDPORTT 1" >>confdefs.h +printf "%s\n" "#define ISC_PLATFORM_NEEDPORTT 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking type of socklen arg for getsockname()" >&5 -$as_echo_n "checking type of socklen arg for getsockname()... " >&6; } -if ${ntp_cv_getsockname_socklen_type+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking type of socklen arg for getsockname()" >&5 +printf %s "checking type of socklen arg for getsockname()... " >&6; } +if test ${ntp_cv_getsockname_socklen_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop getsockname_socklen_type_found=no for getsockname_arg2 in 'struct sockaddr *' 'void *'; do @@ -32380,7 +33669,7 @@ else #endif int -main () +main (void) { extern @@ -32392,10 +33681,11 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : getsockname_socklen_type_found=yes ; break 2 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done done case "$getsockname_socklen_type_found" in @@ -32407,19 +33697,18 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_getsockname_socklen_type" >&5 -$as_echo "$ntp_cv_getsockname_socklen_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_getsockname_socklen_type" >&5 +printf "%s\n" "$ntp_cv_getsockname_socklen_type" >&6; } -cat >>confdefs.h <<_ACEOF -#define GETSOCKNAME_SOCKLEN_TYPE $ntp_cv_getsockname_socklen_type -_ACEOF +printf "%s\n" "#define GETSOCKNAME_SOCKLEN_TYPE $ntp_cv_getsockname_socklen_type" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr for sa_len" >&5 -$as_echo_n "checking struct sockaddr for sa_len... " >&6; } -if ${isc_cv_platform_havesalen+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking struct sockaddr for sa_len" >&5 +printf %s "checking struct sockaddr for sa_len... " >&6; } +if test ${isc_cv_platform_havesalen+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -32427,7 +33716,7 @@ else #include int -main () +main (void) { extern struct sockaddr *ps; @@ -32438,26 +33727,28 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : isc_cv_platform_havesalen=yes -else +else $as_nop isc_cv_platform_havesalen=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_platform_havesalen" >&5 -$as_echo "$isc_cv_platform_havesalen" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $isc_cv_platform_havesalen" >&5 +printf "%s\n" "$isc_cv_platform_havesalen" >&6; } case "$isc_cv_platform_havesalen" in yes) -$as_echo "#define ISC_PLATFORM_HAVESALEN 1" >>confdefs.h +printf "%s\n" "#define ISC_PLATFORM_HAVESALEN 1" >>confdefs.h esac # Check whether --enable-ipv6 was given. -if test "${enable_ipv6+set}" = set; then : +if test ${enable_ipv6+y} +then : enableval=$enable_ipv6; fi @@ -32469,7 +33760,7 @@ case "$enable_ipv6" in ;; *) -$as_echo "#define WANT_IPV6 1" >>confdefs.h +printf "%s\n" "#define WANT_IPV6 1" >>confdefs.h ;; esac @@ -32482,16 +33773,17 @@ esac case "$host" in *-*-darwin*) -$as_echo "#define __APPLE_USE_RFC_3542 1" >>confdefs.h +printf "%s\n" "#define __APPLE_USE_RFC_3542 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 structures" >&5 -$as_echo_n "checking for IPv6 structures... " >&6; } -if ${isc_cv_found_ipv6+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IPv6 structures" >&5 +printf %s "checking for IPv6 structures... " >&6; } +if test ${isc_cv_found_ipv6+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -32500,7 +33792,7 @@ else #include int -main () +main (void) { struct sockaddr_in6 sin6; @@ -32510,29 +33802,31 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : isc_cv_found_ipv6=yes -else +else $as_nop isc_cv_found_ipv6=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_found_ipv6" >&5 -$as_echo "$isc_cv_found_ipv6" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $isc_cv_found_ipv6" >&5 +printf "%s\n" "$isc_cv_found_ipv6" >&6; } # # See whether IPv6 support is provided via a Kame add-on. # This is done before other IPv6 linking tests so LIBS is properly set. # -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kame IPv6 support" >&5 -$as_echo_n "checking for Kame IPv6 support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Kame IPv6 support" >&5 +printf %s "checking for Kame IPv6 support... " >&6; } # Check whether --with-kame was given. -if test "${with_kame+set}" = set; then : +if test ${with_kame+y} +then : withval=$with_kame; use_kame="$withval" -else +else $as_nop use_kame="no" fi @@ -32549,13 +33843,13 @@ case "$use_kame" in esac case "$use_kame" in no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; *) if test -f $kame_path/lib/libinet6.a; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kame_path/lib/libinet6.a" >&5 -$as_echo "$kame_path/lib/libinet6.a" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $kame_path/lib/libinet6.a" >&5 +printf "%s\n" "$kame_path/lib/libinet6.a" >&6; } LIBS="-L$kame_path/lib -linet6 $LIBS" else as_fn_error $? "$kame_path/lib/libinet6.a not found. @@ -32579,7 +33873,7 @@ esac case "$host" in *-bsdi4.[01]*) -$as_echo "#define ISC_PLATFORM_NEEDNETINET6IN6H 1" >>confdefs.h +printf "%s\n" "#define ISC_PLATFORM_NEEDNETINET6IN6H 1" >>confdefs.h isc_netinet6in6_hack="#include " ;; @@ -32594,7 +33888,7 @@ esac case "$host" in *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*) -$as_echo "#define ISC_PLATFORM_FIXIN6ISADDR 1" >>confdefs.h +printf "%s\n" "#define ISC_PLATFORM_FIXIN6ISADDR 1" >>confdefs.h isc_netinetin6_hack="#include " ;; @@ -32607,13 +33901,14 @@ esac case "$isc_cv_found_ipv6" in yes) -$as_echo "#define ISC_PLATFORM_HAVEIPV6 1" >>confdefs.h +printf "%s\n" "#define ISC_PLATFORM_HAVEIPV6 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6_pktinfo" >&5 -$as_echo_n "checking for in6_pktinfo... " >&6; } -if ${isc_cv_have_in6_pktinfo+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for in6_pktinfo" >&5 +printf %s "checking for in6_pktinfo... " >&6; } +if test ${isc_cv_have_in6_pktinfo+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -32624,7 +33919,7 @@ else $isc_netinet6in6_hack int -main () +main (void) { struct in6_pktinfo xyzzy; @@ -32634,31 +33929,33 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : isc_cv_have_in6_pktinfo=yes -else +else $as_nop isc_cv_have_in6_pktinfo=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_in6_pktinfo" >&5 -$as_echo "$isc_cv_have_in6_pktinfo" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_in6_pktinfo" >&5 +printf "%s\n" "$isc_cv_have_in6_pktinfo" >&6; } case "$isc_cv_have_in6_pktinfo" in yes) -$as_echo "#define ISC_PLATFORM_HAVEIN6PKTINFO 1" >>confdefs.h +printf "%s\n" "#define ISC_PLATFORM_HAVEIN6PKTINFO 1" >>confdefs.h esac # HMS: Use HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID instead? - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_in6.sin6_scope_id" >&5 -$as_echo_n "checking for sockaddr_in6.sin6_scope_id... " >&6; } -if ${isc_cv_have_sin6_scope_id+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sockaddr_in6.sin6_scope_id" >&5 +printf %s "checking for sockaddr_in6.sin6_scope_id... " >&6; } +if test ${isc_cv_have_sin6_scope_id+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -32669,7 +33966,7 @@ else $isc_netinet6in6_hack int -main () +main (void) { struct sockaddr_in6 xyzzy; @@ -32680,22 +33977,23 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : isc_cv_have_sin6_scope_id=yes -else +else $as_nop isc_cv_have_sin6_scope_id=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_sin6_scope_id" >&5 -$as_echo "$isc_cv_have_sin6_scope_id" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_sin6_scope_id" >&5 +printf "%s\n" "$isc_cv_have_sin6_scope_id" >&6; } case "$isc_cv_have_sin6_scope_id" in yes) -$as_echo "#define ISC_PLATFORM_HAVESCOPEID 1" >>confdefs.h +printf "%s\n" "#define ISC_PLATFORM_HAVESCOPEID 1" >>confdefs.h esac esac @@ -32703,11 +34001,12 @@ esac # We need this check run even without isc_cv_found_ipv6=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6addr_any" >&5 -$as_echo_n "checking for in6addr_any... " >&6; } -if ${isc_cv_in6addr_any_links+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for in6addr_any" >&5 +printf %s "checking for in6addr_any... " >&6; } +if test ${isc_cv_in6addr_any_links+y} +then : + printf %s "(cached) " >&6 +else $as_nop SAVED_LIBS="$LIBS" LIBS="$LDADD_LIBNTP $LIBS" @@ -32720,7 +34019,7 @@ $ac_includes_default $isc_netinet6in6_hack int -main () +main (void) { printf("%x", in6addr_any.s6_addr[15]); @@ -32730,35 +34029,37 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : isc_cv_in6addr_any_links=yes -else +else $as_nop isc_cv_in6addr_any_links=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$SAVED_LIBS" { SAVED_LIBS=; unset SAVED_LIBS;} fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_in6addr_any_links" >&5 -$as_echo "$isc_cv_in6addr_any_links" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $isc_cv_in6addr_any_links" >&5 +printf "%s\n" "$isc_cv_in6addr_any_links" >&6; } case "$isc_cv_in6addr_any_links" in no) -$as_echo "#define ISC_PLATFORM_NEEDIN6ADDRANY 1" >>confdefs.h +printf "%s\n" "#define ISC_PLATFORM_NEEDIN6ADDRANY 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct if_laddrconf" >&5 -$as_echo_n "checking for struct if_laddrconf... " >&6; } -if ${isc_cv_struct_if_laddrconf+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct if_laddrconf" >&5 +printf %s "checking for struct if_laddrconf... " >&6; } +if test ${isc_cv_struct_if_laddrconf+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -32766,7 +34067,7 @@ else #include int -main () +main (void) { struct if_laddrconf a; @@ -32776,30 +34077,32 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : isc_cv_struct_if_laddrconf=yes -else +else $as_nop isc_cv_struct_if_laddrconf=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_struct_if_laddrconf" >&5 -$as_echo "$isc_cv_struct_if_laddrconf" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $isc_cv_struct_if_laddrconf" >&5 +printf "%s\n" "$isc_cv_struct_if_laddrconf" >&6; } case "$isc_cv_struct_if_laddrconf" in yes) -$as_echo "#define ISC_PLATFORM_HAVEIF_LADDRCONF 1" >>confdefs.h +printf "%s\n" "#define ISC_PLATFORM_HAVEIF_LADDRCONF 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct if_laddrreq" >&5 -$as_echo_n "checking for struct if_laddrreq... " >&6; } -if ${isc_cv_struct_if_laddrreq+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct if_laddrreq" >&5 +printf %s "checking for struct if_laddrreq... " >&6; } +if test ${isc_cv_struct_if_laddrreq+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -32807,7 +34110,7 @@ else #include int -main () +main (void) { struct if_laddrreq a; @@ -32817,30 +34120,32 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : isc_cv_struct_if_laddrreq=yes -else +else $as_nop isc_cv_struct_if_laddrreq=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_struct_if_laddrreq" >&5 -$as_echo "$isc_cv_struct_if_laddrreq" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $isc_cv_struct_if_laddrreq" >&5 +printf "%s\n" "$isc_cv_struct_if_laddrreq" >&6; } case "$isc_cv_struct_if_laddrreq" in yes) -$as_echo "#define ISC_PLATFORM_HAVEIF_LADDRREQ 1" >>confdefs.h +printf "%s\n" "#define ISC_PLATFORM_HAVEIF_LADDRREQ 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for multicast IP support" >&5 -$as_echo_n "checking for multicast IP support... " >&6; } -if ${ntp_cv_multicast+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for multicast IP support" >&5 +printf %s "checking for multicast IP support... " >&6; } +if test ${ntp_cv_multicast+y} +then : + printf %s "(cached) " >&6 +else $as_nop ntp_cv_multicast=no case "$host" in @@ -32855,7 +34160,7 @@ else #endif int -main () +main (void) { struct ip_mreq ipmr; @@ -32866,27 +34171,29 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ntp_cv_multicast=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_multicast" >&5 -$as_echo "$ntp_cv_multicast" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_multicast" >&5 +printf "%s\n" "$ntp_cv_multicast" >&6; } case "$ntp_cv_multicast" in yes) -$as_echo "#define MCAST 1" >>confdefs.h +printf "%s\n" "#define MCAST 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking arg type needed for setsockopt() IP*_MULTICAST_LOOP" >&5 -$as_echo_n "checking arg type needed for setsockopt() IP*_MULTICAST_LOOP... " >&6; } -if ${ntp_cv_typeof_ip_multicast_loop+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking arg type needed for setsockopt() IP*_MULTICAST_LOOP" >&5 +printf %s "checking arg type needed for setsockopt() IP*_MULTICAST_LOOP... " >&6; } +if test ${ntp_cv_typeof_ip_multicast_loop+y} +then : + printf %s "(cached) " >&6 +else $as_nop case "$host" in *-*-netbsd*|*-*-*linux*) @@ -32899,19 +34206,18 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_typeof_ip_multicast_loop" >&5 -$as_echo "$ntp_cv_typeof_ip_multicast_loop" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_typeof_ip_multicast_loop" >&5 +printf "%s\n" "$ntp_cv_typeof_ip_multicast_loop" >&6; } -cat >>confdefs.h <<_ACEOF -#define TYPEOF_IP_MULTICAST_LOOP $ntp_cv_typeof_ip_multicast_loop -_ACEOF +printf "%s\n" "#define TYPEOF_IP_MULTICAST_LOOP $ntp_cv_typeof_ip_multicast_loop" >>confdefs.h esac # Check whether --enable-getifaddrs was given. -if test "${enable_getifaddrs+set}" = set; then : +if test ${enable_getifaddrs+y} +then : enableval=$enable_getifaddrs; want_getifaddrs="$enableval" -else +else $as_nop want_getifaddrs="yes" fi @@ -32919,8 +34225,8 @@ fi case $want_getifaddrs in glibc) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-getifaddrs=glibc is no longer required" >&5 -$as_echo "$as_me: WARNING: --enable-getifaddrs=glibc is no longer required" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: --enable-getifaddrs=glibc is no longer required" >&5 +printf "%s\n" "$as_me: WARNING: --enable-getifaddrs=glibc is no longer required" >&2;} esac case $want_getifaddrs in no) @@ -32928,16 +34234,12 @@ case $want_getifaddrs in *) SAVED_LIBS="$LIBS" LIBS="$LDADD_LIBNTP $LIBS" - for ac_func in getifaddrs -do : - ac_fn_c_check_func "$LINENO" "getifaddrs" "ac_cv_func_getifaddrs" -if test "x$ac_cv_func_getifaddrs" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETIFADDRS 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "getifaddrs" "ac_cv_func_getifaddrs" +if test "x$ac_cv_func_getifaddrs" = xyes +then : + printf "%s\n" "#define HAVE_GETIFADDRS 1" >>confdefs.h fi -done LIBS="$SAVED_LIBS" { SAVED_LIBS=; unset SAVED_LIBS;} @@ -32949,11 +34251,12 @@ esac # case "$host" in *-hp-hpux*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing if_nametoindex" >&5 -$as_echo_n "checking for library containing if_nametoindex... " >&6; } -if ${ac_cv_search_if_nametoindex+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing if_nametoindex" >&5 +printf %s "checking for library containing if_nametoindex... " >&6; } +if test ${ac_cv_search_if_nametoindex+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -32961,46 +34264,48 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char if_nametoindex (); int -main () +main (void) { return if_nametoindex (); ; return 0; } _ACEOF -for ac_lib in '' ipv6; do +for ac_lib in '' ipv6 +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_if_nametoindex=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_if_nametoindex+:} false; then : + if test ${ac_cv_search_if_nametoindex+y} +then : break fi done -if ${ac_cv_search_if_nametoindex+:} false; then : +if test ${ac_cv_search_if_nametoindex+y} +then : -else +else $as_nop ac_cv_search_if_nametoindex=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_if_nametoindex" >&5 -$as_echo "$ac_cv_search_if_nametoindex" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_if_nametoindex" >&5 +printf "%s\n" "$ac_cv_search_if_nametoindex" >&6; } ac_res=$ac_cv_search_if_nametoindex -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi @@ -33008,23 +34313,19 @@ fi esac SAVED_LIBS="$LIBS" LIBS="$LDADD_LIBNTP $LIBS" -for ac_func in if_nametoindex -do : - ac_fn_c_check_func "$LINENO" "if_nametoindex" "ac_cv_func_if_nametoindex" -if test "x$ac_cv_func_if_nametoindex" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_IF_NAMETOINDEX 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "if_nametoindex" "ac_cv_func_if_nametoindex" +if test "x$ac_cv_func_if_nametoindex" = xyes +then : + printf "%s\n" "#define HAVE_IF_NAMETOINDEX 1" >>confdefs.h fi -done LIBS="$SAVED_LIBS" { SAVED_LIBS=; unset SAVED_LIBS;} case "$ac_cv_func_if_nametoindex" in yes) -$as_echo "#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1" >>confdefs.h +printf "%s\n" "#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1" >>confdefs.h esac @@ -33034,11 +34335,12 @@ esac # # Look for a sysctl call to get the list of network interfaces. # -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for interface list sysctl" >&5 -$as_echo_n "checking for interface list sysctl... " >&6; } -if ${ntp_cv_iflist_sysctl+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for interface list sysctl" >&5 +printf %s "checking for interface list sysctl... " >&6; } +if test ${ntp_cv_iflist_sysctl+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -33050,32 +34352,34 @@ else #endif _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : ntp_cv_iflist_sysctl=yes -else +else $as_nop ntp_cv_iflist_sysctl=no fi rm -f conftest.err conftest.i conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_iflist_sysctl" >&5 -$as_echo "$ntp_cv_iflist_sysctl" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_iflist_sysctl" >&5 +printf "%s\n" "$ntp_cv_iflist_sysctl" >&6; } case "$ntp_cv_iflist_sysctl" in yes) -$as_echo "#define HAVE_IFLIST_SYSCTL 1" >>confdefs.h +printf "%s\n" "#define HAVE_IFLIST_SYSCTL 1" >>confdefs.h esac ### -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want the saveconfig mechanism" >&5 -$as_echo_n "checking if we want the saveconfig mechanism... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want the saveconfig mechanism" >&5 +printf %s "checking if we want the saveconfig mechanism... " >&6; } # Check whether --enable-saveconfig was given. -if test "${enable_saveconfig+set}" = set; then : +if test ${enable_saveconfig+y} +then : enableval=$enable_saveconfig; ntp_ok=$enableval -else +else $as_nop ntp_ok=yes fi @@ -33085,7 +34389,7 @@ case "$ntp_ok" in yes) ntp_saveconfig_enabled=1 -$as_echo "#define SAVECONFIG 1" >>confdefs.h +printf "%s\n" "#define SAVECONFIG 1" >>confdefs.h ;; esac @@ -33097,17 +34401,18 @@ else SAVECONFIG_ENABLED_FALSE= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } ### -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want the experimental leap smear code" >&5 -$as_echo_n "checking if we want the experimental leap smear code... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want the experimental leap smear code" >&5 +printf %s "checking if we want the experimental leap smear code... " >&6; } # Check whether --enable-leap-smear was given. -if test "${enable_leap_smear+set}" = set; then : +if test ${enable_leap_smear+y} +then : enableval=$enable_leap_smear; ntp_ok=$enableval -else +else $as_nop ntp_ok=no fi @@ -33117,23 +34422,24 @@ case "$ntp_ok" in yes) ntp_leap_smear_enabled=1 -$as_echo "#define LEAP_SMEAR 1" >>confdefs.h +printf "%s\n" "#define LEAP_SMEAR 1" >>confdefs.h HAVE_LEAPSMEARINTERVAL="leapsmearinterval 0" ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } ### -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want dynamic interleave support" >&5 -$as_echo_n "checking if we want dynamic interleave support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want dynamic interleave support" >&5 +printf %s "checking if we want dynamic interleave support... " >&6; } # Check whether --enable-dynamic-interleave was given. -if test "${enable_dynamic_interleave+set}" = set; then : +if test ${enable_dynamic_interleave+y} +then : enableval=$enable_dynamic_interleave; ntp_ok=$enableval -else +else $as_nop ntp_ok=no fi @@ -33145,23 +34451,22 @@ case "$ntp_ok" in ;; esac -cat >>confdefs.h <<_ACEOF -#define DYNAMIC_INTERLEAVE $ntp_dynamic_interleave -_ACEOF +printf "%s\n" "#define DYNAMIC_INTERLEAVE $ntp_dynamic_interleave" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 -$as_echo "$ntp_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5 +printf "%s\n" "$ntp_ok" >&6; } # We may not need have_unity have_unity=false # Extract the first word of "ruby", so it can be a program name with args. set dummy ruby; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PATH_RUBY+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PATH_RUBY+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PATH_RUBY in [\\/]* | ?:[\\/]*) ac_cv_path_PATH_RUBY="$PATH_RUBY" # Let the user override the test with a path. @@ -33171,11 +34476,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PATH_RUBY="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PATH_RUBY="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -33187,11 +34496,11 @@ esac fi PATH_RUBY=$ac_cv_path_PATH_RUBY if test -n "$PATH_RUBY"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_RUBY" >&5 -$as_echo "$PATH_RUBY" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PATH_RUBY" >&5 +printf "%s\n" "$PATH_RUBY" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -33215,126 +34524,27 @@ fi -gta=false - -# Check whether --with-gtest was given. -if test "${with_gtest+set}" = set; then : - withval=$with_gtest; try_gtest=$withval -else - try_gtest=yes - -fi - -case "$try_gtest" in - yes) - # Extract the first word of "gtest-config", so it can be a program name with args. -set dummy gtest-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GTEST_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GTEST_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_GTEST_CONFIG="$GTEST_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GTEST_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -GTEST_CONFIG=$ac_cv_path_GTEST_CONFIG -if test -n "$GTEST_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTEST_CONFIG" >&5 -$as_echo "$GTEST_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - { ac_cv_path_GTEST_CONFIG=; unset ac_cv_path_GTEST_CONFIG;} - case x${GTEST_CONFIG} in - x) ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking gtest version" >&5 -$as_echo_n "checking gtest version... " >&6; } - gtest_version_test=`$GTEST_CONFIG --min-version=1.5 || echo toolow` - case "$gtest_version_test" in - toolow*) - ;; - *) - GTEST_LDFLAGS=`$GTEST_CONFIG --ldflags` - GTEST_LIBS=`$GTEST_CONFIG --libs` - GTEST_CXXFLAGS=`$GTEST_CONFIG --cxxflags` - GTEST_CPPFLAGS=`$GTEST_CONFIG --cppflags` - - - - - gta=true - ;; - esac - gtest_version=`$GTEST_CONFIG --version` - case "$gta" in - true) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ($gtest_version) ok" >&5 -$as_echo "($gtest_version) ok" >&6; } - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ($gtest_version) not ok" >&5 -$as_echo "($gtest_version) not ok" >&6; } - ;; - esac - { gtest_version_test=; unset gtest_version_test;} - { gtest_version=; unset gtest_version;} - esac -esac - if $gta; then - GTEST_AVAILABLE_TRUE= - GTEST_AVAILABLE_FALSE='#' -else - GTEST_AVAILABLE_TRUE='#' - GTEST_AVAILABLE_FALSE= -fi - - - - - case "$build" in $host) cross=0 ;; *) cross=1 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to enable tests with undiagnosed problems" >&5 -$as_echo_n "checking if we want to enable tests with undiagnosed problems... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we want to enable tests with undiagnosed problems" >&5 +printf %s "checking if we want to enable tests with undiagnosed problems... " >&6; } # Check whether --enable-problem-tests was given. -if test "${enable_problem_tests+set}" = set; then : +if test ${enable_problem_tests+y} +then : enableval=$enable_problem_tests; ntp_ept=$enableval -else +else $as_nop ntp_ept=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ept" >&5 -$as_echo "$ntp_ept" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_ept" >&5 +printf "%s\n" "$ntp_ept" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can run test-ntp_restrict" >&5 -$as_echo_n "checking if we can run test-ntp_restrict... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can run test-ntp_restrict" >&5 +printf %s "checking if we can run test-ntp_restrict... " >&6; } ntp_test_ntp_restrict="no" case "$ntp_ept:$cross:$host" in no:0:*-*-freebsd6.4) ;; @@ -33346,8 +34556,8 @@ case "$ntp_cv_gc_sections_runs" in no) ntp_test_ntp_restrict="no" ;; * ) ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_test_ntp_restrict" >&5 -$as_echo "$ntp_test_ntp_restrict" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_test_ntp_restrict" >&5 +printf "%s\n" "$ntp_test_ntp_restrict" >&6; } if test x$ntp_test_ntp_restrict = xyes; then BUILD_TEST_NTP_RESTRICT_TRUE= BUILD_TEST_NTP_RESTRICT_FALSE='#' @@ -33357,8 +34567,8 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can run test-ntp_scanner" >&5 -$as_echo_n "checking if we can run test-ntp_scanner... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can run test-ntp_scanner" >&5 +printf %s "checking if we can run test-ntp_scanner... " >&6; } ntp_test_ntp_scanner="no" case "$ntp_ept:$cross:$host" in no:0:*-*-freebsd6.4) ;; @@ -33369,8 +34579,8 @@ case "$ntp_cv_gc_sections_runs" in no) ntp_test_ntp_scanner="no" ;; * ) ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_test_ntp_scanner" >&5 -$as_echo "$ntp_test_ntp_scanner" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_test_ntp_scanner" >&5 +printf "%s\n" "$ntp_test_ntp_scanner" >&6; } if test x$ntp_test_ntp_scanner = xyes; then BUILD_TEST_NTP_SCANNER_TRUE= BUILD_TEST_NTP_SCANNER_FALSE='#' @@ -33380,8 +34590,8 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can run test-ntp_signd" >&5 -$as_echo_n "checking if we can run test-ntp_signd... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can run test-ntp_signd" >&5 +printf %s "checking if we can run test-ntp_signd... " >&6; } ntp_test_ntp_signd="no" case "$ntp_ept:$cross:$host" in no:0:*-*-freebsd6.4) ;; @@ -33392,8 +34602,8 @@ case "$ntp_cv_gc_sections_runs" in no) ntp_test_ntp_signd="no" ;; * ) ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_test_ntp_signd" >&5 -$as_echo "$ntp_test_ntp_signd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ntp_test_ntp_signd" >&5 +printf "%s\n" "$ntp_test_ntp_signd" >&6; } if test x$ntp_test_ntp_signd = xyes; then BUILD_TEST_NTP_SIGND_TRUE= BUILD_TEST_NTP_SIGND_FALSE='#' @@ -33407,28 +34617,24 @@ fi ### -ac_fn_c_check_decl "$LINENO" "sigsetjmp" "ac_cv_have_decl_sigsetjmp" "#include -" -if test "x$ac_cv_have_decl_sigsetjmp" = xyes; then : +ac_fn_check_decl "$LINENO" "sigsetjmp" "ac_cv_have_decl_sigsetjmp" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_sigsetjmp" = xyes +then : ac_have_decl=1 -else +else $as_nop ac_have_decl=0 fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SIGSETJMP $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "siglongjmp" "ac_cv_have_decl_siglongjmp" "#include -" -if test "x$ac_cv_have_decl_siglongjmp" = xyes; then : +printf "%s\n" "#define HAVE_DECL_SIGSETJMP $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "siglongjmp" "ac_cv_have_decl_siglongjmp" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_siglongjmp" = xyes +then : ac_have_decl=1 -else +else $as_nop ac_have_decl=0 fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SIGLONGJMP $ac_have_decl -_ACEOF +printf "%s\n" "#define HAVE_DECL_SIGLONGJMP $ac_have_decl" >>confdefs.h ### @@ -33443,9 +34649,7 @@ _ACEOF NTP_KEYSDIR="$ac_define_dir" -cat >>confdefs.h <<_ACEOF -#define NTP_KEYSDIR "$ac_define_dir" -_ACEOF +printf "%s\n" "#define NTP_KEYSDIR \"$ac_define_dir\"" >>confdefs.h test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE @@ -33549,9 +34753,7 @@ perllibdir="${datadir}/ntp/lib" PERLLIBDIR="$ac_define_dir" -cat >>confdefs.h <<_ACEOF -#define PERLLIBDIR "$ac_define_dir" -_ACEOF +printf "%s\n" "#define PERLLIBDIR \"$ac_define_dir\"" >>confdefs.h test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE @@ -33602,8 +34804,8 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -33633,15 +34835,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -33655,8 +34857,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;} fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -33673,7 +34875,7 @@ U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -33684,14 +34886,14 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -33761,10 +34963,6 @@ if test -z "${UNITYBUILD_AVAILABLE_TRUE}" && test -z "${UNITYBUILD_AVAILABLE_FAL as_fn_error $? "conditional \"UNITYBUILD_AVAILABLE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${GTEST_AVAILABLE_TRUE}" && test -z "${GTEST_AVAILABLE_FALSE}"; then - as_fn_error $? "conditional \"GTEST_AVAILABLE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${BUILD_TEST_NTP_RESTRICT_TRUE}" && test -z "${BUILD_TEST_NTP_RESTRICT_FALSE}"; then as_fn_error $? "conditional \"BUILD_TEST_NTP_RESTRICT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -33782,8 +34980,8 @@ fi ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -33806,14 +35004,16 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -33823,46 +35023,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -33871,13 +35071,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -33886,8 +35079,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -33899,30 +35096,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -33935,13 +35112,14 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -33968,18 +35146,20 @@ as_fn_unset () { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -33991,12 +35171,13 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -34027,7 +35208,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -34049,6 +35230,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -34062,6 +35247,12 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -34103,7 +35294,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -34112,7 +35303,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -34174,8 +35365,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ntp $as_me 4.2.8p15, which was -generated by GNU Autoconf 2.69. Invocation command line was +This file was extended by ntp $as_me 4.2.8p16, which was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -34234,18 +35425,20 @@ $config_headers Configuration commands: $config_commands -Report bugs to . -ntp home page: ." +Report bugs to . +ntp home page: ." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -ntp config.status 4.2.8p15 -configured by $0, generated by GNU Autoconf 2.69, +ntp config.status 4.2.8p16 +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -34285,15 +35478,15 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -34301,7 +35494,7 @@ do --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -34310,7 +35503,7 @@ do as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -34338,7 +35531,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -34352,7 +35545,7 @@ exec 5>>config.log sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -34360,7 +35553,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout @@ -34710,9 +35903,9 @@ done # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -35082,7 +36275,7 @@ do esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -35090,17 +36283,17 @@ do # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -35117,7 +36310,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -35141,9 +36334,9 @@ $as_echo X"$ac_file" | case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -35205,8 +36398,8 @@ ac_sed_dataroot=' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -35255,9 +36448,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -35273,20 +36466,20 @@ which seems to be undefined. Please make sure it is defined" >&2;} # if test x"$ac_file" != x-; then { - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -35306,7 +36499,7 @@ $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | +printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -35326,8 +36519,8 @@ $as_echo X"$_am_arg" | s/.*/./; q'`/stamp-h$_am_stamp_count ;; - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -35337,29 +36530,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -35377,53 +36576,50 @@ $as_echo X"$mf" | q } s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } - /^X\(\/\/\)[^/].*/{ + /^X\/\(\/\/\)$/{ s//\1/ q } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ + /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? done + if test $am_rc -ne 0; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk } ;; "libtool":C) @@ -35954,6 +37150,7 @@ _LT_EOF esac + ltmain=$ac_aux_dir/ltmain.sh @@ -36054,7 +37251,7 @@ if test "$no_recursion" != yes; then ;; *) case $ac_arg in - *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_sub_configure_args " '$ac_arg'" ;; esac @@ -36064,7 +37261,7 @@ if test "$no_recursion" != yes; then # in subdir configurations. ac_arg="--prefix=$prefix" case $ac_arg in - *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" @@ -36085,17 +37282,17 @@ if test "$no_recursion" != yes; then test -d "$srcdir/$ac_dir" || continue ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" - $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 - $as_echo "$ac_msg" >&6 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 + printf "%s\n" "$ac_msg" >&6 as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -36125,17 +37322,15 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" - # Check for guested configure; otherwise get Cygnus style configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then ac_sub_configure=$ac_srcdir/configure.gnu elif test -f "$ac_srcdir/configure"; then ac_sub_configure=$ac_srcdir/configure - elif test -f "$ac_srcdir/configure.in"; then - # This should be Cygnus configure. - ac_sub_configure=$ac_aux_dir/configure else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 -$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 +printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_configure= fi @@ -36148,8 +37343,8 @@ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 -$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 +printf "%s\n" "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || @@ -36160,7 +37355,8 @@ $as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cach done fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi + diff --git a/configure.ac b/configure.ac index 5dc6aee02edc..c2dce35e800d 100644 --- a/configure.ac +++ b/configure.ac @@ -5,9 +5,9 @@ AC_PREREQ([2.68]) AC_INIT( [ntp], [VERSION_NUMBER], - [http://bugs.ntp.org./], + [https://bugs.ntp.org/], [], - [http://www.ntp.org./]dnl + [https://www.ntp.org/]dnl ) AC_CONFIG_MACRO_DIR([sntp/m4]) AC_CONFIG_AUX_DIR([sntp/libevent/build-aux]) @@ -35,14 +35,14 @@ AC_PRESERVE_HELP_ORDER # the date YYYYMMDD optionally with -HHMM if there is more than one # bump in a day. -ntp_configure_cache_version=20120806 +ntp_configure_cache_version=20230326 # When the cache version of config.cache and configure do not # match, NTP_CACHEVERSION will flush the cache. NTP_CACHEVERSION([main], [$ntp_configure_cache_version]) -AM_INIT_AUTOMAKE([1.15 foreign -Wall -Wno-gnu]) +AM_INIT_AUTOMAKE([1.15 foreign subdir-objects -Wall -Wno-gnu]) AM_SILENT_RULES([yes]) @@ -64,8 +64,6 @@ ntp_jupiter_ok=${ntp_jupiter_ok=no} NTP_PROG_CC NTP_COMPILER -dnl # Do we need CXX for anything besides google test? -dnl AC_PROG_CXX AC_PROG_YACC dnl AC_PROG_CC_C_O # called by NTP_COMPILER AX_C99_STRUCT_INIT @@ -76,11 +74,7 @@ NTP_VPATH_HACK dnl used only by ntpd/Makefile.am NTP_LOCINFO([sntp]) dnl takes over from NTP_BINDIR, in NTP_LIBNTP -dnl AM_PROG_AR req. automake 1.12 -m4_ifdef( - [AM_PROG_AR], - [AM_PROG_AR] -) +AM_PROG_AR # So far, the only shared library we might use is libopts. # It's a small library - we might as well use a static version of it. @@ -403,7 +397,7 @@ case "$ac_cv_header_stdatomic_h" in [[ atomic_thread_fence(memory_order_seq_cst); ]] - )] + )], [ntp_cv_func_atomic_thread_fence=yes], [ntp_cv_func_atomic_thread_fence=no] )] @@ -479,7 +473,7 @@ case "$have_adjtimex" in struct nlist n; n.n_un.n_name = 0; ]] - )] + )], [ntp_cv_struct_nlist_n_un=yes], [ntp_cv_struct_nlist_n_un=no] )] @@ -855,7 +849,9 @@ AC_CHECK_FUNCS( )] ) -AC_CHECK_FUNCS([fnmatch getbootfile getuid getrusage nanosleep strsignal]) +AC_CHECK_FUNCS([fnmatch getbootfile getuid getrusage nanosleep strsignal ]dnl + [strsignal closefrom getdtablesize]) + # kvm_open() is only used by tickadj. Also see above. case "$ac_cv_header_kvm_h" in @@ -900,6 +896,7 @@ case "$host" in ;; esac AC_CHECK_FUNCS([nice plock pututline pututxline readlink rtprio]) +NTP_FUNC_REALPATH case "$host" in *-*-aix[[4-9]]*) # XXX only verified thru AIX6. @@ -1109,7 +1106,7 @@ AC_CACHE_CHECK( [[ extern int syscall (int, ...); ]] - )] + )], [ntp_cv_decl_syscall=yes], [ntp_cv_decl_syscall=no] )] @@ -4211,6 +4208,24 @@ case "$ans" in esac +AC_MSG_CHECKING([if we want a debug assert on an OOB KoD RATE value]) +AC_ARG_ENABLE( + [bug3767-fix], + [AS_HELP_STRING( + [--enable-bug3767-fix], + [+ Disable debug assertion on OOB KoD RATE value] + )], + [ans=$enableval], + [ans=yes] +) +AC_MSG_RESULT([$ans]) +case "$ans" in + no) + AC_DEFINE([DISABLE_BUG3767_FIX], [1], + [Disable debug assertion on OOB KoD RATE value?]) +esac + + AC_MSG_CHECKING([if we should use the IRIG sawtooth filter]) case "$host" in @@ -4295,6 +4310,26 @@ case "$ntp_signd_path" in ;; esac +dnl check for 'magic pps' for Linux +AC_MSG_CHECKING([if we want 'magic' PPS support]) +AC_ARG_ENABLE( + [magicpps], + [AS_HELP_STRING( + [--enable-magicpps], + [+ try to auto-instantiate PPS devices on Linux] + )], + [ans=$enableval], + [ans=yes] +) +AC_MSG_RESULT([$ans]) +case "$ans" in + yes) + AC_DEFINE([ENABLE_MAGICPPS], [1], + [auto-instantiate missing PPS devices on Linux]) + AC_CHECK_FUNCS([openat fdopendir fstatat]) + ;; +esac + AC_CHECK_HEADERS([libscf.h]) LSCF= case "$ac_cv_header_libscf_h" in @@ -4399,11 +4434,6 @@ AC_MSG_RESULT([$ntp_ok]) NTP_UNITYBUILD -dnl gtest is needed for our tests subdirs. It would be nice if we could -dnl require a C++ compiler only if we will use gtest, but AC_PROG_CXX -dnl can't be conditionalized. -NTP_GOOGLETEST - NTP_PROBLEM_TESTS ### diff --git a/deps-ver b/deps-ver index 16d66a8bdb86..abd139968b25 100644 --- a/deps-ver +++ b/deps-ver @@ -1 +1 @@ -Fri Dec 30 11:24:57 UTC 2011 +Mon Jan 16 09:26:08 UTC 2023 diff --git a/depsver.mf b/depsver.mf index 695f7303ce31..62c59c4f1d12 100644 --- a/depsver.mf +++ b/depsver.mf @@ -2,9 +2,9 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ - chmod ug+w $@ + chmod u+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ - $(MAKE) $(AM_MAKEFLAGS) clean && \ + $(MAKE) $(AM_MAKEFLAGS) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ @@ -22,7 +22,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) - cp $(top_srcdir)/deps-ver $@ + $(AM_V_at)cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/deps-ver @@ -30,6 +30,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver BUILT_SOURCES += .deps-ver CLEANFILES += .deps-ver +DISTCLEANFILES += $(DEPDIR)/deps-ver # # depsver.mf included in Makefile.am for directories with .deps @@ -55,6 +56,6 @@ CLEANFILES += .deps-ver # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # -# This comment block follows rather than leads the related code so that +# This comment block follows rather than leads the related rules so that # it stays with it in the generated Makefile.in and Makefile. # diff --git a/html/authentic.html b/html/authentic.html index 52703e4566e5..62066c3b5444 100644 --- a/html/authentic.html +++ b/html/authentic.html @@ -135,13 +135,14 @@ Ordinarily, the ntp.keys file is generated by the ntp-keygen program, but it can be constructed and edited using an ordinary text editor.

-

Each line of the keys file consists of three or four fields: a key - ID in the range 1 to 65,535, inclusive, a key type, a message digest - key consisting of a printable ASCII string less than 40 characters or - a 40-character hex digit string, and an optional comma-separated list - of IPs that are allowed to serve time. If the OpenSSL library is - installed, the key type can be any message digest algorithm supported - by the library. If the OpenSSL library is not installed, the only +

Each line of the keys file consists of three or four fields: a + key ID in the range 1 to 65,535, inclusive, a key type, a + message digest key consisting of a printable ASCII string up to + 20 characters or a hex digit string with more than 20 + characters, and an optional comma-separated list of IPs that are + allowed to serve time. If the OpenSSL library is installed, the + key type can be any message digest algorithm supported by the + library. If the OpenSSL library is not installed, the only permitted key type is MD5.

+ + + +
diff --git a/html/clockopt.html b/html/clockopt.html index 2c2d0a8fdfe9..5b2de7e58d6e 100644 --- a/html/clockopt.html +++ b/html/clockopt.html @@ -68,6 +68,45 @@ +
device 127.127.t.u [timedata devpath] [ppsdata devpath]
+
+ This command can be used to specify the devices a reference + clocks should use. Every clock has a special hard-coded builtin + name to use, and while it is possible to make a symlink from the + expected name to the real device, doing so is not always + convenient. On some platforms or setups it is much easier to + specify the real device name in ntpd's configuration file. +
+ Note: It is not necessary to specify device names + in the configuration file; in such a case the builtin name will be + used. But once a device name is given, it will be used as + specified. There's no fallback in case of errors. +
+ The arguments are: +
+
timedata devpath
+
+ Defines the device that provides the time code data stream; + for e.g. NMEA, devpath could be "/dev/ttyS7" on a + POSIX-like system or "\\.\COM4" for another widely used OS. +
+
ppsdata devpath
+
+ Defines the device that provides the PPS timing stream. By + default, the time data stream is expected to be able to + provide the PPS data, too. (Proper wiring and hardware + assumed, of course.) This is true for all OSes that implement + the PPS API as originally designed for BSD variants. +

+ But on some hardware the PPS signal cannot not delivered to + the UART that handles the serial data; instead it might + be routed to a GPIO pin, and that means that we need a + way to define the device where the PPS data can be acquired + from. The ppsdata definition provides support for such + use cases. +

+
+

diff --git a/html/copyright.html b/html/copyright.html index 93604b7d0368..d00cf9712178 100644 --- a/html/copyright.html +++ b/html/copyright.html @@ -9,7 +9,7 @@

Copyright Notice

jpg "Clone me," says Dolly sheepishly.

Last update: - 4-Feb-2020 23:47 + 2-Mar-2023 05:21 UTC


@@ -34,11 +34,11 @@ * * *********************************************************************** -

Content starting in 2011 from Harlan Stenn, Danny Mayer, and Martin Burnicki is:

+

Content starting in 2011 from Harlan Stenn, Juergen Perlinger, Dave Hart, Danny Mayer, Martin Burnicki, and possibly others is:

 ***********************************************************************
 *                                                                     *
-* Copyright (c) Network Time Foundation 2011-2020                     *
+* Copyright (c) Network Time Foundation 2011-2023                     *
 *                                                                     *
 * All Rights Reserved                                                 *
 *                                                                     *
@@ -82,12 +82,13 @@
   
  • Reg Clemens <reg@dwf.com> Oncore driver (Current maintainer)
  • Steve Clift <clift@ml.csiro.au> OMEGA clock driver
  • Casey Crellin <casey@csc.co.za> vxWorks (Tornado) port and help with target configuration
  • +
  • Philippe De Muyter <phdm@macqel.be> Wharton reference clock driver, sysV68 and AIX modifications.
  • Sven Dietrich <sven_dietrich@trimble.com> Palisade reference clock driver, NT adj. residuals, integrated Greg's Winnt port.
  • John A. Dundas III <dundas@salt.jpl.nasa.gov> Apple A/UX port
  • Torsten Duwe <duwe@immd4.informatik.uni-erlangen.de> Linux port
  • Dennis Ferguson <dennis@mrbill.canet.ca> foundation code for NTP Version 2 as specified in RFC-1119
  • John Hay <jhay@icomtek.csir.co.za> IPv6 support and testing
  • -
  • Dave Hart <davehart@davehart.com> General maintenance, Windows port interpolation rewrite
  • +
  • Dave Hart <davehart@gmail.com> General maintenance, IPv6 cleanup, Windows PPSAPI
  • Claas Hilbrecht <neoclock4x@linum.com> NeoClock4X clock driver
  • Glenn Hollinger <glenn@herald.usask.ca> GOES clock driver
  • Mike Iglesias <iglesias@uci.edu> DEC Alpha port
  • diff --git a/html/drivers/driver20.html b/html/drivers/driver20.html index 1c3ac782f768..ea9aa01257fe 100644 --- a/html/drivers/driver20.html +++ b/html/drivers/driver20.html @@ -13,7 +13,7 @@

    Generic NMEA GPS Receiver

    Last update: - 13-Jan-2020 07:12 + 17-Oct-2020 16:00 UTC


    Synopsis

    @@ -350,6 +350,15 @@ See below. Caveat: This (hitherto undocumented) bit has moved! +
    195242880x80000Ignore receiver status, assume time is always good as long + as it is present at all. A possible option for receivers + with a good hold-over characteristic, but most likely + harmful in general. Use at own risk. +
    diff --git a/html/drivers/driver44.html b/html/drivers/driver44.html old mode 100755 new mode 100644 diff --git a/html/drivers/driver46.html b/html/drivers/driver46.html index cdb0b6899e15..f0eb9cf07a0b 100644 --- a/html/drivers/driver46.html +++ b/html/drivers/driver46.html @@ -92,11 +92,11 @@

    Naming a Device

    - The GPSD driver uses the same device name as the NMEA - driver, namely /dev/gpsu. There is a simple - reason for that: While the NMEA driver and the GPSD - driver can be active at the same time for different - devices, they cannot access the same device at a + By default, the GPSD driver uses the same device name as + the NMEA driver, namely /dev/gpsu. There is a + simple reason for that: While the NMEA driver and + the GPSD driver can be active at the same time for + different devices, they cannot access the same device at a time. Having the same name helps on that. It also eases migration from using NMEA directly to using GPSD, as no new links etc need to be created. @@ -110,11 +110,18 @@ identification. This makes the migration from the built-in NMEA driver a bit easier.

    +

    + The driver also honors device statements for + the timedata channel. (PPS is handled + inside GPSD, so there's no need for that.) This permits a + more natural way to specify the link between GPSD + and NTPD: Simply name the device as it was given + to GPSD. +

    Note: GPSD (as of version 3.10) cannot use kernel - mode PPS on devices that are hot-plugged. This would require to - attach the PPS line discipline to the character special file, - which is not possible when running with root privileges already - dropped. This is not likely to change in the future. + mode PPS on devices that are hot-plugged or activated on demand. + This is not likely to change in the future. Have a look + at GPSD's -n (nowait) option.

    @@ -168,7 +175,7 @@ 120s. Then it reverts to STI-only operation until the PPS is stable again for 40s, when strict mode is engaged again. -

    Important Notice: This is an expiremental +

    Important Notice: This is an experimental feature!
    Switching between strict and STI-only mode will cause changes in offset and jitter. Use this mode only if STI-only works fairly well with your setup, @@ -209,7 +216,7 @@ primary clock unit (u mod 128). A secondary unit processes only the PPS data from GPSD and needs the corresponding master unit to work1. Use - the 'noselect' keyword on the primary unit if you are not + the 'noselect' keyword on the primary unit if you are not interested in its data.

    The secondary unit employs the usual precautions before feeding clock samples:

    @@ -225,7 +232,7 @@ only be used if the GPS receiver can be trusted for the quality of its PPS signal2. The PPS flag gets cleared if no - PPS records can be aquired for some time. The unit also flushes + PPS records can be acquired for some time. The unit also flushes the sample buffer at this point to avoid the use of stale PPS data.

    Attention: This unit uses its own PPS fudge value diff --git a/html/miscopt.html b/html/miscopt.html index f5bce4b44ac3..ecbe25fc4add 100644 --- a/html/miscopt.html +++ b/html/miscopt.html @@ -110,9 +110,7 @@ For the JJY driver (type 40 mode 100 - 180), the argument is one telephone number used to dial the telephone JJY service. The Hayes command ATDT is normally prepended to the number, which can contain other modem control codes as well.

    pollskewlist [poll value - | value] ... [default value - | value]
    + >pollskewlist [poll early late] ... [default early late]
    Enable skewing of our poll requests to our servers. poll is a number between 3 and 17 inclusive, identifying a specific poll interval. @@ -123,9 +121,8 @@ a poll interval of 17 corresponds to 131,072 seconds, or about a day and a half. The next two numbers must be between 0 and one-half of the poll interval, inclusive. -The first number specifies how early the poll may start, -while -the second number specifies how late the poll may be delayed. +early specifies how early the poll may start, while +late specifies how late the poll may be delayed. With no arguments, internally specified default values are chosen.
    reset [allpeers] [auth] [ctl] [io] [mem] [sys] [timer]
    Reset one or more groups of counters maintained by ntpd and exposed by ntpq and ntpdc.
    diff --git a/html/ntpdc.html b/html/ntpdc.html index 7a68dd2f7906..8a66a0d01118 100644 --- a/html/ntpdc.html +++ b/html/ntpdc.html @@ -75,7 +75,8 @@
    quit
    Exit ntpdc.
    passwd
    -
    This command prompts you to type in a password (which will not be echoed) which will be used to authenticate configuration requests. The password must correspond to the key configured for use by the NTP server for this purpose if such requests are to be successful.
    +
    This command prompts you to type in a password (which will not be echoed) which will be used to authenticate configuration requests. The password must correspond to the key configured for use by the NTP server for this purpose if such requests are to be successful. + It follows the same rules as a password entry in the keys file of ntpd.
    timeout milliseconds
    Specify a timeout period for responses to server queries. The default is about 8000 milliseconds. Note that since ntpdc retries each query once after a timeout, the total waiting time for a timeout will be twice the timeout value set.
    diff --git a/html/ntpq.html b/html/ntpq.html index 4789c8ba9cdc..e143d8596755 100644 --- a/html/ntpq.html +++ b/html/ntpq.html @@ -75,7 +75,8 @@
    ntpversion 1 | 2 | 3 | 4
    Sets the NTP version number which ntpq claims in packets. Defaults to 2, Note that mode-6 control messages (and modes, for that matter) didn't exist in NTP version 1.
    passwd
    -
    This command prompts for a password to authenticate requests. The password must correspond to the key ID configured in ntp.conf for this purpose.
    +
    This command prompts for a password to authenticate requests. The password must correspond to the key ID configured in ntp.conf for this purpose. + It follows the same rules as a password entry in the keys file of ntpd.
    quit
    Exit ntpq.
    raw
    diff --git a/html/scripts/clockopt.txt b/html/scripts/clockopt.txt index 1c76a1ce408c..873524dcac61 100644 --- a/html/scripts/clockopt.txt +++ b/html/scripts/clockopt.txt @@ -1,5 +1,6 @@ document.write("

    Reference Clock Commands and Options

    ") diff --git a/include/Makefile.in b/include/Makefile.in index 9e75bb3df245..5bf244e81bd8 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -108,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_debug.m4 \ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \ - $(top_srcdir)/sntp/m4/ntp_googletest.m4 \ $(top_srcdir)/sntp/m4/ntp_harden.m4 \ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \ @@ -128,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ + $(top_srcdir)/sntp/m4/realpath.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -173,7 +173,7 @@ am__recursive_targets = \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir + distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -191,8 +191,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -238,6 +236,7 @@ CALC_TICKADJ_MS = @CALC_TICKADJ_MS@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CC_NOFORMAT = @CC_NOFORMAT@ CFLAGS = @CFLAGS@ CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@ CFLAGS_NTP = @CFLAGS_NTP@ @@ -247,6 +246,8 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ CPPFLAGS_NTP = @CPPFLAGS_NTP@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ DEFS = @DEFS@ @@ -259,14 +260,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EDITLINE_LIBS = @EDITLINE_LIBS@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ -GTEST_CONFIG = @GTEST_CONFIG@ -GTEST_CPPFLAGS = @GTEST_CPPFLAGS@ -GTEST_CXXFLAGS = @GTEST_CXXFLAGS@ -GTEST_LDFLAGS = @GTEST_LDFLAGS@ -GTEST_LIBS = @GTEST_LIBS@ HAVE_INLINE = @HAVE_INLINE@ HAVE_LEAPSMEARINTERVAL = @HAVE_LEAPSMEARINTERVAL@ HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@ @@ -477,6 +474,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -589,8 +587,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -706,8 +704,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff --git a/include/icom.h b/include/icom.h old mode 100755 new mode 100644 diff --git a/include/isc/Makefile.in b/include/isc/Makefile.in index c730b3a03cff..037cfbe354bf 100644 --- a/include/isc/Makefile.in +++ b/include/isc/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -108,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_debug.m4 \ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \ - $(top_srcdir)/sntp/m4/ntp_googletest.m4 \ $(top_srcdir)/sntp/m4/ntp_harden.m4 \ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \ @@ -128,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ + $(top_srcdir)/sntp/m4/realpath.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -175,8 +175,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -196,6 +194,7 @@ CALC_TICKADJ_MS = @CALC_TICKADJ_MS@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CC_NOFORMAT = @CC_NOFORMAT@ CFLAGS = @CFLAGS@ CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@ CFLAGS_NTP = @CFLAGS_NTP@ @@ -205,6 +204,8 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ CPPFLAGS_NTP = @CPPFLAGS_NTP@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ DEFS = @DEFS@ @@ -217,14 +218,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EDITLINE_LIBS = @EDITLINE_LIBS@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ -GTEST_CONFIG = @GTEST_CONFIG@ -GTEST_CPPFLAGS = @GTEST_CPPFLAGS@ -GTEST_CXXFLAGS = @GTEST_CXXFLAGS@ -GTEST_LDFLAGS = @GTEST_LDFLAGS@ -GTEST_LIBS = @GTEST_LIBS@ HAVE_INLINE = @HAVE_INLINE@ HAVE_LEAPSMEARINTERVAL = @HAVE_LEAPSMEARINTERVAL@ HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@ @@ -435,6 +432,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -469,8 +467,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -539,8 +537,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff --git a/include/ntp.h b/include/ntp.h index 8e0ea2b202a7..c037f5986016 100644 --- a/include/ntp.h +++ b/include/ntp.h @@ -759,6 +759,7 @@ struct pkt { #define LOOP_CODEC 13 /* set audio codec frequency */ #define LOOP_LEAP 14 /* insert leap after second 23:59 */ #define LOOP_TICK 15 /* sim. low precision clock */ +#define LOOP_NOFREQ 16 /* undo a previos LOOP_FREQ */ /* * Configuration items for the stats printer diff --git a/include/ntp_config.h b/include/ntp_config.h index 53546df8d6ca..dbb64e3a2eee 100644 --- a/include/ntp_config.h +++ b/include/ntp_config.h @@ -234,6 +234,7 @@ struct config_tree_tag { restrict_fifo * restrict_opts; addr_opts_fifo *fudge; + addr_opts_fifo *device; attr_val_fifo * rlimit; attr_val_fifo * tinker; attr_val_fifo * enable_opts; diff --git a/include/ntp_fp.h b/include/ntp_fp.h index afd1f827459e..fe6e390a1481 100644 --- a/include/ntp_fp.h +++ b/include/ntp_fp.h @@ -195,9 +195,9 @@ typedef u_int32 u_fp; do { \ int32 add_f = (int32)(f); \ if (add_f >= 0) \ - M_ADD((r_i), (r_f), 0, (uint32)( add_f)); \ + M_ADD((r_i), (r_f), 0, (u_int32)( add_f)); \ else \ - M_SUB((r_i), (r_f), 0, (uint32)(-add_f)); \ + M_SUB((r_i), (r_f), 0, (u_int32)(-add_f)); \ } while(0) #define M_ISNEG(v_i) /* v < 0 */ \ diff --git a/include/ntp_random.h b/include/ntp_random.h index fa77f6553ec6..931b2199020e 100644 --- a/include/ntp_random.h +++ b/include/ntp_random.h @@ -5,6 +5,7 @@ void ntp_crypto_srandom(void); int ntp_crypto_random_buf(void *buf, size_t nbytes); long ntp_random (void); +double ntp_uurandom(void); void ntp_srandom (unsigned long); void ntp_srandomdev (void); char * ntp_initstate (unsigned long, /* seed for R.N.G. */ diff --git a/include/ntp_refclock.h b/include/ntp_refclock.h index e74e77aa791a..1f19d7bddeed 100644 --- a/include/ntp_refclock.h +++ b/include/ntp_refclock.h @@ -213,13 +213,15 @@ struct refclock { extern int io_addclock (struct refclockio *); extern void io_closeclock (struct refclockio *); +#define FDWRITE_ERROR ((size_t)-1) + #ifdef REFCLOCK extern void refclock_buginfo(sockaddr_u *, struct refclockbug *); extern void refclock_control(sockaddr_u *, const struct refclockstat *, struct refclockstat *); -extern int refclock_open (const char *, u_int, u_int); +extern int refclock_open (const sockaddr_u *srcadr, const char *, u_int, u_int); extern int refclock_setup (int, u_int, u_int); extern void refclock_timer (struct peer *); extern void refclock_transmit(struct peer *); @@ -232,6 +234,10 @@ extern int refclock_samples_expire(struct refclockproc *, int); extern void refclock_report (struct peer *, int); extern int refclock_gtlin (struct recvbuf *, char *, int, l_fp *); extern int refclock_gtraw (struct recvbuf *, char *, int, l_fp *); +extern size_t refclock_write (const struct peer *, const void *, size_t, + const char * what); +extern size_t refclock_fdwrite(const struct peer *, int, const void *, size_t, + const char * what); extern int indicate_refclock_packet(struct refclockio *, struct recvbuf *); extern void process_refclock_packet(struct recvbuf *); @@ -250,6 +256,11 @@ extern int refclock_ppsaugment( const struct refclock_atom*, l_fp *rcvtime , double rcvfudge, double ppsfudge); +extern int ppsdev_reopen(const sockaddr_u *srcadr, + int ttyfd, int ppsfd, const char *ppspath, + int mode, int flags); +extern void ppsdev_close(int ttyfd, int ppsfd); + #endif /* REFCLOCK */ #endif /* NTP_REFCLOCK_H */ diff --git a/include/ntp_stdlib.h b/include/ntp_stdlib.h index 265aafa73ebc..2d7c640565d5 100644 --- a/include/ntp_stdlib.h +++ b/include/ntp_stdlib.h @@ -40,6 +40,8 @@ extern void setup_logfile (const char *); extern void errno_to_str(int, char *, size_t); #endif +extern char * ntp_realpath(const char * fsname); + extern int xvsbprintf(char**, char* const, char const*, va_list) NTP_PRINTF(3, 0); extern int xsbprintf(char**, char* const, char const*, ...) NTP_PRINTF(3, 4); @@ -67,8 +69,17 @@ extern int xsbprintf(char**, char* const, char const*, ...) NTP_PRINTF(3, 4); typedef void (*ctrl_c_fn)(void); /* authkeys.c */ +#define AUTHPWD_MAXSECLEN 64 /* max. length of secret blob */ + +enum AuthPwdEnc { + AUTHPWD_UNSPEC, /* format unspecified, length used for discrimination */ + AUTHPWD_PLAIN, /* plain text, used as is */ + AUTHPWD_HEX /* hex-encoded string */ +}; + extern void auth_delkeys (void); extern int auth_havekey (keyid_t); +extern size_t authdecodepw (u_char *dst, size_t dstlen, const char *src, enum AuthPwdEnc); extern int authdecrypt (keyid_t, u_int32 *, size_t, size_t); extern size_t authencrypt (keyid_t, u_int32 *, size_t); extern int authhavekey (keyid_t); @@ -100,7 +111,7 @@ extern void auth_prealloc_symkeys(int); extern int ymd2yd (int, int, int); /* a_md5encrypt.c */ -extern int MD5authdecrypt (int, const u_char *, size_t, u_int32 *, size_t, size_t); +extern int MD5authdecrypt (int, const u_char *, size_t, u_int32 *, size_t, size_t, keyid_t); extern size_t MD5authencrypt (int, const u_char *, size_t, u_int32 *, size_t); extern void MD5auth_setkey (keyid_t, int, const u_char *, size_t, KeyAccT *c); extern u_int32 addr2refid (sockaddr_u *); @@ -174,7 +185,7 @@ extern int sockaddr_masktoprefixlen(const sockaddr_u *); extern const char * socktohost (const sockaddr_u *); extern int octtoint (const char *, u_long *); extern u_long ranp2 (int); -extern const char *refnumtoa (sockaddr_u *); +extern const char *refnumtoa (const sockaddr_u *); extern const char *refid_str (u_int32, int); extern int decodenetnum (const char *, sockaddr_u *); diff --git a/include/ntp_types.h b/include/ntp_types.h index 969b325b5db7..c3cf2c196521 100644 --- a/include/ntp_types.h +++ b/include/ntp_types.h @@ -168,11 +168,11 @@ typedef unsigned long long u_int64; /* * and here the trouble starts: We need a representation with more than - * 64 bits. If a scalar of that size is not available, we need a struct + * 32 bits. If a scalar of that size is not available, we need a struct * that holds the value in split representation. * * To ease the usage a bit, we alwys use a union that is in processor - * byte order and might or might not contain a 64bit scalar. + * byte order and might or might not contain a 64-bit scalar. */ #if SIZEOF_SHORT != 2 @@ -258,10 +258,11 @@ aligned_ptr( * Macro to use in otherwise-empty source files to comply with ANSI C * requirement that each translation unit (source file) contain some * declaration. This has commonly been done by declaring an unused - * global variable of type int or char. An extern reference to exit() - * serves the same purpose without bloat. + * global variable of type int or char. An extern reference to abs() + * serves the same purpose without bloat. We once used exit() but + * that can produce warnings on systems that declare exit() noreturn. */ -#define NONEMPTY_TRANSLATION_UNIT extern void exit(int); +#define NONEMPTY_TRANSLATION_UNIT extern int abs(int); /* * On Unix struct sock_timeval is equivalent to struct timeval. diff --git a/include/ntpd.h b/include/ntpd.h index de9283360a46..ad3e30fbb889 100644 --- a/include/ntpd.h +++ b/include/ntpd.h @@ -483,6 +483,7 @@ extern struct peer *sys_peer; /* current peer */ * Nonspecified system state variables. */ extern int sys_bclient; /* we set our time to broadcasts */ +extern int sys_mclient; /* we set our time to manycasts */ extern double sys_bdelay; /* broadcast client default delay */ extern int sys_authenticate; /* requre authentication for config */ extern l_fp sys_authdelay; /* authentication delay */ diff --git a/include/ssl_applink.c b/include/ssl_applink.c index 693380f01051..993d6f664e3b 100644 --- a/include/ssl_applink.c +++ b/include/ssl_applink.c @@ -14,7 +14,7 @@ # include "msvc_ssl_autolib.h" # endif # endif -# if OPENSSL_VERSION_NUMBER < 0x10100000L +# if OPENSSL_VERSION_NUMBER < 0x10100000L || OPENSSL_VERSION_NUMBER >= 0x10101000L # include # endif # ifdef _MSC_VER diff --git a/include/vint64ops.h b/include/vint64ops.h index 2c3deffb3813..888d342781fb 100644 --- a/include/vint64ops.h +++ b/include/vint64ops.h @@ -23,6 +23,6 @@ extern vint64 subv64i32(const vint64 * lhs, int32_t rhs); extern vint64 subv64u32(const vint64 * lhs, uint32_t rhs); /* parsing. works like strtoul() or strtoull() */ -extern vint64 strtouv64(const char * begp, char ** endp, int base); +extern vint64 strtouv64(char const * begp, char const ** const endp, int base); #endif /*!defined(VINT64OPS_H)*/ diff --git a/includes.mf b/includes.mf index e868ba470b75..e34b908cc149 100644 --- a/includes.mf +++ b/includes.mf @@ -1,6 +1,6 @@ ## includes.mf - automake fragment NTP_INCS = -I$(top_srcdir)/include -NTP_INCS += -I$(top_srcdir)/lib/isc/include -NTP_INCS += -I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include -NTP_INCS += -I$(top_srcdir)/lib/isc/unix/include +NTP_INCS += -I$(top_srcdir)/libntp/lib/isc/include +NTP_INCS += -I$(top_srcdir)/libntp/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include +NTP_INCS += -I$(top_srcdir)/libntp/lib/isc/unix/include diff --git a/kernel/Makefile.in b/kernel/Makefile.in index e88b256d6447..f0cf22e84381 100644 --- a/kernel/Makefile.in +++ b/kernel/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -107,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_debug.m4 \ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \ - $(top_srcdir)/sntp/m4/ntp_googletest.m4 \ $(top_srcdir)/sntp/m4/ntp_harden.m4 \ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \ @@ -127,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ + $(top_srcdir)/sntp/m4/realpath.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -170,7 +170,7 @@ am__recursive_targets = \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir + distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -188,8 +188,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -235,6 +233,7 @@ CALC_TICKADJ_MS = @CALC_TICKADJ_MS@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CC_NOFORMAT = @CC_NOFORMAT@ CFLAGS = @CFLAGS@ CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@ CFLAGS_NTP = @CFLAGS_NTP@ @@ -244,6 +243,8 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ CPPFLAGS_NTP = @CPPFLAGS_NTP@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ DEFS = @DEFS@ @@ -256,14 +257,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EDITLINE_LIBS = @EDITLINE_LIBS@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ -GTEST_CONFIG = @GTEST_CONFIG@ -GTEST_CPPFLAGS = @GTEST_CPPFLAGS@ -GTEST_CXXFLAGS = @GTEST_CXXFLAGS@ -GTEST_LDFLAGS = @GTEST_LDFLAGS@ -GTEST_LIBS = @GTEST_LIBS@ HAVE_INLINE = @HAVE_INLINE@ HAVE_LEAPSMEARINTERVAL = @HAVE_LEAPSMEARINTERVAL@ HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@ @@ -474,6 +471,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -504,8 +502,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -621,8 +619,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff --git a/kernel/sys/Makefile.in b/kernel/sys/Makefile.in index 684023c29e7c..447e32e2cc8e 100644 --- a/kernel/sys/Makefile.in +++ b/kernel/sys/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -108,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_debug.m4 \ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \ - $(top_srcdir)/sntp/m4/ntp_googletest.m4 \ $(top_srcdir)/sntp/m4/ntp_harden.m4 \ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \ @@ -128,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ + $(top_srcdir)/sntp/m4/realpath.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -175,8 +175,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -196,6 +194,7 @@ CALC_TICKADJ_MS = @CALC_TICKADJ_MS@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CC_NOFORMAT = @CC_NOFORMAT@ CFLAGS = @CFLAGS@ CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@ CFLAGS_NTP = @CFLAGS_NTP@ @@ -205,6 +204,8 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ CPPFLAGS_NTP = @CPPFLAGS_NTP@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ DEFS = @DEFS@ @@ -217,14 +218,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EDITLINE_LIBS = @EDITLINE_LIBS@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ -GTEST_CONFIG = @GTEST_CONFIG@ -GTEST_CPPFLAGS = @GTEST_CPPFLAGS@ -GTEST_CXXFLAGS = @GTEST_CXXFLAGS@ -GTEST_LDFLAGS = @GTEST_LDFLAGS@ -GTEST_LIBS = @GTEST_LIBS@ HAVE_INLINE = @HAVE_INLINE@ HAVE_LEAPSMEARINTERVAL = @HAVE_LEAPSMEARINTERVAL@ HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@ @@ -435,6 +432,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -467,8 +465,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -537,8 +535,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff --git a/lib/isc/Atffile b/lib/isc/Atffile deleted file mode 100644 index 1edb838c66cc..000000000000 --- a/lib/isc/Atffile +++ /dev/null @@ -1,5 +0,0 @@ -Content-Type: application/X-atf-atffile; version="1" - -prop: test-suite = bind9 - -tp: tests diff --git a/lib/isc/alpha/include/isc/atomic.h b/lib/isc/alpha/include/isc/atomic.h deleted file mode 100644 index a6232ada6fc7..000000000000 --- a/lib/isc/alpha/include/isc/atomic.h +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (C) 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: atomic.h,v 1.7 2009/04/08 06:48:23 tbox Exp $ */ - -/* - * This code was written based on FreeBSD's kernel source whose copyright - * follows: - */ - -/*- - * Copyright (c) 1998 Doug Rabson - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/alpha/include/atomic.h,v 1.18.6.1 2004/09/13 21:52:04 wilko Exp $ - */ - -#ifndef ISC_ATOMIC_H -#define ISC_ATOMIC_H 1 - -#include -#include - -#ifdef ISC_PLATFORM_USEOSFASM -#include - -#pragma intrinsic(asm) - -/* - * This routine atomically increments the value stored in 'p' by 'val', and - * returns the previous value. Memory access ordering around this function - * can be critical, so we add explicit memory block instructions at the - * beginning and the end of it (same for other functions). - */ -static inline isc_int32_t -isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) { - return (asm("mb;" - "1:" - "ldl_l %t0, 0(%a0);" /* load old value */ - "mov %t0, %v0;" /* copy the old value */ - "addl %t0, %a1, %t0;" /* calculate new value */ - "stl_c %t0, 0(%a0);" /* attempt to store */ - "beq %t0, 1b;" /* spin if failed */ - "mb;", - p, val)); -} - -/* - * This routine atomically stores the value 'val' in 'p'. - */ -static inline void -isc_atomic_store(isc_int32_t *p, isc_int32_t val) { - (void)asm("mb;" - "1:" - "ldl_l %t0, 0(%a0);" /* load old value */ - "mov %a1, %t0;" /* value to store */ - "stl_c %t0, 0(%a0);" /* attempt to store */ - "beq %t0, 1b;" /* spin if failed */ - "mb;", - p, val); -} - -/* - * This routine atomically replaces the value in 'p' with 'val', if the - * original value is equal to 'cmpval'. The original value is returned in any - * case. - */ -static inline isc_int32_t -isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) { - - return(asm("mb;" - "1:" - "ldl_l %t0, 0(%a0);" /* load old value */ - "mov %t0, %v0;" /* copy the old value */ - "cmpeq %t0, %a1, %t0;" /* compare */ - "beq %t0, 2f;" /* exit if not equal */ - "mov %a2, %t0;" /* value to store */ - "stl_c %t0, 0(%a0);" /* attempt to store */ - "beq %t0, 1b;" /* if it failed, spin */ - "2:" - "mb;", - p, cmpval, val)); -} -#elif defined (ISC_PLATFORM_USEGCCASM) -static inline isc_int32_t -isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) { - isc_int32_t temp, prev; - - __asm__ volatile( - "mb;" - "1:" - "ldl_l %0, %1;" /* load old value */ - "mov %0, %2;" /* copy the old value */ - "addl %0, %3, %0;" /* calculate new value */ - "stl_c %0, %1;" /* attempt to store */ - "beq %0, 1b;" /* spin if failed */ - "mb;" - : "=&r"(temp), "+m"(*p), "=&r"(prev) - : "r"(val) - : "memory"); - - return (prev); -} - -static inline void -isc_atomic_store(isc_int32_t *p, isc_int32_t val) { - isc_int32_t temp; - - __asm__ volatile( - "mb;" - "1:" - "ldl_l %0, %1;" /* load old value */ - "mov %2, %0;" /* value to store */ - "stl_c %0, %1;" /* attempt to store */ - "beq %0, 1b;" /* if it failed, spin */ - "mb;" - : "=&r"(temp), "+m"(*p) - : "r"(val) - : "memory"); -} - -static inline isc_int32_t -isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) { - isc_int32_t temp, prev; - - __asm__ volatile( - "mb;" - "1:" - "ldl_l %0, %1;" /* load old value */ - "mov %0, %2;" /* copy the old value */ - "cmpeq %0, %3, %0;" /* compare */ - "beq %0, 2f;" /* exit if not equal */ - "mov %4, %0;" /* value to store */ - "stl_c %0, %1;" /* attempt to store */ - "beq %0, 1b;" /* if it failed, spin */ - "2:" - "mb;" - : "=&r"(temp), "+m"(*p), "=&r"(prev) - : "r"(cmpval), "r"(val) - : "memory"); - - return (prev); -} -#else - -#error "unsupported compiler. disable atomic ops by --disable-atomic" - -#endif - -#endif /* ISC_ATOMIC_H */ diff --git a/lib/isc/api b/lib/isc/api deleted file mode 100644 index ed4b69f8b8f7..000000000000 --- a/lib/isc/api +++ /dev/null @@ -1,8 +0,0 @@ -# LIBINTERFACE ranges -# 9.6: 50-59, 110-119 -# 9.7: 60-79 -# 9.8: 80-89 -# 9.9: 90-109 -LIBINTERFACE = 91 -LIBREVISION = 1 -LIBAGE = 1 diff --git a/lib/isc/app_api.c b/lib/isc/app_api.c deleted file mode 100644 index ce767d175053..000000000000 --- a/lib/isc/app_api.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: app_api.c,v 1.5 2009/09/02 23:48:02 tbox Exp $ */ - -#include - -#include - -#include -#include -#include -#include -#include - -static isc_mutex_t createlock; -static isc_once_t once = ISC_ONCE_INIT; -static isc_appctxcreatefunc_t appctx_createfunc = NULL; - -#define ISCAPI_APPMETHODS_VALID(m) ISC_MAGIC_VALID(m, ISCAPI_APPMETHODS_MAGIC) - -static void -initialize(void) { - RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS); -} - -isc_result_t -isc_app_register(isc_appctxcreatefunc_t createfunc) { - isc_result_t result = ISC_R_SUCCESS; - - RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS); - - LOCK(&createlock); - if (appctx_createfunc == NULL) - appctx_createfunc = createfunc; - else - result = ISC_R_EXISTS; - UNLOCK(&createlock); - - return (result); -} - -isc_result_t -isc_appctx_create(isc_mem_t *mctx, isc_appctx_t **ctxp) { - isc_result_t result; - - LOCK(&createlock); - - REQUIRE(appctx_createfunc != NULL); - result = (*appctx_createfunc)(mctx, ctxp); - - UNLOCK(&createlock); - - return (result); -} - -void -isc_appctx_destroy(isc_appctx_t **ctxp) { - REQUIRE(ctxp != NULL && ISCAPI_APPCTX_VALID(*ctxp)); - - (*ctxp)->methods->ctxdestroy(ctxp); - - ENSURE(*ctxp == NULL); -} - -isc_result_t -isc_app_ctxstart(isc_appctx_t *ctx) { - REQUIRE(ISCAPI_APPCTX_VALID(ctx)); - - return (ctx->methods->ctxstart(ctx)); -} - -isc_result_t -isc_app_ctxrun(isc_appctx_t *ctx) { - REQUIRE(ISCAPI_APPCTX_VALID(ctx)); - - return (ctx->methods->ctxrun(ctx)); -} - -isc_result_t -isc_app_ctxsuspend(isc_appctx_t *ctx) { - REQUIRE(ISCAPI_APPCTX_VALID(ctx)); - - return (ctx->methods->ctxsuspend(ctx)); -} - -isc_result_t -isc_app_ctxshutdown(isc_appctx_t *ctx) { - REQUIRE(ISCAPI_APPCTX_VALID(ctx)); - - return (ctx->methods->ctxshutdown(ctx)); -} - -void -isc_app_ctxfinish(isc_appctx_t *ctx) { - REQUIRE(ISCAPI_APPCTX_VALID(ctx)); - - ctx->methods->ctxfinish(ctx); -} - -void -isc_appctx_settaskmgr(isc_appctx_t *ctx, isc_taskmgr_t *taskmgr) { - REQUIRE(ISCAPI_APPCTX_VALID(ctx)); - REQUIRE(taskmgr != NULL); - - ctx->methods->settaskmgr(ctx, taskmgr); -} - -void -isc_appctx_setsocketmgr(isc_appctx_t *ctx, isc_socketmgr_t *socketmgr) { - REQUIRE(ISCAPI_APPCTX_VALID(ctx)); - REQUIRE(socketmgr != NULL); - - ctx->methods->setsocketmgr(ctx, socketmgr); -} - -void -isc_appctx_settimermgr(isc_appctx_t *ctx, isc_timermgr_t *timermgr) { - REQUIRE(ISCAPI_APPCTX_VALID(ctx)); - REQUIRE(timermgr != NULL); - - ctx->methods->settimermgr(ctx, timermgr); -} diff --git a/lib/isc/base32.c b/lib/isc/base32.c deleted file mode 100644 index d25e3c4716bb..000000000000 --- a/lib/isc/base32.c +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Copyright (C) 2008, 2009 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: base32.c,v 1.6 2009/10/21 01:22:29 each Exp $ */ - -/*! \file */ - -#include - -#include -#include -#include -#include -#include -#include - -#define RETERR(x) do { \ - isc_result_t _r = (x); \ - if (_r != ISC_R_SUCCESS) \ - return (_r); \ - } while (0) - - -/*@{*/ -/*! - * These static functions are also present in lib/dns/rdata.c. I'm not - * sure where they should go. -- bwelling - */ -static isc_result_t -str_totext(const char *source, isc_buffer_t *target); - -static isc_result_t -mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length); - -/*@}*/ - -static const char base32[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=abcdefghijklmnopqrstuvwxyz234567"; -static const char base32hex[] = - "0123456789ABCDEFGHIJKLMNOPQRSTUV=0123456789abcdefghijklmnopqrstuv"; - -static isc_result_t -base32_totext(isc_region_t *source, int wordlength, const char *wordbreak, - isc_buffer_t *target, const char base[]) -{ - char buf[9]; - unsigned int loops = 0; - - if (wordlength >= 0 && wordlength < 8) - wordlength = 8; - - memset(buf, 0, sizeof(buf)); - while (source->length > 0) { - buf[0] = base[((source->base[0]>>3)&0x1f)]; /* 5 + */ - if (source->length == 1) { - buf[1] = base[(source->base[0]<<2)&0x1c]; - buf[2] = buf[3] = buf[4] = '='; - buf[5] = buf[6] = buf[7] = '='; - RETERR(str_totext(buf, target)); - break; - } - buf[1] = base[((source->base[0]<<2)&0x1c)| /* 3 = 8 */ - ((source->base[1]>>6)&0x03)]; /* 2 + */ - buf[2] = base[((source->base[1]>>1)&0x1f)]; /* 5 + */ - if (source->length == 2) { - buf[3] = base[(source->base[1]<<4)&0x10]; - buf[4] = buf[5] = buf[6] = buf[7] = '='; - RETERR(str_totext(buf, target)); - break; - } - buf[3] = base[((source->base[1]<<4)&0x10)| /* 1 = 8 */ - ((source->base[2]>>4)&0x0f)]; /* 4 + */ - if (source->length == 3) { - buf[4] = base[(source->base[2]<<1)&0x1e]; - buf[5] = buf[6] = buf[7] = '='; - RETERR(str_totext(buf, target)); - break; - } - buf[4] = base[((source->base[2]<<1)&0x1e)| /* 4 = 8 */ - ((source->base[3]>>7)&0x01)]; /* 1 + */ - buf[5] = base[((source->base[3]>>2)&0x1f)]; /* 5 + */ - if (source->length == 4) { - buf[6] = base[(source->base[3]<<3)&0x18]; - buf[7] = '='; - RETERR(str_totext(buf, target)); - break; - } - buf[6] = base[((source->base[3]<<3)&0x18)| /* 2 = 8 */ - ((source->base[4]>>5)&0x07)]; /* 3 + */ - buf[7] = base[source->base[4]&0x1f]; /* 5 = 8 */ - RETERR(str_totext(buf, target)); - isc_region_consume(source, 5); - - loops++; - if (source->length != 0 && wordlength >= 0 && - (int)((loops + 1) * 8) >= wordlength) - { - loops = 0; - RETERR(str_totext(wordbreak, target)); - } - } - if (source->length > 0) - isc_region_consume(source, source->length); - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_base32_totext(isc_region_t *source, int wordlength, - const char *wordbreak, isc_buffer_t *target) -{ - return (base32_totext(source, wordlength, wordbreak, target, base32)); -} - -isc_result_t -isc_base32hex_totext(isc_region_t *source, int wordlength, - const char *wordbreak, isc_buffer_t *target) -{ - return (base32_totext(source, wordlength, wordbreak, target, - base32hex)); -} - -/*% - * State of a base32 decoding process in progress. - */ -typedef struct { - int length; /*%< Desired length of binary data or -1 */ - isc_buffer_t *target; /*%< Buffer for resulting binary data */ - int digits; /*%< Number of buffered base32 digits */ - isc_boolean_t seen_end; /*%< True if "=" end marker seen */ - int val[8]; - const char *base; /*%< Which encoding we are using */ - int seen_32; /*%< Number of significant bytes if non zero */ -} base32_decode_ctx_t; - -static inline void -base32_decode_init(base32_decode_ctx_t *ctx, int length, - const char base[], isc_buffer_t *target) -{ - ctx->digits = 0; - ctx->seen_end = ISC_FALSE; - ctx->seen_32 = 0; - ctx->length = length; - ctx->target = target; - ctx->base = base; -} - -static inline isc_result_t -base32_decode_char(base32_decode_ctx_t *ctx, int c) { - char *s; - unsigned int last; - - if (ctx->seen_end) - return (ISC_R_BADBASE32); - if ((s = strchr(ctx->base, c)) == NULL) - return (ISC_R_BADBASE32); - last = s - ctx->base; - /* - * Handle lower case. - */ - if (last > 32) - last -= 33; - /* - * Check that padding is contiguous. - */ - if (last != 32 && ctx->seen_32 != 0) - return (ISC_R_BADBASE32); - /* - * Check that padding starts at the right place and that - * bits that should be zero are. - * Record how many significant bytes in answer (seen_32). - */ - if (last == 32 && ctx->seen_32 == 0) - switch (ctx->digits) { - case 0: - case 1: - return (ISC_R_BADBASE32); - case 2: - if ((ctx->val[1]&0x03) != 0) - return (ISC_R_BADBASE32); - ctx->seen_32 = 1; - break; - case 3: - return (ISC_R_BADBASE32); - case 4: - if ((ctx->val[3]&0x0f) != 0) - return (ISC_R_BADBASE32); - ctx->seen_32 = 3; - break; - case 5: - if ((ctx->val[4]&0x01) != 0) - return (ISC_R_BADBASE32); - ctx->seen_32 = 3; - break; - case 6: - return (ISC_R_BADBASE32); - case 7: - if ((ctx->val[6]&0x07) != 0) - return (ISC_R_BADBASE32); - ctx->seen_32 = 4; - break; - } - /* - * Zero fill pad values. - */ - ctx->val[ctx->digits++] = (last == 32) ? 0 : last; - - if (ctx->digits == 8) { - int n = 5; - unsigned char buf[5]; - - if (ctx->seen_32 != 0) { - ctx->seen_end = ISC_TRUE; - n = ctx->seen_32; - } - buf[0] = (ctx->val[0]<<3)|(ctx->val[1]>>2); - buf[1] = (ctx->val[1]<<6)|(ctx->val[2]<<1)|(ctx->val[3]>>4); - buf[2] = (ctx->val[3]<<4)|(ctx->val[4]>>1); - buf[3] = (ctx->val[4]<<7)|(ctx->val[5]<<2)|(ctx->val[6]>>3); - buf[4] = (ctx->val[6]<<5)|(ctx->val[7]); - RETERR(mem_tobuffer(ctx->target, buf, n)); - if (ctx->length >= 0) { - if (n > ctx->length) - return (ISC_R_BADBASE32); - else - ctx->length -= n; - } - ctx->digits = 0; - } - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -base32_decode_finish(base32_decode_ctx_t *ctx) { - if (ctx->length > 0) - return (ISC_R_UNEXPECTEDEND); - if (ctx->digits != 0) - return (ISC_R_BADBASE32); - return (ISC_R_SUCCESS); -} - -static isc_result_t -base32_tobuffer(isc_lex_t *lexer, const char base[], isc_buffer_t *target, - int length) -{ - base32_decode_ctx_t ctx; - isc_textregion_t *tr; - isc_token_t token; - isc_boolean_t eol; - - base32_decode_init(&ctx, length, base, target); - - while (!ctx.seen_end && (ctx.length != 0)) { - unsigned int i; - - if (length > 0) - eol = ISC_FALSE; - else - eol = ISC_TRUE; - RETERR(isc_lex_getmastertoken(lexer, &token, - isc_tokentype_string, eol)); - if (token.type != isc_tokentype_string) - break; - tr = &token.value.as_textregion; - for (i = 0; i < tr->length; i++) - RETERR(base32_decode_char(&ctx, tr->base[i])); - } - if (ctx.length < 0 && !ctx.seen_end) - isc_lex_ungettoken(lexer, &token); - RETERR(base32_decode_finish(&ctx)); - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_base32_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) { - return (base32_tobuffer(lexer, base32, target, length)); -} - -isc_result_t -isc_base32hex_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) { - return (base32_tobuffer(lexer, base32hex, target, length)); -} - -static isc_result_t -base32_decodestring(const char *cstr, const char base[], isc_buffer_t *target) { - base32_decode_ctx_t ctx; - - base32_decode_init(&ctx, -1, base, target); - for (;;) { - int c = *cstr++; - if (c == '\0') - break; - if (c == ' ' || c == '\t' || c == '\n' || c== '\r') - continue; - RETERR(base32_decode_char(&ctx, c)); - } - RETERR(base32_decode_finish(&ctx)); - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_base32_decodestring(const char *cstr, isc_buffer_t *target) { - return (base32_decodestring(cstr, base32, target)); -} - -isc_result_t -isc_base32hex_decodestring(const char *cstr, isc_buffer_t *target) { - return (base32_decodestring(cstr, base32hex, target)); -} - -static isc_result_t -base32_decoderegion(isc_region_t *source, const char base[], isc_buffer_t *target) { - base32_decode_ctx_t ctx; - - base32_decode_init(&ctx, -1, base, target); - while (source->length != 0) { - int c = *source->base; - RETERR(base32_decode_char(&ctx, c)); - isc_region_consume(source, 1); - } - RETERR(base32_decode_finish(&ctx)); - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_base32_decoderegion(isc_region_t *source, isc_buffer_t *target) { - return (base32_decoderegion(source, base32, target)); -} - -isc_result_t -isc_base32hex_decoderegion(isc_region_t *source, isc_buffer_t *target) { - return (base32_decoderegion(source, base32hex, target)); -} - -static isc_result_t -str_totext(const char *source, isc_buffer_t *target) { - unsigned int l; - isc_region_t region; - - isc_buffer_availableregion(target, ®ion); - l = strlen(source); - - if (l > region.length) - return (ISC_R_NOSPACE); - - memcpy(region.base, source, l); - isc_buffer_add(target, l); - return (ISC_R_SUCCESS); -} - -static isc_result_t -mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) { - isc_region_t tr; - - isc_buffer_availableregion(target, &tr); - if (length > tr.length) - return (ISC_R_NOSPACE); - memcpy(tr.base, base, length); - isc_buffer_add(target, length); - return (ISC_R_SUCCESS); -} diff --git a/lib/isc/base64.c b/lib/isc/base64.c deleted file mode 100644 index bad1565bea7b..000000000000 --- a/lib/isc/base64.c +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001, 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: base64.c,v 1.34 2009/10/21 23:48:05 tbox Exp $ */ - -/*! \file */ - -#include - -#include -#include -#include -#include -#include - -#define RETERR(x) do { \ - isc_result_t _r = (x); \ - if (_r != ISC_R_SUCCESS) \ - return (_r); \ - } while (0) - - -/*@{*/ -/*! - * These static functions are also present in lib/dns/rdata.c. I'm not - * sure where they should go. -- bwelling - */ -static isc_result_t -str_totext(const char *source, isc_buffer_t *target); - -static isc_result_t -mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length); - -static const char base64[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; -/*@}*/ - -isc_result_t -isc_base64_totext(isc_region_t *source, int wordlength, - const char *wordbreak, isc_buffer_t *target) -{ - char buf[5]; - unsigned int loops = 0; - - if (wordlength < 4) - wordlength = 4; - - memset(buf, 0, sizeof(buf)); - while (source->length > 2) { - buf[0] = base64[(source->base[0]>>2)&0x3f]; - buf[1] = base64[((source->base[0]<<4)&0x30)| - ((source->base[1]>>4)&0x0f)]; - buf[2] = base64[((source->base[1]<<2)&0x3c)| - ((source->base[2]>>6)&0x03)]; - buf[3] = base64[source->base[2]&0x3f]; - RETERR(str_totext(buf, target)); - isc_region_consume(source, 3); - - loops++; - if (source->length != 0 && - (int)((loops + 1) * 4) >= wordlength) - { - loops = 0; - RETERR(str_totext(wordbreak, target)); - } - } - if (source->length == 2) { - buf[0] = base64[(source->base[0]>>2)&0x3f]; - buf[1] = base64[((source->base[0]<<4)&0x30)| - ((source->base[1]>>4)&0x0f)]; - buf[2] = base64[((source->base[1]<<2)&0x3c)]; - buf[3] = '='; - RETERR(str_totext(buf, target)); - isc_region_consume(source, 2); - } else if (source->length == 1) { - buf[0] = base64[(source->base[0]>>2)&0x3f]; - buf[1] = base64[((source->base[0]<<4)&0x30)]; - buf[2] = buf[3] = '='; - RETERR(str_totext(buf, target)); - isc_region_consume(source, 1); - } - return (ISC_R_SUCCESS); -} - -/*% - * State of a base64 decoding process in progress. - */ -typedef struct { - int length; /*%< Desired length of binary data or -1 */ - isc_buffer_t *target; /*%< Buffer for resulting binary data */ - int digits; /*%< Number of buffered base64 digits */ - isc_boolean_t seen_end; /*%< True if "=" end marker seen */ - int val[4]; -} base64_decode_ctx_t; - -static inline void -base64_decode_init(base64_decode_ctx_t *ctx, int length, isc_buffer_t *target) -{ - ctx->digits = 0; - ctx->seen_end = ISC_FALSE; - ctx->length = length; - ctx->target = target; -} - -static inline isc_result_t -base64_decode_char(base64_decode_ctx_t *ctx, int c) { - char *s; - - if (ctx->seen_end) - return (ISC_R_BADBASE64); - if ((s = strchr(base64, c)) == NULL) - return (ISC_R_BADBASE64); - ctx->val[ctx->digits++] = s - base64; - if (ctx->digits == 4) { - int n; - unsigned char buf[3]; - if (ctx->val[0] == 64 || ctx->val[1] == 64) - return (ISC_R_BADBASE64); - if (ctx->val[2] == 64 && ctx->val[3] != 64) - return (ISC_R_BADBASE64); - /* - * Check that bits that should be zero are. - */ - if (ctx->val[2] == 64 && (ctx->val[1] & 0xf) != 0) - return (ISC_R_BADBASE64); - /* - * We don't need to test for ctx->val[2] != 64 as - * the bottom two bits of 64 are zero. - */ - if (ctx->val[3] == 64 && (ctx->val[2] & 0x3) != 0) - return (ISC_R_BADBASE64); - n = (ctx->val[2] == 64) ? 1 : - (ctx->val[3] == 64) ? 2 : 3; - if (n != 3) { - ctx->seen_end = ISC_TRUE; - if (ctx->val[2] == 64) - ctx->val[2] = 0; - if (ctx->val[3] == 64) - ctx->val[3] = 0; - } - buf[0] = (ctx->val[0]<<2)|(ctx->val[1]>>4); - buf[1] = (ctx->val[1]<<4)|(ctx->val[2]>>2); - buf[2] = (ctx->val[2]<<6)|(ctx->val[3]); - RETERR(mem_tobuffer(ctx->target, buf, n)); - if (ctx->length >= 0) { - if (n > ctx->length) - return (ISC_R_BADBASE64); - else - ctx->length -= n; - } - ctx->digits = 0; - } - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -base64_decode_finish(base64_decode_ctx_t *ctx) { - if (ctx->length > 0) - return (ISC_R_UNEXPECTEDEND); - if (ctx->digits != 0) - return (ISC_R_BADBASE64); - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_base64_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) { - base64_decode_ctx_t ctx; - isc_textregion_t *tr; - isc_token_t token; - isc_boolean_t eol; - - base64_decode_init(&ctx, length, target); - - while (!ctx.seen_end && (ctx.length != 0)) { - unsigned int i; - - if (length > 0) - eol = ISC_FALSE; - else - eol = ISC_TRUE; - RETERR(isc_lex_getmastertoken(lexer, &token, - isc_tokentype_string, eol)); - if (token.type != isc_tokentype_string) - break; - tr = &token.value.as_textregion; - for (i = 0; i < tr->length; i++) - RETERR(base64_decode_char(&ctx, tr->base[i])); - } - if (ctx.length < 0 && !ctx.seen_end) - isc_lex_ungettoken(lexer, &token); - RETERR(base64_decode_finish(&ctx)); - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_base64_decodestring(const char *cstr, isc_buffer_t *target) { - base64_decode_ctx_t ctx; - - base64_decode_init(&ctx, -1, target); - for (;;) { - int c = *cstr++; - if (c == '\0') - break; - if (c == ' ' || c == '\t' || c == '\n' || c== '\r') - continue; - RETERR(base64_decode_char(&ctx, c)); - } - RETERR(base64_decode_finish(&ctx)); - return (ISC_R_SUCCESS); -} - -static isc_result_t -str_totext(const char *source, isc_buffer_t *target) { - unsigned int l; - isc_region_t region; - - isc_buffer_availableregion(target, ®ion); - l = strlen(source); - - if (l > region.length) - return (ISC_R_NOSPACE); - - memcpy(region.base, source, l); - isc_buffer_add(target, l); - return (ISC_R_SUCCESS); -} - -static isc_result_t -mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) { - isc_region_t tr; - - isc_buffer_availableregion(target, &tr); - if (length > tr.length) - return (ISC_R_NOSPACE); - memcpy(tr.base, base, length); - isc_buffer_add(target, length); - return (ISC_R_SUCCESS); -} diff --git a/lib/isc/bitstring.c b/lib/isc/bitstring.c deleted file mode 100644 index 33c7c1fa6d8b..000000000000 --- a/lib/isc/bitstring.c +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: bitstring.c,v 1.17 2007/06/19 23:47:17 tbox Exp $ */ - -/*! \file */ - -#include - -#include - -#include -#include -#include - -#define DIV8(x) ((x) >> 3) -#define MOD8(x) ((x) & 0x00000007U) -#define OCTETS(n) (((n) + 7) >> 3) -#define PADDED(n) ((((n) + 7) >> 3) << 3) -#define BITSET(bs, n) (((bs)->data[DIV8(n)] & \ - (1 << (7 - MOD8(n)))) != 0) -#define SETBIT(bs, n) (bs)->data[DIV8(n)] |= (1 << (7 - MOD8(n))) -#define CLEARBIT(bs, n) (bs)->data[DIV8(n)] &= ~(1 << (7 - MOD8(n))) - -#define BITSTRING_MAGIC ISC_MAGIC('B', 'S', 't', 'r') -#define VALID_BITSTRING(b) ISC_MAGIC_VALID(b, BITSTRING_MAGIC) - -void -isc_bitstring_init(isc_bitstring_t *bitstring, unsigned char *data, - unsigned int length, unsigned int size, isc_boolean_t lsb0) -{ - /* - * Make 'bitstring' refer to the bitstring of 'size' bits starting - * at 'data'. 'length' bits of the bitstring are valid. If 'lsb0' - * is set then, bit 0 refers to the least significant bit of the - * bitstring. Otherwise bit 0 is the most significant bit. - */ - - REQUIRE(bitstring != NULL); - REQUIRE(data != NULL); - REQUIRE(length <= size); - - bitstring->magic = BITSTRING_MAGIC; - bitstring->data = data; - bitstring->length = length; - bitstring->size = size; - bitstring->lsb0 = lsb0; -} - -void -isc_bitstring_invalidate(isc_bitstring_t *bitstring) { - - /* - * Invalidate 'bitstring'. - */ - - REQUIRE(VALID_BITSTRING(bitstring)); - - bitstring->magic = 0; - bitstring->data = NULL; - bitstring->length = 0; - bitstring->size = 0; - bitstring->lsb0 = ISC_FALSE; -} - -void -isc_bitstring_copy(isc_bitstring_t *source, unsigned int sbitpos, - isc_bitstring_t *target, unsigned int tbitpos, - unsigned int n) -{ - unsigned int tlast; - - /* - * Starting at bit 'sbitpos', copy 'n' bits from 'source' to - * the 'n' bits of 'target' starting at 'tbitpos'. - */ - - REQUIRE(VALID_BITSTRING(source)); - REQUIRE(VALID_BITSTRING(target)); - REQUIRE(source->lsb0 == target->lsb0); - if (source->lsb0) { - REQUIRE(sbitpos <= source->length); - sbitpos = PADDED(source->size) - sbitpos; - REQUIRE(sbitpos >= n); - sbitpos -= n; - } else - REQUIRE(sbitpos + n <= source->length); - tlast = tbitpos + n; - if (target->lsb0) { - REQUIRE(tbitpos <= target->length); - tbitpos = PADDED(target->size) - tbitpos; - REQUIRE(tbitpos >= n); - tbitpos -= n; - } else - REQUIRE(tlast <= target->size); - - if (tlast > target->length) - target->length = tlast; - - /* - * This is far from optimal... - */ - - while (n > 0) { - if (BITSET(source, sbitpos)) - SETBIT(target, tbitpos); - else - CLEARBIT(target, tbitpos); - sbitpos++; - tbitpos++; - n--; - } -} diff --git a/lib/isc/bufferlist.c b/lib/isc/bufferlist.c deleted file mode 100644 index 0e5c1251bf04..000000000000 --- a/lib/isc/bufferlist.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: bufferlist.c,v 1.17 2007/06/19 23:47:17 tbox Exp $ */ - -/*! \file */ - -#include - -#include - -#include -#include -#include - -unsigned int -isc_bufferlist_usedcount(isc_bufferlist_t *bl) { - isc_buffer_t *buffer; - unsigned int length; - - REQUIRE(bl != NULL); - - length = 0; - buffer = ISC_LIST_HEAD(*bl); - while (buffer != NULL) { - REQUIRE(ISC_BUFFER_VALID(buffer)); - length += isc_buffer_usedlength(buffer); - buffer = ISC_LIST_NEXT(buffer, link); - } - - return (length); -} - -unsigned int -isc_bufferlist_availablecount(isc_bufferlist_t *bl) { - isc_buffer_t *buffer; - unsigned int length; - - REQUIRE(bl != NULL); - - length = 0; - buffer = ISC_LIST_HEAD(*bl); - while (buffer != NULL) { - REQUIRE(ISC_BUFFER_VALID(buffer)); - length += isc_buffer_availablelength(buffer); - buffer = ISC_LIST_NEXT(buffer, link); - } - - return (length); -} diff --git a/lib/isc/commandline.c b/lib/isc/commandline.c deleted file mode 100644 index aca1203ce338..000000000000 --- a/lib/isc/commandline.c +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Portions Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") - * Portions Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * Copyright (c) 1987, 1993, 1994 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* $Id: commandline.c,v 1.22 2008/09/25 04:02:39 tbox Exp $ */ - -/*! \file - * This file was adapted from the NetBSD project's source tree, RCS ID: - * NetBSD: getopt.c,v 1.15 1999/09/20 04:39:37 lukem Exp - * - * The primary change has been to rename items to the ISC namespace - * and format in the ISC coding style. - */ - -/* - * \author Principal Authors: Computer Systems Research Group at UC Berkeley - * \author Principal ISC caretaker: DCL - */ - -#include - -#include - -#include -#include -#include -#include - -/*% Index into parent argv vector. */ -LIBISC_EXTERNAL_DATA int isc_commandline_index = 1; -/*% Character checked for validity. */ -LIBISC_EXTERNAL_DATA int isc_commandline_option; -/*% Argument associated with option. */ -LIBISC_EXTERNAL_DATA char *isc_commandline_argument; -/*% For printing error messages. */ -LIBISC_EXTERNAL_DATA char *isc_commandline_progname; -/*% Print error messages. */ -LIBISC_EXTERNAL_DATA isc_boolean_t isc_commandline_errprint = ISC_TRUE; -/*% Reset processing. */ -LIBISC_EXTERNAL_DATA isc_boolean_t isc_commandline_reset = ISC_TRUE; - -static char endopt = '\0'; - -#define BADOPT '?' -#define BADARG ':' -#define ENDOPT &endopt - -/*! - * getopt -- - * Parse argc/argv argument vector. - */ -int -isc_commandline_parse(int argc, char * const *argv, const char *options) { - static char *place = ENDOPT; - char *option; /* Index into *options of option. */ - - REQUIRE(argc >= 0 && argv != NULL && options != NULL); - - /* - * Update scanning pointer, either because a reset was requested or - * the previous argv was finished. - */ - if (isc_commandline_reset || *place == '\0') { - if (isc_commandline_reset) { - isc_commandline_index = 1; - isc_commandline_reset = ISC_FALSE; - } - - if (isc_commandline_progname == NULL) - isc_commandline_progname = argv[0]; - - if (isc_commandline_index >= argc || - *(place = argv[isc_commandline_index]) != '-') { - /* - * Index out of range or points to non-option. - */ - place = ENDOPT; - return (-1); - } - - if (place[1] != '\0' && *++place == '-' && place[1] == '\0') { - /* - * Found '--' to signal end of options. Advance - * index to next argv, the first non-option. - */ - isc_commandline_index++; - place = ENDOPT; - return (-1); - } - } - - isc_commandline_option = *place++; - option = strchr(options, isc_commandline_option); - - /* - * Ensure valid option has been passed as specified by options string. - * '-:' is never a valid command line option because it could not - * distinguish ':' from the argument specifier in the options string. - */ - if (isc_commandline_option == ':' || option == NULL) { - if (*place == '\0') - isc_commandline_index++; - - if (isc_commandline_errprint && *options != ':') - fprintf(stderr, "%s: %s -- %c\n", - isc_commandline_progname, - isc_msgcat_get(isc_msgcat, - ISC_MSGSET_COMMANDLINE, - ISC_MSG_ILLEGALOPT, - "illegal option"), - isc_commandline_option); - - return (BADOPT); - } - - if (*++option != ':') { - /* - * Option does not take an argument. - */ - isc_commandline_argument = NULL; - - /* - * Skip to next argv if at the end of the current argv. - */ - if (*place == '\0') - ++isc_commandline_index; - - } else { - /* - * Option needs an argument. - */ - if (*place != '\0') - /* - * Option is in this argv, -D1 style. - */ - isc_commandline_argument = place; - - else if (argc > ++isc_commandline_index) - /* - * Option is next argv, -D 1 style. - */ - isc_commandline_argument = argv[isc_commandline_index]; - - else { - /* - * Argument needed, but no more argv. - */ - place = ENDOPT; - - /* - * Silent failure with "missing argument" return - * when ':' starts options string, per historical spec. - */ - if (*options == ':') - return (BADARG); - - if (isc_commandline_errprint) - fprintf(stderr, "%s: %s -- %c\n", - isc_commandline_progname, - isc_msgcat_get(isc_msgcat, - ISC_MSGSET_COMMANDLINE, - ISC_MSG_OPTNEEDARG, - "option requires " - "an argument"), - isc_commandline_option); - - return (BADOPT); - } - - place = ENDOPT; - - /* - * Point to argv that follows argument. - */ - isc_commandline_index++; - } - - return (isc_commandline_option); -} diff --git a/lib/isc/entropy.c b/lib/isc/entropy.c deleted file mode 100644 index da9e81fb3129..000000000000 --- a/lib/isc/entropy.c +++ /dev/null @@ -1,1277 +0,0 @@ -/* - * Copyright (C) 2004-2007, 2009, 2010 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000-2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: entropy.c,v 1.22 2010/08/10 23:48:19 tbox Exp $ */ - -/*! \file - * \brief - * This is the system independent part of the entropy module. It is - * compiled via inclusion from the relevant OS source file, ie, - * \link unix/entropy.c unix/entropy.c \endlink or win32/entropy.c. - * - * \author Much of this code is modeled after the NetBSD /dev/random implementation, - * written by Michael Graff . - */ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#define ENTROPY_MAGIC ISC_MAGIC('E', 'n', 't', 'e') -#define SOURCE_MAGIC ISC_MAGIC('E', 'n', 't', 's') - -#define VALID_ENTROPY(e) ISC_MAGIC_VALID(e, ENTROPY_MAGIC) -#define VALID_SOURCE(s) ISC_MAGIC_VALID(s, SOURCE_MAGIC) - -/*** - *** "constants." Do not change these unless you _really_ know what - *** you are doing. - ***/ - -/*% - * Size of entropy pool in 32-bit words. This _MUST_ be a power of 2. - */ -#define RND_POOLWORDS 128 -/*% Pool in bytes. */ -#define RND_POOLBYTES (RND_POOLWORDS * 4) -/*% Pool in bits. */ -#define RND_POOLBITS (RND_POOLWORDS * 32) - -/*% - * Number of bytes returned per hash. This must be true: - * threshold * 2 <= digest_size_in_bytes - */ -#define RND_ENTROPY_THRESHOLD 10 -#define THRESHOLD_BITS (RND_ENTROPY_THRESHOLD * 8) - -/*% - * Size of the input event queue in samples. - */ -#define RND_EVENTQSIZE 32 - -/*% - * The number of times we'll "reseed" for pseudorandom seeds. This is an - * extremely weak pseudorandom seed. If the caller is using lots of - * pseudorandom data and they cannot provide a stronger random source, - * there is little we can do other than hope they're smart enough to - * call _adddata() with something better than we can come up with. - */ -#define RND_INITIALIZE 128 - -/*% Entropy Pool */ -typedef struct { - isc_uint32_t cursor; /*%< current add point in the pool */ - isc_uint32_t entropy; /*%< current entropy estimate in bits */ - isc_uint32_t pseudo; /*%< bits extracted in pseudorandom */ - isc_uint32_t rotate; /*%< how many bits to rotate by */ - isc_uint32_t pool[RND_POOLWORDS]; /*%< random pool data */ -} isc_entropypool_t; - -struct isc_entropy { - unsigned int magic; - isc_mem_t *mctx; - isc_mutex_t lock; - unsigned int refcnt; - isc_uint32_t initialized; - isc_uint32_t initcount; - isc_entropypool_t pool; - unsigned int nsources; - isc_entropysource_t *nextsource; - ISC_LIST(isc_entropysource_t) sources; -}; - -/*% Sample Queue */ -typedef struct { - isc_uint32_t last_time; /*%< last time recorded */ - isc_uint32_t last_delta; /*%< last delta value */ - isc_uint32_t last_delta2; /*%< last delta2 value */ - isc_uint32_t nsamples; /*%< number of samples filled in */ - isc_uint32_t *samples; /*%< the samples */ - isc_uint32_t *extra; /*%< extra samples added in */ -} sample_queue_t; - -typedef struct { - sample_queue_t samplequeue; -} isc_entropysamplesource_t; - -typedef struct { - isc_boolean_t start_called; - isc_entropystart_t startfunc; - isc_entropyget_t getfunc; - isc_entropystop_t stopfunc; - void *arg; - sample_queue_t samplequeue; -} isc_cbsource_t; - -typedef struct { - FILESOURCE_HANDLE_TYPE handle; -} isc_entropyfilesource_t; - -struct isc_entropysource { - unsigned int magic; - unsigned int type; - isc_entropy_t *ent; - isc_uint32_t total; /*%< entropy from this source */ - ISC_LINK(isc_entropysource_t) link; - char name[32]; - isc_boolean_t bad; - isc_boolean_t warn_keyboard; - isc_keyboard_t kbd; - union { - isc_entropysamplesource_t sample; - isc_entropyfilesource_t file; - isc_cbsource_t callback; - isc_entropyusocketsource_t usocket; - } sources; -}; - -#define ENTROPY_SOURCETYPE_SAMPLE 1 /*%< Type is a sample source */ -#define ENTROPY_SOURCETYPE_FILE 2 /*%< Type is a file source */ -#define ENTROPY_SOURCETYPE_CALLBACK 3 /*%< Type is a callback source */ -#define ENTROPY_SOURCETYPE_USOCKET 4 /*%< Type is a Unix socket source */ - -/*@{*/ -/*% - * The random pool "taps" - */ -#define TAP1 99 -#define TAP2 59 -#define TAP3 31 -#define TAP4 9 -#define TAP5 7 -/*@}*/ - -/*@{*/ -/*% - * Declarations for function provided by the system dependent sources that - * include this file. - */ -static void -fillpool(isc_entropy_t *, unsigned int, isc_boolean_t); - -static int -wait_for_sources(isc_entropy_t *); - -static void -destroyfilesource(isc_entropyfilesource_t *source); - -static void -destroyusocketsource(isc_entropyusocketsource_t *source); - -/*@}*/ - -static void -samplequeue_release(isc_entropy_t *ent, sample_queue_t *sq) { - REQUIRE(sq->samples != NULL); - REQUIRE(sq->extra != NULL); - - isc_mem_put(ent->mctx, sq->samples, RND_EVENTQSIZE * 4); - isc_mem_put(ent->mctx, sq->extra, RND_EVENTQSIZE * 4); - sq->samples = NULL; - sq->extra = NULL; -} - -static isc_result_t -samplesource_allocate(isc_entropy_t *ent, sample_queue_t *sq) { - sq->samples = isc_mem_get(ent->mctx, RND_EVENTQSIZE * 4); - if (sq->samples == NULL) - return (ISC_R_NOMEMORY); - - sq->extra = isc_mem_get(ent->mctx, RND_EVENTQSIZE * 4); - if (sq->extra == NULL) { - isc_mem_put(ent->mctx, sq->samples, RND_EVENTQSIZE * 4); - sq->samples = NULL; - return (ISC_R_NOMEMORY); - } - - sq->nsamples = 0; - - return (ISC_R_SUCCESS); -} - -/*% - * Add in entropy, even when the value we're adding in could be - * very large. - */ -static inline void -add_entropy(isc_entropy_t *ent, isc_uint32_t entropy) { - /* clamp input. Yes, this must be done. */ - entropy = ISC_MIN(entropy, RND_POOLBITS); - /* Add in the entropy we already have. */ - entropy += ent->pool.entropy; - /* Clamp. */ - ent->pool.entropy = ISC_MIN(entropy, RND_POOLBITS); -} - -/*% - * Decrement the amount of entropy the pool has. - */ -static inline void -subtract_entropy(isc_entropy_t *ent, isc_uint32_t entropy) { - entropy = ISC_MIN(entropy, ent->pool.entropy); - ent->pool.entropy -= entropy; -} - -/*! - * Add in entropy, even when the value we're adding in could be - * very large. - */ -static inline void -add_pseudo(isc_entropy_t *ent, isc_uint32_t pseudo) { - /* clamp input. Yes, this must be done. */ - pseudo = ISC_MIN(pseudo, RND_POOLBITS * 8); - /* Add in the pseudo we already have. */ - pseudo += ent->pool.pseudo; - /* Clamp. */ - ent->pool.pseudo = ISC_MIN(pseudo, RND_POOLBITS * 8); -} - -/*! - * Decrement the amount of pseudo the pool has. - */ -static inline void -subtract_pseudo(isc_entropy_t *ent, isc_uint32_t pseudo) { - pseudo = ISC_MIN(pseudo, ent->pool.pseudo); - ent->pool.pseudo -= pseudo; -} - -/*! - * Add one word to the pool, rotating the input as needed. - */ -static inline void -entropypool_add_word(isc_entropypool_t *rp, isc_uint32_t val) { - /* - * Steal some values out of the pool, and xor them into the - * word we were given. - * - * Mix the new value into the pool using xor. This will - * prevent the actual values from being known to the caller - * since the previous values are assumed to be unknown as well. - */ - val ^= rp->pool[(rp->cursor + TAP1) & (RND_POOLWORDS - 1)]; - val ^= rp->pool[(rp->cursor + TAP2) & (RND_POOLWORDS - 1)]; - val ^= rp->pool[(rp->cursor + TAP3) & (RND_POOLWORDS - 1)]; - val ^= rp->pool[(rp->cursor + TAP4) & (RND_POOLWORDS - 1)]; - val ^= rp->pool[(rp->cursor + TAP5) & (RND_POOLWORDS - 1)]; - if (rp->rotate == 0) - rp->pool[rp->cursor++] ^= val; - else - rp->pool[rp->cursor++] ^= - ((val << rp->rotate) | (val >> (32 - rp->rotate))); - - /* - * If we have looped around the pool, increment the rotate - * variable so the next value will get xored in rotated to - * a different position. - * Increment by a value that is relatively prime to the word size - * to try to spread the bits throughout the pool quickly when the - * pool is empty. - */ - if (rp->cursor == RND_POOLWORDS) { - rp->cursor = 0; - rp->rotate = (rp->rotate + 7) & 31; - } -} - -/*! - * Add a buffer's worth of data to the pool. - * - * Requires that the lock is held on the entropy pool. - */ -static void -entropypool_adddata(isc_entropy_t *ent, void *p, unsigned int len, - isc_uint32_t entropy) -{ - isc_uint32_t val; - unsigned long addr; - isc_uint8_t *buf; - - addr = (unsigned long)p; - buf = p; - - if ((addr & 0x03U) != 0U) { - val = 0; - switch (len) { - case 3: - val = *buf++; - len--; - case 2: - val = val << 8 | *buf++; - len--; - case 1: - val = val << 8 | *buf++; - len--; - } - - entropypool_add_word(&ent->pool, val); - } - - for (; len > 3; len -= 4) { - val = *((isc_uint32_t *)buf); - - entropypool_add_word(&ent->pool, val); - buf += 4; - } - - if (len != 0) { - val = 0; - switch (len) { - case 3: - val = *buf++; - case 2: - val = val << 8 | *buf++; - case 1: - val = val << 8 | *buf++; - } - - entropypool_add_word(&ent->pool, val); - } - - add_entropy(ent, entropy); - subtract_pseudo(ent, entropy); -} - -static inline void -reseed(isc_entropy_t *ent) { - isc_time_t t; - pid_t pid; - - if (ent->initcount == 0) { - pid = getpid(); - entropypool_adddata(ent, &pid, sizeof(pid), 0); - pid = getppid(); - entropypool_adddata(ent, &pid, sizeof(pid), 0); - } - - /*! - * After we've reseeded 100 times, only add new timing info every - * 50 requests. This will keep us from using lots and lots of - * CPU just to return bad pseudorandom data anyway. - */ - if (ent->initcount > 100) - if ((ent->initcount % 50) != 0) - return; - - TIME_NOW(&t); - entropypool_adddata(ent, &t, sizeof(t), 0); - ent->initcount++; -} - -static inline unsigned int -estimate_entropy(sample_queue_t *sq, isc_uint32_t t) { - isc_int32_t delta; - isc_int32_t delta2; - isc_int32_t delta3; - - /*! - * If the time counter has overflowed, calculate the real difference. - * If it has not, it is simpler. - */ - if (t < sq->last_time) - delta = UINT_MAX - sq->last_time + t; - else - delta = sq->last_time - t; - - if (delta < 0) - delta = -delta; - - /* - * Calculate the second and third order differentials - */ - delta2 = sq->last_delta - delta; - if (delta2 < 0) - delta2 = -delta2; - - delta3 = sq->last_delta2 - delta2; - if (delta3 < 0) - delta3 = -delta3; - - sq->last_time = t; - sq->last_delta = delta; - sq->last_delta2 = delta2; - - /* - * If any delta is 0, we got no entropy. If all are non-zero, we - * might have something. - */ - if (delta == 0 || delta2 == 0 || delta3 == 0) - return 0; - - /* - * We could find the smallest delta and claim we got log2(delta) - * bits, but for now return that we found 1 bit. - */ - return 1; -} - -static unsigned int -crunchsamples(isc_entropy_t *ent, sample_queue_t *sq) { - unsigned int ns; - unsigned int added; - - if (sq->nsamples < 6) - return (0); - - added = 0; - sq->last_time = sq->samples[0]; - sq->last_delta = 0; - sq->last_delta2 = 0; - - /* - * Prime the values by adding in the first 4 samples in. This - * should completely initialize the delta calculations. - */ - for (ns = 0; ns < 4; ns++) - (void)estimate_entropy(sq, sq->samples[ns]); - - for (ns = 4; ns < sq->nsamples; ns++) - added += estimate_entropy(sq, sq->samples[ns]); - - entropypool_adddata(ent, sq->samples, sq->nsamples * 4, added); - entropypool_adddata(ent, sq->extra, sq->nsamples * 4, 0); - - /* - * Move the last 4 samples into the first 4 positions, and start - * adding new samples from that point. - */ - for (ns = 0; ns < 4; ns++) { - sq->samples[ns] = sq->samples[sq->nsamples - 4 + ns]; - sq->extra[ns] = sq->extra[sq->nsamples - 4 + ns]; - } - - sq->nsamples = 4; - - return (added); -} - -static unsigned int -get_from_callback(isc_entropysource_t *source, unsigned int desired, - isc_boolean_t blocking) -{ - isc_entropy_t *ent = source->ent; - isc_cbsource_t *cbs = &source->sources.callback; - unsigned int added; - unsigned int got; - isc_result_t result; - - if (desired == 0) - return (0); - - if (source->bad) - return (0); - - if (!cbs->start_called && cbs->startfunc != NULL) { - result = cbs->startfunc(source, cbs->arg, blocking); - if (result != ISC_R_SUCCESS) - return (0); - cbs->start_called = ISC_TRUE; - } - - added = 0; - result = ISC_R_SUCCESS; - while (desired > 0 && result == ISC_R_SUCCESS) { - result = cbs->getfunc(source, cbs->arg, blocking); - if (result == ISC_R_QUEUEFULL) { - got = crunchsamples(ent, &cbs->samplequeue); - added += got; - desired -= ISC_MIN(got, desired); - result = ISC_R_SUCCESS; - } else if (result != ISC_R_SUCCESS && - result != ISC_R_NOTBLOCKING) - source->bad = ISC_TRUE; - - } - - return (added); -} - -/* - * Extract some number of bytes from the random pool, decreasing the - * estimate of randomness as each byte is extracted. - * - * Do this by stiring the pool and returning a part of hash as randomness. - * Note that no secrets are given away here since parts of the hash are - * xored together before returned. - * - * Honor the request from the caller to only return good data, any data, - * etc. - */ -isc_result_t -isc_entropy_getdata(isc_entropy_t *ent, void *data, unsigned int length, - unsigned int *returned, unsigned int flags) -{ - unsigned int i; - isc_sha1_t hash; - unsigned char digest[ISC_SHA1_DIGESTLENGTH]; - isc_uint32_t remain, deltae, count, total; - isc_uint8_t *buf; - isc_boolean_t goodonly, partial, blocking; - - REQUIRE(VALID_ENTROPY(ent)); - REQUIRE(data != NULL); - REQUIRE(length > 0); - - goodonly = ISC_TF((flags & ISC_ENTROPY_GOODONLY) != 0); - partial = ISC_TF((flags & ISC_ENTROPY_PARTIAL) != 0); - blocking = ISC_TF((flags & ISC_ENTROPY_BLOCKING) != 0); - - REQUIRE(!partial || returned != NULL); - - LOCK(&ent->lock); - - remain = length; - buf = data; - total = 0; - while (remain != 0) { - count = ISC_MIN(remain, RND_ENTROPY_THRESHOLD); - - /* - * If we are extracting good data only, make certain we - * have enough data in our pool for this pass. If we don't, - * get some, and fail if we can't, and partial returns - * are not ok. - */ - if (goodonly) { - unsigned int fillcount; - - fillcount = ISC_MAX(remain * 8, count * 8); - - /* - * If, however, we have at least THRESHOLD_BITS - * of entropy in the pool, don't block here. It is - * better to drain the pool once in a while and - * then refill it than it is to constantly keep the - * pool full. - */ - if (ent->pool.entropy >= THRESHOLD_BITS) - fillpool(ent, fillcount, ISC_FALSE); - else - fillpool(ent, fillcount, blocking); - - /* - * Verify that we got enough entropy to do one - * extraction. If we didn't, bail. - */ - if (ent->pool.entropy < THRESHOLD_BITS) { - if (!partial) - goto zeroize; - else - goto partial_output; - } - } else { - /* - * If we've extracted half our pool size in bits - * since the last refresh, try to refresh here. - */ - if (ent->initialized < THRESHOLD_BITS) - fillpool(ent, THRESHOLD_BITS, blocking); - else - fillpool(ent, 0, ISC_FALSE); - - /* - * If we've not initialized with enough good random - * data, seed with our crappy code. - */ - if (ent->initialized < THRESHOLD_BITS) - reseed(ent); - } - - isc_sha1_init(&hash); - isc_sha1_update(&hash, (void *)(ent->pool.pool), - RND_POOLBYTES); - isc_sha1_final(&hash, digest); - - /* - * Stir the extracted data (all of it) back into the pool. - */ - entropypool_adddata(ent, digest, ISC_SHA1_DIGESTLENGTH, 0); - - for (i = 0; i < count; i++) - buf[i] = digest[i] ^ digest[i + RND_ENTROPY_THRESHOLD]; - - buf += count; - remain -= count; - - deltae = count * 8; - deltae = ISC_MIN(deltae, ent->pool.entropy); - total += deltae; - subtract_entropy(ent, deltae); - add_pseudo(ent, count * 8); - } - - partial_output: - memset(digest, 0, sizeof(digest)); - - if (returned != NULL) - *returned = (length - remain); - - UNLOCK(&ent->lock); - - return (ISC_R_SUCCESS); - - zeroize: - /* put the entropy we almost extracted back */ - add_entropy(ent, total); - memset(data, 0, length); - memset(digest, 0, sizeof(digest)); - if (returned != NULL) - *returned = 0; - - UNLOCK(&ent->lock); - - return (ISC_R_NOENTROPY); -} - -static void -isc_entropypool_init(isc_entropypool_t *pool) { - pool->cursor = RND_POOLWORDS - 1; - pool->entropy = 0; - pool->pseudo = 0; - pool->rotate = 0; - memset(pool->pool, 0, RND_POOLBYTES); -} - -static void -isc_entropypool_invalidate(isc_entropypool_t *pool) { - pool->cursor = 0; - pool->entropy = 0; - pool->pseudo = 0; - pool->rotate = 0; - memset(pool->pool, 0, RND_POOLBYTES); -} - -isc_result_t -isc_entropy_create(isc_mem_t *mctx, isc_entropy_t **entp) { - isc_result_t result; - isc_entropy_t *ent; - - REQUIRE(mctx != NULL); - REQUIRE(entp != NULL && *entp == NULL); - - ent = isc_mem_get(mctx, sizeof(isc_entropy_t)); - if (ent == NULL) - return (ISC_R_NOMEMORY); - - /* - * We need a lock. - */ - result = isc_mutex_init(&ent->lock); - if (result != ISC_R_SUCCESS) - goto errout; - - /* - * From here down, no failures will/can occur. - */ - ISC_LIST_INIT(ent->sources); - ent->nextsource = NULL; - ent->nsources = 0; - ent->mctx = NULL; - isc_mem_attach(mctx, &ent->mctx); - ent->refcnt = 1; - ent->initialized = 0; - ent->initcount = 0; - ent->magic = ENTROPY_MAGIC; - - isc_entropypool_init(&ent->pool); - - *entp = ent; - return (ISC_R_SUCCESS); - - errout: - isc_mem_put(mctx, ent, sizeof(isc_entropy_t)); - - return (result); -} - -/*! - * Requires "ent" be locked. - */ -static void -destroysource(isc_entropysource_t **sourcep) { - isc_entropysource_t *source; - isc_entropy_t *ent; - isc_cbsource_t *cbs; - - source = *sourcep; - *sourcep = NULL; - ent = source->ent; - - ISC_LIST_UNLINK(ent->sources, source, link); - ent->nextsource = NULL; - REQUIRE(ent->nsources > 0); - ent->nsources--; - - switch (source->type) { - case ENTROPY_SOURCETYPE_FILE: - if (! source->bad) - destroyfilesource(&source->sources.file); - break; - case ENTROPY_SOURCETYPE_USOCKET: - if (! source->bad) - destroyusocketsource(&source->sources.usocket); - break; - case ENTROPY_SOURCETYPE_SAMPLE: - samplequeue_release(ent, &source->sources.sample.samplequeue); - break; - case ENTROPY_SOURCETYPE_CALLBACK: - cbs = &source->sources.callback; - if (cbs->start_called && cbs->stopfunc != NULL) { - cbs->stopfunc(source, cbs->arg); - cbs->start_called = ISC_FALSE; - } - samplequeue_release(ent, &cbs->samplequeue); - break; - } - - memset(source, 0, sizeof(isc_entropysource_t)); - - isc_mem_put(ent->mctx, source, sizeof(isc_entropysource_t)); -} - -static inline isc_boolean_t -destroy_check(isc_entropy_t *ent) { - isc_entropysource_t *source; - - if (ent->refcnt > 0) - return (ISC_FALSE); - - source = ISC_LIST_HEAD(ent->sources); - while (source != NULL) { - switch (source->type) { - case ENTROPY_SOURCETYPE_FILE: - case ENTROPY_SOURCETYPE_USOCKET: - break; - default: - return (ISC_FALSE); - } - source = ISC_LIST_NEXT(source, link); - } - - return (ISC_TRUE); -} - -static void -destroy(isc_entropy_t **entp) { - isc_entropy_t *ent; - isc_entropysource_t *source; - isc_mem_t *mctx; - - REQUIRE(entp != NULL && *entp != NULL); - ent = *entp; - *entp = NULL; - - LOCK(&ent->lock); - - REQUIRE(ent->refcnt == 0); - - /* - * Here, detach non-sample sources. - */ - source = ISC_LIST_HEAD(ent->sources); - while (source != NULL) { - switch(source->type) { - case ENTROPY_SOURCETYPE_FILE: - case ENTROPY_SOURCETYPE_USOCKET: - destroysource(&source); - break; - } - source = ISC_LIST_HEAD(ent->sources); - } - - /* - * If there are other types of sources, we've found a bug. - */ - REQUIRE(ISC_LIST_EMPTY(ent->sources)); - - mctx = ent->mctx; - - isc_entropypool_invalidate(&ent->pool); - - UNLOCK(&ent->lock); - - DESTROYLOCK(&ent->lock); - - memset(ent, 0, sizeof(isc_entropy_t)); - isc_mem_put(mctx, ent, sizeof(isc_entropy_t)); - isc_mem_detach(&mctx); -} - -void -isc_entropy_destroysource(isc_entropysource_t **sourcep) { - isc_entropysource_t *source; - isc_entropy_t *ent; - isc_boolean_t killit; - - REQUIRE(sourcep != NULL); - REQUIRE(VALID_SOURCE(*sourcep)); - - source = *sourcep; - *sourcep = NULL; - - ent = source->ent; - REQUIRE(VALID_ENTROPY(ent)); - - LOCK(&ent->lock); - - destroysource(&source); - - killit = destroy_check(ent); - - UNLOCK(&ent->lock); - - if (killit) - destroy(&ent); -} - -isc_result_t -isc_entropy_createcallbacksource(isc_entropy_t *ent, - isc_entropystart_t start, - isc_entropyget_t get, - isc_entropystop_t stop, - void *arg, - isc_entropysource_t **sourcep) -{ - isc_result_t result; - isc_entropysource_t *source; - isc_cbsource_t *cbs; - - REQUIRE(VALID_ENTROPY(ent)); - REQUIRE(get != NULL); - REQUIRE(sourcep != NULL && *sourcep == NULL); - - LOCK(&ent->lock); - - source = isc_mem_get(ent->mctx, sizeof(isc_entropysource_t)); - if (source == NULL) { - result = ISC_R_NOMEMORY; - goto errout; - } - source->bad = ISC_FALSE; - - cbs = &source->sources.callback; - - result = samplesource_allocate(ent, &cbs->samplequeue); - if (result != ISC_R_SUCCESS) - goto errout; - - cbs->start_called = ISC_FALSE; - cbs->startfunc = start; - cbs->getfunc = get; - cbs->stopfunc = stop; - cbs->arg = arg; - - /* - * From here down, no failures can occur. - */ - source->magic = SOURCE_MAGIC; - source->type = ENTROPY_SOURCETYPE_CALLBACK; - source->ent = ent; - source->total = 0; - memset(source->name, 0, sizeof(source->name)); - ISC_LINK_INIT(source, link); - - /* - * Hook it into the entropy system. - */ - ISC_LIST_APPEND(ent->sources, source, link); - ent->nsources++; - - *sourcep = source; - - UNLOCK(&ent->lock); - return (ISC_R_SUCCESS); - - errout: - if (source != NULL) - isc_mem_put(ent->mctx, source, sizeof(isc_entropysource_t)); - - UNLOCK(&ent->lock); - - return (result); -} - -void -isc_entropy_stopcallbacksources(isc_entropy_t *ent) { - isc_entropysource_t *source; - isc_cbsource_t *cbs; - - REQUIRE(VALID_ENTROPY(ent)); - - LOCK(&ent->lock); - - source = ISC_LIST_HEAD(ent->sources); - while (source != NULL) { - if (source->type == ENTROPY_SOURCETYPE_CALLBACK) { - cbs = &source->sources.callback; - if (cbs->start_called && cbs->stopfunc != NULL) { - cbs->stopfunc(source, cbs->arg); - cbs->start_called = ISC_FALSE; - } - } - - source = ISC_LIST_NEXT(source, link); - } - - UNLOCK(&ent->lock); -} - -isc_result_t -isc_entropy_createsamplesource(isc_entropy_t *ent, - isc_entropysource_t **sourcep) -{ - isc_result_t result; - isc_entropysource_t *source; - sample_queue_t *sq; - - REQUIRE(VALID_ENTROPY(ent)); - REQUIRE(sourcep != NULL && *sourcep == NULL); - - LOCK(&ent->lock); - - source = isc_mem_get(ent->mctx, sizeof(isc_entropysource_t)); - if (source == NULL) { - result = ISC_R_NOMEMORY; - goto errout; - } - - sq = &source->sources.sample.samplequeue; - result = samplesource_allocate(ent, sq); - if (result != ISC_R_SUCCESS) - goto errout; - - /* - * From here down, no failures can occur. - */ - source->magic = SOURCE_MAGIC; - source->type = ENTROPY_SOURCETYPE_SAMPLE; - source->ent = ent; - source->total = 0; - memset(source->name, 0, sizeof(source->name)); - ISC_LINK_INIT(source, link); - - /* - * Hook it into the entropy system. - */ - ISC_LIST_APPEND(ent->sources, source, link); - ent->nsources++; - - *sourcep = source; - - UNLOCK(&ent->lock); - return (ISC_R_SUCCESS); - - errout: - if (source != NULL) - isc_mem_put(ent->mctx, source, sizeof(isc_entropysource_t)); - - UNLOCK(&ent->lock); - - return (result); -} - -/*! - * Add a sample, and return ISC_R_SUCCESS if the queue has become full, - * ISC_R_NOENTROPY if it has space remaining, and ISC_R_NOMORE if the - * queue was full when this function was called. - */ -static isc_result_t -addsample(sample_queue_t *sq, isc_uint32_t sample, isc_uint32_t extra) { - if (sq->nsamples >= RND_EVENTQSIZE) - return (ISC_R_NOMORE); - - sq->samples[sq->nsamples] = sample; - sq->extra[sq->nsamples] = extra; - sq->nsamples++; - - if (sq->nsamples >= RND_EVENTQSIZE) - return (ISC_R_QUEUEFULL); - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_entropy_addsample(isc_entropysource_t *source, isc_uint32_t sample, - isc_uint32_t extra) -{ - isc_entropy_t *ent; - sample_queue_t *sq; - unsigned int entropy; - isc_result_t result; - - REQUIRE(VALID_SOURCE(source)); - - ent = source->ent; - - LOCK(&ent->lock); - - sq = &source->sources.sample.samplequeue; - result = addsample(sq, sample, extra); - if (result == ISC_R_QUEUEFULL) { - entropy = crunchsamples(ent, sq); - add_entropy(ent, entropy); - } - - UNLOCK(&ent->lock); - - return (result); -} - -isc_result_t -isc_entropy_addcallbacksample(isc_entropysource_t *source, isc_uint32_t sample, - isc_uint32_t extra) -{ - sample_queue_t *sq; - isc_result_t result; - - REQUIRE(VALID_SOURCE(source)); - REQUIRE(source->type == ENTROPY_SOURCETYPE_CALLBACK); - - sq = &source->sources.callback.samplequeue; - result = addsample(sq, sample, extra); - - return (result); -} - -void -isc_entropy_putdata(isc_entropy_t *ent, void *data, unsigned int length, - isc_uint32_t entropy) -{ - REQUIRE(VALID_ENTROPY(ent)); - - LOCK(&ent->lock); - - entropypool_adddata(ent, data, length, entropy); - - if (ent->initialized < THRESHOLD_BITS) - ent->initialized = THRESHOLD_BITS; - - UNLOCK(&ent->lock); -} - -static void -dumpstats(isc_entropy_t *ent, FILE *out) { - fprintf(out, - isc_msgcat_get(isc_msgcat, ISC_MSGSET_ENTROPY, - ISC_MSG_ENTROPYSTATS, - "Entropy pool %p: refcnt %u cursor %u," - " rotate %u entropy %u pseudo %u nsources %u" - " nextsource %p initialized %u initcount %u\n"), - ent, ent->refcnt, - ent->pool.cursor, ent->pool.rotate, - ent->pool.entropy, ent->pool.pseudo, - ent->nsources, ent->nextsource, ent->initialized, - ent->initcount); -} - -/* - * This function ignores locking. Use at your own risk. - */ -void -isc_entropy_stats(isc_entropy_t *ent, FILE *out) { - REQUIRE(VALID_ENTROPY(ent)); - - LOCK(&ent->lock); - dumpstats(ent, out); - UNLOCK(&ent->lock); -} - -unsigned int -isc_entropy_status(isc_entropy_t *ent) { - unsigned int estimate; - - LOCK(&ent->lock); - estimate = ent->pool.entropy; - UNLOCK(&ent->lock); - - return estimate; -} - -void -isc_entropy_attach(isc_entropy_t *ent, isc_entropy_t **entp) { - REQUIRE(VALID_ENTROPY(ent)); - REQUIRE(entp != NULL && *entp == NULL); - - LOCK(&ent->lock); - - ent->refcnt++; - *entp = ent; - - UNLOCK(&ent->lock); -} - -void -isc_entropy_detach(isc_entropy_t **entp) { - isc_entropy_t *ent; - isc_boolean_t killit; - - REQUIRE(entp != NULL && VALID_ENTROPY(*entp)); - ent = *entp; - *entp = NULL; - - LOCK(&ent->lock); - - REQUIRE(ent->refcnt > 0); - ent->refcnt--; - - killit = destroy_check(ent); - - UNLOCK(&ent->lock); - - if (killit) - destroy(&ent); -} - -static isc_result_t -kbdstart(isc_entropysource_t *source, void *arg, isc_boolean_t blocking) { - /* - * The intent of "first" is to provide a warning message only once - * during the run of a program that might try to gather keyboard - * entropy multiple times. - */ - static isc_boolean_t first = ISC_TRUE; - - UNUSED(arg); - - if (! blocking) - return (ISC_R_NOENTROPY); - - if (first) { - if (source->warn_keyboard) - fprintf(stderr, "You must use the keyboard to create " - "entropy, since your system is lacking\n" - "/dev/random (or equivalent)\n\n"); - first = ISC_FALSE; - } - fprintf(stderr, "start typing:\n"); - - return (isc_keyboard_open(&source->kbd)); -} - -static void -kbdstop(isc_entropysource_t *source, void *arg) { - - UNUSED(arg); - - if (! isc_keyboard_canceled(&source->kbd)) - fprintf(stderr, "stop typing.\r\n"); - - (void)isc_keyboard_close(&source->kbd, 3); -} - -static isc_result_t -kbdget(isc_entropysource_t *source, void *arg, isc_boolean_t blocking) { - isc_result_t result; - isc_time_t t; - isc_uint32_t sample; - isc_uint32_t extra; - unsigned char c; - - UNUSED(arg); - - if (!blocking) - return (ISC_R_NOTBLOCKING); - - result = isc_keyboard_getchar(&source->kbd, &c); - if (result != ISC_R_SUCCESS) - return (result); - - TIME_NOW(&t); - - sample = isc_time_nanoseconds(&t); - extra = c; - - result = isc_entropy_addcallbacksample(source, sample, extra); - if (result != ISC_R_SUCCESS) { - fprintf(stderr, "\r\n"); - return (result); - } - - fprintf(stderr, "."); - fflush(stderr); - - return (result); -} - -isc_result_t -isc_entropy_usebestsource(isc_entropy_t *ectx, isc_entropysource_t **source, - const char *randomfile, int use_keyboard) -{ - isc_result_t result; - isc_result_t final_result = ISC_R_NOENTROPY; - isc_boolean_t userfile = ISC_TRUE; - - REQUIRE(VALID_ENTROPY(ectx)); - REQUIRE(source != NULL && *source == NULL); - REQUIRE(use_keyboard == ISC_ENTROPY_KEYBOARDYES || - use_keyboard == ISC_ENTROPY_KEYBOARDNO || - use_keyboard == ISC_ENTROPY_KEYBOARDMAYBE); - -#ifdef PATH_RANDOMDEV - if (randomfile == NULL) { - randomfile = PATH_RANDOMDEV; - userfile = ISC_FALSE; - } -#endif - - if (randomfile != NULL && use_keyboard != ISC_ENTROPY_KEYBOARDYES) { - result = isc_entropy_createfilesource(ectx, randomfile); - if (result == ISC_R_SUCCESS && - use_keyboard == ISC_ENTROPY_KEYBOARDMAYBE) - use_keyboard = ISC_ENTROPY_KEYBOARDNO; - if (result != ISC_R_SUCCESS && userfile) - return (result); - - final_result = result; - } - - if (use_keyboard != ISC_ENTROPY_KEYBOARDNO) { - result = isc_entropy_createcallbacksource(ectx, kbdstart, - kbdget, kbdstop, - NULL, source); - if (result == ISC_R_SUCCESS) - (*source)->warn_keyboard = - ISC_TF(use_keyboard == - ISC_ENTROPY_KEYBOARDMAYBE); - - if (final_result != ISC_R_SUCCESS) - final_result = result; - } - - /* - * final_result is ISC_R_SUCCESS if at least one source of entropy - * could be started, otherwise it is the error from the most recently - * failed operation (or ISC_R_NOENTROPY if PATH_RANDOMDEV is not - * defined and use_keyboard is ISC_ENTROPY_KEYBOARDNO). - */ - return (final_result); -} diff --git a/lib/isc/fsaccess.c b/lib/isc/fsaccess.c deleted file mode 100644 index 5c9718318eae..000000000000 --- a/lib/isc/fsaccess.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: fsaccess.c,v 1.10 2007/06/19 23:47:17 tbox Exp $ */ - -/*! \file - * \brief - * This file contains the OS-independent functionality of the API. - */ -#include -#include -#include - -/*! - * Shorthand. Maybe ISC__FSACCESS_PERMISSIONBITS should not even be in - * . Could check consistency with sizeof(isc_fsaccess_t) - * and the number of bits in each function. - */ -#define STEP (ISC__FSACCESS_PERMISSIONBITS) -#define GROUP (STEP) -#define OTHER (STEP * 2) - -void -isc_fsaccess_add(int trustee, int permission, isc_fsaccess_t *access) { - REQUIRE(trustee <= 0x7); - REQUIRE(permission <= 0xFF); - - if ((trustee & ISC_FSACCESS_OWNER) != 0) - *access |= permission; - - if ((trustee & ISC_FSACCESS_GROUP) != 0) - *access |= (permission << GROUP); - - if ((trustee & ISC_FSACCESS_OTHER) != 0) - *access |= (permission << OTHER); -} - -void -isc_fsaccess_remove(int trustee, int permission, isc_fsaccess_t *access) { - REQUIRE(trustee <= 0x7); - REQUIRE(permission <= 0xFF); - - - if ((trustee & ISC_FSACCESS_OWNER) != 0) - *access &= ~permission; - - if ((trustee & ISC_FSACCESS_GROUP) != 0) - *access &= ~(permission << GROUP); - - if ((trustee & ISC_FSACCESS_OTHER) != 0) - *access &= ~(permission << OTHER); -} - -static isc_result_t -check_bad_bits(isc_fsaccess_t access, isc_boolean_t is_dir) { - isc_fsaccess_t bits; - - /* - * Check for disallowed user bits. - */ - if (is_dir) - bits = ISC_FSACCESS_READ | - ISC_FSACCESS_WRITE | - ISC_FSACCESS_EXECUTE; - else - bits = ISC_FSACCESS_CREATECHILD | - ISC_FSACCESS_ACCESSCHILD | - ISC_FSACCESS_DELETECHILD | - ISC_FSACCESS_LISTDIRECTORY; - - /* - * Set group bad bits. - */ - bits |= bits << STEP; - /* - * Set other bad bits. - */ - bits |= bits << STEP; - - if ((access & bits) != 0) { - if (is_dir) - return (ISC_R_NOTFILE); - else - return (ISC_R_NOTDIRECTORY); - } - - return (ISC_R_SUCCESS); -} diff --git a/lib/isc/hash.c b/lib/isc/hash.c deleted file mode 100644 index f1d68c7700f5..000000000000 --- a/lib/isc/hash.c +++ /dev/null @@ -1,404 +0,0 @@ -/* - * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: hash.c,v 1.16 2009/09/01 00:22:28 jinmei Exp $ */ - -/*! \file - * Some portion of this code was derived from universal hash function - * libraries of Rice University. -\section license UH Universal Hashing Library - -Copyright ((c)) 2002, Rice University -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of Rice University (RICE) nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - -This software is provided by RICE and the contributors on an "as is" -basis, without any representations or warranties of any kind, express -or implied including, but not limited to, representations or -warranties of non-infringement, merchantability or fitness for a -particular purpose. In no event shall RICE or contributors be liable -for any direct, indirect, incidental, special, exemplary, or -consequential damages (including, but not limited to, procurement of -substitute goods or services; loss of use, data, or profits; or -business interruption) however caused and on any theory of liability, -whether in contract, strict liability, or tort (including negligence -or otherwise) arising in any way out of the use of this software, even -if advised of the possibility of such damage. -*/ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define HASH_MAGIC ISC_MAGIC('H', 'a', 's', 'h') -#define VALID_HASH(h) ISC_MAGIC_VALID((h), HASH_MAGIC) - -/*% - * A large 32-bit prime number that specifies the range of the hash output. - */ -#define PRIME32 0xFFFFFFFB /* 2^32 - 5 */ - -/*@{*/ -/*% - * Types of random seed and hash accumulator. Perhaps they can be system - * dependent. - */ -typedef isc_uint32_t hash_accum_t; -typedef isc_uint16_t hash_random_t; -/*@}*/ - -/*% isc hash structure */ -struct isc_hash { - unsigned int magic; - isc_mem_t *mctx; - isc_mutex_t lock; - isc_boolean_t initialized; - isc_refcount_t refcnt; - isc_entropy_t *entropy; /*%< entropy source */ - unsigned int limit; /*%< upper limit of key length */ - size_t vectorlen; /*%< size of the vector below */ - hash_random_t *rndvector; /*%< random vector for universal hashing */ -}; - -static isc_mutex_t createlock; -static isc_once_t once = ISC_ONCE_INIT; -static isc_hash_t *hash = NULL; - -static unsigned char maptolower[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, - 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff -}; - -isc_result_t -isc_hash_ctxcreate(isc_mem_t *mctx, isc_entropy_t *entropy, - unsigned int limit, isc_hash_t **hctxp) -{ - isc_result_t result; - isc_hash_t *hctx; - size_t vlen; - hash_random_t *rv; - hash_accum_t overflow_limit; - - REQUIRE(mctx != NULL); - REQUIRE(hctxp != NULL && *hctxp == NULL); - - /* - * Overflow check. Since our implementation only does a modulo - * operation at the last stage of hash calculation, the accumulator - * must not overflow. - */ - overflow_limit = - 1 << (((sizeof(hash_accum_t) - sizeof(hash_random_t))) * 8); - if (overflow_limit < (limit + 1) * 0xff) - return (ISC_R_RANGE); - - hctx = isc_mem_get(mctx, sizeof(isc_hash_t)); - if (hctx == NULL) - return (ISC_R_NOMEMORY); - - vlen = sizeof(hash_random_t) * (limit + 1); - rv = isc_mem_get(mctx, vlen); - if (rv == NULL) { - result = ISC_R_NOMEMORY; - goto errout; - } - - /* - * We need a lock. - */ - result = isc_mutex_init(&hctx->lock); - if (result != ISC_R_SUCCESS) - goto errout; - - /* - * From here down, no failures will/can occur. - */ - hctx->magic = HASH_MAGIC; - hctx->mctx = NULL; - isc_mem_attach(mctx, &hctx->mctx); - hctx->initialized = ISC_FALSE; - result = isc_refcount_init(&hctx->refcnt, 1); - if (result != ISC_R_SUCCESS) - goto cleanup_lock; - hctx->entropy = NULL; - hctx->limit = limit; - hctx->vectorlen = vlen; - hctx->rndvector = rv; - -#ifdef BIND9 - if (entropy != NULL) - isc_entropy_attach(entropy, &hctx->entropy); -#else - UNUSED(entropy); -#endif - - *hctxp = hctx; - return (ISC_R_SUCCESS); - - cleanup_lock: - DESTROYLOCK(&hctx->lock); - errout: - isc_mem_put(mctx, hctx, sizeof(isc_hash_t)); - if (rv != NULL) - isc_mem_put(mctx, rv, vlen); - - return (result); -} - -static void -initialize_lock(void) { - RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS); -} - -isc_result_t -isc_hash_create(isc_mem_t *mctx, isc_entropy_t *entropy, size_t limit) { - isc_result_t result = ISC_R_SUCCESS; - - REQUIRE(mctx != NULL); - INSIST(hash == NULL); - - RUNTIME_CHECK(isc_once_do(&once, initialize_lock) == ISC_R_SUCCESS); - - LOCK(&createlock); - - if (hash == NULL) - result = isc_hash_ctxcreate(mctx, entropy, limit, &hash); - - UNLOCK(&createlock); - - return (result); -} - -void -isc_hash_ctxinit(isc_hash_t *hctx) { - LOCK(&hctx->lock); - - if (hctx->initialized == ISC_TRUE) - goto out; - - if (hctx->entropy) { -#ifdef BIND9 - isc_result_t result; - - result = isc_entropy_getdata(hctx->entropy, - hctx->rndvector, hctx->vectorlen, - NULL, 0); - INSIST(result == ISC_R_SUCCESS); -#else - INSIST(0); -#endif - } else { - isc_uint32_t pr; - unsigned int i, copylen; - unsigned char *p; - - p = (unsigned char *)hctx->rndvector; - for (i = 0; i < hctx->vectorlen; i += copylen, p += copylen) { - isc_random_get(&pr); - if (i + sizeof(pr) <= hctx->vectorlen) - copylen = sizeof(pr); - else - copylen = hctx->vectorlen - i; - - memcpy(p, &pr, copylen); - } - INSIST(p == (unsigned char *)hctx->rndvector + - hctx->vectorlen); - } - - hctx->initialized = ISC_TRUE; - - out: - UNLOCK(&hctx->lock); -} - -void -isc_hash_init() { - INSIST(hash != NULL && VALID_HASH(hash)); - - isc_hash_ctxinit(hash); -} - -void -isc_hash_ctxattach(isc_hash_t *hctx, isc_hash_t **hctxp) { - REQUIRE(VALID_HASH(hctx)); - REQUIRE(hctxp != NULL && *hctxp == NULL); - - isc_refcount_increment(&hctx->refcnt, NULL); - *hctxp = hctx; -} - -static void -destroy(isc_hash_t **hctxp) { - isc_hash_t *hctx; - isc_mem_t *mctx; - unsigned char canary0[4], canary1[4]; - - REQUIRE(hctxp != NULL && *hctxp != NULL); - hctx = *hctxp; - *hctxp = NULL; - - LOCK(&hctx->lock); - - isc_refcount_destroy(&hctx->refcnt); - - mctx = hctx->mctx; -#ifdef BIND9 - if (hctx->entropy != NULL) - isc_entropy_detach(&hctx->entropy); -#endif - if (hctx->rndvector != NULL) - isc_mem_put(mctx, hctx->rndvector, hctx->vectorlen); - - UNLOCK(&hctx->lock); - - DESTROYLOCK(&hctx->lock); - - memcpy(canary0, hctx + 1, sizeof(canary0)); - memset(hctx, 0, sizeof(isc_hash_t)); - memcpy(canary1, hctx + 1, sizeof(canary1)); - INSIST(memcmp(canary0, canary1, sizeof(canary0)) == 0); - isc_mem_put(mctx, hctx, sizeof(isc_hash_t)); - isc_mem_detach(&mctx); -} - -void -isc_hash_ctxdetach(isc_hash_t **hctxp) { - isc_hash_t *hctx; - unsigned int refs; - - REQUIRE(hctxp != NULL && VALID_HASH(*hctxp)); - hctx = *hctxp; - - isc_refcount_decrement(&hctx->refcnt, &refs); - if (refs == 0) - destroy(&hctx); - - *hctxp = NULL; -} - -void -isc_hash_destroy() { - unsigned int refs; - - INSIST(hash != NULL && VALID_HASH(hash)); - - isc_refcount_decrement(&hash->refcnt, &refs); - INSIST(refs == 0); - - destroy(&hash); -} - -static inline unsigned int -hash_calc(isc_hash_t *hctx, const unsigned char *key, unsigned int keylen, - isc_boolean_t case_sensitive) -{ - hash_accum_t partial_sum = 0; - hash_random_t *p = hctx->rndvector; - unsigned int i = 0; - - /* Make it sure that the hash context is initialized. */ - if (hctx->initialized == ISC_FALSE) - isc_hash_ctxinit(hctx); - - if (case_sensitive) { - for (i = 0; i < keylen; i++) - partial_sum += key[i] * (hash_accum_t)p[i]; - } else { - for (i = 0; i < keylen; i++) - partial_sum += maptolower[key[i]] * (hash_accum_t)p[i]; - } - - partial_sum += p[i]; - - return ((unsigned int)(partial_sum % PRIME32)); -} - -unsigned int -isc_hash_ctxcalc(isc_hash_t *hctx, const unsigned char *key, - unsigned int keylen, isc_boolean_t case_sensitive) -{ - REQUIRE(hctx != NULL && VALID_HASH(hctx)); - REQUIRE(keylen <= hctx->limit); - - return (hash_calc(hctx, key, keylen, case_sensitive)); -} - -unsigned int -isc_hash_calc(const unsigned char *key, unsigned int keylen, - isc_boolean_t case_sensitive) -{ - INSIST(hash != NULL && VALID_HASH(hash)); - REQUIRE(keylen <= hash->limit); - - return (hash_calc(hash, key, keylen, case_sensitive)); -} diff --git a/lib/isc/heap.c b/lib/isc/heap.c deleted file mode 100644 index ebadd2fd807c..000000000000 --- a/lib/isc/heap.c +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Copyright (C) 2004-2007, 2010-2012 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1997-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/*! \file - * Heap implementation of priority queues adapted from the following: - * - * \li "Introduction to Algorithms," Cormen, Leiserson, and Rivest, - * MIT Press / McGraw Hill, 1990, ISBN 0-262-03141-8, chapter 7. - * - * \li "Algorithms," Second Edition, Sedgewick, Addison-Wesley, 1988, - * ISBN 0-201-06673-4, chapter 11. - */ - -#include - -#include -#include -#include -#include /* Required for memcpy. */ -#include - -/*@{*/ -/*% - * Note: to make heap_parent and heap_left easy to compute, the first - * element of the heap array is not used; i.e. heap subscripts are 1-based, - * not 0-based. The parent is index/2, and the left-child is index*2. - * The right child is index*2+1. - */ -#define heap_parent(i) ((i) >> 1) -#define heap_left(i) ((i) << 1) -/*@}*/ - -#define SIZE_INCREMENT 1024 - -#define HEAP_MAGIC ISC_MAGIC('H', 'E', 'A', 'P') -#define VALID_HEAP(h) ISC_MAGIC_VALID(h, HEAP_MAGIC) - -/*% - * When the heap is in a consistent state, the following invariant - * holds true: for every element i > 1, heap_parent(i) has a priority - * higher than or equal to that of i. - */ -#define HEAPCONDITION(i) ((i) == 1 || \ - ! heap->compare(heap->array[(i)], \ - heap->array[heap_parent(i)])) - -/*% ISC heap structure. */ -struct isc_heap { - unsigned int magic; - isc_mem_t * mctx; - unsigned int size; - unsigned int size_increment; - unsigned int last; - void **array; - isc_heapcompare_t compare; - isc_heapindex_t index; -}; - -isc_result_t -isc_heap_create(isc_mem_t *mctx, isc_heapcompare_t compare, - isc_heapindex_t index, unsigned int size_increment, - isc_heap_t **heapp) -{ - isc_heap_t *heap; - - REQUIRE(heapp != NULL && *heapp == NULL); - REQUIRE(compare != NULL); - - heap = isc_mem_get(mctx, sizeof(*heap)); - if (heap == NULL) - return (ISC_R_NOMEMORY); - heap->magic = HEAP_MAGIC; - heap->size = 0; - heap->mctx = NULL; - isc_mem_attach(mctx, &heap->mctx); - if (size_increment == 0) - heap->size_increment = SIZE_INCREMENT; - else - heap->size_increment = size_increment; - heap->last = 0; - heap->array = NULL; - heap->compare = compare; - heap->index = index; - - *heapp = heap; - - return (ISC_R_SUCCESS); -} - -void -isc_heap_destroy(isc_heap_t **heapp) { - isc_heap_t *heap; - - REQUIRE(heapp != NULL); - heap = *heapp; - REQUIRE(VALID_HEAP(heap)); - - if (heap->array != NULL) - isc_mem_put(heap->mctx, heap->array, - heap->size * sizeof(void *)); - heap->magic = 0; - isc_mem_putanddetach(&heap->mctx, heap, sizeof(*heap)); - - *heapp = NULL; -} - -static isc_boolean_t -resize(isc_heap_t *heap) { - void **new_array; - size_t new_size; - - REQUIRE(VALID_HEAP(heap)); - - new_size = heap->size + heap->size_increment; - new_array = isc_mem_get(heap->mctx, new_size * sizeof(void *)); - if (new_array == NULL) - return (ISC_FALSE); - if (heap->array != NULL) { - memcpy(new_array, heap->array, heap->size * sizeof(void *)); - isc_mem_put(heap->mctx, heap->array, - heap->size * sizeof(void *)); - } - heap->size = new_size; - heap->array = new_array; - - return (ISC_TRUE); -} - -static void -float_up(isc_heap_t *heap, unsigned int i, void *elt) { - unsigned int p; - - for (p = heap_parent(i) ; - i > 1 && heap->compare(elt, heap->array[p]) ; - i = p, p = heap_parent(i)) { - heap->array[i] = heap->array[p]; - if (heap->index != NULL) - (heap->index)(heap->array[i], i); - } - heap->array[i] = elt; - if (heap->index != NULL) - (heap->index)(heap->array[i], i); - - INSIST(HEAPCONDITION(i)); -} - -static void -sink_down(isc_heap_t *heap, unsigned int i, void *elt) { - unsigned int j, size, half_size; - size = heap->last; - half_size = size / 2; - while (i <= half_size) { - /* Find the smallest of the (at most) two children. */ - j = heap_left(i); - if (j < size && heap->compare(heap->array[j+1], - heap->array[j])) - j++; - if (heap->compare(elt, heap->array[j])) - break; - heap->array[i] = heap->array[j]; - if (heap->index != NULL) - (heap->index)(heap->array[i], i); - i = j; - } - heap->array[i] = elt; - if (heap->index != NULL) - (heap->index)(heap->array[i], i); - - INSIST(HEAPCONDITION(i)); -} - -isc_result_t -isc_heap_insert(isc_heap_t *heap, void *elt) { - unsigned int new_last; - - REQUIRE(VALID_HEAP(heap)); - - new_last = heap->last + 1; - RUNTIME_CHECK(new_last > 0); /* overflow check */ - if (new_last >= heap->size && !resize(heap)) - return (ISC_R_NOMEMORY); - heap->last = new_last; - - float_up(heap, new_last, elt); - - return (ISC_R_SUCCESS); -} - -void -isc_heap_delete(isc_heap_t *heap, unsigned int index) { - void *elt; - isc_boolean_t less; - - REQUIRE(VALID_HEAP(heap)); - REQUIRE(index >= 1 && index <= heap->last); - - if (index == heap->last) { - heap->array[heap->last] = NULL; - heap->last--; - } else { - elt = heap->array[heap->last]; - heap->array[heap->last] = NULL; - heap->last--; - - less = heap->compare(elt, heap->array[index]); - heap->array[index] = elt; - if (less) - float_up(heap, index, heap->array[index]); - else - sink_down(heap, index, heap->array[index]); - } -} - -void -isc_heap_increased(isc_heap_t *heap, unsigned int index) { - REQUIRE(VALID_HEAP(heap)); - REQUIRE(index >= 1 && index <= heap->last); - - float_up(heap, index, heap->array[index]); -} - -void -isc_heap_decreased(isc_heap_t *heap, unsigned int index) { - REQUIRE(VALID_HEAP(heap)); - REQUIRE(index >= 1 && index <= heap->last); - - sink_down(heap, index, heap->array[index]); -} - -void * -isc_heap_element(isc_heap_t *heap, unsigned int index) { - REQUIRE(VALID_HEAP(heap)); - REQUIRE(index >= 1); - - if (index <= heap->last) - return (heap->array[index]); - return (NULL); -} - -void -isc_heap_foreach(isc_heap_t *heap, isc_heapaction_t action, void *uap) { - unsigned int i; - - REQUIRE(VALID_HEAP(heap)); - REQUIRE(action != NULL); - - for (i = 1 ; i <= heap->last ; i++) - (action)(heap->array[i], uap); -} diff --git a/lib/isc/hex.c b/lib/isc/hex.c deleted file mode 100644 index 3fa0e699fa55..000000000000 --- a/lib/isc/hex.c +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000-2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: hex.c,v 1.20 2008/09/25 04:02:39 tbox Exp $ */ - -/*! \file */ - -#include - -#include - -#include -#include -#include -#include -#include - -#define RETERR(x) do { \ - isc_result_t _r = (x); \ - if (_r != ISC_R_SUCCESS) \ - return (_r); \ - } while (0) - - -/* - * BEW: These static functions are copied from lib/dns/rdata.c. - */ -static isc_result_t -str_totext(const char *source, isc_buffer_t *target); - -static isc_result_t -mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length); - -static const char hex[] = "0123456789ABCDEF"; - -isc_result_t -isc_hex_totext(isc_region_t *source, int wordlength, - const char *wordbreak, isc_buffer_t *target) -{ - char buf[3]; - unsigned int loops = 0; - - if (wordlength < 2) - wordlength = 2; - - memset(buf, 0, sizeof(buf)); - while (source->length > 0) { - buf[0] = hex[(source->base[0] >> 4) & 0xf]; - buf[1] = hex[(source->base[0]) & 0xf]; - RETERR(str_totext(buf, target)); - isc_region_consume(source, 1); - - loops++; - if (source->length != 0 && - (int)((loops + 1) * 2) >= wordlength) - { - loops = 0; - RETERR(str_totext(wordbreak, target)); - } - } - return (ISC_R_SUCCESS); -} - -/*% - * State of a hex decoding process in progress. - */ -typedef struct { - int length; /*%< Desired length of binary data or -1 */ - isc_buffer_t *target; /*%< Buffer for resulting binary data */ - int digits; /*%< Number of buffered hex digits */ - int val[2]; -} hex_decode_ctx_t; - -static inline void -hex_decode_init(hex_decode_ctx_t *ctx, int length, isc_buffer_t *target) -{ - ctx->digits = 0; - ctx->length = length; - ctx->target = target; -} - -static inline isc_result_t -hex_decode_char(hex_decode_ctx_t *ctx, int c) { - char *s; - - if ((s = strchr(hex, toupper(c))) == NULL) - return (ISC_R_BADHEX); - ctx->val[ctx->digits++] = s - hex; - if (ctx->digits == 2) { - unsigned char num; - - num = (ctx->val[0] << 4) + (ctx->val[1]); - RETERR(mem_tobuffer(ctx->target, &num, 1)); - if (ctx->length >= 0) { - if (ctx->length == 0) - return (ISC_R_BADHEX); - else - ctx->length -= 1; - } - ctx->digits = 0; - } - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -hex_decode_finish(hex_decode_ctx_t *ctx) { - if (ctx->length > 0) - return (ISC_R_UNEXPECTEDEND); - if (ctx->digits != 0) - return (ISC_R_BADHEX); - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_hex_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) { - hex_decode_ctx_t ctx; - isc_textregion_t *tr; - isc_token_t token; - isc_boolean_t eol; - - hex_decode_init(&ctx, length, target); - - while (ctx.length != 0) { - unsigned int i; - - if (length > 0) - eol = ISC_FALSE; - else - eol = ISC_TRUE; - RETERR(isc_lex_getmastertoken(lexer, &token, - isc_tokentype_string, eol)); - if (token.type != isc_tokentype_string) - break; - tr = &token.value.as_textregion; - for (i = 0; i < tr->length; i++) - RETERR(hex_decode_char(&ctx, tr->base[i])); - } - if (ctx.length < 0) - isc_lex_ungettoken(lexer, &token); - RETERR(hex_decode_finish(&ctx)); - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_hex_decodestring(const char *cstr, isc_buffer_t *target) { - hex_decode_ctx_t ctx; - - hex_decode_init(&ctx, -1, target); - for (;;) { - int c = *cstr++; - if (c == '\0') - break; - if (c == ' ' || c == '\t' || c == '\n' || c== '\r') - continue; - RETERR(hex_decode_char(&ctx, c)); - } - RETERR(hex_decode_finish(&ctx)); - return (ISC_R_SUCCESS); -} - -static isc_result_t -str_totext(const char *source, isc_buffer_t *target) { - unsigned int l; - isc_region_t region; - - isc_buffer_availableregion(target, ®ion); - l = strlen(source); - - if (l > region.length) - return (ISC_R_NOSPACE); - - memcpy(region.base, source, l); - isc_buffer_add(target, l); - return (ISC_R_SUCCESS); -} - -static isc_result_t -mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) { - isc_region_t tr; - - isc_buffer_availableregion(target, &tr); - if (length > tr.length) - return (ISC_R_NOSPACE); - memcpy(tr.base, base, length); - isc_buffer_add(target, length); - return (ISC_R_SUCCESS); -} diff --git a/lib/isc/hmacmd5.c b/lib/isc/hmacmd5.c deleted file mode 100644 index 0388b17083b7..000000000000 --- a/lib/isc/hmacmd5.c +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: hmacmd5.c,v 1.16 2009/02/06 23:47:42 tbox Exp $ */ - -/*! \file - * This code implements the HMAC-MD5 keyed hash algorithm - * described in RFC2104. - */ - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include - -#ifdef ISC_PLATFORM_OPENSSLHASH - -void -isc_hmacmd5_init(isc_hmacmd5_t *ctx, const unsigned char *key, - unsigned int len) -{ - HMAC_Init(ctx, (const void *) key, (int) len, EVP_md5()); -} - -void -isc_hmacmd5_invalidate(isc_hmacmd5_t *ctx) { - HMAC_CTX_cleanup(ctx); -} - -void -isc_hmacmd5_update(isc_hmacmd5_t *ctx, const unsigned char *buf, - unsigned int len) -{ - HMAC_Update(ctx, buf, (int) len); -} - -void -isc_hmacmd5_sign(isc_hmacmd5_t *ctx, unsigned char *digest) { - HMAC_Final(ctx, digest, NULL); - HMAC_CTX_cleanup(ctx); -} - -#else - -#define PADLEN 64 -#define IPAD 0x36 -#define OPAD 0x5C - -/*! - * Start HMAC-MD5 process. Initialize an md5 context and digest the key. - */ -void -isc_hmacmd5_init(isc_hmacmd5_t *ctx, const unsigned char *key, - unsigned int len) -{ - unsigned char ipad[PADLEN]; - int i; - - memset(ctx->key, 0, sizeof(ctx->key)); - if (len > sizeof(ctx->key)) { - isc_md5_t md5ctx; - isc_md5_init(&md5ctx); - isc_md5_update(&md5ctx, key, len); - isc_md5_final(&md5ctx, ctx->key); - } else - memcpy(ctx->key, key, len); - - isc_md5_init(&ctx->md5ctx); - memset(ipad, IPAD, sizeof(ipad)); - for (i = 0; i < PADLEN; i++) - ipad[i] ^= ctx->key[i]; - isc_md5_update(&ctx->md5ctx, ipad, sizeof(ipad)); -} - -void -isc_hmacmd5_invalidate(isc_hmacmd5_t *ctx) { - isc_md5_invalidate(&ctx->md5ctx); - memset(ctx->key, 0, sizeof(ctx->key)); -} - -/*! - * Update context to reflect the concatenation of another buffer full - * of bytes. - */ -void -isc_hmacmd5_update(isc_hmacmd5_t *ctx, const unsigned char *buf, - unsigned int len) -{ - isc_md5_update(&ctx->md5ctx, buf, len); -} - -/*! - * Compute signature - finalize MD5 operation and reapply MD5. - */ -void -isc_hmacmd5_sign(isc_hmacmd5_t *ctx, unsigned char *digest) { - unsigned char opad[PADLEN]; - int i; - - isc_md5_final(&ctx->md5ctx, digest); - - memset(opad, OPAD, sizeof(opad)); - for (i = 0; i < PADLEN; i++) - opad[i] ^= ctx->key[i]; - - isc_md5_init(&ctx->md5ctx); - isc_md5_update(&ctx->md5ctx, opad, sizeof(opad)); - isc_md5_update(&ctx->md5ctx, digest, ISC_MD5_DIGESTLENGTH); - isc_md5_final(&ctx->md5ctx, digest); - isc_hmacmd5_invalidate(ctx); -} -#endif /* !ISC_PLATFORM_OPENSSLHASH */ - -/*! - * Verify signature - finalize MD5 operation and reapply MD5, then - * compare to the supplied digest. - */ -isc_boolean_t -isc_hmacmd5_verify(isc_hmacmd5_t *ctx, unsigned char *digest) { - return (isc_hmacmd5_verify2(ctx, digest, ISC_MD5_DIGESTLENGTH)); -} - -isc_boolean_t -isc_hmacmd5_verify2(isc_hmacmd5_t *ctx, unsigned char *digest, size_t len) { - unsigned char newdigest[ISC_MD5_DIGESTLENGTH]; - - REQUIRE(len <= ISC_MD5_DIGESTLENGTH); - isc_hmacmd5_sign(ctx, newdigest); - return (ISC_TF(isc_tsmemcmp(digest, newdigest, len) == 0)); -} diff --git a/lib/isc/hmacsha.c b/lib/isc/hmacsha.c deleted file mode 100644 index 75b1cb14d29d..000000000000 --- a/lib/isc/hmacsha.c +++ /dev/null @@ -1,594 +0,0 @@ -/* - * Copyright (C) 2005-2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/* - * This code implements the HMAC-SHA1, HMAC-SHA224, HMAC-SHA256, HMAC-SHA384 - * and HMAC-SHA512 keyed hash algorithm described in RFC 2104 and - * draft-ietf-dnsext-tsig-sha-01.txt. - */ - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef ISC_PLATFORM_OPENSSLHASH - -void -isc_hmacsha1_init(isc_hmacsha1_t *ctx, const unsigned char *key, - unsigned int len) -{ - HMAC_Init(ctx, (const void *) key, (int) len, EVP_sha1()); -} - -void -isc_hmacsha1_invalidate(isc_hmacsha1_t *ctx) { - HMAC_CTX_cleanup(ctx); -} - -void -isc_hmacsha1_update(isc_hmacsha1_t *ctx, const unsigned char *buf, - unsigned int len) -{ - HMAC_Update(ctx, buf, (int) len); -} - -void -isc_hmacsha1_sign(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len) { - unsigned char newdigest[ISC_SHA1_DIGESTLENGTH]; - - REQUIRE(len <= ISC_SHA1_DIGESTLENGTH); - - HMAC_Final(ctx, newdigest, NULL); - HMAC_CTX_cleanup(ctx); - memcpy(digest, newdigest, len); - memset(newdigest, 0, sizeof(newdigest)); -} - -void -isc_hmacsha224_init(isc_hmacsha224_t *ctx, const unsigned char *key, - unsigned int len) -{ - HMAC_Init(ctx, (const void *) key, (int) len, EVP_sha224()); -} - -void -isc_hmacsha224_invalidate(isc_hmacsha224_t *ctx) { - HMAC_CTX_cleanup(ctx); -} - -void -isc_hmacsha224_update(isc_hmacsha224_t *ctx, const unsigned char *buf, - unsigned int len) -{ - HMAC_Update(ctx, buf, (int) len); -} - -void -isc_hmacsha224_sign(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len) { - unsigned char newdigest[ISC_SHA224_DIGESTLENGTH]; - - REQUIRE(len <= ISC_SHA224_DIGESTLENGTH); - - HMAC_Final(ctx, newdigest, NULL); - HMAC_CTX_cleanup(ctx); - memcpy(digest, newdigest, len); - memset(newdigest, 0, sizeof(newdigest)); -} - -void -isc_hmacsha256_init(isc_hmacsha256_t *ctx, const unsigned char *key, - unsigned int len) -{ - HMAC_Init(ctx, (const void *) key, (int) len, EVP_sha256()); -} - -void -isc_hmacsha256_invalidate(isc_hmacsha256_t *ctx) { - HMAC_CTX_cleanup(ctx); -} - -void -isc_hmacsha256_update(isc_hmacsha256_t *ctx, const unsigned char *buf, - unsigned int len) -{ - HMAC_Update(ctx, buf, (int) len); -} - -void -isc_hmacsha256_sign(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len) { - unsigned char newdigest[ISC_SHA256_DIGESTLENGTH]; - - REQUIRE(len <= ISC_SHA256_DIGESTLENGTH); - - HMAC_Final(ctx, newdigest, NULL); - HMAC_CTX_cleanup(ctx); - memcpy(digest, newdigest, len); - memset(newdigest, 0, sizeof(newdigest)); -} - -void -isc_hmacsha384_init(isc_hmacsha384_t *ctx, const unsigned char *key, - unsigned int len) -{ - HMAC_Init(ctx, (const void *) key, (int) len, EVP_sha384()); -} - -void -isc_hmacsha384_invalidate(isc_hmacsha384_t *ctx) { - HMAC_CTX_cleanup(ctx); -} - -void -isc_hmacsha384_update(isc_hmacsha384_t *ctx, const unsigned char *buf, - unsigned int len) -{ - HMAC_Update(ctx, buf, (int) len); -} - -void -isc_hmacsha384_sign(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len) { - unsigned char newdigest[ISC_SHA384_DIGESTLENGTH]; - - REQUIRE(len <= ISC_SHA384_DIGESTLENGTH); - - HMAC_Final(ctx, newdigest, NULL); - HMAC_CTX_cleanup(ctx); - memcpy(digest, newdigest, len); - memset(newdigest, 0, sizeof(newdigest)); -} - -void -isc_hmacsha512_init(isc_hmacsha512_t *ctx, const unsigned char *key, - unsigned int len) -{ - HMAC_Init(ctx, (const void *) key, (int) len, EVP_sha512()); -} - -void -isc_hmacsha512_invalidate(isc_hmacsha512_t *ctx) { - HMAC_CTX_cleanup(ctx); -} - -void -isc_hmacsha512_update(isc_hmacsha512_t *ctx, const unsigned char *buf, - unsigned int len) -{ - HMAC_Update(ctx, buf, (int) len); -} - -void -isc_hmacsha512_sign(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len) { - unsigned char newdigest[ISC_SHA512_DIGESTLENGTH]; - - REQUIRE(len <= ISC_SHA512_DIGESTLENGTH); - - HMAC_Final(ctx, newdigest, NULL); - HMAC_CTX_cleanup(ctx); - memcpy(digest, newdigest, len); - memset(newdigest, 0, sizeof(newdigest)); -} - -#else - -#define IPAD 0x36 -#define OPAD 0x5C - -/* - * Start HMAC-SHA1 process. Initialize an sha1 context and digest the key. - */ -void -isc_hmacsha1_init(isc_hmacsha1_t *ctx, const unsigned char *key, - unsigned int len) -{ - unsigned char ipad[ISC_SHA1_BLOCK_LENGTH]; - unsigned int i; - - memset(ctx->key, 0, sizeof(ctx->key)); - if (len > sizeof(ctx->key)) { - isc_sha1_t sha1ctx; - isc_sha1_init(&sha1ctx); - isc_sha1_update(&sha1ctx, key, len); - isc_sha1_final(&sha1ctx, ctx->key); - } else - memcpy(ctx->key, key, len); - - isc_sha1_init(&ctx->sha1ctx); - memset(ipad, IPAD, sizeof(ipad)); - for (i = 0; i < ISC_SHA1_BLOCK_LENGTH; i++) - ipad[i] ^= ctx->key[i]; - isc_sha1_update(&ctx->sha1ctx, ipad, sizeof(ipad)); -} - -void -isc_hmacsha1_invalidate(isc_hmacsha1_t *ctx) { - isc_sha1_invalidate(&ctx->sha1ctx); - memset(ctx, 0, sizeof(*ctx)); -} - -/* - * Update context to reflect the concatenation of another buffer full - * of bytes. - */ -void -isc_hmacsha1_update(isc_hmacsha1_t *ctx, const unsigned char *buf, - unsigned int len) -{ - isc_sha1_update(&ctx->sha1ctx, buf, len); -} - -/* - * Compute signature - finalize SHA1 operation and reapply SHA1. - */ -void -isc_hmacsha1_sign(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len) { - unsigned char opad[ISC_SHA1_BLOCK_LENGTH]; - unsigned char newdigest[ISC_SHA1_DIGESTLENGTH]; - unsigned int i; - - REQUIRE(len <= ISC_SHA1_DIGESTLENGTH); - isc_sha1_final(&ctx->sha1ctx, newdigest); - - memset(opad, OPAD, sizeof(opad)); - for (i = 0; i < ISC_SHA1_BLOCK_LENGTH; i++) - opad[i] ^= ctx->key[i]; - - isc_sha1_init(&ctx->sha1ctx); - isc_sha1_update(&ctx->sha1ctx, opad, sizeof(opad)); - isc_sha1_update(&ctx->sha1ctx, newdigest, ISC_SHA1_DIGESTLENGTH); - isc_sha1_final(&ctx->sha1ctx, newdigest); - isc_hmacsha1_invalidate(ctx); - memcpy(digest, newdigest, len); - memset(newdigest, 0, sizeof(newdigest)); -} - -/* - * Start HMAC-SHA224 process. Initialize an sha224 context and digest the key. - */ -void -isc_hmacsha224_init(isc_hmacsha224_t *ctx, const unsigned char *key, - unsigned int len) -{ - unsigned char ipad[ISC_SHA224_BLOCK_LENGTH]; - unsigned int i; - - memset(ctx->key, 0, sizeof(ctx->key)); - if (len > sizeof(ctx->key)) { - isc_sha224_t sha224ctx; - isc_sha224_init(&sha224ctx); - isc_sha224_update(&sha224ctx, key, len); - isc_sha224_final(ctx->key, &sha224ctx); - } else - memcpy(ctx->key, key, len); - - isc_sha224_init(&ctx->sha224ctx); - memset(ipad, IPAD, sizeof(ipad)); - for (i = 0; i < ISC_SHA224_BLOCK_LENGTH; i++) - ipad[i] ^= ctx->key[i]; - isc_sha224_update(&ctx->sha224ctx, ipad, sizeof(ipad)); -} - -void -isc_hmacsha224_invalidate(isc_hmacsha224_t *ctx) { - memset(ctx, 0, sizeof(*ctx)); -} - -/* - * Update context to reflect the concatenation of another buffer full - * of bytes. - */ -void -isc_hmacsha224_update(isc_hmacsha224_t *ctx, const unsigned char *buf, - unsigned int len) -{ - isc_sha224_update(&ctx->sha224ctx, buf, len); -} - -/* - * Compute signature - finalize SHA224 operation and reapply SHA224. - */ -void -isc_hmacsha224_sign(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len) { - unsigned char opad[ISC_SHA224_BLOCK_LENGTH]; - unsigned char newdigest[ISC_SHA224_DIGESTLENGTH]; - unsigned int i; - - REQUIRE(len <= ISC_SHA224_DIGESTLENGTH); - isc_sha224_final(newdigest, &ctx->sha224ctx); - - memset(opad, OPAD, sizeof(opad)); - for (i = 0; i < ISC_SHA224_BLOCK_LENGTH; i++) - opad[i] ^= ctx->key[i]; - - isc_sha224_init(&ctx->sha224ctx); - isc_sha224_update(&ctx->sha224ctx, opad, sizeof(opad)); - isc_sha224_update(&ctx->sha224ctx, newdigest, ISC_SHA224_DIGESTLENGTH); - isc_sha224_final(newdigest, &ctx->sha224ctx); - memcpy(digest, newdigest, len); - memset(newdigest, 0, sizeof(newdigest)); -} - -/* - * Start HMAC-SHA256 process. Initialize an sha256 context and digest the key. - */ -void -isc_hmacsha256_init(isc_hmacsha256_t *ctx, const unsigned char *key, - unsigned int len) -{ - unsigned char ipad[ISC_SHA256_BLOCK_LENGTH]; - unsigned int i; - - memset(ctx->key, 0, sizeof(ctx->key)); - if (len > sizeof(ctx->key)) { - isc_sha256_t sha256ctx; - isc_sha256_init(&sha256ctx); - isc_sha256_update(&sha256ctx, key, len); - isc_sha256_final(ctx->key, &sha256ctx); - } else - memcpy(ctx->key, key, len); - - isc_sha256_init(&ctx->sha256ctx); - memset(ipad, IPAD, sizeof(ipad)); - for (i = 0; i < ISC_SHA256_BLOCK_LENGTH; i++) - ipad[i] ^= ctx->key[i]; - isc_sha256_update(&ctx->sha256ctx, ipad, sizeof(ipad)); -} - -void -isc_hmacsha256_invalidate(isc_hmacsha256_t *ctx) { - memset(ctx, 0, sizeof(*ctx)); -} - -/* - * Update context to reflect the concatenation of another buffer full - * of bytes. - */ -void -isc_hmacsha256_update(isc_hmacsha256_t *ctx, const unsigned char *buf, - unsigned int len) -{ - isc_sha256_update(&ctx->sha256ctx, buf, len); -} - -/* - * Compute signature - finalize SHA256 operation and reapply SHA256. - */ -void -isc_hmacsha256_sign(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len) { - unsigned char opad[ISC_SHA256_BLOCK_LENGTH]; - unsigned char newdigest[ISC_SHA256_DIGESTLENGTH]; - unsigned int i; - - REQUIRE(len <= ISC_SHA256_DIGESTLENGTH); - isc_sha256_final(newdigest, &ctx->sha256ctx); - - memset(opad, OPAD, sizeof(opad)); - for (i = 0; i < ISC_SHA256_BLOCK_LENGTH; i++) - opad[i] ^= ctx->key[i]; - - isc_sha256_init(&ctx->sha256ctx); - isc_sha256_update(&ctx->sha256ctx, opad, sizeof(opad)); - isc_sha256_update(&ctx->sha256ctx, newdigest, ISC_SHA256_DIGESTLENGTH); - isc_sha256_final(newdigest, &ctx->sha256ctx); - memcpy(digest, newdigest, len); - memset(newdigest, 0, sizeof(newdigest)); -} - -/* - * Start HMAC-SHA384 process. Initialize an sha384 context and digest the key. - */ -void -isc_hmacsha384_init(isc_hmacsha384_t *ctx, const unsigned char *key, - unsigned int len) -{ - unsigned char ipad[ISC_SHA384_BLOCK_LENGTH]; - unsigned int i; - - memset(ctx->key, 0, sizeof(ctx->key)); - if (len > sizeof(ctx->key)) { - isc_sha384_t sha384ctx; - isc_sha384_init(&sha384ctx); - isc_sha384_update(&sha384ctx, key, len); - isc_sha384_final(ctx->key, &sha384ctx); - } else - memcpy(ctx->key, key, len); - - isc_sha384_init(&ctx->sha384ctx); - memset(ipad, IPAD, sizeof(ipad)); - for (i = 0; i < ISC_SHA384_BLOCK_LENGTH; i++) - ipad[i] ^= ctx->key[i]; - isc_sha384_update(&ctx->sha384ctx, ipad, sizeof(ipad)); -} - -void -isc_hmacsha384_invalidate(isc_hmacsha384_t *ctx) { - memset(ctx, 0, sizeof(*ctx)); -} - -/* - * Update context to reflect the concatenation of another buffer full - * of bytes. - */ -void -isc_hmacsha384_update(isc_hmacsha384_t *ctx, const unsigned char *buf, - unsigned int len) -{ - isc_sha384_update(&ctx->sha384ctx, buf, len); -} - -/* - * Compute signature - finalize SHA384 operation and reapply SHA384. - */ -void -isc_hmacsha384_sign(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len) { - unsigned char opad[ISC_SHA384_BLOCK_LENGTH]; - unsigned char newdigest[ISC_SHA384_DIGESTLENGTH]; - unsigned int i; - - REQUIRE(len <= ISC_SHA384_DIGESTLENGTH); - isc_sha384_final(newdigest, &ctx->sha384ctx); - - memset(opad, OPAD, sizeof(opad)); - for (i = 0; i < ISC_SHA384_BLOCK_LENGTH; i++) - opad[i] ^= ctx->key[i]; - - isc_sha384_init(&ctx->sha384ctx); - isc_sha384_update(&ctx->sha384ctx, opad, sizeof(opad)); - isc_sha384_update(&ctx->sha384ctx, newdigest, ISC_SHA384_DIGESTLENGTH); - isc_sha384_final(newdigest, &ctx->sha384ctx); - memcpy(digest, newdigest, len); - memset(newdigest, 0, sizeof(newdigest)); -} - -/* - * Start HMAC-SHA512 process. Initialize an sha512 context and digest the key. - */ -void -isc_hmacsha512_init(isc_hmacsha512_t *ctx, const unsigned char *key, - unsigned int len) -{ - unsigned char ipad[ISC_SHA512_BLOCK_LENGTH]; - unsigned int i; - - memset(ctx->key, 0, sizeof(ctx->key)); - if (len > sizeof(ctx->key)) { - isc_sha512_t sha512ctx; - isc_sha512_init(&sha512ctx); - isc_sha512_update(&sha512ctx, key, len); - isc_sha512_final(ctx->key, &sha512ctx); - } else - memcpy(ctx->key, key, len); - - isc_sha512_init(&ctx->sha512ctx); - memset(ipad, IPAD, sizeof(ipad)); - for (i = 0; i < ISC_SHA512_BLOCK_LENGTH; i++) - ipad[i] ^= ctx->key[i]; - isc_sha512_update(&ctx->sha512ctx, ipad, sizeof(ipad)); -} - -void -isc_hmacsha512_invalidate(isc_hmacsha512_t *ctx) { - memset(ctx, 0, sizeof(*ctx)); -} - -/* - * Update context to reflect the concatenation of another buffer full - * of bytes. - */ -void -isc_hmacsha512_update(isc_hmacsha512_t *ctx, const unsigned char *buf, - unsigned int len) -{ - isc_sha512_update(&ctx->sha512ctx, buf, len); -} - -/* - * Compute signature - finalize SHA512 operation and reapply SHA512. - */ -void -isc_hmacsha512_sign(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len) { - unsigned char opad[ISC_SHA512_BLOCK_LENGTH]; - unsigned char newdigest[ISC_SHA512_DIGESTLENGTH]; - unsigned int i; - - REQUIRE(len <= ISC_SHA512_DIGESTLENGTH); - isc_sha512_final(newdigest, &ctx->sha512ctx); - - memset(opad, OPAD, sizeof(opad)); - for (i = 0; i < ISC_SHA512_BLOCK_LENGTH; i++) - opad[i] ^= ctx->key[i]; - - isc_sha512_init(&ctx->sha512ctx); - isc_sha512_update(&ctx->sha512ctx, opad, sizeof(opad)); - isc_sha512_update(&ctx->sha512ctx, newdigest, ISC_SHA512_DIGESTLENGTH); - isc_sha512_final(newdigest, &ctx->sha512ctx); - memcpy(digest, newdigest, len); - memset(newdigest, 0, sizeof(newdigest)); -} -#endif /* !ISC_PLATFORM_OPENSSLHASH */ - -/* - * Verify signature - finalize SHA1 operation and reapply SHA1, then - * compare to the supplied digest. - */ -isc_boolean_t -isc_hmacsha1_verify(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len) { - unsigned char newdigest[ISC_SHA1_DIGESTLENGTH]; - - REQUIRE(len <= ISC_SHA1_DIGESTLENGTH); - isc_hmacsha1_sign(ctx, newdigest, ISC_SHA1_DIGESTLENGTH); - return (ISC_TF(isc_tsmemcmp(digest, newdigest, len) == 0)); -} - -/* - * Verify signature - finalize SHA224 operation and reapply SHA224, then - * compare to the supplied digest. - */ -isc_boolean_t -isc_hmacsha224_verify(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len) { - unsigned char newdigest[ISC_SHA224_DIGESTLENGTH]; - - REQUIRE(len <= ISC_SHA224_DIGESTLENGTH); - isc_hmacsha224_sign(ctx, newdigest, ISC_SHA224_DIGESTLENGTH); - return (ISC_TF(isc_tsmemcmp(digest, newdigest, len) == 0)); -} - -/* - * Verify signature - finalize SHA256 operation and reapply SHA256, then - * compare to the supplied digest. - */ -isc_boolean_t -isc_hmacsha256_verify(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len) { - unsigned char newdigest[ISC_SHA256_DIGESTLENGTH]; - - REQUIRE(len <= ISC_SHA256_DIGESTLENGTH); - isc_hmacsha256_sign(ctx, newdigest, ISC_SHA256_DIGESTLENGTH); - return (ISC_TF(isc_tsmemcmp(digest, newdigest, len) == 0)); -} - -/* - * Verify signature - finalize SHA384 operation and reapply SHA384, then - * compare to the supplied digest. - */ -isc_boolean_t -isc_hmacsha384_verify(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len) { - unsigned char newdigest[ISC_SHA384_DIGESTLENGTH]; - - REQUIRE(len <= ISC_SHA384_DIGESTLENGTH); - isc_hmacsha384_sign(ctx, newdigest, ISC_SHA384_DIGESTLENGTH); - return (ISC_TF(isc_tsmemcmp(digest, newdigest, len) == 0)); -} - -/* - * Verify signature - finalize SHA512 operation and reapply SHA512, then - * compare to the supplied digest. - */ -isc_boolean_t -isc_hmacsha512_verify(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len) { - unsigned char newdigest[ISC_SHA512_DIGESTLENGTH]; - - REQUIRE(len <= ISC_SHA512_DIGESTLENGTH); - isc_hmacsha512_sign(ctx, newdigest, ISC_SHA512_DIGESTLENGTH); - return (ISC_TF(isc_tsmemcmp(digest, newdigest, len) == 0)); -} diff --git a/lib/isc/httpd.c b/lib/isc/httpd.c deleted file mode 100644 index 16a8c9fe142b..000000000000 --- a/lib/isc/httpd.c +++ /dev/null @@ -1,1028 +0,0 @@ -/* - * Copyright (C) 2006-2008, 2010-2012 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/*! \file */ - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -/*% - * TODO: - * - * o Put in better checks to make certain things are passed in correctly. - * This includes a magic number for externally-visible structures, - * checking for NULL-ness before dereferencing, etc. - * o Make the URL processing external functions which will fill-in a buffer - * structure we provide, or return an error and we will render a generic - * page and close the client. - */ - -#define MSHUTTINGDOWN(cm) ((cm->flags & ISC_HTTPDMGR_FLAGSHUTTINGDOWN) != 0) -#define MSETSHUTTINGDOWN(cm) (cm->flags |= ISC_HTTPDMGR_FLAGSHUTTINGDOWN) - -#ifdef DEBUG_HTTPD -#define ENTER(x) do { fprintf(stderr, "ENTER %s\n", (x)); } while (0) -#define EXIT(x) do { fprintf(stderr, "EXIT %s\n", (x)); } while (0) -#define NOTICE(x) do { fprintf(stderr, "NOTICE %s\n", (x)); } while (0) -#else -#define ENTER(x) do { } while(0) -#define EXIT(x) do { } while(0) -#define NOTICE(x) do { } while(0) -#endif - -#define HTTP_RECVLEN 1024 -#define HTTP_SENDGROW 1024 -#define HTTP_SEND_MAXLEN 10240 - -/*% - * HTTP urls. These are the URLs we manage, and the function to call to - * provide the data for it. We pass in the base url (so the same function - * can handle multiple requests), and a structure to fill in to return a - * result to the client. We also pass in a pointer to be filled in for - * the data cleanup function. - */ -struct isc_httpdurl { - char *url; - isc_httpdaction_t *action; - void *action_arg; - ISC_LINK(isc_httpdurl_t) link; -}; - -#define HTTPD_CLOSE 0x0001 /* Got a Connection: close header */ -#define HTTPD_FOUNDHOST 0x0002 /* Got a Host: header */ - -/*% http client */ -struct isc_httpd { - isc_httpdmgr_t *mgr; /*%< our parent */ - ISC_LINK(isc_httpd_t) link; - unsigned int state; - isc_socket_t *sock; - - /*% - * Received data state. - */ - char recvbuf[HTTP_RECVLEN]; /*%< receive buffer */ - isc_uint32_t recvlen; /*%< length recv'd */ - unsigned int method; - char *url; - char *querystring; - char *protocol; - - /* - * Flags on the httpd client. - */ - int flags; - - /*% - * Transmit data state. - * - * This is the data buffer we will transmit. - * - * This free function pointer is filled in by the rendering function - * we call. The free function is called after the data is transmitted - * to the client. - * - * The bufflist is the list of buffers we are currently transmitting. - * The headerdata is where we render our headers to. If we run out of - * space when rendering a header, we will change the size of our - * buffer. We will not free it until we are finished, and will - * allocate an additional HTTP_SENDGROW bytes per header space grow. - * - * We currently use two buffers total, one for the headers (which - * we manage) and another for the client to fill in (which it manages, - * it provides the space for it, etc) -- we will pass that buffer - * structure back to the caller, who is responsible for managing the - * space it may have allocated as backing store for it. This second - * buffer is bodybuffer, and we only allocate the buffer itself, not - * the backing store. - */ - isc_bufferlist_t bufflist; - char *headerdata; /*%< send header buf */ - unsigned int headerlen; /*%< current header buffer size */ - isc_buffer_t headerbuffer; - - const char *mimetype; - unsigned int retcode; - const char *retmsg; - isc_buffer_t bodybuffer; - isc_httpdfree_t *freecb; - void *freecb_arg; -}; - -/*% lightweight socket manager for httpd output */ -struct isc_httpdmgr { - isc_mem_t *mctx; - isc_socket_t *sock; /*%< listening socket */ - isc_task_t *task; /*%< owning task */ - isc_timermgr_t *timermgr; - - isc_httpdclientok_t *client_ok; /*%< client validator */ - isc_httpdondestroy_t *ondestroy; /*%< cleanup callback */ - void *cb_arg; /*%< argument for the above */ - - unsigned int flags; - ISC_LIST(isc_httpd_t) running; /*%< running clients */ - - isc_mutex_t lock; - - ISC_LIST(isc_httpdurl_t) urls; /*%< urls we manage */ - isc_httpdaction_t *render_404; - isc_httpdaction_t *render_500; -}; - -/*% - * HTTP methods. - */ -#define ISC_HTTPD_METHODUNKNOWN 0 -#define ISC_HTTPD_METHODGET 1 -#define ISC_HTTPD_METHODPOST 2 - -/*% - * Client states. - * - * _IDLE The client is not doing anything at all. This state should - * only occur just after creation, and just before being - * destroyed. - * - * _RECV The client is waiting for data after issuing a socket recv(). - * - * _RECVDONE Data has been received, and is being processed. - * - * _SEND All data for a response has completed, and a reply was - * sent via a socket send() call. - * - * _SENDDONE Send is completed. - * - * Badly formatted state table: - * - * IDLE -> RECV when client has a recv() queued. - * - * RECV -> RECVDONE when recvdone event received. - * - * RECVDONE -> SEND if the data for a reply is at hand. - * - * SEND -> RECV when a senddone event was received. - * - * At any time -> RECV on error. If RECV fails, the client will - * self-destroy, closing the socket and freeing memory. - */ -#define ISC_HTTPD_STATEIDLE 0 -#define ISC_HTTPD_STATERECV 1 -#define ISC_HTTPD_STATERECVDONE 2 -#define ISC_HTTPD_STATESEND 3 -#define ISC_HTTPD_STATESENDDONE 4 - -#define ISC_HTTPD_ISRECV(c) ((c)->state == ISC_HTTPD_STATERECV) -#define ISC_HTTPD_ISRECVDONE(c) ((c)->state == ISC_HTTPD_STATERECVDONE) -#define ISC_HTTPD_ISSEND(c) ((c)->state == ISC_HTTPD_STATESEND) -#define ISC_HTTPD_ISSENDDONE(c) ((c)->state == ISC_HTTPD_STATESENDDONE) - -/*% - * Overall magic test that means we're not idle. - */ -#define ISC_HTTPD_SETRECV(c) ((c)->state = ISC_HTTPD_STATERECV) -#define ISC_HTTPD_SETRECVDONE(c) ((c)->state = ISC_HTTPD_STATERECVDONE) -#define ISC_HTTPD_SETSEND(c) ((c)->state = ISC_HTTPD_STATESEND) -#define ISC_HTTPD_SETSENDDONE(c) ((c)->state = ISC_HTTPD_STATESENDDONE) - -static void isc_httpd_accept(isc_task_t *, isc_event_t *); -static void isc_httpd_recvdone(isc_task_t *, isc_event_t *); -static void isc_httpd_senddone(isc_task_t *, isc_event_t *); -static void destroy_client(isc_httpd_t **); -static isc_result_t process_request(isc_httpd_t *, int); -static void httpdmgr_destroy(isc_httpdmgr_t *); -static isc_result_t grow_headerspace(isc_httpd_t *); -static void reset_client(isc_httpd_t *httpd); -static isc_result_t render_404(const char *, const char *, - void *, - unsigned int *, const char **, - const char **, isc_buffer_t *, - isc_httpdfree_t **, void **); -static isc_result_t render_500(const char *, const char *, - void *, - unsigned int *, const char **, - const char **, isc_buffer_t *, - isc_httpdfree_t **, void **); - -static void -destroy_client(isc_httpd_t **httpdp) -{ - isc_httpd_t *httpd = *httpdp; - isc_httpdmgr_t *httpdmgr = httpd->mgr; - - *httpdp = NULL; - - LOCK(&httpdmgr->lock); - - isc_socket_detach(&httpd->sock); - ISC_LIST_UNLINK(httpdmgr->running, httpd, link); - - if (httpd->headerlen > 0) - isc_mem_put(httpdmgr->mctx, httpd->headerdata, - httpd->headerlen); - - isc_mem_put(httpdmgr->mctx, httpd, sizeof(isc_httpd_t)); - - UNLOCK(&httpdmgr->lock); - - httpdmgr_destroy(httpdmgr); -} - -isc_result_t -isc_httpdmgr_create(isc_mem_t *mctx, isc_socket_t *sock, isc_task_t *task, - isc_httpdclientok_t *client_ok, - isc_httpdondestroy_t *ondestroy, void *cb_arg, - isc_timermgr_t *tmgr, isc_httpdmgr_t **httpdp) -{ - isc_result_t result; - isc_httpdmgr_t *httpd; - - REQUIRE(mctx != NULL); - REQUIRE(sock != NULL); - REQUIRE(task != NULL); - REQUIRE(tmgr != NULL); - REQUIRE(httpdp != NULL && *httpdp == NULL); - - httpd = isc_mem_get(mctx, sizeof(isc_httpdmgr_t)); - if (httpd == NULL) - return (ISC_R_NOMEMORY); - - result = isc_mutex_init(&httpd->lock); - if (result != ISC_R_SUCCESS) { - isc_mem_put(mctx, httpd, sizeof(isc_httpdmgr_t)); - return (result); - } - httpd->mctx = NULL; - isc_mem_attach(mctx, &httpd->mctx); - httpd->sock = NULL; - isc_socket_attach(sock, &httpd->sock); - httpd->task = NULL; - isc_task_attach(task, &httpd->task); - httpd->timermgr = tmgr; /* XXXMLG no attach function? */ - httpd->client_ok = client_ok; - httpd->ondestroy = ondestroy; - httpd->cb_arg = cb_arg; - - ISC_LIST_INIT(httpd->running); - ISC_LIST_INIT(httpd->urls); - - /* XXXMLG ignore errors on isc_socket_listen() */ - result = isc_socket_listen(sock, SOMAXCONN); - if (result != ISC_R_SUCCESS) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_socket_listen() failed: %s", - isc_result_totext(result)); - goto cleanup; - } - - (void)isc_socket_filter(sock, "httpready"); - - result = isc_socket_accept(sock, task, isc_httpd_accept, httpd); - if (result != ISC_R_SUCCESS) - goto cleanup; - - httpd->render_404 = render_404; - httpd->render_500 = render_500; - - *httpdp = httpd; - return (ISC_R_SUCCESS); - - cleanup: - isc_task_detach(&httpd->task); - isc_socket_detach(&httpd->sock); - isc_mem_detach(&httpd->mctx); - (void)isc_mutex_destroy(&httpd->lock); - isc_mem_put(mctx, httpd, sizeof(isc_httpdmgr_t)); - return (result); -} - -static void -httpdmgr_destroy(isc_httpdmgr_t *httpdmgr) -{ - isc_mem_t *mctx; - isc_httpdurl_t *url; - - ENTER("httpdmgr_destroy"); - - LOCK(&httpdmgr->lock); - - if (!MSHUTTINGDOWN(httpdmgr)) { - NOTICE("httpdmgr_destroy not shutting down yet"); - UNLOCK(&httpdmgr->lock); - return; - } - - /* - * If all clients are not shut down, don't do anything yet. - */ - if (!ISC_LIST_EMPTY(httpdmgr->running)) { - NOTICE("httpdmgr_destroy clients still active"); - UNLOCK(&httpdmgr->lock); - return; - } - - NOTICE("httpdmgr_destroy detaching socket, task, and timermgr"); - - isc_socket_detach(&httpdmgr->sock); - isc_task_detach(&httpdmgr->task); - httpdmgr->timermgr = NULL; - - /* - * Clear out the list of all actions we know about. Just free the - * memory. - */ - url = ISC_LIST_HEAD(httpdmgr->urls); - while (url != NULL) { - isc_mem_free(httpdmgr->mctx, url->url); - ISC_LIST_UNLINK(httpdmgr->urls, url, link); - isc_mem_put(httpdmgr->mctx, url, sizeof(isc_httpdurl_t)); - url = ISC_LIST_HEAD(httpdmgr->urls); - } - - UNLOCK(&httpdmgr->lock); - (void)isc_mutex_destroy(&httpdmgr->lock); - - if (httpdmgr->ondestroy != NULL) - (httpdmgr->ondestroy)(httpdmgr->cb_arg); - - mctx = httpdmgr->mctx; - isc_mem_putanddetach(&mctx, httpdmgr, sizeof(isc_httpdmgr_t)); - - EXIT("httpdmgr_destroy"); -} - -#define LENGTHOK(s) (httpd->recvbuf - (s) < (int)httpd->recvlen) -#define BUFLENOK(s) (httpd->recvbuf - (s) < HTTP_RECVLEN) - -static isc_result_t -process_request(isc_httpd_t *httpd, int length) -{ - char *s; - char *p; - int delim; - - ENTER("request"); - - httpd->recvlen += length; - - httpd->recvbuf[httpd->recvlen] = 0; - - /* - * If we don't find a blank line in our buffer, return that we need - * more data. - */ - s = strstr(httpd->recvbuf, "\r\n\r\n"); - delim = 1; - if (s == NULL) { - s = strstr(httpd->recvbuf, "\n\n"); - delim = 2; - } - if (s == NULL) - return (ISC_R_NOTFOUND); - - /* - * Determine if this is a POST or GET method. Any other values will - * cause an error to be returned. - */ - if (strncmp(httpd->recvbuf, "GET ", 4) == 0) { - httpd->method = ISC_HTTPD_METHODGET; - p = httpd->recvbuf + 4; - } else if (strncmp(httpd->recvbuf, "POST ", 5) == 0) { - httpd->method = ISC_HTTPD_METHODPOST; - p = httpd->recvbuf + 5; - } else { - return (ISC_R_RANGE); - } - - /* - * From now on, p is the start of our buffer. - */ - - /* - * Extract the URL. - */ - s = p; - while (LENGTHOK(s) && BUFLENOK(s) && - (*s != '\n' && *s != '\r' && *s != '\0' && *s != ' ')) - s++; - if (!LENGTHOK(s)) - return (ISC_R_NOTFOUND); - if (!BUFLENOK(s)) - return (ISC_R_NOMEMORY); - *s = 0; - - /* - * Make the URL relative. - */ - if ((strncmp(p, "http:/", 6) == 0) - || (strncmp(p, "https:/", 7) == 0)) { - /* Skip first / */ - while (*p != '/' && *p != 0) - p++; - if (*p == 0) - return (ISC_R_RANGE); - p++; - /* Skip second / */ - while (*p != '/' && *p != 0) - p++; - if (*p == 0) - return (ISC_R_RANGE); - p++; - /* Find third / */ - while (*p != '/' && *p != 0) - p++; - if (*p == 0) { - p--; - *p = '/'; - } - } - - httpd->url = p; - p = s + delim; - s = p; - - /* - * Now, see if there is a ? mark in the URL. If so, this is - * part of the query string, and we will split it from the URL. - */ - httpd->querystring = strchr(httpd->url, '?'); - if (httpd->querystring != NULL) { - *(httpd->querystring) = 0; - httpd->querystring++; - } - - /* - * Extract the HTTP/1.X protocol. We will bounce on anything but - * HTTP/1.1 for now. - */ - while (LENGTHOK(s) && BUFLENOK(s) && - (*s != '\n' && *s != '\r' && *s != '\0')) - s++; - if (!LENGTHOK(s)) - return (ISC_R_NOTFOUND); - if (!BUFLENOK(s)) - return (ISC_R_NOMEMORY); - *s = 0; - if ((strncmp(p, "HTTP/1.0", 8) != 0) - && (strncmp(p, "HTTP/1.1", 8) != 0)) - return (ISC_R_RANGE); - httpd->protocol = p; - p = s + 1; - s = p; - - if (strstr(s, "Connection: close") != NULL) - httpd->flags |= HTTPD_CLOSE; - - if (strstr(s, "Host: ") != NULL) - httpd->flags |= HTTPD_FOUNDHOST; - - /* - * Standards compliance hooks here. - */ - if (strcmp(httpd->protocol, "HTTP/1.1") == 0 - && ((httpd->flags & HTTPD_FOUNDHOST) == 0)) - return (ISC_R_RANGE); - - EXIT("request"); - - return (ISC_R_SUCCESS); -} - -static void -isc_httpd_accept(isc_task_t *task, isc_event_t *ev) -{ - isc_result_t result; - isc_httpdmgr_t *httpdmgr = ev->ev_arg; - isc_httpd_t *httpd; - isc_region_t r; - isc_socket_newconnev_t *nev = (isc_socket_newconnev_t *)ev; - isc_sockaddr_t peeraddr; - - ENTER("accept"); - - LOCK(&httpdmgr->lock); - if (MSHUTTINGDOWN(httpdmgr)) { - NOTICE("accept shutting down, goto out"); - goto out; - } - - if (nev->result == ISC_R_CANCELED) { - NOTICE("accept canceled, goto out"); - goto out; - } - - if (nev->result != ISC_R_SUCCESS) { - /* XXXMLG log failure */ - NOTICE("accept returned failure, goto requeue"); - goto requeue; - } - - (void)isc_socket_getpeername(nev->newsocket, &peeraddr); - if (httpdmgr->client_ok != NULL && - !(httpdmgr->client_ok)(&peeraddr, httpdmgr->cb_arg)) { - isc_socket_detach(&nev->newsocket); - goto requeue; - } - - httpd = isc_mem_get(httpdmgr->mctx, sizeof(isc_httpd_t)); - if (httpd == NULL) { - /* XXXMLG log failure */ - NOTICE("accept failed to allocate memory, goto requeue"); - isc_socket_detach(&nev->newsocket); - goto requeue; - } - - httpd->mgr = httpdmgr; - ISC_LINK_INIT(httpd, link); - ISC_LIST_APPEND(httpdmgr->running, httpd, link); - ISC_HTTPD_SETRECV(httpd); - httpd->sock = nev->newsocket; - isc_socket_setname(httpd->sock, "httpd", NULL); - httpd->flags = 0; - - /* - * Initialize the buffer for our headers. - */ - httpd->headerdata = isc_mem_get(httpdmgr->mctx, HTTP_SENDGROW); - if (httpd->headerdata == NULL) { - isc_mem_put(httpdmgr->mctx, httpd, sizeof(isc_httpd_t)); - isc_socket_detach(&nev->newsocket); - goto requeue; - } - httpd->headerlen = HTTP_SENDGROW; - isc_buffer_init(&httpd->headerbuffer, httpd->headerdata, - httpd->headerlen); - - ISC_LIST_INIT(httpd->bufflist); - - isc_buffer_initnull(&httpd->bodybuffer); - reset_client(httpd); - - r.base = (unsigned char *)httpd->recvbuf; - r.length = HTTP_RECVLEN - 1; - result = isc_socket_recv(httpd->sock, &r, 1, task, isc_httpd_recvdone, - httpd); - /* FIXME!!! */ - POST(result); - NOTICE("accept queued recv on socket"); - - requeue: - result = isc_socket_accept(httpdmgr->sock, task, isc_httpd_accept, - httpdmgr); - if (result != ISC_R_SUCCESS) { - /* XXXMLG what to do? Log failure... */ - NOTICE("accept could not reaccept due to failure"); - } - - out: - UNLOCK(&httpdmgr->lock); - - httpdmgr_destroy(httpdmgr); - - isc_event_free(&ev); - - EXIT("accept"); -} - -static isc_result_t -render_404(const char *url, const char *querystring, - void *arg, - unsigned int *retcode, const char **retmsg, - const char **mimetype, isc_buffer_t *b, - isc_httpdfree_t **freecb, void **freecb_args) -{ - static char msg[] = "No such URL."; - - UNUSED(url); - UNUSED(querystring); - UNUSED(arg); - - *retcode = 404; - *retmsg = "No such URL"; - *mimetype = "text/plain"; - isc_buffer_reinit(b, msg, strlen(msg)); - isc_buffer_add(b, strlen(msg)); - *freecb = NULL; - *freecb_args = NULL; - - return (ISC_R_SUCCESS); -} - -static isc_result_t -render_500(const char *url, const char *querystring, - void *arg, - unsigned int *retcode, const char **retmsg, - const char **mimetype, isc_buffer_t *b, - isc_httpdfree_t **freecb, void **freecb_args) -{ - static char msg[] = "Internal server failure."; - - UNUSED(url); - UNUSED(querystring); - UNUSED(arg); - - *retcode = 500; - *retmsg = "Internal server failure"; - *mimetype = "text/plain"; - isc_buffer_reinit(b, msg, strlen(msg)); - isc_buffer_add(b, strlen(msg)); - *freecb = NULL; - *freecb_args = NULL; - - return (ISC_R_SUCCESS); -} - -static void -isc_httpd_recvdone(isc_task_t *task, isc_event_t *ev) -{ - isc_region_t r; - isc_result_t result; - isc_httpd_t *httpd = ev->ev_arg; - isc_socketevent_t *sev = (isc_socketevent_t *)ev; - isc_httpdurl_t *url; - isc_time_t now; - char datebuf[32]; /* Only need 30, but safety first */ - - ENTER("recv"); - - INSIST(ISC_HTTPD_ISRECV(httpd)); - - if (sev->result != ISC_R_SUCCESS) { - NOTICE("recv destroying client"); - destroy_client(&httpd); - goto out; - } - - result = process_request(httpd, sev->n); - if (result == ISC_R_NOTFOUND) { - if (httpd->recvlen >= HTTP_RECVLEN - 1) { - destroy_client(&httpd); - goto out; - } - r.base = (unsigned char *)httpd->recvbuf + httpd->recvlen; - r.length = HTTP_RECVLEN - httpd->recvlen - 1; - /* check return code? */ - (void)isc_socket_recv(httpd->sock, &r, 1, task, - isc_httpd_recvdone, httpd); - goto out; - } else if (result != ISC_R_SUCCESS) { - destroy_client(&httpd); - goto out; - } - - ISC_HTTPD_SETSEND(httpd); - - /* - * XXXMLG Call function here. Provide an add-header function - * which will append the common headers to a response we generate. - */ - isc_buffer_initnull(&httpd->bodybuffer); - isc_time_now(&now); - isc_time_formathttptimestamp(&now, datebuf, sizeof(datebuf)); - url = ISC_LIST_HEAD(httpd->mgr->urls); - while (url != NULL) { - if (strcmp(httpd->url, url->url) == 0) - break; - url = ISC_LIST_NEXT(url, link); - } - if (url == NULL) - result = httpd->mgr->render_404(httpd->url, httpd->querystring, - NULL, - &httpd->retcode, - &httpd->retmsg, - &httpd->mimetype, - &httpd->bodybuffer, - &httpd->freecb, - &httpd->freecb_arg); - else - result = url->action(httpd->url, httpd->querystring, - url->action_arg, - &httpd->retcode, &httpd->retmsg, - &httpd->mimetype, &httpd->bodybuffer, - &httpd->freecb, &httpd->freecb_arg); - if (result != ISC_R_SUCCESS) { - result = httpd->mgr->render_500(httpd->url, httpd->querystring, - NULL, &httpd->retcode, - &httpd->retmsg, - &httpd->mimetype, - &httpd->bodybuffer, - &httpd->freecb, - &httpd->freecb_arg); - RUNTIME_CHECK(result == ISC_R_SUCCESS); - } - - isc_httpd_response(httpd); - isc_httpd_addheader(httpd, "Content-Type", httpd->mimetype); - isc_httpd_addheader(httpd, "Date", datebuf); - isc_httpd_addheader(httpd, "Expires", datebuf); - isc_httpd_addheader(httpd, "Last-Modified", datebuf); - isc_httpd_addheader(httpd, "Pragma: no-cache", NULL); - isc_httpd_addheader(httpd, "Cache-Control: no-cache", NULL); - isc_httpd_addheader(httpd, "Server: libisc", NULL); - isc_httpd_addheaderuint(httpd, "Content-Length", - isc_buffer_usedlength(&httpd->bodybuffer)); - isc_httpd_endheaders(httpd); /* done */ - - ISC_LIST_APPEND(httpd->bufflist, &httpd->headerbuffer, link); - /* - * Link the data buffer into our send queue, should we have any data - * rendered into it. If no data is present, we won't do anything - * with the buffer. - */ - if (isc_buffer_length(&httpd->bodybuffer) > 0) - ISC_LIST_APPEND(httpd->bufflist, &httpd->bodybuffer, link); - - /* check return code? */ - (void)isc_socket_sendv(httpd->sock, &httpd->bufflist, task, - isc_httpd_senddone, httpd); - - out: - isc_event_free(&ev); - EXIT("recv"); -} - -void -isc_httpdmgr_shutdown(isc_httpdmgr_t **httpdmgrp) -{ - isc_httpdmgr_t *httpdmgr; - isc_httpd_t *httpd; - httpdmgr = *httpdmgrp; - *httpdmgrp = NULL; - - ENTER("isc_httpdmgr_shutdown"); - - LOCK(&httpdmgr->lock); - - MSETSHUTTINGDOWN(httpdmgr); - - isc_socket_cancel(httpdmgr->sock, httpdmgr->task, ISC_SOCKCANCEL_ALL); - - httpd = ISC_LIST_HEAD(httpdmgr->running); - while (httpd != NULL) { - isc_socket_cancel(httpd->sock, httpdmgr->task, - ISC_SOCKCANCEL_ALL); - httpd = ISC_LIST_NEXT(httpd, link); - } - - UNLOCK(&httpdmgr->lock); - - EXIT("isc_httpdmgr_shutdown"); -} - -static isc_result_t -grow_headerspace(isc_httpd_t *httpd) -{ - char *newspace; - unsigned int newlen; - isc_region_t r; - - newlen = httpd->headerlen + HTTP_SENDGROW; - if (newlen > HTTP_SEND_MAXLEN) - return (ISC_R_NOSPACE); - - newspace = isc_mem_get(httpd->mgr->mctx, newlen); - if (newspace == NULL) - return (ISC_R_NOMEMORY); - isc_buffer_region(&httpd->headerbuffer, &r); - isc_buffer_reinit(&httpd->headerbuffer, newspace, newlen); - - isc_mem_put(httpd->mgr->mctx, r.base, r.length); - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_httpd_response(isc_httpd_t *httpd) -{ - isc_result_t result; - unsigned int needlen; - - needlen = strlen(httpd->protocol) + 1; /* protocol + space */ - needlen += 3 + 1; /* room for response code, always 3 bytes */ - needlen += strlen(httpd->retmsg) + 2; /* return msg + CRLF */ - - while (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) { - result = grow_headerspace(httpd); - if (result != ISC_R_SUCCESS) - return (result); - } - - sprintf(isc_buffer_used(&httpd->headerbuffer), "%s %03d %s\r\n", - httpd->protocol, httpd->retcode, httpd->retmsg); - isc_buffer_add(&httpd->headerbuffer, needlen); - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_httpd_addheader(isc_httpd_t *httpd, const char *name, - const char *val) -{ - isc_result_t result; - unsigned int needlen; - - needlen = strlen(name); /* name itself */ - if (val != NULL) - needlen += 2 + strlen(val); /* : and val */ - needlen += 2; /* CRLF */ - - while (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) { - result = grow_headerspace(httpd); - if (result != ISC_R_SUCCESS) - return (result); - } - - if (val != NULL) - sprintf(isc_buffer_used(&httpd->headerbuffer), - "%s: %s\r\n", name, val); - else - sprintf(isc_buffer_used(&httpd->headerbuffer), - "%s\r\n", name); - - isc_buffer_add(&httpd->headerbuffer, needlen); - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_httpd_endheaders(isc_httpd_t *httpd) -{ - isc_result_t result; - - while (isc_buffer_availablelength(&httpd->headerbuffer) < 2) { - result = grow_headerspace(httpd); - if (result != ISC_R_SUCCESS) - return (result); - } - - sprintf(isc_buffer_used(&httpd->headerbuffer), "\r\n"); - isc_buffer_add(&httpd->headerbuffer, 2); - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_httpd_addheaderuint(isc_httpd_t *httpd, const char *name, int val) { - isc_result_t result; - unsigned int needlen; - char buf[sizeof "18446744073709551616"]; - - sprintf(buf, "%d", val); - - needlen = strlen(name); /* name itself */ - needlen += 2 + strlen(buf); /* : and val */ - needlen += 2; /* CRLF */ - - while (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) { - result = grow_headerspace(httpd); - if (result != ISC_R_SUCCESS) - return (result); - } - - sprintf(isc_buffer_used(&httpd->headerbuffer), - "%s: %s\r\n", name, buf); - - isc_buffer_add(&httpd->headerbuffer, needlen); - - return (ISC_R_SUCCESS); -} - -static void -isc_httpd_senddone(isc_task_t *task, isc_event_t *ev) -{ - isc_httpd_t *httpd = ev->ev_arg; - isc_region_t r; - isc_socketevent_t *sev = (isc_socketevent_t *)ev; - - ENTER("senddone"); - INSIST(ISC_HTTPD_ISSEND(httpd)); - - /* - * First, unlink our header buffer from the socket's bufflist. This - * is sort of an evil hack, since we know our buffer will be there, - * and we know it's address, so we can just remove it directly. - */ - NOTICE("senddone unlinked header"); - ISC_LIST_UNLINK(sev->bufferlist, &httpd->headerbuffer, link); - - /* - * We will always want to clean up our receive buffer, even if we - * got an error on send or we are shutting down. - * - * We will pass in the buffer only if there is data in it. If - * there is no data, we will pass in a NULL. - */ - if (httpd->freecb != NULL) { - isc_buffer_t *b = NULL; - if (isc_buffer_length(&httpd->bodybuffer) > 0) - b = &httpd->bodybuffer; - httpd->freecb(b, httpd->freecb_arg); - NOTICE("senddone free callback performed"); - } - if (ISC_LINK_LINKED(&httpd->bodybuffer, link)) { - ISC_LIST_UNLINK(sev->bufferlist, &httpd->bodybuffer, link); - NOTICE("senddone body buffer unlinked"); - } - - if (sev->result != ISC_R_SUCCESS) { - destroy_client(&httpd); - goto out; - } - - if ((httpd->flags & HTTPD_CLOSE) != 0) { - destroy_client(&httpd); - goto out; - } - - ISC_HTTPD_SETRECV(httpd); - - NOTICE("senddone restarting recv on socket"); - - reset_client(httpd); - - r.base = (unsigned char *)httpd->recvbuf; - r.length = HTTP_RECVLEN - 1; - /* check return code? */ - (void)isc_socket_recv(httpd->sock, &r, 1, task, - isc_httpd_recvdone, httpd); - -out: - isc_event_free(&ev); - EXIT("senddone"); -} - -static void -reset_client(isc_httpd_t *httpd) -{ - /* - * Catch errors here. We MUST be in RECV mode, and we MUST NOT have - * any outstanding buffers. If we have buffers, we have a leak. - */ - INSIST(ISC_HTTPD_ISRECV(httpd)); - INSIST(!ISC_LINK_LINKED(&httpd->headerbuffer, link)); - INSIST(!ISC_LINK_LINKED(&httpd->bodybuffer, link)); - - httpd->recvbuf[0] = 0; - httpd->recvlen = 0; - httpd->method = ISC_HTTPD_METHODUNKNOWN; - httpd->url = NULL; - httpd->querystring = NULL; - httpd->protocol = NULL; - httpd->flags = 0; - - isc_buffer_clear(&httpd->headerbuffer); - isc_buffer_invalidate(&httpd->bodybuffer); -} - -isc_result_t -isc_httpdmgr_addurl(isc_httpdmgr_t *httpdmgr, const char *url, - isc_httpdaction_t *func, void *arg) -{ - isc_httpdurl_t *item; - - if (url == NULL) { - httpdmgr->render_404 = func; - return (ISC_R_SUCCESS); - } - - item = isc_mem_get(httpdmgr->mctx, sizeof(isc_httpdurl_t)); - if (item == NULL) - return (ISC_R_NOMEMORY); - - item->url = isc_mem_strdup(httpdmgr->mctx, url); - if (item->url == NULL) { - isc_mem_put(httpdmgr->mctx, item, sizeof(isc_httpdurl_t)); - return (ISC_R_NOMEMORY); - } - - item->action = func; - item->action_arg = arg; - ISC_LINK_INIT(item, link); - ISC_LIST_APPEND(httpdmgr->urls, item, link); - - return (ISC_R_SUCCESS); -} diff --git a/lib/isc/ia64/include/isc/atomic.h b/lib/isc/ia64/include/isc/atomic.h deleted file mode 100644 index 6c22f2a53e28..000000000000 --- a/lib/isc/ia64/include/isc/atomic.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: atomic.h,v 1.7 2009/06/24 02:22:50 marka Exp $ */ - -#ifndef ISC_ATOMIC_H -#define ISC_ATOMIC_H 1 - -#include -#include - -#ifdef ISC_PLATFORM_USEGCCASM -/* - * This routine atomically increments the value stored in 'p' by 'val', and - * returns the previous value. - * - * Open issue: can 'fetchadd' make the code faster for some particular values - * (e.g., 1 and -1)? - */ -static inline isc_int32_t -#ifdef __GNUC__ -__attribute__ ((unused)) -#endif -isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) -{ - isc_int32_t prev, swapped; - - for (prev = *(volatile isc_int32_t *)p; ; prev = swapped) { - swapped = prev + val; - __asm__ volatile( - "mov ar.ccv=%2;" - "cmpxchg4.acq %0=%4,%3,ar.ccv" - : "=r" (swapped), "=m" (*p) - : "r" (prev), "r" (swapped), "m" (*p) - : "memory"); - if (swapped == prev) - break; - } - - return (prev); -} - -/* - * This routine atomically stores the value 'val' in 'p'. - */ -static inline void -#ifdef __GNUC__ -__attribute__ ((unused)) -#endif -isc_atomic_store(isc_int32_t *p, isc_int32_t val) -{ - __asm__ volatile( - "st4.rel %0=%1" - : "=m" (*p) - : "r" (val) - : "memory" - ); -} - -/* - * This routine atomically replaces the value in 'p' with 'val', if the - * original value is equal to 'cmpval'. The original value is returned in any - * case. - */ -static inline isc_int32_t -#ifdef __GNUC__ -__attribute__ ((unused)) -#endif -isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) -{ - isc_int32_t ret; - - __asm__ volatile( - "mov ar.ccv=%2;" - "cmpxchg4.acq %0=%4,%3,ar.ccv" - : "=r" (ret), "=m" (*p) - : "r" (cmpval), "r" (val), "m" (*p) - : "memory"); - - return (ret); -} -#else /* !ISC_PLATFORM_USEGCCASM */ - -#error "unsupported compiler. disable atomic ops by --disable-atomic" - -#endif -#endif /* ISC_ATOMIC_H */ diff --git a/lib/isc/include/isc/base32.h b/lib/isc/include/isc/base32.h deleted file mode 100644 index 978a8db463ae..000000000000 --- a/lib/isc/include/isc/base32.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: base32.h,v 1.3 2008/09/25 04:02:39 tbox Exp $ */ - -#ifndef ISC_BASE32_H -#define ISC_BASE32_H 1 - -/*! \file */ - -/* - * Routines for manipulating base 32 and base 32 hex encoded data. - * Based on RFC 4648. - * - * Base 32 hex preserves the sort order of data when it is encoded / - * decoded. - */ - -#include -#include - -ISC_LANG_BEGINDECLS - -/*** - *** Functions - ***/ - -isc_result_t -isc_base32_totext(isc_region_t *source, int wordlength, - const char *wordbreak, isc_buffer_t *target); -isc_result_t -isc_base32hex_totext(isc_region_t *source, int wordlength, - const char *wordbreak, isc_buffer_t *target); -/*!< - * \brief Convert data into base32 encoded text. - * - * Notes: - *\li The base32 encoded text in 'target' will be divided into - * words of at most 'wordlength' characters, separated by - * the 'wordbreak' string. No parentheses will surround - * the text. - * - * Requires: - *\li 'source' is a region containing binary data - *\li 'target' is a text buffer containing available space - *\li 'wordbreak' points to a null-terminated string of - * zero or more whitespace characters - * - * Ensures: - *\li target will contain the base32 encoded version of the data - * in source. The 'used' pointer in target will be advanced as - * necessary. - */ - -isc_result_t -isc_base32_decodestring(const char *cstr, isc_buffer_t *target); -isc_result_t -isc_base32hex_decodestring(const char *cstr, isc_buffer_t *target); -/*!< - * \brief Decode a null-terminated base32 string. - * - * Requires: - *\li 'cstr' is non-null. - *\li 'target' is a valid buffer. - * - * Returns: - *\li #ISC_R_SUCCESS -- the entire decoded representation of 'cstring' - * fit in 'target'. - *\li #ISC_R_BADBASE32 -- 'cstr' is not a valid base32 encoding. - * - * Other error returns are any possible error code from: - *\li isc_lex_create(), - *\li isc_lex_openbuffer(), - *\li isc_base32_tobuffer(). - */ - -isc_result_t -isc_base32_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length); -isc_result_t -isc_base32hex_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length); -/*!< - * \brief Convert base32 encoded text from a lexer context into data. - * - * Requires: - *\li 'lex' is a valid lexer context - *\li 'target' is a buffer containing binary data - *\li 'length' is an integer - * - * Ensures: - *\li target will contain the data represented by the base32 encoded - * string parsed by the lexer. No more than length bytes will be read, - * if length is positive. The 'used' pointer in target will be - * advanced as necessary. - */ - -isc_result_t -isc_base32_decoderegion(isc_region_t *source, isc_buffer_t *target); -isc_result_t -isc_base32hex_decoderegion(isc_region_t *source, isc_buffer_t *target); -/*!< - * \brief Decode a packed (no white space permitted) base32 region. - * - * Requires: - *\li 'source' is a valid region. - *\li 'target' is a valid buffer. - * - * Returns: - *\li #ISC_R_SUCCESS -- the entire decoded representation of 'cstring' - * fit in 'target'. - *\li #ISC_R_BADBASE32 -- 'source' is not a valid base32 encoding. - */ - -ISC_LANG_ENDDECLS - -#endif /* ISC_BASE32_H */ diff --git a/lib/isc/include/isc/base64.h b/lib/isc/include/isc/base64.h deleted file mode 100644 index e48ef2a400cd..000000000000 --- a/lib/isc/include/isc/base64.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: base64.h,v 1.22 2007/06/19 23:47:18 tbox Exp $ */ - -#ifndef ISC_BASE64_H -#define ISC_BASE64_H 1 - -/*! \file isc/base64.h */ - -#include -#include - -ISC_LANG_BEGINDECLS - -/*** - *** Functions - ***/ - -isc_result_t -isc_base64_totext(isc_region_t *source, int wordlength, - const char *wordbreak, isc_buffer_t *target); -/*!< - * \brief Convert data into base64 encoded text. - * - * Notes: - *\li The base64 encoded text in 'target' will be divided into - * words of at most 'wordlength' characters, separated by - * the 'wordbreak' string. No parentheses will surround - * the text. - * - * Requires: - *\li 'source' is a region containing binary data - *\li 'target' is a text buffer containing available space - *\li 'wordbreak' points to a null-terminated string of - * zero or more whitespace characters - * - * Ensures: - *\li target will contain the base64 encoded version of the data - * in source. The 'used' pointer in target will be advanced as - * necessary. - */ - -isc_result_t -isc_base64_decodestring(const char *cstr, isc_buffer_t *target); -/*!< - * \brief Decode a null-terminated base64 string. - * - * Requires: - *\li 'cstr' is non-null. - *\li 'target' is a valid buffer. - * - * Returns: - *\li #ISC_R_SUCCESS -- the entire decoded representation of 'cstring' - * fit in 'target'. - *\li #ISC_R_BADBASE64 -- 'cstr' is not a valid base64 encoding. - * - * Other error returns are any possible error code from: - *\li isc_lex_create(), - *\li isc_lex_openbuffer(), - *\li isc_base64_tobuffer(). - */ - -isc_result_t -isc_base64_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length); -/*!< - * \brief Convert base64 encoded text from a lexer context into data. - * - * Requires: - *\li 'lex' is a valid lexer context - *\li 'target' is a buffer containing binary data - *\li 'length' is an integer - * - * Ensures: - *\li target will contain the data represented by the base64 encoded - * string parsed by the lexer. No more than length bytes will be read, - * if length is positive. The 'used' pointer in target will be - * advanced as necessary. - */ - - - -ISC_LANG_ENDDECLS - -#endif /* ISC_BASE64_H */ diff --git a/lib/isc/include/isc/bitstring.h b/lib/isc/include/isc/bitstring.h deleted file mode 100644 index 252d1117a782..000000000000 --- a/lib/isc/include/isc/bitstring.h +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: bitstring.h,v 1.14 2007/06/19 23:47:18 tbox Exp $ */ - -#ifndef ISC_BITSTRING_H -#define ISC_BITSTRING_H 1 - -/***** - ***** Module Info - *****/ - -/*! \file isc/bitstring.h - * - * \brief Bitstring manipulation functions. - * - * A bitstring is a packed array of bits, stored in a contiguous - * sequence of octets. The "most significant bit" (msb) of a bitstring - * is the high bit of the first octet. The "least significant bit" of a - * bitstring is the low bit of the last octet. - * - * Two bit numbering schemes are supported, "msb0" and "lsb0". - * - * In the "msb0" scheme, bit number 0 designates the most significant bit, - * and any padding bits required to make the bitstring a multiple of 8 bits - * long are added to the least significant end of the last octet. - * - * In the "lsb0" scheme, bit number 0 designates the least significant bit, - * and any padding bits required to make the bitstring a multiple of 8 bits - * long are added to the most significant end of the first octet. - * - * E.g., consider the bitstring "11010001111". This bitstring is 11 bits - * long and will take two octets. Let "p" denote a pad bit. In the msb0 - * encoding, it would be - * - * \verbatim - * Octet 0 Octet 1 - * | - * 1 1 0 1 0 0 0 1 | 1 1 1 p p p p p - * ^ | ^ - * | | - * bit 0 bit 15 - * \endverbatim - * - * In the lsb0 encoding, it would be - * - * \verbatim - * Octet 0 Octet 1 - * | - * p p p p p 1 1 0 | 1 0 0 0 1 1 1 1 - * ^ | ^ - * | | - * bit 15 bit 0 - * \endverbatim - */ - -/*** - *** Imports - ***/ - -#include -#include - -ISC_LANG_BEGINDECLS - -/*** - *** Types - ***/ - -struct isc_bitstring { - unsigned int magic; - unsigned char * data; - unsigned int length; - unsigned int size; - isc_boolean_t lsb0; -}; - -/*** - *** Functions - ***/ - -void -isc_bitstring_init(isc_bitstring_t *bitstring, unsigned char *data, - unsigned int length, unsigned int size, isc_boolean_t lsb0); -/*!< - * \brief Make 'bitstring' refer to the bitstring of 'size' bits starting - * at 'data'. 'length' bits of the bitstring are valid. If 'lsb0' - * is set then, bit 0 refers to the least significant bit of the - * bitstring. Otherwise bit 0 is the most significant bit. - * - * Requires: - * - *\li 'bitstring' points to a isc_bitstring_t. - * - *\li 'data' points to an array of unsigned char large enough to hold - * 'size' bits. - * - *\li 'length' <= 'size'. - * - * Ensures: - * - *\li 'bitstring' is a valid bitstring. - */ - -void -isc_bitstring_invalidate(isc_bitstring_t *bitstring); -/*!< - * \brief Invalidate 'bitstring'. - * - * Requires: - * - *\li 'bitstring' is a valid bitstring. - * - * Ensures: - * - *\li 'bitstring' is not a valid bitstring. - */ - -void -isc_bitstring_copy(isc_bitstring_t *source, unsigned int sbitpos, - isc_bitstring_t *target, unsigned int tbitpos, - unsigned int n); -/*!< - * \brief Starting at bit 'sbitpos', copy 'n' bits from 'source' to - * the 'n' bits of 'target' starting at 'tbitpos'. - * - * Requires: - * - *\li 'source' and target are valid bitstrings with the same lsb0 setting. - * - *\li 'sbitpos' + 'n' is less than or equal to the length of 'source'. - * - *\li 'tbitpos' + 'n' is less than or equal to the size of 'target'. - * - * Ensures: - * - *\li The specified bits have been copied, and the length of 'target' - * adjusted (if required). - */ - -ISC_LANG_ENDDECLS - -#endif /* ISC_BITSTRING_H */ diff --git a/lib/isc/include/isc/bufferlist.h b/lib/isc/include/isc/bufferlist.h deleted file mode 100644 index 54e00c76f619..000000000000 --- a/lib/isc/include/isc/bufferlist.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: bufferlist.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */ - -#ifndef ISC_BUFFERLIST_H -#define ISC_BUFFERLIST_H 1 - -/***** - ***** Module Info - *****/ - -/*! \file isc/bufferlist.h - * - * - *\brief Buffer lists have no synchronization. Clients must ensure exclusive - * access. - * - * \li Reliability: - * No anticipated impact. - - * \li Security: - * No anticipated impact. - * - * \li Standards: - * None. - */ - -/*** - *** Imports - ***/ - -#include -#include - -ISC_LANG_BEGINDECLS - -/*** - *** Functions - ***/ - -unsigned int -isc_bufferlist_usedcount(isc_bufferlist_t *bl); -/*!< - * \brief Return the length of the sum of all used regions of all buffers in - * the buffer list 'bl' - * - * Requires: - * - *\li 'bl' is not NULL. - * - * Returns: - *\li sum of all used regions' lengths. - */ - -unsigned int -isc_bufferlist_availablecount(isc_bufferlist_t *bl); -/*!< - * \brief Return the length of the sum of all available regions of all buffers in - * the buffer list 'bl' - * - * Requires: - * - *\li 'bl' is not NULL. - * - * Returns: - *\li sum of all available regions' lengths. - */ - -ISC_LANG_ENDDECLS - -#endif /* ISC_BUFFERLIST_H */ diff --git a/lib/isc/include/isc/commandline.h b/lib/isc/include/isc/commandline.h deleted file mode 100644 index 384640a45b5c..000000000000 --- a/lib/isc/include/isc/commandline.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: commandline.h,v 1.16 2007/06/19 23:47:18 tbox Exp $ */ - -#ifndef ISC_COMMANDLINE_H -#define ISC_COMMANDLINE_H 1 - -/*! \file isc/commandline.h */ - -#include -#include -#include - -/*% Index into parent argv vector. */ -LIBISC_EXTERNAL_DATA extern int isc_commandline_index; -/*% Character checked for validity. */ -LIBISC_EXTERNAL_DATA extern int isc_commandline_option; -/*% Argument associated with option. */ -LIBISC_EXTERNAL_DATA extern char *isc_commandline_argument; -/*% For printing error messages. */ -LIBISC_EXTERNAL_DATA extern char *isc_commandline_progname; -/*% Print error message. */ -LIBISC_EXTERNAL_DATA extern isc_boolean_t isc_commandline_errprint; -/*% Reset getopt. */ -LIBISC_EXTERNAL_DATA extern isc_boolean_t isc_commandline_reset; - -ISC_LANG_BEGINDECLS - -/*% parse command line */ -int -isc_commandline_parse(int argc, char * const *argv, const char *options); - -ISC_LANG_ENDDECLS - -#endif /* ISC_COMMANDLINE_H */ diff --git a/lib/isc/include/isc/entropy.h b/lib/isc/include/isc/entropy.h deleted file mode 100644 index d28f29a56ecf..000000000000 --- a/lib/isc/include/isc/entropy.h +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: entropy.h,v 1.35 2009/10/19 02:37:08 marka Exp $ */ - -#ifndef ISC_ENTROPY_H -#define ISC_ENTROPY_H 1 - -/***** - ***** Module Info - *****/ - -/*! \file isc/entropy.h - * \brief The entropy API - * - * \li MP: - * The entropy object is locked internally. All callbacks into - * application-provided functions (for setup, gathering, and - * shutdown of sources) are guaranteed to be called with the - * entropy API lock held. This means these functions are - * not permitted to call back into the entropy API. - * - * \li Reliability: - * No anticipated impact. - * - * \li Resources: - * A buffer, used as an entropy pool. - * - * \li Security: - * While this code is believed to implement good entropy gathering - * and distribution, it has not been reviewed by a cryptographic - * expert. - * Since the added entropy is only as good as the sources used, - * this module could hand out bad data and never know it. - * - * \li Standards: - * None. - */ - -/*** - *** Imports - ***/ - -#include - -#include -#include - -/*@{*/ -/*% Entropy callback function. */ -typedef isc_result_t (*isc_entropystart_t)(isc_entropysource_t *source, - void *arg, isc_boolean_t blocking); -typedef isc_result_t (*isc_entropyget_t)(isc_entropysource_t *source, - void *arg, isc_boolean_t blocking); -typedef void (*isc_entropystop_t)(isc_entropysource_t *source, void *arg); -/*@}*/ - -/*** - *** Flags. - ***/ - -/*! - * \brief - * Extract only "good" data; return failure if there is not enough - * data available and there are no sources which we can poll to get - * data, or those sources are empty. - * - * - */ -#define ISC_ENTROPY_GOODONLY 0x00000001U -/*! - * \brief - * Extract as much good data as possible, but if there isn't enough - * at hand, return what is available. This flag only makes sense - * when used with _GOODONLY. - */ -#define ISC_ENTROPY_PARTIAL 0x00000002U -/*! - * \brief - * Block the task until data is available. This is contrary to the - * ISC task system, where tasks should never block. However, if - * this is a special purpose application where blocking a task is - * acceptable (say, an offline zone signer) this flag may be set. - * This flag only makes sense when used with _GOODONLY, and will - * block regardless of the setting for _PARTIAL. - */ -#define ISC_ENTROPY_BLOCKING 0x00000004U - -/*! - * \brief - * Estimate the amount of entropy contained in the sample pool. - * If this is not set, the source will be gathered and periodically - * mixed into the entropy pool, but no increment in contained entropy - * will be assumed. This flag only makes sense on sample sources. - */ -#define ISC_ENTROPYSOURCE_ESTIMATE 0x00000001U - -/* - * For use with isc_entropy_usebestsource(). - */ -/*! - * \brief - * Use the keyboard as the only entropy source. - */ -#define ISC_ENTROPY_KEYBOARDYES 1 -/*! - * \brief - * Never use the keyboard as an entropy source. - */ -#define ISC_ENTROPY_KEYBOARDNO 2 -/*! - * \brief - * Use the keyboard as an entropy source only if opening the - * random device fails. - */ -#define ISC_ENTROPY_KEYBOARDMAYBE 3 - -ISC_LANG_BEGINDECLS - -/*** - *** Functions - ***/ - -isc_result_t -isc_entropy_create(isc_mem_t *mctx, isc_entropy_t **entp); -/*!< - * \brief Create a new entropy object. - */ - -void -isc_entropy_attach(isc_entropy_t *ent, isc_entropy_t **entp); -/*!< - * Attaches to an entropy object. - */ - -void -isc_entropy_detach(isc_entropy_t **entp); -/*!< - * \brief Detaches from an entropy object. - */ - -isc_result_t -isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname); -/*!< - * \brief Create a new entropy source from a file. - * - * The file is assumed to contain good randomness, and will be mixed directly - * into the pool with every byte adding 8 bits of entropy. - * - * The file will be put into non-blocking mode, so it may be a device file, - * such as /dev/random. /dev/urandom should not be used here if it can - * be avoided, since it will always provide data even if it isn't good. - * We will make as much pseudorandom data as we need internally if our - * caller asks for it. - * - * If we hit end-of-file, we will stop reading from this source. Callers - * who require strong random data will get failure when our pool drains. - * The file will never be opened/read again once EOF is reached. - */ - -void -isc_entropy_destroysource(isc_entropysource_t **sourcep); -/*!< - * \brief Removes an entropy source from the entropy system. - */ - -isc_result_t -isc_entropy_createsamplesource(isc_entropy_t *ent, - isc_entropysource_t **sourcep); -/*!< - * \brief Create an entropy source that consists of samples. Each sample is - * added to the source via isc_entropy_addsamples(), below. - */ - -isc_result_t -isc_entropy_createcallbacksource(isc_entropy_t *ent, - isc_entropystart_t start, - isc_entropyget_t get, - isc_entropystop_t stop, - void *arg, - isc_entropysource_t **sourcep); -/*!< - * \brief Create an entropy source that is polled via a callback. - * - * This would - * be used when keyboard input is used, or a GUI input method. It can - * also be used to hook in any external entropy source. - * - * Samples are added via isc_entropy_addcallbacksample(), below. - * _addcallbacksample() is the only function which may be called from - * within an entropy API callback function. - */ - -void -isc_entropy_stopcallbacksources(isc_entropy_t *ent); -/*!< - * \brief Call the stop functions for callback sources that have had their - * start functions called. - */ - -/*@{*/ -isc_result_t -isc_entropy_addcallbacksample(isc_entropysource_t *source, isc_uint32_t sample, - isc_uint32_t extra); -isc_result_t -isc_entropy_addsample(isc_entropysource_t *source, isc_uint32_t sample, - isc_uint32_t extra); -/*!< - * \brief Add a sample to the sample source. - * - * The sample MUST be a timestamp - * that increases over time, with the exception of wrap-around for - * extremely high resolution timers which will quickly wrap-around - * a 32-bit integer. - * - * The "extra" parameter is used only to add a bit more unpredictable - * data. It is not used other than included in the hash of samples. - * - * When in an entropy API callback function, _addcallbacksource() must be - * used. At all other times, _addsample() must be used. - */ -/*@}*/ - -isc_result_t -isc_entropy_getdata(isc_entropy_t *ent, void *data, unsigned int length, - unsigned int *returned, unsigned int flags); -/*!< - * \brief Extract data from the entropy pool. This may load the pool from various - * sources. - * - * Do this by stiring the pool and returning a part of hash as randomness. - * Note that no secrets are given away here since parts of the hash are - * xored together before returned. - * - * Honor the request from the caller to only return good data, any data, - * etc. - */ - -void -isc_entropy_putdata(isc_entropy_t *ent, void *data, unsigned int length, - isc_uint32_t entropy); -/*!< - * \brief Add "length" bytes in "data" to the entropy pool, incrementing the - * pool's entropy count by "entropy." - * - * These bytes will prime the pseudorandom portion even if no entropy is - * actually added. - */ - -void -isc_entropy_stats(isc_entropy_t *ent, FILE *out); -/*!< - * \brief Dump some (trivial) stats to the stdio stream "out". - */ - -unsigned int -isc_entropy_status(isc_entropy_t *end); -/* - * Returns the number of bits the pool currently contains. This is just - * an estimate. - */ - -isc_result_t -isc_entropy_usebestsource(isc_entropy_t *ectx, isc_entropysource_t **source, - const char *randomfile, int use_keyboard); -/*!< - * \brief Use whatever source of entropy is best. - * - * Notes: - *\li If "randomfile" is not NULL, open it with - * isc_entropy_createfilesource(). - * - *\li If "randomfile" is NULL and the system's random device was detected - * when the program was configured and built, open that device with - * isc_entropy_createfilesource(). - * - *\li If "use_keyboard" is #ISC_ENTROPY_KEYBOARDYES, then always open - * the keyboard as an entropy source (possibly in addition to - * "randomfile" or the random device). - * - *\li If "use_keyboard" is #ISC_ENTROPY_KEYBOARDMAYBE, open the keyboard only - * if opening the random file/device fails. A message will be - * printed describing the need for keyboard input. - * - *\li If "use_keyboard" is #ISC_ENTROPY_KEYBOARDNO, the keyboard will - * never be opened. - * - * Returns: - *\li #ISC_R_SUCCESS if at least one source of entropy could be started. - * - *\li #ISC_R_NOENTROPY if use_keyboard is #ISC_ENTROPY_KEYBOARDNO and - * there is no random device pathname compiled into the program. - * - *\li A return code from isc_entropy_createfilesource() or - * isc_entropy_createcallbacksource(). - */ - -ISC_LANG_ENDDECLS - -#endif /* ISC_ENTROPY_H */ diff --git a/lib/isc/include/isc/fsaccess.h b/lib/isc/include/isc/fsaccess.h deleted file mode 100644 index 7962bbe21ab1..000000000000 --- a/lib/isc/include/isc/fsaccess.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: fsaccess.h,v 1.16 2009/01/17 23:47:43 tbox Exp $ */ - -#ifndef ISC_FSACCESS_H -#define ISC_FSACCESS_H 1 - -/*! \file isc/fsaccess.h - * \brief The ISC filesystem access module encapsulates the setting of file - * and directory access permissions into one API that is meant to be - * portable to multiple operating systems. - * - * The two primary operating system flavors that are initially accommodated - * are POSIX and Windows NT 4.0 and later. The Windows NT access model is - * considerable more flexible than POSIX's model (as much as I am loathe to - * admit it), and so the ISC API has a higher degree of complexity than would - * be needed to simply address POSIX's needs. - * - * The full breadth of NT's flexibility is not available either, for the - * present time. Much of it is to provide compatibility with what Unix - * programmers are expecting. This is also due to not yet really needing all - * of the functionality of an NT system (or, for that matter, a POSIX system) - * in BIND9, and so resolving how to handle the various incompatibilities has - * been a purely theoretical exercise with no operational experience to - * indicate how flawed the thinking may be. - * - * Some of the more notable dumbing down of NT for this API includes: - * - *\li Each of FILE_READ_DATA and FILE_READ_EA are set with #ISC_FSACCESS_READ. - * - * \li All of FILE_WRITE_DATA, FILE_WRITE_EA and FILE_APPEND_DATA are - * set with #ISC_FSACCESS_WRITE. FILE_WRITE_ATTRIBUTES is not set - * so as to be consistent with Unix, where only the owner of the file - * or the superuser can change the attributes/mode of a file. - * - * \li Both of FILE_ADD_FILE and FILE_ADD_SUBDIRECTORY are set with - * #ISC_FSACCESS_CREATECHILD. This is similar to setting the WRITE - * permission on a Unix directory. - * - * \li SYNCHRONIZE is always set for files and directories, unless someone - * can give me a reason why this is a bad idea. - * - * \li READ_CONTROL and FILE_READ_ATTRIBUTES are always set; this is - * consistent with Unix, where any file or directory can be stat()'d - * unless the directory path disallows complete access somewhere along - * the way. - * - * \li WRITE_DAC is only set for the owner. This too is consistent with - * Unix, and is tighter security than allowing anyone else to be - * able to set permissions. - * - * \li DELETE is only set for the owner. On Unix the ability to delete - * a file is controlled by the directory permissions, but it isn't - * currently clear to me what happens on NT if the directory has - * FILE_DELETE_CHILD set but a file within it does not have DELETE - * set. Always setting DELETE on the file/directory for the owner - * gives maximum flexibility to the owner without exposing the - * file to deletion by others. - * - * \li WRITE_OWNER is never set. This too is consistent with Unix, - * and is also tighter security than allowing anyone to change the - * ownership of the file apart from the superu..ahem, Administrator. - * - * \li Inheritance is set to NO_INHERITANCE. - * - * Unix's dumbing down includes: - * - * \li The sticky bit cannot be set. - * - * \li setuid and setgid cannot be set. - * - * \li Only regular files and directories can be set. - * - * The rest of this comment discusses a few of the incompatibilities - * between the two systems that need more thought if this API is to - * be extended to accommodate them. - * - * The Windows standard access right "DELETE" doesn't have a direct - * equivalent in the Unix world, so it isn't clear what should be done - * with it. - * - * The Unix sticky bit is not supported. While NT does have a concept - * of allowing users to create files in a directory but not delete or - * rename them, it does not have a concept of allowing them to be deleted - * if they are owned by the user trying to delete/rename. While it is - * probable that something could be cobbled together in NT 5 with inheritance, - * it can't really be done in NT 4 as a single property that you could - * set on a directory. You'd need to coordinate something with file creation - * so that every file created had DELETE set for the owner but noone else. - * - * On Unix systems, setting #ISC_FSACCESS_LISTDIRECTORY sets READ. - * ... setting either #ISC_FSACCESS_CREATECHILD or #ISC_FSACCESS_DELETECHILD - * sets WRITE. - * ... setting #ISC_FSACCESS_ACCESSCHILD sets EXECUTE. - * - * On NT systems, setting #ISC_FSACCESS_LISTDIRECTORY sets FILE_LIST_DIRECTORY. - * ... setting #ISC_FSACCESS_CREATECHILD sets FILE_CREATE_CHILD independently. - * ... setting #ISC_FSACCESS_DELETECHILD sets FILE_DELETE_CHILD independently. - * ... setting #ISC_FSACCESS_ACCESSCHILD sets FILE_TRAVERSE. - * - * Unresolved: XXXDCL - * \li What NT access right controls the ability to rename a file? - * \li How does DELETE work? If a directory has FILE_DELETE_CHILD but a - * file or directory within it does not have DELETE, is that file - * or directory deletable? - * \li To implement isc_fsaccess_get(), mapping an existing Unix permission - * mode_t back to an isc_fsaccess_t is pretty trivial; however, mapping - * an NT DACL could be impossible to do in a responsible way. - * \li Similarly, trying to implement the functionality of being able to - * say "add group writability to whatever permissions already exist" - * could be tricky on NT because of the order-of-entry issue combined - * with possibly having one or more matching ACEs already explicitly - * granting or denying access. Because this functionality is - * not yet needed by the ISC, no code has been written to try to - * solve this problem. - */ - -#include -#include - -/* - * Trustees. - */ -#define ISC_FSACCESS_OWNER 0x1 /*%< User account. */ -#define ISC_FSACCESS_GROUP 0x2 /*%< Primary group owner. */ -#define ISC_FSACCESS_OTHER 0x4 /*%< Not the owner or the group owner. */ -#define ISC_FSACCESS_WORLD 0x7 /*%< User, Group, Other. */ - -/* - * Types of permission. - */ -#define ISC_FSACCESS_READ 0x00000001 /*%< File only. */ -#define ISC_FSACCESS_WRITE 0x00000002 /*%< File only. */ -#define ISC_FSACCESS_EXECUTE 0x00000004 /*%< File only. */ -#define ISC_FSACCESS_CREATECHILD 0x00000008 /*%< Dir only. */ -#define ISC_FSACCESS_DELETECHILD 0x00000010 /*%< Dir only. */ -#define ISC_FSACCESS_LISTDIRECTORY 0x00000020 /*%< Dir only. */ -#define ISC_FSACCESS_ACCESSCHILD 0x00000040 /*%< Dir only. */ - -/*% - * Adding any permission bits beyond 0x200 would mean typedef'ing - * isc_fsaccess_t as isc_uint64_t, and redefining this value to - * reflect the new range of permission types, Probably to 21 for - * maximum flexibility. The number of bits has to accommodate all of - * the permission types, and three full sets of them have to fit - * within an isc_fsaccess_t. - */ -#define ISC__FSACCESS_PERMISSIONBITS 10 - -ISC_LANG_BEGINDECLS - -void -isc_fsaccess_add(int trustee, int permission, isc_fsaccess_t *access); - -void -isc_fsaccess_remove(int trustee, int permission, isc_fsaccess_t *access); - -isc_result_t -isc_fsaccess_set(const char *path, isc_fsaccess_t access); - -ISC_LANG_ENDDECLS - -#endif /* ISC_FSACCESS_H */ diff --git a/lib/isc/include/isc/heap.h b/lib/isc/include/isc/heap.h deleted file mode 100644 index 77bf07c34498..000000000000 --- a/lib/isc/include/isc/heap.h +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1997-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: heap.h,v 1.26 2009/01/17 23:47:43 tbox Exp $ */ - -#ifndef ISC_HEAP_H -#define ISC_HEAP_H 1 - -/*! \file isc/heap.h */ - -#include -#include - -ISC_LANG_BEGINDECLS - -/*% - * The comparison function returns ISC_TRUE if the first argument has - * higher priority than the second argument, and ISC_FALSE otherwise. - */ -typedef isc_boolean_t (*isc_heapcompare_t)(void *, void *); - -/*% - * The index function allows the client of the heap to receive a callback - * when an item's index number changes. This allows it to maintain - * sync with its external state, but still delete itself, since deletions - * from the heap require the index be provided. - */ -typedef void (*isc_heapindex_t)(void *, unsigned int); - -/*% - * The heapaction function is used when iterating over the heap. - * - * NOTE: The heap structure CANNOT BE MODIFIED during the call to - * isc_heap_foreach(). - */ -typedef void (*isc_heapaction_t)(void *, void *); - -typedef struct isc_heap isc_heap_t; - -isc_result_t -isc_heap_create(isc_mem_t *mctx, isc_heapcompare_t compare, - isc_heapindex_t index, unsigned int size_increment, - isc_heap_t **heapp); -/*!< - * \brief Create a new heap. The heap is implemented using a space-efficient - * storage method. When the heap elements are deleted space is not freed - * but will be reused when new elements are inserted. - * - * Requires: - *\li "mctx" is valid. - *\li "compare" is a function which takes two void * arguments and - * returns ISC_TRUE if the first argument has a higher priority than - * the second, and ISC_FALSE otherwise. - *\li "index" is a function which takes a void *, and an unsigned int - * argument. This function will be called whenever an element's - * index value changes, so it may continue to delete itself from the - * heap. This option may be NULL if this functionality is unneeded. - *\li "size_increment" is a hint about how large the heap should grow - * when resizing is needed. If this is 0, a default size will be - * used, which is currently 1024, allowing space for an additional 1024 - * heap elements to be inserted before adding more space. - *\li "heapp" is not NULL, and "*heap" is NULL. - * - * Returns: - *\li ISC_R_SUCCESS - success - *\li ISC_R_NOMEMORY - insufficient memory - */ - -void -isc_heap_destroy(isc_heap_t **heapp); -/*!< - * \brief Destroys a heap. - * - * Requires: - *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t. - */ - -isc_result_t -isc_heap_insert(isc_heap_t *heap, void *elt); -/*!< - * \brief Inserts a new element into a heap. - * - * Requires: - *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t. - */ - -void -isc_heap_delete(isc_heap_t *heap, unsigned int index); -/*!< - * \brief Deletes an element from a heap, by element index. - * - * Requires: - *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t. - *\li "index" is a valid element index, as provided by the "index" callback - * provided during heap creation. - */ - -void -isc_heap_increased(isc_heap_t *heap, unsigned int index); -/*!< - * \brief Indicates to the heap that an element's priority has increased. - * This function MUST be called whenever an element has increased in priority. - * - * Requires: - *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t. - *\li "index" is a valid element index, as provided by the "index" callback - * provided during heap creation. - */ - -void -isc_heap_decreased(isc_heap_t *heap, unsigned int index); -/*!< - * \brief Indicates to the heap that an element's priority has decreased. - * This function MUST be called whenever an element has decreased in priority. - * - * Requires: - *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t. - *\li "index" is a valid element index, as provided by the "index" callback - * provided during heap creation. - */ - -void * -isc_heap_element(isc_heap_t *heap, unsigned int index); -/*!< - * \brief Returns the element for a specific element index. - * - * Requires: - *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t. - *\li "index" is a valid element index, as provided by the "index" callback - * provided during heap creation. - * - * Returns: - *\li A pointer to the element for the element index. - */ - -void -isc_heap_foreach(isc_heap_t *heap, isc_heapaction_t action, void *uap); -/*!< - * \brief Iterate over the heap, calling an action for each element. The - * order of iteration is not sorted. - * - * Requires: - *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t. - *\li "action" is not NULL, and is a function which takes two arguments. - * The first is a void *, representing the element, and the second is - * "uap" as provided to isc_heap_foreach. - *\li "uap" is a caller-provided argument, and may be NULL. - * - * Note: - *\li The heap structure CANNOT be modified during this iteration. The only - * safe function to call while iterating the heap is isc_heap_element(). - */ - -ISC_LANG_ENDDECLS - -#endif /* ISC_HEAP_H */ diff --git a/lib/isc/include/isc/hex.h b/lib/isc/include/isc/hex.h deleted file mode 100644 index a5e2f532d91b..000000000000 --- a/lib/isc/include/isc/hex.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: hex.h,v 1.13 2008/09/25 04:02:39 tbox Exp $ */ - -#ifndef ISC_HEX_H -#define ISC_HEX_H 1 - -/*! \file isc/hex.h */ - -#include -#include - -ISC_LANG_BEGINDECLS - -/*** - *** Functions - ***/ - -isc_result_t -isc_hex_totext(isc_region_t *source, int wordlength, - const char *wordbreak, isc_buffer_t *target); -/*!< - * \brief Convert data into hex encoded text. - * - * Notes: - *\li The hex encoded text in 'target' will be divided into - * words of at most 'wordlength' characters, separated by - * the 'wordbreak' string. No parentheses will surround - * the text. - * - * Requires: - *\li 'source' is a region containing binary data - *\li 'target' is a text buffer containing available space - *\li 'wordbreak' points to a null-terminated string of - * zero or more whitespace characters - * - * Ensures: - *\li target will contain the hex encoded version of the data - * in source. The 'used' pointer in target will be advanced as - * necessary. - */ - -isc_result_t -isc_hex_decodestring(const char *cstr, isc_buffer_t *target); -/*!< - * \brief Decode a null-terminated hex string. - * - * Requires: - *\li 'cstr' is non-null. - *\li 'target' is a valid buffer. - * - * Returns: - *\li #ISC_R_SUCCESS -- the entire decoded representation of 'cstring' - * fit in 'target'. - *\li #ISC_R_BADHEX -- 'cstr' is not a valid hex encoding. - * - * Other error returns are any possible error code from: - * isc_lex_create(), - * isc_lex_openbuffer(), - * isc_hex_tobuffer(). - */ - -isc_result_t -isc_hex_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length); -/*!< - * \brief Convert hex encoded text from a lexer context into data. - * - * Requires: - *\li 'lex' is a valid lexer context - *\li 'target' is a buffer containing binary data - *\li 'length' is an integer - * - * Ensures: - *\li target will contain the data represented by the hex encoded - * string parsed by the lexer. No more than length bytes will be read, - * if length is positive. The 'used' pointer in target will be - * advanced as necessary. - */ - - -ISC_LANG_ENDDECLS - -#endif /* ISC_HEX_H */ diff --git a/lib/isc/include/isc/hmacmd5.h b/lib/isc/include/isc/hmacmd5.h deleted file mode 100644 index 9ecad453dfa5..000000000000 --- a/lib/isc/include/isc/hmacmd5.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: hmacmd5.h,v 1.14 2009/02/06 23:47:42 tbox Exp $ */ - -/*! \file isc/hmacmd5.h - * \brief This is the header file for the HMAC-MD5 keyed hash algorithm - * described in RFC2104. - */ - -#ifndef ISC_HMACMD5_H -#define ISC_HMACMD5_H 1 - -#include -#include -#include -#include - -#define ISC_HMACMD5_KEYLENGTH 64 - -#ifdef ISC_PLATFORM_OPENSSLHASH -#include - -typedef HMAC_CTX isc_hmacmd5_t; - -#else - -typedef struct { - isc_md5_t md5ctx; - unsigned char key[ISC_HMACMD5_KEYLENGTH]; -} isc_hmacmd5_t; -#endif - -ISC_LANG_BEGINDECLS - -void -isc_hmacmd5_init(isc_hmacmd5_t *ctx, const unsigned char *key, - unsigned int len); - -void -isc_hmacmd5_invalidate(isc_hmacmd5_t *ctx); - -void -isc_hmacmd5_update(isc_hmacmd5_t *ctx, const unsigned char *buf, - unsigned int len); - -void -isc_hmacmd5_sign(isc_hmacmd5_t *ctx, unsigned char *digest); - -isc_boolean_t -isc_hmacmd5_verify(isc_hmacmd5_t *ctx, unsigned char *digest); - -isc_boolean_t -isc_hmacmd5_verify2(isc_hmacmd5_t *ctx, unsigned char *digest, size_t len); - -ISC_LANG_ENDDECLS - -#endif /* ISC_HMACMD5_H */ diff --git a/lib/isc/include/isc/hmacsha.h b/lib/isc/include/isc/hmacsha.h deleted file mode 100644 index 1d0e18409536..000000000000 --- a/lib/isc/include/isc/hmacsha.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (C) 2005-2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: hmacsha.h,v 1.9 2009/02/06 23:47:42 tbox Exp $ */ - -/*! \file isc/hmacsha.h - * This is the header file for the HMAC-SHA1, HMAC-SHA224, HMAC-SHA256, - * HMAC-SHA334 and HMAC-SHA512 hash algorithm described in RFC 2104. - */ - -#ifndef ISC_HMACSHA_H -#define ISC_HMACSHA_H 1 - -#include -#include -#include -#include -#include - -#define ISC_HMACSHA1_KEYLENGTH ISC_SHA1_BLOCK_LENGTH -#define ISC_HMACSHA224_KEYLENGTH ISC_SHA224_BLOCK_LENGTH -#define ISC_HMACSHA256_KEYLENGTH ISC_SHA256_BLOCK_LENGTH -#define ISC_HMACSHA384_KEYLENGTH ISC_SHA384_BLOCK_LENGTH -#define ISC_HMACSHA512_KEYLENGTH ISC_SHA512_BLOCK_LENGTH - -#ifdef ISC_PLATFORM_OPENSSLHASH -#include - -typedef HMAC_CTX isc_hmacsha1_t; -typedef HMAC_CTX isc_hmacsha224_t; -typedef HMAC_CTX isc_hmacsha256_t; -typedef HMAC_CTX isc_hmacsha384_t; -typedef HMAC_CTX isc_hmacsha512_t; - -#else - -typedef struct { - isc_sha1_t sha1ctx; - unsigned char key[ISC_HMACSHA1_KEYLENGTH]; -} isc_hmacsha1_t; - -typedef struct { - isc_sha224_t sha224ctx; - unsigned char key[ISC_HMACSHA224_KEYLENGTH]; -} isc_hmacsha224_t; - -typedef struct { - isc_sha256_t sha256ctx; - unsigned char key[ISC_HMACSHA256_KEYLENGTH]; -} isc_hmacsha256_t; - -typedef struct { - isc_sha384_t sha384ctx; - unsigned char key[ISC_HMACSHA384_KEYLENGTH]; -} isc_hmacsha384_t; - -typedef struct { - isc_sha512_t sha512ctx; - unsigned char key[ISC_HMACSHA512_KEYLENGTH]; -} isc_hmacsha512_t; -#endif - -ISC_LANG_BEGINDECLS - -void -isc_hmacsha1_init(isc_hmacsha1_t *ctx, const unsigned char *key, - unsigned int len); - -void -isc_hmacsha1_invalidate(isc_hmacsha1_t *ctx); - -void -isc_hmacsha1_update(isc_hmacsha1_t *ctx, const unsigned char *buf, - unsigned int len); - -void -isc_hmacsha1_sign(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len); - -isc_boolean_t -isc_hmacsha1_verify(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len); - - -void -isc_hmacsha224_init(isc_hmacsha224_t *ctx, const unsigned char *key, - unsigned int len); - -void -isc_hmacsha224_invalidate(isc_hmacsha224_t *ctx); - -void -isc_hmacsha224_update(isc_hmacsha224_t *ctx, const unsigned char *buf, - unsigned int len); - -void -isc_hmacsha224_sign(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len); - -isc_boolean_t -isc_hmacsha224_verify(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len); - - -void -isc_hmacsha256_init(isc_hmacsha256_t *ctx, const unsigned char *key, - unsigned int len); - -void -isc_hmacsha256_invalidate(isc_hmacsha256_t *ctx); - -void -isc_hmacsha256_update(isc_hmacsha256_t *ctx, const unsigned char *buf, - unsigned int len); - -void -isc_hmacsha256_sign(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len); - -isc_boolean_t -isc_hmacsha256_verify(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len); - - -void -isc_hmacsha384_init(isc_hmacsha384_t *ctx, const unsigned char *key, - unsigned int len); - -void -isc_hmacsha384_invalidate(isc_hmacsha384_t *ctx); - -void -isc_hmacsha384_update(isc_hmacsha384_t *ctx, const unsigned char *buf, - unsigned int len); - -void -isc_hmacsha384_sign(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len); - -isc_boolean_t -isc_hmacsha384_verify(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len); - - -void -isc_hmacsha512_init(isc_hmacsha512_t *ctx, const unsigned char *key, - unsigned int len); - -void -isc_hmacsha512_invalidate(isc_hmacsha512_t *ctx); - -void -isc_hmacsha512_update(isc_hmacsha512_t *ctx, const unsigned char *buf, - unsigned int len); - -void -isc_hmacsha512_sign(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len); - -isc_boolean_t -isc_hmacsha512_verify(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len); - -ISC_LANG_ENDDECLS - -#endif /* ISC_HMACSHA_H */ diff --git a/lib/isc/include/isc/httpd.h b/lib/isc/include/isc/httpd.h deleted file mode 100644 index ba7f900198e4..000000000000 --- a/lib/isc/include/isc/httpd.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2006-2008 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: httpd.h,v 1.9 2008/08/08 05:06:49 marka Exp $ */ - -#ifndef ISC_HTTPD_H -#define ISC_HTTPD_H 1 - -/*! \file */ - -#include -#include -#include -#include -#include - -#define HTTPD_EVENTCLASS ISC_EVENTCLASS(4300) -#define HTTPD_SHUTDOWN (HTTPD_EVENTCLASS + 0x0001) - -#define ISC_HTTPDMGR_FLAGSHUTTINGDOWN 0x00000001 - -/* - * Create a new http daemon which will send, once every time period, - * a http-like header followed by HTTP data. - */ -isc_result_t -isc_httpdmgr_create(isc_mem_t *mctx, isc_socket_t *sock, isc_task_t *task, - isc_httpdclientok_t *client_ok, - isc_httpdondestroy_t *ondestory, void *cb_arg, - isc_timermgr_t *tmgr, isc_httpdmgr_t **httpdp); - -void -isc_httpdmgr_shutdown(isc_httpdmgr_t **httpdp); - -isc_result_t -isc_httpdmgr_addurl(isc_httpdmgr_t *httpdmgr, const char *url, - isc_httpdaction_t *func, void *arg); - -isc_result_t -isc_httpd_response(isc_httpd_t *httpd); - -isc_result_t -isc_httpd_addheader(isc_httpd_t *httpd, const char *name, - const char *val); - -isc_result_t -isc_httpd_addheaderuint(isc_httpd_t *httpd, const char *name, int val); - -isc_result_t isc_httpd_endheaders(isc_httpd_t *httpd); - -#endif /* ISC_HTTPD_H */ diff --git a/lib/isc/include/isc/ipv6.h b/lib/isc/include/isc/ipv6.h deleted file mode 100644 index 8054c9e18647..000000000000 --- a/lib/isc/include/isc/ipv6.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: ipv6.h,v 1.24 2007/06/19 23:47:18 tbox Exp $ */ - -#ifndef ISC_IPV6_H -#define ISC_IPV6_H 1 - -/*! - * Also define LWRES_IPV6_H to keep it from being included if liblwres is - * being used, or redefinition errors will occur. - */ -#define LWRES_IPV6_H 1 - -/***** - ***** Module Info - *****/ - -/*! \file isc/ipv6.h - * \brief IPv6 definitions for systems which do not support IPv6. - * - * \li MP: - * No impact. - * - * \li Reliability: - * No anticipated impact. - * - * \li Resources: - * N/A. - * - * \li Security: - * No anticipated impact. - * - * \li Standards: - * RFC2553. - */ - -/*** - *** Imports. - ***/ - -#include -#include - -/*** - *** Types. - ***/ - -struct in6_addr { - union { - isc_uint8_t _S6_u8[16]; - isc_uint16_t _S6_u16[8]; - isc_uint32_t _S6_u32[4]; - } _S6_un; -}; -#define s6_addr _S6_un._S6_u8 -#define s6_addr8 _S6_un._S6_u8 -#define s6_addr16 _S6_un._S6_u16 -#define s6_addr32 _S6_un._S6_u32 - -#define IN6ADDR_ANY_INIT {{{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }}} -#define IN6ADDR_LOOPBACK_INIT {{{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }}} - -LIBISC_EXTERNAL_DATA extern const struct in6_addr in6addr_any; -LIBISC_EXTERNAL_DATA extern const struct in6_addr in6addr_loopback; - -struct sockaddr_in6 { -#ifdef ISC_PLATFORM_HAVESALEN - isc_uint8_t sin6_len; - isc_uint8_t sin6_family; -#else - isc_uint16_t sin6_family; -#endif - isc_uint16_t sin6_port; - isc_uint32_t sin6_flowinfo; - struct in6_addr sin6_addr; - isc_uint32_t sin6_scope_id; -}; - -#ifdef ISC_PLATFORM_HAVESALEN -#define SIN6_LEN 1 -#endif - -/*% - * Unspecified - */ -#define IN6_IS_ADDR_UNSPECIFIED(a) \ - (((a)->s6_addr32[0] == 0) && \ - ((a)->s6_addr32[1] == 0) && \ - ((a)->s6_addr32[2] == 0) && \ - ((a)->s6_addr32[3] == 0)) - -/*% - * Loopback - */ -#define IN6_IS_ADDR_LOOPBACK(a) \ - (((a)->s6_addr32[0] == 0) && \ - ((a)->s6_addr32[1] == 0) && \ - ((a)->s6_addr32[2] == 0) && \ - ((a)->s6_addr32[3] == htonl(1))) - -/*% - * IPv4 compatible - */ -#define IN6_IS_ADDR_V4COMPAT(a) \ - (((a)->s6_addr32[0] == 0) && \ - ((a)->s6_addr32[1] == 0) && \ - ((a)->s6_addr32[2] == 0) && \ - ((a)->s6_addr32[3] != 0) && \ - ((a)->s6_addr32[3] != htonl(1))) - -/*% - * Mapped - */ -#define IN6_IS_ADDR_V4MAPPED(a) \ - (((a)->s6_addr32[0] == 0) && \ - ((a)->s6_addr32[1] == 0) && \ - ((a)->s6_addr32[2] == htonl(0x0000ffff))) - -/*% - * Multicast - */ -#define IN6_IS_ADDR_MULTICAST(a) \ - ((a)->s6_addr8[0] == 0xffU) - -/*% - * Unicast link / site local. - */ -#define IN6_IS_ADDR_LINKLOCAL(a) \ - (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80)) -#define IN6_IS_ADDR_SITELOCAL(a) \ - (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0)) - -#endif /* ISC_IPV6_H */ diff --git a/lib/isc/include/isc/iterated_hash.h b/lib/isc/include/isc/iterated_hash.h deleted file mode 100644 index a8173f0ab22f..000000000000 --- a/lib/isc/include/isc/iterated_hash.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: iterated_hash.h,v 1.3 2008/09/25 04:02:39 tbox Exp $ */ - -#ifndef ISC_ITERATED_HASH_H -#define ISC_ITERATED_HASH_H 1 - -#include -#include - -/* - * The maximal hash length that can be encoded it a name - * using base32hex. floor(255/8)*5 - */ -#define NSEC3_MAX_HASH_LENGTH 155 - -/* - * The maximum has that can be encoded in a single label using - * base32hex. floor(63/8)*5 - */ -#define NSEC3_MAX_LABEL_HASH 35 - -ISC_LANG_BEGINDECLS - -int isc_iterated_hash(unsigned char out[NSEC3_MAX_HASH_LENGTH], - unsigned int hashalg, int iterations, - const unsigned char *salt, int saltlength, - const unsigned char *in, int inlength); - - -ISC_LANG_ENDDECLS - -#endif /* ISC_ITERATED_HASH_H */ diff --git a/lib/isc/include/isc/lex.h b/lib/isc/include/isc/lex.h deleted file mode 100644 index 8612150991bc..000000000000 --- a/lib/isc/include/isc/lex.h +++ /dev/null @@ -1,431 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: lex.h,v 1.37 2008/05/30 23:47:01 tbox Exp $ */ - -#ifndef ISC_LEX_H -#define ISC_LEX_H 1 - -/***** - ***** Module Info - *****/ - -/*! \file isc/lex.h - * \brief The "lex" module provides a lightweight tokenizer. It can operate - * on files or buffers, and can handle "include". It is designed for - * parsing of DNS master files and the BIND configuration file, but - * should be general enough to tokenize other things, e.g. HTTP. - * - * \li MP: - * No synchronization is provided. Clients must ensure exclusive - * access. - * - * \li Reliability: - * No anticipated impact. - * - * \li Resources: - * TBS - * - * \li Security: - * No anticipated impact. - * - * \li Standards: - * None. - */ - -/*** - *** Imports - ***/ - -#include - -#include -#include -#include - -ISC_LANG_BEGINDECLS - -/*** - *** Options - ***/ - -/*@{*/ -/*! - * Various options for isc_lex_gettoken(). - */ - -#define ISC_LEXOPT_EOL 0x01 /*%< Want end-of-line token. */ -#define ISC_LEXOPT_EOF 0x02 /*%< Want end-of-file token. */ -#define ISC_LEXOPT_INITIALWS 0x04 /*%< Want initial whitespace. */ -#define ISC_LEXOPT_NUMBER 0x08 /*%< Recognize numbers. */ -#define ISC_LEXOPT_QSTRING 0x10 /*%< Recognize qstrings. */ -/*@}*/ - -/*@{*/ -/*! - * The ISC_LEXOPT_DNSMULTILINE option handles the processing of '(' and ')' in - * the DNS master file format. If this option is set, then the - * ISC_LEXOPT_INITIALWS and ISC_LEXOPT_EOL options will be ignored when - * the paren count is > 0. To use this option, '(' and ')' must be special - * characters. - */ -#define ISC_LEXOPT_DNSMULTILINE 0x20 /*%< Handle '(' and ')'. */ -#define ISC_LEXOPT_NOMORE 0x40 /*%< Want "no more" token. */ - -#define ISC_LEXOPT_CNUMBER 0x80 /*%< Recognize octal and hex. */ -#define ISC_LEXOPT_ESCAPE 0x100 /*%< Recognize escapes. */ -#define ISC_LEXOPT_QSTRINGMULTILINE 0x200 /*%< Allow multiline "" strings */ -#define ISC_LEXOPT_OCTAL 0x400 /*%< Expect a octal number. */ -/*@}*/ -/*@{*/ -/*! - * Various commenting styles, which may be changed at any time with - * isc_lex_setcomments(). - */ - -#define ISC_LEXCOMMENT_C 0x01 -#define ISC_LEXCOMMENT_CPLUSPLUS 0x02 -#define ISC_LEXCOMMENT_SHELL 0x04 -#define ISC_LEXCOMMENT_DNSMASTERFILE 0x08 -/*@}*/ - -/*** - *** Types - ***/ - -/*! Lex */ - -typedef char isc_lexspecials_t[256]; - -/* Tokens */ - -typedef enum { - isc_tokentype_unknown = 0, - isc_tokentype_string = 1, - isc_tokentype_number = 2, - isc_tokentype_qstring = 3, - isc_tokentype_eol = 4, - isc_tokentype_eof = 5, - isc_tokentype_initialws = 6, - isc_tokentype_special = 7, - isc_tokentype_nomore = 8 -} isc_tokentype_t; - -typedef union { - char as_char; - unsigned long as_ulong; - isc_region_t as_region; - isc_textregion_t as_textregion; - void * as_pointer; -} isc_tokenvalue_t; - -typedef struct isc_token { - isc_tokentype_t type; - isc_tokenvalue_t value; -} isc_token_t; - -/*** - *** Functions - ***/ - -isc_result_t -isc_lex_create(isc_mem_t *mctx, size_t max_token, isc_lex_t **lexp); -/*%< - * Create a lexer. - * - * 'max_token' is a hint of the number of bytes in the largest token. - * - * Requires: - *\li '*lexp' is a valid lexer. - * - *\li max_token > 0. - * - * Ensures: - *\li On success, *lexp is attached to the newly created lexer. - * - * Returns: - *\li #ISC_R_SUCCESS - *\li #ISC_R_NOMEMORY - */ - -void -isc_lex_destroy(isc_lex_t **lexp); -/*%< - * Destroy the lexer. - * - * Requires: - *\li '*lexp' is a valid lexer. - * - * Ensures: - *\li *lexp == NULL - */ - -unsigned int -isc_lex_getcomments(isc_lex_t *lex); -/*%< - * Return the current lexer commenting styles. - * - * Requires: - *\li 'lex' is a valid lexer. - * - * Returns: - *\li The commenting sytles which are currently allowed. - */ - -void -isc_lex_setcomments(isc_lex_t *lex, unsigned int comments); -/*%< - * Set allowed lexer commenting styles. - * - * Requires: - *\li 'lex' is a valid lexer. - * - *\li 'comments' has meaningful values. - */ - -void -isc_lex_getspecials(isc_lex_t *lex, isc_lexspecials_t specials); -/*%< - * Put the current list of specials into 'specials'. - * - * Requires: - *\li 'lex' is a valid lexer. - */ - -void -isc_lex_setspecials(isc_lex_t *lex, isc_lexspecials_t specials); -/*!< - * The characters in 'specials' are returned as tokens. Along with - * whitespace, they delimit strings and numbers. - * - * Note: - *\li Comment processing takes precedence over special character - * recognition. - * - * Requires: - *\li 'lex' is a valid lexer. - */ - -isc_result_t -isc_lex_openfile(isc_lex_t *lex, const char *filename); -/*%< - * Open 'filename' and make it the current input source for 'lex'. - * - * Requires: - *\li 'lex' is a valid lexer. - * - *\li filename is a valid C string. - * - * Returns: - *\li #ISC_R_SUCCESS - *\li #ISC_R_NOMEMORY Out of memory - *\li #ISC_R_NOTFOUND File not found - *\li #ISC_R_NOPERM No permission to open file - *\li #ISC_R_FAILURE Couldn't open file, not sure why - *\li #ISC_R_UNEXPECTED - */ - -isc_result_t -isc_lex_openstream(isc_lex_t *lex, FILE *stream); -/*%< - * Make 'stream' the current input source for 'lex'. - * - * Requires: - *\li 'lex' is a valid lexer. - * - *\li 'stream' is a valid C stream. - * - * Returns: - *\li #ISC_R_SUCCESS - *\li #ISC_R_NOMEMORY Out of memory - */ - -isc_result_t -isc_lex_openbuffer(isc_lex_t *lex, isc_buffer_t *buffer); -/*%< - * Make 'buffer' the current input source for 'lex'. - * - * Requires: - *\li 'lex' is a valid lexer. - * - *\li 'buffer' is a valid buffer. - * - * Returns: - *\li #ISC_R_SUCCESS - *\li #ISC_R_NOMEMORY Out of memory - */ - -isc_result_t -isc_lex_close(isc_lex_t *lex); -/*%< - * Close the most recently opened object (i.e. file or buffer). - * - * Returns: - *\li #ISC_R_SUCCESS - *\li #ISC_R_NOMORE No more input sources - */ - -isc_result_t -isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp); -/*%< - * Get the next token. - * - * Requires: - *\li 'lex' is a valid lexer. - * - *\li 'lex' has an input source. - * - *\li 'options' contains valid options. - * - *\li '*tokenp' is a valid pointer. - * - * Returns: - *\li #ISC_R_SUCCESS - *\li #ISC_R_UNEXPECTEDEND - *\li #ISC_R_NOMEMORY - * - * These two results are returned only if their corresponding lexer - * options are not set. - * - *\li #ISC_R_EOF End of input source - *\li #ISC_R_NOMORE No more input sources - */ - -isc_result_t -isc_lex_getmastertoken(isc_lex_t *lex, isc_token_t *token, - isc_tokentype_t expect, isc_boolean_t eol); -/*%< - * Get the next token from a DNS master file type stream. This is a - * convenience function that sets appropriate options and handles quoted - * strings and end of line correctly for master files. It also ungets - * unexpected tokens. - * - * Requires: - *\li 'lex' is a valid lexer. - * - *\li 'token' is a valid pointer - * - * Returns: - * - * \li any return code from isc_lex_gettoken(). - */ - -isc_result_t -isc_lex_getoctaltoken(isc_lex_t *lex, isc_token_t *token, isc_boolean_t eol); -/*%< - * Get the next token from a DNS master file type stream. This is a - * convenience function that sets appropriate options and handles end - * of line correctly for master files. It also ungets unexpected tokens. - * - * Requires: - *\li 'lex' is a valid lexer. - * - *\li 'token' is a valid pointer - * - * Returns: - * - * \li any return code from isc_lex_gettoken(). - */ - -void -isc_lex_ungettoken(isc_lex_t *lex, isc_token_t *tokenp); -/*%< - * Unget the current token. - * - * Requires: - *\li 'lex' is a valid lexer. - * - *\li 'lex' has an input source. - * - *\li 'tokenp' points to a valid token. - * - *\li There is no ungotten token already. - */ - -void -isc_lex_getlasttokentext(isc_lex_t *lex, isc_token_t *tokenp, isc_region_t *r); -/*%< - * Returns a region containing the text of the last token returned. - * - * Requires: - *\li 'lex' is a valid lexer. - * - *\li 'lex' has an input source. - * - *\li 'tokenp' points to a valid token. - * - *\li A token has been gotten and not ungotten. - */ - -char * -isc_lex_getsourcename(isc_lex_t *lex); -/*%< - * Return the input source name. - * - * Requires: - *\li 'lex' is a valid lexer. - * - * Returns: - * \li source name or NULL if no current source. - *\li result valid while current input source exists. - */ - - -unsigned long -isc_lex_getsourceline(isc_lex_t *lex); -/*%< - * Return the input source line number. - * - * Requires: - *\li 'lex' is a valid lexer. - * - * Returns: - *\li Current line number or 0 if no current source. - */ - -isc_result_t -isc_lex_setsourcename(isc_lex_t *lex, const char *name); -/*%< - * Assigns a new name to the input source. - * - * Requires: - * - * \li 'lex' is a valid lexer. - * - * Returns: - * \li #ISC_R_SUCCESS - * \li #ISC_R_NOMEMORY - * \li #ISC_R_NOTFOUND - there are no sources. - */ - -isc_boolean_t -isc_lex_isfile(isc_lex_t *lex); -/*%< - * Return whether the current input source is a file. - * - * Requires: - *\li 'lex' is a valid lexer. - * - * Returns: - * \li #ISC_TRUE if the current input is a file, - *\li #ISC_FALSE otherwise. - */ - - -ISC_LANG_ENDDECLS - -#endif /* ISC_LEX_H */ diff --git a/lib/isc/include/isc/lfsr.h b/lib/isc/include/isc/lfsr.h deleted file mode 100644 index d4d970700078..000000000000 --- a/lib/isc/include/isc/lfsr.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: lfsr.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */ - -#ifndef ISC_LFSR_H -#define ISC_LFSR_H 1 - -/*! \file isc/lfsr.h */ - -#include -#include - -typedef struct isc_lfsr isc_lfsr_t; - -/*% - * This function is called when reseeding is needed. It is allowed to - * modify any state in the LFSR in any way it sees fit OTHER THAN "bits". - * - * It MUST set "count" to a new value or the lfsr will never reseed again. - * - * Also, a reseed will never occur in the middle of an extraction. This - * is purely an optimization, and is probably what one would want. - */ -typedef void (*isc_lfsrreseed_t)(isc_lfsr_t *, void *); - -/*% - * The members of this structure can be used by the application, but care - * needs to be taken to not change state once the lfsr is in operation. - */ -struct isc_lfsr { - isc_uint32_t state; /*%< previous state */ - unsigned int bits; /*%< length */ - isc_uint32_t tap; /*%< bit taps */ - unsigned int count; /*%< reseed count (in BITS!) */ - isc_lfsrreseed_t reseed; /*%< reseed function */ - void *arg; /*%< reseed function argument */ -}; - -ISC_LANG_BEGINDECLS - - -void -isc_lfsr_init(isc_lfsr_t *lfsr, isc_uint32_t state, unsigned int bits, - isc_uint32_t tap, unsigned int count, - isc_lfsrreseed_t reseed, void *arg); -/*%< - * Initialize an LFSR. - * - * Note: - * - *\li Putting untrusted values into this function will cause the LFSR to - * generate (perhaps) non-maximal length sequences. - * - * Requires: - * - *\li lfsr != NULL - * - *\li 8 <= bits <= 32 - * - *\li tap != 0 - */ - -void -isc_lfsr_generate(isc_lfsr_t *lfsr, void *data, unsigned int count); -/*%< - * Returns "count" bytes of data from the LFSR. - * - * Requires: - * - *\li lfsr be valid. - * - *\li data != NULL. - * - *\li count > 0. - */ - -void -isc_lfsr_skip(isc_lfsr_t *lfsr, unsigned int skip); -/*%< - * Skip "skip" states. - * - * Requires: - * - *\li lfsr be valid. - */ - -isc_uint32_t -isc_lfsr_generate32(isc_lfsr_t *lfsr1, isc_lfsr_t *lfsr2); -/*%< - * Given two LFSRs, use the current state from each to skip entries in the - * other. The next states are then xor'd together and returned. - * - * WARNING: - * - *\li This function is used only for very, very low security data, such - * as DNS message IDs where it is desired to have an unpredictable - * stream of bytes that are harder to predict than a simple flooding - * attack. - * - * Notes: - * - *\li Since the current state from each of the LFSRs is used to skip - * state in the other, it is important that no state be leaked - * from either LFSR. - * - * Requires: - * - *\li lfsr1 and lfsr2 be valid. - * - *\li 1 <= skipbits <= 31 - */ - -ISC_LANG_ENDDECLS - -#endif /* ISC_LFSR_H */ diff --git a/lib/isc/include/isc/mem.h b/lib/isc/include/isc/mem.h deleted file mode 100644 index 5101ea3fed1c..000000000000 --- a/lib/isc/include/isc/mem.h +++ /dev/null @@ -1,750 +0,0 @@ -/* - * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1997-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -#ifndef ISC_MEM_H -#define ISC_MEM_H 1 - -/*! \file isc/mem.h */ - -#include - -#include -#include -#include -#include -#include - -ISC_LANG_BEGINDECLS - -#define ISC_MEM_LOWATER 0 -#define ISC_MEM_HIWATER 1 -typedef void (*isc_mem_water_t)(void *, int); - -typedef void * (*isc_memalloc_t)(void *, size_t); -typedef void (*isc_memfree_t)(void *, void *); - -/*% - * Define ISC_MEM_DEBUG=1 to make all functions that free memory - * set the pointer being freed to NULL after being freed. - * This is the default; set ISC_MEM_DEBUG=0 to disable it. - */ -#ifndef ISC_MEM_DEBUG -#define ISC_MEM_DEBUG 1 -#endif - -/*% - * Define ISC_MEM_TRACKLINES=1 to turn on detailed tracing of memory - * allocation and freeing by file and line number. - */ -#ifndef ISC_MEM_TRACKLINES -#define ISC_MEM_TRACKLINES 1 -#endif - -/*% - * Define ISC_MEM_CHECKOVERRUN=1 to turn on checks for using memory outside - * the requested space. This will increase the size of each allocation. - */ -#ifndef ISC_MEM_CHECKOVERRUN -#define ISC_MEM_CHECKOVERRUN 1 -#endif - -/*% - * Define ISC_MEM_FILL=1 to fill each block of memory returned to the system - * with the byte string '0xbe'. This helps track down uninitialized pointers - * and the like. On freeing memory, the space is filled with '0xde' for - * the same reasons. - */ -#ifndef ISC_MEM_FILL -#define ISC_MEM_FILL 1 -#endif - -/*% - * Define ISC_MEMPOOL_NAMES=1 to make memory pools store a symbolic - * name so that the leaking pool can be more readily identified in - * case of a memory leak. - */ -#ifndef ISC_MEMPOOL_NAMES -#define ISC_MEMPOOL_NAMES 1 -#endif - -LIBISC_EXTERNAL_DATA extern unsigned int isc_mem_debugging; -/*@{*/ -#define ISC_MEM_DEBUGTRACE 0x00000001U -#define ISC_MEM_DEBUGRECORD 0x00000002U -#define ISC_MEM_DEBUGUSAGE 0x00000004U -#define ISC_MEM_DEBUGSIZE 0x00000008U -#define ISC_MEM_DEBUGCTX 0x00000010U -#define ISC_MEM_DEBUGALL 0x0000001FU -/*!< - * The variable isc_mem_debugging holds a set of flags for - * turning certain memory debugging options on or off at - * runtime. It is initialized to the value ISC_MEM_DEGBUGGING, - * which is 0 by default but may be overridden at compile time. - * The following flags can be specified: - * - * \li #ISC_MEM_DEBUGTRACE - * Log each allocation and free to isc_lctx. - * - * \li #ISC_MEM_DEBUGRECORD - * Remember each allocation, and match them up on free. - * Crash if a free doesn't match an allocation. - * - * \li #ISC_MEM_DEBUGUSAGE - * If a hi_water mark is set, print the maximum inuse memory - * every time it is raised once it exceeds the hi_water mark. - * - * \li #ISC_MEM_DEBUGSIZE - * Check the size argument being passed to isc_mem_put() matches - * that passed to isc_mem_get(). - * - * \li #ISC_MEM_DEBUGCTX - * Check the mctx argument being passed to isc_mem_put() matches - * that passed to isc_mem_get(). - */ -/*@}*/ - -#if ISC_MEM_TRACKLINES -#define _ISC_MEM_FILELINE , __FILE__, __LINE__ -#define _ISC_MEM_FLARG , const char *, unsigned int -#else -#define _ISC_MEM_FILELINE -#define _ISC_MEM_FLARG -#endif - -/*! - * Define ISC_MEM_USE_INTERNAL_MALLOC=1 to use the internal malloc() - * implementation in preference to the system one. The internal malloc() - * is very space-efficient, and quite fast on uniprocessor systems. It - * performs poorly on multiprocessor machines. - * JT: we can overcome the performance issue on multiprocessor machines - * by carefully separating memory contexts. - */ - -#ifndef ISC_MEM_USE_INTERNAL_MALLOC -#define ISC_MEM_USE_INTERNAL_MALLOC 1 -#endif - -/* - * Flags for isc_mem_create2()calls. - */ -#define ISC_MEMFLAG_NOLOCK 0x00000001 /* no lock is necessary */ -#define ISC_MEMFLAG_INTERNAL 0x00000002 /* use internal malloc */ -#if ISC_MEM_USE_INTERNAL_MALLOC -#define ISC_MEMFLAG_DEFAULT ISC_MEMFLAG_INTERNAL -#else -#define ISC_MEMFLAG_DEFAULT 0 -#endif - - -/*%< - * We use either isc___mem (three underscores) or isc__mem (two) depending on - * whether it's for BIND9's internal purpose (with -DBIND9) or generic export - * library. This condition is generally handled in isc/namespace.h, but for - * Windows it doesn't work if it involves multiple times of macro expansion - * (such as isc_mem to isc__mem then to isc___mem). The following definitions - * are used to work around this portability issue. Right now, we don't support - * the export library for Windows, so we always use the three-underscore - * version. - */ -#ifdef WIN32 -#define ISCMEMFUNC(sfx) isc___mem_ ## sfx -#define ISCMEMPOOLFUNC(sfx) isc___mempool_ ## sfx -#else -#define ISCMEMFUNC(sfx) isc__mem_ ## sfx -#define ISCMEMPOOLFUNC(sfx) isc__mempool_ ## sfx -#endif - -#define isc_mem_get(c, s) ISCMEMFUNC(get)((c), (s) _ISC_MEM_FILELINE) -#define isc_mem_allocate(c, s) ISCMEMFUNC(allocate)((c), (s) _ISC_MEM_FILELINE) -#define isc_mem_reallocate(c, p, s) ISCMEMFUNC(reallocate)((c), (p), (s) _ISC_MEM_FILELINE) -#define isc_mem_strdup(c, p) ISCMEMFUNC(strdup)((c), (p) _ISC_MEM_FILELINE) -#define isc_mempool_get(c) ISCMEMPOOLFUNC(get)((c) _ISC_MEM_FILELINE) - -/*% - * isc_mem_putanddetach() is a convenience function for use where you - * have a structure with an attached memory context. - * - * Given: - * - * \code - * struct { - * ... - * isc_mem_t *mctx; - * ... - * } *ptr; - * - * isc_mem_t *mctx; - * - * isc_mem_putanddetach(&ptr->mctx, ptr, sizeof(*ptr)); - * \endcode - * - * is the equivalent of: - * - * \code - * mctx = NULL; - * isc_mem_attach(ptr->mctx, &mctx); - * isc_mem_detach(&ptr->mctx); - * isc_mem_put(mctx, ptr, sizeof(*ptr)); - * isc_mem_detach(&mctx); - * \endcode - */ - -/*% memory and memory pool methods */ -typedef struct isc_memmethods { - void (*attach)(isc_mem_t *source, isc_mem_t **targetp); - void (*detach)(isc_mem_t **mctxp); - void (*destroy)(isc_mem_t **mctxp); - void *(*memget)(isc_mem_t *mctx, size_t size _ISC_MEM_FLARG); - void (*memput)(isc_mem_t *mctx, void *ptr, size_t size _ISC_MEM_FLARG); - void (*memputanddetach)(isc_mem_t **mctxp, void *ptr, - size_t size _ISC_MEM_FLARG); - void *(*memallocate)(isc_mem_t *mctx, size_t size _ISC_MEM_FLARG); - void *(*memreallocate)(isc_mem_t *mctx, void *ptr, - size_t size _ISC_MEM_FLARG); - char *(*memstrdup)(isc_mem_t *mctx, const char *s _ISC_MEM_FLARG); - void (*memfree)(isc_mem_t *mctx, void *ptr _ISC_MEM_FLARG); - void (*setdestroycheck)(isc_mem_t *mctx, isc_boolean_t flag); - void (*setwater)(isc_mem_t *ctx, isc_mem_water_t water, - void *water_arg, size_t hiwater, size_t lowater); - void (*waterack)(isc_mem_t *ctx, int flag); - size_t (*inuse)(isc_mem_t *mctx); - isc_boolean_t (*isovermem)(isc_mem_t *mctx); - isc_result_t (*mpcreate)(isc_mem_t *mctx, size_t size, - isc_mempool_t **mpctxp); -} isc_memmethods_t; - -typedef struct isc_mempoolmethods { - void (*destroy)(isc_mempool_t **mpctxp); - void *(*get)(isc_mempool_t *mpctx _ISC_MEM_FLARG); - void (*put)(isc_mempool_t *mpctx, void *mem _ISC_MEM_FLARG); - unsigned int (*getallocated)(isc_mempool_t *mpctx); - void (*setmaxalloc)(isc_mempool_t *mpctx, unsigned int limit); - void (*setfreemax)(isc_mempool_t *mpctx, unsigned int limit); - void (*setname)(isc_mempool_t *mpctx, const char *name); - void (*associatelock)(isc_mempool_t *mpctx, isc_mutex_t *lock); - void (*setfillcount)(isc_mempool_t *mpctx, unsigned int limit); -} isc_mempoolmethods_t; - -/*% - * This structure is actually just the common prefix of a memory context - * implementation's version of an isc_mem_t. - * \brief - * Direct use of this structure by clients is forbidden. mctx implementations - * may change the structure. 'magic' must be ISCAPI_MCTX_MAGIC for any of the - * isc_mem_ routines to work. mctx implementations must maintain all mctx - * invariants. - */ -struct isc_mem { - unsigned int impmagic; - unsigned int magic; - isc_memmethods_t *methods; -}; - -#define ISCAPI_MCTX_MAGIC ISC_MAGIC('A','m','c','x') -#define ISCAPI_MCTX_VALID(m) ((m) != NULL && \ - (m)->magic == ISCAPI_MCTX_MAGIC) - -/*% - * This is the common prefix of a memory pool context. The same note as - * that for the mem structure applies. - */ -struct isc_mempool { - unsigned int impmagic; - unsigned int magic; - isc_mempoolmethods_t *methods; -}; - -#define ISCAPI_MPOOL_MAGIC ISC_MAGIC('A','m','p','l') -#define ISCAPI_MPOOL_VALID(mp) ((mp) != NULL && \ - (mp)->magic == ISCAPI_MPOOL_MAGIC) - -#if ISC_MEM_DEBUG -#define isc_mem_put(c, p, s) \ - do { \ - ISCMEMFUNC(put)((c), (p), (s) _ISC_MEM_FILELINE); \ - (p) = NULL; \ - } while (0) -#define isc_mem_putanddetach(c, p, s) \ - do { \ - ISCMEMFUNC(putanddetach)((c), (p), (s) _ISC_MEM_FILELINE); \ - (p) = NULL; \ - } while (0) -#define isc_mem_free(c, p) \ - do { \ - ISCMEMFUNC(free)((c), (p) _ISC_MEM_FILELINE); \ - (p) = NULL; \ - } while (0) -#define isc_mempool_put(c, p) \ - do { \ - ISCMEMPOOLFUNC(put)((c), (p) _ISC_MEM_FILELINE); \ - (p) = NULL; \ - } while (0) -#else -#define isc_mem_put(c, p, s) ISCMEMFUNC(put)((c), (p), (s) _ISC_MEM_FILELINE) -#define isc_mem_putanddetach(c, p, s) \ - ISCMEMFUNC(putanddetach)((c), (p), (s) _ISC_MEM_FILELINE) -#define isc_mem_free(c, p) ISCMEMFUNC(free)((c), (p) _ISC_MEM_FILELINE) -#define isc_mempool_put(c, p) ISCMEMPOOLFUNC(put)((c), (p) _ISC_MEM_FILELINE) -#endif - -/*@{*/ -isc_result_t -isc_mem_create(size_t max_size, size_t target_size, - isc_mem_t **mctxp); - -isc_result_t -isc_mem_create2(size_t max_size, size_t target_size, - isc_mem_t **mctxp, unsigned int flags); - -isc_result_t -isc_mem_createx(size_t max_size, size_t target_size, - isc_memalloc_t memalloc, isc_memfree_t memfree, - void *arg, isc_mem_t **mctxp); - -isc_result_t -isc_mem_createx2(size_t max_size, size_t target_size, - isc_memalloc_t memalloc, isc_memfree_t memfree, - void *arg, isc_mem_t **mctxp, unsigned int flags); - -/*!< - * \brief Create a memory context. - * - * 'max_size' and 'target_size' are tuning parameters. When - * ISC_MEMFLAG_INTERNAL is set, allocations smaller than 'max_size' - * will be satisfied by getting blocks of size 'target_size' from the - * system allocator and breaking them up into pieces; larger allocations - * will use the system allocator directly. If 'max_size' and/or - * 'target_size' are zero, default values will be * used. When - * ISC_MEMFLAG_INTERNAL is not set, 'target_size' is ignored. - * - * 'max_size' is also used to size the statistics arrays and the array - * used to record active memory when ISC_MEM_DEBUGRECORD is set. Setting - * 'max_size' too low can have detrimental effects on performance. - * - * A memory context created using isc_mem_createx() will obtain - * memory from the system by calling 'memalloc' and 'memfree', - * passing them the argument 'arg'. A memory context created - * using isc_mem_create() will use the standard library malloc() - * and free(). - * - * If ISC_MEMFLAG_NOLOCK is set in 'flags', the corresponding memory context - * will be accessed without locking. The user who creates the context must - * ensure there be no race. Since this can be a source of bug, it is generally - * inadvisable to use this flag unless the user is very sure about the race - * condition and the access to the object is highly performance sensitive. - * - * Requires: - * mctxp != NULL && *mctxp == NULL */ -/*@}*/ - -/*@{*/ -void -isc_mem_attach(isc_mem_t *, isc_mem_t **); -void -isc_mem_detach(isc_mem_t **); -/*!< - * \brief Attach to / detach from a memory context. - * - * This is intended for applications that use multiple memory contexts - * in such a way that it is not obvious when the last allocations from - * a given context has been freed and destroying the context is safe. - * - * Most applications do not need to call these functions as they can - * simply create a single memory context at the beginning of main() - * and destroy it at the end of main(), thereby guaranteeing that it - * is not destroyed while there are outstanding allocations. - */ -/*@}*/ - -void -isc_mem_destroy(isc_mem_t **); -/*%< - * Destroy a memory context. - */ - -isc_result_t -isc_mem_ondestroy(isc_mem_t *ctx, - isc_task_t *task, - isc_event_t **event); -/*%< - * Request to be notified with an event when a memory context has - * been successfully destroyed. - */ - -void -isc_mem_stats(isc_mem_t *mctx, FILE *out); -/*%< - * Print memory usage statistics for 'mctx' on the stream 'out'. - */ - -void -isc_mem_setdestroycheck(isc_mem_t *mctx, - isc_boolean_t on); -/*%< - * If 'on' is ISC_TRUE, 'mctx' will check for memory leaks when - * destroyed and abort the program if any are present. - */ - -/*@{*/ -void -isc_mem_setquota(isc_mem_t *, size_t); -size_t -isc_mem_getquota(isc_mem_t *); -/*%< - * Set/get the memory quota of 'mctx'. This is a hard limit - * on the amount of memory that may be allocated from mctx; - * if it is exceeded, allocations will fail. - */ -/*@}*/ - -size_t -isc_mem_inuse(isc_mem_t *mctx); -/*%< - * Get an estimate of the number of memory in use in 'mctx', in bytes. - * This includes quantization overhead, but does not include memory - * allocated from the system but not yet used. - */ - -isc_boolean_t -isc_mem_isovermem(isc_mem_t *mctx); -/*%< - * Return true iff the memory context is in "over memory" state, i.e., - * a hiwater mark has been set and the used amount of memory has exceeds - * the mark. - */ - -void -isc_mem_setwater(isc_mem_t *mctx, isc_mem_water_t water, void *water_arg, - size_t hiwater, size_t lowater); -/*%< - * Set high and low water marks for this memory context. - * - * When the memory usage of 'mctx' exceeds 'hiwater', - * '(water)(water_arg, #ISC_MEM_HIWATER)' will be called. 'water' needs to - * call isc_mem_waterack() with #ISC_MEM_HIWATER to acknowledge the state - * change. 'water' may be called multiple times. - * - * When the usage drops below 'lowater', 'water' will again be called, this - * time with #ISC_MEM_LOWATER. 'water' need to calls isc_mem_waterack() with - * #ISC_MEM_LOWATER to acknowledge the change. - * - * static void - * water(void *arg, int mark) { - * struct foo *foo = arg; - * - * LOCK(&foo->marklock); - * if (foo->mark != mark) { - * foo->mark = mark; - * .... - * isc_mem_waterack(foo->mctx, mark); - * } - * UNLOCK(&foo->marklock); - * } - * - * If 'water' is NULL then 'water_arg', 'hi_water' and 'lo_water' are - * ignored and the state is reset. - * - * Requires: - * - * 'water' is not NULL. - * hi_water >= lo_water - */ - -void -isc_mem_waterack(isc_mem_t *ctx, int mark); -/*%< - * Called to acknowledge changes in signaled by calls to 'water'. - */ - -void -isc_mem_printactive(isc_mem_t *mctx, FILE *file); -/*%< - * Print to 'file' all active memory in 'mctx'. - * - * Requires ISC_MEM_DEBUGRECORD to have been set. - */ - -void -isc_mem_printallactive(FILE *file); -/*%< - * Print to 'file' all active memory in all contexts. - * - * Requires ISC_MEM_DEBUGRECORD to have been set. - */ - -void -isc_mem_checkdestroyed(FILE *file); -/*%< - * Check that all memory contexts have been destroyed. - * Prints out those that have not been. - * Fatally fails if there are still active contexts. - */ - -unsigned int -isc_mem_references(isc_mem_t *ctx); -/*%< - * Return the current reference count. - */ - -void -isc_mem_setname(isc_mem_t *ctx, const char *name, void *tag); -/*%< - * Name 'ctx'. - * - * Notes: - * - *\li Only the first 15 characters of 'name' will be copied. - * - *\li 'tag' is for debugging purposes only. - * - * Requires: - * - *\li 'ctx' is a valid ctx. - */ - -const char * -isc_mem_getname(isc_mem_t *ctx); -/*%< - * Get the name of 'ctx', as previously set using isc_mem_setname(). - * - * Requires: - *\li 'ctx' is a valid ctx. - * - * Returns: - *\li A non-NULL pointer to a null-terminated string. - * If the ctx has not been named, the string is - * empty. - */ - -void * -isc_mem_gettag(isc_mem_t *ctx); -/*%< - * Get the tag value for 'task', as previously set using isc_mem_setname(). - * - * Requires: - *\li 'ctx' is a valid ctx. - * - * Notes: - *\li This function is for debugging purposes only. - * - * Requires: - *\li 'ctx' is a valid task. - */ - -#ifdef HAVE_LIBXML2 -void -isc_mem_renderxml(xmlTextWriterPtr writer); -/*%< - * Render all contexts' statistics and status in XML for writer. - */ -#endif /* HAVE_LIBXML2 */ - -/* - * Memory pools - */ - -isc_result_t -isc_mempool_create(isc_mem_t *mctx, size_t size, isc_mempool_t **mpctxp); -/*%< - * Create a memory pool. - * - * Requires: - *\li mctx is a valid memory context. - *\li size > 0 - *\li mpctxp != NULL and *mpctxp == NULL - * - * Defaults: - *\li maxalloc = UINT_MAX - *\li freemax = 1 - *\li fillcount = 1 - * - * Returns: - *\li #ISC_R_NOMEMORY -- not enough memory to create pool - *\li #ISC_R_SUCCESS -- all is well. - */ - -void -isc_mempool_destroy(isc_mempool_t **mpctxp); -/*%< - * Destroy a memory pool. - * - * Requires: - *\li mpctxp != NULL && *mpctxp is a valid pool. - *\li The pool has no un"put" allocations outstanding - */ - -void -isc_mempool_setname(isc_mempool_t *mpctx, const char *name); -/*%< - * Associate a name with a memory pool. At most 15 characters may be used. - * - * Requires: - *\li mpctx is a valid pool. - *\li name != NULL; - */ - -void -isc_mempool_associatelock(isc_mempool_t *mpctx, isc_mutex_t *lock); -/*%< - * Associate a lock with this memory pool. - * - * This lock is used when getting or putting items using this memory pool, - * and it is also used to set or get internal state via the isc_mempool_get*() - * and isc_mempool_set*() set of functions. - * - * Multiple pools can each share a single lock. For instance, if "manager" - * type object contained pools for various sizes of events, and each of - * these pools used a common lock. Note that this lock must NEVER be used - * by other than mempool routines once it is given to a pool, since that can - * easily cause double locking. - * - * Requires: - * - *\li mpctpx is a valid pool. - * - *\li lock != NULL. - * - *\li No previous lock is assigned to this pool. - * - *\li The lock is initialized before calling this function via the normal - * means of doing that. - */ - -/* - * The following functions get/set various parameters. Note that due to - * the unlocked nature of pools these are potentially random values unless - * the imposed externally provided locking protocols are followed. - * - * Also note that the quota limits will not always take immediate effect. - * For instance, setting "maxalloc" to a number smaller than the currently - * allocated count is permitted. New allocations will be refused until - * the count drops below this threshold. - * - * All functions require (in addition to other requirements): - * mpctx is a valid memory pool - */ - -unsigned int -isc_mempool_getfreemax(isc_mempool_t *mpctx); -/*%< - * Returns the maximum allowed size of the free list. - */ - -void -isc_mempool_setfreemax(isc_mempool_t *mpctx, unsigned int limit); -/*%< - * Sets the maximum allowed size of the free list. - */ - -unsigned int -isc_mempool_getfreecount(isc_mempool_t *mpctx); -/*%< - * Returns current size of the free list. - */ - -unsigned int -isc_mempool_getmaxalloc(isc_mempool_t *mpctx); -/*!< - * Returns the maximum allowed number of allocations. - */ - -void -isc_mempool_setmaxalloc(isc_mempool_t *mpctx, unsigned int limit); -/*%< - * Sets the maximum allowed number of allocations. - * - * Additional requirements: - *\li limit > 0 - */ - -unsigned int -isc_mempool_getallocated(isc_mempool_t *mpctx); -/*%< - * Returns the number of items allocated from this pool. - */ - -unsigned int -isc_mempool_getfillcount(isc_mempool_t *mpctx); -/*%< - * Returns the number of items allocated as a block from the parent memory - * context when the free list is empty. - */ - -void -isc_mempool_setfillcount(isc_mempool_t *mpctx, unsigned int limit); -/*%< - * Sets the fillcount. - * - * Additional requirements: - *\li limit > 0 - */ - - -/* - * Pseudo-private functions for use via macros. Do not call directly. - */ -void * -ISCMEMFUNC(get)(isc_mem_t *, size_t _ISC_MEM_FLARG); -void -ISCMEMFUNC(putanddetach)(isc_mem_t **, void *, size_t _ISC_MEM_FLARG); -void -ISCMEMFUNC(put)(isc_mem_t *, void *, size_t _ISC_MEM_FLARG); -void * -ISCMEMFUNC(allocate)(isc_mem_t *, size_t _ISC_MEM_FLARG); -void * -ISCMEMFUNC(reallocate)(isc_mem_t *, void *, size_t _ISC_MEM_FLARG); -void -ISCMEMFUNC(free)(isc_mem_t *, void * _ISC_MEM_FLARG); -char * -ISCMEMFUNC(strdup)(isc_mem_t *, const char *_ISC_MEM_FLARG); -void * -ISCMEMPOOLFUNC(get)(isc_mempool_t * _ISC_MEM_FLARG); -void -ISCMEMPOOLFUNC(put)(isc_mempool_t *, void * _ISC_MEM_FLARG); - -#ifdef USE_MEMIMPREGISTER - -/*%< - * See isc_mem_create2() above. - */ -typedef isc_result_t -(*isc_memcreatefunc_t)(size_t init_max_size, size_t target_size, - isc_mem_t **ctxp, unsigned int flags); - -isc_result_t -isc_mem_register(isc_memcreatefunc_t createfunc); -/*%< - * Register a new memory management implementation and add it to the list of - * supported implementations. This function must be called when a different - * memory management library is used than the one contained in the ISC library. - */ - -isc_result_t -isc__mem_register(void); -/*%< - * A short cut function that specifies the memory management module in the ISC - * library for isc_mem_register(). An application that uses the ISC library - * usually do not have to care about this function: it would call - * isc_lib_register(), which internally calls this function. - */ -#endif /* USE_MEMIMPREGISTER */ - -ISC_LANG_ENDDECLS - -#endif /* ISC_MEM_H */ diff --git a/lib/isc/include/isc/mutexblock.h b/lib/isc/include/isc/mutexblock.h deleted file mode 100644 index 65bf2bf27f0b..000000000000 --- a/lib/isc/include/isc/mutexblock.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: mutexblock.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */ - -#ifndef ISC_MUTEXBLOCK_H -#define ISC_MUTEXBLOCK_H 1 - -/*! \file isc/mutexblock.h */ - -#include -#include -#include - -ISC_LANG_BEGINDECLS - -isc_result_t -isc_mutexblock_init(isc_mutex_t *block, unsigned int count); -/*%< - * Initialize a block of locks. If an error occurs all initialized locks - * will be destroyed, if possible. - * - * Requires: - * - *\li block != NULL - * - *\li count > 0 - * - * Returns: - * - *\li Any code isc_mutex_init() can return is a valid return for this - * function. - */ - -isc_result_t -isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count); -/*%< - * Destroy a block of locks. - * - * Requires: - * - *\li block != NULL - * - *\li count > 0 - * - *\li Each lock in the block be initialized via isc_mutex_init() or - * the whole block was initialized via isc_mutex_initblock(). - * - * Returns: - * - *\li Any code isc_mutex_init() can return is a valid return for this - * function. - */ - -ISC_LANG_ENDDECLS - -#endif /* ISC_MUTEXBLOCK_H */ diff --git a/lib/isc/include/isc/os.h b/lib/isc/include/isc/os.h deleted file mode 100644 index 3cf59e2cb642..000000000000 --- a/lib/isc/include/isc/os.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: os.h,v 1.12 2007/06/19 23:47:18 tbox Exp $ */ - -#ifndef ISC_OS_H -#define ISC_OS_H 1 - -/*! \file isc/os.h */ - -#include - -ISC_LANG_BEGINDECLS - -unsigned int -isc_os_ncpus(void); -/*%< - * Return the number of CPUs available on the system, or 1 if this cannot - * be determined. - */ - -ISC_LANG_ENDDECLS - -#endif /* ISC_OS_H */ diff --git a/lib/isc/include/isc/parseint.h b/lib/isc/include/isc/parseint.h deleted file mode 100644 index 5047676852bf..000000000000 --- a/lib/isc/include/isc/parseint.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2001, 2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: parseint.h,v 1.9 2007/06/19 23:47:18 tbox Exp $ */ - -#ifndef ISC_PARSEINT_H -#define ISC_PARSEINT_H 1 - -#include -#include - -/*! \file isc/parseint.h - * \brief Parse integers, in a saner way than atoi() or strtoul() do. - */ - -/*** - *** Functions - ***/ - -ISC_LANG_BEGINDECLS - -isc_result_t -isc_parse_uint32(isc_uint32_t *uip, const char *string, int base); - -isc_result_t -isc_parse_uint16(isc_uint16_t *uip, const char *string, int base); - -isc_result_t -isc_parse_uint8(isc_uint8_t *uip, const char *string, int base); -/*%< - * Parse the null-terminated string 'string' containing a base 'base' - * integer, storing the result in '*uip'. - * The base is interpreted - * as in strtoul(). Unlike strtoul(), leading whitespace, minus or - * plus signs are not accepted, and all errors (including overflow) - * are reported uniformly through the return value. - * - * Requires: - *\li 'string' points to a null-terminated string - *\li 0 <= 'base' <= 36 - * - * Returns: - *\li #ISC_R_SUCCESS - *\li #ISC_R_BADNUMBER The string is not numeric (in the given base) - *\li #ISC_R_RANGE The number is not representable as the requested type. - */ - -ISC_LANG_ENDDECLS - -#endif /* ISC_PARSEINT_H */ diff --git a/lib/isc/include/isc/platform.h.in b/lib/isc/include/isc/platform.h.in deleted file mode 100644 index 03c2710bac35..000000000000 --- a/lib/isc/include/isc/platform.h.in +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: platform.h.in,v 1.56 2010/12/18 01:56:23 each Exp $ */ - -#ifndef ISC_PLATFORM_H -#define ISC_PLATFORM_H 1 - -/*! \file */ - -/***** - ***** Platform-dependent defines. - *****/ - -/*** - *** Network. - ***/ - -/*! \brief - * Define if this system needs the header file included - * for full IPv6 support (pretty much only UnixWare). - */ -@ISC_PLATFORM_NEEDNETINETIN6H@ - -/*! \brief - * Define if this system needs the header file included - * to support in6_pkinfo (pretty much only BSD/OS). - */ -@ISC_PLATFORM_NEEDNETINET6IN6H@ - -/*! \brief - * If sockaddrs on this system have an sa_len field, ISC_PLATFORM_HAVESALEN - * will be defined. - */ -@ISC_PLATFORM_HAVESALEN@ - -/*! \brief - * If this system has the IPv6 structure definitions, ISC_PLATFORM_HAVEIPV6 - * will be defined. - */ -@ISC_PLATFORM_HAVEIPV6@ - -/*! \brief - * If this system is missing in6addr_any, ISC_PLATFORM_NEEDIN6ADDRANY will - * be defined. - */ -@ISC_PLATFORM_NEEDIN6ADDRANY@ - -/*! \brief - * If this system is missing in6addr_loopback, ISC_PLATFORM_NEEDIN6ADDRLOOPBACK - * will be defined. - */ -@ISC_PLATFORM_NEEDIN6ADDRLOOPBACK@ - -/*! \brief - * If this system has in6_pktinfo, ISC_PLATFORM_HAVEIN6PKTINFO will be - * defined. - */ -@ISC_PLATFORM_HAVEIN6PKTINFO@ - -/*! \brief - * If this system has in_addr6, rather than in6_addr, ISC_PLATFORM_HAVEINADDR6 - * will be defined. - */ -@ISC_PLATFORM_HAVEINADDR6@ - -/*! \brief - * If this system has sin6_scope_id, ISC_PLATFORM_HAVESCOPEID will be defined. - */ -@ISC_PLATFORM_HAVESCOPEID@ - -/*! \brief - * If this system needs inet_ntop(), ISC_PLATFORM_NEEDNTOP will be defined. - */ -@ISC_PLATFORM_NEEDNTOP@ - -/*! \brief - * If this system needs inet_pton(), ISC_PLATFORM_NEEDPTON will be defined. - */ -@ISC_PLATFORM_NEEDPTON@ - -/*! \brief - * If this system needs in_port_t, ISC_PLATFORM_NEEDPORTT will be defined. - */ -@ISC_PLATFORM_NEEDPORTT@ - -/*! \brief - * Define if the system has struct lifconf which is a extended struct ifconf - * for IPv6. - */ -@ISC_PLATFORM_HAVELIFCONF@ - -/*! \brief - * Define if the system has struct if_laddrconf which is a extended struct - * ifconf for IPv6. - */ -@ISC_PLATFORM_HAVEIF_LADDRCONF@ - -/*! \brief - * Define if the system has struct if_laddrreq. - */ -@ISC_PLATFORM_HAVEIF_LADDRREQ@ - -/*! \brief - * Define either ISC_PLATFORM_BSD44MSGHDR or ISC_PLATFORM_BSD43MSGHDR. - */ -@ISC_PLATFORM_MSGHDRFLAVOR@ - -/*! \brief - * Define if the system supports if_nametoindex. - */ -@ISC_PLATFORM_HAVEIFNAMETOINDEX@ - -/*! \brief - * Define on some UnixWare systems to fix erroneous definitions of various - * IN6_IS_ADDR_* macros. - */ -@ISC_PLATFORM_FIXIN6ISADDR@ - -/*! \brief - * Define if the system supports kqueue multiplexing - */ -@ISC_PLATFORM_HAVEKQUEUE@ - -/*! \brief - * Define if the system supports epoll multiplexing - */ -@ISC_PLATFORM_HAVEEPOLL@ - -/*! \brief - * Define if the system supports /dev/poll multiplexing - */ -@ISC_PLATFORM_HAVEDEVPOLL@ - -/*! \brief - * Define if we want to log backtrace - */ -@ISC_PLATFORM_USEBACKTRACE@ - -/* - *** Printing. - ***/ - -/*! \brief - * If this system needs vsnprintf() and snprintf(), ISC_PLATFORM_NEEDVSNPRINTF - * will be defined. - */ -@ISC_PLATFORM_NEEDVSNPRINTF@ - -/*! \brief - * If this system need a modern sprintf() that returns (int) not (char*). - */ -@ISC_PLATFORM_NEEDSPRINTF@ - -/*! \brief - * The printf format string modifier to use with isc_uint64_t values. - */ -@ISC_PLATFORM_QUADFORMAT@ - -/*** - *** String functions. - ***/ -/* - * If the system needs strsep(), ISC_PLATFORM_NEEDSTRSEP will be defined. - */ -@ISC_PLATFORM_NEEDSTRSEP@ - -/* - * If the system needs strlcpy(), ISC_PLATFORM_NEEDSTRLCPY will be defined. - */ -@ISC_PLATFORM_NEEDSTRLCPY@ - -/* - * If the system needs strlcat(), ISC_PLATFORM_NEEDSTRLCAT will be defined. - */ -@ISC_PLATFORM_NEEDSTRLCAT@ - -/* - * Define if this system needs strtoul. - */ -@ISC_PLATFORM_NEEDSTRTOUL@ - -/* - * Define if this system needs memmove. - */ -@ISC_PLATFORM_NEEDMEMMOVE@ - -/*** - *** Miscellaneous. - ***/ - -/* - * Defined if we are using threads. - */ -@ISC_PLATFORM_USETHREADS@ - -/* - * Defined if unistd.h does not cause fd_set to be delared. - */ -@ISC_PLATFORM_NEEDSYSSELECTH@ - -/* - * Defined to or for how to include - * the GSSAPI header. - */ -@ISC_PLATFORM_GSSAPIHEADER@ - -/* - * Defined to or for how to - * include the GSSAPI KRB5 header. - */ -@ISC_PLATFORM_GSSAPI_KRB5_HEADER@ - -/* - * Defined to or for how to include - * the KRB5 header. - */ -@ISC_PLATFORM_KRB5HEADER@ - -/* - * Type used for resource limits. - */ -@ISC_PLATFORM_RLIMITTYPE@ - -/* - * Define if your compiler supports "long long int". - */ -@ISC_PLATFORM_HAVELONGLONG@ - -/* - * Define if PTHREAD_ONCE_INIT should be surrounded by braces to - * prevent compiler warnings (such as with gcc on Solaris 2.8). - */ -@ISC_PLATFORM_BRACEPTHREADONCEINIT@ - -/* - * Used to control how extern data is linked; needed for Win32 platforms. - */ -@ISC_PLATFORM_USEDECLSPEC@ - -/* - * Define if the platform has . - */ -@ISC_PLATFORM_HAVESYSUNH@ - -/* - * If the "xadd" operation is available on this architecture, - * ISC_PLATFORM_HAVEXADD will be defined. - */ -@ISC_PLATFORM_HAVEXADD@ - -/* - * If the "xaddq" operation (64bit xadd) is available on this architecture, - * ISC_PLATFORM_HAVEXADDQ will be defined. - */ -@ISC_PLATFORM_HAVEXADDQ@ - -/* - * If the "atomic swap" operation is available on this architecture, - * ISC_PLATFORM_HAVEATOMICSTORE" will be defined. - */ -@ISC_PLATFORM_HAVEATOMICSTORE@ - -/* - * If the "compare-and-exchange" operation is available on this architecture, - * ISC_PLATFORM_HAVECMPXCHG will be defined. - */ -@ISC_PLATFORM_HAVECMPXCHG@ - -/* - * Define if gcc ASM extension is available - */ -@ISC_PLATFORM_USEGCCASM@ - -/* - * Define if Tru64 style ASM syntax must be used. - */ -@ISC_PLATFORM_USEOSFASM@ - -/* - * Define if the standard __asm function must be used. - */ -@ISC_PLATFORM_USESTDASM@ - -/* - * Define if the platform has . - */ -@ISC_PLATFORM_HAVESTRINGSH@ - -/* - * Define if the hash functions must be provided by OpenSSL. - */ -@ISC_PLATFORM_OPENSSLHASH@ - -/* - * Defines for the noreturn attribute. - */ -@ISC_PLATFORM_NORETURN_PRE@ -@ISC_PLATFORM_NORETURN_POST@ - -/*** - *** Windows dll support. - ***/ - -/* - * Define if MacOS style of PPC assembly must be used. - * e.g. "r6", not "6", for register six. - */ -@ISC_PLATFORM_USEMACASM@ - -#ifndef ISC_PLATFORM_USEDECLSPEC -#define LIBISC_EXTERNAL_DATA -#define LIBDNS_EXTERNAL_DATA -#define LIBISCCC_EXTERNAL_DATA -#define LIBISCCFG_EXTERNAL_DATA -#define LIBBIND9_EXTERNAL_DATA -#else /*! \brief ISC_PLATFORM_USEDECLSPEC */ -#ifdef LIBISC_EXPORTS -#define LIBISC_EXTERNAL_DATA __declspec(dllexport) -#else -#define LIBISC_EXTERNAL_DATA __declspec(dllimport) -#endif -#ifdef LIBDNS_EXPORTS -#define LIBDNS_EXTERNAL_DATA __declspec(dllexport) -#else -#define LIBDNS_EXTERNAL_DATA __declspec(dllimport) -#endif -#ifdef LIBISCCC_EXPORTS -#define LIBISCCC_EXTERNAL_DATA __declspec(dllexport) -#else -#define LIBISCCC_EXTERNAL_DATA __declspec(dllimport) -#endif -#ifdef LIBISCCFG_EXPORTS -#define LIBISCCFG_EXTERNAL_DATA __declspec(dllexport) -#else -#define LIBISCCFG_EXTERNAL_DATA __declspec(dllimport) -#endif -#ifdef LIBBIND9_EXPORTS -#define LIBBIND9_EXTERNAL_DATA __declspec(dllexport) -#else -#define LIBBIND9_EXTERNAL_DATA __declspec(dllimport) -#endif -#endif /*! \brief ISC_PLATFORM_USEDECLSPEC */ - -/* - * Tell emacs to use C mode for this file. - * - * Local Variables: - * mode: c - * End: - */ - -#endif /* ISC_PLATFORM_H */ diff --git a/lib/isc/include/isc/portset.h b/lib/isc/include/isc/portset.h deleted file mode 100644 index 774d6bb18cbd..000000000000 --- a/lib/isc/include/isc/portset.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (C) 2008, 2009 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: portset.h,v 1.6 2009/06/25 05:28:34 marka Exp $ */ - -/*! \file isc/portset.h - * \brief Transport Protocol Port Manipulation Module - * - * This module provides simple utilities to handle a set of transport protocol - * (UDP or TCP) port numbers, e.g., for creating an ACL list. An isc_portset_t - * object is an opaque instance of a port set, for which the user can add or - * remove a specific port or a range of consecutive ports. This object is - * expected to be used as a temporary work space only, and does not protect - * simultaneous access from multiple threads. Therefore it must not be stored - * in a place that can be accessed from multiple threads. - */ - -#ifndef ISC_PORTSET_H -#define ISC_PORTSET_H 1 - -/*** - *** Imports - ***/ - -#include - -/*** - *** Functions - ***/ - -ISC_LANG_BEGINDECLS - -isc_result_t -isc_portset_create(isc_mem_t *mctx, isc_portset_t **portsetp); -/*%< - * Create a port set and initialize it as an empty set. - * - * Requires: - *\li 'mctx' to be valid. - *\li 'portsetp' to be non NULL and '*portsetp' to be NULL; - * - * Returns: - *\li #ISC_R_SUCCESS - *\li #ISC_R_NOMEMORY - */ - -void -isc_portset_destroy(isc_mem_t *mctx, isc_portset_t **portsetp); -/*%< - * Destroy a port set. - * - * Requires: - *\li 'mctx' to be valid and must be the same context given when the port set - * was created. - *\li '*portsetp' to be a valid set. - */ - -isc_boolean_t -isc_portset_isset(isc_portset_t *portset, in_port_t port); -/*%< - * Test whether the given port is stored in the portset. - * - * Requires: - *\li 'portset' to be a valid set. - * - * Returns - * \li #ISC_TRUE if the port is found, ISC_FALSE otherwise. - */ - -unsigned int -isc_portset_nports(isc_portset_t *portset); -/*%< - * Provides the number of ports stored in the given portset. - * - * Requires: - *\li 'portset' to be a valid set. - * - * Returns - * \li the number of ports stored in portset. - */ - -void -isc_portset_add(isc_portset_t *portset, in_port_t port); -/*%< - * Add the given port to the portset. The port may or may not be stored in - * the portset. - * - * Requires: - *\li 'portlist' to be valid. - */ - -void -isc_portset_remove(isc_portset_t *portset, in_port_t port); -/*%< - * Remove the given port to the portset. The port may or may not be stored in - * the portset. - * - * Requires: - *\li 'portlist' to be valid. - */ - -void -isc_portset_addrange(isc_portset_t *portset, in_port_t port_lo, - in_port_t port_hi); -/*%< - * Add a subset of [port_lo, port_hi] (inclusive) to the portset. Ports in the - * subset may or may not be stored in portset. - * - * Requires: - *\li 'portlist' to be valid. - *\li port_lo <= port_hi - */ - -void -isc_portset_removerange(isc_portset_t *portset, in_port_t port_lo, - in_port_t port_hi); -/*%< - * Subtract a subset of [port_lo, port_hi] (inclusive) from the portset. Ports - * in the subset may or may not be stored in portset. - * - * Requires: - *\li 'portlist' to be valid. - *\li port_lo <= port_hi - */ - -ISC_LANG_ENDDECLS - -#endif /* ISC_PORTSET_H */ diff --git a/lib/isc/include/isc/queue.h b/lib/isc/include/isc/queue.h deleted file mode 100644 index 5bf84c527c13..000000000000 --- a/lib/isc/include/isc/queue.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/* - * This is a generic implementation of a two-lock concurrent queue. - * There are built-in mutex locks for the head and tail of the queue, - * allowing elements to be safely added and removed at the same time. - */ - -#ifndef ISC_QUEUE_H -#define ISC_QUEUE_H 1 -#include -#include -#include - -#ifdef ISC_QUEUE_CHECKINIT -#define ISC_QLINK_INSIST(x) ISC_INSIST(x) -#else -#define ISC_QLINK_INSIST(x) (void)0 -#endif - -#define ISC_QLINK(type) struct { void *next; isc_boolean_t linked; } -#define ISC_QLINK_INIT(elt, link) \ - do { \ - (elt)->link.next = (void *)(-1); \ - (elt)->link.linked = ISC_FALSE; \ - } while (0) -#define ISC_QLINK_LINKED(elt, link) ((elt)->link.linked) - -#define ISC_QUEUE(type) struct { \ - type headnode; \ - type *head, *tail; \ - isc_mutex_t headlock, taillock; \ -} - -#define ISC_QUEUE_INIT(queue, link) \ - do { \ - isc_mutex_init(&(queue).headlock); \ - isc_mutex_init(&(queue).taillock); \ - (queue).head = (void *) &((queue).headnode); \ - (queue).tail = (void *) &((queue).headnode); \ - ISC_QLINK_INIT((queue).head, link); \ - } while (0) - -#define ISC_QUEUE_EMPTY(queue) ISC_TF((queue).head == (queue).tail) - -#define ISC_QUEUE_DESTROY(queue) \ - do { \ - ISC_QLINK_INSIST(ISC_QUEUE_EMPTY(queue)); \ - isc_mutex_destroy(&(queue).headlock); \ - isc_mutex_destroy(&(queue).taillock); \ - } while (0) - -#define ISC_QUEUE_PUSH(queue, elt, link) \ - do { \ - ISC_QLINK_INSIST(!ISC_QLINK_LINKED(elt, link)); \ - (elt)->link.next = (void *)(-1); \ - LOCK(&(queue).taillock); \ - (queue).tail->link.next = elt; \ - (queue).tail = elt; \ - UNLOCK(&(queue).taillock); \ - (elt)->link.linked = ISC_TRUE; \ - } while (0) - -#define ISC_QUEUE_POP(queue, link, ret) \ - do { \ - LOCK(&(queue).headlock); \ - ret = (queue).head->link.next; \ - if (ret == (void *)(-1)) { \ - UNLOCK(&(queue).headlock); \ - ret = NULL; \ - } else { \ - (queue).head->link.next = ret->link.next; \ - if (ret->link.next == (void *)(-1)) { \ - LOCK(&(queue).taillock); \ - (queue).tail = (queue).head; \ - UNLOCK(&(queue).taillock); \ - } \ - UNLOCK(&(queue).headlock); \ - ret->link.next = (void *)(-1); \ - ret->link.linked = ISC_FALSE; \ - } \ - } while (0) - -#endif /* ISC_QUEUE_H */ diff --git a/lib/isc/include/isc/quota.h b/lib/isc/include/isc/quota.h deleted file mode 100644 index 7b0d0d9beb84..000000000000 --- a/lib/isc/include/isc/quota.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: quota.h,v 1.16 2007/06/19 23:47:18 tbox Exp $ */ - -#ifndef ISC_QUOTA_H -#define ISC_QUOTA_H 1 - -/***** - ***** Module Info - *****/ - -/*! \file isc/quota.h - * - * \brief The isc_quota_t object is a simple helper object for implementing - * quotas on things like the number of simultaneous connections to - * a server. It keeps track of the amount of quota in use, and - * encapsulates the locking necessary to allow multiple tasks to - * share a quota. - */ - -/*** - *** Imports. - ***/ - -#include -#include -#include - -/***** - ***** Types. - *****/ - -ISC_LANG_BEGINDECLS - -/*% isc_quota structure */ -struct isc_quota { - isc_mutex_t lock; /*%< Locked by lock. */ - int max; - int used; - int soft; -}; - -isc_result_t -isc_quota_init(isc_quota_t *quota, int max); -/*%< - * Initialize a quota object. - * - * Returns: - * ISC_R_SUCCESS - * Other error Lock creation failed. - */ - -void -isc_quota_destroy(isc_quota_t *quota); -/*%< - * Destroy a quota object. - */ - -void -isc_quota_soft(isc_quota_t *quota, int soft); -/*%< - * Set a soft quota. - */ - -void -isc_quota_max(isc_quota_t *quota, int max); -/*%< - * Re-set a maximum quota. - */ - -isc_result_t -isc_quota_reserve(isc_quota_t *quota); -/*%< - * Attempt to reserve one unit of 'quota'. - * - * Returns: - * \li #ISC_R_SUCCESS Success - * \li #ISC_R_SOFTQUOTA Success soft quota reached - * \li #ISC_R_QUOTA Quota is full - */ - -void -isc_quota_release(isc_quota_t *quota); -/*%< - * Release one unit of quota. - */ - -isc_result_t -isc_quota_attach(isc_quota_t *quota, isc_quota_t **p); -/*%< - * Like isc_quota_reserve, and also attaches '*p' to the - * quota if successful (ISC_R_SUCCESS or ISC_R_SOFTQUOTA). - */ - -void -isc_quota_detach(isc_quota_t **p); -/*%< - * Like isc_quota_release, and also detaches '*p' from the - * quota. - */ - -ISC_LANG_ENDDECLS - -#endif /* ISC_QUOTA_H */ diff --git a/lib/isc/include/isc/radix.h b/lib/isc/include/isc/radix.h deleted file mode 100644 index 6b413a23b909..000000000000 --- a/lib/isc/include/isc/radix.h +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Copyright (C) 2007, 2008 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: radix.h,v 1.13 2008/12/01 23:47:45 tbox Exp $ */ - -/* - * This source was adapted from MRT's RCS Ids: - * Id: radix.h,v 1.6 1999/08/03 03:32:53 masaki Exp - * Id: mrt.h,v 1.57.2.6 1999/12/28 23:41:27 labovit Exp - * Id: defs.h,v 1.5.2.2 2000/01/15 14:19:16 masaki Exp - */ - -#include -#include -#include -#include -#include - -#include - -#ifndef _RADIX_H -#define _RADIX_H - -#define NETADDR_TO_PREFIX_T(na,pt,bits) \ - do { \ - memset(&(pt), 0, sizeof(pt)); \ - if((na) != NULL) { \ - (pt).family = (na)->family; \ - (pt).bitlen = (bits); \ - if ((pt).family == AF_INET6) { \ - memcpy(&(pt).add.sin6, &(na)->type.in6, \ - ((bits)+7)/8); \ - } else \ - memcpy(&(pt).add.sin, &(na)->type.in, \ - ((bits)+7)/8); \ - } else { \ - (pt).family = AF_UNSPEC; \ - (pt).bitlen = 0; \ - } \ - isc_refcount_init(&(pt).refcount, 0); \ - } while(0) - -typedef struct isc_prefix { - unsigned int family; /* AF_INET | AF_INET6, or AF_UNSPEC for "any" */ - unsigned int bitlen; /* 0 for "any" */ - isc_refcount_t refcount; - union { - struct in_addr sin; - struct in6_addr sin6; - } add; -} isc_prefix_t; - -typedef void (*isc_radix_destroyfunc_t)(void *); -typedef void (*isc_radix_processfunc_t)(isc_prefix_t *, void **); - -#define isc_prefix_tochar(prefix) ((char *)&(prefix)->add.sin) -#define isc_prefix_touchar(prefix) ((u_char *)&(prefix)->add.sin) - -#define BIT_TEST(f, b) ((f) & (b)) - -/* - * We need "first match" when we search the radix tree to preserve - * compatibility with the existing ACL implementation. Radix trees - * naturally lend themselves to "best match". In order to get "first match" - * behavior, we keep track of the order in which entries are added to the - * tree--and when a search is made, we find all matching entries, and - * return the one that was added first. - * - * An IPv4 prefix and an IPv6 prefix may share a radix tree node if they - * have the same length and bit pattern (e.g., 127/8 and 7f::/8). To - * disambiguate between them, node_num and data are two-element arrays; - * node_num[0] and data[0] are used for IPv4 addresses, node_num[1] - * and data[1] for IPv6 addresses. The only exception is a prefix of - * 0/0 (aka "any" or "none"), which is always stored as IPv4 but matches - * IPv6 addresses too. - */ - -#define ISC_IS6(family) ((family) == AF_INET6 ? 1 : 0) -typedef struct isc_radix_node { - isc_uint32_t bit; /* bit length of the prefix */ - isc_prefix_t *prefix; /* who we are in radix tree */ - struct isc_radix_node *l, *r; /* left and right children */ - struct isc_radix_node *parent; /* may be used */ - void *data[2]; /* pointers to IPv4 and IPV6 data */ - int node_num[2]; /* which node this was in the tree, - or -1 for glue nodes */ -} isc_radix_node_t; - -#define RADIX_TREE_MAGIC ISC_MAGIC('R','d','x','T'); -#define RADIX_TREE_VALID(a) ISC_MAGIC_VALID(a, RADIX_TREE_MAGIC); - -typedef struct isc_radix_tree { - unsigned int magic; - isc_mem_t *mctx; - isc_radix_node_t *head; - isc_uint32_t maxbits; /* for IP, 32 bit addresses */ - int num_active_node; /* for debugging purposes */ - int num_added_node; /* total number of nodes */ -} isc_radix_tree_t; - -isc_result_t -isc_radix_search(isc_radix_tree_t *radix, isc_radix_node_t **target, - isc_prefix_t *prefix); -/*%< - * Search 'radix' for the best match to 'prefix'. - * Return the node found in '*target'. - * - * Requires: - * \li 'radix' to be valid. - * \li 'target' is not NULL and "*target" is NULL. - * \li 'prefix' to be valid. - * - * Returns: - * \li ISC_R_NOTFOUND - * \li ISC_R_SUCCESS - */ - -isc_result_t -isc_radix_insert(isc_radix_tree_t *radix, isc_radix_node_t **target, - isc_radix_node_t *source, isc_prefix_t *prefix); -/*%< - * Insert 'source' or 'prefix' into the radix tree 'radix'. - * Return the node added in 'target'. - * - * Requires: - * \li 'radix' to be valid. - * \li 'target' is not NULL and "*target" is NULL. - * \li 'prefix' to be valid or 'source' to be non NULL and contain - * a valid prefix. - * - * Returns: - * \li ISC_R_NOMEMORY - * \li ISC_R_SUCCESS - */ - -void -isc_radix_remove(isc_radix_tree_t *radix, isc_radix_node_t *node); -/*%< - * Remove the node 'node' from the radix tree 'radix'. - * - * Requires: - * \li 'radix' to be valid. - * \li 'node' to be valid. - */ - -isc_result_t -isc_radix_create(isc_mem_t *mctx, isc_radix_tree_t **target, int maxbits); -/*%< - * Create a radix tree with a maximum depth of 'maxbits'; - * - * Requires: - * \li 'mctx' to be valid. - * \li 'target' to be non NULL and '*target' to be NULL. - * \li 'maxbits' to be less than or equal to RADIX_MAXBITS. - * - * Returns: - * \li ISC_R_NOMEMORY - * \li ISC_R_SUCCESS - */ - -void -isc_radix_destroy(isc_radix_tree_t *radix, isc_radix_destroyfunc_t func); -/*%< - * Destroy a radix tree optionally calling 'func' to clean up node data. - * - * Requires: - * \li 'radix' to be valid. - */ - -void -isc_radix_process(isc_radix_tree_t *radix, isc_radix_processfunc_t func); -/*%< - * Walk a radix tree calling 'func' to process node data. - * - * Requires: - * \li 'radix' to be valid. - * \li 'func' to point to a function. - */ - -#define RADIX_MAXBITS 128 -#define RADIX_NBIT(x) (0x80 >> ((x) & 0x7f)) -#define RADIX_NBYTE(x) ((x) >> 3) - -#define RADIX_DATA_GET(node, type) (type *)((node)->data) -#define RADIX_DATA_SET(node, value) ((node)->data = (void *)(value)) - -#define RADIX_WALK(Xhead, Xnode) \ - do { \ - isc_radix_node_t *Xstack[RADIX_MAXBITS+1]; \ - isc_radix_node_t **Xsp = Xstack; \ - isc_radix_node_t *Xrn = (Xhead); \ - while ((Xnode = Xrn)) { \ - if (Xnode->prefix) - -#define RADIX_WALK_ALL(Xhead, Xnode) \ -do { \ - isc_radix_node_t *Xstack[RADIX_MAXBITS+1]; \ - isc_radix_node_t **Xsp = Xstack; \ - isc_radix_node_t *Xrn = (Xhead); \ - while ((Xnode = Xrn)) { \ - if (1) - -#define RADIX_WALK_BREAK { \ - if (Xsp != Xstack) { \ - Xrn = *(--Xsp); \ - } else { \ - Xrn = (radix_node_t *) 0; \ - } \ - continue; } - -#define RADIX_WALK_END \ - if (Xrn->l) { \ - if (Xrn->r) { \ - *Xsp++ = Xrn->r; \ - } \ - Xrn = Xrn->l; \ - } else if (Xrn->r) { \ - Xrn = Xrn->r; \ - } else if (Xsp != Xstack) { \ - Xrn = *(--Xsp); \ - } else { \ - Xrn = (isc_radix_node_t *) 0; \ - } \ - } \ - } while (0) - -#endif /* _RADIX_H */ diff --git a/lib/isc/include/isc/ratelimiter.h b/lib/isc/include/isc/ratelimiter.h deleted file mode 100644 index 00a7209758bb..000000000000 --- a/lib/isc/include/isc/ratelimiter.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: ratelimiter.h,v 1.23 2009/01/18 23:48:14 tbox Exp $ */ - -#ifndef ISC_RATELIMITER_H -#define ISC_RATELIMITER_H 1 - -/***** - ***** Module Info - *****/ - -/*! \file isc/ratelimiter.h - * \brief A rate limiter is a mechanism for dispatching events at a limited - * rate. This is intended to be used when sending zone maintenance - * SOA queries, NOTIFY messages, etc. - */ - -/*** - *** Imports. - ***/ - -#include -#include - -ISC_LANG_BEGINDECLS - -/***** - ***** Functions. - *****/ - -isc_result_t -isc_ratelimiter_create(isc_mem_t *mctx, isc_timermgr_t *timermgr, - isc_task_t *task, isc_ratelimiter_t **ratelimiterp); -/*%< - * Create a rate limiter. The execution interval is initially undefined. - */ - -isc_result_t -isc_ratelimiter_setinterval(isc_ratelimiter_t *rl, isc_interval_t *interval); -/*!< - * Set the minimum interval between event executions. - * The interval value is copied, so the caller need not preserve it. - * - * Requires: - * '*interval' is a nonzero interval. - */ - -void -isc_ratelimiter_setpertic(isc_ratelimiter_t *rl, isc_uint32_t perint); -/*%< - * Set the number of events processed per interval timer tick. - * If 'perint' is zero it is treated as 1. - */ - -isc_result_t -isc_ratelimiter_enqueue(isc_ratelimiter_t *rl, isc_task_t *task, - isc_event_t **eventp); -/*%< - * Queue an event for rate-limited execution. - * - * This is similar - * to doing an isc_task_send() to the 'task', except that the - * execution may be delayed to achieve the desired rate of - * execution. - * - * '(*eventp)->ev_sender' is used to hold the task. The caller - * must ensure that the task exists until the event is delivered. - * - * Requires: - *\li An interval has been set by calling - * isc_ratelimiter_setinterval(). - * - *\li 'task' to be non NULL. - *\li '(*eventp)->ev_sender' to be NULL. - */ - -void -isc_ratelimiter_shutdown(isc_ratelimiter_t *ratelimiter); -/*%< - * Shut down a rate limiter. - * - * Ensures: - *\li All events that have not yet been - * dispatched to the task are dispatched immediately with - * the #ISC_EVENTATTR_CANCELED bit set in ev_attributes. - * - *\li Further attempts to enqueue events will fail with - * #ISC_R_SHUTTINGDOWN. - * - *\li The rate limiter is no longer attached to its task. - */ - -void -isc_ratelimiter_attach(isc_ratelimiter_t *source, isc_ratelimiter_t **target); -/*%< - * Attach to a rate limiter. - */ - -void -isc_ratelimiter_detach(isc_ratelimiter_t **ratelimiterp); -/*%< - * Detach from a rate limiter. - */ - -isc_result_t -isc_ratelimiter_stall(isc_ratelimiter_t *rl); -/*%< - * Stall event processing. - */ - -isc_result_t -isc_ratelimiter_release(isc_ratelimiter_t *rl); -/*%< - * Release a stalled rate limiter. - */ - -ISC_LANG_ENDDECLS - -#endif /* ISC_RATELIMITER_H */ diff --git a/lib/isc/include/isc/refcount.h b/lib/isc/include/isc/refcount.h deleted file mode 100644 index b72b1585be39..000000000000 --- a/lib/isc/include/isc/refcount.h +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2001, 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: refcount.h,v 1.17 2009/09/29 23:48:04 tbox Exp $ */ - -#ifndef ISC_REFCOUNT_H -#define ISC_REFCOUNT_H 1 - -#include -#include -#include -#include -#include -#include - -/*! \file isc/refcount.h - * \brief Implements a locked reference counter. - * - * These functions may actually be - * implemented using macros, and implementations of these macros are below. - * The isc_refcount_t type should not be accessed directly, as its contents - * depend on the implementation. - */ - -ISC_LANG_BEGINDECLS - -/* - * Function prototypes - */ - -/* - * isc_result_t - * isc_refcount_init(isc_refcount_t *ref, unsigned int n); - * - * Initialize the reference counter. There will be 'n' initial references. - * - * Requires: - * ref != NULL - */ - -/* - * void - * isc_refcount_destroy(isc_refcount_t *ref); - * - * Destroys a reference counter. - * - * Requires: - * ref != NULL - * The number of references is 0. - */ - -/* - * void - * isc_refcount_increment(isc_refcount_t *ref, unsigned int *targetp); - * isc_refcount_increment0(isc_refcount_t *ref, unsigned int *targetp); - * - * Increments the reference count, returning the new value in targetp if it's - * not NULL. The reference counter typically begins with the initial counter - * of 1, and will be destroyed once the counter reaches 0. Thus, - * isc_refcount_increment() additionally requires the previous counter be - * larger than 0 so that an error which violates the usage can be easily - * caught. isc_refcount_increment0() does not have this restriction. - * - * Requires: - * ref != NULL. - */ - -/* - * void - * isc_refcount_decrement(isc_refcount_t *ref, unsigned int *targetp); - * - * Decrements the reference count, returning the new value in targetp if it's - * not NULL. - * - * Requires: - * ref != NULL. - */ - - -/* - * Sample implementations - */ -#ifdef ISC_PLATFORM_USETHREADS -#ifdef ISC_PLATFORM_HAVEXADD - -#define ISC_REFCOUNT_HAVEATOMIC 1 - -typedef struct isc_refcount { - isc_int32_t refs; -} isc_refcount_t; - -#define isc_refcount_destroy(rp) REQUIRE((rp)->refs == 0) -#define isc_refcount_current(rp) ((unsigned int)((rp)->refs)) - -#define isc_refcount_increment0(rp, tp) \ - do { \ - unsigned int *_tmp = (unsigned int *)(tp); \ - isc_int32_t prev; \ - prev = isc_atomic_xadd(&(rp)->refs, 1); \ - if (_tmp != NULL) \ - *_tmp = prev + 1; \ - } while (0) - -#define isc_refcount_increment(rp, tp) \ - do { \ - unsigned int *_tmp = (unsigned int *)(tp); \ - isc_int32_t prev; \ - prev = isc_atomic_xadd(&(rp)->refs, 1); \ - REQUIRE(prev > 0); \ - if (_tmp != NULL) \ - *_tmp = prev + 1; \ - } while (0) - -#define isc_refcount_decrement(rp, tp) \ - do { \ - unsigned int *_tmp = (unsigned int *)(tp); \ - isc_int32_t prev; \ - prev = isc_atomic_xadd(&(rp)->refs, -1); \ - REQUIRE(prev > 0); \ - if (_tmp != NULL) \ - *_tmp = prev - 1; \ - } while (0) - -#else /* ISC_PLATFORM_HAVEXADD */ - -typedef struct isc_refcount { - int refs; - isc_mutex_t lock; -} isc_refcount_t; - -/*% Destroys a reference counter. */ -#define isc_refcount_destroy(rp) \ - do { \ - REQUIRE((rp)->refs == 0); \ - DESTROYLOCK(&(rp)->lock); \ - } while (0) - -#define isc_refcount_current(rp) ((unsigned int)((rp)->refs)) - -/*% Increments the reference count, returning the new value in targetp if it's not NULL. */ -#define isc_refcount_increment0(rp, tp) \ - do { \ - unsigned int *_tmp = (unsigned int *)(tp); \ - LOCK(&(rp)->lock); \ - ++((rp)->refs); \ - if (_tmp != NULL) \ - *_tmp = ((rp)->refs); \ - UNLOCK(&(rp)->lock); \ - } while (0) - -#define isc_refcount_increment(rp, tp) \ - do { \ - unsigned int *_tmp = (unsigned int *)(tp); \ - LOCK(&(rp)->lock); \ - REQUIRE((rp)->refs > 0); \ - ++((rp)->refs); \ - if (_tmp != NULL) \ - *_tmp = ((rp)->refs); \ - UNLOCK(&(rp)->lock); \ - } while (0) - -/*% Decrements the reference count, returning the new value in targetp if it's not NULL. */ -#define isc_refcount_decrement(rp, tp) \ - do { \ - unsigned int *_tmp = (unsigned int *)(tp); \ - LOCK(&(rp)->lock); \ - REQUIRE((rp)->refs > 0); \ - --((rp)->refs); \ - if (_tmp != NULL) \ - *_tmp = ((rp)->refs); \ - UNLOCK(&(rp)->lock); \ - } while (0) - -#endif /* ISC_PLATFORM_HAVEXADD */ -#else /* ISC_PLATFORM_USETHREADS */ - -typedef struct isc_refcount { - int refs; -} isc_refcount_t; - -#define isc_refcount_destroy(rp) REQUIRE((rp)->refs == 0) -#define isc_refcount_current(rp) ((unsigned int)((rp)->refs)) - -#define isc_refcount_increment0(rp, tp) \ - do { \ - unsigned int *_tmp = (unsigned int *)(tp); \ - int _n = ++(rp)->refs; \ - if (_tmp != NULL) \ - *_tmp = _n; \ - } while (0) - -#define isc_refcount_increment(rp, tp) \ - do { \ - unsigned int *_tmp = (unsigned int *)(tp); \ - int _n; \ - REQUIRE((rp)->refs > 0); \ - _n = ++(rp)->refs; \ - if (_tmp != NULL) \ - *_tmp = _n; \ - } while (0) - -#define isc_refcount_decrement(rp, tp) \ - do { \ - unsigned int *_tmp = (unsigned int *)(tp); \ - int _n; \ - REQUIRE((rp)->refs > 0); \ - _n = --(rp)->refs; \ - if (_tmp != NULL) \ - *_tmp = _n; \ - } while (0) - -#endif /* ISC_PLATFORM_USETHREADS */ - -isc_result_t -isc_refcount_init(isc_refcount_t *ref, unsigned int n); - -ISC_LANG_ENDDECLS - -#endif /* ISC_REFCOUNT_H */ diff --git a/lib/isc/include/isc/resource.h b/lib/isc/include/isc/resource.h deleted file mode 100644 index 747c9fdf4e5d..000000000000 --- a/lib/isc/include/isc/resource.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: resource.h,v 1.13 2008/07/11 23:47:09 tbox Exp $ */ - -#ifndef ISC_RESOURCE_H -#define ISC_RESOURCE_H 1 - -/*! \file isc/resource.h */ - -#include -#include - -#define ISC_RESOURCE_UNLIMITED ((isc_resourcevalue_t)ISC_UINT64_MAX) - -ISC_LANG_BEGINDECLS - -isc_result_t -isc_resource_setlimit(isc_resource_t resource, isc_resourcevalue_t value); -/*%< - * Set the maximum limit for a system resource. - * - * Notes: - *\li If 'value' exceeds the maximum possible on the operating system, - * it is silently limited to that maximum -- or to "infinity", if - * the operating system has that concept. #ISC_RESOURCE_UNLIMITED - * can be used to explicitly ask for the maximum. - * - * Requires: - *\li 'resource' is a valid member of the isc_resource_t enumeration. - * - * Returns: - *\li #ISC_R_SUCCESS Success. - *\li #ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS. - *\li #ISC_R_NOPERM The calling process did not have adequate permission - * to change the resource limit. - */ - -isc_result_t -isc_resource_getlimit(isc_resource_t resource, isc_resourcevalue_t *value); -/*%< - * Get the maximum limit for a system resource. - * - * Notes: - *\li 'value' is set to the maximum limit. - * - *\li #ISC_RESOURCE_UNLIMITED is the maximum value of isc_resourcevalue_t. - * - *\li On many (all?) Unix systems, RLIM_INFINITY is a valid value that is - * significantly less than #ISC_RESOURCE_UNLIMITED, but which in practice - * behaves the same. - * - *\li The current ISC libdns configuration file parser assigns a value - * of ISC_UINT32_MAX for a size_spec of "unlimited" and ISC_UNIT32_MAX - 1 - * for "default", the latter of which is supposed to represent "the - * limit that was in force when the server started". Since these are - * valid values in the middle of the range of isc_resourcevalue_t, - * there is the possibility for confusion over what exactly those - * particular values are supposed to represent in a particular context -- - * discrete integral values or generalized concepts. - * - * Requires: - *\li 'resource' is a valid member of the isc_resource_t enumeration. - * - * Returns: - *\li #ISC_R_SUCCESS Success. - *\li #ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS. - */ - -isc_result_t -isc_resource_getcurlimit(isc_resource_t resource, isc_resourcevalue_t *value); -/*%< - * Same as isc_resource_getlimit(), but returns the current (soft) limit. - * - * Returns: - *\li #ISC_R_SUCCESS Success. - *\li #ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS. - */ - -ISC_LANG_ENDDECLS - -#endif /* ISC_RESOURCE_H */ - diff --git a/lib/isc/include/isc/rwlock.h b/lib/isc/include/isc/rwlock.h deleted file mode 100644 index 28052cdd7f8b..000000000000 --- a/lib/isc/include/isc/rwlock.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001, 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: rwlock.h,v 1.28 2007/06/19 23:47:18 tbox Exp $ */ - -#ifndef ISC_RWLOCK_H -#define ISC_RWLOCK_H 1 - -/*! \file isc/rwlock.h */ - -#include -#include -#include -#include - -ISC_LANG_BEGINDECLS - -typedef enum { - isc_rwlocktype_none = 0, - isc_rwlocktype_read, - isc_rwlocktype_write -} isc_rwlocktype_t; - -#ifdef ISC_PLATFORM_USETHREADS -#if defined(ISC_PLATFORM_HAVEXADD) && defined(ISC_PLATFORM_HAVECMPXCHG) -#define ISC_RWLOCK_USEATOMIC 1 -#endif - -struct isc_rwlock { - /* Unlocked. */ - unsigned int magic; - isc_mutex_t lock; - -#if defined(ISC_PLATFORM_HAVEXADD) && defined(ISC_PLATFORM_HAVECMPXCHG) - /* - * When some atomic instructions with hardware assistance are - * available, rwlock will use those so that concurrent readers do not - * interfere with each other through mutex as long as no writers - * appear, massively reducing the lock overhead in the typical case. - * - * The basic algorithm of this approach is the "simple - * writer-preference lock" shown in the following URL: - * http://www.cs.rochester.edu/u/scott/synchronization/pseudocode/rw.html - * but our implementation does not rely on the spin lock unlike the - * original algorithm to be more portable as a user space application. - */ - - /* Read or modified atomically. */ - isc_int32_t write_requests; - isc_int32_t write_completions; - isc_int32_t cnt_and_flag; - - /* Locked by lock. */ - isc_condition_t readable; - isc_condition_t writeable; - unsigned int readers_waiting; - - /* Locked by rwlock itself. */ - unsigned int write_granted; - - /* Unlocked. */ - unsigned int write_quota; - -#else /* ISC_PLATFORM_HAVEXADD && ISC_PLATFORM_HAVECMPXCHG */ - - /*%< Locked by lock. */ - isc_condition_t readable; - isc_condition_t writeable; - isc_rwlocktype_t type; - - /*% The number of threads that have the lock. */ - unsigned int active; - - /*% - * The number of lock grants made since the lock was last switched - * from reading to writing or vice versa; used in determining - * when the quota is reached and it is time to switch. - */ - unsigned int granted; - - unsigned int readers_waiting; - unsigned int writers_waiting; - unsigned int read_quota; - unsigned int write_quota; - isc_rwlocktype_t original; -#endif /* ISC_PLATFORM_HAVEXADD && ISC_PLATFORM_HAVECMPXCHG */ -}; -#else /* ISC_PLATFORM_USETHREADS */ -struct isc_rwlock { - unsigned int magic; - isc_rwlocktype_t type; - unsigned int active; -}; -#endif /* ISC_PLATFORM_USETHREADS */ - - -isc_result_t -isc_rwlock_init(isc_rwlock_t *rwl, unsigned int read_quota, - unsigned int write_quota); - -isc_result_t -isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type); - -isc_result_t -isc_rwlock_trylock(isc_rwlock_t *rwl, isc_rwlocktype_t type); - -isc_result_t -isc_rwlock_unlock(isc_rwlock_t *rwl, isc_rwlocktype_t type); - -isc_result_t -isc_rwlock_tryupgrade(isc_rwlock_t *rwl); - -void -isc_rwlock_downgrade(isc_rwlock_t *rwl); - -void -isc_rwlock_destroy(isc_rwlock_t *rwl); - -ISC_LANG_ENDDECLS - -#endif /* ISC_RWLOCK_H */ diff --git a/lib/isc/include/isc/serial.h b/lib/isc/include/isc/serial.h deleted file mode 100644 index a5e03970c3e6..000000000000 --- a/lib/isc/include/isc/serial.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: serial.h,v 1.18 2009/01/18 23:48:14 tbox Exp $ */ - -#ifndef ISC_SERIAL_H -#define ISC_SERIAL_H 1 - -#include -#include - -/*! \file isc/serial.h - * \brief Implement 32 bit serial space arithmetic comparison functions. - * Note: Undefined results are returned as ISC_FALSE. - */ - -/*** - *** Functions - ***/ - -ISC_LANG_BEGINDECLS - -isc_boolean_t -isc_serial_lt(isc_uint32_t a, isc_uint32_t b); -/*%< - * Return true if 'a' < 'b' otherwise false. - */ - -isc_boolean_t -isc_serial_gt(isc_uint32_t a, isc_uint32_t b); -/*%< - * Return true if 'a' > 'b' otherwise false. - */ - -isc_boolean_t -isc_serial_le(isc_uint32_t a, isc_uint32_t b); -/*%< - * Return true if 'a' <= 'b' otherwise false. - */ - -isc_boolean_t -isc_serial_ge(isc_uint32_t a, isc_uint32_t b); -/*%< - * Return true if 'a' >= 'b' otherwise false. - */ - -isc_boolean_t -isc_serial_eq(isc_uint32_t a, isc_uint32_t b); -/*%< - * Return true if 'a' == 'b' otherwise false. - */ - -isc_boolean_t -isc_serial_ne(isc_uint32_t a, isc_uint32_t b); -/*%< - * Return true if 'a' != 'b' otherwise false. - */ - -ISC_LANG_ENDDECLS - -#endif /* ISC_SERIAL_H */ diff --git a/lib/isc/include/isc/sha2.h b/lib/isc/include/isc/sha2.h deleted file mode 100644 index 439bbb948e4e..000000000000 --- a/lib/isc/include/isc/sha2.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (C) 2005-2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: sha2.h,v 1.12 2009/10/22 02:21:31 each Exp $ */ - -/* $FreeBSD: src/sys/crypto/sha2/sha2.h,v 1.1.2.1 2001/07/03 11:01:36 ume Exp $ */ -/* $KAME: sha2.h,v 1.3 2001/03/12 08:27:48 itojun Exp $ */ - -/* - * sha2.h - * - * Version 1.0.0beta1 - * - * Written by Aaron D. Gifford - * - * Copyright 2000 Aaron D. Gifford. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the names of contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTOR(S) ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTOR(S) BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#ifndef ISC_SHA2_H -#define ISC_SHA2_H - -#include -#include -#include - -/*** SHA-224/256/384/512 Various Length Definitions ***********************/ - -#define ISC_SHA224_BLOCK_LENGTH 64U -#define ISC_SHA224_DIGESTLENGTH 28U -#define ISC_SHA224_DIGESTSTRINGLENGTH (ISC_SHA224_DIGESTLENGTH * 2 + 1) -#define ISC_SHA256_BLOCK_LENGTH 64U -#define ISC_SHA256_DIGESTLENGTH 32U -#define ISC_SHA256_DIGESTSTRINGLENGTH (ISC_SHA256_DIGESTLENGTH * 2 + 1) -#define ISC_SHA384_BLOCK_LENGTH 128 -#define ISC_SHA384_DIGESTLENGTH 48U -#define ISC_SHA384_DIGESTSTRINGLENGTH (ISC_SHA384_DIGESTLENGTH * 2 + 1) -#define ISC_SHA512_BLOCK_LENGTH 128U -#define ISC_SHA512_DIGESTLENGTH 64U -#define ISC_SHA512_DIGESTSTRINGLENGTH (ISC_SHA512_DIGESTLENGTH * 2 + 1) - -/*** SHA-256/384/512 Context Structures *******************************/ - -#ifdef ISC_PLATFORM_OPENSSLHASH -#include - -typedef EVP_MD_CTX isc_sha256_t; -typedef EVP_MD_CTX isc_sha512_t; - -#else - -/* - * Keep buffer immediately after bitcount to preserve alignment. - */ -typedef struct { - isc_uint32_t state[8]; - isc_uint64_t bitcount; - isc_uint8_t buffer[ISC_SHA256_BLOCK_LENGTH]; -} isc_sha256_t; - -/* - * Keep buffer immediately after bitcount to preserve alignment. - */ -typedef struct { - isc_uint64_t state[8]; - isc_uint64_t bitcount[2]; - isc_uint8_t buffer[ISC_SHA512_BLOCK_LENGTH]; -} isc_sha512_t; -#endif - -typedef isc_sha256_t isc_sha224_t; -typedef isc_sha512_t isc_sha384_t; - -ISC_LANG_BEGINDECLS - -/*** SHA-224/256/384/512 Function Prototypes ******************************/ - -void isc_sha224_init (isc_sha224_t *); -void isc_sha224_invalidate (isc_sha224_t *); -void isc_sha224_update (isc_sha224_t *, const isc_uint8_t *, size_t); -void isc_sha224_final (isc_uint8_t[ISC_SHA224_DIGESTLENGTH], isc_sha224_t *); -char *isc_sha224_end (isc_sha224_t *, char[ISC_SHA224_DIGESTSTRINGLENGTH]); -char *isc_sha224_data (const isc_uint8_t *, size_t, char[ISC_SHA224_DIGESTSTRINGLENGTH]); - -void isc_sha256_init (isc_sha256_t *); -void isc_sha256_invalidate (isc_sha256_t *); -void isc_sha256_update (isc_sha256_t *, const isc_uint8_t *, size_t); -void isc_sha256_final (isc_uint8_t[ISC_SHA256_DIGESTLENGTH], isc_sha256_t *); -char *isc_sha256_end (isc_sha256_t *, char[ISC_SHA256_DIGESTSTRINGLENGTH]); -char *isc_sha256_data (const isc_uint8_t *, size_t, char[ISC_SHA256_DIGESTSTRINGLENGTH]); - -void isc_sha384_init (isc_sha384_t *); -void isc_sha384_invalidate (isc_sha384_t *); -void isc_sha384_update (isc_sha384_t *, const isc_uint8_t *, size_t); -void isc_sha384_final (isc_uint8_t[ISC_SHA384_DIGESTLENGTH], isc_sha384_t *); -char *isc_sha384_end (isc_sha384_t *, char[ISC_SHA384_DIGESTSTRINGLENGTH]); -char *isc_sha384_data (const isc_uint8_t *, size_t, char[ISC_SHA384_DIGESTSTRINGLENGTH]); - -void isc_sha512_init (isc_sha512_t *); -void isc_sha512_invalidate (isc_sha512_t *); -void isc_sha512_update (isc_sha512_t *, const isc_uint8_t *, size_t); -void isc_sha512_final (isc_uint8_t[ISC_SHA512_DIGESTLENGTH], isc_sha512_t *); -char *isc_sha512_end (isc_sha512_t *, char[ISC_SHA512_DIGESTSTRINGLENGTH]); -char *isc_sha512_data (const isc_uint8_t *, size_t, char[ISC_SHA512_DIGESTSTRINGLENGTH]); - -ISC_LANG_ENDDECLS - -#endif /* ISC_SHA2_H */ diff --git a/lib/isc/include/isc/stats.h b/lib/isc/include/isc/stats.h deleted file mode 100644 index 682eefdedf13..000000000000 --- a/lib/isc/include/isc/stats.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -#ifndef ISC_STATS_H -#define ISC_STATS_H 1 - -/*! \file isc/stats.h */ - -#include - -ISC_LANG_BEGINDECLS - -/*%< - * Flag(s) for isc_stats_dump(). - */ -#define ISC_STATSDUMP_VERBOSE 0x00000001 /*%< dump 0-value counters */ - -/*%< - * Dump callback type. - */ -typedef void (*isc_stats_dumper_t)(isc_statscounter_t, isc_uint64_t, void *); - -isc_result_t -isc_stats_create(isc_mem_t *mctx, isc_stats_t **statsp, int ncounters); -/*%< - * Create a statistics counter structure of general type. It counts a general - * set of counters indexed by an ID between 0 and ncounters -1. - * - * Requires: - *\li 'mctx' must be a valid memory context. - * - *\li 'statsp' != NULL && '*statsp' == NULL. - * - * Returns: - *\li ISC_R_SUCCESS -- all ok - * - *\li anything else -- failure - */ - -void -isc_stats_attach(isc_stats_t *stats, isc_stats_t **statsp); -/*%< - * Attach to a statistics set. - * - * Requires: - *\li 'stats' is a valid isc_stats_t. - * - *\li 'statsp' != NULL && '*statsp' == NULL - */ - -void -isc_stats_detach(isc_stats_t **statsp); -/*%< - * Detaches from the statistics set. - * - * Requires: - *\li 'statsp' != NULL and '*statsp' is a valid isc_stats_t. - */ - -int -isc_stats_ncounters(isc_stats_t *stats); -/*%< - * Returns the number of counters contained in stats. - * - * Requires: - *\li 'stats' is a valid isc_stats_t. - * - */ - -void -isc_stats_increment(isc_stats_t *stats, isc_statscounter_t counter); -/*%< - * Increment the counter-th counter of stats. - * - * Requires: - *\li 'stats' is a valid isc_stats_t. - * - *\li counter is less than the maximum available ID for the stats specified - * on creation. - */ - -void -isc_stats_decrement(isc_stats_t *stats, isc_statscounter_t counter); -/*%< - * Decrement the counter-th counter of stats. - * - * Requires: - *\li 'stats' is a valid isc_stats_t. - */ - -void -isc_stats_dump(isc_stats_t *stats, isc_stats_dumper_t dump_fn, void *arg, - unsigned int options); -/*%< - * Dump the current statistics counters in a specified way. For each counter - * in stats, dump_fn is called with its current value and the given argument - * arg. By default counters that have a value of 0 is skipped; if options has - * the ISC_STATSDUMP_VERBOSE flag, even such counters are dumped. - * - * Requires: - *\li 'stats' is a valid isc_stats_t. - */ - -ISC_LANG_ENDDECLS - -#endif /* ISC_STATS_H */ diff --git a/lib/isc/include/isc/stdlib.h b/lib/isc/include/isc/stdlib.h deleted file mode 100644 index 02243f0863ec..000000000000 --- a/lib/isc/include/isc/stdlib.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: stdlib.h,v 1.8 2007/06/19 23:47:18 tbox Exp $ */ - -#ifndef ISC_STDLIB_H -#define ISC_STDLIB_H 1 - -/*! \file isc/stdlib.h */ - -#include - -#include -#include - -#ifdef ISC_PLATFORM_NEEDSTRTOUL -#define strtoul isc_strtoul -#endif - -ISC_LANG_BEGINDECLS - -unsigned long isc_strtoul(const char *, char **, int); - -ISC_LANG_ENDDECLS - -#endif diff --git a/lib/isc/include/isc/symtab.h b/lib/isc/include/isc/symtab.h deleted file mode 100644 index 9d0e5e2f23f0..000000000000 --- a/lib/isc/include/isc/symtab.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (C) 2004-2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1996-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -#ifndef ISC_SYMTAB_H -#define ISC_SYMTAB_H 1 - -/***** - ***** Module Info - *****/ - -/*! \file isc/symtab.h - * \brief Provides a simple memory-based symbol table. - * - * Keys are C strings, and key comparisons are case-insensitive. A type may - * be specified when looking up, defining, or undefining. A type value of - * 0 means "match any type"; any other value will only match the given - * type. - * - * It's possible that a client will attempt to define a - * tuple when a tuple with the given key and type already exists in the table. - * What to do in this case is specified by the client. Possible policies are: - * - *\li #isc_symexists_reject Disallow the define, returning #ISC_R_EXISTS - *\li #isc_symexists_replace Replace the old value with the new. The - * undefine action (if provided) will be called - * with the old tuple. - *\li #isc_symexists_add Add the new tuple, leaving the old tuple in - * the table. Subsequent lookups will retrieve - * the most-recently-defined tuple. - * - * A lookup of a key using type 0 will return the most-recently defined - * symbol with that key. An undefine of a key using type 0 will undefine the - * most-recently defined symbol with that key. Trying to define a key with - * type 0 is illegal. - * - * The symbol table library does not make a copy the key field, so the - * caller must ensure that any key it passes to isc_symtab_define() will not - * change until it calls isc_symtab_undefine() or isc_symtab_destroy(). - * - * A user-specified action will be called (if provided) when a symbol is - * undefined. It can be used to free memory associated with keys and/or - * values. - * - * A symbol table is implemented as a hash table of lists; the size of the - * hash table is set by the 'size' parameter to isc_symtbl_create(). When - * the number of entries in the symbol table reaches three quarters of this - * value, the hash table is reallocated with size doubled, in order to - * optimize lookup performance. This has a negative effect on insertion - * performance, which can be mitigated by sizing the table appropriately - * when creating it. - * - * \li MP: - * The callers of this module must ensure any required synchronization. - * - * \li Reliability: - * No anticipated impact. - * - * \li Resources: - * TBS - * - * \li Security: - * No anticipated impact. - * - * \li Standards: - * None. - */ - -/*** - *** Imports. - ***/ - -#include -#include - -/* - *** Symbol Tables. - ***/ -/*% Symbol table value. */ -typedef union isc_symvalue { - void * as_pointer; - const void * as_cpointer; - int as_integer; - unsigned int as_uinteger; -} isc_symvalue_t; - -typedef void (*isc_symtabaction_t)(char *key, unsigned int type, - isc_symvalue_t value, void *userarg); -/*% Symbol table exists. */ -typedef enum { - isc_symexists_reject = 0, /*%< Disallow the define */ - isc_symexists_replace = 1, /*%< Replace the old value with the new */ - isc_symexists_add = 2 /*%< Add the new tuple */ -} isc_symexists_t; - -ISC_LANG_BEGINDECLS - -/*% Create a symbol table. */ -isc_result_t -isc_symtab_create(isc_mem_t *mctx, unsigned int size, - isc_symtabaction_t undefine_action, void *undefine_arg, - isc_boolean_t case_sensitive, isc_symtab_t **symtabp); - -/*% Destroy a symbol table. */ -void -isc_symtab_destroy(isc_symtab_t **symtabp); - -/*% Lookup a symbol table. */ -isc_result_t -isc_symtab_lookup(isc_symtab_t *symtab, const char *key, unsigned int type, - isc_symvalue_t *value); - -/*% Define a symbol table. */ -isc_result_t -isc_symtab_define(isc_symtab_t *symtab, const char *key, unsigned int type, - isc_symvalue_t value, isc_symexists_t exists_policy); - -/*% Undefine a symbol table. */ -isc_result_t -isc_symtab_undefine(isc_symtab_t *symtab, const char *key, unsigned int type); - -ISC_LANG_ENDDECLS - -#endif /* ISC_SYMTAB_H */ diff --git a/lib/isc/include/isc/taskpool.h b/lib/isc/include/isc/taskpool.h deleted file mode 100644 index 46f395ea246f..000000000000 --- a/lib/isc/include/isc/taskpool.h +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (C) 2004-2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -#ifndef ISC_TASKPOOL_H -#define ISC_TASKPOOL_H 1 - -/***** - ***** Module Info - *****/ - -/*! \file isc/taskpool.h - * \brief A task pool is a mechanism for sharing a small number of tasks - * among a large number of objects such that each object is - * assigned a unique task, but each task may be shared by several - * objects. - * - * Task pools are used to let objects that can exist in large - * numbers (e.g., zones) use tasks for synchronization without - * the memory overhead and unfair scheduling competition that - * could result from creating a separate task for each object. - */ - - -/*** - *** Imports. - ***/ - -#include -#include - -ISC_LANG_BEGINDECLS - -/***** - ***** Types. - *****/ - -typedef struct isc_taskpool isc_taskpool_t; - -/***** - ***** Functions. - *****/ - -isc_result_t -isc_taskpool_create(isc_taskmgr_t *tmgr, isc_mem_t *mctx, - unsigned int ntasks, unsigned int quantum, - isc_taskpool_t **poolp); -/*%< - * Create a task pool of "ntasks" tasks, each with quantum - * "quantum". - * - * Requires: - * - *\li 'tmgr' is a valid task manager. - * - *\li 'mctx' is a valid memory context. - * - *\li poolp != NULL && *poolp == NULL - * - * Ensures: - * - *\li On success, '*taskp' points to the new task pool. - * - * Returns: - * - *\li #ISC_R_SUCCESS - *\li #ISC_R_NOMEMORY - *\li #ISC_R_UNEXPECTED - */ - -void -isc_taskpool_gettask(isc_taskpool_t *pool, isc_task_t **targetp); -/*%< - * Attach to a task from the pool. Currently the next task is chosen - * from the pool at random. (This may be changed in the future to - * something that guaratees balance.) - */ - -int -isc_taskpool_size(isc_taskpool_t *pool); -/*%< - * Returns the number of tasks in the task pool 'pool'. - */ - -isc_result_t -isc_taskpool_expand(isc_taskpool_t **sourcep, unsigned int size, - isc_taskpool_t **targetp); - -/*%< - * If 'size' is larger than the number of tasks in the pool pointed to by - * 'sourcep', then a new taskpool of size 'size' is allocated, the existing - * tasks from are moved into it, additional tasks are created to bring the - * total number up to 'size', and the resulting pool is attached to - * 'targetp'. - * - * If 'size' is less than or equal to the tasks in pool 'source', then - * 'sourcep' is attached to 'targetp' without any other action being taken. - * - * In either case, 'sourcep' is detached. - * - * Requires: - * - * \li 'sourcep' is not NULL and '*source' is not NULL - * \li 'targetp' is not NULL and '*source' is NULL - * - * Ensures: - * - * \li On success, '*targetp' points to a valid task pool. - * \li On success, '*sourcep' points to NULL. - * - * Returns: - * - * \li #ISC_R_SUCCESS - * \li #ISC_R_NOMEMORY - */ - -void -isc_taskpool_destroy(isc_taskpool_t **poolp); -/*%< - * Destroy a task pool. The tasks in the pool are detached but not - * shut down. - * - * Requires: - * \li '*poolp' is a valid task pool. - */ - -void -isc_taskpool_setprivilege(isc_taskpool_t *pool, isc_boolean_t priv); -/*%< - * Set the privilege flag on all tasks in 'pool' to 'priv'. If 'priv' is - * true, then when the task manager is set into privileged mode, only - * tasks wihin this pool will be able to execute. (Note: It is important - * to turn the pool tasks' privilege back off before the last task finishes - * executing.) - * - * Requires: - * \li 'pool' is a valid task pool. - */ - -ISC_LANG_ENDDECLS - -#endif /* ISC_TASKPOOL_H */ diff --git a/lib/isc/include/isc/version.h b/lib/isc/include/isc/version.h deleted file mode 100644 index ec00bdea7b24..000000000000 --- a/lib/isc/include/isc/version.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: version.h,v 1.9 2007/06/19 23:47:18 tbox Exp $ */ - -/*! \file isc/version.h */ - -#include - -LIBISC_EXTERNAL_DATA extern const char isc_version[]; - -LIBISC_EXTERNAL_DATA extern const unsigned int isc_libinterface; -LIBISC_EXTERNAL_DATA extern const unsigned int isc_librevision; -LIBISC_EXTERNAL_DATA extern const unsigned int isc_libage; diff --git a/lib/isc/inet_aton.c b/lib/isc/inet_aton.c deleted file mode 100644 index 3fc3a4db87a5..000000000000 --- a/lib/isc/inet_aton.c +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Portions Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") - * Portions Copyright (C) 1996-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * Copyright (c) 1983, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies, and that - * the name of Digital Equipment Corporation not be used in advertising or - * publicity pertaining to distribution of the document or software without - * specific, written prior permission. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT - * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ -/*! \file */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93"; -static char rcsid[] = "$Id: inet_aton.c,v 1.23 2008/12/01 23:47:45 tbox Exp $"; -#endif /* LIBC_SCCS and not lint */ - -#include - -#include -#include /* Required for NULL. */ - -#include -#include - -/*% - * Check whether "cp" is a valid ascii representation - * of an Internet address and convert to a binary address. - * Returns 1 if the address is valid, 0 if not. - * This replaces inet_addr, the return value from which - * cannot distinguish between failure and a local broadcast address. - */ -int -isc_net_aton(const char *cp, struct in_addr *addr) { - unsigned long val; - int base; - unsigned char c; - isc_uint8_t parts[4]; - isc_uint8_t *pp = parts; - int digit; - - c = *cp; - for (;;) { - /* - * Collect number up to ``.''. - * Values are specified as for C: - * 0x=hex, 0=octal, isdigit=decimal. - */ - if (!isdigit(c & 0xff)) - return (0); - val = 0; base = 10; digit = 0; - if (c == '0') { - c = *++cp; - if (c == 'x' || c == 'X') - base = 16, c = *++cp; - else { - base = 8; - digit = 1; - } - } - for (;;) { - /* - * isascii() is valid for all integer values, and - * when it is true, c is known to be in scope - * for isdigit(). No cast necessary. Similar - * comment applies for later ctype uses. - */ - if (isascii(c) && isdigit(c)) { - if (base == 8 && (c == '8' || c == '9')) - return (0); - val = (val * base) + (c - '0'); - c = *++cp; - digit = 1; - } else if (base == 16 && isascii(c) && isxdigit(c)) { - val = (val << 4) | - (c + 10 - (islower(c) ? 'a' : 'A')); - c = *++cp; - digit = 1; - } else - break; - } - if (c == '.') { - /* - * Internet format: - * a.b.c.d - * a.b.c (with c treated as 16 bits) - * a.b (with b treated as 24 bits) - */ - if (pp >= parts + 3 || val > 0xffU) - return (0); - *pp++ = (isc_uint8_t)val; - c = *++cp; - } else - break; - } - /* - * Check for trailing characters. - */ - if (c != '\0' && (!isascii(c) || !isspace(c))) - return (0); - /* - * Did we get a valid digit? - */ - if (!digit) - return (0); - /* - * Concoct the address according to - * the number of parts specified. - */ - switch (pp - parts + 1) { - case 1: /* a -- 32 bits */ - break; - - case 2: /* a.b -- 8.24 bits */ - if (val > 0xffffffU) - return (0); - val |= parts[0] << 24; - break; - - case 3: /* a.b.c -- 8.8.16 bits */ - if (val > 0xffffU) - return (0); - val |= (parts[0] << 24) | (parts[1] << 16); - break; - - case 4: /* a.b.c.d -- 8.8.8.8 bits */ - if (val > 0xffU) - return (0); - val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); - break; - } - if (addr != NULL) - addr->s_addr = htonl(val); - - return (1); -} diff --git a/lib/isc/iterated_hash.c b/lib/isc/iterated_hash.c deleted file mode 100644 index 86dedde2880c..000000000000 --- a/lib/isc/iterated_hash.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2006, 2008, 2009 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: iterated_hash.c,v 1.6 2009/02/18 23:47:48 tbox Exp $ */ - -#include "config.h" - -#include - -#include -#include - -int -isc_iterated_hash(unsigned char out[ISC_SHA1_DIGESTLENGTH], - unsigned int hashalg, int iterations, - const unsigned char *salt, int saltlength, - const unsigned char *in, int inlength) -{ - isc_sha1_t ctx; - int n = 0; - - if (hashalg != 1) - return (0); - - do { - isc_sha1_init(&ctx); - isc_sha1_update(&ctx, in, inlength); - isc_sha1_update(&ctx, salt, saltlength); - isc_sha1_final(&ctx, out); - in = out; - inlength = ISC_SHA1_DIGESTLENGTH; - } while (n++ < iterations); - - return (ISC_SHA1_DIGESTLENGTH); -} diff --git a/lib/isc/lex.c b/lib/isc/lex.c deleted file mode 100644 index 8749ed0b0ba3..000000000000 --- a/lib/isc/lex.c +++ /dev/null @@ -1,959 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: lex.c,v 1.86 2007/09/17 09:56:29 shane Exp $ */ - -/*! \file */ - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -typedef struct inputsource { - isc_result_t result; - isc_boolean_t is_file; - isc_boolean_t need_close; - isc_boolean_t at_eof; - isc_buffer_t * pushback; - unsigned int ignored; - void * input; - char * name; - unsigned long line; - unsigned long saved_line; - ISC_LINK(struct inputsource) link; -} inputsource; - -#define LEX_MAGIC ISC_MAGIC('L', 'e', 'x', '!') -#define VALID_LEX(l) ISC_MAGIC_VALID(l, LEX_MAGIC) - -struct isc_lex { - /* Unlocked. */ - unsigned int magic; - isc_mem_t * mctx; - size_t max_token; - char * data; - unsigned int comments; - isc_boolean_t comment_ok; - isc_boolean_t last_was_eol; - unsigned int paren_count; - unsigned int saved_paren_count; - isc_lexspecials_t specials; - LIST(struct inputsource) sources; -}; - -static inline isc_result_t -grow_data(isc_lex_t *lex, size_t *remainingp, char **currp, char **prevp) { - char *new; - - new = isc_mem_get(lex->mctx, lex->max_token * 2 + 1); - if (new == NULL) - return (ISC_R_NOMEMORY); - memcpy(new, lex->data, lex->max_token + 1); - *currp = new + (*currp - lex->data); - if (*prevp != NULL) - *prevp = new + (*prevp - lex->data); - isc_mem_put(lex->mctx, lex->data, lex->max_token + 1); - lex->data = new; - *remainingp += lex->max_token; - lex->max_token *= 2; - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_lex_create(isc_mem_t *mctx, size_t max_token, isc_lex_t **lexp) { - isc_lex_t *lex; - - /* - * Create a lexer. - */ - - REQUIRE(lexp != NULL && *lexp == NULL); - REQUIRE(max_token > 0U); - - lex = isc_mem_get(mctx, sizeof(*lex)); - if (lex == NULL) - return (ISC_R_NOMEMORY); - lex->data = isc_mem_get(mctx, max_token + 1); - if (lex->data == NULL) { - isc_mem_put(mctx, lex, sizeof(*lex)); - return (ISC_R_NOMEMORY); - } - lex->mctx = mctx; - lex->max_token = max_token; - lex->comments = 0; - lex->comment_ok = ISC_TRUE; - lex->last_was_eol = ISC_TRUE; - lex->paren_count = 0; - lex->saved_paren_count = 0; - memset(lex->specials, 0, 256); - INIT_LIST(lex->sources); - lex->magic = LEX_MAGIC; - - *lexp = lex; - - return (ISC_R_SUCCESS); -} - -void -isc_lex_destroy(isc_lex_t **lexp) { - isc_lex_t *lex; - - /* - * Destroy the lexer. - */ - - REQUIRE(lexp != NULL); - lex = *lexp; - REQUIRE(VALID_LEX(lex)); - - while (!EMPTY(lex->sources)) - RUNTIME_CHECK(isc_lex_close(lex) == ISC_R_SUCCESS); - if (lex->data != NULL) - isc_mem_put(lex->mctx, lex->data, lex->max_token + 1); - lex->magic = 0; - isc_mem_put(lex->mctx, lex, sizeof(*lex)); - - *lexp = NULL; -} - -unsigned int -isc_lex_getcomments(isc_lex_t *lex) { - /* - * Return the current lexer commenting styles. - */ - - REQUIRE(VALID_LEX(lex)); - - return (lex->comments); -} - -void -isc_lex_setcomments(isc_lex_t *lex, unsigned int comments) { - /* - * Set allowed lexer commenting styles. - */ - - REQUIRE(VALID_LEX(lex)); - - lex->comments = comments; -} - -void -isc_lex_getspecials(isc_lex_t *lex, isc_lexspecials_t specials) { - /* - * Put the current list of specials into 'specials'. - */ - - REQUIRE(VALID_LEX(lex)); - - memcpy(specials, lex->specials, 256); -} - -void -isc_lex_setspecials(isc_lex_t *lex, isc_lexspecials_t specials) { - /* - * The characters in 'specials' are returned as tokens. Along with - * whitespace, they delimit strings and numbers. - */ - - REQUIRE(VALID_LEX(lex)); - - memcpy(lex->specials, specials, 256); -} - -static inline isc_result_t -new_source(isc_lex_t *lex, isc_boolean_t is_file, isc_boolean_t need_close, - void *input, const char *name) -{ - inputsource *source; - isc_result_t result; - - source = isc_mem_get(lex->mctx, sizeof(*source)); - if (source == NULL) - return (ISC_R_NOMEMORY); - source->result = ISC_R_SUCCESS; - source->is_file = is_file; - source->need_close = need_close; - source->at_eof = ISC_FALSE; - source->input = input; - source->name = isc_mem_strdup(lex->mctx, name); - if (source->name == NULL) { - isc_mem_put(lex->mctx, source, sizeof(*source)); - return (ISC_R_NOMEMORY); - } - source->pushback = NULL; - result = isc_buffer_allocate(lex->mctx, &source->pushback, - lex->max_token); - if (result != ISC_R_SUCCESS) { - isc_mem_free(lex->mctx, source->name); - isc_mem_put(lex->mctx, source, sizeof(*source)); - return (result); - } - source->ignored = 0; - source->line = 1; - ISC_LIST_INITANDPREPEND(lex->sources, source, link); - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_lex_openfile(isc_lex_t *lex, const char *filename) { - isc_result_t result; - FILE *stream = NULL; - - /* - * Open 'filename' and make it the current input source for 'lex'. - */ - - REQUIRE(VALID_LEX(lex)); - - result = isc_stdio_open(filename, "r", &stream); - if (result != ISC_R_SUCCESS) - return (result); - - result = new_source(lex, ISC_TRUE, ISC_TRUE, stream, filename); - if (result != ISC_R_SUCCESS) - (void)fclose(stream); - return (result); -} - -isc_result_t -isc_lex_openstream(isc_lex_t *lex, FILE *stream) { - char name[128]; - - /* - * Make 'stream' the current input source for 'lex'. - */ - - REQUIRE(VALID_LEX(lex)); - - snprintf(name, sizeof(name), "stream-%p", stream); - - return (new_source(lex, ISC_TRUE, ISC_FALSE, stream, name)); -} - -isc_result_t -isc_lex_openbuffer(isc_lex_t *lex, isc_buffer_t *buffer) { - char name[128]; - - /* - * Make 'buffer' the current input source for 'lex'. - */ - - REQUIRE(VALID_LEX(lex)); - - snprintf(name, sizeof(name), "buffer-%p", buffer); - - return (new_source(lex, ISC_FALSE, ISC_FALSE, buffer, name)); -} - -isc_result_t -isc_lex_close(isc_lex_t *lex) { - inputsource *source; - - /* - * Close the most recently opened object (i.e. file or buffer). - */ - - REQUIRE(VALID_LEX(lex)); - - source = HEAD(lex->sources); - if (source == NULL) - return (ISC_R_NOMORE); - - ISC_LIST_UNLINK(lex->sources, source, link); - if (source->is_file) { - if (source->need_close) - (void)fclose((FILE *)(source->input)); - } - isc_mem_free(lex->mctx, source->name); - isc_buffer_free(&source->pushback); - isc_mem_put(lex->mctx, source, sizeof(*source)); - - return (ISC_R_SUCCESS); -} - -typedef enum { - lexstate_start, - lexstate_crlf, - lexstate_string, - lexstate_number, - lexstate_maybecomment, - lexstate_ccomment, - lexstate_ccommentend, - lexstate_eatline, - lexstate_qstring -} lexstate; - -#define IWSEOL (ISC_LEXOPT_INITIALWS | ISC_LEXOPT_EOL) - -static void -pushback(inputsource *source, int c) { - REQUIRE(source->pushback->current > 0); - if (c == EOF) { - source->at_eof = ISC_FALSE; - return; - } - source->pushback->current--; - if (c == '\n') - source->line--; -} - -static isc_result_t -pushandgrow(isc_lex_t *lex, inputsource *source, int c) { - if (isc_buffer_availablelength(source->pushback) == 0) { - isc_buffer_t *tbuf = NULL; - unsigned int oldlen; - isc_region_t used; - isc_result_t result; - - oldlen = isc_buffer_length(source->pushback); - result = isc_buffer_allocate(lex->mctx, &tbuf, oldlen * 2); - if (result != ISC_R_SUCCESS) - return (result); - isc_buffer_usedregion(source->pushback, &used); - result = isc_buffer_copyregion(tbuf, &used); - INSIST(result == ISC_R_SUCCESS); - tbuf->current = source->pushback->current; - isc_buffer_free(&source->pushback); - source->pushback = tbuf; - } - isc_buffer_putuint8(source->pushback, (isc_uint8_t)c); - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { - inputsource *source; - int c; - isc_boolean_t done = ISC_FALSE; - isc_boolean_t no_comments = ISC_FALSE; - isc_boolean_t escaped = ISC_FALSE; - lexstate state = lexstate_start; - lexstate saved_state = lexstate_start; - isc_buffer_t *buffer; - FILE *stream; - char *curr, *prev; - size_t remaining; - isc_uint32_t as_ulong; - unsigned int saved_options; - isc_result_t result; - - /* - * Get the next token. - */ - - REQUIRE(VALID_LEX(lex)); - source = HEAD(lex->sources); - REQUIRE(tokenp != NULL); - - if (source == NULL) { - if ((options & ISC_LEXOPT_NOMORE) != 0) { - tokenp->type = isc_tokentype_nomore; - return (ISC_R_SUCCESS); - } - return (ISC_R_NOMORE); - } - - if (source->result != ISC_R_SUCCESS) - return (source->result); - - lex->saved_paren_count = lex->paren_count; - source->saved_line = source->line; - - if (isc_buffer_remaininglength(source->pushback) == 0 && - source->at_eof) - { - if ((options & ISC_LEXOPT_DNSMULTILINE) != 0 && - lex->paren_count != 0) { - lex->paren_count = 0; - return (ISC_R_UNBALANCED); - } - if ((options & ISC_LEXOPT_EOF) != 0) { - tokenp->type = isc_tokentype_eof; - return (ISC_R_SUCCESS); - } - return (ISC_R_EOF); - } - - isc_buffer_compact(source->pushback); - - saved_options = options; - if ((options & ISC_LEXOPT_DNSMULTILINE) != 0 && lex->paren_count > 0) - options &= ~IWSEOL; - - curr = lex->data; - *curr = '\0'; - - prev = NULL; - remaining = lex->max_token; - -#ifdef HAVE_FLOCKFILE - if (source->is_file) - flockfile(source->input); -#endif - - do { - if (isc_buffer_remaininglength(source->pushback) == 0) { - if (source->is_file) { - stream = source->input; - -#if defined(HAVE_FLOCKFILE) && defined(HAVE_GETCUNLOCKED) - c = getc_unlocked(stream); -#else - c = getc(stream); -#endif - if (c == EOF) { - if (ferror(stream)) { - source->result = ISC_R_IOERROR; - result = source->result; - goto done; - } - source->at_eof = ISC_TRUE; - } - } else { - buffer = source->input; - - if (buffer->current == buffer->used) { - c = EOF; - source->at_eof = ISC_TRUE; - } else { - c = *((char *)buffer->base + - buffer->current); - buffer->current++; - } - } - if (c != EOF) { - source->result = pushandgrow(lex, source, c); - if (source->result != ISC_R_SUCCESS) { - result = source->result; - goto done; - } - } - } - - if (!source->at_eof) { - if (state == lexstate_start) - /* Token has not started yet. */ - source->ignored = - isc_buffer_consumedlength(source->pushback); - c = isc_buffer_getuint8(source->pushback); - } else { - c = EOF; - } - - if (c == '\n') - source->line++; - - if (lex->comment_ok && !no_comments) { - if (!escaped && c == ';' && - ((lex->comments & ISC_LEXCOMMENT_DNSMASTERFILE) - != 0)) { - saved_state = state; - state = lexstate_eatline; - no_comments = ISC_TRUE; - continue; - } else if (c == '/' && - (lex->comments & - (ISC_LEXCOMMENT_C| - ISC_LEXCOMMENT_CPLUSPLUS)) != 0) { - saved_state = state; - state = lexstate_maybecomment; - no_comments = ISC_TRUE; - continue; - } else if (c == '#' && - ((lex->comments & ISC_LEXCOMMENT_SHELL) - != 0)) { - saved_state = state; - state = lexstate_eatline; - no_comments = ISC_TRUE; - continue; - } - } - - no_read: - /* INSIST(c == EOF || (c >= 0 && c <= 255)); */ - switch (state) { - case lexstate_start: - if (c == EOF) { - lex->last_was_eol = ISC_FALSE; - if ((options & ISC_LEXOPT_DNSMULTILINE) != 0 && - lex->paren_count != 0) { - lex->paren_count = 0; - result = ISC_R_UNBALANCED; - goto done; - } - if ((options & ISC_LEXOPT_EOF) == 0) { - result = ISC_R_EOF; - goto done; - } - tokenp->type = isc_tokentype_eof; - done = ISC_TRUE; - } else if (c == ' ' || c == '\t') { - if (lex->last_was_eol && - (options & ISC_LEXOPT_INITIALWS) - != 0) { - lex->last_was_eol = ISC_FALSE; - tokenp->type = isc_tokentype_initialws; - tokenp->value.as_char = c; - done = ISC_TRUE; - } - } else if (c == '\n') { - if ((options & ISC_LEXOPT_EOL) != 0) { - tokenp->type = isc_tokentype_eol; - done = ISC_TRUE; - } - lex->last_was_eol = ISC_TRUE; - } else if (c == '\r') { - if ((options & ISC_LEXOPT_EOL) != 0) - state = lexstate_crlf; - } else if (c == '"' && - (options & ISC_LEXOPT_QSTRING) != 0) { - lex->last_was_eol = ISC_FALSE; - no_comments = ISC_TRUE; - state = lexstate_qstring; - } else if (lex->specials[c]) { - lex->last_was_eol = ISC_FALSE; - if ((c == '(' || c == ')') && - (options & ISC_LEXOPT_DNSMULTILINE) != 0) { - if (c == '(') { - if (lex->paren_count == 0) - options &= ~IWSEOL; - lex->paren_count++; - } else { - if (lex->paren_count == 0) { - result = ISC_R_UNBALANCED; - goto done; - } - lex->paren_count--; - if (lex->paren_count == 0) - options = - saved_options; - } - continue; - } - tokenp->type = isc_tokentype_special; - tokenp->value.as_char = c; - done = ISC_TRUE; - } else if (isdigit((unsigned char)c) && - (options & ISC_LEXOPT_NUMBER) != 0) { - lex->last_was_eol = ISC_FALSE; - if ((options & ISC_LEXOPT_OCTAL) != 0 && - (c == '8' || c == '9')) - state = lexstate_string; - else - state = lexstate_number; - goto no_read; - } else { - lex->last_was_eol = ISC_FALSE; - state = lexstate_string; - goto no_read; - } - break; - case lexstate_crlf: - if (c != '\n') - pushback(source, c); - tokenp->type = isc_tokentype_eol; - done = ISC_TRUE; - lex->last_was_eol = ISC_TRUE; - break; - case lexstate_number: - if (c == EOF || !isdigit((unsigned char)c)) { - if (c == ' ' || c == '\t' || c == '\r' || - c == '\n' || c == EOF || - lex->specials[c]) { - int base; - if ((options & ISC_LEXOPT_OCTAL) != 0) - base = 8; - else if ((options & ISC_LEXOPT_CNUMBER) != 0) - base = 0; - else - base = 10; - pushback(source, c); - - result = isc_parse_uint32(&as_ulong, - lex->data, - base); - if (result == ISC_R_SUCCESS) { - tokenp->type = - isc_tokentype_number; - tokenp->value.as_ulong = - as_ulong; - } else if (result == ISC_R_BADNUMBER) { - isc_tokenvalue_t *v; - - tokenp->type = - isc_tokentype_string; - v = &(tokenp->value); - v->as_textregion.base = - lex->data; - v->as_textregion.length = - lex->max_token - - remaining; - } else - goto done; - done = ISC_TRUE; - continue; - } else if (!(options & ISC_LEXOPT_CNUMBER) || - ((c != 'x' && c != 'X') || - (curr != &lex->data[1]) || - (lex->data[0] != '0'))) { - /* Above test supports hex numbers */ - state = lexstate_string; - } - } else if ((options & ISC_LEXOPT_OCTAL) != 0 && - (c == '8' || c == '9')) { - state = lexstate_string; - } - if (remaining == 0U) { - result = grow_data(lex, &remaining, - &curr, &prev); - if (result != ISC_R_SUCCESS) - goto done; - } - INSIST(remaining > 0U); - *curr++ = c; - *curr = '\0'; - remaining--; - break; - case lexstate_string: - /* - * EOF needs to be checked before lex->specials[c] - * as lex->specials[EOF] is not a good idea. - */ - if (c == '\r' || c == '\n' || c == EOF || - (!escaped && - (c == ' ' || c == '\t' || lex->specials[c]))) { - pushback(source, c); - if (source->result != ISC_R_SUCCESS) { - result = source->result; - goto done; - } - tokenp->type = isc_tokentype_string; - tokenp->value.as_textregion.base = lex->data; - tokenp->value.as_textregion.length = - lex->max_token - remaining; - done = ISC_TRUE; - continue; - } - if ((options & ISC_LEXOPT_ESCAPE) != 0) - escaped = (!escaped && c == '\\') ? - ISC_TRUE : ISC_FALSE; - if (remaining == 0U) { - result = grow_data(lex, &remaining, - &curr, &prev); - if (result != ISC_R_SUCCESS) - goto done; - } - INSIST(remaining > 0U); - *curr++ = c; - *curr = '\0'; - remaining--; - break; - case lexstate_maybecomment: - if (c == '*' && - (lex->comments & ISC_LEXCOMMENT_C) != 0) { - state = lexstate_ccomment; - continue; - } else if (c == '/' && - (lex->comments & ISC_LEXCOMMENT_CPLUSPLUS) != 0) { - state = lexstate_eatline; - continue; - } - pushback(source, c); - c = '/'; - no_comments = ISC_FALSE; - state = saved_state; - goto no_read; - case lexstate_ccomment: - if (c == EOF) { - result = ISC_R_UNEXPECTEDEND; - goto done; - } - if (c == '*') - state = lexstate_ccommentend; - break; - case lexstate_ccommentend: - if (c == EOF) { - result = ISC_R_UNEXPECTEDEND; - goto done; - } - if (c == '/') { - /* - * C-style comments become a single space. - * We do this to ensure that a comment will - * act as a delimiter for strings and - * numbers. - */ - c = ' '; - no_comments = ISC_FALSE; - state = saved_state; - goto no_read; - } else if (c != '*') - state = lexstate_ccomment; - break; - case lexstate_eatline: - if ((c == '\n') || (c == EOF)) { - no_comments = ISC_FALSE; - state = saved_state; - goto no_read; - } - break; - case lexstate_qstring: - if (c == EOF) { - result = ISC_R_UNEXPECTEDEND; - goto done; - } - if (c == '"') { - if (escaped) { - escaped = ISC_FALSE; - /* - * Overwrite the preceding backslash. - */ - INSIST(prev != NULL); - *prev = '"'; - } else { - tokenp->type = isc_tokentype_qstring; - tokenp->value.as_textregion.base = - lex->data; - tokenp->value.as_textregion.length = - lex->max_token - remaining; - no_comments = ISC_FALSE; - done = ISC_TRUE; - } - } else { - if (c == '\n' && !escaped && - (options & ISC_LEXOPT_QSTRINGMULTILINE) == 0) { - pushback(source, c); - result = ISC_R_UNBALANCEDQUOTES; - goto done; - } - if (c == '\\' && !escaped) - escaped = ISC_TRUE; - else - escaped = ISC_FALSE; - if (remaining == 0U) { - result = grow_data(lex, &remaining, - &curr, &prev); - if (result != ISC_R_SUCCESS) - goto done; - } - INSIST(remaining > 0U); - prev = curr; - *curr++ = c; - *curr = '\0'; - remaining--; - } - break; - default: - FATAL_ERROR(__FILE__, __LINE__, - isc_msgcat_get(isc_msgcat, ISC_MSGSET_LEX, - ISC_MSG_UNEXPECTEDSTATE, - "Unexpected state %d"), - state); - /* Does not return. */ - } - - } while (!done); - - result = ISC_R_SUCCESS; - done: -#ifdef HAVE_FLOCKFILE - if (source->is_file) - funlockfile(source->input); -#endif - return (result); -} - -isc_result_t -isc_lex_getmastertoken(isc_lex_t *lex, isc_token_t *token, - isc_tokentype_t expect, isc_boolean_t eol) -{ - unsigned int options = ISC_LEXOPT_EOL | ISC_LEXOPT_EOF | - ISC_LEXOPT_DNSMULTILINE | ISC_LEXOPT_ESCAPE; - isc_result_t result; - - if (expect == isc_tokentype_qstring) - options |= ISC_LEXOPT_QSTRING; - else if (expect == isc_tokentype_number) - options |= ISC_LEXOPT_NUMBER; - result = isc_lex_gettoken(lex, options, token); - if (result == ISC_R_RANGE) - isc_lex_ungettoken(lex, token); - if (result != ISC_R_SUCCESS) - return (result); - - if (eol && ((token->type == isc_tokentype_eol) || - (token->type == isc_tokentype_eof))) - return (ISC_R_SUCCESS); - if (token->type == isc_tokentype_string && - expect == isc_tokentype_qstring) - return (ISC_R_SUCCESS); - if (token->type != expect) { - isc_lex_ungettoken(lex, token); - if (token->type == isc_tokentype_eol || - token->type == isc_tokentype_eof) - return (ISC_R_UNEXPECTEDEND); - if (expect == isc_tokentype_number) - return (ISC_R_BADNUMBER); - return (ISC_R_UNEXPECTEDTOKEN); - } - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_lex_getoctaltoken(isc_lex_t *lex, isc_token_t *token, isc_boolean_t eol) -{ - unsigned int options = ISC_LEXOPT_EOL | ISC_LEXOPT_EOF | - ISC_LEXOPT_DNSMULTILINE | ISC_LEXOPT_ESCAPE| - ISC_LEXOPT_NUMBER | ISC_LEXOPT_OCTAL; - isc_result_t result; - - result = isc_lex_gettoken(lex, options, token); - if (result == ISC_R_RANGE) - isc_lex_ungettoken(lex, token); - if (result != ISC_R_SUCCESS) - return (result); - - if (eol && ((token->type == isc_tokentype_eol) || - (token->type == isc_tokentype_eof))) - return (ISC_R_SUCCESS); - if (token->type != isc_tokentype_number) { - isc_lex_ungettoken(lex, token); - if (token->type == isc_tokentype_eol || - token->type == isc_tokentype_eof) - return (ISC_R_UNEXPECTEDEND); - return (ISC_R_BADNUMBER); - } - return (ISC_R_SUCCESS); -} - -void -isc_lex_ungettoken(isc_lex_t *lex, isc_token_t *tokenp) { - inputsource *source; - /* - * Unget the current token. - */ - - REQUIRE(VALID_LEX(lex)); - source = HEAD(lex->sources); - REQUIRE(source != NULL); - REQUIRE(tokenp != NULL); - REQUIRE(isc_buffer_consumedlength(source->pushback) != 0 || - tokenp->type == isc_tokentype_eof); - - UNUSED(tokenp); - - isc_buffer_first(source->pushback); - lex->paren_count = lex->saved_paren_count; - source->line = source->saved_line; - source->at_eof = ISC_FALSE; -} - -void -isc_lex_getlasttokentext(isc_lex_t *lex, isc_token_t *tokenp, isc_region_t *r) -{ - inputsource *source; - - REQUIRE(VALID_LEX(lex)); - source = HEAD(lex->sources); - REQUIRE(source != NULL); - REQUIRE(tokenp != NULL); - REQUIRE(isc_buffer_consumedlength(source->pushback) != 0 || - tokenp->type == isc_tokentype_eof); - - UNUSED(tokenp); - - INSIST(source->ignored <= isc_buffer_consumedlength(source->pushback)); - r->base = (unsigned char *)isc_buffer_base(source->pushback) + - source->ignored; - r->length = isc_buffer_consumedlength(source->pushback) - - source->ignored; -} - - -char * -isc_lex_getsourcename(isc_lex_t *lex) { - inputsource *source; - - REQUIRE(VALID_LEX(lex)); - source = HEAD(lex->sources); - - if (source == NULL) - return (NULL); - - return (source->name); -} - -unsigned long -isc_lex_getsourceline(isc_lex_t *lex) { - inputsource *source; - - REQUIRE(VALID_LEX(lex)); - source = HEAD(lex->sources); - - if (source == NULL) - return (0); - - return (source->line); -} - - -isc_result_t -isc_lex_setsourcename(isc_lex_t *lex, const char *name) { - inputsource *source; - char *newname; - - REQUIRE(VALID_LEX(lex)); - source = HEAD(lex->sources); - - if (source == NULL) - return(ISC_R_NOTFOUND); - newname = isc_mem_strdup(lex->mctx, name); - if (newname == NULL) - return (ISC_R_NOMEMORY); - isc_mem_free(lex->mctx, source->name); - source->name = newname; - return (ISC_R_SUCCESS); -} - -isc_boolean_t -isc_lex_isfile(isc_lex_t *lex) { - inputsource *source; - - REQUIRE(VALID_LEX(lex)); - - source = HEAD(lex->sources); - - if (source == NULL) - return (ISC_FALSE); - - return (source->is_file); -} diff --git a/lib/isc/lfsr.c b/lib/isc/lfsr.c deleted file mode 100644 index 0b8d782ec33a..000000000000 --- a/lib/isc/lfsr.c +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: lfsr.c,v 1.20 2007/06/19 23:47:17 tbox Exp $ */ - -/*! \file */ - -#include - -#include -#include - -#include -#include -#include - -#define VALID_LFSR(x) (x != NULL) - -void -isc_lfsr_init(isc_lfsr_t *lfsr, isc_uint32_t state, unsigned int bits, - isc_uint32_t tap, unsigned int count, - isc_lfsrreseed_t reseed, void *arg) -{ - REQUIRE(VALID_LFSR(lfsr)); - REQUIRE(8 <= bits && bits <= 32); - REQUIRE(tap != 0); - - lfsr->state = state; - lfsr->bits = bits; - lfsr->tap = tap; - lfsr->count = count; - lfsr->reseed = reseed; - lfsr->arg = arg; - - if (count == 0 && reseed != NULL) - reseed(lfsr, arg); - if (lfsr->state == 0) - lfsr->state = 0xffffffffU >> (32 - lfsr->bits); -} - -/*! - * Return the next state of the lfsr. - */ -static inline isc_uint32_t -lfsr_generate(isc_lfsr_t *lfsr) -{ - - /* - * If the previous state is zero, we must fill it with something - * here, or we will begin to generate an extremely predictable output. - * - * First, give the reseed function a crack at it. If the state is - * still 0, set it to all ones. - */ - if (lfsr->state == 0) { - if (lfsr->reseed != NULL) - lfsr->reseed(lfsr, lfsr->arg); - if (lfsr->state == 0) - lfsr->state = 0xffffffffU >> (32 - lfsr->bits); - } - - if (lfsr->state & 0x01) { - lfsr->state = (lfsr->state >> 1) ^ lfsr->tap; - return (1); - } else { - lfsr->state >>= 1; - return (0); - } -} - -void -isc_lfsr_generate(isc_lfsr_t *lfsr, void *data, unsigned int count) -{ - unsigned char *p; - unsigned int bit; - unsigned int byte; - - REQUIRE(VALID_LFSR(lfsr)); - REQUIRE(data != NULL); - REQUIRE(count > 0); - - p = data; - byte = count; - - while (byte--) { - *p = 0; - for (bit = 0; bit < 7; bit++) { - *p |= lfsr_generate(lfsr); - *p <<= 1; - } - *p |= lfsr_generate(lfsr); - p++; - } - - if (lfsr->count != 0 && lfsr->reseed != NULL) { - if (lfsr->count <= count * 8) - lfsr->reseed(lfsr, lfsr->arg); - else - lfsr->count -= (count * 8); - } -} - -static inline isc_uint32_t -lfsr_skipgenerate(isc_lfsr_t *lfsr, unsigned int skip) -{ - while (skip--) - (void)lfsr_generate(lfsr); - - (void)lfsr_generate(lfsr); - - return (lfsr->state); -} - -/* - * Skip "skip" states in "lfsr". - */ -void -isc_lfsr_skip(isc_lfsr_t *lfsr, unsigned int skip) -{ - REQUIRE(VALID_LFSR(lfsr)); - - while (skip--) - (void)lfsr_generate(lfsr); -} - -/* - * Skip states in lfsr1 and lfsr2 using the other's current state. - * Return the final state of lfsr1 ^ lfsr2. - */ -isc_uint32_t -isc_lfsr_generate32(isc_lfsr_t *lfsr1, isc_lfsr_t *lfsr2) -{ - isc_uint32_t state1, state2; - isc_uint32_t skip1, skip2; - - REQUIRE(VALID_LFSR(lfsr1)); - REQUIRE(VALID_LFSR(lfsr2)); - - skip1 = lfsr1->state & 0x01; - skip2 = lfsr2->state & 0x01; - - /* cross-skip. */ - state1 = lfsr_skipgenerate(lfsr1, skip2); - state2 = lfsr_skipgenerate(lfsr2, skip1); - - return (state1 ^ state2); -} diff --git a/lib/isc/mem.c b/lib/isc/mem.c deleted file mode 100644 index 5b4b16c570f6..000000000000 --- a/lib/isc/mem.c +++ /dev/null @@ -1,2477 +0,0 @@ -/* - * Copyright (C) 2004-2010, 2012 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1997-2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/*! \file */ - -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define MCTXLOCK(m, l) if (((m)->flags & ISC_MEMFLAG_NOLOCK) == 0) LOCK(l) -#define MCTXUNLOCK(m, l) if (((m)->flags & ISC_MEMFLAG_NOLOCK) == 0) UNLOCK(l) - -#ifndef ISC_MEM_DEBUGGING -#define ISC_MEM_DEBUGGING 0 -#endif -LIBISC_EXTERNAL_DATA unsigned int isc_mem_debugging = ISC_MEM_DEBUGGING; - -/* - * Constants. - */ - -#define DEF_MAX_SIZE 1100 -#define DEF_MEM_TARGET 4096 -#define ALIGNMENT_SIZE 8U /*%< must be a power of 2 */ -#define NUM_BASIC_BLOCKS 64 /*%< must be > 1 */ -#define TABLE_INCREMENT 1024 -#define DEBUGLIST_COUNT 1024 - -/* - * Types. - */ -typedef struct isc__mem isc__mem_t; -typedef struct isc__mempool isc__mempool_t; - -#if ISC_MEM_TRACKLINES -typedef struct debuglink debuglink_t; -struct debuglink { - ISC_LINK(debuglink_t) link; - const void *ptr[DEBUGLIST_COUNT]; - unsigned int size[DEBUGLIST_COUNT]; - const char *file[DEBUGLIST_COUNT]; - unsigned int line[DEBUGLIST_COUNT]; - unsigned int count; -}; - -#define FLARG_PASS , file, line -#define FLARG , const char *file, unsigned int line -#else -#define FLARG_PASS -#define FLARG -#endif - -typedef struct element element; -struct element { - element * next; -}; - -typedef struct { - /*! - * This structure must be ALIGNMENT_SIZE bytes. - */ - union { - size_t size; - isc__mem_t *ctx; - char bytes[ALIGNMENT_SIZE]; - } u; -} size_info; - -struct stats { - unsigned long gets; - unsigned long totalgets; - unsigned long blocks; - unsigned long freefrags; -}; - -#define MEM_MAGIC ISC_MAGIC('M', 'e', 'm', 'C') -#define VALID_CONTEXT(c) ISC_MAGIC_VALID(c, MEM_MAGIC) - -#if ISC_MEM_TRACKLINES -typedef ISC_LIST(debuglink_t) debuglist_t; -#endif - -/* List of all active memory contexts. */ - -static ISC_LIST(isc__mem_t) contexts; -static isc_once_t once = ISC_ONCE_INIT; -static isc_mutex_t lock; - -/*% - * Total size of lost memory due to a bug of external library. - * Locked by the global lock. - */ -static isc_uint64_t totallost; - -struct isc__mem { - isc_mem_t common; - isc_ondestroy_t ondestroy; - unsigned int flags; - isc_mutex_t lock; - isc_memalloc_t memalloc; - isc_memfree_t memfree; - void * arg; - size_t max_size; - isc_boolean_t checkfree; - struct stats * stats; - unsigned int references; - char name[16]; - void * tag; - size_t quota; - size_t total; - size_t inuse; - size_t maxinuse; - size_t hi_water; - size_t lo_water; - isc_boolean_t hi_called; - isc_boolean_t is_overmem; - isc_mem_water_t water; - void * water_arg; - ISC_LIST(isc__mempool_t) pools; - unsigned int poolcnt; - - /* ISC_MEMFLAG_INTERNAL */ - size_t mem_target; - element ** freelists; - element * basic_blocks; - unsigned char ** basic_table; - unsigned int basic_table_count; - unsigned int basic_table_size; - unsigned char * lowest; - unsigned char * highest; - -#if ISC_MEM_TRACKLINES - debuglist_t * debuglist; - unsigned int debuglistcnt; -#endif - - unsigned int memalloc_failures; - ISC_LINK(isc__mem_t) link; -}; - -#define MEMPOOL_MAGIC ISC_MAGIC('M', 'E', 'M', 'p') -#define VALID_MEMPOOL(c) ISC_MAGIC_VALID(c, MEMPOOL_MAGIC) - -struct isc__mempool { - /* always unlocked */ - isc_mempool_t common; /*%< common header of mempool's */ - isc_mutex_t *lock; /*%< optional lock */ - isc__mem_t *mctx; /*%< our memory context */ - /*%< locked via the memory context's lock */ - ISC_LINK(isc__mempool_t) link; /*%< next pool in this mem context */ - /*%< optionally locked from here down */ - element *items; /*%< low water item list */ - size_t size; /*%< size of each item on this pool */ - unsigned int maxalloc; /*%< max number of items allowed */ - unsigned int allocated; /*%< # of items currently given out */ - unsigned int freecount; /*%< # of items on reserved list */ - unsigned int freemax; /*%< # of items allowed on free list */ - unsigned int fillcount; /*%< # of items to fetch on each fill */ - /*%< Stats only. */ - unsigned int gets; /*%< # of requests to this pool */ - /*%< Debugging only. */ -#if ISC_MEMPOOL_NAMES - char name[16]; /*%< printed name in stats reports */ -#endif -}; - -/* - * Private Inline-able. - */ - -#if ! ISC_MEM_TRACKLINES -#define ADD_TRACE(a, b, c, d, e) -#define DELETE_TRACE(a, b, c, d, e) -#else -#define ADD_TRACE(a, b, c, d, e) \ - do { \ - if ((isc_mem_debugging & (ISC_MEM_DEBUGTRACE | \ - ISC_MEM_DEBUGRECORD)) != 0 && \ - b != NULL) \ - add_trace_entry(a, b, c, d, e); \ - } while (0) -#define DELETE_TRACE(a, b, c, d, e) delete_trace_entry(a, b, c, d, e) - -static void -print_active(isc__mem_t *ctx, FILE *out); - -/*% - * The following can be either static or public, depending on build environment. - */ - -#ifdef BIND9 -#define ISC_MEMFUNC_SCOPE -#else -#define ISC_MEMFUNC_SCOPE static -#endif - -ISC_MEMFUNC_SCOPE isc_result_t -isc__mem_createx(size_t init_max_size, size_t target_size, - isc_memalloc_t memalloc, isc_memfree_t memfree, void *arg, - isc_mem_t **ctxp); -ISC_MEMFUNC_SCOPE isc_result_t -isc__mem_createx2(size_t init_max_size, size_t target_size, - isc_memalloc_t memalloc, isc_memfree_t memfree, void *arg, - isc_mem_t **ctxp, unsigned int flags); -ISC_MEMFUNC_SCOPE isc_result_t -isc__mem_create(size_t init_max_size, size_t target_size, isc_mem_t **ctxp); -ISC_MEMFUNC_SCOPE isc_result_t -isc__mem_create2(size_t init_max_size, size_t target_size, - isc_mem_t **ctxp, unsigned int flags); -ISC_MEMFUNC_SCOPE void -isc__mem_attach(isc_mem_t *source, isc_mem_t **targetp); -ISC_MEMFUNC_SCOPE void -isc__mem_detach(isc_mem_t **ctxp); -ISC_MEMFUNC_SCOPE void -isc___mem_putanddetach(isc_mem_t **ctxp, void *ptr, size_t size FLARG); -ISC_MEMFUNC_SCOPE void -isc__mem_destroy(isc_mem_t **ctxp); -ISC_MEMFUNC_SCOPE isc_result_t -isc__mem_ondestroy(isc_mem_t *ctx, isc_task_t *task, isc_event_t **event); -ISC_MEMFUNC_SCOPE void * -isc___mem_get(isc_mem_t *ctx, size_t size FLARG); -ISC_MEMFUNC_SCOPE void -isc___mem_put(isc_mem_t *ctx, void *ptr, size_t size FLARG); -ISC_MEMFUNC_SCOPE void -isc__mem_stats(isc_mem_t *ctx, FILE *out); -ISC_MEMFUNC_SCOPE void * -isc___mem_allocate(isc_mem_t *ctx, size_t size FLARG); -ISC_MEMFUNC_SCOPE void * -isc___mem_reallocate(isc_mem_t *ctx, void *ptr, size_t size FLARG); -ISC_MEMFUNC_SCOPE void -isc___mem_free(isc_mem_t *ctx, void *ptr FLARG); -ISC_MEMFUNC_SCOPE char * -isc___mem_strdup(isc_mem_t *mctx, const char *s FLARG); -ISC_MEMFUNC_SCOPE void -isc__mem_setdestroycheck(isc_mem_t *ctx, isc_boolean_t flag); -ISC_MEMFUNC_SCOPE void -isc__mem_setquota(isc_mem_t *ctx, size_t quota); -ISC_MEMFUNC_SCOPE size_t -isc__mem_getquota(isc_mem_t *ctx); -ISC_MEMFUNC_SCOPE size_t -isc__mem_inuse(isc_mem_t *ctx); -ISC_MEMFUNC_SCOPE isc_boolean_t -isc__mem_isovermem(isc_mem_t *ctx); -ISC_MEMFUNC_SCOPE void -isc__mem_setwater(isc_mem_t *ctx, isc_mem_water_t water, void *water_arg, - size_t hiwater, size_t lowater); -ISC_MEMFUNC_SCOPE void -isc__mem_waterack(isc_mem_t *ctx0, int flag); -ISC_MEMFUNC_SCOPE void -isc__mem_setname(isc_mem_t *ctx, const char *name, void *tag); -ISC_MEMFUNC_SCOPE const char * -isc__mem_getname(isc_mem_t *ctx); -ISC_MEMFUNC_SCOPE void * -isc__mem_gettag(isc_mem_t *ctx); -ISC_MEMFUNC_SCOPE isc_result_t -isc__mempool_create(isc_mem_t *mctx, size_t size, isc_mempool_t **mpctxp); -ISC_MEMFUNC_SCOPE void -isc__mempool_setname(isc_mempool_t *mpctx, const char *name); -ISC_MEMFUNC_SCOPE void -isc__mempool_destroy(isc_mempool_t **mpctxp); -ISC_MEMFUNC_SCOPE void -isc__mempool_associatelock(isc_mempool_t *mpctx, isc_mutex_t *lock); -ISC_MEMFUNC_SCOPE void * -isc___mempool_get(isc_mempool_t *mpctx FLARG); -ISC_MEMFUNC_SCOPE void -isc___mempool_put(isc_mempool_t *mpctx, void *mem FLARG); -ISC_MEMFUNC_SCOPE void -isc__mempool_setfreemax(isc_mempool_t *mpctx, unsigned int limit); -ISC_MEMFUNC_SCOPE unsigned int -isc__mempool_getfreemax(isc_mempool_t *mpctx); -ISC_MEMFUNC_SCOPE unsigned int -isc__mempool_getfreecount(isc_mempool_t *mpctx); -ISC_MEMFUNC_SCOPE void -isc__mempool_setmaxalloc(isc_mempool_t *mpctx, unsigned int limit); -ISC_MEMFUNC_SCOPE unsigned int -isc__mempool_getmaxalloc(isc_mempool_t *mpctx); -ISC_MEMFUNC_SCOPE unsigned int -isc__mempool_getallocated(isc_mempool_t *mpctx); -ISC_MEMFUNC_SCOPE void -isc__mempool_setfillcount(isc_mempool_t *mpctx, unsigned int limit); -ISC_MEMFUNC_SCOPE unsigned int -isc__mempool_getfillcount(isc_mempool_t *mpctx); -#ifdef BIND9 -ISC_MEMFUNC_SCOPE void -isc__mem_printactive(isc_mem_t *ctx0, FILE *file); -ISC_MEMFUNC_SCOPE void -isc__mem_printallactive(FILE *file); -ISC_MEMFUNC_SCOPE void -isc__mem_checkdestroyed(FILE *file); -ISC_MEMFUNC_SCOPE unsigned int -isc__mem_references(isc_mem_t *ctx0); -#endif - -static struct isc__memmethods { - isc_memmethods_t methods; - - /*% - * The following are defined just for avoiding unused static functions. - */ -#ifndef BIND9 - void *createx, *create, *create2, *ondestroy, *stats, - *setquota, *getquota, *setname, *getname, *gettag; -#endif -} memmethods = { - { - isc__mem_attach, - isc__mem_detach, - isc__mem_destroy, - isc___mem_get, - isc___mem_put, - isc___mem_putanddetach, - isc___mem_allocate, - isc___mem_reallocate, - isc___mem_strdup, - isc___mem_free, - isc__mem_setdestroycheck, - isc__mem_setwater, - isc__mem_waterack, - isc__mem_inuse, - isc__mem_isovermem, - isc__mempool_create - } -#ifndef BIND9 - , - (void *)isc__mem_createx, (void *)isc__mem_create, - (void *)isc__mem_create2, (void *)isc__mem_ondestroy, - (void *)isc__mem_stats, (void *)isc__mem_setquota, - (void *)isc__mem_getquota, (void *)isc__mem_setname, - (void *)isc__mem_getname, (void *)isc__mem_gettag -#endif -}; - -static struct isc__mempoolmethods { - isc_mempoolmethods_t methods; - - /*% - * The following are defined just for avoiding unused static functions. - */ -#ifndef BIND9 - void *getfreemax, *getfreecount, *getmaxalloc, *getfillcount; -#endif -} mempoolmethods = { - { - isc__mempool_destroy, - isc___mempool_get, - isc___mempool_put, - isc__mempool_getallocated, - isc__mempool_setmaxalloc, - isc__mempool_setfreemax, - isc__mempool_setname, - isc__mempool_associatelock, - isc__mempool_setfillcount - } -#ifndef BIND9 - , - (void *)isc__mempool_getfreemax, (void *)isc__mempool_getfreecount, - (void *)isc__mempool_getmaxalloc, (void *)isc__mempool_getfillcount -#endif -}; - -/*! - * mctx must be locked. - */ -static inline void -add_trace_entry(isc__mem_t *mctx, const void *ptr, unsigned int size - FLARG) -{ - debuglink_t *dl; - unsigned int i; - unsigned int mysize = size; - - if ((isc_mem_debugging & ISC_MEM_DEBUGTRACE) != 0) - fprintf(stderr, isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, - ISC_MSG_ADDTRACE, - "add %p size %u " - "file %s line %u mctx %p\n"), - ptr, size, file, line, mctx); - - if (mctx->debuglist == NULL) - return; - - if (mysize > mctx->max_size) - mysize = mctx->max_size; - - dl = ISC_LIST_HEAD(mctx->debuglist[mysize]); - while (dl != NULL) { - if (dl->count == DEBUGLIST_COUNT) - goto next; - for (i = 0; i < DEBUGLIST_COUNT; i++) { - if (dl->ptr[i] == NULL) { - dl->ptr[i] = ptr; - dl->size[i] = size; - dl->file[i] = file; - dl->line[i] = line; - dl->count++; - return; - } - } - next: - dl = ISC_LIST_NEXT(dl, link); - } - - dl = malloc(sizeof(debuglink_t)); - INSIST(dl != NULL); - - ISC_LINK_INIT(dl, link); - for (i = 1; i < DEBUGLIST_COUNT; i++) { - dl->ptr[i] = NULL; - dl->size[i] = 0; - dl->file[i] = NULL; - dl->line[i] = 0; - } - - dl->ptr[0] = ptr; - dl->size[0] = size; - dl->file[0] = file; - dl->line[0] = line; - dl->count = 1; - - ISC_LIST_PREPEND(mctx->debuglist[mysize], dl, link); - mctx->debuglistcnt++; -} - -static inline void -delete_trace_entry(isc__mem_t *mctx, const void *ptr, unsigned int size, - const char *file, unsigned int line) -{ - debuglink_t *dl; - unsigned int i; - - if ((isc_mem_debugging & ISC_MEM_DEBUGTRACE) != 0) - fprintf(stderr, isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, - ISC_MSG_DELTRACE, - "del %p size %u " - "file %s line %u mctx %p\n"), - ptr, size, file, line, mctx); - - if (mctx->debuglist == NULL) - return; - - if (size > mctx->max_size) - size = mctx->max_size; - - dl = ISC_LIST_HEAD(mctx->debuglist[size]); - while (dl != NULL) { - for (i = 0; i < DEBUGLIST_COUNT; i++) { - if (dl->ptr[i] == ptr) { - dl->ptr[i] = NULL; - dl->size[i] = 0; - dl->file[i] = NULL; - dl->line[i] = 0; - - INSIST(dl->count > 0); - dl->count--; - if (dl->count == 0) { - ISC_LIST_UNLINK(mctx->debuglist[size], - dl, link); - free(dl); - } - return; - } - } - dl = ISC_LIST_NEXT(dl, link); - } - - /* - * If we get here, we didn't find the item on the list. We're - * screwed. - */ - INSIST(dl != NULL); -} -#endif /* ISC_MEM_TRACKLINES */ - -static inline size_t -rmsize(size_t size) { - /* - * round down to ALIGNMENT_SIZE - */ - return (size & (~(ALIGNMENT_SIZE - 1))); -} - -static inline size_t -quantize(size_t size) { - /*! - * Round up the result in order to get a size big - * enough to satisfy the request and be aligned on ALIGNMENT_SIZE - * byte boundaries. - */ - - if (size == 0U) - return (ALIGNMENT_SIZE); - return ((size + ALIGNMENT_SIZE - 1) & (~(ALIGNMENT_SIZE - 1))); -} - -static inline isc_boolean_t -more_basic_blocks(isc__mem_t *ctx) { - void *new; - unsigned char *curr, *next; - unsigned char *first, *last; - unsigned char **table; - unsigned int table_size; - size_t increment; - int i; - - /* Require: we hold the context lock. */ - - /* - * Did we hit the quota for this context? - */ - increment = NUM_BASIC_BLOCKS * ctx->mem_target; - if (ctx->quota != 0U && ctx->total + increment > ctx->quota) - return (ISC_FALSE); - - INSIST(ctx->basic_table_count <= ctx->basic_table_size); - if (ctx->basic_table_count == ctx->basic_table_size) { - table_size = ctx->basic_table_size + TABLE_INCREMENT; - table = (ctx->memalloc)(ctx->arg, - table_size * sizeof(unsigned char *)); - if (table == NULL) { - ctx->memalloc_failures++; - return (ISC_FALSE); - } - if (ctx->basic_table_size != 0) { - memcpy(table, ctx->basic_table, - ctx->basic_table_size * - sizeof(unsigned char *)); - (ctx->memfree)(ctx->arg, ctx->basic_table); - } - ctx->basic_table = table; - ctx->basic_table_size = table_size; - } - - new = (ctx->memalloc)(ctx->arg, NUM_BASIC_BLOCKS * ctx->mem_target); - if (new == NULL) { - ctx->memalloc_failures++; - return (ISC_FALSE); - } - ctx->total += increment; - ctx->basic_table[ctx->basic_table_count] = new; - ctx->basic_table_count++; - - curr = new; - next = curr + ctx->mem_target; - for (i = 0; i < (NUM_BASIC_BLOCKS - 1); i++) { - ((element *)curr)->next = (element *)next; - curr = next; - next += ctx->mem_target; - } - /* - * curr is now pointing at the last block in the - * array. - */ - ((element *)curr)->next = NULL; - first = new; - last = first + NUM_BASIC_BLOCKS * ctx->mem_target - 1; - if (first < ctx->lowest || ctx->lowest == NULL) - ctx->lowest = first; - if (last > ctx->highest) - ctx->highest = last; - ctx->basic_blocks = new; - - return (ISC_TRUE); -} - -static inline isc_boolean_t -more_frags(isc__mem_t *ctx, size_t new_size) { - int i, frags; - size_t total_size; - void *new; - unsigned char *curr, *next; - - /*! - * Try to get more fragments by chopping up a basic block. - */ - - if (ctx->basic_blocks == NULL) { - if (!more_basic_blocks(ctx)) { - /* - * We can't get more memory from the OS, or we've - * hit the quota for this context. - */ - /* - * XXXRTH "At quota" notification here. - */ - return (ISC_FALSE); - } - } - - total_size = ctx->mem_target; - new = ctx->basic_blocks; - ctx->basic_blocks = ctx->basic_blocks->next; - frags = total_size / new_size; - ctx->stats[new_size].blocks++; - ctx->stats[new_size].freefrags += frags; - /* - * Set up a linked-list of blocks of size - * "new_size". - */ - curr = new; - next = curr + new_size; - total_size -= new_size; - for (i = 0; i < (frags - 1); i++) { - ((element *)curr)->next = (element *)next; - curr = next; - next += new_size; - total_size -= new_size; - } - /* - * Add the remaining fragment of the basic block to a free list. - */ - total_size = rmsize(total_size); - if (total_size > 0U) { - ((element *)next)->next = ctx->freelists[total_size]; - ctx->freelists[total_size] = (element *)next; - ctx->stats[total_size].freefrags++; - } - /* - * curr is now pointing at the last block in the - * array. - */ - ((element *)curr)->next = NULL; - ctx->freelists[new_size] = new; - - return (ISC_TRUE); -} - -static inline void * -mem_getunlocked(isc__mem_t *ctx, size_t size) { - size_t new_size = quantize(size); - void *ret; - - if (size >= ctx->max_size || new_size >= ctx->max_size) { - /* - * memget() was called on something beyond our upper limit. - */ - if (ctx->quota != 0U && ctx->total + size > ctx->quota) { - ret = NULL; - goto done; - } - ret = (ctx->memalloc)(ctx->arg, size); - if (ret == NULL) { - ctx->memalloc_failures++; - goto done; - } - ctx->total += size; - ctx->inuse += size; - ctx->stats[ctx->max_size].gets++; - ctx->stats[ctx->max_size].totalgets++; - /* - * If we don't set new_size to size, then the - * ISC_MEM_FILL code might write over bytes we - * don't own. - */ - new_size = size; - goto done; - } - - /* - * If there are no blocks in the free list for this size, get a chunk - * of memory and then break it up into "new_size"-sized blocks, adding - * them to the free list. - */ - if (ctx->freelists[new_size] == NULL && !more_frags(ctx, new_size)) - return (NULL); - - /* - * The free list uses the "rounded-up" size "new_size". - */ - ret = ctx->freelists[new_size]; - ctx->freelists[new_size] = ctx->freelists[new_size]->next; - - /* - * The stats[] uses the _actual_ "size" requested by the - * caller, with the caveat (in the code above) that "size" >= the - * max. size (max_size) ends up getting recorded as a call to - * max_size. - */ - ctx->stats[size].gets++; - ctx->stats[size].totalgets++; - ctx->stats[new_size].freefrags--; - ctx->inuse += new_size; - - done: - -#if ISC_MEM_FILL - if (ret != NULL) - memset(ret, 0xbe, new_size); /* Mnemonic for "beef". */ -#endif - - return (ret); -} - -#if ISC_MEM_FILL && ISC_MEM_CHECKOVERRUN -static inline void -check_overrun(void *mem, size_t size, size_t new_size) { - unsigned char *cp; - - cp = (unsigned char *)mem; - cp += size; - while (size < new_size) { - INSIST(*cp == 0xbe); - cp++; - size++; - } -} -#endif - -static inline void -mem_putunlocked(isc__mem_t *ctx, void *mem, size_t size) { - size_t new_size = quantize(size); - - if (size == ctx->max_size || new_size >= ctx->max_size) { - /* - * memput() called on something beyond our upper limit. - */ -#if ISC_MEM_FILL - memset(mem, 0xde, size); /* Mnemonic for "dead". */ -#endif - (ctx->memfree)(ctx->arg, mem); - INSIST(ctx->stats[ctx->max_size].gets != 0U); - ctx->stats[ctx->max_size].gets--; - INSIST(size <= ctx->total); - ctx->inuse -= size; - ctx->total -= size; - return; - } - -#if ISC_MEM_FILL -#if ISC_MEM_CHECKOVERRUN - check_overrun(mem, size, new_size); -#endif - memset(mem, 0xde, new_size); /* Mnemonic for "dead". */ -#endif - - /* - * The free list uses the "rounded-up" size "new_size". - */ - ((element *)mem)->next = ctx->freelists[new_size]; - ctx->freelists[new_size] = (element *)mem; - - /* - * The stats[] uses the _actual_ "size" requested by the - * caller, with the caveat (in the code above) that "size" >= the - * max. size (max_size) ends up getting recorded as a call to - * max_size. - */ - INSIST(ctx->stats[size].gets != 0U); - ctx->stats[size].gets--; - ctx->stats[new_size].freefrags++; - ctx->inuse -= new_size; -} - -/*! - * Perform a malloc, doing memory filling and overrun detection as necessary. - */ -static inline void * -mem_get(isc__mem_t *ctx, size_t size) { - char *ret; - -#if ISC_MEM_CHECKOVERRUN - size += 1; -#endif - - ret = (ctx->memalloc)(ctx->arg, size); - if (ret == NULL) - ctx->memalloc_failures++; - -#if ISC_MEM_FILL - if (ret != NULL) - memset(ret, 0xbe, size); /* Mnemonic for "beef". */ -#else -# if ISC_MEM_CHECKOVERRUN - if (ret != NULL) - ret[size-1] = 0xbe; -# endif -#endif - - return (ret); -} - -/*! - * Perform a free, doing memory filling and overrun detection as necessary. - */ -static inline void -mem_put(isc__mem_t *ctx, void *mem, size_t size) { -#if ISC_MEM_CHECKOVERRUN - INSIST(((unsigned char *)mem)[size] == 0xbe); -#endif -#if ISC_MEM_FILL - memset(mem, 0xde, size); /* Mnemonic for "dead". */ -#else - UNUSED(size); -#endif - (ctx->memfree)(ctx->arg, mem); -} - -/*! - * Update internal counters after a memory get. - */ -static inline void -mem_getstats(isc__mem_t *ctx, size_t size) { - ctx->total += size; - ctx->inuse += size; - - if (size > ctx->max_size) { - ctx->stats[ctx->max_size].gets++; - ctx->stats[ctx->max_size].totalgets++; - } else { - ctx->stats[size].gets++; - ctx->stats[size].totalgets++; - } -} - -/*! - * Update internal counters after a memory put. - */ -static inline void -mem_putstats(isc__mem_t *ctx, void *ptr, size_t size) { - UNUSED(ptr); - - INSIST(ctx->inuse >= size); - ctx->inuse -= size; - - if (size > ctx->max_size) { - INSIST(ctx->stats[ctx->max_size].gets > 0U); - ctx->stats[ctx->max_size].gets--; - } else { - INSIST(ctx->stats[size].gets > 0U); - ctx->stats[size].gets--; - } -} - -/* - * Private. - */ - -static void * -default_memalloc(void *arg, size_t size) { - UNUSED(arg); - if (size == 0U) - size = 1; - return (malloc(size)); -} - -static void -default_memfree(void *arg, void *ptr) { - UNUSED(arg); - free(ptr); -} - -static void -initialize_action(void) { - RUNTIME_CHECK(isc_mutex_init(&lock) == ISC_R_SUCCESS); - ISC_LIST_INIT(contexts); - totallost = 0; -} - -/* - * Public. - */ - -ISC_MEMFUNC_SCOPE isc_result_t -isc__mem_createx(size_t init_max_size, size_t target_size, - isc_memalloc_t memalloc, isc_memfree_t memfree, void *arg, - isc_mem_t **ctxp) -{ - return (isc__mem_createx2(init_max_size, target_size, memalloc, memfree, - arg, ctxp, ISC_MEMFLAG_DEFAULT)); - -} - -ISC_MEMFUNC_SCOPE isc_result_t -isc__mem_createx2(size_t init_max_size, size_t target_size, - isc_memalloc_t memalloc, isc_memfree_t memfree, void *arg, - isc_mem_t **ctxp, unsigned int flags) -{ - isc__mem_t *ctx; - isc_result_t result; - - REQUIRE(ctxp != NULL && *ctxp == NULL); - REQUIRE(memalloc != NULL); - REQUIRE(memfree != NULL); - - INSIST((ALIGNMENT_SIZE & (ALIGNMENT_SIZE - 1)) == 0); - - RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS); - - ctx = (memalloc)(arg, sizeof(*ctx)); - if (ctx == NULL) - return (ISC_R_NOMEMORY); - - if ((flags & ISC_MEMFLAG_NOLOCK) == 0) { - result = isc_mutex_init(&ctx->lock); - if (result != ISC_R_SUCCESS) { - (memfree)(arg, ctx); - return (result); - } - } - - if (init_max_size == 0U) - ctx->max_size = DEF_MAX_SIZE; - else - ctx->max_size = init_max_size; - ctx->flags = flags; - ctx->references = 1; - memset(ctx->name, 0, sizeof(ctx->name)); - ctx->tag = NULL; - ctx->quota = 0; - ctx->total = 0; - ctx->inuse = 0; - ctx->maxinuse = 0; - ctx->hi_water = 0; - ctx->lo_water = 0; - ctx->hi_called = ISC_FALSE; - ctx->is_overmem = ISC_FALSE; - ctx->water = NULL; - ctx->water_arg = NULL; - ctx->common.impmagic = MEM_MAGIC; - ctx->common.magic = ISCAPI_MCTX_MAGIC; - ctx->common.methods = (isc_memmethods_t *)&memmethods; - isc_ondestroy_init(&ctx->ondestroy); - ctx->memalloc = memalloc; - ctx->memfree = memfree; - ctx->arg = arg; - ctx->stats = NULL; - ctx->checkfree = ISC_TRUE; -#if ISC_MEM_TRACKLINES - ctx->debuglist = NULL; - ctx->debuglistcnt = 0; -#endif - ISC_LIST_INIT(ctx->pools); - ctx->poolcnt = 0; - ctx->freelists = NULL; - ctx->basic_blocks = NULL; - ctx->basic_table = NULL; - ctx->basic_table_count = 0; - ctx->basic_table_size = 0; - ctx->lowest = NULL; - ctx->highest = NULL; - - ctx->stats = (memalloc)(arg, - (ctx->max_size+1) * sizeof(struct stats)); - if (ctx->stats == NULL) { - result = ISC_R_NOMEMORY; - goto error; - } - memset(ctx->stats, 0, (ctx->max_size + 1) * sizeof(struct stats)); - - if ((flags & ISC_MEMFLAG_INTERNAL) != 0) { - if (target_size == 0U) - ctx->mem_target = DEF_MEM_TARGET; - else - ctx->mem_target = target_size; - ctx->freelists = (memalloc)(arg, ctx->max_size * - sizeof(element *)); - if (ctx->freelists == NULL) { - result = ISC_R_NOMEMORY; - goto error; - } - memset(ctx->freelists, 0, - ctx->max_size * sizeof(element *)); - } - -#if ISC_MEM_TRACKLINES - if ((isc_mem_debugging & ISC_MEM_DEBUGRECORD) != 0) { - unsigned int i; - - ctx->debuglist = (memalloc)(arg, - (ctx->max_size+1) * sizeof(debuglist_t)); - if (ctx->debuglist == NULL) { - result = ISC_R_NOMEMORY; - goto error; - } - for (i = 0; i <= ctx->max_size; i++) - ISC_LIST_INIT(ctx->debuglist[i]); - } -#endif - - ctx->memalloc_failures = 0; - - LOCK(&lock); - ISC_LIST_INITANDAPPEND(contexts, ctx, link); - UNLOCK(&lock); - - *ctxp = (isc_mem_t *)ctx; - return (ISC_R_SUCCESS); - - error: - if (ctx != NULL) { - if (ctx->stats != NULL) - (memfree)(arg, ctx->stats); - if (ctx->freelists != NULL) - (memfree)(arg, ctx->freelists); -#if ISC_MEM_TRACKLINES - if (ctx->debuglist != NULL) - (ctx->memfree)(ctx->arg, ctx->debuglist); -#endif /* ISC_MEM_TRACKLINES */ - if ((ctx->flags & ISC_MEMFLAG_NOLOCK) == 0) - DESTROYLOCK(&ctx->lock); - (memfree)(arg, ctx); - } - - return (result); -} - -ISC_MEMFUNC_SCOPE isc_result_t -isc__mem_create(size_t init_max_size, size_t target_size, isc_mem_t **ctxp) { - return (isc__mem_createx2(init_max_size, target_size, - default_memalloc, default_memfree, NULL, - ctxp, ISC_MEMFLAG_DEFAULT)); -} - -ISC_MEMFUNC_SCOPE isc_result_t -isc__mem_create2(size_t init_max_size, size_t target_size, - isc_mem_t **ctxp, unsigned int flags) -{ - return (isc__mem_createx2(init_max_size, target_size, - default_memalloc, default_memfree, NULL, - ctxp, flags)); -} - -static void -destroy(isc__mem_t *ctx) { - unsigned int i; - isc_ondestroy_t ondest; - - LOCK(&lock); - ISC_LIST_UNLINK(contexts, ctx, link); - totallost += ctx->inuse; - UNLOCK(&lock); - - ctx->common.impmagic = 0; - ctx->common.magic = 0; - - INSIST(ISC_LIST_EMPTY(ctx->pools)); - -#if ISC_MEM_TRACKLINES - if (ctx->debuglist != NULL) { - if (ctx->checkfree) { - for (i = 0; i <= ctx->max_size; i++) { - if (!ISC_LIST_EMPTY(ctx->debuglist[i])) - print_active(ctx, stderr); - INSIST(ISC_LIST_EMPTY(ctx->debuglist[i])); - } - } else { - debuglink_t *dl; - - for (i = 0; i <= ctx->max_size; i++) - for (dl = ISC_LIST_HEAD(ctx->debuglist[i]); - dl != NULL; - dl = ISC_LIST_HEAD(ctx->debuglist[i])) { - ISC_LIST_UNLINK(ctx->debuglist[i], - dl, link); - free(dl); - } - } - (ctx->memfree)(ctx->arg, ctx->debuglist); - } -#endif - INSIST(ctx->references == 0); - - if (ctx->checkfree) { - for (i = 0; i <= ctx->max_size; i++) { -#if ISC_MEM_TRACKLINES - if (ctx->stats[i].gets != 0U) - print_active(ctx, stderr); -#endif - INSIST(ctx->stats[i].gets == 0U); - } - } - - (ctx->memfree)(ctx->arg, ctx->stats); - - if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { - for (i = 0; i < ctx->basic_table_count; i++) - (ctx->memfree)(ctx->arg, ctx->basic_table[i]); - (ctx->memfree)(ctx->arg, ctx->freelists); - if (ctx->basic_table != NULL) - (ctx->memfree)(ctx->arg, ctx->basic_table); - } - - ondest = ctx->ondestroy; - - if ((ctx->flags & ISC_MEMFLAG_NOLOCK) == 0) - DESTROYLOCK(&ctx->lock); - (ctx->memfree)(ctx->arg, ctx); - - isc_ondestroy_notify(&ondest, ctx); -} - -ISC_MEMFUNC_SCOPE void -isc__mem_attach(isc_mem_t *source0, isc_mem_t **targetp) { - isc__mem_t *source = (isc__mem_t *)source0; - - REQUIRE(VALID_CONTEXT(source)); - REQUIRE(targetp != NULL && *targetp == NULL); - - MCTXLOCK(source, &source->lock); - source->references++; - MCTXUNLOCK(source, &source->lock); - - *targetp = (isc_mem_t *)source; -} - -ISC_MEMFUNC_SCOPE void -isc__mem_detach(isc_mem_t **ctxp) { - isc__mem_t *ctx; - isc_boolean_t want_destroy = ISC_FALSE; - - REQUIRE(ctxp != NULL); - ctx = (isc__mem_t *)*ctxp; - REQUIRE(VALID_CONTEXT(ctx)); - - MCTXLOCK(ctx, &ctx->lock); - INSIST(ctx->references > 0); - ctx->references--; - if (ctx->references == 0) - want_destroy = ISC_TRUE; - MCTXUNLOCK(ctx, &ctx->lock); - - if (want_destroy) - destroy(ctx); - - *ctxp = NULL; -} - -/* - * isc_mem_putanddetach() is the equivalent of: - * - * mctx = NULL; - * isc_mem_attach(ptr->mctx, &mctx); - * isc_mem_detach(&ptr->mctx); - * isc_mem_put(mctx, ptr, sizeof(*ptr); - * isc_mem_detach(&mctx); - */ - -ISC_MEMFUNC_SCOPE void -isc___mem_putanddetach(isc_mem_t **ctxp, void *ptr, size_t size FLARG) { - isc__mem_t *ctx; - isc_boolean_t want_destroy = ISC_FALSE; - size_info *si; - size_t oldsize; - - REQUIRE(ctxp != NULL); - ctx = (isc__mem_t *)*ctxp; - REQUIRE(VALID_CONTEXT(ctx)); - REQUIRE(ptr != NULL); - - /* - * Must be before mem_putunlocked() as ctxp is usually within - * [ptr..ptr+size). - */ - *ctxp = NULL; - - if ((isc_mem_debugging & (ISC_MEM_DEBUGSIZE|ISC_MEM_DEBUGCTX)) != 0) { - if ((isc_mem_debugging & ISC_MEM_DEBUGSIZE) != 0) { - si = &(((size_info *)ptr)[-1]); - oldsize = si->u.size - ALIGNMENT_SIZE; - if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0) - oldsize -= ALIGNMENT_SIZE; - INSIST(oldsize == size); - } - isc_mem_free((isc_mem_t *)ctx, ptr); - - MCTXLOCK(ctx, &ctx->lock); - ctx->references--; - if (ctx->references == 0) - want_destroy = ISC_TRUE; - MCTXUNLOCK(ctx, &ctx->lock); - if (want_destroy) - destroy(ctx); - - return; - } - - if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { - MCTXLOCK(ctx, &ctx->lock); - mem_putunlocked(ctx, ptr, size); - } else { - mem_put(ctx, ptr, size); - MCTXLOCK(ctx, &ctx->lock); - mem_putstats(ctx, ptr, size); - } - - DELETE_TRACE(ctx, ptr, size, file, line); - INSIST(ctx->references > 0); - ctx->references--; - if (ctx->references == 0) - want_destroy = ISC_TRUE; - - MCTXUNLOCK(ctx, &ctx->lock); - - if (want_destroy) - destroy(ctx); -} - -ISC_MEMFUNC_SCOPE void -isc__mem_destroy(isc_mem_t **ctxp) { - isc__mem_t *ctx; - - /* - * This routine provides legacy support for callers who use mctxs - * without attaching/detaching. - */ - - REQUIRE(ctxp != NULL); - ctx = (isc__mem_t *)*ctxp; - REQUIRE(VALID_CONTEXT(ctx)); - - MCTXLOCK(ctx, &ctx->lock); -#if ISC_MEM_TRACKLINES - if (ctx->references != 1) - print_active(ctx, stderr); -#endif - REQUIRE(ctx->references == 1); - ctx->references--; - MCTXUNLOCK(ctx, &ctx->lock); - - destroy(ctx); - - *ctxp = NULL; -} - -ISC_MEMFUNC_SCOPE isc_result_t -isc__mem_ondestroy(isc_mem_t *ctx0, isc_task_t *task, isc_event_t **event) { - isc__mem_t *ctx = (isc__mem_t *)ctx0; - isc_result_t res; - - MCTXLOCK(ctx, &ctx->lock); - res = isc_ondestroy_register(&ctx->ondestroy, task, event); - MCTXUNLOCK(ctx, &ctx->lock); - - return (res); -} - -ISC_MEMFUNC_SCOPE void * -isc___mem_get(isc_mem_t *ctx0, size_t size FLARG) { - isc__mem_t *ctx = (isc__mem_t *)ctx0; - void *ptr; - isc_boolean_t call_water = ISC_FALSE; - - REQUIRE(VALID_CONTEXT(ctx)); - - if ((isc_mem_debugging & (ISC_MEM_DEBUGSIZE|ISC_MEM_DEBUGCTX)) != 0) - return (isc__mem_allocate(ctx0, size FLARG_PASS)); - - if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { - MCTXLOCK(ctx, &ctx->lock); - ptr = mem_getunlocked(ctx, size); - } else { - ptr = mem_get(ctx, size); - MCTXLOCK(ctx, &ctx->lock); - if (ptr != NULL) - mem_getstats(ctx, size); - } - - ADD_TRACE(ctx, ptr, size, file, line); - if (ctx->hi_water != 0U && ctx->inuse > ctx->hi_water && - !ctx->is_overmem) { - ctx->is_overmem = ISC_TRUE; - } - if (ctx->hi_water != 0U && !ctx->hi_called && - ctx->inuse > ctx->hi_water) { - call_water = ISC_TRUE; - } - if (ctx->inuse > ctx->maxinuse) { - ctx->maxinuse = ctx->inuse; - if (ctx->hi_water != 0U && ctx->inuse > ctx->hi_water && - (isc_mem_debugging & ISC_MEM_DEBUGUSAGE) != 0) - fprintf(stderr, "maxinuse = %lu\n", - (unsigned long)ctx->inuse); - } - MCTXUNLOCK(ctx, &ctx->lock); - - if (call_water) - (ctx->water)(ctx->water_arg, ISC_MEM_HIWATER); - - return (ptr); -} - -ISC_MEMFUNC_SCOPE void -isc___mem_put(isc_mem_t *ctx0, void *ptr, size_t size FLARG) { - isc__mem_t *ctx = (isc__mem_t *)ctx0; - isc_boolean_t call_water = ISC_FALSE; - size_info *si; - size_t oldsize; - - REQUIRE(VALID_CONTEXT(ctx)); - REQUIRE(ptr != NULL); - - if ((isc_mem_debugging & (ISC_MEM_DEBUGSIZE|ISC_MEM_DEBUGCTX)) != 0) { - if ((isc_mem_debugging & ISC_MEM_DEBUGSIZE) != 0) { - si = &(((size_info *)ptr)[-1]); - oldsize = si->u.size - ALIGNMENT_SIZE; - if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0) - oldsize -= ALIGNMENT_SIZE; - INSIST(oldsize == size); - } - isc_mem_free((isc_mem_t *)ctx, ptr); - return; - } - - if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { - MCTXLOCK(ctx, &ctx->lock); - mem_putunlocked(ctx, ptr, size); - } else { - mem_put(ctx, ptr, size); - MCTXLOCK(ctx, &ctx->lock); - mem_putstats(ctx, ptr, size); - } - - DELETE_TRACE(ctx, ptr, size, file, line); - - /* - * The check against ctx->lo_water == 0 is for the condition - * when the context was pushed over hi_water but then had - * isc_mem_setwater() called with 0 for hi_water and lo_water. - */ - if (ctx->is_overmem && - (ctx->inuse < ctx->lo_water || ctx->lo_water == 0U)) { - ctx->is_overmem = ISC_FALSE; - } - if (ctx->hi_called && - (ctx->inuse < ctx->lo_water || ctx->lo_water == 0U)) { - if (ctx->water != NULL) - call_water = ISC_TRUE; - } - MCTXUNLOCK(ctx, &ctx->lock); - - if (call_water) - (ctx->water)(ctx->water_arg, ISC_MEM_LOWATER); -} - -ISC_MEMFUNC_SCOPE void -isc__mem_waterack(isc_mem_t *ctx0, int flag) { - isc__mem_t *ctx = (isc__mem_t *)ctx0; - - REQUIRE(VALID_CONTEXT(ctx)); - - MCTXLOCK(ctx, &ctx->lock); - if (flag == ISC_MEM_LOWATER) - ctx->hi_called = ISC_FALSE; - else if (flag == ISC_MEM_HIWATER) - ctx->hi_called = ISC_TRUE; - MCTXUNLOCK(ctx, &ctx->lock); -} - -#if ISC_MEM_TRACKLINES -static void -print_active(isc__mem_t *mctx, FILE *out) { - if (mctx->debuglist != NULL) { - debuglink_t *dl; - unsigned int i, j; - const char *format; - isc_boolean_t found; - - fprintf(out, "%s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, - ISC_MSG_DUMPALLOC, - "Dump of all outstanding " - "memory allocations:\n")); - found = ISC_FALSE; - format = isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, - ISC_MSG_PTRFILELINE, - "\tptr %p size %u file %s line %u\n"); - for (i = 0; i <= mctx->max_size; i++) { - dl = ISC_LIST_HEAD(mctx->debuglist[i]); - - if (dl != NULL) - found = ISC_TRUE; - - while (dl != NULL) { - for (j = 0; j < DEBUGLIST_COUNT; j++) - if (dl->ptr[j] != NULL) - fprintf(out, format, - dl->ptr[j], - dl->size[j], - dl->file[j], - dl->line[j]); - dl = ISC_LIST_NEXT(dl, link); - } - } - if (!found) - fprintf(out, "%s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, - ISC_MSG_NONE, "\tNone.\n")); - } -} -#endif - -/* - * Print the stats[] on the stream "out" with suitable formatting. - */ -ISC_MEMFUNC_SCOPE void -isc__mem_stats(isc_mem_t *ctx0, FILE *out) { - isc__mem_t *ctx = (isc__mem_t *)ctx0; - size_t i; - const struct stats *s; - const isc__mempool_t *pool; - - REQUIRE(VALID_CONTEXT(ctx)); - MCTXLOCK(ctx, &ctx->lock); - - for (i = 0; i <= ctx->max_size; i++) { - s = &ctx->stats[i]; - - if (s->totalgets == 0U && s->gets == 0U) - continue; - fprintf(out, "%s%5lu: %11lu gets, %11lu rem", - (i == ctx->max_size) ? ">=" : " ", - (unsigned long) i, s->totalgets, s->gets); - if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0 && - (s->blocks != 0U || s->freefrags != 0U)) - fprintf(out, " (%lu bl, %lu ff)", - s->blocks, s->freefrags); - fputc('\n', out); - } - - /* - * Note that since a pool can be locked now, these stats might be - * somewhat off if the pool is in active use at the time the stats - * are dumped. The link fields are protected by the isc_mem_t's - * lock, however, so walking this list and extracting integers from - * stats fields is always safe. - */ - pool = ISC_LIST_HEAD(ctx->pools); - if (pool != NULL) { - fprintf(out, "%s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, - ISC_MSG_POOLSTATS, - "[Pool statistics]\n")); - fprintf(out, "%15s %10s %10s %10s %10s %10s %10s %10s %1s\n", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, - ISC_MSG_POOLNAME, "name"), - isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, - ISC_MSG_POOLSIZE, "size"), - isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, - ISC_MSG_POOLMAXALLOC, "maxalloc"), - isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, - ISC_MSG_POOLALLOCATED, "allocated"), - isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, - ISC_MSG_POOLFREECOUNT, "freecount"), - isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, - ISC_MSG_POOLFREEMAX, "freemax"), - isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, - ISC_MSG_POOLFILLCOUNT, "fillcount"), - isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, - ISC_MSG_POOLGETS, "gets"), - "L"); - } - while (pool != NULL) { - fprintf(out, "%15s %10lu %10u %10u %10u %10u %10u %10u %s\n", - pool->name, (unsigned long) pool->size, pool->maxalloc, - pool->allocated, pool->freecount, pool->freemax, - pool->fillcount, pool->gets, - (pool->lock == NULL ? "N" : "Y")); - pool = ISC_LIST_NEXT(pool, link); - } - -#if ISC_MEM_TRACKLINES - print_active(ctx, out); -#endif - - MCTXUNLOCK(ctx, &ctx->lock); -} - -/* - * Replacements for malloc() and free() -- they implicitly remember the - * size of the object allocated (with some additional overhead). - */ - -static void * -isc__mem_allocateunlocked(isc_mem_t *ctx0, size_t size) { - isc__mem_t *ctx = (isc__mem_t *)ctx0; - size_info *si; - - size += ALIGNMENT_SIZE; - if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0) - size += ALIGNMENT_SIZE; - - if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) - si = mem_getunlocked(ctx, size); - else - si = mem_get(ctx, size); - - if (si == NULL) - return (NULL); - if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0) { - si->u.ctx = ctx; - si++; - } - si->u.size = size; - return (&si[1]); -} - -ISC_MEMFUNC_SCOPE void * -isc___mem_allocate(isc_mem_t *ctx0, size_t size FLARG) { - isc__mem_t *ctx = (isc__mem_t *)ctx0; - size_info *si; - isc_boolean_t call_water = ISC_FALSE; - - REQUIRE(VALID_CONTEXT(ctx)); - - if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { - MCTXLOCK(ctx, &ctx->lock); - si = isc__mem_allocateunlocked((isc_mem_t *)ctx, size); - } else { - si = isc__mem_allocateunlocked((isc_mem_t *)ctx, size); - MCTXLOCK(ctx, &ctx->lock); - if (si != NULL) - mem_getstats(ctx, si[-1].u.size); - } - -#if ISC_MEM_TRACKLINES - ADD_TRACE(ctx, si, si[-1].u.size, file, line); -#endif - if (ctx->hi_water != 0U && ctx->inuse > ctx->hi_water && - !ctx->is_overmem) { - ctx->is_overmem = ISC_TRUE; - } - - if (ctx->hi_water != 0U && !ctx->hi_called && - ctx->inuse > ctx->hi_water) { - ctx->hi_called = ISC_TRUE; - call_water = ISC_TRUE; - } - if (ctx->inuse > ctx->maxinuse) { - ctx->maxinuse = ctx->inuse; - if (ctx->hi_water != 0U && ctx->inuse > ctx->hi_water && - (isc_mem_debugging & ISC_MEM_DEBUGUSAGE) != 0) - fprintf(stderr, "maxinuse = %lu\n", - (unsigned long)ctx->inuse); - } - MCTXUNLOCK(ctx, &ctx->lock); - - if (call_water) - (ctx->water)(ctx->water_arg, ISC_MEM_HIWATER); - - return (si); -} - -ISC_MEMFUNC_SCOPE void * -isc___mem_reallocate(isc_mem_t *ctx0, void *ptr, size_t size FLARG) { - isc__mem_t *ctx = (isc__mem_t *)ctx0; - void *new_ptr = NULL; - size_t oldsize, copysize; - - REQUIRE(VALID_CONTEXT(ctx)); - - /* - * This function emulates the realloc(3) standard library function: - * - if size > 0, allocate new memory; and if ptr is non NULL, copy - * as much of the old contents to the new buffer and free the old one. - * Note that when allocation fails the original pointer is intact; - * the caller must free it. - * - if size is 0 and ptr is non NULL, simply free the given ptr. - * - this function returns: - * pointer to the newly allocated memory, or - * NULL if allocation fails or doesn't happen. - */ - if (size > 0U) { - new_ptr = isc__mem_allocate(ctx0, size FLARG_PASS); - if (new_ptr != NULL && ptr != NULL) { - oldsize = (((size_info *)ptr)[-1]).u.size; - INSIST(oldsize >= ALIGNMENT_SIZE); - oldsize -= ALIGNMENT_SIZE; - copysize = oldsize > size ? size : oldsize; - memcpy(new_ptr, ptr, copysize); - isc__mem_free(ctx0, ptr FLARG_PASS); - } - } else if (ptr != NULL) - isc__mem_free(ctx0, ptr FLARG_PASS); - - return (new_ptr); -} - -ISC_MEMFUNC_SCOPE void -isc___mem_free(isc_mem_t *ctx0, void *ptr FLARG) { - isc__mem_t *ctx = (isc__mem_t *)ctx0; - size_info *si; - size_t size; - isc_boolean_t call_water= ISC_FALSE; - - REQUIRE(VALID_CONTEXT(ctx)); - REQUIRE(ptr != NULL); - - if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0) { - si = &(((size_info *)ptr)[-2]); - REQUIRE(si->u.ctx == ctx); - size = si[1].u.size; - } else { - si = &(((size_info *)ptr)[-1]); - size = si->u.size; - } - - if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { - MCTXLOCK(ctx, &ctx->lock); - mem_putunlocked(ctx, si, size); - } else { - mem_put(ctx, si, size); - MCTXLOCK(ctx, &ctx->lock); - mem_putstats(ctx, si, size); - } - - DELETE_TRACE(ctx, ptr, size, file, line); - - /* - * The check against ctx->lo_water == 0 is for the condition - * when the context was pushed over hi_water but then had - * isc_mem_setwater() called with 0 for hi_water and lo_water. - */ - if (ctx->is_overmem && - (ctx->inuse < ctx->lo_water || ctx->lo_water == 0U)) { - ctx->is_overmem = ISC_FALSE; - } - - if (ctx->hi_called && - (ctx->inuse < ctx->lo_water || ctx->lo_water == 0U)) { - ctx->hi_called = ISC_FALSE; - - if (ctx->water != NULL) - call_water = ISC_TRUE; - } - MCTXUNLOCK(ctx, &ctx->lock); - - if (call_water) - (ctx->water)(ctx->water_arg, ISC_MEM_LOWATER); -} - - -/* - * Other useful things. - */ - -ISC_MEMFUNC_SCOPE char * -isc___mem_strdup(isc_mem_t *mctx0, const char *s FLARG) { - isc__mem_t *mctx = (isc__mem_t *)mctx0; - size_t len; - char *ns; - - REQUIRE(VALID_CONTEXT(mctx)); - REQUIRE(s != NULL); - - len = strlen(s); - - ns = isc___mem_allocate((isc_mem_t *)mctx, len + 1 FLARG_PASS); - - if (ns != NULL) - strncpy(ns, s, len + 1); - - return (ns); -} - -ISC_MEMFUNC_SCOPE void -isc__mem_setdestroycheck(isc_mem_t *ctx0, isc_boolean_t flag) { - isc__mem_t *ctx = (isc__mem_t *)ctx0; - - REQUIRE(VALID_CONTEXT(ctx)); - MCTXLOCK(ctx, &ctx->lock); - - ctx->checkfree = flag; - - MCTXUNLOCK(ctx, &ctx->lock); -} - -/* - * Quotas - */ - -ISC_MEMFUNC_SCOPE void -isc__mem_setquota(isc_mem_t *ctx0, size_t quota) { - isc__mem_t *ctx = (isc__mem_t *)ctx0; - - REQUIRE(VALID_CONTEXT(ctx)); - MCTXLOCK(ctx, &ctx->lock); - - ctx->quota = quota; - - MCTXUNLOCK(ctx, &ctx->lock); -} - -ISC_MEMFUNC_SCOPE size_t -isc__mem_getquota(isc_mem_t *ctx0) { - isc__mem_t *ctx = (isc__mem_t *)ctx0; - size_t quota; - - REQUIRE(VALID_CONTEXT(ctx)); - MCTXLOCK(ctx, &ctx->lock); - - quota = ctx->quota; - - MCTXUNLOCK(ctx, &ctx->lock); - - return (quota); -} - -ISC_MEMFUNC_SCOPE size_t -isc__mem_inuse(isc_mem_t *ctx0) { - isc__mem_t *ctx = (isc__mem_t *)ctx0; - size_t inuse; - - REQUIRE(VALID_CONTEXT(ctx)); - MCTXLOCK(ctx, &ctx->lock); - - inuse = ctx->inuse; - - MCTXUNLOCK(ctx, &ctx->lock); - - return (inuse); -} - -ISC_MEMFUNC_SCOPE void -isc__mem_setwater(isc_mem_t *ctx0, isc_mem_water_t water, void *water_arg, - size_t hiwater, size_t lowater) -{ - isc__mem_t *ctx = (isc__mem_t *)ctx0; - isc_boolean_t callwater = ISC_FALSE; - isc_mem_water_t oldwater; - void *oldwater_arg; - - REQUIRE(VALID_CONTEXT(ctx)); - REQUIRE(hiwater >= lowater); - - MCTXLOCK(ctx, &ctx->lock); - oldwater = ctx->water; - oldwater_arg = ctx->water_arg; - if (water == NULL) { - callwater = ctx->hi_called; - ctx->water = NULL; - ctx->water_arg = NULL; - ctx->hi_water = 0; - ctx->lo_water = 0; - ctx->hi_called = ISC_FALSE; - } else { - if (ctx->hi_called && - (ctx->water != water || ctx->water_arg != water_arg || - ctx->inuse < lowater || lowater == 0U)) - callwater = ISC_TRUE; - ctx->water = water; - ctx->water_arg = water_arg; - ctx->hi_water = hiwater; - ctx->lo_water = lowater; - ctx->hi_called = ISC_FALSE; - } - MCTXUNLOCK(ctx, &ctx->lock); - - if (callwater && oldwater != NULL) - (oldwater)(oldwater_arg, ISC_MEM_LOWATER); -} - -ISC_MEMFUNC_SCOPE isc_boolean_t -isc__mem_isovermem(isc_mem_t *ctx0) { - isc__mem_t *ctx = (isc__mem_t *)ctx0; - - REQUIRE(VALID_CONTEXT(ctx)); - - /* - * We don't bother to lock the context because 100% accuracy isn't - * necessary (and even if we locked the context the returned value - * could be different from the actual state when it's used anyway) - */ - return (ctx->is_overmem); -} - -ISC_MEMFUNC_SCOPE void -isc__mem_setname(isc_mem_t *ctx0, const char *name, void *tag) { - isc__mem_t *ctx = (isc__mem_t *)ctx0; - - REQUIRE(VALID_CONTEXT(ctx)); - - LOCK(&ctx->lock); - memset(ctx->name, 0, sizeof(ctx->name)); - strncpy(ctx->name, name, sizeof(ctx->name) - 1); - ctx->tag = tag; - UNLOCK(&ctx->lock); -} - -ISC_MEMFUNC_SCOPE const char * -isc__mem_getname(isc_mem_t *ctx0) { - isc__mem_t *ctx = (isc__mem_t *)ctx0; - - REQUIRE(VALID_CONTEXT(ctx)); - - return (ctx->name); -} - -ISC_MEMFUNC_SCOPE void * -isc__mem_gettag(isc_mem_t *ctx0) { - isc__mem_t *ctx = (isc__mem_t *)ctx0; - - REQUIRE(VALID_CONTEXT(ctx)); - - return (ctx->tag); -} - -/* - * Memory pool stuff - */ - -ISC_MEMFUNC_SCOPE isc_result_t -isc__mempool_create(isc_mem_t *mctx0, size_t size, isc_mempool_t **mpctxp) { - isc__mem_t *mctx = (isc__mem_t *)mctx0; - isc__mempool_t *mpctx; - - REQUIRE(VALID_CONTEXT(mctx)); - REQUIRE(size > 0U); - REQUIRE(mpctxp != NULL && *mpctxp == NULL); - - /* - * Allocate space for this pool, initialize values, and if all works - * well, attach to the memory context. - */ - mpctx = isc_mem_get((isc_mem_t *)mctx, sizeof(isc__mempool_t)); - if (mpctx == NULL) - return (ISC_R_NOMEMORY); - - mpctx->common.methods = (isc_mempoolmethods_t *)&mempoolmethods; - mpctx->common.impmagic = MEMPOOL_MAGIC; - mpctx->common.magic = ISCAPI_MPOOL_MAGIC; - mpctx->lock = NULL; - mpctx->mctx = mctx; - mpctx->size = size; - mpctx->maxalloc = UINT_MAX; - mpctx->allocated = 0; - mpctx->freecount = 0; - mpctx->freemax = 1; - mpctx->fillcount = 1; - mpctx->gets = 0; -#if ISC_MEMPOOL_NAMES - mpctx->name[0] = 0; -#endif - mpctx->items = NULL; - - *mpctxp = (isc_mempool_t *)mpctx; - - MCTXLOCK(mctx, &mctx->lock); - ISC_LIST_INITANDAPPEND(mctx->pools, mpctx, link); - mctx->poolcnt++; - MCTXUNLOCK(mctx, &mctx->lock); - - return (ISC_R_SUCCESS); -} - -ISC_MEMFUNC_SCOPE void -isc__mempool_setname(isc_mempool_t *mpctx0, const char *name) { - isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0; - - REQUIRE(name != NULL); - REQUIRE(VALID_MEMPOOL(mpctx)); - -#if ISC_MEMPOOL_NAMES - if (mpctx->lock != NULL) - LOCK(mpctx->lock); - - strncpy(mpctx->name, name, sizeof(mpctx->name) - 1); - mpctx->name[sizeof(mpctx->name) - 1] = '\0'; - - if (mpctx->lock != NULL) - UNLOCK(mpctx->lock); -#else - UNUSED(mpctx); - UNUSED(name); -#endif -} - -ISC_MEMFUNC_SCOPE void -isc__mempool_destroy(isc_mempool_t **mpctxp) { - isc__mempool_t *mpctx; - isc__mem_t *mctx; - isc_mutex_t *lock; - element *item; - - REQUIRE(mpctxp != NULL); - mpctx = (isc__mempool_t *)*mpctxp; - REQUIRE(VALID_MEMPOOL(mpctx)); -#if ISC_MEMPOOL_NAMES - if (mpctx->allocated > 0) - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc__mempool_destroy(): mempool %s " - "leaked memory", - mpctx->name); -#endif - REQUIRE(mpctx->allocated == 0); - - mctx = mpctx->mctx; - - lock = mpctx->lock; - - if (lock != NULL) - LOCK(lock); - - /* - * Return any items on the free list - */ - MCTXLOCK(mctx, &mctx->lock); - while (mpctx->items != NULL) { - INSIST(mpctx->freecount > 0); - mpctx->freecount--; - item = mpctx->items; - mpctx->items = item->next; - - if ((mctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { - mem_putunlocked(mctx, item, mpctx->size); - } else { - mem_put(mctx, item, mpctx->size); - mem_putstats(mctx, item, mpctx->size); - } - } - MCTXUNLOCK(mctx, &mctx->lock); - - /* - * Remove our linked list entry from the memory context. - */ - MCTXLOCK(mctx, &mctx->lock); - ISC_LIST_UNLINK(mctx->pools, mpctx, link); - mctx->poolcnt--; - MCTXUNLOCK(mctx, &mctx->lock); - - mpctx->common.impmagic = 0; - mpctx->common.magic = 0; - - isc_mem_put((isc_mem_t *)mpctx->mctx, mpctx, sizeof(isc__mempool_t)); - - if (lock != NULL) - UNLOCK(lock); - - *mpctxp = NULL; -} - -ISC_MEMFUNC_SCOPE void -isc__mempool_associatelock(isc_mempool_t *mpctx0, isc_mutex_t *lock) { - isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0; - - REQUIRE(VALID_MEMPOOL(mpctx)); - REQUIRE(mpctx->lock == NULL); - REQUIRE(lock != NULL); - - mpctx->lock = lock; -} - -ISC_MEMFUNC_SCOPE void * -isc___mempool_get(isc_mempool_t *mpctx0 FLARG) { - isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0; - element *item; - isc__mem_t *mctx; - unsigned int i; - - REQUIRE(VALID_MEMPOOL(mpctx)); - - mctx = mpctx->mctx; - - if (mpctx->lock != NULL) - LOCK(mpctx->lock); - - /* - * Don't let the caller go over quota - */ - if (mpctx->allocated >= mpctx->maxalloc) { - item = NULL; - goto out; - } - - /* - * if we have a free list item, return the first here - */ - item = mpctx->items; - if (item != NULL) { - mpctx->items = item->next; - INSIST(mpctx->freecount > 0); - mpctx->freecount--; - mpctx->gets++; - mpctx->allocated++; - goto out; - } - - /* - * We need to dip into the well. Lock the memory context here and - * fill up our free list. - */ - MCTXLOCK(mctx, &mctx->lock); - for (i = 0; i < mpctx->fillcount; i++) { - if ((mctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { - item = mem_getunlocked(mctx, mpctx->size); - } else { - item = mem_get(mctx, mpctx->size); - if (item != NULL) - mem_getstats(mctx, mpctx->size); - } - if (item == NULL) - break; - item->next = mpctx->items; - mpctx->items = item; - mpctx->freecount++; - } - MCTXUNLOCK(mctx, &mctx->lock); - - /* - * If we didn't get any items, return NULL. - */ - item = mpctx->items; - if (item == NULL) - goto out; - - mpctx->items = item->next; - mpctx->freecount--; - mpctx->gets++; - mpctx->allocated++; - - out: - if (mpctx->lock != NULL) - UNLOCK(mpctx->lock); - -#if ISC_MEM_TRACKLINES - if (item != NULL) { - MCTXLOCK(mctx, &mctx->lock); - ADD_TRACE(mctx, item, mpctx->size, file, line); - MCTXUNLOCK(mctx, &mctx->lock); - } -#endif /* ISC_MEM_TRACKLINES */ - - return (item); -} - -ISC_MEMFUNC_SCOPE void -isc___mempool_put(isc_mempool_t *mpctx0, void *mem FLARG) { - isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0; - isc__mem_t *mctx; - element *item; - - REQUIRE(VALID_MEMPOOL(mpctx)); - REQUIRE(mem != NULL); - - mctx = mpctx->mctx; - - if (mpctx->lock != NULL) - LOCK(mpctx->lock); - - INSIST(mpctx->allocated > 0); - mpctx->allocated--; - -#if ISC_MEM_TRACKLINES - MCTXLOCK(mctx, &mctx->lock); - DELETE_TRACE(mctx, mem, mpctx->size, file, line); - MCTXUNLOCK(mctx, &mctx->lock); -#endif /* ISC_MEM_TRACKLINES */ - - /* - * If our free list is full, return this to the mctx directly. - */ - if (mpctx->freecount >= mpctx->freemax) { - if ((mctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { - MCTXLOCK(mctx, &mctx->lock); - mem_putunlocked(mctx, mem, mpctx->size); - MCTXUNLOCK(mctx, &mctx->lock); - } else { - mem_put(mctx, mem, mpctx->size); - MCTXLOCK(mctx, &mctx->lock); - mem_putstats(mctx, mem, mpctx->size); - MCTXUNLOCK(mctx, &mctx->lock); - } - if (mpctx->lock != NULL) - UNLOCK(mpctx->lock); - return; - } - - /* - * Otherwise, attach it to our free list and bump the counter. - */ - mpctx->freecount++; - item = (element *)mem; - item->next = mpctx->items; - mpctx->items = item; - - if (mpctx->lock != NULL) - UNLOCK(mpctx->lock); -} - -/* - * Quotas - */ - -ISC_MEMFUNC_SCOPE void -isc__mempool_setfreemax(isc_mempool_t *mpctx0, unsigned int limit) { - isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0; - - REQUIRE(VALID_MEMPOOL(mpctx)); - - if (mpctx->lock != NULL) - LOCK(mpctx->lock); - - mpctx->freemax = limit; - - if (mpctx->lock != NULL) - UNLOCK(mpctx->lock); -} - -ISC_MEMFUNC_SCOPE unsigned int -isc__mempool_getfreemax(isc_mempool_t *mpctx0) { - isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0; - unsigned int freemax; - - REQUIRE(VALID_MEMPOOL(mpctx)); - - if (mpctx->lock != NULL) - LOCK(mpctx->lock); - - freemax = mpctx->freemax; - - if (mpctx->lock != NULL) - UNLOCK(mpctx->lock); - - return (freemax); -} - -ISC_MEMFUNC_SCOPE unsigned int -isc__mempool_getfreecount(isc_mempool_t *mpctx0) { - isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0; - unsigned int freecount; - - REQUIRE(VALID_MEMPOOL(mpctx)); - - if (mpctx->lock != NULL) - LOCK(mpctx->lock); - - freecount = mpctx->freecount; - - if (mpctx->lock != NULL) - UNLOCK(mpctx->lock); - - return (freecount); -} - -ISC_MEMFUNC_SCOPE void -isc__mempool_setmaxalloc(isc_mempool_t *mpctx0, unsigned int limit) { - isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0; - - REQUIRE(limit > 0); - - REQUIRE(VALID_MEMPOOL(mpctx)); - - if (mpctx->lock != NULL) - LOCK(mpctx->lock); - - mpctx->maxalloc = limit; - - if (mpctx->lock != NULL) - UNLOCK(mpctx->lock); -} - -ISC_MEMFUNC_SCOPE unsigned int -isc__mempool_getmaxalloc(isc_mempool_t *mpctx0) { - isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0; - unsigned int maxalloc; - - REQUIRE(VALID_MEMPOOL(mpctx)); - - if (mpctx->lock != NULL) - LOCK(mpctx->lock); - - maxalloc = mpctx->maxalloc; - - if (mpctx->lock != NULL) - UNLOCK(mpctx->lock); - - return (maxalloc); -} - -ISC_MEMFUNC_SCOPE unsigned int -isc__mempool_getallocated(isc_mempool_t *mpctx0) { - isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0; - unsigned int allocated; - - REQUIRE(VALID_MEMPOOL(mpctx)); - - if (mpctx->lock != NULL) - LOCK(mpctx->lock); - - allocated = mpctx->allocated; - - if (mpctx->lock != NULL) - UNLOCK(mpctx->lock); - - return (allocated); -} - -ISC_MEMFUNC_SCOPE void -isc__mempool_setfillcount(isc_mempool_t *mpctx0, unsigned int limit) { - isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0; - - REQUIRE(limit > 0); - REQUIRE(VALID_MEMPOOL(mpctx)); - - if (mpctx->lock != NULL) - LOCK(mpctx->lock); - - mpctx->fillcount = limit; - - if (mpctx->lock != NULL) - UNLOCK(mpctx->lock); -} - -ISC_MEMFUNC_SCOPE unsigned int -isc__mempool_getfillcount(isc_mempool_t *mpctx0) { - isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0; - - unsigned int fillcount; - - REQUIRE(VALID_MEMPOOL(mpctx)); - - if (mpctx->lock != NULL) - LOCK(mpctx->lock); - - fillcount = mpctx->fillcount; - - if (mpctx->lock != NULL) - UNLOCK(mpctx->lock); - - return (fillcount); -} - -#ifdef USE_MEMIMPREGISTER -isc_result_t -isc__mem_register() { - return (isc_mem_register(isc__mem_create2)); -} -#endif - -#ifdef BIND9 -ISC_MEMFUNC_SCOPE void -isc__mem_printactive(isc_mem_t *ctx0, FILE *file) { - isc__mem_t *ctx = (isc__mem_t *)ctx0; - - REQUIRE(VALID_CONTEXT(ctx)); - REQUIRE(file != NULL); - -#if !ISC_MEM_TRACKLINES - UNUSED(ctx); - UNUSED(file); -#else - print_active(ctx, file); -#endif -} - -ISC_MEMFUNC_SCOPE void -isc__mem_printallactive(FILE *file) { -#if !ISC_MEM_TRACKLINES - UNUSED(file); -#else - isc__mem_t *ctx; - - RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS); - - LOCK(&lock); - for (ctx = ISC_LIST_HEAD(contexts); - ctx != NULL; - ctx = ISC_LIST_NEXT(ctx, link)) { - fprintf(file, "context: %p\n", ctx); - print_active(ctx, file); - } - UNLOCK(&lock); -#endif -} - -ISC_MEMFUNC_SCOPE void -isc__mem_checkdestroyed(FILE *file) { - - RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS); - - LOCK(&lock); - if (!ISC_LIST_EMPTY(contexts)) { -#if ISC_MEM_TRACKLINES - isc__mem_t *ctx; - - for (ctx = ISC_LIST_HEAD(contexts); - ctx != NULL; - ctx = ISC_LIST_NEXT(ctx, link)) { - fprintf(file, "context: %p\n", ctx); - print_active(ctx, file); - } - fflush(file); -#endif - INSIST(0); - } - UNLOCK(&lock); -} - -ISC_MEMFUNC_SCOPE unsigned int -isc_mem_references(isc_mem_t *ctx0) { - isc__mem_t *ctx = (isc__mem_t *)ctx0; - unsigned int references; - - REQUIRE(VALID_CONTEXT(ctx)); - - MCTXLOCK(ctx, &ctx->lock); - references = ctx->references; - MCTXUNLOCK(ctx, &ctx->lock); - - return (references); -} - -#ifdef HAVE_LIBXML2 - -typedef struct summarystat { - isc_uint64_t total; - isc_uint64_t inuse; - isc_uint64_t blocksize; - isc_uint64_t contextsize; -} summarystat_t; - -static void -renderctx(isc__mem_t *ctx, summarystat_t *summary, xmlTextWriterPtr writer) { - REQUIRE(VALID_CONTEXT(ctx)); - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "context"); - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "id"); - xmlTextWriterWriteFormatString(writer, "%p", ctx); - xmlTextWriterEndElement(writer); /* id */ - - if (ctx->name[0] != 0) { - xmlTextWriterStartElement(writer, ISC_XMLCHAR "name"); - xmlTextWriterWriteFormatString(writer, "%s", ctx->name); - xmlTextWriterEndElement(writer); /* name */ - } - - REQUIRE(VALID_CONTEXT(ctx)); - MCTXLOCK(ctx, &ctx->lock); - - summary->contextsize += sizeof(*ctx) + - (ctx->max_size + 1) * sizeof(struct stats) + - ctx->max_size * sizeof(element *) + - ctx->basic_table_count * sizeof(char *); -#if ISC_MEM_TRACKLINES - if (ctx->debuglist != NULL) { - summary->contextsize += - (ctx->max_size + 1) * sizeof(debuglist_t) + - ctx->debuglistcnt * sizeof(debuglink_t); - } -#endif - xmlTextWriterStartElement(writer, ISC_XMLCHAR "references"); - xmlTextWriterWriteFormatString(writer, "%d", ctx->references); - xmlTextWriterEndElement(writer); /* references */ - - summary->total += ctx->total; - xmlTextWriterStartElement(writer, ISC_XMLCHAR "total"); - xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", - (isc_uint64_t)ctx->total); - xmlTextWriterEndElement(writer); /* total */ - - summary->inuse += ctx->inuse; - xmlTextWriterStartElement(writer, ISC_XMLCHAR "inuse"); - xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", - (isc_uint64_t)ctx->inuse); - xmlTextWriterEndElement(writer); /* inuse */ - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "maxinuse"); - xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", - (isc_uint64_t)ctx->maxinuse); - xmlTextWriterEndElement(writer); /* maxinuse */ - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "blocksize"); - if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { - summary->blocksize += ctx->basic_table_count * - NUM_BASIC_BLOCKS * ctx->mem_target; - xmlTextWriterWriteFormatString(writer, - "%" ISC_PRINT_QUADFORMAT "u", - (isc_uint64_t) - ctx->basic_table_count * - NUM_BASIC_BLOCKS * - ctx->mem_target); - } else - xmlTextWriterWriteFormatString(writer, "%s", "-"); - xmlTextWriterEndElement(writer); /* blocksize */ - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "pools"); - xmlTextWriterWriteFormatString(writer, "%u", ctx->poolcnt); - xmlTextWriterEndElement(writer); /* pools */ - summary->contextsize += ctx->poolcnt * sizeof(isc_mempool_t); - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "hiwater"); - xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", - (isc_uint64_t)ctx->hi_water); - xmlTextWriterEndElement(writer); /* hiwater */ - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "lowater"); - xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", - (isc_uint64_t)ctx->lo_water); - xmlTextWriterEndElement(writer); /* lowater */ - - MCTXUNLOCK(ctx, &ctx->lock); - - xmlTextWriterEndElement(writer); /* context */ -} - -void -isc_mem_renderxml(xmlTextWriterPtr writer) { - isc__mem_t *ctx; - summarystat_t summary; - isc_uint64_t lost; - - memset(&summary, 0, sizeof(summary)); - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "contexts"); - - RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS); - - LOCK(&lock); - lost = totallost; - for (ctx = ISC_LIST_HEAD(contexts); - ctx != NULL; - ctx = ISC_LIST_NEXT(ctx, link)) { - renderctx(ctx, &summary, writer); - } - UNLOCK(&lock); - - xmlTextWriterEndElement(writer); /* contexts */ - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "summary"); - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "TotalUse"); - xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", - summary.total); - xmlTextWriterEndElement(writer); /* TotalUse */ - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "InUse"); - xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", - summary.inuse); - xmlTextWriterEndElement(writer); /* InUse */ - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "BlockSize"); - xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", - summary.blocksize); - xmlTextWriterEndElement(writer); /* BlockSize */ - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "ContextSize"); - xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", - summary.contextsize); - xmlTextWriterEndElement(writer); /* ContextSize */ - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "Lost"); - xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", - lost); - xmlTextWriterEndElement(writer); /* Lost */ - - xmlTextWriterEndElement(writer); /* summary */ -} - -#endif /* HAVE_LIBXML2 */ -#endif /* BIND9 */ diff --git a/lib/isc/mem_api.c b/lib/isc/mem_api.c deleted file mode 100644 index 85abb9b4507c..000000000000 --- a/lib/isc/mem_api.c +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Copyright (C) 2009, 2010 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: mem_api.c,v 1.8 2010/08/12 21:30:26 jinmei Exp $ */ - -#include - -#include -#include -#include -#include - -#if ISC_MEM_TRACKLINES -#define FLARG_PASS , file, line -#define FLARG , const char *file, unsigned int line -#else -#define FLARG_PASS -#define FLARG -#endif - -static isc_mutex_t createlock; -static isc_once_t once = ISC_ONCE_INIT; -static isc_memcreatefunc_t mem_createfunc = NULL; - -static void -initialize(void) { - RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS); -} - -isc_result_t -isc_mem_register(isc_memcreatefunc_t createfunc) { - isc_result_t result = ISC_R_SUCCESS; - - RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS); - - LOCK(&createlock); - if (mem_createfunc == NULL) - mem_createfunc = createfunc; - else - result = ISC_R_EXISTS; - UNLOCK(&createlock); - - return (result); -} - -isc_result_t -isc_mem_create(size_t init_max_size, size_t target_size, isc_mem_t **mctxp) { - isc_result_t result; - - LOCK(&createlock); - - REQUIRE(mem_createfunc != NULL); - result = (*mem_createfunc)(init_max_size, target_size, mctxp, - ISC_MEMFLAG_DEFAULT); - - UNLOCK(&createlock); - - return (result); -} - -isc_result_t -isc_mem_create2(size_t init_max_size, size_t target_size, isc_mem_t **mctxp, - unsigned int flags) -{ - isc_result_t result; - - LOCK(&createlock); - - REQUIRE(mem_createfunc != NULL); - result = (*mem_createfunc)(init_max_size, target_size, mctxp, flags); - - UNLOCK(&createlock); - - return (result); -} - -void -isc_mem_attach(isc_mem_t *source, isc_mem_t **targetp) { - REQUIRE(ISCAPI_MCTX_VALID(source)); - REQUIRE(targetp != NULL && *targetp == NULL); - - source->methods->attach(source, targetp); - - ENSURE(*targetp == source); -} - -void -isc_mem_detach(isc_mem_t **mctxp) { - REQUIRE(mctxp != NULL && ISCAPI_MCTX_VALID(*mctxp)); - - (*mctxp)->methods->detach(mctxp); - - ENSURE(*mctxp == NULL); -} - -void -isc_mem_destroy(isc_mem_t **mctxp) { - REQUIRE(mctxp != NULL && ISCAPI_MCTX_VALID(*mctxp)); - - (*mctxp)->methods->destroy(mctxp); - - ENSURE(*mctxp == NULL); -} - -void * -isc__mem_get(isc_mem_t *mctx, size_t size FLARG) { - REQUIRE(ISCAPI_MCTX_VALID(mctx)); - - return (mctx->methods->memget(mctx, size FLARG_PASS)); -} - -void -isc__mem_put(isc_mem_t *mctx, void *ptr, size_t size FLARG) { - REQUIRE(ISCAPI_MCTX_VALID(mctx)); - - mctx->methods->memput(mctx, ptr, size FLARG_PASS); -} - -void -isc__mem_putanddetach(isc_mem_t **mctxp, void *ptr, size_t size FLARG) { - REQUIRE(mctxp != NULL && ISCAPI_MCTX_VALID(*mctxp)); - - (*mctxp)->methods->memputanddetach(mctxp, ptr, size FLARG_PASS); - - /* - * XXX: We cannot always ensure *mctxp == NULL here - * (see lib/isc/mem.c). - */ -} - -void * -isc__mem_allocate(isc_mem_t *mctx, size_t size FLARG) { - REQUIRE(ISCAPI_MCTX_VALID(mctx)); - - return (mctx->methods->memallocate(mctx, size FLARG_PASS)); -} - -void * -isc__mem_reallocate(isc_mem_t *mctx, void *ptr, size_t size FLARG) { - REQUIRE(ISCAPI_MCTX_VALID(mctx)); - - return (mctx->methods->memreallocate(mctx, ptr, size FLARG_PASS)); -} - -char * -isc__mem_strdup(isc_mem_t *mctx, const char *s FLARG) { - REQUIRE(ISCAPI_MCTX_VALID(mctx)); - - return (mctx->methods->memstrdup(mctx, s FLARG_PASS)); -} - -void -isc__mem_free(isc_mem_t *mctx, void *ptr FLARG) { - REQUIRE(ISCAPI_MCTX_VALID(mctx)); - - mctx->methods->memfree(mctx, ptr FLARG_PASS); -} - -void -isc_mem_setdestroycheck(isc_mem_t *mctx, isc_boolean_t flag) { - REQUIRE(ISCAPI_MCTX_VALID(mctx)); - - mctx->methods->setdestroycheck(mctx, flag); -} - -void -isc_mem_setwater(isc_mem_t *ctx, isc_mem_water_t water, void *water_arg, - size_t hiwater, size_t lowater) -{ - REQUIRE(ISCAPI_MCTX_VALID(ctx)); - - ctx->methods->setwater(ctx, water, water_arg, hiwater, lowater); -} - -void -isc_mem_waterack(isc_mem_t *ctx, int flag) { - REQUIRE(ISCAPI_MCTX_VALID(ctx)); - - ctx->methods->waterack(ctx, flag); -} - -size_t -isc_mem_inuse(isc_mem_t *mctx) { - REQUIRE(ISCAPI_MCTX_VALID(mctx)); - - return (mctx->methods->inuse(mctx)); -} - -isc_boolean_t -isc_mem_isovermem(isc_mem_t *mctx) { - REQUIRE(ISCAPI_MCTX_VALID(mctx)); - - return (mctx->methods->isovermem(mctx)); -} - -void -isc_mem_setname(isc_mem_t *mctx, const char *name, void *tag) { - REQUIRE(ISCAPI_MCTX_VALID(mctx)); - - UNUSED(name); - UNUSED(tag); - - return; -} - -const char * -isc_mem_getname(isc_mem_t *mctx) { - REQUIRE(ISCAPI_MCTX_VALID(mctx)); - - return (""); -} - -void * -isc_mem_gettag(isc_mem_t *mctx) { - REQUIRE(ISCAPI_MCTX_VALID(mctx)); - - return (NULL); -} - -isc_result_t -isc_mempool_create(isc_mem_t *mctx, size_t size, isc_mempool_t **mpctxp) { - REQUIRE(ISCAPI_MCTX_VALID(mctx)); - - return (mctx->methods->mpcreate(mctx, size, mpctxp)); -} - -void -isc_mempool_destroy(isc_mempool_t **mpctxp) { - REQUIRE(mpctxp != NULL && ISCAPI_MPOOL_VALID(*mpctxp)); - - (*mpctxp)->methods->destroy(mpctxp); - - ENSURE(*mpctxp == NULL); -} - -void * -isc__mempool_get(isc_mempool_t *mpctx FLARG) { - REQUIRE(ISCAPI_MPOOL_VALID(mpctx)); - - return (mpctx->methods->get(mpctx FLARG_PASS)); -} - -void -isc__mempool_put(isc_mempool_t *mpctx, void *mem FLARG) { - REQUIRE(ISCAPI_MPOOL_VALID(mpctx)); - - mpctx->methods->put(mpctx, mem FLARG_PASS); -} - -unsigned int -isc_mempool_getallocated(isc_mempool_t *mpctx) { - REQUIRE(ISCAPI_MPOOL_VALID(mpctx)); - - return (mpctx->methods->getallocated(mpctx)); -} - -void -isc_mempool_setmaxalloc(isc_mempool_t *mpctx, unsigned int limit) { - REQUIRE(ISCAPI_MPOOL_VALID(mpctx)); - - mpctx->methods->setmaxalloc(mpctx, limit); -} - -void -isc_mempool_setfreemax(isc_mempool_t *mpctx, unsigned int limit) { - REQUIRE(ISCAPI_MPOOL_VALID(mpctx)); - - mpctx->methods->setfreemax(mpctx, limit); -} - -void -isc_mempool_setname(isc_mempool_t *mpctx, const char *name) { - REQUIRE(ISCAPI_MPOOL_VALID(mpctx)); - - mpctx->methods->setname(mpctx, name); -} - -void -isc_mempool_associatelock(isc_mempool_t *mpctx, isc_mutex_t *lock) { - REQUIRE(ISCAPI_MPOOL_VALID(mpctx)); - - mpctx->methods->associatelock(mpctx, lock); -} - -void -isc_mempool_setfillcount(isc_mempool_t *mpctx, unsigned int limit) { - REQUIRE(ISCAPI_MPOOL_VALID(mpctx)); - - mpctx->methods->setfillcount(mpctx, limit); -} diff --git a/lib/isc/mips/include/isc/atomic.h b/lib/isc/mips/include/isc/atomic.h deleted file mode 100644 index bb739f7404a9..000000000000 --- a/lib/isc/mips/include/isc/atomic.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (C) 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: atomic.h,v 1.3 2007/06/19 23:47:18 tbox Exp $ */ - -#ifndef ISC_ATOMIC_H -#define ISC_ATOMIC_H 1 - -#include -#include - -#ifdef ISC_PLATFORM_USEGCCASM -/* - * This routine atomically increments the value stored in 'p' by 'val', and - * returns the previous value. - */ -static inline isc_int32_t -isc_atomic_xadd(isc_int32_t *p, int val) { - isc_int32_t orig; - - /* add is a cheat, since MIPS has no mov instruction */ - __asm__ volatile ( - "1:" - "ll $3, %1\n" - "add %0, $0, $3\n" - "add $3, $3, %2\n" - "sc $3, %1\n" - "beq $3, 0, 1b" - : "=&r"(orig) - : "m"(*p), "r"(val) - : "memory", "$3" - ); - - return (orig); -} - -/* - * This routine atomically stores the value 'val' in 'p'. - */ -static inline void -isc_atomic_store(isc_int32_t *p, isc_int32_t val) { - __asm__ volatile ( - "1:" - "ll $3, %0\n" - "add $3, $0, %1\n" - "sc $3, %0\n" - "beq $3, 0, 1b" - : - : "m"(*p), "r"(val) - : "memory", "$3" - ); -} - -/* - * This routine atomically replaces the value in 'p' with 'val', if the - * original value is equal to 'cmpval'. The original value is returned in any - * case. - */ -static inline isc_int32_t -isc_atomic_cmpxchg(isc_int32_t *p, int cmpval, int val) { - isc_int32_t orig; - - __asm__ volatile( - "1:" - "ll $3, %1\n" - "add %0, $0, $3\n" - "bne $3, %2, 2f\n" - "add $3, $0, %3\n" - "sc $3, %1\n" - "beq $3, 0, 1b\n" - "2:" - : "=&r"(orig) - : "m"(*p), "r"(cmpval), "r"(val) - : "memory", "$3" - ); - - return (orig); -} - -#else /* !ISC_PLATFORM_USEGCCASM */ - -#error "unsupported compiler. disable atomic ops by --disable-atomic" - -#endif -#endif /* ISC_ATOMIC_H */ diff --git a/lib/isc/mutexblock.c b/lib/isc/mutexblock.c deleted file mode 100644 index d41e9d28d86d..000000000000 --- a/lib/isc/mutexblock.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/*! \file */ - -#include - -#include -#include - -isc_result_t -isc_mutexblock_init(isc_mutex_t *block, unsigned int count) { - isc_result_t result; - unsigned int i; - - for (i = 0; i < count; i++) { - result = isc_mutex_init(&block[i]); - if (result != ISC_R_SUCCESS) { - while (i > 0U) { - i--; - DESTROYLOCK(&block[i]); - } - return (result); - } - } - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count) { - isc_result_t result; - unsigned int i; - - for (i = 0; i < count; i++) { - result = isc_mutex_destroy(&block[i]); - if (result != ISC_R_SUCCESS) - return (result); - } - - return (ISC_R_SUCCESS); -} diff --git a/lib/isc/noatomic/include/isc/atomic.h b/lib/isc/noatomic/include/isc/atomic.h deleted file mode 100644 index 942ba036e27f..000000000000 --- a/lib/isc/noatomic/include/isc/atomic.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: atomic.h,v 1.4 2007/06/19 23:47:18 tbox Exp $ */ - -#ifndef ISC_ATOMIC_H -#define ISC_ATOMIC_H 1 - -/* This file is inherently empty. */ - -#endif /* ISC_ATOMIC_H */ diff --git a/lib/isc/nothreads/mutex.c b/lib/isc/nothreads/mutex.c deleted file mode 100644 index 50ba0f4d6593..000000000000 --- a/lib/isc/nothreads/mutex.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2004, 2006, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: mutex.c,v 1.10 2007/06/19 23:47:18 tbox Exp $ */ - -#include - -#include - -EMPTY_TRANSLATION_UNIT - diff --git a/lib/isc/parseint.c b/lib/isc/parseint.c deleted file mode 100644 index 266d44cec5c5..000000000000 --- a/lib/isc/parseint.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2001-2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: parseint.c,v 1.8 2007/06/19 23:47:17 tbox Exp $ */ - -/*! \file */ - -#include - -#include -#include -#include - -#include -#include -#include - -isc_result_t -isc_parse_uint32(isc_uint32_t *uip, const char *string, int base) { - unsigned long n; - char *e; - if (! isalnum((unsigned char)(string[0]))) - return (ISC_R_BADNUMBER); - errno = 0; - n = strtoul(string, &e, base); - if (*e != '\0') - return (ISC_R_BADNUMBER); - if (n == ULONG_MAX && errno == ERANGE) - return (ISC_R_RANGE); - *uip = n; - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_parse_uint16(isc_uint16_t *uip, const char *string, int base) { - isc_uint32_t val; - isc_result_t result; - result = isc_parse_uint32(&val, string, base); - if (result != ISC_R_SUCCESS) - return (result); - if (val > 0xFFFF) - return (ISC_R_RANGE); - *uip = (isc_uint16_t) val; - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_parse_uint8(isc_uint8_t *uip, const char *string, int base) { - isc_uint32_t val; - isc_result_t result; - result = isc_parse_uint32(&val, string, base); - if (result != ISC_R_SUCCESS) - return (result); - if (val > 0xFF) - return (ISC_R_RANGE); - *uip = (isc_uint8_t) val; - return (ISC_R_SUCCESS); -} diff --git a/lib/isc/portset.c b/lib/isc/portset.c deleted file mode 100644 index 471ca8e8d00d..000000000000 --- a/lib/isc/portset.c +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: portset.c,v 1.4 2008/06/24 23:24:35 marka Exp $ */ - -/*! \file */ - -#include - -#include -#include -#include -#include -#include - -#define ISC_PORTSET_BUFSIZE (65536 / (sizeof(isc_uint32_t) * 8)) - -/*% - * Internal representation of portset. It's an array of 32-bit integers, each - * bit corresponding to a single port in the ascending order. For example, - * the second most significant bit of buf[0] corresponds to port 1. - */ -struct isc_portset { - unsigned int nports; /*%< number of ports in the set */ - isc_uint32_t buf[ISC_PORTSET_BUFSIZE]; -}; - -static inline isc_boolean_t -portset_isset(isc_portset_t *portset, in_port_t port) { - return (ISC_TF((portset->buf[port >> 5] & (1 << (port & 31))) != 0)); -} - -static inline void -portset_add(isc_portset_t *portset, in_port_t port) { - if (!portset_isset(portset, port)) { - portset->nports++; - portset->buf[port >> 5] |= (1 << (port & 31)); - } -} - -static inline void -portset_remove(isc_portset_t *portset, in_port_t port) { - if (portset_isset(portset, port)) { - portset->nports--; - portset->buf[port >> 5] &= ~(1 << (port & 31)); - } -} - -isc_result_t -isc_portset_create(isc_mem_t *mctx, isc_portset_t **portsetp) { - isc_portset_t *portset; - - REQUIRE(portsetp != NULL && *portsetp == NULL); - - portset = isc_mem_get(mctx, sizeof(*portset)); - if (portset == NULL) - return (ISC_R_NOMEMORY); - - /* Make the set 'empty' by default */ - memset(portset, 0, sizeof(*portset)); - *portsetp = portset; - - return (ISC_R_SUCCESS); -} - -void -isc_portset_destroy(isc_mem_t *mctx, isc_portset_t **portsetp) { - isc_portset_t *portset; - - REQUIRE(portsetp != NULL); - portset = *portsetp; - - isc_mem_put(mctx, portset, sizeof(*portset)); -} - -isc_boolean_t -isc_portset_isset(isc_portset_t *portset, in_port_t port) { - REQUIRE(portset != NULL); - - return (portset_isset(portset, port)); -} - -unsigned int -isc_portset_nports(isc_portset_t *portset) { - REQUIRE(portset != NULL); - - return (portset->nports); -} - -void -isc_portset_add(isc_portset_t *portset, in_port_t port) { - REQUIRE(portset != NULL); - - portset_add(portset, port); -} - -void -isc_portset_remove(isc_portset_t *portset, in_port_t port) { - portset_remove(portset, port); -} - -void -isc_portset_addrange(isc_portset_t *portset, in_port_t port_lo, - in_port_t port_hi) -{ - in_port_t p; - - REQUIRE(portset != NULL); - REQUIRE(port_lo <= port_hi); - - p = port_lo; - do { - portset_add(portset, p); - } while (p++ < port_hi); -} - -void -isc_portset_removerange(isc_portset_t *portset, in_port_t port_lo, - in_port_t port_hi) -{ - in_port_t p; - - REQUIRE(portset != NULL); - REQUIRE(port_lo <= port_hi); - - p = port_lo; - do { - portset_remove(portset, p); - } while (p++ < port_hi); -} diff --git a/lib/isc/powerpc/include/isc/atomic.h b/lib/isc/powerpc/include/isc/atomic.h deleted file mode 100644 index 030007f34ed7..000000000000 --- a/lib/isc/powerpc/include/isc/atomic.h +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright (C) 2005, 2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -#ifndef ISC_ATOMIC_H -#define ISC_ATOMIC_H 1 - -#include -#include - -/*!\file - * static inline isc_int32_t - * isc_atomic_xadd(isc_int32_t *p, isc_int32_t val); - * - * This routine atomically increments the value stored in 'p' by 'val', and - * returns the previous value. - * - * static inline void - * isc_atomic_store(void *p, isc_int32_t val); - * - * This routine atomically stores the value 'val' in 'p'. - * - * static inline isc_int32_t - * isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val); - * - * This routine atomically replaces the value in 'p' with 'val', if the - * original value is equal to 'cmpval'. The original value is returned in any - * case. - */ - -#if defined(_AIX) - -#include - -#define isc_atomic_store(p, v) _clear_lock(p, v) - -#ifdef __GNUC__ -static inline isc_int32_t -#else -static isc_int32_t -#endif -isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) { - int ret; - -#ifdef __GNUC__ - asm("ics"); -#else - __isync(); -#endif - - ret = fetch_and_add((atomic_p)p, (int)val); - -#ifdef __GNUC__ - asm("ics"); -#else - __isync(); -#endif - - return (ret); -} - -#ifdef __GNUC__ -static inline int -#else -static int -#endif -isc_atomic_cmpxchg(atomic_p p, int old, int new) { - int orig = old; - -#ifdef __GNUC__ - asm("ics"); -#else - __isync(); -#endif - if (compare_and_swap(p, &orig, new)) - orig = old; - -#ifdef __GNUC__ - asm("ics"); -#else - __isync(); -#endif - - return (orig); -} - -#elif defined(ISC_PLATFORM_USEGCCASM) || defined(ISC_PLATFORM_USEMACASM) -static inline isc_int32_t -isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) { - isc_int32_t orig; - - __asm__ volatile ( -#ifdef ISC_PLATFORM_USEMACASM - "1:" - "lwarx r6, 0, %1\n" - "mr %0, r6\n" - "add r6, r6, %2\n" - "stwcx. r6, 0, %1\n" - "bne- 1b\n" - "sync" -#else - "1:" - "lwarx 6, 0, %1\n" - "mr %0, 6\n" - "add 6, 6, %2\n" - "stwcx. 6, 0, %1\n" - "bne- 1b\n" - "sync" -#endif - : "=&r"(orig) - : "r"(p), "r"(val) - : "r6", "memory" - ); - - return (orig); -} - -static inline void -isc_atomic_store(void *p, isc_int32_t val) { - __asm__ volatile ( -#ifdef ISC_PLATFORM_USEMACASM - "1:" - "lwarx r6, 0, %0\n" - "lwz r6, %1\n" - "stwcx. r6, 0, %0\n" - "bne- 1b\n" - "sync" -#else - "1:" - "lwarx 6, 0, %0\n" - "lwz 6, %1\n" - "stwcx. 6, 0, %0\n" - "bne- 1b\n" - "sync" -#endif - : - : "r"(p), "m"(val) - : "r6", "memory" - ); -} - -static inline isc_int32_t -isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) { - isc_int32_t orig; - - __asm__ volatile ( -#ifdef ISC_PLATFORM_USEMACASM - "1:" - "lwarx r6, 0, %1\n" - "mr %0,r6\n" - "cmpw r6, %2\n" - "bne 2f\n" - "mr r6, %3\n" - "stwcx. r6, 0, %1\n" - "bne- 1b\n" - "2:\n" - "sync" -#else - "1:" - "lwarx 6, 0, %1\n" - "mr %0,6\n" - "cmpw 6, %2\n" - "bne 2f\n" - "mr 6, %3\n" - "stwcx. 6, 0, %1\n" - "bne- 1b\n" - "2:\n" - "sync" -#endif - : "=&r" (orig) - : "r"(p), "r"(cmpval), "r"(val) - : "r6", "memory" - ); - - return (orig); -} - -#else - -#error "unsupported compiler. disable atomic ops by --disable-atomic" - -#endif -#endif /* ISC_ATOMIC_H */ diff --git a/lib/isc/print.c b/lib/isc/print.c deleted file mode 100644 index a5e5ba6699d6..000000000000 --- a/lib/isc/print.c +++ /dev/null @@ -1,624 +0,0 @@ -/* - * Copyright (C) 2004-2008, 2010 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001, 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: print.c,v 1.37 2010/10/18 23:47:08 tbox Exp $ */ - -/*! \file */ - -#include - -#include -#include /* for sprintf() */ -#include /* for strlen() */ - -#define ISC__PRINT_SOURCE /* Used to get the isc_print_* prototypes. */ - -#include -#include -#include -#include -#include -#include - -int -isc_print_sprintf(char *str, const char *format, ...) { - va_list ap; - - va_start(ap, format); - vsprintf(str, format, ap); - va_end(ap); - return (strlen(str)); -} - -/*! - * Return length of string that would have been written if not truncated. - */ - -int -isc_print_snprintf(char *str, size_t size, const char *format, ...) { - va_list ap; - int ret; - - va_start(ap, format); - ret = vsnprintf(str, size, format, ap); - va_end(ap); - return (ret); - -} - -/*! - * Return length of string that would have been written if not truncated. - */ - -int -isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) { - int h; - int l; - int q; - int alt; - int zero; - int left; - int plus; - int space; - int neg; - isc_int64_t tmpi; - isc_uint64_t tmpui; - unsigned long width; - unsigned long precision; - unsigned int length; - char buf[1024]; - char c; - void *v; - char *save = str; - const char *cp; - const char *head; - int count = 0; - int pad; - int zeropad; - int dot; - double dbl; -#ifdef HAVE_LONG_DOUBLE - long double ldbl; -#endif - char fmt[32]; - - INSIST(str != NULL); - INSIST(format != NULL); - - while (*format != '\0') { - if (*format != '%') { - if (size > 1) { - *str++ = *format; - size--; - } - count++; - format++; - continue; - } - format++; - - /* - * Reset flags. - */ - dot = neg = space = plus = left = zero = alt = h = l = q = 0; - width = precision = 0; - head = ""; - length = pad = zeropad = 0; - - do { - if (*format == '#') { - alt = 1; - format++; - } else if (*format == '-') { - left = 1; - zero = 0; - format++; - } else if (*format == ' ') { - if (!plus) - space = 1; - format++; - } else if (*format == '+') { - plus = 1; - space = 0; - format++; - } else if (*format == '0') { - if (!left) - zero = 1; - format++; - } else - break; - } while (1); - - /* - * Width. - */ - if (*format == '*') { - width = va_arg(ap, int); - format++; - } else if (isdigit((unsigned char)*format)) { - char *e; - width = strtoul(format, &e, 10); - format = e; - } - - /* - * Precision. - */ - if (*format == '.') { - format++; - dot = 1; - if (*format == '*') { - precision = va_arg(ap, int); - format++; - } else if (isdigit((unsigned char)*format)) { - char *e; - precision = strtoul(format, &e, 10); - format = e; - } - } - - switch (*format) { - case '\0': - continue; - case '%': - if (size > 1) { - *str++ = *format; - size--; - } - count++; - break; - case 'q': - q = 1; - format++; - goto doint; - case 'h': - h = 1; - format++; - goto doint; - case 'l': - l = 1; - format++; - if (*format == 'l') { - q = 1; - format++; - } - goto doint; - case 'n': - case 'i': - case 'd': - case 'o': - case 'u': - case 'x': - case 'X': - doint: - if (precision != 0) - zero = 0; - switch (*format) { - case 'n': - if (h) { - short int *p; - p = va_arg(ap, short *); - REQUIRE(p != NULL); - *p = str - save; - } else if (l) { - long int *p; - p = va_arg(ap, long *); - REQUIRE(p != NULL); - *p = str - save; - } else { - int *p; - p = va_arg(ap, int *); - REQUIRE(p != NULL); - *p = str - save; - } - break; - case 'i': - case 'd': - if (q) - tmpi = va_arg(ap, isc_int64_t); - else if (l) - tmpi = va_arg(ap, long int); - else - tmpi = va_arg(ap, int); - if (tmpi < 0) { - head = "-"; - tmpui = -tmpi; - } else { - if (plus) - head = "+"; - else if (space) - head = " "; - else - head = ""; - tmpui = tmpi; - } - if (tmpui <= 0xffffffffU) - sprintf(buf, "%lu", - (unsigned long)tmpui); - else { - unsigned long mid; - unsigned long lo; - unsigned long hi; - lo = tmpui % 1000000000; - tmpui /= 1000000000; - mid = tmpui % 1000000000; - hi = tmpui / 1000000000; - if (hi != 0) - sprintf(buf, "%lu", hi); - else - buf[0] = '\n'; - sprintf(buf + strlen(buf), "%lu", mid); - sprintf(buf + strlen(buf), "%lu", lo); - } - goto printint; - case 'o': - if (q) - tmpui = va_arg(ap, isc_uint64_t); - else if (l) - tmpui = va_arg(ap, long int); - else - tmpui = va_arg(ap, int); - if (tmpui <= 0xffffffffU) - sprintf(buf, alt ? "%#lo" : "%lo", - (unsigned long)tmpui); - else { - unsigned long mid; - unsigned long lo; - unsigned long hi; - lo = tmpui % 010000000000; - tmpui /= 010000000000; - mid = tmpui % 010000000000; - hi = tmpui / 010000000000; - if (hi != 0) { - sprintf(buf, - alt ? "%#lo" : "%lo", - hi); - sprintf(buf + strlen(buf), - "%lo", mid); - } else - sprintf(buf, - alt ? "%#lo" : "%lo", - mid); - sprintf(buf + strlen(buf), "%lo", lo); - } - goto printint; - case 'u': - if (q) - tmpui = va_arg(ap, isc_uint64_t); - else if (l) - tmpui = va_arg(ap, unsigned long int); - else - tmpui = va_arg(ap, unsigned int); - if (tmpui <= 0xffffffffU) - sprintf(buf, "%lu", - (unsigned long)tmpui); - else { - unsigned long mid; - unsigned long lo; - unsigned long hi; - lo = tmpui % 1000000000; - tmpui /= 1000000000; - mid = tmpui % 1000000000; - hi = tmpui / 1000000000; - if (hi != 0) - sprintf(buf, "%lu", hi); - else - buf[0] = '\n'; - sprintf(buf + strlen(buf), "%lu", mid); - sprintf(buf + strlen(buf), "%lu", lo); - } - goto printint; - case 'x': - if (q) - tmpui = va_arg(ap, isc_uint64_t); - else if (l) - tmpui = va_arg(ap, unsigned long int); - else - tmpui = va_arg(ap, unsigned int); - if (alt) { - head = "0x"; - if (precision > 2) - precision -= 2; - } - if (tmpui <= 0xffffffffU) - sprintf(buf, "%lx", - (unsigned long)tmpui); - else { - unsigned long hi = tmpui>>32; - unsigned long lo = tmpui & 0xffffffff; - sprintf(buf, "%lx", hi); - sprintf(buf + strlen(buf), "%lx", lo); - } - goto printint; - case 'X': - if (q) - tmpui = va_arg(ap, isc_uint64_t); - else if (l) - tmpui = va_arg(ap, unsigned long int); - else - tmpui = va_arg(ap, unsigned int); - if (alt) { - head = "0X"; - if (precision > 2) - precision -= 2; - } - if (tmpui <= 0xffffffffU) - sprintf(buf, "%lX", - (unsigned long)tmpui); - else { - unsigned long hi = tmpui>>32; - unsigned long lo = tmpui & 0xffffffff; - sprintf(buf, "%lX", hi); - sprintf(buf + strlen(buf), "%lX", lo); - } - goto printint; - printint: - if (precision != 0 || width != 0) { - length = strlen(buf); - if (length < precision) - zeropad = precision - length; - else if (length < width && zero) - zeropad = width - length; - if (width != 0) { - pad = width - length - - zeropad - strlen(head); - if (pad < 0) - pad = 0; - } - } - count += strlen(head) + strlen(buf) + pad + - zeropad; - if (!left) { - while (pad > 0 && size > 1) { - *str++ = ' '; - size--; - pad--; - } - } - cp = head; - while (*cp != '\0' && size > 1) { - *str++ = *cp++; - size--; - } - while (zeropad > 0 && size > 1) { - *str++ = '0'; - size--; - zeropad--; - } - cp = buf; - while (*cp != '\0' && size > 1) { - *str++ = *cp++; - size--; - } - while (pad > 0 && size > 1) { - *str++ = ' '; - size--; - pad--; - } - break; - default: - break; - } - break; - case 's': - cp = va_arg(ap, char *); - REQUIRE(cp != NULL); - - if (precision != 0) { - /* - * cp need not be NULL terminated. - */ - const char *tp; - unsigned long n; - - n = precision; - tp = cp; - while (n != 0 && *tp != '\0') - n--, tp++; - length = precision - n; - } else { - length = strlen(cp); - } - if (width != 0) { - pad = width - length; - if (pad < 0) - pad = 0; - } - count += pad + length; - if (!left) - while (pad > 0 && size > 1) { - *str++ = ' '; - size--; - pad--; - } - if (precision != 0) - while (precision > 0 && *cp != '\0' && - size > 1) { - *str++ = *cp++; - size--; - precision--; - } - else - while (*cp != '\0' && size > 1) { - *str++ = *cp++; - size--; - } - while (pad > 0 && size > 1) { - *str++ = ' '; - size--; - pad--; - } - break; - case 'c': - c = va_arg(ap, int); - if (width > 0) { - count += width; - width--; - if (left && size > 1) { - *str++ = c; - size--; - } - while (width-- > 0 && size > 1) { - *str++ = ' '; - size--; - } - if (!left && size > 1) { - *str++ = c; - size--; - } - } else { - count++; - if (size > 1) { - *str++ = c; - size--; - } - } - break; - case 'p': - v = va_arg(ap, void *); - sprintf(buf, "%p", v); - length = strlen(buf); - if (precision > length) - zeropad = precision - length; - if (width > 0) { - pad = width - length - zeropad; - if (pad < 0) - pad = 0; - } - count += length + pad + zeropad; - if (!left) - while (pad > 0 && size > 1) { - *str++ = ' '; - size--; - pad--; - } - cp = buf; - if (zeropad > 0 && buf[0] == '0' && - (buf[1] == 'x' || buf[1] == 'X')) { - if (size > 1) { - *str++ = *cp++; - size--; - } - if (size > 1) { - *str++ = *cp++; - size--; - } - while (zeropad > 0 && size > 1) { - *str++ = '0'; - size--; - zeropad--; - } - } - while (*cp != '\0' && size > 1) { - *str++ = *cp++; - size--; - } - while (pad > 0 && size > 1) { - *str++ = ' '; - size--; - pad--; - } - break; - case 'D': /*deprecated*/ - INSIST("use %ld instead of %D" == NULL); - case 'O': /*deprecated*/ - INSIST("use %lo instead of %O" == NULL); - case 'U': /*deprecated*/ - INSIST("use %lu instead of %U" == NULL); - - case 'L': -#ifdef HAVE_LONG_DOUBLE - l = 1; -#else - INSIST("long doubles are not supported" == NULL); -#endif - /*FALLTHROUGH*/ - case 'e': - case 'E': - case 'f': - case 'g': - case 'G': - if (!dot) - precision = 6; - /* - * IEEE floating point. - * MIN 2.2250738585072014E-308 - * MAX 1.7976931348623157E+308 - * VAX floating point has a smaller range than IEEE. - * - * precisions > 324 don't make much sense. - * if we cap the precision at 512 we will not - * overflow buf. - */ - if (precision > 512) - precision = 512; - sprintf(fmt, "%%%s%s.%lu%s%c", alt ? "#" : "", - plus ? "+" : space ? " " : "", - precision, l ? "L" : "", *format); - switch (*format) { - case 'e': - case 'E': - case 'f': - case 'g': - case 'G': -#ifdef HAVE_LONG_DOUBLE - if (l) { - ldbl = va_arg(ap, long double); - sprintf(buf, fmt, ldbl); - } else -#endif - { - dbl = va_arg(ap, double); - sprintf(buf, fmt, dbl); - } - length = strlen(buf); - if (width > 0) { - pad = width - length; - if (pad < 0) - pad = 0; - } - count += length + pad; - if (!left) - while (pad > 0 && size > 1) { - *str++ = ' '; - size--; - pad--; - } - cp = buf; - while (*cp != ' ' && size > 1) { - *str++ = *cp++; - size--; - } - while (pad > 0 && size > 1) { - *str++ = ' '; - size--; - pad--; - } - break; - default: - continue; - } - break; - default: - continue; - } - format++; - } - if (size > 0) - *str = '\0'; - return (count); -} diff --git a/lib/isc/quota.c b/lib/isc/quota.c deleted file mode 100644 index 5e5c50c0edc2..000000000000 --- a/lib/isc/quota.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: quota.c,v 1.18 2007/06/19 23:47:17 tbox Exp $ */ - -/*! \file */ - -#include - -#include - -#include -#include - -isc_result_t -isc_quota_init(isc_quota_t *quota, int max) { - quota->max = max; - quota->used = 0; - quota->soft = 0; - return (isc_mutex_init("a->lock)); -} - -void -isc_quota_destroy(isc_quota_t *quota) { - INSIST(quota->used == 0); - quota->max = 0; - quota->used = 0; - quota->soft = 0; - DESTROYLOCK("a->lock); -} - -void -isc_quota_soft(isc_quota_t *quota, int soft) { - LOCK("a->lock); - quota->soft = soft; - UNLOCK("a->lock); -} - -void -isc_quota_max(isc_quota_t *quota, int max) { - LOCK("a->lock); - quota->max = max; - UNLOCK("a->lock); -} - -isc_result_t -isc_quota_reserve(isc_quota_t *quota) { - isc_result_t result; - LOCK("a->lock); - if (quota->max == 0 || quota->used < quota->max) { - if (quota->soft == 0 || quota->used < quota->soft) - result = ISC_R_SUCCESS; - else - result = ISC_R_SOFTQUOTA; - quota->used++; - } else - result = ISC_R_QUOTA; - UNLOCK("a->lock); - return (result); -} - -void -isc_quota_release(isc_quota_t *quota) { - LOCK("a->lock); - INSIST(quota->used > 0); - quota->used--; - UNLOCK("a->lock); -} - -isc_result_t -isc_quota_attach(isc_quota_t *quota, isc_quota_t **p) -{ - isc_result_t result; - INSIST(p != NULL && *p == NULL); - result = isc_quota_reserve(quota); - if (result == ISC_R_SUCCESS || result == ISC_R_SOFTQUOTA) - *p = quota; - return (result); -} - -void -isc_quota_detach(isc_quota_t **p) -{ - INSIST(p != NULL && *p != NULL); - isc_quota_release(*p); - *p = NULL; -} diff --git a/lib/isc/radix.c b/lib/isc/radix.c deleted file mode 100644 index ac211efb6a87..000000000000 --- a/lib/isc/radix.c +++ /dev/null @@ -1,706 +0,0 @@ -/* - * Copyright (C) 2007-2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/* - * This source was adapted from MRT's RCS Ids: - * Id: radix.c,v 1.10.2.1 1999/11/29 05:16:24 masaki Exp - * Id: prefix.c,v 1.37.2.9 2000/03/10 02:53:19 labovit Exp - */ - -#include - -#include -#include -#include -#include - -static isc_result_t -_new_prefix(isc_mem_t *mctx, isc_prefix_t **target, int family, - void *dest, int bitlen); - -static void -_deref_prefix(isc_mem_t *mctx, isc_prefix_t *prefix); - -static isc_result_t -_ref_prefix(isc_mem_t *mctx, isc_prefix_t **target, isc_prefix_t *prefix); - -static int -_comp_with_mask(void *addr, void *dest, u_int mask); - -static void -_clear_radix(isc_radix_tree_t *radix, isc_radix_destroyfunc_t func); - -static isc_result_t -_new_prefix(isc_mem_t *mctx, isc_prefix_t **target, int family, void *dest, - int bitlen) -{ - isc_prefix_t *prefix; - - REQUIRE(target != NULL); - - if (family != AF_INET6 && family != AF_INET && family != AF_UNSPEC) - return (ISC_R_NOTIMPLEMENTED); - - prefix = isc_mem_get(mctx, sizeof(isc_prefix_t)); - if (prefix == NULL) - return (ISC_R_NOMEMORY); - - if (family == AF_INET6) { - prefix->bitlen = (bitlen >= 0) ? bitlen : 128; - memcpy(&prefix->add.sin6, dest, 16); - } else { - /* AF_UNSPEC is "any" or "none"--treat it as AF_INET */ - prefix->bitlen = (bitlen >= 0) ? bitlen : 32; - memcpy(&prefix->add.sin, dest, 4); - } - - prefix->family = family; - - isc_refcount_init(&prefix->refcount, 1); - - *target = prefix; - return (ISC_R_SUCCESS); -} - -static void -_deref_prefix(isc_mem_t *mctx, isc_prefix_t *prefix) { - int refs; - - if (prefix == NULL) - return; - - isc_refcount_decrement(&prefix->refcount, &refs); - - if (refs <= 0) { - isc_refcount_destroy(&prefix->refcount); - isc_mem_put(mctx, prefix, sizeof(isc_prefix_t)); - } -} - -static isc_result_t -_ref_prefix(isc_mem_t *mctx, isc_prefix_t **target, isc_prefix_t *prefix) { - INSIST(prefix != NULL); - INSIST((prefix->family == AF_INET && prefix->bitlen <= 32) || - (prefix->family == AF_INET6 && prefix->bitlen <= 128) || - (prefix->family == AF_UNSPEC && prefix->bitlen == 0)); - REQUIRE(target != NULL && *target == NULL); - - /* - * If this prefix is a static allocation, copy it into new memory. - * (Note, the refcount still has to be destroyed by the calling - * routine.) - */ - if (isc_refcount_current(&prefix->refcount) == 0) { - isc_result_t ret; - ret = _new_prefix(mctx, target, prefix->family, - &prefix->add, prefix->bitlen); - return ret; - } - - isc_refcount_increment(&prefix->refcount, NULL); - - *target = prefix; - return (ISC_R_SUCCESS); -} - -static int -_comp_with_mask(void *addr, void *dest, u_int mask) { - - /* Mask length of zero matches everything */ - if (mask == 0) - return (1); - - if (memcmp(addr, dest, mask / 8) == 0) { - int n = mask / 8; - int m = ((~0) << (8 - (mask % 8))); - - if ((mask % 8) == 0 || - (((u_char *)addr)[n] & m) == (((u_char *)dest)[n] & m)) - return (1); - } - return (0); -} - -isc_result_t -isc_radix_create(isc_mem_t *mctx, isc_radix_tree_t **target, int maxbits) { - isc_radix_tree_t *radix; - - REQUIRE(target != NULL && *target == NULL); - - radix = isc_mem_get(mctx, sizeof(isc_radix_tree_t)); - if (radix == NULL) - return (ISC_R_NOMEMORY); - - radix->mctx = mctx; - radix->maxbits = maxbits; - radix->head = NULL; - radix->num_active_node = 0; - radix->num_added_node = 0; - RUNTIME_CHECK(maxbits <= RADIX_MAXBITS); /* XXX */ - radix->magic = RADIX_TREE_MAGIC; - *target = radix; - return (ISC_R_SUCCESS); -} - -/* - * if func is supplied, it will be called as func(node->data) - * before deleting the node - */ - -static void -_clear_radix(isc_radix_tree_t *radix, isc_radix_destroyfunc_t func) { - - REQUIRE(radix != NULL); - - if (radix->head != NULL) { - - isc_radix_node_t *Xstack[RADIX_MAXBITS+1]; - isc_radix_node_t **Xsp = Xstack; - isc_radix_node_t *Xrn = radix->head; - - while (Xrn != NULL) { - isc_radix_node_t *l = Xrn->l; - isc_radix_node_t *r = Xrn->r; - - if (Xrn->prefix != NULL) { - _deref_prefix(radix->mctx, Xrn->prefix); - if (func != NULL && (Xrn->data[0] != NULL || - Xrn->data[1] != NULL)) - func(Xrn->data); - } else { - INSIST(Xrn->data[0] == NULL && - Xrn->data[1] == NULL); - } - - isc_mem_put(radix->mctx, Xrn, sizeof(*Xrn)); - radix->num_active_node--; - - if (l != NULL) { - if (r != NULL) { - *Xsp++ = r; - } - Xrn = l; - } else if (r != NULL) { - Xrn = r; - } else if (Xsp != Xstack) { - Xrn = *(--Xsp); - } else { - Xrn = NULL; - } - } - } - RUNTIME_CHECK(radix->num_active_node == 0); -} - - -void -isc_radix_destroy(isc_radix_tree_t *radix, isc_radix_destroyfunc_t func) -{ - REQUIRE(radix != NULL); - _clear_radix(radix, func); - isc_mem_put(radix->mctx, radix, sizeof(*radix)); -} - - -/* - * func will be called as func(node->prefix, node->data) - */ -void -isc_radix_process(isc_radix_tree_t *radix, isc_radix_processfunc_t func) -{ - isc_radix_node_t *node; - - REQUIRE(func != NULL); - - RADIX_WALK(radix->head, node) { - func(node->prefix, node->data); - } RADIX_WALK_END; -} - - -isc_result_t -isc_radix_search(isc_radix_tree_t *radix, isc_radix_node_t **target, - isc_prefix_t *prefix) -{ - isc_radix_node_t *node; - isc_radix_node_t *stack[RADIX_MAXBITS + 1]; - u_char *addr; - isc_uint32_t bitlen; - int tfamily = -1; - int cnt = 0; - - REQUIRE(radix != NULL); - REQUIRE(prefix != NULL); - REQUIRE(target != NULL && *target == NULL); - RUNTIME_CHECK(prefix->bitlen <= radix->maxbits); - - *target = NULL; - - if (radix->head == NULL) { - return (ISC_R_NOTFOUND); - } - - node = radix->head; - addr = isc_prefix_touchar(prefix); - bitlen = prefix->bitlen; - - while (node->bit < bitlen) { - if (node->prefix) - stack[cnt++] = node; - - if (BIT_TEST(addr[node->bit >> 3], 0x80 >> (node->bit & 0x07))) - node = node->r; - else - node = node->l; - - if (node == NULL) - break; - } - - if (node && node->prefix) - stack[cnt++] = node; - - while (cnt-- > 0) { - node = stack[cnt]; - - if (_comp_with_mask(isc_prefix_tochar(node->prefix), - isc_prefix_tochar(prefix), - node->prefix->bitlen)) { - if (node->node_num[ISC_IS6(prefix->family)] != -1 && - ((*target == NULL) || - (*target)->node_num[ISC_IS6(tfamily)] > - node->node_num[ISC_IS6(prefix->family)])) { - *target = node; - tfamily = prefix->family; - } - } - } - - if (*target == NULL) { - return (ISC_R_NOTFOUND); - } else { - return (ISC_R_SUCCESS); - } -} - -isc_result_t -isc_radix_insert(isc_radix_tree_t *radix, isc_radix_node_t **target, - isc_radix_node_t *source, isc_prefix_t *prefix) -{ - isc_radix_node_t *node, *new_node, *parent, *glue = NULL; - u_char *addr, *test_addr; - isc_uint32_t bitlen, fam, check_bit, differ_bit; - isc_uint32_t i, j, r; - isc_result_t result; - - REQUIRE(radix != NULL); - REQUIRE(target != NULL && *target == NULL); - REQUIRE(prefix != NULL || (source != NULL && source->prefix != NULL)); - RUNTIME_CHECK(prefix == NULL || prefix->bitlen <= radix->maxbits); - - if (prefix == NULL) - prefix = source->prefix; - - INSIST(prefix != NULL); - - bitlen = prefix->bitlen; - fam = prefix->family; - - if (radix->head == NULL) { - node = isc_mem_get(radix->mctx, sizeof(isc_radix_node_t)); - if (node == NULL) - return (ISC_R_NOMEMORY); - node->bit = bitlen; - node->node_num[0] = node->node_num[1] = -1; - node->prefix = NULL; - result = _ref_prefix(radix->mctx, &node->prefix, prefix); - if (result != ISC_R_SUCCESS) { - isc_mem_put(radix->mctx, node, - sizeof(isc_radix_node_t)); - return (result); - } - node->parent = NULL; - node->l = node->r = NULL; - if (source != NULL) { - /* - * If source is non-NULL, then we're merging in a - * node from an existing radix tree. To keep - * the node_num values consistent, the calling - * function will add the total number of nodes - * added to num_added_node at the end of - * the merge operation--we don't do it here. - */ - if (source->node_num[0] != -1) - node->node_num[0] = radix->num_added_node + - source->node_num[0]; - if (source->node_num[1] != -1) - node->node_num[1] = radix->num_added_node + - source->node_num[1]; - node->data[0] = source->data[0]; - node->data[1] = source->data[1]; - } else { - if (fam == AF_UNSPEC) { - /* "any" or "none" */ - node->node_num[0] = node->node_num[1] = - ++radix->num_added_node; - } else { - node->node_num[ISC_IS6(fam)] = - ++radix->num_added_node; - } - node->data[0] = NULL; - node->data[1] = NULL; - } - radix->head = node; - radix->num_active_node++; - *target = node; - return (ISC_R_SUCCESS); - } - - addr = isc_prefix_touchar(prefix); - node = radix->head; - - while (node->bit < bitlen || node->prefix == NULL) { - if (node->bit < radix->maxbits && - BIT_TEST(addr[node->bit >> 3], 0x80 >> (node->bit & 0x07))) - { - if (node->r == NULL) - break; - node = node->r; - } else { - if (node->l == NULL) - break; - node = node->l; - } - - INSIST(node != NULL); - } - - INSIST(node->prefix != NULL); - - test_addr = isc_prefix_touchar(node->prefix); - /* Find the first bit different. */ - check_bit = (node->bit < bitlen) ? node->bit : bitlen; - differ_bit = 0; - for (i = 0; i*8 < check_bit; i++) { - if ((r = (addr[i] ^ test_addr[i])) == 0) { - differ_bit = (i + 1) * 8; - continue; - } - /* I know the better way, but for now. */ - for (j = 0; j < 8; j++) { - if (BIT_TEST (r, (0x80 >> j))) - break; - } - /* Must be found. */ - INSIST(j < 8); - differ_bit = i * 8 + j; - break; - } - - if (differ_bit > check_bit) - differ_bit = check_bit; - - parent = node->parent; - while (parent != NULL && parent->bit >= differ_bit) { - node = parent; - parent = node->parent; - } - - if (differ_bit == bitlen && node->bit == bitlen) { - if (node->prefix != NULL) { - /* Set node_num only if it hasn't been set before */ - if (source != NULL) { - /* Merging node */ - if (node->node_num[0] == -1 && - source->node_num[0] != -1) { - node->node_num[0] = - radix->num_added_node + - source->node_num[0]; - node->data[0] = source->data[0]; - } - if (node->node_num[1] == -1 && - source->node_num[0] != -1) { - node->node_num[1] = - radix->num_added_node + - source->node_num[1]; - node->data[1] = source->data[1]; - } - } else { - if (fam == AF_UNSPEC) { - /* "any" or "none" */ - int next = radix->num_added_node + 1; - if (node->node_num[0] == -1) { - node->node_num[0] = next; - radix->num_added_node = next; - } - if (node->node_num[1] == -1) { - node->node_num[1] = next; - radix->num_added_node = next; - } - } else { - if (node->node_num[ISC_IS6(fam)] == -1) - node->node_num[ISC_IS6(fam)] - = ++radix->num_added_node; - } - } - *target = node; - return (ISC_R_SUCCESS); - } else { - result = - _ref_prefix(radix->mctx, &node->prefix, prefix); - if (result != ISC_R_SUCCESS) - return (result); - } - INSIST(node->data[0] == NULL && node->node_num[0] == -1 && - node->data[1] == NULL && node->node_num[1] == -1); - if (source != NULL) { - /* Merging node */ - if (source->node_num[0] != -1) { - node->node_num[0] = radix->num_added_node + - source->node_num[0]; - node->data[0] = source->data[0]; - } - if (source->node_num[1] != -1) { - node->node_num[1] = radix->num_added_node + - source->node_num[1]; - node->data[1] = source->data[1]; - } - } else { - if (fam == AF_UNSPEC) { - /* "any" or "none" */ - node->node_num[0] = node->node_num[1] = - ++radix->num_added_node; - } else { - node->node_num[ISC_IS6(fam)] = - ++radix->num_added_node; - } - } - *target = node; - return (ISC_R_SUCCESS); - } - - new_node = isc_mem_get(radix->mctx, sizeof(isc_radix_node_t)); - if (new_node == NULL) - return (ISC_R_NOMEMORY); - if (node->bit != differ_bit && bitlen != differ_bit) { - glue = isc_mem_get(radix->mctx, sizeof(isc_radix_node_t)); - if (glue == NULL) { - isc_mem_put(radix->mctx, new_node, - sizeof(isc_radix_node_t)); - return (ISC_R_NOMEMORY); - } - } - new_node->bit = bitlen; - new_node->prefix = NULL; - result = _ref_prefix(radix->mctx, &new_node->prefix, prefix); - if (result != ISC_R_SUCCESS) { - isc_mem_put(radix->mctx, new_node, sizeof(isc_radix_node_t)); - if (glue != NULL) - isc_mem_put(radix->mctx, glue, - sizeof(isc_radix_node_t)); - return (result); - } - new_node->parent = NULL; - new_node->l = new_node->r = NULL; - new_node->node_num[0] = new_node->node_num[1] = -1; - radix->num_active_node++; - - if (source != NULL) { - /* Merging node */ - if (source->node_num[0] != -1) - new_node->node_num[0] = radix->num_added_node + - source->node_num[0]; - if (source->node_num[1] != -1) - new_node->node_num[1] = radix->num_added_node + - source->node_num[1]; - new_node->data[0] = source->data[0]; - new_node->data[1] = source->data[1]; - } else { - if (fam == AF_UNSPEC) { - /* "any" or "none" */ - new_node->node_num[0] = new_node->node_num[1] = - ++radix->num_added_node; - } else { - new_node->node_num[ISC_IS6(fam)] = - ++radix->num_added_node; - } - new_node->data[0] = NULL; - new_node->data[1] = NULL; - } - - if (node->bit == differ_bit) { - INSIST(glue == NULL); - new_node->parent = node; - if (node->bit < radix->maxbits && - BIT_TEST(addr[node->bit >> 3], 0x80 >> (node->bit & 0x07))) - { - INSIST(node->r == NULL); - node->r = new_node; - } else { - INSIST(node->l == NULL); - node->l = new_node; - } - *target = new_node; - return (ISC_R_SUCCESS); - } - - if (bitlen == differ_bit) { - INSIST(glue == NULL); - if (bitlen < radix->maxbits && - BIT_TEST(test_addr[bitlen >> 3], 0x80 >> (bitlen & 0x07))) { - new_node->r = node; - } else { - new_node->l = node; - } - new_node->parent = node->parent; - if (node->parent == NULL) { - INSIST(radix->head == node); - radix->head = new_node; - } else if (node->parent->r == node) { - node->parent->r = new_node; - } else { - node->parent->l = new_node; - } - node->parent = new_node; - } else { - INSIST(glue != NULL); - glue->bit = differ_bit; - glue->prefix = NULL; - glue->parent = node->parent; - glue->data[0] = glue->data[1] = NULL; - glue->node_num[0] = glue->node_num[1] = -1; - radix->num_active_node++; - if (differ_bit < radix->maxbits && - BIT_TEST(addr[differ_bit>>3], 0x80 >> (differ_bit & 07))) { - glue->r = new_node; - glue->l = node; - } else { - glue->r = node; - glue->l = new_node; - } - new_node->parent = glue; - - if (node->parent == NULL) { - INSIST(radix->head == node); - radix->head = glue; - } else if (node->parent->r == node) { - node->parent->r = glue; - } else { - node->parent->l = glue; - } - node->parent = glue; - } - - *target = new_node; - return (ISC_R_SUCCESS); -} - -void -isc_radix_remove(isc_radix_tree_t *radix, isc_radix_node_t *node) { - isc_radix_node_t *parent, *child; - - REQUIRE(radix != NULL); - REQUIRE(node != NULL); - - if (node->r && node->l) { - /* - * This might be a placeholder node -- have to check and - * make sure there is a prefix associated with it! - */ - if (node->prefix != NULL) - _deref_prefix(radix->mctx, node->prefix); - - node->prefix = NULL; - node->data[0] = node->data[1] = NULL; - return; - } - - if (node->r == NULL && node->l == NULL) { - parent = node->parent; - _deref_prefix(radix->mctx, node->prefix); - isc_mem_put(radix->mctx, node, sizeof(*node)); - radix->num_active_node--; - - if (parent == NULL) { - INSIST(radix->head == node); - radix->head = NULL; - return; - } - - if (parent->r == node) { - parent->r = NULL; - child = parent->l; - } else { - INSIST(parent->l == node); - parent->l = NULL; - child = parent->r; - } - - if (parent->prefix) - return; - - /* We need to remove parent too. */ - - if (parent->parent == NULL) { - INSIST(radix->head == parent); - radix->head = child; - } else if (parent->parent->r == parent) { - parent->parent->r = child; - } else { - INSIST(parent->parent->l == parent); - parent->parent->l = child; - } - child->parent = parent->parent; - isc_mem_put(radix->mctx, parent, sizeof(*parent)); - radix->num_active_node--; - return; - } - - if (node->r) { - child = node->r; - } else { - INSIST(node->l != NULL); - child = node->l; - } - parent = node->parent; - child->parent = parent; - - _deref_prefix(radix->mctx, node->prefix); - isc_mem_put(radix->mctx, node, sizeof(*node)); - radix->num_active_node--; - - if (parent == NULL) { - INSIST(radix->head == node); - radix->head = child; - return; - } - - if (parent->r == node) { - parent->r = child; - } else { - INSIST(parent->l == node); - parent->l = child; - } -} - -/* -Local Variables: -c-basic-offset: 4 -indent-tabs-mode: t -End: -*/ diff --git a/lib/isc/ratelimiter.c b/lib/isc/ratelimiter.c deleted file mode 100644 index 07bcc7c7af1c..000000000000 --- a/lib/isc/ratelimiter.c +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: ratelimiter.c,v 1.25 2007/06/19 23:47:17 tbox Exp $ */ - -/*! \file */ - -#include - -#include -#include -#include -#include -#include -#include - -typedef enum { - isc_ratelimiter_stalled = 0, - isc_ratelimiter_ratelimited = 1, - isc_ratelimiter_idle = 2, - isc_ratelimiter_shuttingdown = 3 -} isc_ratelimiter_state_t; - -struct isc_ratelimiter { - isc_mem_t * mctx; - isc_mutex_t lock; - int refs; - isc_task_t * task; - isc_timer_t * timer; - isc_interval_t interval; - isc_uint32_t pertic; - isc_ratelimiter_state_t state; - isc_event_t shutdownevent; - ISC_LIST(isc_event_t) pending; -}; - -#define ISC_RATELIMITEREVENT_SHUTDOWN (ISC_EVENTCLASS_RATELIMITER + 1) - -static void -ratelimiter_tick(isc_task_t *task, isc_event_t *event); - -static void -ratelimiter_shutdowncomplete(isc_task_t *task, isc_event_t *event); - -isc_result_t -isc_ratelimiter_create(isc_mem_t *mctx, isc_timermgr_t *timermgr, - isc_task_t *task, isc_ratelimiter_t **ratelimiterp) -{ - isc_result_t result; - isc_ratelimiter_t *rl; - INSIST(ratelimiterp != NULL && *ratelimiterp == NULL); - - rl = isc_mem_get(mctx, sizeof(*rl)); - if (rl == NULL) - return ISC_R_NOMEMORY; - rl->mctx = mctx; - rl->refs = 1; - rl->task = task; - isc_interval_set(&rl->interval, 0, 0); - rl->timer = NULL; - rl->pertic = 1; - rl->state = isc_ratelimiter_idle; - ISC_LIST_INIT(rl->pending); - - result = isc_mutex_init(&rl->lock); - if (result != ISC_R_SUCCESS) - goto free_mem; - result = isc_timer_create(timermgr, isc_timertype_inactive, - NULL, NULL, rl->task, ratelimiter_tick, - rl, &rl->timer); - if (result != ISC_R_SUCCESS) - goto free_mutex; - - /* - * Increment the reference count to indicate that we may - * (soon) have events outstanding. - */ - rl->refs++; - - ISC_EVENT_INIT(&rl->shutdownevent, - sizeof(isc_event_t), - 0, NULL, ISC_RATELIMITEREVENT_SHUTDOWN, - ratelimiter_shutdowncomplete, rl, rl, NULL, NULL); - - *ratelimiterp = rl; - return (ISC_R_SUCCESS); - -free_mutex: - DESTROYLOCK(&rl->lock); -free_mem: - isc_mem_put(mctx, rl, sizeof(*rl)); - return (result); -} - -isc_result_t -isc_ratelimiter_setinterval(isc_ratelimiter_t *rl, isc_interval_t *interval) { - isc_result_t result = ISC_R_SUCCESS; - LOCK(&rl->lock); - rl->interval = *interval; - /* - * If the timer is currently running, change its rate. - */ - if (rl->state == isc_ratelimiter_ratelimited) { - result = isc_timer_reset(rl->timer, isc_timertype_ticker, NULL, - &rl->interval, ISC_FALSE); - } - UNLOCK(&rl->lock); - return (result); -} - -void -isc_ratelimiter_setpertic(isc_ratelimiter_t *rl, isc_uint32_t pertic) { - if (pertic == 0) - pertic = 1; - rl->pertic = pertic; -} - -isc_result_t -isc_ratelimiter_enqueue(isc_ratelimiter_t *rl, isc_task_t *task, - isc_event_t **eventp) -{ - isc_result_t result = ISC_R_SUCCESS; - isc_event_t *ev; - - REQUIRE(eventp != NULL && *eventp != NULL); - REQUIRE(task != NULL); - ev = *eventp; - REQUIRE(ev->ev_sender == NULL); - - LOCK(&rl->lock); - if (rl->state == isc_ratelimiter_ratelimited || - rl->state == isc_ratelimiter_stalled) { - isc_event_t *ev = *eventp; - ev->ev_sender = task; - ISC_LIST_APPEND(rl->pending, ev, ev_link); - *eventp = NULL; - } else if (rl->state == isc_ratelimiter_idle) { - result = isc_timer_reset(rl->timer, isc_timertype_ticker, NULL, - &rl->interval, ISC_FALSE); - if (result == ISC_R_SUCCESS) { - ev->ev_sender = task; - rl->state = isc_ratelimiter_ratelimited; - } - } else { - INSIST(rl->state == isc_ratelimiter_shuttingdown); - result = ISC_R_SHUTTINGDOWN; - } - UNLOCK(&rl->lock); - if (*eventp != NULL && result == ISC_R_SUCCESS) - isc_task_send(task, eventp); - return (result); -} - -static void -ratelimiter_tick(isc_task_t *task, isc_event_t *event) { - isc_result_t result = ISC_R_SUCCESS; - isc_ratelimiter_t *rl = (isc_ratelimiter_t *)event->ev_arg; - isc_event_t *p; - isc_uint32_t pertic; - - UNUSED(task); - - isc_event_free(&event); - - pertic = rl->pertic; - while (pertic != 0) { - pertic--; - LOCK(&rl->lock); - p = ISC_LIST_HEAD(rl->pending); - if (p != NULL) { - /* - * There is work to do. Let's do it after unlocking. - */ - ISC_LIST_UNLINK(rl->pending, p, ev_link); - } else { - /* - * No work left to do. Stop the timer so that we don't - * waste resources by having it fire periodically. - */ - result = isc_timer_reset(rl->timer, - isc_timertype_inactive, - NULL, NULL, ISC_FALSE); - RUNTIME_CHECK(result == ISC_R_SUCCESS); - rl->state = isc_ratelimiter_idle; - pertic = 0; /* Force the loop to exit. */ - } - UNLOCK(&rl->lock); - if (p != NULL) { - isc_task_t *evtask = p->ev_sender; - isc_task_send(evtask, &p); - } - INSIST(p == NULL); - } -} - -void -isc_ratelimiter_shutdown(isc_ratelimiter_t *rl) { - isc_event_t *ev; - isc_task_t *task; - LOCK(&rl->lock); - rl->state = isc_ratelimiter_shuttingdown; - (void)isc_timer_reset(rl->timer, isc_timertype_inactive, - NULL, NULL, ISC_FALSE); - while ((ev = ISC_LIST_HEAD(rl->pending)) != NULL) { - ISC_LIST_UNLINK(rl->pending, ev, ev_link); - ev->ev_attributes |= ISC_EVENTATTR_CANCELED; - task = ev->ev_sender; - isc_task_send(task, &ev); - } - isc_timer_detach(&rl->timer); - /* - * Send an event to our task. The delivery of this event - * indicates that no more timer events will be delivered. - */ - ev = &rl->shutdownevent; - isc_task_send(rl->task, &ev); - - UNLOCK(&rl->lock); -} - -static void -ratelimiter_shutdowncomplete(isc_task_t *task, isc_event_t *event) { - isc_ratelimiter_t *rl = (isc_ratelimiter_t *)event->ev_arg; - - UNUSED(task); - - isc_ratelimiter_detach(&rl); -} - -static void -ratelimiter_free(isc_ratelimiter_t *rl) { - DESTROYLOCK(&rl->lock); - isc_mem_put(rl->mctx, rl, sizeof(*rl)); -} - -void -isc_ratelimiter_attach(isc_ratelimiter_t *source, isc_ratelimiter_t **target) { - REQUIRE(source != NULL); - REQUIRE(target != NULL && *target == NULL); - - LOCK(&source->lock); - REQUIRE(source->refs > 0); - source->refs++; - INSIST(source->refs > 0); - UNLOCK(&source->lock); - *target = source; -} - -void -isc_ratelimiter_detach(isc_ratelimiter_t **rlp) { - isc_ratelimiter_t *rl = *rlp; - isc_boolean_t free_now = ISC_FALSE; - - LOCK(&rl->lock); - REQUIRE(rl->refs > 0); - rl->refs--; - if (rl->refs == 0) - free_now = ISC_TRUE; - UNLOCK(&rl->lock); - - if (free_now) - ratelimiter_free(rl); - - *rlp = NULL; -} - -isc_result_t -isc_ratelimiter_stall(isc_ratelimiter_t *rl) { - isc_result_t result = ISC_R_SUCCESS; - - LOCK(&rl->lock); - switch (rl->state) { - case isc_ratelimiter_shuttingdown: - result = ISC_R_SHUTTINGDOWN; - break; - case isc_ratelimiter_ratelimited: - result = isc_timer_reset(rl->timer, isc_timertype_inactive, - NULL, NULL, ISC_FALSE); - RUNTIME_CHECK(result == ISC_R_SUCCESS); - case isc_ratelimiter_idle: - case isc_ratelimiter_stalled: - rl->state = isc_ratelimiter_stalled; - break; - } - UNLOCK(&rl->lock); - return (result); -} - -isc_result_t -isc_ratelimiter_release(isc_ratelimiter_t *rl) { - isc_result_t result = ISC_R_SUCCESS; - - LOCK(&rl->lock); - switch (rl->state) { - case isc_ratelimiter_shuttingdown: - result = ISC_R_SHUTTINGDOWN; - break; - case isc_ratelimiter_stalled: - if (!ISC_LIST_EMPTY(rl->pending)) { - result = isc_timer_reset(rl->timer, - isc_timertype_ticker, NULL, - &rl->interval, ISC_FALSE); - if (result == ISC_R_SUCCESS) - rl->state = isc_ratelimiter_ratelimited; - } else - rl->state = isc_ratelimiter_idle; - break; - case isc_ratelimiter_ratelimited: - case isc_ratelimiter_idle: - break; - } - UNLOCK(&rl->lock); - return (result); -} diff --git a/lib/isc/refcount.c b/lib/isc/refcount.c deleted file mode 100644 index 36dfff297bb1..000000000000 --- a/lib/isc/refcount.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: refcount.c,v 1.5 2007/06/19 23:47:17 tbox Exp $ */ - -#include - -#include - -#include -#include -#include - -isc_result_t -isc_refcount_init(isc_refcount_t *ref, unsigned int n) { - REQUIRE(ref != NULL); - - ref->refs = n; -#if defined(ISC_PLATFORM_USETHREADS) && !defined(ISC_PLATFORM_HAVEXADD) - return (isc_mutex_init(&ref->lock)); -#else - return (ISC_R_SUCCESS); -#endif -} diff --git a/lib/isc/region.c b/lib/isc/region.c deleted file mode 100644 index cf64979003e9..000000000000 --- a/lib/isc/region.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: region.c,v 1.7 2007/06/19 23:47:17 tbox Exp $ */ - -/*! \file */ - -#include - -#include -#include - -#include -#include - -int -isc_region_compare(isc_region_t *r1, isc_region_t *r2) { - unsigned int l; - int result; - - REQUIRE(r1 != NULL); - REQUIRE(r2 != NULL); - - l = (r1->length < r2->length) ? r1->length : r2->length; - - if ((result = memcmp(r1->base, r2->base, l)) != 0) - return ((result < 0) ? -1 : 1); - else - return ((r1->length == r2->length) ? 0 : - (r1->length < r2->length) ? -1 : 1); -} diff --git a/lib/isc/rwlock.c b/lib/isc/rwlock.c deleted file mode 100644 index 9c84c258a28b..000000000000 --- a/lib/isc/rwlock.c +++ /dev/null @@ -1,809 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001, 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/*! \file */ - -#include - -#include - -#include -#include -#include -#include -#include -#include - -#define RWLOCK_MAGIC ISC_MAGIC('R', 'W', 'L', 'k') -#define VALID_RWLOCK(rwl) ISC_MAGIC_VALID(rwl, RWLOCK_MAGIC) - -#ifdef ISC_PLATFORM_USETHREADS - -#ifndef RWLOCK_DEFAULT_READ_QUOTA -#define RWLOCK_DEFAULT_READ_QUOTA 4 -#endif - -#ifndef RWLOCK_DEFAULT_WRITE_QUOTA -#define RWLOCK_DEFAULT_WRITE_QUOTA 4 -#endif - -#ifdef ISC_RWLOCK_TRACE -#include /* Required for fprintf/stderr. */ -#include /* Required for isc_thread_self(). */ - -static void -print_lock(const char *operation, isc_rwlock_t *rwl, isc_rwlocktype_t type) { - fprintf(stderr, - isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, - ISC_MSG_PRINTLOCK, - "rwlock %p thread %lu %s(%s): %s, %u active, " - "%u granted, %u rwaiting, %u wwaiting\n"), - rwl, isc_thread_self(), operation, - (type == isc_rwlocktype_read ? - isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, - ISC_MSG_READ, "read") : - isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, - ISC_MSG_WRITE, "write")), - (rwl->type == isc_rwlocktype_read ? - isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, - ISC_MSG_READING, "reading") : - isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, - ISC_MSG_WRITING, "writing")), - rwl->active, rwl->granted, rwl->readers_waiting, - rwl->writers_waiting); -} -#endif - -isc_result_t -isc_rwlock_init(isc_rwlock_t *rwl, unsigned int read_quota, - unsigned int write_quota) -{ - isc_result_t result; - - REQUIRE(rwl != NULL); - - /* - * In case there's trouble initializing, we zero magic now. If all - * goes well, we'll set it to RWLOCK_MAGIC. - */ - rwl->magic = 0; - -#if defined(ISC_PLATFORM_HAVEXADD) && defined(ISC_PLATFORM_HAVECMPXCHG) - rwl->write_requests = 0; - rwl->write_completions = 0; - rwl->cnt_and_flag = 0; - rwl->readers_waiting = 0; - rwl->write_granted = 0; - if (read_quota != 0) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "read quota is not supported"); - } - if (write_quota == 0) - write_quota = RWLOCK_DEFAULT_WRITE_QUOTA; - rwl->write_quota = write_quota; -#else - rwl->type = isc_rwlocktype_read; - rwl->original = isc_rwlocktype_none; - rwl->active = 0; - rwl->granted = 0; - rwl->readers_waiting = 0; - rwl->writers_waiting = 0; - if (read_quota == 0) - read_quota = RWLOCK_DEFAULT_READ_QUOTA; - rwl->read_quota = read_quota; - if (write_quota == 0) - write_quota = RWLOCK_DEFAULT_WRITE_QUOTA; - rwl->write_quota = write_quota; -#endif - - result = isc_mutex_init(&rwl->lock); - if (result != ISC_R_SUCCESS) - return (result); - - result = isc_condition_init(&rwl->readable); - if (result != ISC_R_SUCCESS) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_condition_init(readable) %s: %s", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed"), - isc_result_totext(result)); - result = ISC_R_UNEXPECTED; - goto destroy_lock; - } - result = isc_condition_init(&rwl->writeable); - if (result != ISC_R_SUCCESS) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_condition_init(writeable) %s: %s", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed"), - isc_result_totext(result)); - result = ISC_R_UNEXPECTED; - goto destroy_rcond; - } - - rwl->magic = RWLOCK_MAGIC; - - return (ISC_R_SUCCESS); - - destroy_rcond: - (void)isc_condition_destroy(&rwl->readable); - destroy_lock: - DESTROYLOCK(&rwl->lock); - - return (result); -} - -void -isc_rwlock_destroy(isc_rwlock_t *rwl) { - REQUIRE(VALID_RWLOCK(rwl)); - -#if defined(ISC_PLATFORM_HAVEXADD) && defined(ISC_PLATFORM_HAVECMPXCHG) - REQUIRE(rwl->write_requests == rwl->write_completions && - rwl->cnt_and_flag == 0 && rwl->readers_waiting == 0); -#else - LOCK(&rwl->lock); - REQUIRE(rwl->active == 0 && - rwl->readers_waiting == 0 && - rwl->writers_waiting == 0); - UNLOCK(&rwl->lock); -#endif - - rwl->magic = 0; - (void)isc_condition_destroy(&rwl->readable); - (void)isc_condition_destroy(&rwl->writeable); - DESTROYLOCK(&rwl->lock); -} - -#if defined(ISC_PLATFORM_HAVEXADD) && defined(ISC_PLATFORM_HAVECMPXCHG) - -/* - * When some architecture-dependent atomic operations are available, - * rwlock can be more efficient than the generic algorithm defined below. - * The basic algorithm is described in the following URL: - * http://www.cs.rochester.edu/u/scott/synchronization/pseudocode/rw.html - * - * The key is to use the following integer variables modified atomically: - * write_requests, write_completions, and cnt_and_flag. - * - * write_requests and write_completions act as a waiting queue for writers - * in order to ensure the FIFO order. Both variables begin with the initial - * value of 0. When a new writer tries to get a write lock, it increments - * write_requests and gets the previous value of the variable as a "ticket". - * When write_completions reaches the ticket number, the new writer can start - * writing. When the writer completes its work, it increments - * write_completions so that another new writer can start working. If the - * write_requests is not equal to write_completions, it means a writer is now - * working or waiting. In this case, a new readers cannot start reading, or - * in other words, this algorithm basically prefers writers. - * - * cnt_and_flag is a "lock" shared by all readers and writers. This integer - * variable is a kind of structure with two members: writer_flag (1 bit) and - * reader_count (31 bits). The writer_flag shows whether a writer is working, - * and the reader_count shows the number of readers currently working or almost - * ready for working. A writer who has the current "ticket" tries to get the - * lock by exclusively setting the writer_flag to 1, provided that the whole - * 32-bit is 0 (meaning no readers or writers working). On the other hand, - * a new reader tries to increment the "reader_count" field provided that - * the writer_flag is 0 (meaning there is no writer working). - * - * If some of the above operations fail, the reader or the writer sleeps - * until the related condition changes. When a working reader or writer - * completes its work, some readers or writers are sleeping, and the condition - * that suspended the reader or writer has changed, it wakes up the sleeping - * readers or writers. - * - * As already noted, this algorithm basically prefers writers. In order to - * prevent readers from starving, however, the algorithm also introduces the - * "writer quota" (Q). When Q consecutive writers have completed their work, - * suspending readers, the last writer will wake up the readers, even if a new - * writer is waiting. - * - * Implementation specific note: due to the combination of atomic operations - * and a mutex lock, ordering between the atomic operation and locks can be - * very sensitive in some cases. In particular, it is generally very important - * to check the atomic variable that requires a reader or writer to sleep after - * locking the mutex and before actually sleeping; otherwise, it could be very - * likely to cause a deadlock. For example, assume "var" is a variable - * atomically modified, then the corresponding code would be: - * if (var == need_sleep) { - * LOCK(lock); - * if (var == need_sleep) - * WAIT(cond, lock); - * UNLOCK(lock); - * } - * The second check is important, since "var" is protected by the atomic - * operation, not by the mutex, and can be changed just before sleeping. - * (The first "if" could be omitted, but this is also important in order to - * make the code efficient by avoiding the use of the mutex unless it is - * really necessary.) - */ - -#define WRITER_ACTIVE 0x1 -#define READER_INCR 0x2 - -isc_result_t -isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { - isc_int32_t cntflag; - - REQUIRE(VALID_RWLOCK(rwl)); - -#ifdef ISC_RWLOCK_TRACE - print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, - ISC_MSG_PRELOCK, "prelock"), rwl, type); -#endif - - if (type == isc_rwlocktype_read) { - if (rwl->write_requests != rwl->write_completions) { - /* there is a waiting or active writer */ - LOCK(&rwl->lock); - if (rwl->write_requests != rwl->write_completions) { - rwl->readers_waiting++; - WAIT(&rwl->readable, &rwl->lock); - rwl->readers_waiting--; - } - UNLOCK(&rwl->lock); - } - - cntflag = isc_atomic_xadd(&rwl->cnt_and_flag, READER_INCR); - POST(cntflag); - while (1) { - if ((rwl->cnt_and_flag & WRITER_ACTIVE) == 0) - break; - - /* A writer is still working */ - LOCK(&rwl->lock); - rwl->readers_waiting++; - if ((rwl->cnt_and_flag & WRITER_ACTIVE) != 0) - WAIT(&rwl->readable, &rwl->lock); - rwl->readers_waiting--; - UNLOCK(&rwl->lock); - - /* - * Typically, the reader should be able to get a lock - * at this stage: - * (1) there should have been no pending writer when - * the reader was trying to increment the - * counter; otherwise, the writer should be in - * the waiting queue, preventing the reader from - * proceeding to this point. - * (2) once the reader increments the counter, no - * more writer can get a lock. - * Still, it is possible another writer can work at - * this point, e.g. in the following scenario: - * A previous writer unlocks the writer lock. - * This reader proceeds to point (1). - * A new writer appears, and gets a new lock before - * the reader increments the counter. - * The reader then increments the counter. - * The previous writer notices there is a waiting - * reader who is almost ready, and wakes it up. - * So, the reader needs to confirm whether it can now - * read explicitly (thus we loop). Note that this is - * not an infinite process, since the reader has - * incremented the counter at this point. - */ - } - - /* - * If we are temporarily preferred to writers due to the writer - * quota, reset the condition (race among readers doesn't - * matter). - */ - rwl->write_granted = 0; - } else { - isc_int32_t prev_writer; - - /* enter the waiting queue, and wait for our turn */ - prev_writer = isc_atomic_xadd(&rwl->write_requests, 1); - while (rwl->write_completions != prev_writer) { - LOCK(&rwl->lock); - if (rwl->write_completions != prev_writer) { - WAIT(&rwl->writeable, &rwl->lock); - UNLOCK(&rwl->lock); - continue; - } - UNLOCK(&rwl->lock); - break; - } - - while (1) { - cntflag = isc_atomic_cmpxchg(&rwl->cnt_and_flag, 0, - WRITER_ACTIVE); - if (cntflag == 0) - break; - - /* Another active reader or writer is working. */ - LOCK(&rwl->lock); - if (rwl->cnt_and_flag != 0) - WAIT(&rwl->writeable, &rwl->lock); - UNLOCK(&rwl->lock); - } - - INSIST((rwl->cnt_and_flag & WRITER_ACTIVE) != 0); - rwl->write_granted++; - } - -#ifdef ISC_RWLOCK_TRACE - print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, - ISC_MSG_POSTLOCK, "postlock"), rwl, type); -#endif - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_rwlock_trylock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { - isc_int32_t cntflag; - - REQUIRE(VALID_RWLOCK(rwl)); - -#ifdef ISC_RWLOCK_TRACE - print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, - ISC_MSG_PRELOCK, "prelock"), rwl, type); -#endif - - if (type == isc_rwlocktype_read) { - /* If a writer is waiting or working, we fail. */ - if (rwl->write_requests != rwl->write_completions) - return (ISC_R_LOCKBUSY); - - /* Otherwise, be ready for reading. */ - cntflag = isc_atomic_xadd(&rwl->cnt_and_flag, READER_INCR); - if ((cntflag & WRITER_ACTIVE) != 0) { - /* - * A writer is working. We lose, and cancel the read - * request. - */ - cntflag = isc_atomic_xadd(&rwl->cnt_and_flag, - -READER_INCR); - /* - * If no other readers are waiting and we've suspended - * new writers in this short period, wake them up. - */ - if (cntflag == READER_INCR && - rwl->write_completions != rwl->write_requests) { - LOCK(&rwl->lock); - BROADCAST(&rwl->writeable); - UNLOCK(&rwl->lock); - } - - return (ISC_R_LOCKBUSY); - } - } else { - /* Try locking without entering the waiting queue. */ - cntflag = isc_atomic_cmpxchg(&rwl->cnt_and_flag, 0, - WRITER_ACTIVE); - if (cntflag != 0) - return (ISC_R_LOCKBUSY); - - /* - * XXXJT: jump into the queue, possibly breaking the writer - * order. - */ - (void)isc_atomic_xadd(&rwl->write_completions, -1); - - rwl->write_granted++; - } - -#ifdef ISC_RWLOCK_TRACE - print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, - ISC_MSG_POSTLOCK, "postlock"), rwl, type); -#endif - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_rwlock_tryupgrade(isc_rwlock_t *rwl) { - isc_int32_t prevcnt; - - REQUIRE(VALID_RWLOCK(rwl)); - - /* Try to acquire write access. */ - prevcnt = isc_atomic_cmpxchg(&rwl->cnt_and_flag, - READER_INCR, WRITER_ACTIVE); - /* - * There must have been no writer, and there must have been at least - * one reader. - */ - INSIST((prevcnt & WRITER_ACTIVE) == 0 && - (prevcnt & ~WRITER_ACTIVE) != 0); - - if (prevcnt == READER_INCR) { - /* - * We are the only reader and have been upgraded. - * Now jump into the head of the writer waiting queue. - */ - (void)isc_atomic_xadd(&rwl->write_completions, -1); - } else - return (ISC_R_LOCKBUSY); - - return (ISC_R_SUCCESS); - -} - -void -isc_rwlock_downgrade(isc_rwlock_t *rwl) { - isc_int32_t prev_readers; - - REQUIRE(VALID_RWLOCK(rwl)); - - /* Become an active reader. */ - prev_readers = isc_atomic_xadd(&rwl->cnt_and_flag, READER_INCR); - /* We must have been a writer. */ - INSIST((prev_readers & WRITER_ACTIVE) != 0); - - /* Complete write */ - (void)isc_atomic_xadd(&rwl->cnt_and_flag, -WRITER_ACTIVE); - (void)isc_atomic_xadd(&rwl->write_completions, 1); - - /* Resume other readers */ - LOCK(&rwl->lock); - if (rwl->readers_waiting > 0) - BROADCAST(&rwl->readable); - UNLOCK(&rwl->lock); -} - -isc_result_t -isc_rwlock_unlock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { - isc_int32_t prev_cnt; - - REQUIRE(VALID_RWLOCK(rwl)); - -#ifdef ISC_RWLOCK_TRACE - print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, - ISC_MSG_PREUNLOCK, "preunlock"), rwl, type); -#endif - - if (type == isc_rwlocktype_read) { - prev_cnt = isc_atomic_xadd(&rwl->cnt_and_flag, -READER_INCR); - - /* - * If we're the last reader and any writers are waiting, wake - * them up. We need to wake up all of them to ensure the - * FIFO order. - */ - if (prev_cnt == READER_INCR && - rwl->write_completions != rwl->write_requests) { - LOCK(&rwl->lock); - BROADCAST(&rwl->writeable); - UNLOCK(&rwl->lock); - } - } else { - isc_boolean_t wakeup_writers = ISC_TRUE; - - /* - * Reset the flag, and (implicitly) tell other writers - * we are done. - */ - (void)isc_atomic_xadd(&rwl->cnt_and_flag, -WRITER_ACTIVE); - (void)isc_atomic_xadd(&rwl->write_completions, 1); - - if (rwl->write_granted >= rwl->write_quota || - rwl->write_requests == rwl->write_completions || - (rwl->cnt_and_flag & ~WRITER_ACTIVE) != 0) { - /* - * We have passed the write quota, no writer is - * waiting, or some readers are almost ready, pending - * possible writers. Note that the last case can - * happen even if write_requests != write_completions - * (which means a new writer in the queue), so we need - * to catch the case explicitly. - */ - LOCK(&rwl->lock); - if (rwl->readers_waiting > 0) { - wakeup_writers = ISC_FALSE; - BROADCAST(&rwl->readable); - } - UNLOCK(&rwl->lock); - } - - if (rwl->write_requests != rwl->write_completions && - wakeup_writers) { - LOCK(&rwl->lock); - BROADCAST(&rwl->writeable); - UNLOCK(&rwl->lock); - } - } - -#ifdef ISC_RWLOCK_TRACE - print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, - ISC_MSG_POSTUNLOCK, "postunlock"), - rwl, type); -#endif - - return (ISC_R_SUCCESS); -} - -#else /* ISC_PLATFORM_HAVEXADD && ISC_PLATFORM_HAVECMPXCHG */ - -static isc_result_t -doit(isc_rwlock_t *rwl, isc_rwlocktype_t type, isc_boolean_t nonblock) { - isc_boolean_t skip = ISC_FALSE; - isc_boolean_t done = ISC_FALSE; - isc_result_t result = ISC_R_SUCCESS; - - REQUIRE(VALID_RWLOCK(rwl)); - - LOCK(&rwl->lock); - -#ifdef ISC_RWLOCK_TRACE - print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, - ISC_MSG_PRELOCK, "prelock"), rwl, type); -#endif - - if (type == isc_rwlocktype_read) { - if (rwl->readers_waiting != 0) - skip = ISC_TRUE; - while (!done) { - if (!skip && - ((rwl->active == 0 || - (rwl->type == isc_rwlocktype_read && - (rwl->writers_waiting == 0 || - rwl->granted < rwl->read_quota))))) - { - rwl->type = isc_rwlocktype_read; - rwl->active++; - rwl->granted++; - done = ISC_TRUE; - } else if (nonblock) { - result = ISC_R_LOCKBUSY; - done = ISC_TRUE; - } else { - skip = ISC_FALSE; - rwl->readers_waiting++; - WAIT(&rwl->readable, &rwl->lock); - rwl->readers_waiting--; - } - } - } else { - if (rwl->writers_waiting != 0) - skip = ISC_TRUE; - while (!done) { - if (!skip && rwl->active == 0) { - rwl->type = isc_rwlocktype_write; - rwl->active = 1; - rwl->granted++; - done = ISC_TRUE; - } else if (nonblock) { - result = ISC_R_LOCKBUSY; - done = ISC_TRUE; - } else { - skip = ISC_FALSE; - rwl->writers_waiting++; - WAIT(&rwl->writeable, &rwl->lock); - rwl->writers_waiting--; - } - } - } - -#ifdef ISC_RWLOCK_TRACE - print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, - ISC_MSG_POSTLOCK, "postlock"), rwl, type); -#endif - - UNLOCK(&rwl->lock); - - return (result); -} - -isc_result_t -isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { - return (doit(rwl, type, ISC_FALSE)); -} - -isc_result_t -isc_rwlock_trylock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { - return (doit(rwl, type, ISC_TRUE)); -} - -isc_result_t -isc_rwlock_tryupgrade(isc_rwlock_t *rwl) { - isc_result_t result = ISC_R_SUCCESS; - - REQUIRE(VALID_RWLOCK(rwl)); - LOCK(&rwl->lock); - REQUIRE(rwl->type == isc_rwlocktype_read); - REQUIRE(rwl->active != 0); - - /* If we are the only reader then succeed. */ - if (rwl->active == 1) { - rwl->original = (rwl->original == isc_rwlocktype_none) ? - isc_rwlocktype_read : isc_rwlocktype_none; - rwl->type = isc_rwlocktype_write; - } else - result = ISC_R_LOCKBUSY; - - UNLOCK(&rwl->lock); - return (result); -} - -void -isc_rwlock_downgrade(isc_rwlock_t *rwl) { - - REQUIRE(VALID_RWLOCK(rwl)); - LOCK(&rwl->lock); - REQUIRE(rwl->type == isc_rwlocktype_write); - REQUIRE(rwl->active == 1); - - rwl->type = isc_rwlocktype_read; - rwl->original = (rwl->original == isc_rwlocktype_none) ? - isc_rwlocktype_write : isc_rwlocktype_none; - /* - * Resume processing any read request that were blocked when - * we upgraded. - */ - if (rwl->original == isc_rwlocktype_none && - (rwl->writers_waiting == 0 || rwl->granted < rwl->read_quota) && - rwl->readers_waiting > 0) - BROADCAST(&rwl->readable); - - UNLOCK(&rwl->lock); -} - -isc_result_t -isc_rwlock_unlock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { - - REQUIRE(VALID_RWLOCK(rwl)); - LOCK(&rwl->lock); - REQUIRE(rwl->type == type); - - UNUSED(type); - -#ifdef ISC_RWLOCK_TRACE - print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, - ISC_MSG_PREUNLOCK, "preunlock"), rwl, type); -#endif - - INSIST(rwl->active > 0); - rwl->active--; - if (rwl->active == 0) { - if (rwl->original != isc_rwlocktype_none) { - rwl->type = rwl->original; - rwl->original = isc_rwlocktype_none; - } - if (rwl->type == isc_rwlocktype_read) { - rwl->granted = 0; - if (rwl->writers_waiting > 0) { - rwl->type = isc_rwlocktype_write; - SIGNAL(&rwl->writeable); - } else if (rwl->readers_waiting > 0) { - /* Does this case ever happen? */ - BROADCAST(&rwl->readable); - } - } else { - if (rwl->readers_waiting > 0) { - if (rwl->writers_waiting > 0 && - rwl->granted < rwl->write_quota) { - SIGNAL(&rwl->writeable); - } else { - rwl->granted = 0; - rwl->type = isc_rwlocktype_read; - BROADCAST(&rwl->readable); - } - } else if (rwl->writers_waiting > 0) { - rwl->granted = 0; - SIGNAL(&rwl->writeable); - } else { - rwl->granted = 0; - } - } - } - INSIST(rwl->original == isc_rwlocktype_none); - -#ifdef ISC_RWLOCK_TRACE - print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, - ISC_MSG_POSTUNLOCK, "postunlock"), - rwl, type); -#endif - - UNLOCK(&rwl->lock); - - return (ISC_R_SUCCESS); -} - -#endif /* ISC_PLATFORM_HAVEXADD && ISC_PLATFORM_HAVECMPXCHG */ -#else /* ISC_PLATFORM_USETHREADS */ - -isc_result_t -isc_rwlock_init(isc_rwlock_t *rwl, unsigned int read_quota, - unsigned int write_quota) -{ - REQUIRE(rwl != NULL); - - UNUSED(read_quota); - UNUSED(write_quota); - - rwl->type = isc_rwlocktype_read; - rwl->active = 0; - rwl->magic = RWLOCK_MAGIC; - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { - REQUIRE(VALID_RWLOCK(rwl)); - - if (type == isc_rwlocktype_read) { - if (rwl->type != isc_rwlocktype_read && rwl->active != 0) - return (ISC_R_LOCKBUSY); - rwl->type = isc_rwlocktype_read; - rwl->active++; - } else { - if (rwl->active != 0) - return (ISC_R_LOCKBUSY); - rwl->type = isc_rwlocktype_write; - rwl->active = 1; - } - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_rwlock_trylock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { - return (isc_rwlock_lock(rwl, type)); -} - -isc_result_t -isc_rwlock_tryupgrade(isc_rwlock_t *rwl) { - isc_result_t result = ISC_R_SUCCESS; - - REQUIRE(VALID_RWLOCK(rwl)); - REQUIRE(rwl->type == isc_rwlocktype_read); - REQUIRE(rwl->active != 0); - - /* If we are the only reader then succeed. */ - if (rwl->active == 1) - rwl->type = isc_rwlocktype_write; - else - result = ISC_R_LOCKBUSY; - return (result); -} - -void -isc_rwlock_downgrade(isc_rwlock_t *rwl) { - - REQUIRE(VALID_RWLOCK(rwl)); - REQUIRE(rwl->type == isc_rwlocktype_write); - REQUIRE(rwl->active == 1); - - rwl->type = isc_rwlocktype_read; -} - -isc_result_t -isc_rwlock_unlock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { - REQUIRE(VALID_RWLOCK(rwl)); - REQUIRE(rwl->type == type); - - UNUSED(type); - - INSIST(rwl->active > 0); - rwl->active--; - - return (ISC_R_SUCCESS); -} - -void -isc_rwlock_destroy(isc_rwlock_t *rwl) { - REQUIRE(rwl != NULL); - REQUIRE(rwl->active == 0); - rwl->magic = 0; -} - -#endif /* ISC_PLATFORM_USETHREADS */ diff --git a/lib/isc/serial.c b/lib/isc/serial.c deleted file mode 100644 index b43aac7ed232..000000000000 --- a/lib/isc/serial.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: serial.c,v 1.12 2007/06/19 23:47:17 tbox Exp $ */ - -/*! \file */ - -#include - -#include - -isc_boolean_t -isc_serial_lt(isc_uint32_t a, isc_uint32_t b) { - /* - * Undefined => ISC_FALSE - */ - if (a == (b ^ 0x80000000U)) - return (ISC_FALSE); - return (((isc_int32_t)(a - b) < 0) ? ISC_TRUE : ISC_FALSE); -} - -isc_boolean_t -isc_serial_gt(isc_uint32_t a, isc_uint32_t b) { - return (((isc_int32_t)(a - b) > 0) ? ISC_TRUE : ISC_FALSE); -} - -isc_boolean_t -isc_serial_le(isc_uint32_t a, isc_uint32_t b) { - return ((a == b) ? ISC_TRUE : isc_serial_lt(a, b)); -} - -isc_boolean_t -isc_serial_ge(isc_uint32_t a, isc_uint32_t b) { - return ((a == b) ? ISC_TRUE : isc_serial_gt(a, b)); -} - -isc_boolean_t -isc_serial_eq(isc_uint32_t a, isc_uint32_t b) { - return ((a == b) ? ISC_TRUE : ISC_FALSE); -} - -isc_boolean_t -isc_serial_ne(isc_uint32_t a, isc_uint32_t b) { - return ((a != b) ? ISC_TRUE : ISC_FALSE); -} diff --git a/lib/isc/sha2.c b/lib/isc/sha2.c deleted file mode 100644 index db2e3496c454..000000000000 --- a/lib/isc/sha2.c +++ /dev/null @@ -1,1449 +0,0 @@ -/* - * Copyright (C) 2005-2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/* $FreeBSD: src/sys/crypto/sha2/sha2.c,v 1.2.2.2 2002/03/05 08:36:47 ume Exp $ */ -/* $KAME: sha2.c,v 1.8 2001/11/08 01:07:52 itojun Exp $ */ - -/* - * sha2.c - * - * Version 1.0.0beta1 - * - * Written by Aaron D. Gifford - * - * Copyright 2000 Aaron D. Gifford. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the names of contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTOR(S) ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTOR(S) BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - - -#include - -#include -#include -#include -#include -#include - -#ifdef ISC_PLATFORM_OPENSSLHASH - -void -isc_sha224_init(isc_sha224_t *context) { - if (context == (isc_sha224_t *)0) { - return; - } - EVP_DigestInit(context, EVP_sha224()); -} - -void -isc_sha224_invalidate(isc_sha224_t *context) { - EVP_MD_CTX_cleanup(context); -} - -void -isc_sha224_update(isc_sha224_t *context, const isc_uint8_t* data, size_t len) { - if (len == 0U) { - /* Calling with no data is valid - we do nothing */ - return; - } - - /* Sanity check: */ - REQUIRE(context != (isc_sha224_t *)0 && data != (isc_uint8_t*)0); - - EVP_DigestUpdate(context, (const void *) data, len); -} - -void -isc_sha224_final(isc_uint8_t digest[], isc_sha224_t *context) { - /* Sanity check: */ - REQUIRE(context != (isc_sha224_t *)0); - - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (isc_uint8_t*)0) { - EVP_DigestFinal(context, digest, NULL); - } else { - EVP_MD_CTX_cleanup(context); - } -} - -void -isc_sha256_init(isc_sha256_t *context) { - if (context == (isc_sha256_t *)0) { - return; - } - EVP_DigestInit(context, EVP_sha256()); -} - -void -isc_sha256_invalidate(isc_sha256_t *context) { - EVP_MD_CTX_cleanup(context); -} - -void -isc_sha256_update(isc_sha256_t *context, const isc_uint8_t *data, size_t len) { - if (len == 0U) { - /* Calling with no data is valid - we do nothing */ - return; - } - - /* Sanity check: */ - REQUIRE(context != (isc_sha256_t *)0 && data != (isc_uint8_t*)0); - - EVP_DigestUpdate(context, (const void *) data, len); -} - -void -isc_sha256_final(isc_uint8_t digest[], isc_sha256_t *context) { - /* Sanity check: */ - REQUIRE(context != (isc_sha256_t *)0); - - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (isc_uint8_t*)0) { - EVP_DigestFinal(context, digest, NULL); - } else { - EVP_MD_CTX_cleanup(context); - } -} - -void -isc_sha512_init(isc_sha512_t *context) { - if (context == (isc_sha512_t *)0) { - return; - } - EVP_DigestInit(context, EVP_sha512()); -} - -void -isc_sha512_invalidate(isc_sha512_t *context) { - EVP_MD_CTX_cleanup(context); -} - -void isc_sha512_update(isc_sha512_t *context, const isc_uint8_t *data, size_t len) { - if (len == 0U) { - /* Calling with no data is valid - we do nothing */ - return; - } - - /* Sanity check: */ - REQUIRE(context != (isc_sha512_t *)0 && data != (isc_uint8_t*)0); - - EVP_DigestUpdate(context, (const void *) data, len); -} - -void isc_sha512_final(isc_uint8_t digest[], isc_sha512_t *context) { - /* Sanity check: */ - REQUIRE(context != (isc_sha512_t *)0); - - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (isc_uint8_t*)0) { - EVP_DigestFinal(context, digest, NULL); - } else { - EVP_MD_CTX_cleanup(context); - } -} - -void -isc_sha384_init(isc_sha384_t *context) { - if (context == (isc_sha384_t *)0) { - return; - } - EVP_DigestInit(context, EVP_sha384()); -} - -void -isc_sha384_invalidate(isc_sha384_t *context) { - EVP_MD_CTX_cleanup(context); -} - -void -isc_sha384_update(isc_sha384_t *context, const isc_uint8_t* data, size_t len) { - if (len == 0U) { - /* Calling with no data is valid - we do nothing */ - return; - } - - /* Sanity check: */ - REQUIRE(context != (isc_sha512_t *)0 && data != (isc_uint8_t*)0); - - EVP_DigestUpdate(context, (const void *) data, len); -} - -void -isc_sha384_final(isc_uint8_t digest[], isc_sha384_t *context) { - /* Sanity check: */ - REQUIRE(context != (isc_sha384_t *)0); - - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (isc_uint8_t*)0) { - EVP_DigestFinal(context, digest, NULL); - } else { - EVP_MD_CTX_cleanup(context); - } -} - -#else - -/* - * UNROLLED TRANSFORM LOOP NOTE: - * You can define SHA2_UNROLL_TRANSFORM to use the unrolled transform - * loop version for the hash transform rounds (defined using macros - * later in this file). Either define on the command line, for example: - * - * cc -DISC_SHA2_UNROLL_TRANSFORM -o sha2 sha2.c sha2prog.c - * - * or define below: - * - * \#define ISC_SHA2_UNROLL_TRANSFORM - * - */ - -/*** SHA-256/384/512 Machine Architecture Definitions *****************/ -/* - * BYTE_ORDER NOTE: - * - * Please make sure that your system defines BYTE_ORDER. If your - * architecture is little-endian, make sure it also defines - * LITTLE_ENDIAN and that the two (BYTE_ORDER and LITTLE_ENDIAN) are - * equivalent. - * - * If your system does not define the above, then you can do so by - * hand like this: - * - * \#define LITTLE_ENDIAN 1234 - * \#define BIG_ENDIAN 4321 - * - * And for little-endian machines, add: - * - * \#define BYTE_ORDER LITTLE_ENDIAN - * - * Or for big-endian machines: - * - * \#define BYTE_ORDER BIG_ENDIAN - * - * The FreeBSD machine this was written on defines BYTE_ORDER - * appropriately by including (which in turn includes - * where the appropriate definitions are actually - * made). - */ -#if !defined(BYTE_ORDER) || (BYTE_ORDER != LITTLE_ENDIAN && BYTE_ORDER != BIG_ENDIAN) -#ifndef BYTE_ORDER -#ifndef BIG_ENDIAN -#define BIG_ENDIAN 4321 -#endif -#ifndef LITTLE_ENDIAN -#define LITTLE_ENDIAN 1234 -#endif -#ifdef WORDS_BIGENDIAN -#define BYTE_ORDER BIG_ENDIAN -#else -#define BYTE_ORDER LITTLE_ENDIAN -#endif -#else -#error Define BYTE_ORDER to be equal to either LITTLE_ENDIAN or BIG_ENDIAN -#endif -#endif - -/*** SHA-256/384/512 Various Length Definitions ***********************/ -/* NOTE: Most of these are in sha2.h */ -#define ISC_SHA256_SHORT_BLOCK_LENGTH (ISC_SHA256_BLOCK_LENGTH - 8) -#define ISC_SHA384_SHORT_BLOCK_LENGTH (ISC_SHA384_BLOCK_LENGTH - 16) -#define ISC_SHA512_SHORT_BLOCK_LENGTH (ISC_SHA512_BLOCK_LENGTH - 16) - - -/*** ENDIAN REVERSAL MACROS *******************************************/ -#if BYTE_ORDER == LITTLE_ENDIAN -#define REVERSE32(w,x) { \ - isc_uint32_t tmp = (w); \ - tmp = (tmp >> 16) | (tmp << 16); \ - (x) = ((tmp & 0xff00ff00UL) >> 8) | ((tmp & 0x00ff00ffUL) << 8); \ -} -#ifdef WIN32 -#define REVERSE64(w,x) { \ - isc_uint64_t tmp = (w); \ - tmp = (tmp >> 32) | (tmp << 32); \ - tmp = ((tmp & 0xff00ff00ff00ff00UL) >> 8) | \ - ((tmp & 0x00ff00ff00ff00ffUL) << 8); \ - (x) = ((tmp & 0xffff0000ffff0000UL) >> 16) | \ - ((tmp & 0x0000ffff0000ffffUL) << 16); \ -} -#else -#define REVERSE64(w,x) { \ - isc_uint64_t tmp = (w); \ - tmp = (tmp >> 32) | (tmp << 32); \ - tmp = ((tmp & 0xff00ff00ff00ff00ULL) >> 8) | \ - ((tmp & 0x00ff00ff00ff00ffULL) << 8); \ - (x) = ((tmp & 0xffff0000ffff0000ULL) >> 16) | \ - ((tmp & 0x0000ffff0000ffffULL) << 16); \ -} -#endif -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ - -/* - * Macro for incrementally adding the unsigned 64-bit integer n to the - * unsigned 128-bit integer (represented using a two-element array of - * 64-bit words): - */ -#define ADDINC128(w,n) { \ - (w)[0] += (isc_uint64_t)(n); \ - if ((w)[0] < (n)) { \ - (w)[1]++; \ - } \ -} - -/*** THE SIX LOGICAL FUNCTIONS ****************************************/ -/* - * Bit shifting and rotation (used by the six SHA-XYZ logical functions: - * - * NOTE: The naming of R and S appears backwards here (R is a SHIFT and - * S is a ROTATION) because the SHA-256/384/512 description document - * (see http://csrc.nist.gov/cryptval/shs/sha256-384-512.pdf) uses this - * same "backwards" definition. - */ -/* Shift-right (used in SHA-256, SHA-384, and SHA-512): */ -#define R(b,x) ((x) >> (b)) -/* 32-bit Rotate-right (used in SHA-256): */ -#define S32(b,x) (((x) >> (b)) | ((x) << (32 - (b)))) -/* 64-bit Rotate-right (used in SHA-384 and SHA-512): */ -#define S64(b,x) (((x) >> (b)) | ((x) << (64 - (b)))) - -/* Two of six logical functions used in SHA-256, SHA-384, and SHA-512: */ -#define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z))) -#define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) - -/* Four of six logical functions used in SHA-256: */ -#define Sigma0_256(x) (S32(2, (x)) ^ S32(13, (x)) ^ S32(22, (x))) -#define Sigma1_256(x) (S32(6, (x)) ^ S32(11, (x)) ^ S32(25, (x))) -#define sigma0_256(x) (S32(7, (x)) ^ S32(18, (x)) ^ R(3 , (x))) -#define sigma1_256(x) (S32(17, (x)) ^ S32(19, (x)) ^ R(10, (x))) - -/* Four of six logical functions used in SHA-384 and SHA-512: */ -#define Sigma0_512(x) (S64(28, (x)) ^ S64(34, (x)) ^ S64(39, (x))) -#define Sigma1_512(x) (S64(14, (x)) ^ S64(18, (x)) ^ S64(41, (x))) -#define sigma0_512(x) (S64( 1, (x)) ^ S64( 8, (x)) ^ R( 7, (x))) -#define sigma1_512(x) (S64(19, (x)) ^ S64(61, (x)) ^ R( 6, (x))) - -/*** INTERNAL FUNCTION PROTOTYPES *************************************/ -/* NOTE: These should not be accessed directly from outside this - * library -- they are intended for private internal visibility/use - * only. - */ -void isc_sha512_last(isc_sha512_t *); -void isc_sha256_transform(isc_sha256_t *, const isc_uint32_t*); -void isc_sha512_transform(isc_sha512_t *, const isc_uint64_t*); - - -/*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/ -/* Hash constant words K for SHA-224 and SHA-256: */ -static const isc_uint32_t K256[64] = { - 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, - 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, - 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, - 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, - 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, - 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, - 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, - 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, - 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, - 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, - 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, - 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, - 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, - 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, - 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, - 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL -}; - -/* Initial hash value H for SHA-224: */ -static const isc_uint32_t sha224_initial_hash_value[8] = { - 0xc1059ed8UL, - 0x367cd507UL, - 0x3070dd17UL, - 0xf70e5939UL, - 0xffc00b31UL, - 0x68581511UL, - 0x64f98fa7UL, - 0xbefa4fa4UL -}; - -/* Initial hash value H for SHA-256: */ -static const isc_uint32_t sha256_initial_hash_value[8] = { - 0x6a09e667UL, - 0xbb67ae85UL, - 0x3c6ef372UL, - 0xa54ff53aUL, - 0x510e527fUL, - 0x9b05688cUL, - 0x1f83d9abUL, - 0x5be0cd19UL -}; - -#ifdef WIN32 -/* Hash constant words K for SHA-384 and SHA-512: */ -static const isc_uint64_t K512[80] = { - 0x428a2f98d728ae22UL, 0x7137449123ef65cdUL, - 0xb5c0fbcfec4d3b2fUL, 0xe9b5dba58189dbbcUL, - 0x3956c25bf348b538UL, 0x59f111f1b605d019UL, - 0x923f82a4af194f9bUL, 0xab1c5ed5da6d8118UL, - 0xd807aa98a3030242UL, 0x12835b0145706fbeUL, - 0x243185be4ee4b28cUL, 0x550c7dc3d5ffb4e2UL, - 0x72be5d74f27b896fUL, 0x80deb1fe3b1696b1UL, - 0x9bdc06a725c71235UL, 0xc19bf174cf692694UL, - 0xe49b69c19ef14ad2UL, 0xefbe4786384f25e3UL, - 0x0fc19dc68b8cd5b5UL, 0x240ca1cc77ac9c65UL, - 0x2de92c6f592b0275UL, 0x4a7484aa6ea6e483UL, - 0x5cb0a9dcbd41fbd4UL, 0x76f988da831153b5UL, - 0x983e5152ee66dfabUL, 0xa831c66d2db43210UL, - 0xb00327c898fb213fUL, 0xbf597fc7beef0ee4UL, - 0xc6e00bf33da88fc2UL, 0xd5a79147930aa725UL, - 0x06ca6351e003826fUL, 0x142929670a0e6e70UL, - 0x27b70a8546d22ffcUL, 0x2e1b21385c26c926UL, - 0x4d2c6dfc5ac42aedUL, 0x53380d139d95b3dfUL, - 0x650a73548baf63deUL, 0x766a0abb3c77b2a8UL, - 0x81c2c92e47edaee6UL, 0x92722c851482353bUL, - 0xa2bfe8a14cf10364UL, 0xa81a664bbc423001UL, - 0xc24b8b70d0f89791UL, 0xc76c51a30654be30UL, - 0xd192e819d6ef5218UL, 0xd69906245565a910UL, - 0xf40e35855771202aUL, 0x106aa07032bbd1b8UL, - 0x19a4c116b8d2d0c8UL, 0x1e376c085141ab53UL, - 0x2748774cdf8eeb99UL, 0x34b0bcb5e19b48a8UL, - 0x391c0cb3c5c95a63UL, 0x4ed8aa4ae3418acbUL, - 0x5b9cca4f7763e373UL, 0x682e6ff3d6b2b8a3UL, - 0x748f82ee5defb2fcUL, 0x78a5636f43172f60UL, - 0x84c87814a1f0ab72UL, 0x8cc702081a6439ecUL, - 0x90befffa23631e28UL, 0xa4506cebde82bde9UL, - 0xbef9a3f7b2c67915UL, 0xc67178f2e372532bUL, - 0xca273eceea26619cUL, 0xd186b8c721c0c207UL, - 0xeada7dd6cde0eb1eUL, 0xf57d4f7fee6ed178UL, - 0x06f067aa72176fbaUL, 0x0a637dc5a2c898a6UL, - 0x113f9804bef90daeUL, 0x1b710b35131c471bUL, - 0x28db77f523047d84UL, 0x32caab7b40c72493UL, - 0x3c9ebe0a15c9bebcUL, 0x431d67c49c100d4cUL, - 0x4cc5d4becb3e42b6UL, 0x597f299cfc657e2aUL, - 0x5fcb6fab3ad6faecUL, 0x6c44198c4a475817UL -}; - -/* Initial hash value H for SHA-384: */ -static const isc_uint64_t sha384_initial_hash_value[8] = { - 0xcbbb9d5dc1059ed8UL, - 0x629a292a367cd507UL, - 0x9159015a3070dd17UL, - 0x152fecd8f70e5939UL, - 0x67332667ffc00b31UL, - 0x8eb44a8768581511UL, - 0xdb0c2e0d64f98fa7UL, - 0x47b5481dbefa4fa4UL -}; - -/* Initial hash value H for SHA-512: */ -static const isc_uint64_t sha512_initial_hash_value[8] = { - 0x6a09e667f3bcc908U, - 0xbb67ae8584caa73bUL, - 0x3c6ef372fe94f82bUL, - 0xa54ff53a5f1d36f1UL, - 0x510e527fade682d1UL, - 0x9b05688c2b3e6c1fUL, - 0x1f83d9abfb41bd6bUL, - 0x5be0cd19137e2179UL -}; -#else -/* Hash constant words K for SHA-384 and SHA-512: */ -static const isc_uint64_t K512[80] = { - 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, - 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, - 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, - 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, - 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, - 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, - 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, - 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, - 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, - 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, - 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, - 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, - 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, - 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, - 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, - 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, - 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, - 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, - 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, - 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, - 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, - 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, - 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, - 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, - 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, - 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, - 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, - 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, - 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, - 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, - 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, - 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, - 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, - 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, - 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, - 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, - 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, - 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, - 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, - 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL -}; - -/* Initial hash value H for SHA-384: */ -static const isc_uint64_t sha384_initial_hash_value[8] = { - 0xcbbb9d5dc1059ed8ULL, - 0x629a292a367cd507ULL, - 0x9159015a3070dd17ULL, - 0x152fecd8f70e5939ULL, - 0x67332667ffc00b31ULL, - 0x8eb44a8768581511ULL, - 0xdb0c2e0d64f98fa7ULL, - 0x47b5481dbefa4fa4ULL -}; - -/* Initial hash value H for SHA-512: */ -static const isc_uint64_t sha512_initial_hash_value[8] = { - 0x6a09e667f3bcc908ULL, - 0xbb67ae8584caa73bULL, - 0x3c6ef372fe94f82bULL, - 0xa54ff53a5f1d36f1ULL, - 0x510e527fade682d1ULL, - 0x9b05688c2b3e6c1fULL, - 0x1f83d9abfb41bd6bULL, - 0x5be0cd19137e2179ULL -}; -#endif - - -/*** SHA-224: *********************************************************/ -void -isc_sha224_init(isc_sha224_t *context) { - if (context == (isc_sha256_t *)0) { - return; - } - memcpy(context->state, sha224_initial_hash_value, - ISC_SHA256_DIGESTLENGTH); - memset(context->buffer, 0, ISC_SHA256_BLOCK_LENGTH); - context->bitcount = 0; -} - -void -isc_sha224_invalidate(isc_sha224_t *context) { - memset(context, 0, sizeof(isc_sha224_t)); -} - -void -isc_sha224_update(isc_sha224_t *context, const isc_uint8_t* data, size_t len) { - isc_sha256_update((isc_sha256_t *)context, data, len); -} - -void -isc_sha224_final(isc_uint8_t digest[], isc_sha224_t *context) { - isc_uint8_t sha256_digest[ISC_SHA256_DIGESTLENGTH]; - isc_sha256_final(sha256_digest, (isc_sha256_t *)context); - memcpy(digest, sha256_digest, ISC_SHA224_DIGESTLENGTH); - memset(sha256_digest, 0, ISC_SHA256_DIGESTLENGTH); -} - -/*** SHA-256: *********************************************************/ -void -isc_sha256_init(isc_sha256_t *context) { - if (context == (isc_sha256_t *)0) { - return; - } - memcpy(context->state, sha256_initial_hash_value, - ISC_SHA256_DIGESTLENGTH); - memset(context->buffer, 0, ISC_SHA256_BLOCK_LENGTH); - context->bitcount = 0; -} - -void -isc_sha256_invalidate(isc_sha256_t *context) { - memset(context, 0, sizeof(isc_sha256_t)); -} - -#ifdef ISC_SHA2_UNROLL_TRANSFORM - -/* Unrolled SHA-256 round macros: */ - -#if BYTE_ORDER == LITTLE_ENDIAN - -#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ - REVERSE32(*data++, W256[j]); \ - T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ - K256[j] + W256[j]; \ - (d) += T1; \ - (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ - j++ - - -#else /* BYTE_ORDER == LITTLE_ENDIAN */ - -#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ - T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ - K256[j] + (W256[j] = *data++); \ - (d) += T1; \ - (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ - j++ - -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ - -#define ROUND256(a,b,c,d,e,f,g,h) \ - s0 = W256[(j+1)&0x0f]; \ - s0 = sigma0_256(s0); \ - s1 = W256[(j+14)&0x0f]; \ - s1 = sigma1_256(s1); \ - T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + K256[j] + \ - (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); \ - (d) += T1; \ - (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ - j++ - -void isc_sha256_transform(isc_sha256_t *context, const isc_uint32_t* data) { - isc_uint32_t a, b, c, d, e, f, g, h, s0, s1; - isc_uint32_t T1, *W256; - int j; - - W256 = (isc_uint32_t*)context->buffer; - - /* Initialize registers with the prev. intermediate value */ - a = context->state[0]; - b = context->state[1]; - c = context->state[2]; - d = context->state[3]; - e = context->state[4]; - f = context->state[5]; - g = context->state[6]; - h = context->state[7]; - - j = 0; - do { - /* Rounds 0 to 15 (unrolled): */ - ROUND256_0_TO_15(a,b,c,d,e,f,g,h); - ROUND256_0_TO_15(h,a,b,c,d,e,f,g); - ROUND256_0_TO_15(g,h,a,b,c,d,e,f); - ROUND256_0_TO_15(f,g,h,a,b,c,d,e); - ROUND256_0_TO_15(e,f,g,h,a,b,c,d); - ROUND256_0_TO_15(d,e,f,g,h,a,b,c); - ROUND256_0_TO_15(c,d,e,f,g,h,a,b); - ROUND256_0_TO_15(b,c,d,e,f,g,h,a); - } while (j < 16); - - /* Now for the remaining rounds to 64: */ - do { - ROUND256(a,b,c,d,e,f,g,h); - ROUND256(h,a,b,c,d,e,f,g); - ROUND256(g,h,a,b,c,d,e,f); - ROUND256(f,g,h,a,b,c,d,e); - ROUND256(e,f,g,h,a,b,c,d); - ROUND256(d,e,f,g,h,a,b,c); - ROUND256(c,d,e,f,g,h,a,b); - ROUND256(b,c,d,e,f,g,h,a); - } while (j < 64); - - /* Compute the current intermediate hash value */ - context->state[0] += a; - context->state[1] += b; - context->state[2] += c; - context->state[3] += d; - context->state[4] += e; - context->state[5] += f; - context->state[6] += g; - context->state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = 0; - /* Avoid compiler warnings */ - POST(a); POST(b); POST(c); POST(d); POST(e); POST(f); - POST(g); POST(h); POST(T1); -} - -#else /* ISC_SHA2_UNROLL_TRANSFORM */ - -void -isc_sha256_transform(isc_sha256_t *context, const isc_uint32_t* data) { - isc_uint32_t a, b, c, d, e, f, g, h, s0, s1; - isc_uint32_t T1, T2, *W256; - int j; - - W256 = (isc_uint32_t*)context->buffer; - - /* Initialize registers with the prev. intermediate value */ - a = context->state[0]; - b = context->state[1]; - c = context->state[2]; - d = context->state[3]; - e = context->state[4]; - f = context->state[5]; - g = context->state[6]; - h = context->state[7]; - - j = 0; - do { -#if BYTE_ORDER == LITTLE_ENDIAN - /* Copy data while converting to host byte order */ - REVERSE32(*data++,W256[j]); - /* Apply the SHA-256 compression function to update a..h */ - T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j]; -#else /* BYTE_ORDER == LITTLE_ENDIAN */ - /* Apply the SHA-256 compression function to update a..h with copy */ - T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++); -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ - T2 = Sigma0_256(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 16); - - do { - /* Part of the message block expansion: */ - s0 = W256[(j+1)&0x0f]; - s0 = sigma0_256(s0); - s1 = W256[(j+14)&0x0f]; - s1 = sigma1_256(s1); - - /* Apply the SHA-256 compression function to update a..h */ - T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + - (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); - T2 = Sigma0_256(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 64); - - /* Compute the current intermediate hash value */ - context->state[0] += a; - context->state[1] += b; - context->state[2] += c; - context->state[3] += d; - context->state[4] += e; - context->state[5] += f; - context->state[6] += g; - context->state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = T2 = 0; - /* Avoid compiler warnings */ - POST(a); POST(b); POST(c); POST(d); POST(e); POST(f); - POST(g); POST(h); POST(T1); POST(T2); -} - -#endif /* ISC_SHA2_UNROLL_TRANSFORM */ - -void -isc_sha256_update(isc_sha256_t *context, const isc_uint8_t *data, size_t len) { - unsigned int freespace, usedspace; - - if (len == 0U) { - /* Calling with no data is valid - we do nothing */ - return; - } - - /* Sanity check: */ - REQUIRE(context != (isc_sha256_t *)0 && data != (isc_uint8_t*)0); - - usedspace = (unsigned int)((context->bitcount >> 3) % - ISC_SHA256_BLOCK_LENGTH); - if (usedspace > 0) { - /* Calculate how much free space is available in the buffer */ - freespace = ISC_SHA256_BLOCK_LENGTH - usedspace; - - if (len >= freespace) { - /* Fill the buffer completely and process it */ - memcpy(&context->buffer[usedspace], data, freespace); - context->bitcount += freespace << 3; - len -= freespace; - data += freespace; - isc_sha256_transform(context, - (isc_uint32_t*)context->buffer); - } else { - /* The buffer is not yet full */ - memcpy(&context->buffer[usedspace], data, len); - context->bitcount += len << 3; - /* Clean up: */ - usedspace = freespace = 0; - /* Avoid compiler warnings: */ - POST(usedspace); POST(freespace); - return; - } - } - while (len >= ISC_SHA256_BLOCK_LENGTH) { - /* Process as many complete blocks as we can */ - memcpy(context->buffer, data, ISC_SHA256_BLOCK_LENGTH); - isc_sha256_transform(context, (isc_uint32_t*)context->buffer); - context->bitcount += ISC_SHA256_BLOCK_LENGTH << 3; - len -= ISC_SHA256_BLOCK_LENGTH; - data += ISC_SHA256_BLOCK_LENGTH; - } - if (len > 0U) { - /* There's left-overs, so save 'em */ - memcpy(context->buffer, data, len); - context->bitcount += len << 3; - } - /* Clean up: */ - usedspace = freespace = 0; - /* Avoid compiler warnings: */ - POST(usedspace); POST(freespace); -} - -void -isc_sha256_final(isc_uint8_t digest[], isc_sha256_t *context) { - isc_uint32_t *d = (isc_uint32_t*)digest; - unsigned int usedspace; - - /* Sanity check: */ - REQUIRE(context != (isc_sha256_t *)0); - - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (isc_uint8_t*)0) { - usedspace = (unsigned int)((context->bitcount >> 3) % - ISC_SHA256_BLOCK_LENGTH); -#if BYTE_ORDER == LITTLE_ENDIAN - /* Convert FROM host byte order */ - REVERSE64(context->bitcount,context->bitcount); -#endif - if (usedspace > 0) { - /* Begin padding with a 1 bit: */ - context->buffer[usedspace++] = 0x80; - - if (usedspace <= ISC_SHA256_SHORT_BLOCK_LENGTH) { - /* Set-up for the last transform: */ - memset(&context->buffer[usedspace], 0, - ISC_SHA256_SHORT_BLOCK_LENGTH - usedspace); - } else { - if (usedspace < ISC_SHA256_BLOCK_LENGTH) { - memset(&context->buffer[usedspace], 0, - ISC_SHA256_BLOCK_LENGTH - - usedspace); - } - /* Do second-to-last transform: */ - isc_sha256_transform(context, - (isc_uint32_t*)context->buffer); - - /* And set-up for the last transform: */ - memset(context->buffer, 0, - ISC_SHA256_SHORT_BLOCK_LENGTH); - } - } else { - /* Set-up for the last transform: */ - memset(context->buffer, 0, ISC_SHA256_SHORT_BLOCK_LENGTH); - - /* Begin padding with a 1 bit: */ - *context->buffer = 0x80; - } - /* Set the bit count: */ - *(isc_uint64_t*)&context->buffer[ISC_SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; - - /* Final transform: */ - isc_sha256_transform(context, (isc_uint32_t*)context->buffer); - -#if BYTE_ORDER == LITTLE_ENDIAN - { - /* Convert TO host byte order */ - int j; - for (j = 0; j < 8; j++) { - REVERSE32(context->state[j],context->state[j]); - *d++ = context->state[j]; - } - } -#else - memcpy(d, context->state, ISC_SHA256_DIGESTLENGTH); -#endif - } - - /* Clean up state data: */ - memset(context, 0, sizeof(*context)); - usedspace = 0; - POST(usedspace); -} - -/*** SHA-512: *********************************************************/ -void -isc_sha512_init(isc_sha512_t *context) { - if (context == (isc_sha512_t *)0) { - return; - } - memcpy(context->state, sha512_initial_hash_value, - ISC_SHA512_DIGESTLENGTH); - memset(context->buffer, 0, ISC_SHA512_BLOCK_LENGTH); - context->bitcount[0] = context->bitcount[1] = 0; -} - -void -isc_sha512_invalidate(isc_sha512_t *context) { - memset(context, 0, sizeof(isc_sha512_t)); -} - -#ifdef ISC_SHA2_UNROLL_TRANSFORM - -/* Unrolled SHA-512 round macros: */ -#if BYTE_ORDER == LITTLE_ENDIAN - -#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ - REVERSE64(*data++, W512[j]); \ - T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ - K512[j] + W512[j]; \ - (d) += T1, \ - (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)), \ - j++ - - -#else /* BYTE_ORDER == LITTLE_ENDIAN */ - -#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ - T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ - K512[j] + (W512[j] = *data++); \ - (d) += T1; \ - (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ - j++ - -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ - -#define ROUND512(a,b,c,d,e,f,g,h) \ - s0 = W512[(j+1)&0x0f]; \ - s0 = sigma0_512(s0); \ - s1 = W512[(j+14)&0x0f]; \ - s1 = sigma1_512(s1); \ - T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + K512[j] + \ - (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); \ - (d) += T1; \ - (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ - j++ - -void isc_sha512_transform(isc_sha512_t *context, const isc_uint64_t* data) { - isc_uint64_t a, b, c, d, e, f, g, h, s0, s1; - isc_uint64_t T1, *W512 = (isc_uint64_t*)context->buffer; - int j; - - /* Initialize registers with the prev. intermediate value */ - a = context->state[0]; - b = context->state[1]; - c = context->state[2]; - d = context->state[3]; - e = context->state[4]; - f = context->state[5]; - g = context->state[6]; - h = context->state[7]; - - j = 0; - do { - ROUND512_0_TO_15(a,b,c,d,e,f,g,h); - ROUND512_0_TO_15(h,a,b,c,d,e,f,g); - ROUND512_0_TO_15(g,h,a,b,c,d,e,f); - ROUND512_0_TO_15(f,g,h,a,b,c,d,e); - ROUND512_0_TO_15(e,f,g,h,a,b,c,d); - ROUND512_0_TO_15(d,e,f,g,h,a,b,c); - ROUND512_0_TO_15(c,d,e,f,g,h,a,b); - ROUND512_0_TO_15(b,c,d,e,f,g,h,a); - } while (j < 16); - - /* Now for the remaining rounds up to 79: */ - do { - ROUND512(a,b,c,d,e,f,g,h); - ROUND512(h,a,b,c,d,e,f,g); - ROUND512(g,h,a,b,c,d,e,f); - ROUND512(f,g,h,a,b,c,d,e); - ROUND512(e,f,g,h,a,b,c,d); - ROUND512(d,e,f,g,h,a,b,c); - ROUND512(c,d,e,f,g,h,a,b); - ROUND512(b,c,d,e,f,g,h,a); - } while (j < 80); - - /* Compute the current intermediate hash value */ - context->state[0] += a; - context->state[1] += b; - context->state[2] += c; - context->state[3] += d; - context->state[4] += e; - context->state[5] += f; - context->state[6] += g; - context->state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = 0; - /* Avoid compiler warnings */ - POST(a); POST(b); POST(c); POST(d); POST(e); POST(f); - POST(g); POST(h); POST(T1); -} - -#else /* ISC_SHA2_UNROLL_TRANSFORM */ - -void -isc_sha512_transform(isc_sha512_t *context, const isc_uint64_t* data) { - isc_uint64_t a, b, c, d, e, f, g, h, s0, s1; - isc_uint64_t T1, T2, *W512 = (isc_uint64_t*)context->buffer; - int j; - - /* Initialize registers with the prev. intermediate value */ - a = context->state[0]; - b = context->state[1]; - c = context->state[2]; - d = context->state[3]; - e = context->state[4]; - f = context->state[5]; - g = context->state[6]; - h = context->state[7]; - - j = 0; - do { -#if BYTE_ORDER == LITTLE_ENDIAN - /* Convert TO host byte order */ - REVERSE64(*data++, W512[j]); - /* Apply the SHA-512 compression function to update a..h */ - T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j]; -#else /* BYTE_ORDER == LITTLE_ENDIAN */ - /* Apply the SHA-512 compression function to update a..h with copy */ - T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++); -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ - T2 = Sigma0_512(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 16); - - do { - /* Part of the message block expansion: */ - s0 = W512[(j+1)&0x0f]; - s0 = sigma0_512(s0); - s1 = W512[(j+14)&0x0f]; - s1 = sigma1_512(s1); - - /* Apply the SHA-512 compression function to update a..h */ - T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + - (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); - T2 = Sigma0_512(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 80); - - /* Compute the current intermediate hash value */ - context->state[0] += a; - context->state[1] += b; - context->state[2] += c; - context->state[3] += d; - context->state[4] += e; - context->state[5] += f; - context->state[6] += g; - context->state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = T2 = 0; - /* Avoid compiler warnings */ - POST(a); POST(b); POST(c); POST(d); POST(e); POST(f); - POST(g); POST(h); POST(T1); POST(T2); -} - -#endif /* ISC_SHA2_UNROLL_TRANSFORM */ - -void isc_sha512_update(isc_sha512_t *context, const isc_uint8_t *data, size_t len) { - unsigned int freespace, usedspace; - - if (len == 0U) { - /* Calling with no data is valid - we do nothing */ - return; - } - - /* Sanity check: */ - REQUIRE(context != (isc_sha512_t *)0 && data != (isc_uint8_t*)0); - - usedspace = (unsigned int)((context->bitcount[0] >> 3) % - ISC_SHA512_BLOCK_LENGTH); - if (usedspace > 0) { - /* Calculate how much free space is available in the buffer */ - freespace = ISC_SHA512_BLOCK_LENGTH - usedspace; - - if (len >= freespace) { - /* Fill the buffer completely and process it */ - memcpy(&context->buffer[usedspace], data, freespace); - ADDINC128(context->bitcount, freespace << 3); - len -= freespace; - data += freespace; - isc_sha512_transform(context, - (isc_uint64_t*)context->buffer); - } else { - /* The buffer is not yet full */ - memcpy(&context->buffer[usedspace], data, len); - ADDINC128(context->bitcount, len << 3); - /* Clean up: */ - usedspace = freespace = 0; - /* Avoid compiler warnings: */ - POST(usedspace); POST(freespace); - return; - } - } - while (len >= ISC_SHA512_BLOCK_LENGTH) { - /* Process as many complete blocks as we can */ - memcpy(context->buffer, data, ISC_SHA512_BLOCK_LENGTH); - isc_sha512_transform(context, (isc_uint64_t*)context->buffer); - ADDINC128(context->bitcount, ISC_SHA512_BLOCK_LENGTH << 3); - len -= ISC_SHA512_BLOCK_LENGTH; - data += ISC_SHA512_BLOCK_LENGTH; - } - if (len > 0U) { - /* There's left-overs, so save 'em */ - memcpy(context->buffer, data, len); - ADDINC128(context->bitcount, len << 3); - } - /* Clean up: */ - usedspace = freespace = 0; - /* Avoid compiler warnings: */ - POST(usedspace); POST(freespace); -} - -void isc_sha512_last(isc_sha512_t *context) { - unsigned int usedspace; - - usedspace = (unsigned int)((context->bitcount[0] >> 3) % - ISC_SHA512_BLOCK_LENGTH); -#if BYTE_ORDER == LITTLE_ENDIAN - /* Convert FROM host byte order */ - REVERSE64(context->bitcount[0],context->bitcount[0]); - REVERSE64(context->bitcount[1],context->bitcount[1]); -#endif - if (usedspace > 0) { - /* Begin padding with a 1 bit: */ - context->buffer[usedspace++] = 0x80; - - if (usedspace <= ISC_SHA512_SHORT_BLOCK_LENGTH) { - /* Set-up for the last transform: */ - memset(&context->buffer[usedspace], 0, - ISC_SHA512_SHORT_BLOCK_LENGTH - usedspace); - } else { - if (usedspace < ISC_SHA512_BLOCK_LENGTH) { - memset(&context->buffer[usedspace], 0, - ISC_SHA512_BLOCK_LENGTH - usedspace); - } - /* Do second-to-last transform: */ - isc_sha512_transform(context, - (isc_uint64_t*)context->buffer); - - /* And set-up for the last transform: */ - memset(context->buffer, 0, ISC_SHA512_BLOCK_LENGTH - 2); - } - } else { - /* Prepare for final transform: */ - memset(context->buffer, 0, ISC_SHA512_SHORT_BLOCK_LENGTH); - - /* Begin padding with a 1 bit: */ - *context->buffer = 0x80; - } - /* Store the length of input data (in bits): */ - *(isc_uint64_t*)&context->buffer[ISC_SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1]; - *(isc_uint64_t*)&context->buffer[ISC_SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0]; - - /* Final transform: */ - isc_sha512_transform(context, (isc_uint64_t*)context->buffer); -} - -void isc_sha512_final(isc_uint8_t digest[], isc_sha512_t *context) { - isc_uint64_t *d = (isc_uint64_t*)digest; - - /* Sanity check: */ - REQUIRE(context != (isc_sha512_t *)0); - - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (isc_uint8_t*)0) { - isc_sha512_last(context); - - /* Save the hash data for output: */ -#if BYTE_ORDER == LITTLE_ENDIAN - { - /* Convert TO host byte order */ - int j; - for (j = 0; j < 8; j++) { - REVERSE64(context->state[j],context->state[j]); - *d++ = context->state[j]; - } - } -#else - memcpy(d, context->state, ISC_SHA512_DIGESTLENGTH); -#endif - } - - /* Zero out state data */ - memset(context, 0, sizeof(*context)); -} - - -/*** SHA-384: *********************************************************/ -void -isc_sha384_init(isc_sha384_t *context) { - if (context == (isc_sha384_t *)0) { - return; - } - memcpy(context->state, sha384_initial_hash_value, - ISC_SHA512_DIGESTLENGTH); - memset(context->buffer, 0, ISC_SHA384_BLOCK_LENGTH); - context->bitcount[0] = context->bitcount[1] = 0; -} - -void -isc_sha384_invalidate(isc_sha384_t *context) { - memset(context, 0, sizeof(isc_sha384_t)); -} - -void -isc_sha384_update(isc_sha384_t *context, const isc_uint8_t* data, size_t len) { - isc_sha512_update((isc_sha512_t *)context, data, len); -} - -void -isc_sha384_final(isc_uint8_t digest[], isc_sha384_t *context) { - isc_uint64_t *d = (isc_uint64_t*)digest; - - /* Sanity check: */ - REQUIRE(context != (isc_sha384_t *)0); - - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (isc_uint8_t*)0) { - isc_sha512_last((isc_sha512_t *)context); - - /* Save the hash data for output: */ -#if BYTE_ORDER == LITTLE_ENDIAN - { - /* Convert TO host byte order */ - int j; - for (j = 0; j < 6; j++) { - REVERSE64(context->state[j],context->state[j]); - *d++ = context->state[j]; - } - } -#else - memcpy(d, context->state, ISC_SHA384_DIGESTLENGTH); -#endif - } - - /* Zero out state data */ - memset(context, 0, sizeof(*context)); -} -#endif /* !ISC_PLATFORM_OPENSSLHASH */ - -/* - * Constant used by SHA256/384/512_End() functions for converting the - * digest to a readable hexadecimal character string: - */ -static const char *sha2_hex_digits = "0123456789abcdef"; - -char * -isc_sha224_end(isc_sha224_t *context, char buffer[]) { - isc_uint8_t digest[ISC_SHA224_DIGESTLENGTH], *d = digest; - unsigned int i; - - /* Sanity check: */ - REQUIRE(context != (isc_sha224_t *)0); - - if (buffer != (char*)0) { - isc_sha224_final(digest, context); - - for (i = 0; i < ISC_SHA224_DIGESTLENGTH; i++) { - *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; - *buffer++ = sha2_hex_digits[*d & 0x0f]; - d++; - } - *buffer = (char)0; - } else { -#ifdef ISC_PLATFORM_OPENSSLHASH - EVP_MD_CTX_cleanup(context); -#else - memset(context, 0, sizeof(*context)); -#endif - } - memset(digest, 0, ISC_SHA224_DIGESTLENGTH); - return buffer; -} - -char * -isc_sha224_data(const isc_uint8_t *data, size_t len, - char digest[ISC_SHA224_DIGESTSTRINGLENGTH]) -{ - isc_sha224_t context; - - isc_sha224_init(&context); - isc_sha224_update(&context, data, len); - return (isc_sha224_end(&context, digest)); -} - -char * -isc_sha256_end(isc_sha256_t *context, char buffer[]) { - isc_uint8_t digest[ISC_SHA256_DIGESTLENGTH], *d = digest; - unsigned int i; - - /* Sanity check: */ - REQUIRE(context != (isc_sha256_t *)0); - - if (buffer != (char*)0) { - isc_sha256_final(digest, context); - - for (i = 0; i < ISC_SHA256_DIGESTLENGTH; i++) { - *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; - *buffer++ = sha2_hex_digits[*d & 0x0f]; - d++; - } - *buffer = (char)0; - } else { -#ifdef ISC_PLATFORM_OPENSSLHASH - EVP_MD_CTX_cleanup(context); -#else - memset(context, 0, sizeof(*context)); -#endif - } - memset(digest, 0, ISC_SHA256_DIGESTLENGTH); - return buffer; -} - -char * -isc_sha256_data(const isc_uint8_t* data, size_t len, - char digest[ISC_SHA256_DIGESTSTRINGLENGTH]) -{ - isc_sha256_t context; - - isc_sha256_init(&context); - isc_sha256_update(&context, data, len); - return (isc_sha256_end(&context, digest)); -} - -char * -isc_sha512_end(isc_sha512_t *context, char buffer[]) { - isc_uint8_t digest[ISC_SHA512_DIGESTLENGTH], *d = digest; - unsigned int i; - - /* Sanity check: */ - REQUIRE(context != (isc_sha512_t *)0); - - if (buffer != (char*)0) { - isc_sha512_final(digest, context); - - for (i = 0; i < ISC_SHA512_DIGESTLENGTH; i++) { - *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; - *buffer++ = sha2_hex_digits[*d & 0x0f]; - d++; - } - *buffer = (char)0; - } else { -#ifdef ISC_PLATFORM_OPENSSLHASH - EVP_MD_CTX_cleanup(context); -#else - memset(context, 0, sizeof(*context)); -#endif - } - memset(digest, 0, ISC_SHA512_DIGESTLENGTH); - return buffer; -} - -char * -isc_sha512_data(const isc_uint8_t *data, size_t len, - char digest[ISC_SHA512_DIGESTSTRINGLENGTH]) -{ - isc_sha512_t context; - - isc_sha512_init(&context); - isc_sha512_update(&context, data, len); - return (isc_sha512_end(&context, digest)); -} - -char * -isc_sha384_end(isc_sha384_t *context, char buffer[]) { - isc_uint8_t digest[ISC_SHA384_DIGESTLENGTH], *d = digest; - unsigned int i; - - /* Sanity check: */ - REQUIRE(context != (isc_sha384_t *)0); - - if (buffer != (char*)0) { - isc_sha384_final(digest, context); - - for (i = 0; i < ISC_SHA384_DIGESTLENGTH; i++) { - *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; - *buffer++ = sha2_hex_digits[*d & 0x0f]; - d++; - } - *buffer = (char)0; - } else { -#ifdef ISC_PLATFORM_OPENSSLHASH - EVP_MD_CTX_cleanup(context); -#else - memset(context, 0, sizeof(*context)); -#endif - } - memset(digest, 0, ISC_SHA384_DIGESTLENGTH); - return buffer; -} - -char * -isc_sha384_data(const isc_uint8_t *data, size_t len, - char digest[ISC_SHA384_DIGESTSTRINGLENGTH]) -{ - isc_sha384_t context; - - isc_sha384_init(&context); - isc_sha384_update(&context, data, len); - return (isc_sha384_end(&context, digest)); -} diff --git a/lib/isc/socket_api.c b/lib/isc/socket_api.c deleted file mode 100644 index 3394ce059b50..000000000000 --- a/lib/isc/socket_api.c +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (C) 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -#include - -#include -#include -#include -#include -#include -#include - -static isc_mutex_t createlock; -static isc_once_t once = ISC_ONCE_INIT; -static isc_socketmgrcreatefunc_t socketmgr_createfunc = NULL; - -static void -initialize(void) { - RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS); -} - -isc_result_t -isc_socket_register(isc_socketmgrcreatefunc_t createfunc) { - isc_result_t result = ISC_R_SUCCESS; - - RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS); - - LOCK(&createlock); - if (socketmgr_createfunc == NULL) - socketmgr_createfunc = createfunc; - else - result = ISC_R_EXISTS; - UNLOCK(&createlock); - - return (result); -} - -isc_result_t -isc_socketmgr_createinctx(isc_mem_t *mctx, isc_appctx_t *actx, - isc_socketmgr_t **managerp) -{ - isc_result_t result; - - LOCK(&createlock); - - REQUIRE(socketmgr_createfunc != NULL); - result = (*socketmgr_createfunc)(mctx, managerp); - - UNLOCK(&createlock); - - if (result == ISC_R_SUCCESS) - isc_appctx_setsocketmgr(actx, *managerp); - - return (result); -} - -isc_result_t -isc_socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp) { - isc_result_t result; - - LOCK(&createlock); - - REQUIRE(socketmgr_createfunc != NULL); - result = (*socketmgr_createfunc)(mctx, managerp); - - UNLOCK(&createlock); - - return (result); -} - -void -isc_socketmgr_destroy(isc_socketmgr_t **managerp) { - REQUIRE(managerp != NULL && ISCAPI_SOCKETMGR_VALID(*managerp)); - - (*managerp)->methods->destroy(managerp); - - ENSURE(*managerp == NULL); -} - -isc_result_t -isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type, - isc_socket_t **socketp) -{ - REQUIRE(ISCAPI_SOCKETMGR_VALID(manager)); - - return (manager->methods->socketcreate(manager, pf, type, socketp)); -} - -void -isc_socket_attach(isc_socket_t *sock, isc_socket_t **socketp) { - REQUIRE(ISCAPI_SOCKET_VALID(sock)); - REQUIRE(socketp != NULL && *socketp == NULL); - - sock->methods->attach(sock, socketp); - - ENSURE(*socketp == sock); -} - -void -isc_socket_detach(isc_socket_t **socketp) { - REQUIRE(socketp != NULL && ISCAPI_SOCKET_VALID(*socketp)); - - (*socketp)->methods->detach(socketp); - - ENSURE(*socketp == NULL); -} - -isc_result_t -isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *sockaddr, - unsigned int options) -{ - REQUIRE(ISCAPI_SOCKET_VALID(sock)); - - return (sock->methods->bind(sock, sockaddr, options)); -} - -isc_result_t -isc_socket_sendto(isc_socket_t *sock, isc_region_t *region, isc_task_t *task, - isc_taskaction_t action, const void *arg, - isc_sockaddr_t *address, struct in6_pktinfo *pktinfo) -{ - REQUIRE(ISCAPI_SOCKET_VALID(sock)); - - return (sock->methods->sendto(sock, region, task, action, arg, address, - pktinfo)); -} - -isc_result_t -isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr, isc_task_t *task, - isc_taskaction_t action, const void *arg) -{ - REQUIRE(ISCAPI_SOCKET_VALID(sock)); - - return (sock->methods->connect(sock, addr, task, action, arg)); -} - -isc_result_t -isc_socket_recv(isc_socket_t *sock, isc_region_t *region, unsigned int minimum, - isc_task_t *task, isc_taskaction_t action, const void *arg) -{ - REQUIRE(ISCAPI_SOCKET_VALID(sock)); - - return (sock->methods->recv(sock, region, minimum, task, action, arg)); -} - -void -isc_socket_cancel(isc_socket_t *sock, isc_task_t *task, unsigned int how) { - REQUIRE(ISCAPI_SOCKET_VALID(sock)); - - sock->methods->cancel(sock, task, how); -} - -isc_result_t -isc_socket_getsockname(isc_socket_t *sock, isc_sockaddr_t *addressp) { - REQUIRE(ISCAPI_SOCKET_VALID(sock)); - - return (sock->methods->getsockname(sock, addressp)); -} - -void -isc_socket_ipv6only(isc_socket_t *sock, isc_boolean_t yes) { - REQUIRE(ISCAPI_SOCKET_VALID(sock)); - - sock->methods->ipv6only(sock, yes); -} - -isc_sockettype_t -isc_socket_gettype(isc_socket_t *sock) { - REQUIRE(ISCAPI_SOCKET_VALID(sock)); - - return (sock->methods->gettype(sock)); -} - -void -isc_socket_setname(isc_socket_t *socket, const char *name, void *tag) { - REQUIRE(ISCAPI_SOCKET_VALID(socket)); - - UNUSED(socket); /* in case REQUIRE() is empty */ - UNUSED(name); - UNUSED(tag); -} - -isc_result_t -isc_socket_fdwatchcreate(isc_socketmgr_t *manager, int fd, int flags, - isc_sockfdwatch_t callback, void *cbarg, - isc_task_t *task, isc_socket_t **socketp) -{ - REQUIRE(ISCAPI_SOCKETMGR_VALID(manager)); - - return (manager->methods->fdwatchcreate(manager, fd, flags, - callback, cbarg, task, - socketp)); -} - -isc_result_t -isc_socket_fdwatchpoke(isc_socket_t *sock, int flags) -{ - REQUIRE(ISCAPI_SOCKET_VALID(sock)); - - return(sock->methods->fdwatchpoke(sock, flags)); -} - -isc_result_t -isc_socket_dup(isc_socket_t *sock, isc_socket_t **socketp) { - REQUIRE(ISCAPI_SOCKET_VALID(sock)); - REQUIRE(socketp != NULL && *socketp == NULL); - - return(sock->methods->dup(sock, socketp)); -} - -int -isc_socket_getfd(isc_socket_t *sock) { - REQUIRE(ISCAPI_SOCKET_VALID(sock)); - - return(sock->methods->getfd(sock)); -} diff --git a/lib/isc/sparc64/include/isc/atomic.h b/lib/isc/sparc64/include/isc/atomic.h deleted file mode 100644 index 5533ddb0cc6f..000000000000 --- a/lib/isc/sparc64/include/isc/atomic.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (C) 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: atomic.h,v 1.5 2007/06/19 23:47:18 tbox Exp $ */ - -/* - * This code was written based on FreeBSD's kernel source whose copyright - * follows: - */ - -/*- - * Copyright (c) 1998 Doug Rabson. - * Copyright (c) 2001 Jake Burkholder. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: FreeBSD: src/sys/i386/include/atomic.h,v 1.20 2001/02/11 - * $FreeBSD: src/sys/sparc64/include/atomic.h,v 1.8 2004/05/22 00:52:16 marius Exp $ - */ - -#ifndef ISC_ATOMIC_H -#define ISC_ATOMIC_H 1 - -#include -#include - -#define ASI_P 0x80 /* Primary Address Space Identifier */ - -#ifdef ISC_PLATFORM_USEGCCASM - -/* - * This routine atomically increments the value stored in 'p' by 'val', and - * returns the previous value. - */ -static inline isc_int32_t -isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) { - isc_int32_t prev, swapped; - - for (prev = *(volatile isc_int32_t *)p; ; prev = swapped) { - swapped = prev + val; - __asm__ volatile( - "casa [%1] %2, %3, %0" - : "+r"(swapped) - : "r"(p), "n"(ASI_P), "r"(prev)); - if (swapped == prev) - break; - } - - return (prev); -} - -/* - * This routine atomically stores the value 'val' in 'p'. - */ -static inline void -isc_atomic_store(isc_int32_t *p, isc_int32_t val) { - isc_int32_t prev, swapped; - - for (prev = *(volatile isc_int32_t *)p; ; prev = swapped) { - swapped = val; - __asm__ volatile( - "casa [%1] %2, %3, %0" - : "+r"(swapped) - : "r"(p), "n"(ASI_P), "r"(prev) - : "memory"); - if (swapped == prev) - break; - } -} - -/* - * This routine atomically replaces the value in 'p' with 'val', if the - * original value is equal to 'cmpval'. The original value is returned in any - * case. - */ -static inline isc_int32_t -isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) { - isc_int32_t temp = val; - - __asm__ volatile( - "casa [%1] %2, %3, %0" - : "+r"(temp) - : "r"(p), "n"(ASI_P), "r"(cmpval)); - - return (temp); -} - -#else /* ISC_PLATFORM_USEGCCASM */ - -#error "unsupported compiler. disable atomic ops by --disable-atomic" - -#endif /* ISC_PLATFORM_USEGCCASM */ - -#endif /* ISC_ATOMIC_H */ diff --git a/lib/isc/stats.c b/lib/isc/stats.c deleted file mode 100644 index 8b624b2d478d..000000000000 --- a/lib/isc/stats.c +++ /dev/null @@ -1,326 +0,0 @@ -/* - * Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/*! \file */ - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define ISC_STATS_MAGIC ISC_MAGIC('S', 't', 'a', 't') -#define ISC_STATS_VALID(x) ISC_MAGIC_VALID(x, ISC_STATS_MAGIC) - -#ifndef ISC_STATS_USEMULTIFIELDS -#if defined(ISC_RWLOCK_USEATOMIC) && defined(ISC_PLATFORM_HAVEXADD) && !defined(ISC_PLATFORM_HAVEXADDQ) -#define ISC_STATS_USEMULTIFIELDS 1 -#else -#define ISC_STATS_USEMULTIFIELDS 0 -#endif -#endif /* ISC_STATS_USEMULTIFIELDS */ - -#if ISC_STATS_USEMULTIFIELDS -typedef struct { - isc_uint32_t hi; - isc_uint32_t lo; -} isc_stat_t; -#else -typedef isc_uint64_t isc_stat_t; -#endif - -struct isc_stats { - /*% Unlocked */ - unsigned int magic; - isc_mem_t *mctx; - int ncounters; - - isc_mutex_t lock; - unsigned int references; /* locked by lock */ - - /*% - * Locked by counterlock or unlocked if efficient rwlock is not - * available. - */ -#ifdef ISC_RWLOCK_USEATOMIC - isc_rwlock_t counterlock; -#endif - isc_stat_t *counters; - - /*% - * We don't want to lock the counters while we are dumping, so we first - * copy the current counter values into a local array. This buffer - * will be used as the copy destination. It's allocated on creation - * of the stats structure so that the dump operation won't fail due - * to memory allocation failure. - * XXX: this approach is weird for non-threaded build because the - * additional memory and the copy overhead could be avoided. We prefer - * simplicity here, however, under the assumption that this function - * should be only rarely called. - */ - isc_uint64_t *copiedcounters; -}; - -static isc_result_t -create_stats(isc_mem_t *mctx, int ncounters, isc_stats_t **statsp) { - isc_stats_t *stats; - isc_result_t result = ISC_R_SUCCESS; - - REQUIRE(statsp != NULL && *statsp == NULL); - - stats = isc_mem_get(mctx, sizeof(*stats)); - if (stats == NULL) - return (ISC_R_NOMEMORY); - - result = isc_mutex_init(&stats->lock); - if (result != ISC_R_SUCCESS) - goto clean_stats; - - stats->counters = isc_mem_get(mctx, sizeof(isc_stat_t) * ncounters); - if (stats->counters == NULL) { - result = ISC_R_NOMEMORY; - goto clean_mutex; - } - stats->copiedcounters = isc_mem_get(mctx, - sizeof(isc_uint64_t) * ncounters); - if (stats->copiedcounters == NULL) { - result = ISC_R_NOMEMORY; - goto clean_counters; - } - -#ifdef ISC_RWLOCK_USEATOMIC - result = isc_rwlock_init(&stats->counterlock, 0, 0); - if (result != ISC_R_SUCCESS) - goto clean_copiedcounters; -#endif - - stats->references = 1; - memset(stats->counters, 0, sizeof(isc_stat_t) * ncounters); - stats->mctx = NULL; - isc_mem_attach(mctx, &stats->mctx); - stats->ncounters = ncounters; - stats->magic = ISC_STATS_MAGIC; - - *statsp = stats; - - return (result); - -clean_counters: - isc_mem_put(mctx, stats->counters, sizeof(isc_stat_t) * ncounters); - -#ifdef ISC_RWLOCK_USEATOMIC -clean_copiedcounters: - isc_mem_put(mctx, stats->copiedcounters, - sizeof(isc_stat_t) * ncounters); -#endif - -clean_mutex: - DESTROYLOCK(&stats->lock); - -clean_stats: - isc_mem_put(mctx, stats, sizeof(*stats)); - - return (result); -} - -void -isc_stats_attach(isc_stats_t *stats, isc_stats_t **statsp) { - REQUIRE(ISC_STATS_VALID(stats)); - REQUIRE(statsp != NULL && *statsp == NULL); - - LOCK(&stats->lock); - stats->references++; - UNLOCK(&stats->lock); - - *statsp = stats; -} - -void -isc_stats_detach(isc_stats_t **statsp) { - isc_stats_t *stats; - - REQUIRE(statsp != NULL && ISC_STATS_VALID(*statsp)); - - stats = *statsp; - *statsp = NULL; - - LOCK(&stats->lock); - stats->references--; - UNLOCK(&stats->lock); - - if (stats->references == 0) { - isc_mem_put(stats->mctx, stats->copiedcounters, - sizeof(isc_stat_t) * stats->ncounters); - isc_mem_put(stats->mctx, stats->counters, - sizeof(isc_stat_t) * stats->ncounters); - DESTROYLOCK(&stats->lock); -#ifdef ISC_RWLOCK_USEATOMIC - isc_rwlock_destroy(&stats->counterlock); -#endif - isc_mem_putanddetach(&stats->mctx, stats, sizeof(*stats)); - } -} - -int -isc_stats_ncounters(isc_stats_t *stats) { - REQUIRE(ISC_STATS_VALID(stats)); - - return (stats->ncounters); -} - -static inline void -incrementcounter(isc_stats_t *stats, int counter) { - isc_int32_t prev; - -#ifdef ISC_RWLOCK_USEATOMIC - /* - * We use a "read" lock to prevent other threads from reading the - * counter while we "writing" a counter field. The write access itself - * is protected by the atomic operation. - */ - isc_rwlock_lock(&stats->counterlock, isc_rwlocktype_read); -#endif - -#if ISC_STATS_USEMULTIFIELDS - prev = isc_atomic_xadd((isc_int32_t *)&stats->counters[counter].lo, 1); - /* - * If the lower 32-bit field overflows, increment the higher field. - * Note that it's *theoretically* possible that the lower field - * overlaps again before the higher field is incremented. It doesn't - * matter, however, because we don't read the value until - * isc_stats_copy() is called where the whole process is protected - * by the write (exclusive) lock. - */ - if (prev == (isc_int32_t)0xffffffff) - isc_atomic_xadd((isc_int32_t *)&stats->counters[counter].hi, 1); -#elif defined(ISC_PLATFORM_HAVEXADDQ) - UNUSED(prev); - isc_atomic_xaddq((isc_int64_t *)&stats->counters[counter], 1); -#else - UNUSED(prev); - stats->counters[counter]++; -#endif - -#ifdef ISC_RWLOCK_USEATOMIC - isc_rwlock_unlock(&stats->counterlock, isc_rwlocktype_read); -#endif -} - -static inline void -decrementcounter(isc_stats_t *stats, int counter) { - isc_int32_t prev; - -#ifdef ISC_RWLOCK_USEATOMIC - isc_rwlock_lock(&stats->counterlock, isc_rwlocktype_read); -#endif - -#if ISC_STATS_USEMULTIFIELDS - prev = isc_atomic_xadd((isc_int32_t *)&stats->counters[counter].lo, -1); - if (prev == 0) - isc_atomic_xadd((isc_int32_t *)&stats->counters[counter].hi, - -1); -#elif defined(ISC_PLATFORM_HAVEXADDQ) - UNUSED(prev); - isc_atomic_xaddq((isc_int64_t *)&stats->counters[counter], -1); -#else - UNUSED(prev); - stats->counters[counter]--; -#endif - -#ifdef ISC_RWLOCK_USEATOMIC - isc_rwlock_unlock(&stats->counterlock, isc_rwlocktype_read); -#endif -} - -static void -copy_counters(isc_stats_t *stats) { - int i; - -#ifdef ISC_RWLOCK_USEATOMIC - /* - * We use a "write" lock before "reading" the statistics counters as - * an exclusive lock. - */ - isc_rwlock_lock(&stats->counterlock, isc_rwlocktype_write); -#endif - -#if ISC_STATS_USEMULTIFIELDS - for (i = 0; i < stats->ncounters; i++) { - stats->copiedcounters[i] = - (isc_uint64_t)(stats->counters[i].hi) << 32 | - stats->counters[i].lo; - } -#else - UNUSED(i); - memcpy(stats->copiedcounters, stats->counters, - stats->ncounters * sizeof(isc_stat_t)); -#endif - -#ifdef ISC_RWLOCK_USEATOMIC - isc_rwlock_unlock(&stats->counterlock, isc_rwlocktype_write); -#endif -} - -isc_result_t -isc_stats_create(isc_mem_t *mctx, isc_stats_t **statsp, int ncounters) { - REQUIRE(statsp != NULL && *statsp == NULL); - - return (create_stats(mctx, ncounters, statsp)); -} - -void -isc_stats_increment(isc_stats_t *stats, isc_statscounter_t counter) { - REQUIRE(ISC_STATS_VALID(stats)); - REQUIRE(counter < stats->ncounters); - - incrementcounter(stats, (int)counter); -} - -void -isc_stats_decrement(isc_stats_t *stats, isc_statscounter_t counter) { - REQUIRE(ISC_STATS_VALID(stats)); - REQUIRE(counter < stats->ncounters); - - decrementcounter(stats, (int)counter); -} - -void -isc_stats_dump(isc_stats_t *stats, isc_stats_dumper_t dump_fn, - void *arg, unsigned int options) -{ - int i; - - REQUIRE(ISC_STATS_VALID(stats)); - - copy_counters(stats); - - for (i = 0; i < stats->ncounters; i++) { - if ((options & ISC_STATSDUMP_VERBOSE) == 0 && - stats->copiedcounters[i] == 0) - continue; - dump_fn((isc_statscounter_t)i, stats->copiedcounters[i], arg); - } -} diff --git a/lib/isc/string.c b/lib/isc/string.c deleted file mode 100644 index cba517c568f9..000000000000 --- a/lib/isc/string.c +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (C) 2004-2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001, 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/*! \file */ - -#include - -#include - -#include -#include -#include -#include -#include - -static char digits[] = "0123456789abcdefghijklmnoprstuvwxyz"; - -isc_uint64_t -isc_string_touint64(char *source, char **end, int base) { - isc_uint64_t tmp; - isc_uint64_t overflow; - char *s = source; - char *o; - char c; - - if ((base < 0) || (base == 1) || (base > 36)) { - *end = source; - return (0); - } - - while (*s != 0 && isascii(*s&0xff) && isspace(*s&0xff)) - s++; - if (*s == '+' /* || *s == '-' */) - s++; - if (base == 0) { - if (*s == '0' && (*(s+1) == 'X' || *(s+1) == 'x')) { - s += 2; - base = 16; - } else if (*s == '0') - base = 8; - else - base = 10; - } - if (*s == 0) { - *end = source; - return (0); - } - overflow = ~0; - overflow /= base; - tmp = 0; - - while ((c = *s) != 0) { - c = tolower(c&0xff); - /* end ? */ - if ((o = strchr(digits, c)) == NULL) { - *end = s; - return (tmp); - } - /* end ? */ - if ((o - digits) >= base) { - *end = s; - return (tmp); - } - /* overflow ? */ - if (tmp > overflow) { - *end = source; - return (0); - } - tmp *= base; - /* overflow ? */ - if ((tmp + (o - digits)) < tmp) { - *end = source; - return (0); - } - tmp += o - digits; - s++; - } - *end = s; - return (tmp); -} - -isc_result_t -isc_string_copy(char *target, size_t size, const char *source) { - REQUIRE(size > 0U); - - if (strlcpy(target, source, size) >= size) { - memset(target, ISC_STRING_MAGIC, size); - return (ISC_R_NOSPACE); - } - - ENSURE(strlen(target) < size); - - return (ISC_R_SUCCESS); -} - -void -isc_string_copy_truncate(char *target, size_t size, const char *source) { - REQUIRE(size > 0U); - - strlcpy(target, source, size); - - ENSURE(strlen(target) < size); -} - -isc_result_t -isc_string_append(char *target, size_t size, const char *source) { - REQUIRE(size > 0U); - REQUIRE(strlen(target) < size); - - if (strlcat(target, source, size) >= size) { - memset(target, ISC_STRING_MAGIC, size); - return (ISC_R_NOSPACE); - } - - ENSURE(strlen(target) < size); - - return (ISC_R_SUCCESS); -} - -void -isc_string_append_truncate(char *target, size_t size, const char *source) { - REQUIRE(size > 0U); - REQUIRE(strlen(target) < size); - - strlcat(target, source, size); - - ENSURE(strlen(target) < size); -} - -isc_result_t -isc_string_printf(char *target, size_t size, const char *format, ...) { - va_list args; - size_t n; - - REQUIRE(size > 0U); - - va_start(args, format); - n = vsnprintf(target, size, format, args); - va_end(args); - - if (n >= size) { - memset(target, ISC_STRING_MAGIC, size); - return (ISC_R_NOSPACE); - } - - ENSURE(strlen(target) < size); - - return (ISC_R_SUCCESS); -} - -void -isc_string_printf_truncate(char *target, size_t size, const char *format, ...) -{ - va_list args; - - REQUIRE(size > 0U); - - va_start(args, format); - /* check return code? */ - (void)vsnprintf(target, size, format, args); - va_end(args); - - ENSURE(strlen(target) < size); -} - -char * -isc_string_regiondup(isc_mem_t *mctx, const isc_region_t *source) { - char *target; - - REQUIRE(mctx != NULL); - REQUIRE(source != NULL); - - target = (char *) isc_mem_allocate(mctx, source->length + 1); - if (target != NULL) { - memcpy(source->base, target, source->length); - target[source->length] = '\0'; - } - - return (target); -} - -char * -isc_string_separate(char **stringp, const char *delim) { - char *string = *stringp; - char *s; - const char *d; - char sc, dc; - - if (string == NULL) - return (NULL); - - for (s = string; (sc = *s) != '\0'; s++) - for (d = delim; (dc = *d) != '\0'; d++) - if (sc == dc) { - *s++ = '\0'; - *stringp = s; - return (string); - } - *stringp = NULL; - return (string); -} - -size_t -isc_string_strlcpy(char *dst, const char *src, size_t size) -{ - char *d = dst; - const char *s = src; - size_t n = size; - - /* Copy as many bytes as will fit */ - if (n != 0U && --n != 0U) { - do { - if ((*d++ = *s++) == 0) - break; - } while (--n != 0U); - } - - /* Not enough room in dst, add NUL and traverse rest of src */ - if (n == 0U) { - if (size != 0U) - *d = '\0'; /* NUL-terminate dst */ - while (*s++) - ; - } - - return(s - src - 1); /* count does not include NUL */ -} - -size_t -isc_string_strlcat(char *dst, const char *src, size_t size) -{ - char *d = dst; - const char *s = src; - size_t n = size; - size_t dlen; - - /* Find the end of dst and adjust bytes left but don't go past end */ - while (n-- != 0U && *d != '\0') - d++; - dlen = d - dst; - n = size - dlen; - - if (n == 0U) - return(dlen + strlen(s)); - while (*s != '\0') { - if (n != 1U) { - *d++ = *s; - n--; - } - s++; - } - *d = '\0'; - - return(dlen + (s - src)); /* count does not include NUL */ -} diff --git a/lib/isc/strtoul.c b/lib/isc/strtoul.c deleted file mode 100644 index 18d93e21ce26..000000000000 --- a/lib/isc/strtoul.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/*! \file */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ - -/* $Id: strtoul.c,v 1.7 2007/06/19 23:47:17 tbox Exp $ */ - -#include - -#include -#include -#include - -#include -#include - -/*! - * Convert a string to an unsigned long integer. - * - * Ignores `locale' stuff. Assumes that the upper and lower case - * alphabets and digits are each contiguous. - */ -unsigned long -isc_strtoul(const char *nptr, char **endptr, int base) { - const char *s = nptr; - unsigned long acc; - unsigned char c; - unsigned long cutoff; - int neg = 0, any, cutlim; - - /* - * See strtol for comments as to the logic used. - */ - do { - c = *s++; - } while (isspace(c)); - if (c == '-') { - neg = 1; - c = *s++; - } else if (c == '+') - c = *s++; - if ((base == 0 || base == 16) && - c == '0' && (*s == 'x' || *s == 'X')) { - c = s[1]; - s += 2; - base = 16; - } - if (base == 0) - base = c == '0' ? 8 : 10; - cutoff = (unsigned long)ULONG_MAX / (unsigned long)base; - cutlim = (unsigned long)ULONG_MAX % (unsigned long)base; - for (acc = 0, any = 0;; c = *s++) { - if (!isascii(c)) - break; - if (isdigit(c)) - c -= '0'; - else if (isalpha(c)) - c -= isupper(c) ? 'A' - 10 : 'a' - 10; - else - break; - if (c >= base) - break; - if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) - any = -1; - else { - any = 1; - acc *= base; - acc += c; - } - } - if (any < 0) { - acc = ULONG_MAX; - errno = ERANGE; - } else if (neg) - acc = -acc; - if (endptr != 0) - DE_CONST(any ? s - 1 : nptr, *endptr); - return (acc); -} diff --git a/lib/isc/symtab.c b/lib/isc/symtab.c deleted file mode 100644 index d4c1dccf0ad9..000000000000 --- a/lib/isc/symtab.c +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1996-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/*! \file */ - -#include - -#include - -#include -#include -#include -#include -#include - -typedef struct elt { - char * key; - unsigned int type; - isc_symvalue_t value; - LINK(struct elt) link; -} elt_t; - -typedef LIST(elt_t) eltlist_t; - -#define SYMTAB_MAGIC ISC_MAGIC('S', 'y', 'm', 'T') -#define VALID_SYMTAB(st) ISC_MAGIC_VALID(st, SYMTAB_MAGIC) - -struct isc_symtab { - /* Unlocked. */ - unsigned int magic; - isc_mem_t * mctx; - unsigned int size; - unsigned int count; - unsigned int maxload; - eltlist_t * table; - isc_symtabaction_t undefine_action; - void * undefine_arg; - isc_boolean_t case_sensitive; -}; - -isc_result_t -isc_symtab_create(isc_mem_t *mctx, unsigned int size, - isc_symtabaction_t undefine_action, - void *undefine_arg, - isc_boolean_t case_sensitive, - isc_symtab_t **symtabp) -{ - isc_symtab_t *symtab; - unsigned int i; - - REQUIRE(mctx != NULL); - REQUIRE(symtabp != NULL && *symtabp == NULL); - REQUIRE(size > 0); /* Should be prime. */ - - symtab = (isc_symtab_t *)isc_mem_get(mctx, sizeof(*symtab)); - if (symtab == NULL) - return (ISC_R_NOMEMORY); - symtab->table = (eltlist_t *)isc_mem_get(mctx, - size * sizeof(eltlist_t)); - if (symtab->table == NULL) { - isc_mem_put(mctx, symtab, sizeof(*symtab)); - return (ISC_R_NOMEMORY); - } - for (i = 0; i < size; i++) - INIT_LIST(symtab->table[i]); - symtab->mctx = mctx; - symtab->size = size; - symtab->count = 0; - symtab->maxload = size * 3 / 4; - symtab->undefine_action = undefine_action; - symtab->undefine_arg = undefine_arg; - symtab->case_sensitive = case_sensitive; - symtab->magic = SYMTAB_MAGIC; - - *symtabp = symtab; - - return (ISC_R_SUCCESS); -} - -void -isc_symtab_destroy(isc_symtab_t **symtabp) { - isc_symtab_t *symtab; - unsigned int i; - elt_t *elt, *nelt; - - REQUIRE(symtabp != NULL); - symtab = *symtabp; - REQUIRE(VALID_SYMTAB(symtab)); - - for (i = 0; i < symtab->size; i++) { - for (elt = HEAD(symtab->table[i]); elt != NULL; elt = nelt) { - nelt = NEXT(elt, link); - if (symtab->undefine_action != NULL) - (symtab->undefine_action)(elt->key, - elt->type, - elt->value, - symtab->undefine_arg); - isc_mem_put(symtab->mctx, elt, sizeof(*elt)); - } - } - isc_mem_put(symtab->mctx, symtab->table, - symtab->size * sizeof(eltlist_t)); - symtab->magic = 0; - isc_mem_put(symtab->mctx, symtab, sizeof(*symtab)); - - *symtabp = NULL; -} - -static inline unsigned int -hash(const char *key, isc_boolean_t case_sensitive) { - const char *s; - unsigned int h = 0; - int c; - - /* - * This hash function is similar to the one Ousterhout - * uses in Tcl. - */ - - if (case_sensitive) { - for (s = key; *s != '\0'; s++) { - h += (h << 3) + *s; - } - } else { - for (s = key; *s != '\0'; s++) { - c = *s; - c = tolower((unsigned char)c); - h += (h << 3) + c; - } - } - - return (h); -} - -#define FIND(s, k, t, b, e) \ - b = hash((k), (s)->case_sensitive) % (s)->size; \ - if ((s)->case_sensitive) { \ - for (e = HEAD((s)->table[b]); e != NULL; e = NEXT(e, link)) { \ - if (((t) == 0 || e->type == (t)) && \ - strcmp(e->key, (k)) == 0) \ - break; \ - } \ - } else { \ - for (e = HEAD((s)->table[b]); e != NULL; e = NEXT(e, link)) { \ - if (((t) == 0 || e->type == (t)) && \ - strcasecmp(e->key, (k)) == 0) \ - break; \ - } \ - } - -isc_result_t -isc_symtab_lookup(isc_symtab_t *symtab, const char *key, unsigned int type, - isc_symvalue_t *value) -{ - unsigned int bucket; - elt_t *elt; - - REQUIRE(VALID_SYMTAB(symtab)); - REQUIRE(key != NULL); - - FIND(symtab, key, type, bucket, elt); - - if (elt == NULL) - return (ISC_R_NOTFOUND); - - if (value != NULL) - *value = elt->value; - - return (ISC_R_SUCCESS); -} - -static void -grow_table(isc_symtab_t *symtab) { - eltlist_t *newtable; - unsigned int i, newsize, newmax; - - REQUIRE(symtab != NULL); - - newsize = symtab->size * 2; - newmax = newsize * 3 / 4; - INSIST(newsize > 0U && newmax > 0U); - - newtable = isc_mem_get(symtab->mctx, newsize * sizeof(eltlist_t)); - if (newtable == NULL) - return; - - for (i = 0; i < newsize; i++) - INIT_LIST(newtable[i]); - - for (i = 0; i < symtab->size; i++) { - elt_t *elt, *nelt; - - for (elt = HEAD(symtab->table[i]); elt != NULL; elt = nelt) { - unsigned int hv; - - nelt = NEXT(elt, link); - - UNLINK(symtab->table[i], elt, link); - hv = hash(elt->key, symtab->case_sensitive); - APPEND(newtable[hv % newsize], elt, link); - } - } - - isc_mem_put(symtab->mctx, symtab->table, - symtab->size * sizeof(eltlist_t)); - - symtab->table = newtable; - symtab->size = newsize; - symtab->maxload = newmax; -} - -isc_result_t -isc_symtab_define(isc_symtab_t *symtab, const char *key, unsigned int type, - isc_symvalue_t value, isc_symexists_t exists_policy) -{ - unsigned int bucket; - elt_t *elt; - - REQUIRE(VALID_SYMTAB(symtab)); - REQUIRE(key != NULL); - REQUIRE(type != 0); - - FIND(symtab, key, type, bucket, elt); - - if (exists_policy != isc_symexists_add && elt != NULL) { - if (exists_policy == isc_symexists_reject) - return (ISC_R_EXISTS); - INSIST(exists_policy == isc_symexists_replace); - UNLINK(symtab->table[bucket], elt, link); - if (symtab->undefine_action != NULL) - (symtab->undefine_action)(elt->key, elt->type, - elt->value, - symtab->undefine_arg); - } else { - elt = (elt_t *)isc_mem_get(symtab->mctx, sizeof(*elt)); - if (elt == NULL) - return (ISC_R_NOMEMORY); - ISC_LINK_INIT(elt, link); - symtab->count++; - } - - /* - * Though the "key" can be const coming in, it is not stored as const - * so that the calling program can easily have writable access to - * it in its undefine_action function. In the event that it *was* - * truly const coming in and then the caller modified it anyway ... - * well, don't do that! - */ - DE_CONST(key, elt->key); - elt->type = type; - elt->value = value; - - /* - * We prepend so that the most recent definition will be found. - */ - PREPEND(symtab->table[bucket], elt, link); - - if (symtab->count > symtab->maxload) - grow_table(symtab); - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_symtab_undefine(isc_symtab_t *symtab, const char *key, unsigned int type) { - unsigned int bucket; - elt_t *elt; - - REQUIRE(VALID_SYMTAB(symtab)); - REQUIRE(key != NULL); - - FIND(symtab, key, type, bucket, elt); - - if (elt == NULL) - return (ISC_R_NOTFOUND); - - if (symtab->undefine_action != NULL) - (symtab->undefine_action)(elt->key, elt->type, - elt->value, symtab->undefine_arg); - UNLINK(symtab->table[bucket], elt, link); - isc_mem_put(symtab->mctx, elt, sizeof(*elt)); - symtab->count--; - - return (ISC_R_SUCCESS); -} diff --git a/lib/isc/task_api.c b/lib/isc/task_api.c deleted file mode 100644 index 34510ff64c47..000000000000 --- a/lib/isc/task_api.c +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Copyright (C) 2009-2012 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -#include - -#include - -#include -#include -#include -#include -#include -#include - -static isc_mutex_t createlock; -static isc_once_t once = ISC_ONCE_INIT; -static isc_taskmgrcreatefunc_t taskmgr_createfunc = NULL; - -static void -initialize(void) { - RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS); -} - -isc_result_t -isc_task_register(isc_taskmgrcreatefunc_t createfunc) { - isc_result_t result = ISC_R_SUCCESS; - - RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS); - - LOCK(&createlock); - if (taskmgr_createfunc == NULL) - taskmgr_createfunc = createfunc; - else - result = ISC_R_EXISTS; - UNLOCK(&createlock); - - return (result); -} - -isc_result_t -isc_taskmgr_createinctx(isc_mem_t *mctx, isc_appctx_t *actx, - unsigned int workers, unsigned int default_quantum, - isc_taskmgr_t **managerp) -{ - isc_result_t result; - - LOCK(&createlock); - - REQUIRE(taskmgr_createfunc != NULL); - result = (*taskmgr_createfunc)(mctx, workers, default_quantum, - managerp); - - UNLOCK(&createlock); - - if (result == ISC_R_SUCCESS) - isc_appctx_settaskmgr(actx, *managerp); - - return (result); -} - -isc_result_t -isc_taskmgr_create(isc_mem_t *mctx, unsigned int workers, - unsigned int default_quantum, isc_taskmgr_t **managerp) -{ - isc_result_t result; - - LOCK(&createlock); - - REQUIRE(taskmgr_createfunc != NULL); - result = (*taskmgr_createfunc)(mctx, workers, default_quantum, - managerp); - - UNLOCK(&createlock); - - return (result); -} - -void -isc_taskmgr_destroy(isc_taskmgr_t **managerp) { - REQUIRE(managerp != NULL && ISCAPI_TASKMGR_VALID(*managerp)); - - (*managerp)->methods->destroy(managerp); - - ENSURE(*managerp == NULL); -} - -void -isc_taskmgr_setmode(isc_taskmgr_t *manager, isc_taskmgrmode_t mode) { - REQUIRE(ISCAPI_TASKMGR_VALID(manager)); - - manager->methods->setmode(manager, mode); -} - -isc_taskmgrmode_t -isc_taskmgr_mode(isc_taskmgr_t *manager) { - REQUIRE(ISCAPI_TASKMGR_VALID(manager)); - - return (manager->methods->mode(manager)); -} - -isc_result_t -isc_task_create(isc_taskmgr_t *manager, unsigned int quantum, - isc_task_t **taskp) -{ - REQUIRE(ISCAPI_TASKMGR_VALID(manager)); - REQUIRE(taskp != NULL && *taskp == NULL); - - return (manager->methods->taskcreate(manager, quantum, taskp)); -} - -void -isc_task_attach(isc_task_t *source, isc_task_t **targetp) { - REQUIRE(ISCAPI_TASK_VALID(source)); - REQUIRE(targetp != NULL && *targetp == NULL); - - source->methods->attach(source, targetp); - - ENSURE(*targetp == source); -} - -void -isc_task_detach(isc_task_t **taskp) { - REQUIRE(taskp != NULL && ISCAPI_TASK_VALID(*taskp)); - - (*taskp)->methods->detach(taskp); - - ENSURE(*taskp == NULL); -} - -void -isc_task_send(isc_task_t *task, isc_event_t **eventp) { - REQUIRE(ISCAPI_TASK_VALID(task)); - REQUIRE(eventp != NULL && *eventp != NULL); - - task->methods->send(task, eventp); - - ENSURE(*eventp == NULL); -} - -void -isc_task_sendanddetach(isc_task_t **taskp, isc_event_t **eventp) { - REQUIRE(taskp != NULL && ISCAPI_TASK_VALID(*taskp)); - REQUIRE(eventp != NULL && *eventp != NULL); - - (*taskp)->methods->sendanddetach(taskp, eventp); - - ENSURE(*taskp == NULL && *eventp == NULL); -} - -unsigned int -isc_task_unsend(isc_task_t *task, void *sender, isc_eventtype_t type, - void *tag, isc_eventlist_t *events) -{ - REQUIRE(ISCAPI_TASK_VALID(task)); - - return (task->methods->unsend(task, sender, type, tag, events)); -} - -isc_result_t -isc_task_onshutdown(isc_task_t *task, isc_taskaction_t action, const void *arg) -{ - REQUIRE(ISCAPI_TASK_VALID(task)); - - return (task->methods->onshutdown(task, action, arg)); -} - -void -isc_task_shutdown(isc_task_t *task) { - REQUIRE(ISCAPI_TASK_VALID(task)); - - task->methods->shutdown(task); -} - -void -isc_task_setname(isc_task_t *task, const char *name, void *tag) { - REQUIRE(ISCAPI_TASK_VALID(task)); - - task->methods->setname(task, name, tag); -} - -unsigned int -isc_task_purge(isc_task_t *task, void *sender, isc_eventtype_t type, void *tag) -{ - REQUIRE(ISCAPI_TASK_VALID(task)); - - return (task->methods->purgeevents(task, sender, type, tag)); -} - -isc_result_t -isc_task_beginexclusive(isc_task_t *task) { - REQUIRE(ISCAPI_TASK_VALID(task)); - - return (task->methods->beginexclusive(task)); -} - -void -isc_task_endexclusive(isc_task_t *task) { - REQUIRE(ISCAPI_TASK_VALID(task)); - - task->methods->endexclusive(task); -} - -void -isc_task_setprivilege(isc_task_t *task, isc_boolean_t priv) { - REQUIRE(ISCAPI_TASK_VALID(task)); - - task->methods->setprivilege(task, priv); -} - -isc_boolean_t -isc_task_privilege(isc_task_t *task) { - REQUIRE(ISCAPI_TASK_VALID(task)); - - return (task->methods->privilege(task)); -} - - -/*% - * This is necessary for libisc's internal timer implementation. Other - * implementation might skip implementing this. - */ -unsigned int -isc_task_purgerange(isc_task_t *task, void *sender, isc_eventtype_t first, - isc_eventtype_t last, void *tag) -{ - REQUIRE(ISCAPI_TASK_VALID(task)); - - return (task->methods->purgerange(task, sender, first, last, tag)); -} diff --git a/lib/isc/taskpool.c b/lib/isc/taskpool.c deleted file mode 100644 index 25d951682889..000000000000 --- a/lib/isc/taskpool.c +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/*! \file */ - -#include - -#include -#include -#include -#include - -/*** - *** Types. - ***/ - -struct isc_taskpool { - isc_mem_t * mctx; - isc_taskmgr_t * tmgr; - unsigned int ntasks; - unsigned int quantum; - isc_task_t ** tasks; -}; - -/*** - *** Functions. - ***/ - -static isc_result_t -alloc_pool(isc_taskmgr_t *tmgr, isc_mem_t *mctx, unsigned int ntasks, - unsigned int quantum, isc_taskpool_t **poolp) -{ - isc_taskpool_t *pool; - unsigned int i; - - pool = isc_mem_get(mctx, sizeof(*pool)); - if (pool == NULL) - return (ISC_R_NOMEMORY); - pool->mctx = mctx; - pool->ntasks = ntasks; - pool->quantum = quantum; - pool->tmgr = tmgr; - pool->tasks = isc_mem_get(mctx, ntasks * sizeof(isc_task_t *)); - if (pool->tasks == NULL) { - isc_mem_put(mctx, pool, sizeof(*pool)); - return (ISC_R_NOMEMORY); - } - for (i = 0; i < ntasks; i++) - pool->tasks[i] = NULL; - - *poolp = pool; - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_taskpool_create(isc_taskmgr_t *tmgr, isc_mem_t *mctx, - unsigned int ntasks, unsigned int quantum, - isc_taskpool_t **poolp) -{ - unsigned int i; - isc_taskpool_t *pool = NULL; - isc_result_t result; - - INSIST(ntasks > 0); - - /* Allocate the pool structure */ - result = alloc_pool(tmgr, mctx, ntasks, quantum, &pool); - if (result != ISC_R_SUCCESS) - return (result); - - /* Create the tasks */ - for (i = 0; i < ntasks; i++) { - result = isc_task_create(tmgr, quantum, &pool->tasks[i]); - if (result != ISC_R_SUCCESS) { - isc_taskpool_destroy(&pool); - return (result); - } - isc_task_setname(pool->tasks[i], "taskpool", NULL); - } - - *poolp = pool; - return (ISC_R_SUCCESS); -} - -void -isc_taskpool_gettask(isc_taskpool_t *pool, isc_task_t **targetp) { - isc_uint32_t i; - isc_random_get(&i); - isc_task_attach(pool->tasks[i % pool->ntasks], targetp); -} - -int -isc_taskpool_size(isc_taskpool_t *pool) { - REQUIRE(pool != NULL); - return (pool->ntasks); -} - -isc_result_t -isc_taskpool_expand(isc_taskpool_t **sourcep, unsigned int size, - isc_taskpool_t **targetp) -{ - isc_result_t result; - isc_taskpool_t *pool; - - REQUIRE(sourcep != NULL && *sourcep != NULL); - REQUIRE(targetp != NULL && *targetp == NULL); - - pool = *sourcep; - if (size > pool->ntasks) { - isc_taskpool_t *newpool = NULL; - unsigned int i; - - /* Allocate a new pool structure */ - result = alloc_pool(pool->tmgr, pool->mctx, size, - pool->quantum, &newpool); - if (result != ISC_R_SUCCESS) - return (result); - - /* Copy over the tasks from the old pool */ - for (i = 0; i < pool->ntasks; i++) { - newpool->tasks[i] = pool->tasks[i]; - pool->tasks[i] = NULL; - } - - /* Create new tasks */ - for (i = pool->ntasks; i < size; i++) { - result = isc_task_create(pool->tmgr, pool->quantum, - &newpool->tasks[i]); - if (result != ISC_R_SUCCESS) { - isc_taskpool_destroy(&newpool); - return (result); - } - isc_task_setname(newpool->tasks[i], "taskpool", NULL); - } - - isc_taskpool_destroy(&pool); - pool = newpool; - } - - *sourcep = NULL; - *targetp = pool; - return (ISC_R_SUCCESS); -} - -void -isc_taskpool_destroy(isc_taskpool_t **poolp) { - unsigned int i; - isc_taskpool_t *pool = *poolp; - for (i = 0; i < pool->ntasks; i++) { - if (pool->tasks[i] != NULL) - isc_task_detach(&pool->tasks[i]); - } - isc_mem_put(pool->mctx, pool->tasks, - pool->ntasks * sizeof(isc_task_t *)); - isc_mem_put(pool->mctx, pool, sizeof(*pool)); - *poolp = NULL; -} - -void -isc_taskpool_setprivilege(isc_taskpool_t *pool, isc_boolean_t priv) { - unsigned int i; - - REQUIRE(pool != NULL); - - for (i = 0; i < pool->ntasks; i++) { - if (pool->tasks[i] != NULL) - isc_task_setprivilege(pool->tasks[i], priv); - } -} diff --git a/lib/isc/tests/Atffile b/lib/isc/tests/Atffile deleted file mode 100644 index c3e044f41a84..000000000000 --- a/lib/isc/tests/Atffile +++ /dev/null @@ -1,5 +0,0 @@ -Content-Type: application/X-atf-atffile; version="1" - -prop: test-suite = bind9 - -tp-glob: *_test diff --git a/lib/isc/tests/hash_test.c b/lib/isc/tests/hash_test.c deleted file mode 100644 index 836d7b67abc7..000000000000 --- a/lib/isc/tests/hash_test.c +++ /dev/null @@ -1,1805 +0,0 @@ -/* - * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/* ! \file */ - -#include - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -/* - * Test data from RFC6234 - */ - -unsigned char digest[ISC_SHA512_DIGESTLENGTH]; -unsigned char buffer[1024]; -const char *s; -char str[ISC_SHA512_DIGESTLENGTH]; -unsigned char key[20]; -int i = 0; - -isc_result_t -tohexstr(unsigned char *d, unsigned int len, char *out); -/* - * Precondition: a hexadecimal number in *d, the length of that number in len, - * and a pointer to a character array to put the output (*out). - * Postcondition: A String representation of the given hexadecimal number is - * placed into the array *out - * - * 'out' MUST point to an array of at least len / 2 + 1 - * - * Return values: ISC_R_SUCCESS if the operation is sucessful - */ - -isc_result_t -tohexstr(unsigned char *d, unsigned int len, char *out) { - - out[0]='\0'; - char c_ret[] = "AA"; - unsigned int i; - strcat(out, "0x"); - for (i = 0; i < len; i++) { - sprintf(c_ret, "%02X", d[i]); - strcat(out, c_ret); - } - strcat(out, "\0"); - return (ISC_R_SUCCESS); -} - - -#define TEST_INPUT(x) (x), sizeof(x)-1 - -typedef struct hash_testcase { - const char *input; - size_t input_len; - const char *result; - int repeats; -} hash_testcase_t; - -typedef struct hash_test_key { - const char *key; - const int len; -} hash_test_key_t; - -/* non-hmac tests */ - -ATF_TC(isc_sha1); -ATF_TC_HEAD(isc_sha1, tc) { - atf_tc_set_md_var(tc, "descr", "sha1 examples from RFC4634"); -} -ATF_TC_BODY(isc_sha1, tc) { - isc_sha1_t sha1; - - UNUSED(tc); - - /* - * These are the various test vectors. All of these are passed - * through the hash function and the results are compared to the - * result specified here. - */ - hash_testcase_t testcases[] = { - /* Test 1 */ - { - TEST_INPUT("abc"), - "0xA9993E364706816ABA3E25717850C26C9CD0D89D", - 1 - }, - /* Test 2 */ - { - TEST_INPUT("abcdbcdecdefdefgefghfghighijhijkijk" - "ljklmklmnlmnomnopnopq"), - "0x84983E441C3BD26EBAAE4AA1F95129E5E54670F1", - 1 - }, - /* Test 3 */ - { - TEST_INPUT("a") /* times 1000000 */, - "0x34AA973CD4C4DAA4F61EEB2BDBAD27316534016F", - 1000000 - }, - /* Test 4 -- exact multiple of 512 bits */ - { - TEST_INPUT("01234567012345670123456701234567"), - "0xDEA356A2CDDD90C7A7ECEDC5EBB563934F460452", - 20 /* 20 times */ - }, -#if 0 - /* Test 5 -- optional feature, not implemented */ - { - TEST_INPUT(""), - /* "extrabits": 0x98 , "numberextrabits": 5 */ - "0x29826B003B906E660EFF4027CE98AF3531AC75BA", - 1 - }, -#endif - /* Test 6 */ - { - TEST_INPUT("\x5e"), - "0x5E6F80A34A9798CAFC6A5DB96CC57BA4C4DB59C2", - 1 - }, -#if 0 - /* Test 7 -- optional feature, not implemented */ - { - TEST_INPUT("\x49\xb2\xae\xc2\x59\x4b\xbe\x3a" - "\x3b\x11\x75\x42\xd9\x4a\xc8"), - /* "extrabits": 0x80, "numberextrabits": 3 */ - "0x6239781E03729919C01955B3FFA8ACB60B988340", 1 }, -#endif - /* Test 8 */ - { - TEST_INPUT("\x9a\x7d\xfd\xf1\xec\xea\xd0\x6e\xd6\x46" - "\xaa\x55\xfe\x75\x71\x46"), - "0x82ABFF6605DBE1C17DEF12A394FA22A82B544A35", - 1 - }, -#if 0 - /* Test 9 -- optional feature, not implemented */ - { - TEST_INPUT("\x65\xf9\x32\x99\x5b\xa4\xce\x2c\xb1\xb4" - "\xa2\xe7\x1a\xe7\x02\x20\xaa\xce\xc8\x96" - "\x2d\xd4\x49\x9c\xbd\x7c\x88\x7a\x94\xea" - "\xaa\x10\x1e\xa5\xaa\xbc\x52\x9b\x4e\x7e" - "\x43\x66\x5a\x5a\xf2\xcd\x03\xfe\x67\x8e" - "\xa6\xa5\x00\x5b\xba\x3b\x08\x22\x04\xc2" - "\x8b\x91\x09\xf4\x69\xda\xc9\x2a\xaa\xb3" - "\xaa\x7c\x11\xa1\xb3\x2a"), - /* "extrabits": 0xE0 , "numberextrabits": 3 */ - "0x8C5B2A5DDAE5A97FC7F9D85661C672ADBF7933D4", - 1 - }, -#endif - /* Test 10 */ - { - TEST_INPUT("\xf7\x8f\x92\x14\x1b\xcd\x17\x0a\xe8\x9b" - "\x4f\xba\x15\xa1\xd5\x9f\x3f\xd8\x4d\x22" - "\x3c\x92\x51\xbd\xac\xbb\xae\x61\xd0\x5e" - "\xd1\x15\xa0\x6a\x7c\xe1\x17\xb7\xbe\xea" - "\xd2\x44\x21\xde\xd9\xc3\x25\x92\xbd\x57" - "\xed\xea\xe3\x9c\x39\xfa\x1f\xe8\x94\x6a" - "\x84\xd0\xcf\x1f\x7b\xee\xad\x17\x13\xe2" - "\xe0\x95\x98\x97\x34\x7f\x67\xc8\x0b\x04" - "\x00\xc2\x09\x81\x5d\x6b\x10\xa6\x83\x83" - "\x6f\xd5\x56\x2a\x56\xca\xb1\xa2\x8e\x81" - "\xb6\x57\x66\x54\x63\x1c\xf1\x65\x66\xb8" - "\x6e\x3b\x33\xa1\x08\xb0\x53\x07\xc0\x0a" - "\xff\x14\xa7\x68\xed\x73\x50\x60\x6a\x0f" - "\x85\xe6\xa9\x1d\x39\x6f\x5b\x5c\xbe\x57" - "\x7f\x9b\x38\x80\x7c\x7d\x52\x3d\x6d\x79" - "\x2f\x6e\xbc\x24\xa4\xec\xf2\xb3\xa4\x27" - "\xcd\xbb\xfb"), - "0xCB0082C8F197D260991BA6A460E76E202BAD27B3", - 1 - }, - { NULL, 0, NULL, 1 } - }; - - hash_testcase_t *testcase = testcases; - - while (testcase->input != NULL && testcase->result != NULL) { - isc_sha1_init(&sha1); - for(i = 0; i < testcase->repeats; i++) { - isc_sha1_update(&sha1, - (const isc_uint8_t *) testcase->input, - testcase->input_len); - } - isc_sha1_final(&sha1, digest); - tohexstr(digest, ISC_SHA1_DIGESTLENGTH, str); - ATF_CHECK_STREQ(str, testcase->result); - - testcase++; - } -} - - -ATF_TC(isc_sha224); -ATF_TC_HEAD(isc_sha224, tc) { - atf_tc_set_md_var(tc, "descr", "sha224 examples from RFC4634"); -} -ATF_TC_BODY(isc_sha224, tc) { - isc_sha224_t sha224; - - UNUSED(tc); - - /* - * These are the various test vectors. All of these are passed - * through the hash function and the results are compared to the - * result specified here. - */ - hash_testcase_t testcases[] = { - /* Test 1 */ - { - TEST_INPUT("abc"), - "0x23097D223405D8228642A477BDA255B32AADBCE4BDA0B3F7" - "E36C9DA7", - 1 - }, - /* Test 2 */ - { - TEST_INPUT("abcdbcdecdefdefgefghfghighijhijkijklj" - "klmklmnlmnomnopnopq"), - "0x75388B16512776CC5DBA5DA1FD890150B0C6455CB4F58B" - "1952522525", - 1 - }, - /* Test 3 */ - { - TEST_INPUT("a"), - "0x20794655980C91D8BBB4C1EA97618A4BF03F42581948B2" - "EE4EE7AD67", - 1000000 - }, - /* Test 4 */ - { - TEST_INPUT("01234567012345670123456701234567"), - "0x567F69F168CD7844E65259CE658FE7AADFA25216E68ECA" - "0EB7AB8262", - 20 - }, -#if 0 - /* Test 5 -- unimplemented optional functionality */ - { - TEST_INPUT(""), - "0xXXX", - 1 - }, -#endif - /* Test 6 */ - { - TEST_INPUT("\x07"), - "0x00ECD5F138422B8AD74C9799FD826C531BAD2FCABC7450" - "BEE2AA8C2A", - 1 - }, -#if 0 - /* Test 7 -- unimplemented optional functionality */ - { - TEST_INPUT(""), - "0xXXX", - 1 - }, -#endif - /* Test 8 */ - { - TEST_INPUT("\x18\x80\x40\x05\xdd\x4f\xbd\x15\x56\x29" - "\x9d\x6f\x9d\x93\xdf\x62"), - "0xDF90D78AA78821C99B40BA4C966921ACCD8FFB1E98AC38" - "8E56191DB1", - 1 - }, -#if 0 - /* Test 9 */ - { - TEST_INPUT(""), - "0xXXX", - 1 - }, -#endif - /* Test 10 */ - { - TEST_INPUT("\x55\xb2\x10\x07\x9c\x61\xb5\x3a\xdd\x52" - "\x06\x22\xd1\xac\x97\xd5\xcd\xbe\x8c\xb3" - "\x3a\xa0\xae\x34\x45\x17\xbe\xe4\xd7\xba" - "\x09\xab\xc8\x53\x3c\x52\x50\x88\x7a\x43" - "\xbe\xbb\xac\x90\x6c\x2e\x18\x37\xf2\x6b" - "\x36\xa5\x9a\xe3\xbe\x78\x14\xd5\x06\x89" - "\x6b\x71\x8b\x2a\x38\x3e\xcd\xac\x16\xb9" - "\x61\x25\x55\x3f\x41\x6f\xf3\x2c\x66\x74" - "\xc7\x45\x99\xa9\x00\x53\x86\xd9\xce\x11" - "\x12\x24\x5f\x48\xee\x47\x0d\x39\x6c\x1e" - "\xd6\x3b\x92\x67\x0c\xa5\x6e\xc8\x4d\xee" - "\xa8\x14\xb6\x13\x5e\xca\x54\x39\x2b\xde" - "\xdb\x94\x89\xbc\x9b\x87\x5a\x8b\xaf\x0d" - "\xc1\xae\x78\x57\x36\x91\x4a\xb7\xda\xa2" - "\x64\xbc\x07\x9d\x26\x9f\x2c\x0d\x7e\xdd" - "\xd8\x10\xa4\x26\x14\x5a\x07\x76\xf6\x7c" - "\x87\x82\x73"), - "0x0B31894EC8937AD9B91BDFBCBA294D9ADEFAA18E09305E" - "9F20D5C3A4", - 1 - }, - { NULL, 0, NULL, 1 } - }; - - hash_testcase_t *testcase = testcases; - - while (testcase->input != NULL && testcase->result != NULL) { - isc_sha224_init(&sha224); - for(i = 0; i < testcase->repeats; i++) { - isc_sha224_update(&sha224, - (const isc_uint8_t *) testcase->input, - testcase->input_len); - } - isc_sha224_final(digest, &sha224); - /* - *API inconsistency BUG HERE - * in order to be consistant with the other isc_hash_final - * functions the call should be - * isc_sha224_final(&sha224, digest); - */ - tohexstr(digest, ISC_SHA224_DIGESTLENGTH, str); - ATF_CHECK_STREQ(str, testcase->result); - - testcase++; - } - -} - -ATF_TC(isc_sha256); -ATF_TC_HEAD(isc_sha256, tc) { - atf_tc_set_md_var(tc, "descr", "sha224 examples from RFC4634"); -} -ATF_TC_BODY(isc_sha256, tc) { - isc_sha256_t sha256; - - UNUSED(tc); - - /* - * These are the various test vectors. All of these are passed - * through the hash function and the results are compared to the - * result specified here. - */ - hash_testcase_t testcases[] = { - /* Test 1 */ - { - TEST_INPUT("abc"), - "0xBA7816BF8F01CFEA414140DE5DAE2223B00361A396177A" - "9CB410FF61F20015AD", - 1 - }, - /* Test 2 */ - { - TEST_INPUT("abcdbcdecdefdefgefghfghighijhijkijkljk" - "lmklmnlmnomnopnopq"), - "0x248D6A61D20638B8E5C026930C3E6039A33CE45964FF21" - "67F6ECEDD419DB06C1", - 1 - }, - /* Test 3 */ - { - TEST_INPUT("a"), - "0xCDC76E5C9914FB9281A1C7E284D73E67F1809A48A49720" - "0E046D39CCC7112CD0", - 1000000 }, - /* Test 4 */ - { - TEST_INPUT("01234567012345670123456701234567"), - "0x594847328451BDFA85056225462CC1D867D877FB388DF0" - "CE35F25AB5562BFBB5", - 20 - }, -#if 0 - /* Test 5 -- unimplemented optional functionality */ - { - TEST_INPUT(""), - "0xXXX", - 1 - }, -#endif - /* Test 6 */ - { - TEST_INPUT("\x19"), - "0x68AA2E2EE5DFF96E3355E6C7EE373E3D6A4E17F75F9518" - "D843709C0C9BC3E3D4", - 1 - }, -#if 0 - /* Test 7 -- unimplemented optional functionality */ - { - TEST_INPUT(""), - "0xXXX", - 1 - }, -#endif - /* Test 8 */ - { - TEST_INPUT("\xe3\xd7\x25\x70\xdc\xdd\x78\x7c\xe3" - "\x88\x7a\xb2\xcd\x68\x46\x52"), - "0x175EE69B02BA9B58E2B0A5FD13819CEA573F3940A94F82" - "5128CF4209BEABB4E8", - 1 - }, -#if 0 - /* Test 9 -- unimplemented optional functionality */ - { - TEST_INPUT(""), - "0xXXX", - 1 - }, -#endif - /* Test 10 */ - { - TEST_INPUT("\x83\x26\x75\x4e\x22\x77\x37\x2f\x4f\xc1" - "\x2b\x20\x52\x7a\xfe\xf0\x4d\x8a\x05\x69" - "\x71\xb1\x1a\xd5\x71\x23\xa7\xc1\x37\x76" - "\x00\x00\xd7\xbe\xf6\xf3\xc1\xf7\xa9\x08" - "\x3a\xa3\x9d\x81\x0d\xb3\x10\x77\x7d\xab" - "\x8b\x1e\x7f\x02\xb8\x4a\x26\xc7\x73\x32" - "\x5f\x8b\x23\x74\xde\x7a\x4b\x5a\x58\xcb" - "\x5c\x5c\xf3\x5b\xce\xe6\xfb\x94\x6e\x5b" - "\xd6\x94\xfa\x59\x3a\x8b\xeb\x3f\x9d\x65" - "\x92\xec\xed\xaa\x66\xca\x82\xa2\x9d\x0c" - "\x51\xbc\xf9\x33\x62\x30\xe5\xd7\x84\xe4" - "\xc0\xa4\x3f\x8d\x79\xa3\x0a\x16\x5c\xba" - "\xbe\x45\x2b\x77\x4b\x9c\x71\x09\xa9\x7d" - "\x13\x8f\x12\x92\x28\x96\x6f\x6c\x0a\xdc" - "\x10\x6a\xad\x5a\x9f\xdd\x30\x82\x57\x69" - "\xb2\xc6\x71\xaf\x67\x59\xdf\x28\xeb\x39" - "\x3d\x54\xd6"), - "0x97DBCA7DF46D62C8A422C941DD7E835B8AD3361763F7E9" - "B2D95F4F0DA6E1CCBC", - 1 - }, - { NULL, 0, NULL, 1 } - }; - - hash_testcase_t *testcase = testcases; - - while (testcase->input != NULL && testcase->result != NULL) { - isc_sha256_init(&sha256); - for(i = 0; i < testcase->repeats; i++) { - isc_sha256_update(&sha256, - (const isc_uint8_t *) testcase->input, - testcase->input_len); - } - isc_sha256_final(digest, &sha256); - /* - *API inconsistency BUG HERE - * in order to be consistant with the other isc_hash_final - * functions the call should be - * isc_sha224_final(&sha224, digest); - */ - tohexstr(digest, ISC_SHA256_DIGESTLENGTH, str); - ATF_CHECK_STREQ(str, testcase->result); - - testcase++; - } - -} - -ATF_TC(isc_sha384); -ATF_TC_HEAD(isc_sha384, tc) { - atf_tc_set_md_var(tc, "descr", "sha224 examples from RFC4634"); -} -ATF_TC_BODY(isc_sha384, tc) { - isc_sha384_t sha384; - - UNUSED(tc); - - /* - * These are the various test vectors. All of these are passed - * through the hash function and the results are compared to the - * result specified here. - */ - hash_testcase_t testcases[] = { - /* Test 1 */ - { - TEST_INPUT("abc"), - "0xCB00753F45A35E8BB5A03D699AC65007272C32AB0EDED1" - "631A8B605A43FF5BED8086072BA1E7CC2358BAEC" - "A134C825A7", - 1 - }, - /* Test 2 */ - { - TEST_INPUT("abcdefghbcdefghicdefghijdefghijkefghijkl" - "fghijklmghijklmnhijklmnoijklmnopjklmnopq" - "klmnopqrlmnopqrsmnopqrstnopqrstu"), - "0x09330C33F71147E83D192FC782CD1B4753111B173B3B05" - "D22FA08086E3B0F712FCC7C71A557E2DB966C3E9" - "FA91746039", - 1 - }, - /* Test 3 */ - { - TEST_INPUT("a"), - "0x9D0E1809716474CB086E834E310A4A1CED149E9C00F248" - "527972CEC5704C2A5B07B8B3DC38ECC4EBAE97DD" - "D87F3D8985", - 1000000 - }, - /* Test 4 */ - { - TEST_INPUT("01234567012345670123456701234567"), - "0x2FC64A4F500DDB6828F6A3430B8DD72A368EB7F3A8322A" - "70BC84275B9C0B3AB00D27A5CC3C2D224AA6B61A" - "0D79FB4596", - 20 - }, -#if 0 - /* Test 5 -- unimplemented optional functionality */ - { - TEST_INPUT(""), - "0xXXX", - 1 - }, -#endif - /* Test 6 */ - { TEST_INPUT("\xb9"), - "0xBC8089A19007C0B14195F4ECC74094FEC64F01F9092928" - "2C2FB392881578208AD466828B1C6C283D2722CF" - "0AD1AB6938", - 1 - }, -#if 0 - /* Test 7 -- unimplemented optional functionality */ - { - TEST_INPUT(""), - "0xXXX", - 1 - }, -#endif - /* Test 8 */ - { - TEST_INPUT("\xa4\x1c\x49\x77\x79\xc0\x37\x5f\xf1" - "\x0a\x7f\x4e\x08\x59\x17\x39"), - "0xC9A68443A005812256B8EC76B00516F0DBB74FAB26D665" - "913F194B6FFB0E91EA9967566B58109CBC675CC2" - "08E4C823F7", - 1 - }, -#if 0 - /* Test 9 -- unimplemented optional functionality */ - { - TEST_INPUT(""), - "0xXXX", - 1 - }, -#endif - /* Test 10 */ - { - TEST_INPUT("\x39\x96\x69\xe2\x8f\x6b\x9c\x6d\xbc\xbb" - "\x69\x12\xec\x10\xff\xcf\x74\x79\x03\x49" - "\xb7\xdc\x8f\xbe\x4a\x8e\x7b\x3b\x56\x21" - "\xdb\x0f\x3e\x7d\xc8\x7f\x82\x32\x64\xbb" - "\xe4\x0d\x18\x11\xc9\xea\x20\x61\xe1\xc8" - "\x4a\xd1\x0a\x23\xfa\xc1\x72\x7e\x72\x02" - "\xfc\x3f\x50\x42\xe6\xbf\x58\xcb\xa8\xa2" - "\x74\x6e\x1f\x64\xf9\xb9\xea\x35\x2c\x71" - "\x15\x07\x05\x3c\xf4\xe5\x33\x9d\x52\x86" - "\x5f\x25\xcc\x22\xb5\xe8\x77\x84\xa1\x2f" - "\xc9\x61\xd6\x6c\xb6\xe8\x95\x73\x19\x9a" - "\x2c\xe6\x56\x5c\xbd\xf1\x3d\xca\x40\x38" - "\x32\xcf\xcb\x0e\x8b\x72\x11\xe8\x3a\xf3" - "\x2a\x11\xac\x17\x92\x9f\xf1\xc0\x73\xa5" - "\x1c\xc0\x27\xaa\xed\xef\xf8\x5a\xad\x7c" - "\x2b\x7c\x5a\x80\x3e\x24\x04\xd9\x6d\x2a" - "\x77\x35\x7b\xda\x1a\x6d\xae\xed\x17\x15" - "\x1c\xb9\xbc\x51\x25\xa4\x22\xe9\x41\xde" - "\x0c\xa0\xfc\x50\x11\xc2\x3e\xcf\xfe\xfd" - "\xd0\x96\x76\x71\x1c\xf3\xdb\x0a\x34\x40" - "\x72\x0e\x16\x15\xc1\xf2\x2f\xbc\x3c\x72" - "\x1d\xe5\x21\xe1\xb9\x9b\xa1\xbd\x55\x77" - "\x40\x86\x42\x14\x7e\xd0\x96"), - "0x4F440DB1E6EDD2899FA335F09515AA025EE177A79F4B4A" - "AF38E42B5C4DE660F5DE8FB2A5B2FBD2A3CBFFD2" - "0CFF1288C0", - 1 - }, - { NULL, 0, NULL, 1 } - }; - - hash_testcase_t *testcase = testcases; - - while (testcase->input != NULL && testcase->result != NULL) { - isc_sha384_init(&sha384); - for(i = 0; i < testcase->repeats; i++) { - isc_sha384_update(&sha384, - (const isc_uint8_t *) testcase->input, - testcase->input_len); - } - isc_sha384_final(digest, &sha384); - /* - *API inconsistency BUG HERE - * in order to be consistant with the other isc_hash_final - * functions the call should be - * isc_sha224_final(&sha224, digest); - */ - tohexstr(digest, ISC_SHA384_DIGESTLENGTH, str); - ATF_CHECK_STREQ(str, testcase->result); - - testcase++; - } - -} - -ATF_TC(isc_sha512); -ATF_TC_HEAD(isc_sha512, tc) { - atf_tc_set_md_var(tc, "descr", "sha224 examples from RFC4634"); -} -ATF_TC_BODY(isc_sha512, tc) { - isc_sha512_t sha512; - - UNUSED(tc); - - /* - * These are the various test vectors. All of these are passed - * through the hash function and the results are compared to the - * result specified here. - */ - hash_testcase_t testcases[] = { - /* Test 1 */ - { - TEST_INPUT("abc"), - "0xDDAF35A193617ABACC417349AE20413112E6FA4E89A97E" - "A20A9EEEE64B55D39A2192992A274FC1A836BA3C" - "23A3FEEBBD454D4423643CE80E2A9AC94FA54CA49F", - 1 - }, - /* Test 2 */ - { - TEST_INPUT("abcdefghbcdefghicdefghijdefghijkefghijkl" - "fghijklmghijklmnhijklmnoijklmnopjklmnopq" - "klmnopqrlmnopqrsmnopqrstnopqrstu"), - "0x8E959B75DAE313DA8CF4F72814FC143F8F7779C6EB9F7F" - "A17299AEADB6889018501D289E4900F7E4331B99" - "DEC4B5433AC7D329EEB6DD26545E96E55B874BE909", - 1 - }, - /* Test 3 */ - { - TEST_INPUT("a"), - "0xE718483D0CE769644E2E42C7BC15B4638E1F98B13B2044" - "285632A803AFA973EBDE0FF244877EA60A4CB043" - "2CE577C31BEB009C5C2C49AA2E4EADB217AD8CC09B", - 1000000 - }, - /* Test 4 */ - { - TEST_INPUT("01234567012345670123456701234567"), - "0x89D05BA632C699C31231DED4FFC127D5A894DAD412C0E0" - "24DB872D1ABD2BA8141A0F85072A9BE1E2AA04CF" - "33C765CB510813A39CD5A84C4ACAA64D3F3FB7BAE9", - 20 - }, -#if 0 - /* Test 5 -- unimplemented optional functionality */ - { - TEST_INPUT(""), - "0xXXX", - 1 - }, -#endif - /* Test 6 */ - { - TEST_INPUT("\xD0"), - "0x9992202938E882E73E20F6B69E68A0A7149090423D93C8" - "1BAB3F21678D4ACEEEE50E4E8CAFADA4C85A54EA" - "8306826C4AD6E74CECE9631BFA8A549B4AB3FBBA15", - 1 - }, -#if 0 - /* Test 7 -- unimplemented optional functionality */ - { - TEST_INPUT(""), - "0xXXX", - 1 - }, -#endif - /* Test 8 */ - { - TEST_INPUT("\x8d\x4e\x3c\x0e\x38\x89\x19\x14\x91\x81" - "\x6e\x9d\x98\xbf\xf0\xa0"), - "0xCB0B67A4B8712CD73C9AABC0B199E9269B20844AFB75AC" - "BDD1C153C9828924C3DDEDAAFE669C5FDD0BC66F" - "630F6773988213EB1B16F517AD0DE4B2F0C95C90F8", - 1 - }, -#if 0 - /* Test 9 -- unimplemented optional functionality */ - { - TEST_INPUT(""), - "0xXXX", - 1 - }, -#endif - /* Test 10 */ - { - TEST_INPUT("\xa5\x5f\x20\xc4\x11\xaa\xd1\x32\x80\x7a" - "\x50\x2d\x65\x82\x4e\x31\xa2\x30\x54\x32" - "\xaa\x3d\x06\xd3\xe2\x82\xa8\xd8\x4e\x0d" - "\xe1\xde\x69\x74\xbf\x49\x54\x69\xfc\x7f" - "\x33\x8f\x80\x54\xd5\x8c\x26\xc4\x93\x60" - "\xc3\xe8\x7a\xf5\x65\x23\xac\xf6\xd8\x9d" - "\x03\xe5\x6f\xf2\xf8\x68\x00\x2b\xc3\xe4" - "\x31\xed\xc4\x4d\xf2\xf0\x22\x3d\x4b\xb3" - "\xb2\x43\x58\x6e\x1a\x7d\x92\x49\x36\x69" - "\x4f\xcb\xba\xf8\x8d\x95\x19\xe4\xeb\x50" - "\xa6\x44\xf8\xe4\xf9\x5e\xb0\xea\x95\xbc" - "\x44\x65\xc8\x82\x1a\xac\xd2\xfe\x15\xab" - "\x49\x81\x16\x4b\xbb\x6d\xc3\x2f\x96\x90" - "\x87\xa1\x45\xb0\xd9\xcc\x9c\x67\xc2\x2b" - "\x76\x32\x99\x41\x9c\xc4\x12\x8b\xe9\xa0" - "\x77\xb3\xac\xe6\x34\x06\x4e\x6d\x99\x28" - "\x35\x13\xdc\x06\xe7\x51\x5d\x0d\x73\x13" - "\x2e\x9a\x0d\xc6\xd3\xb1\xf8\xb2\x46\xf1" - "\xa9\x8a\x3f\xc7\x29\x41\xb1\xe3\xbb\x20" - "\x98\xe8\xbf\x16\xf2\x68\xd6\x4f\x0b\x0f" - "\x47\x07\xfe\x1e\xa1\xa1\x79\x1b\xa2\xf3" - "\xc0\xc7\x58\xe5\xf5\x51\x86\x3a\x96\xc9" - "\x49\xad\x47\xd7\xfb\x40\xd2"), - "0xC665BEFB36DA189D78822D10528CBF3B12B3EEF7260399" - "09C1A16A270D48719377966B957A878E72058477" - "9A62825C18DA26415E49A7176A894E7510FD1451F5", - 1 - }, - { NULL, 0, NULL, 1 } - }; - - hash_testcase_t *testcase = testcases; - - while (testcase->input != NULL && testcase->result != NULL) { - isc_sha512_init(&sha512); - for(i = 0; i < testcase->repeats; i++) { - isc_sha512_update(&sha512, - (const isc_uint8_t *) testcase->input, - testcase->input_len); - } - isc_sha512_final(digest, &sha512); - /* - *API inconsistency BUG HERE - * in order to be consistant with the other isc_hash_final - * functions the call should be - * isc_sha224_final(&sha224, digest); - */ - tohexstr(digest, ISC_SHA512_DIGESTLENGTH, str); - ATF_CHECK_STREQ(str, testcase->result); - - testcase++; - } - -} - -ATF_TC(isc_md5); -ATF_TC_HEAD(isc_md5, tc) { - atf_tc_set_md_var(tc, "descr", "md5 example from RFC1321"); -} -ATF_TC_BODY(isc_md5, tc) { - isc_md5_t md5; - - UNUSED(tc); - - /* - * These are the various test vectors. All of these are passed - * through the hash function and the results are compared to the - * result specified here. - */ - hash_testcase_t testcases[] = { - { - TEST_INPUT(""), - "0xD41D8CD98F00B204E9800998ECF8427E", - 1 - }, - { - TEST_INPUT("a"), - "0x0CC175B9C0F1B6A831C399E269772661", - 1 - }, - { - TEST_INPUT("abc"), - "0x900150983CD24FB0D6963F7D28E17F72", - 1 - }, - { - TEST_INPUT("message digest"), - "0xF96B697D7CB7938D525A2F31AAF161D0", - 1 - }, - { - TEST_INPUT("abcdefghijklmnopqrstuvwxyz"), - "0xC3FCD3D76192E4007DFB496CCA67E13B", - 1 - }, - { - TEST_INPUT("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklm" - "nopqrstuvwxyz0123456789"), - "0xD174AB98D277D9F5A5611C2C9F419D9F", - 1 - }, - { - TEST_INPUT("123456789012345678901234567890123456789" - "01234567890123456789012345678901234567890"), - "0x57EDF4A22BE3C955AC49DA2E2107B67A", - 1 - }, - { NULL, 0, NULL, 1 } - }; - - hash_testcase_t *testcase = testcases; - - while (testcase->input != NULL && testcase->result != NULL) { - isc_md5_init(&md5); - for(i = 0; i < testcase->repeats; i++) { - isc_md5_update(&md5, - (const isc_uint8_t *) testcase->input, - testcase->input_len); - } - isc_md5_final(&md5, digest); - tohexstr(digest, ISC_MD5_DIGESTLENGTH, str); - ATF_CHECK_STREQ(str, testcase->result); - - testcase++; - } -} - -/* HMAC-SHA1 test */ -ATF_TC(isc_hmacsha1); -ATF_TC_HEAD(isc_hmacsha1, tc) { - atf_tc_set_md_var(tc, "descr", "HMAC-SHA1 examples from RFC2104"); -} -ATF_TC_BODY(isc_hmacsha1, tc) { - isc_hmacsha1_t hmacsha1; - - UNUSED(tc); - /* - * These are the various test vectors. All of these are passed - * through the hash function and the results are compared to the - * result specified here. - */ - hash_testcase_t testcases[] = { - /* Test 1 */ - { - TEST_INPUT("\x48\x69\x20\x54\x68\x65\x72\x65"), - "0xB617318655057264E28BC0B6FB378C8EF146BE00", - 1 - }, - /* Test 2 */ - { - TEST_INPUT("\x77\x68\x61\x74\x20\x64\x6f\x20\x79\x61" - "\x20\x77\x61\x6e\x74\x20\x66\x6f\x72\x20" - "\x6e\x6f\x74\x68\x69\x6e\x67\x3f"), - "0xEFFCDF6AE5EB2FA2D27416D5F184DF9C259A7C79", - 1 - }, - /* Test 3 */ - { - TEST_INPUT("\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"), - "0x125D7342B9AC11CD91A39AF48AA17B4F63F175D3", - 1 - }, - /* Test 4 */ - { - TEST_INPUT("\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"), - "0x4C9007F4026250C6BC8414F9BF50C86C2D7235DA", - 1 - }, -#if 0 - /* Test 5 -- unimplemented optional functionality */ - { - TEST_INPUT("Test With Truncation"), - "0x4C1A03424B55E07FE7F27BE1", - 1 - }, -#endif - /* Test 6 */ - { - TEST_INPUT("Test Using Larger Than Block-Size Key - " - "Hash Key First"), - "0xAA4AE5E15272D00E95705637CE8A3B55ED402112", 1 }, - /* Test 7 */ - { - TEST_INPUT("Test Using Larger Than Block-Size Key and " - "Larger Than One Block-Size Data"), - "0xE8E99D0F45237D786D6BBAA7965C7808BBFF1A91", - 1 - }, - { NULL, 0, NULL, 1 } - }; - - hash_testcase_t *testcase = testcases; - - hash_test_key_t test_keys[] = { - /* Key 1 */ - { "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" - "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", 20 }, - /* Key 2 */ - { "Jefe", 4 }, - /* Key 3 */ - { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 20 }, - /* Key 4 */ - { "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a" - "\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14" - "\x15\x16\x17\x18\x19", 25 }, -#if 0 - /* Key 5 */ - { "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" - "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", 20 }, -#endif - /* Key 6 */ - { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 80 }, - /* Key 7 */ - { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 80 }, - { "", 0 } - }; - - hash_test_key_t *test_key = test_keys; - - while (testcase->input != NULL && testcase->result != NULL) { - memcpy(buffer, test_key->key, test_key->len); - isc_hmacsha1_init(&hmacsha1, buffer, test_key->len); - isc_hmacsha1_update(&hmacsha1, - (const isc_uint8_t *) testcase->input, - testcase->input_len); - isc_hmacsha1_sign(&hmacsha1, digest, ISC_SHA1_DIGESTLENGTH); - tohexstr(digest, ISC_SHA1_DIGESTLENGTH, str); - ATF_CHECK_STREQ(str, testcase->result); - - testcase++; - test_key++; - } -} - -/* HMAC-SHA224 test */ -ATF_TC(isc_hmacsha224); -ATF_TC_HEAD(isc_hmacsha224, tc) { - atf_tc_set_md_var(tc, "descr", "HMAC-SHA224 examples from RFC4634"); -} -ATF_TC_BODY(isc_hmacsha224, tc) { - isc_hmacsha224_t hmacsha224; - - UNUSED(tc); - - /* - * These are the various test vectors. All of these are passed - * through the hash function and the results are compared to the - * result specified here. - */ - hash_testcase_t testcases[] = { - /* Test 1 */ - { - TEST_INPUT("\x48\x69\x20\x54\x68\x65\x72\x65"), - "0x896FB1128ABBDF196832107CD49DF33F47B4B1169912BA" - "4F53684B22", - 1 - }, - /* Test 2 */ - { - TEST_INPUT("\x77\x68\x61\x74\x20\x64\x6f\x20\x79\x61" - "\x20\x77\x61\x6e\x74\x20\x66\x6f\x72\x20" - "\x6e\x6f\x74\x68\x69\x6e\x67\x3f"), - "0xA30E01098BC6DBBF45690F3A7E9E6D0F8BBEA2A39E61480" - "08FD05E44", - 1 - }, - /* Test 3 */ - { - TEST_INPUT("\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"), - "0x7FB3CB3588C6C1F6FFA9694D7D6AD2649365B0C1F65D69" - "D1EC8333EA", - 1 - }, - /* Test 4 */ - { - TEST_INPUT("\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"), - "0x6C11506874013CAC6A2ABC1BB382627CEC6A90D86EFC01" - "2DE7AFEC5A", - 1 - }, -#if 0 - /* Test 5 -- unimplemented optional functionality */ - { - TEST_INPUT("Test With Truncation"), - "0x4C1A03424B55E07FE7F27BE1", - 1 - }, -#endif - /* Test 6 */ - { - TEST_INPUT("Test Using Larger Than Block-Size Key - " - "Hash Key First"), - "0x95E9A0DB962095ADAEBE9B2D6F0DBCE2D499F112F2D2B7" - "273FA6870E", - 1 - }, - /* Test 7 */ - { - TEST_INPUT("\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20" - "\x74\x65\x73\x74\x20\x75\x73\x69\x6e\x67" - "\x20\x61\x20\x6c\x61\x72\x67\x65\x72\x20" - "\x74\x68\x61\x6e\x20\x62\x6c\x6f\x63\x6b" - "\x2d\x73\x69\x7a\x65\x20\x6b\x65\x79\x20" - "\x61\x6e\x64\x20\x61\x20\x6c\x61\x72\x67" - "\x65\x72\x20\x74\x68\x61\x6e\x20\x62\x6c" - "\x6f\x63\x6b\x2d\x73\x69\x7a\x65\x20\x64" - "\x61\x74\x61\x2e\x20\x54\x68\x65\x20\x6b" - "\x65\x79\x20\x6e\x65\x65\x64\x73\x20\x74" - "\x6f\x20\x62\x65\x20\x68\x61\x73\x68\x65" - "\x64\x20\x62\x65\x66\x6f\x72\x65\x20\x62" - "\x65\x69\x6e\x67\x20\x75\x73\x65\x64\x20" - "\x62\x79\x20\x74\x68\x65\x20\x48\x4d\x41" - "\x43\x20\x61\x6c\x67\x6f\x72\x69\x74\x68" - "\x6d\x2e"), - "0x3A854166AC5D9F023F54D517D0B39DBD946770DB9C2B95" - "C9F6F565D1", - 1 - }, - { NULL, 0, NULL, 1 } - }; - - hash_testcase_t *testcase = testcases; - - hash_test_key_t test_keys[] = { - /* Key 1 */ - { "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" - "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", 20 }, - /* Key 2 */ - { "Jefe", 4 }, - /* Key 3 */ - { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 20 }, - /* Key 4 */ - { "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a" - "\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14" - "\x15\x16\x17\x18\x19", 25 }, -#if 0 - /* Key 5 */ - { "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" - "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", 20 }, -#endif - /* Key 6 */ - { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 }, - /* Key 7 */ - { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 }, - { "", 0 } - }; - - hash_test_key_t *test_key = test_keys; - - while (testcase->input != NULL && testcase->result != NULL) { - memcpy(buffer, test_key->key, test_key->len); - isc_hmacsha224_init(&hmacsha224, buffer, test_key->len); - isc_hmacsha224_update(&hmacsha224, - (const isc_uint8_t *) testcase->input, - testcase->input_len); - isc_hmacsha224_sign(&hmacsha224, digest, ISC_SHA224_DIGESTLENGTH); - tohexstr(digest, ISC_SHA224_DIGESTLENGTH, str); - ATF_CHECK_STREQ(str, testcase->result); - - testcase++; - test_key++; - } -} - -/* HMAC-SHA256 test */ -ATF_TC(isc_hmacsha256); -ATF_TC_HEAD(isc_hmacsha256, tc) { - atf_tc_set_md_var(tc, "descr", "HMAC-SHA256 examples from RFC4634"); -} -ATF_TC_BODY(isc_hmacsha256, tc) { - isc_hmacsha256_t hmacsha256; - - UNUSED(tc); - - /* - * These are the various test vectors. All of these are passed - * through the hash function and the results are compared to the - * result specified here. - */ - hash_testcase_t testcases[] = { - /* Test 1 */ - { - TEST_INPUT("\x48\x69\x20\x54\x68\x65\x72\x65"), - "0xB0344C61D8DB38535CA8AFCEAF0BF12B881DC200C9833D" - "A726E9376C2E32CFF7", - 1 - }, - /* Test 2 */ - { - TEST_INPUT("\x77\x68\x61\x74\x20\x64\x6f\x20\x79\x61" - "\x20\x77\x61\x6e\x74\x20\x66\x6f\x72\x20" - "\x6e\x6f\x74\x68\x69\x6e\x67\x3f"), - "0x5BDCC146BF60754E6A042426089575C75A003F089D2739" - "839DEC58B964EC3843", - 1 - }, - /* Test 3 */ - { - TEST_INPUT("\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"), - "0x773EA91E36800E46854DB8EBD09181A72959098B3EF8C1" - "22D9635514CED565FE", - 1 - }, - /* Test 4 */ - { - TEST_INPUT("\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"), - "0x82558A389A443C0EA4CC819899F2083A85F0FAA3E578F8" - "077A2E3FF46729665B", - 1 - }, -#if 0 - /* Test 5 -- unimplemented optional functionality */ - { - TEST_INPUT("Test With Truncation"), - "0x4C1A03424B55E07FE7F27BE1", - 1 - }, -#endif - /* Test 6 */ - { - TEST_INPUT("Test Using Larger Than Block-Size Key - " - "Hash Key First"), - "0x60E431591EE0B67F0D8A26AACBF5B77F8E0BC6213728C5" - "140546040F0EE37F54", - 1 - }, - /* Test 7 */ - { - TEST_INPUT("\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20" - "\x74\x65\x73\x74\x20\x75\x73\x69\x6e\x67" - "\x20\x61\x20\x6c\x61\x72\x67\x65\x72\x20" - "\x74\x68\x61\x6e\x20\x62\x6c\x6f\x63\x6b" - "\x2d\x73\x69\x7a\x65\x20\x6b\x65\x79\x20" - "\x61\x6e\x64\x20\x61\x20\x6c\x61\x72\x67" - "\x65\x72\x20\x74\x68\x61\x6e\x20\x62\x6c" - "\x6f\x63\x6b\x2d\x73\x69\x7a\x65\x20\x64" - "\x61\x74\x61\x2e\x20\x54\x68\x65\x20\x6b" - "\x65\x79\x20\x6e\x65\x65\x64\x73\x20\x74" - "\x6f\x20\x62\x65\x20\x68\x61\x73\x68\x65" - "\x64\x20\x62\x65\x66\x6f\x72\x65\x20\x62" - "\x65\x69\x6e\x67\x20\x75\x73\x65\x64\x20" - "\x62\x79\x20\x74\x68\x65\x20\x48\x4d\x41" - "\x43\x20\x61\x6c\x67\x6f\x72\x69\x74\x68" - "\x6d\x2e"), - "0x9B09FFA71B942FCB27635FBCD5B0E944BFDC63644F0713" - "938A7F51535C3A35E2", - 1 - }, - { NULL, 0, NULL, 1 } - }; - - hash_testcase_t *testcase = testcases; - - hash_test_key_t test_keys[] = { - /* Key 1 */ - { "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" - "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", 20 }, - /* Key 2 */ - { "Jefe", 4 }, - /* Key 3 */ - { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 20 }, - /* Key 4 */ - { "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a" - "\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14" - "\x15\x16\x17\x18\x19", 25 }, -#if 0 - /* Key 5 */ - { "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" - "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", 20 }, -#endif - /* Key 6 */ - { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 }, - /* Key 7 */ - { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 }, - { "", 0 } - }; - - hash_test_key_t *test_key = test_keys; - - while (testcase->input != NULL && testcase->result != NULL) { - memcpy(buffer, test_key->key, test_key->len); - isc_hmacsha256_init(&hmacsha256, buffer, test_key->len); - isc_hmacsha256_update(&hmacsha256, - (const isc_uint8_t *) testcase->input, - testcase->input_len); - isc_hmacsha256_sign(&hmacsha256, digest, ISC_SHA256_DIGESTLENGTH); - tohexstr(digest, ISC_SHA256_DIGESTLENGTH, str); - ATF_CHECK_STREQ(str, testcase->result); - - testcase++; - test_key++; - } -} - -/* HMAC-SHA384 test */ -ATF_TC(isc_hmacsha384); -ATF_TC_HEAD(isc_hmacsha384, tc) { - atf_tc_set_md_var(tc, "descr", "HMAC-SHA384 examples from RFC4634"); -} -ATF_TC_BODY(isc_hmacsha384, tc) { - isc_hmacsha384_t hmacsha384; - - UNUSED(tc); - - /* - * These are the various test vectors. All of these are passed - * through the hash function and the results are compared to the - * result specified here. - */ - hash_testcase_t testcases[] = { - /* Test 1 */ - { - TEST_INPUT("\x48\x69\x20\x54\x68\x65\x72\x65"), - "0xAFD03944D84895626B0825F4AB46907F15F9DADBE4101E" - "C682AA034C7CEBC59CFAEA9EA9076EDE7F4AF152" - "E8B2FA9CB6", - 1 - }, - /* Test 2 */ - { - TEST_INPUT("\x77\x68\x61\x74\x20\x64\x6f\x20\x79\x61" - "\x20\x77\x61\x6e\x74\x20\x66\x6f\x72\x20" - "\x6e\x6f\x74\x68\x69\x6e\x67\x3f"), - "0xAF45D2E376484031617F78D2B58A6B1B9C7EF464F5A01B" - "47E42EC3736322445E8E2240CA5E69E2C78B3239" - "ECFAB21649", - 1 - }, - /* Test 3 */ - { - TEST_INPUT("\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"), - "0x88062608D3E6AD8A0AA2ACE014C8A86F0AA635D947AC9F" - "EBE83EF4E55966144B2A5AB39DC13814B94E3AB6" - "E101A34F27", - 1 - }, - /* Test 4 */ - { - TEST_INPUT("\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"), - "0x3E8A69B7783C25851933AB6290AF6CA77A998148085000" - "9CC5577C6E1F573B4E6801DD23C4A7D679CCF8A3" - "86C674CFFB", - 1 - }, -#if 0 - /* Test 5 -- unimplemented optional functionality */ - { - TEST_INPUT("Test With Truncation"), - "0x4C1A03424B55E07FE7F27BE1", - 1 - }, -#endif - /* Test 6 */ - { - TEST_INPUT("Test Using Larger Than Block-Size Key - " - "Hash Key First"), - "0x4ECE084485813E9088D2C63A041BC5B44F9EF1012A2B58" - "8F3CD11F05033AC4C60C2EF6AB4030FE8296248D" - "F163F44952", - 1 - }, - /* Test 7 */ - { - TEST_INPUT("\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20" - "\x74\x65\x73\x74\x20\x75\x73\x69\x6e\x67" - "\x20\x61\x20\x6c\x61\x72\x67\x65\x72\x20" - "\x74\x68\x61\x6e\x20\x62\x6c\x6f\x63\x6b" - "\x2d\x73\x69\x7a\x65\x20\x6b\x65\x79\x20" - "\x61\x6e\x64\x20\x61\x20\x6c\x61\x72\x67" - "\x65\x72\x20\x74\x68\x61\x6e\x20\x62\x6c" - "\x6f\x63\x6b\x2d\x73\x69\x7a\x65\x20\x64" - "\x61\x74\x61\x2e\x20\x54\x68\x65\x20\x6b" - "\x65\x79\x20\x6e\x65\x65\x64\x73\x20\x74" - "\x6f\x20\x62\x65\x20\x68\x61\x73\x68\x65" - "\x64\x20\x62\x65\x66\x6f\x72\x65\x20\x62" - "\x65\x69\x6e\x67\x20\x75\x73\x65\x64\x20" - "\x62\x79\x20\x74\x68\x65\x20\x48\x4d\x41" - "\x43\x20\x61\x6c\x67\x6f\x72\x69\x74\x68" - "\x6d\x2e"), - "0x6617178E941F020D351E2F254E8FD32C602420FEB0B8FB" - "9ADCCEBB82461E99C5A678CC31E799176D3860E6" - "110C46523E", - 1 - }, - { NULL, 0, NULL, 1 } - }; - - hash_testcase_t *testcase = testcases; - - hash_test_key_t test_keys[] = { - /* Key 1 */ - { "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" - "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", 20 }, - /* Key 2 */ - { "Jefe", 4 }, - /* Key 3 */ - { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 20 }, - /* Key 4 */ - { "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a" - "\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14" - "\x15\x16\x17\x18\x19", 25 }, -#if 0 - /* Key 5 */ - { "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" - "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", 20 }, -#endif - /* Key 6 */ - { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 }, - /* Key 7 */ - { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 }, - { "", 0 } - }; - - hash_test_key_t *test_key = test_keys; - - while (testcase->input != NULL && testcase->result != NULL) { - memcpy(buffer, test_key->key, test_key->len); - isc_hmacsha384_init(&hmacsha384, buffer, test_key->len); - isc_hmacsha384_update(&hmacsha384, - (const isc_uint8_t *) testcase->input, - testcase->input_len); - isc_hmacsha384_sign(&hmacsha384, digest, ISC_SHA384_DIGESTLENGTH); - tohexstr(digest, ISC_SHA384_DIGESTLENGTH, str); - ATF_CHECK_STREQ(str, testcase->result); - - testcase++; - test_key++; - } -} - -/* HMAC-SHA512 test */ -ATF_TC(isc_hmacsha512); -ATF_TC_HEAD(isc_hmacsha512, tc) { - atf_tc_set_md_var(tc, "descr", "HMAC-SHA512 examples from RFC4634"); -} -ATF_TC_BODY(isc_hmacsha512, tc) { - isc_hmacsha512_t hmacsha512; - - UNUSED(tc); - - /* - * These are the various test vectors. All of these are passed - * through the hash function and the results are compared to the - * result specified here. - */ - hash_testcase_t testcases[] = { - /* Test 1 */ - { - TEST_INPUT("\x48\x69\x20\x54\x68\x65\x72\x65"), - "0x87AA7CDEA5EF619D4FF0B4241A1D6CB02379F4E2CE4EC2" - "787AD0B30545E17CDEDAA833B7D6B8A702038B27" - "4EAEA3F4E4BE9D914EEB61F1702E696C203A126854", - 1 - }, - /* Test 2 */ - { - TEST_INPUT("\x77\x68\x61\x74\x20\x64\x6f\x20\x79\x61" - "\x20\x77\x61\x6e\x74\x20\x66\x6f\x72\x20" - "\x6e\x6f\x74\x68\x69\x6e\x67\x3f"), - "0x164B7A7BFCF819E2E395FBE73B56E0A387BD64222E831F" - "D610270CD7EA2505549758BF75C05A994A6D034F" - "65F8F0E6FDCAEAB1A34D4A6B4B636E070A38BCE737", - 1 - }, - /* Test 3 */ - { - TEST_INPUT("\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"), - "0xFA73B0089D56A284EFB0F0756C890BE9B1B5DBDD8EE81A" - "3655F83E33B2279D39BF3E848279A722C806B485" - "A47E67C807B946A337BEE8942674278859E13292FB", - 1 - }, - /* Test 4 */ - { - TEST_INPUT("\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"), - "0xB0BA465637458C6990E5A8C5F61D4AF7E576D97FF94B87" - "2DE76F8050361EE3DBA91CA5C11AA25EB4D67927" - "5CC5788063A5F19741120C4F2DE2ADEBEB10A298DD", - 1 - }, -#if 0 - /* Test 5 -- unimplemented optional functionality */ - { - TEST_INPUT("Test With Truncation"), - "0x4C1A03424B55E07FE7F27BE1", - 1 - }, -#endif - /* Test 6 */ - { - TEST_INPUT("Test Using Larger Than Block-Size Key - " - "Hash Key First"), - "0x80B24263C7C1A3EBB71493C1DD7BE8B49B46D1F41B4AEE" - "C1121B013783F8F3526B56D037E05F2598BD0FD2" - "215D6A1E5295E64F73F63F0AEC8B915A985D786598", - 1 - }, - /* Test 7 */ - { - TEST_INPUT("\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20" - "\x74\x65\x73\x74\x20\x75\x73\x69\x6e\x67" - "\x20\x61\x20\x6c\x61\x72\x67\x65\x72\x20" - "\x74\x68\x61\x6e\x20\x62\x6c\x6f\x63\x6b" - "\x2d\x73\x69\x7a\x65\x20\x6b\x65\x79\x20" - "\x61\x6e\x64\x20\x61\x20\x6c\x61\x72\x67" - "\x65\x72\x20\x74\x68\x61\x6e\x20\x62\x6c" - "\x6f\x63\x6b\x2d\x73\x69\x7a\x65\x20\x64" - "\x61\x74\x61\x2e\x20\x54\x68\x65\x20\x6b" - "\x65\x79\x20\x6e\x65\x65\x64\x73\x20\x74" - "\x6f\x20\x62\x65\x20\x68\x61\x73\x68\x65" - "\x64\x20\x62\x65\x66\x6f\x72\x65\x20\x62" - "\x65\x69\x6e\x67\x20\x75\x73\x65\x64\x20" - "\x62\x79\x20\x74\x68\x65\x20\x48\x4d\x41" - "\x43\x20\x61\x6c\x67\x6f\x72\x69\x74\x68" - "\x6d\x2e"), - "0xE37B6A775DC87DBAA4DFA9F96E5E3FFDDEBD71F8867289" - "865DF5A32D20CDC944B6022CAC3C4982B10D5EEB" - "55C3E4DE15134676FB6DE0446065C97440FA8C6A58", - 1 - }, - { NULL, 0, NULL, 1 } - }; - - hash_testcase_t *testcase = testcases; - - hash_test_key_t test_keys[] = { - /* Key 1 */ - { "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" - "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", 20 }, - /* Key 2 */ - { "Jefe", 4 }, - /* Key 3 */ - { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 20 }, - /* Key 4 */ - { "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a" - "\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14" - "\x15\x16\x17\x18\x19", 25 }, -#if 0 - /* Key 5 */ - { "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" - "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", 20 }, -#endif - /* Key 6 */ - { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 }, - /* Key 7 */ - { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 }, - { "", 0 } - }; - - hash_test_key_t *test_key = test_keys; - - while (testcase->input != NULL && testcase->result != NULL) { - memcpy(buffer, test_key->key, test_key->len); - isc_hmacsha512_init(&hmacsha512, buffer, test_key->len); - isc_hmacsha512_update(&hmacsha512, - (const isc_uint8_t *) testcase->input, - testcase->input_len); - isc_hmacsha512_sign(&hmacsha512, digest, ISC_SHA512_DIGESTLENGTH); - tohexstr(digest, ISC_SHA512_DIGESTLENGTH, str); - ATF_CHECK_STREQ(str, testcase->result); - - testcase++; - test_key++; - } -} - - -/* HMAC-MD5 Test */ -ATF_TC(isc_hmacmd5); -ATF_TC_HEAD(isc_hmacmd5, tc) { - atf_tc_set_md_var(tc, "descr", "HMAC-MD5 examples from RFC2104"); -} -ATF_TC_BODY(isc_hmacmd5, tc) { - isc_hmacmd5_t hmacmd5; - - UNUSED(tc); - - /* - * These are the various test vectors. All of these are passed - * through the hash function and the results are compared to the - * result specified here. - */ - hash_testcase_t testcases[] = { - /* Test 1 */ - { - TEST_INPUT("\x48\x69\x20\x54\x68\x65\x72\x65"), - "0x9294727A3638BB1C13F48EF8158BFC9D", - 1 - }, - /* Test 2 */ - { - TEST_INPUT("\x77\x68\x61\x74\x20\x64\x6f\x20\x79" - "\x61\x20\x77\x61\x6e\x74\x20\x66\x6f" - "\x72\x20\x6e\x6f\x74\x68\x69\x6e\x67\x3f"), - "0x750C783E6AB0B503EAA86E310A5DB738", 1 - }, - /* Test 3 */ - { - TEST_INPUT("\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"), - "0x56BE34521D144C88DBB8C733F0E8B3F6", - 1 - }, - /* Test 4 */ - { - TEST_INPUT("\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" - "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"), - "0x697EAF0ACA3A3AEA3A75164746FFAA79", - 1 - }, -#if 0 - /* Test 5 -- unimplemented optional functionality */ - { - TEST_INPUT("Test With Truncation"), - "0x4C1A03424B55E07FE7F27BE1", - 1 - }, - /* Test 6 -- unimplemented optional functionality */ - { - TEST_INPUT("Test Using Larger Than Block-Size Key - " - "Hash Key First"), - "0xAA4AE5E15272D00E95705637CE8A3B55ED402112", - 1 - }, - /* Test 7 -- unimplemented optional functionality */ - { - TEST_INPUT("Test Using Larger Than Block-Size Key and " - "Larger Than One Block-Size Data"), - "0xE8E99D0F45237D786D6BBAA7965C7808BBFF1A91", - 1 - }, -#endif - { NULL, 0, NULL, 1 } - }; - - hash_testcase_t *testcase = testcases; - - hash_test_key_t test_keys[] = { - /* Key 1 */ - { "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" - "\x0b\x0b\x0b\x0b\x0b\x0b", 16 }, - /* Key 2 */ - { "Jefe", 4 }, - /* Key 3 */ - { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa", 16 }, - /* Key 4 */ - { "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a" - "\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14" - "\x15\x16\x17\x18\x19", 25 }, -#if 0 - /* Key 5 */ - { "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" - "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", 20 }, - /* Key 6 */ - { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 }, - /* Key 7 */ - { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" - "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 }, -#endif - { "", 0 } - }; - - hash_test_key_t *test_key = test_keys; - - while (testcase->input != NULL && testcase->result != NULL) { - memcpy(buffer, test_key->key, test_key->len); - isc_hmacmd5_init(&hmacmd5, buffer, test_key->len); - isc_hmacmd5_update(&hmacmd5, - (const isc_uint8_t *) testcase->input, - testcase->input_len); - isc_hmacmd5_sign(&hmacmd5, digest); - tohexstr(digest, ISC_MD5_DIGESTLENGTH, str); - ATF_CHECK_STREQ(str, testcase->result); - - testcase++; - test_key++; - } -} - -/* - * Main - */ -ATF_TP_ADD_TCS(tp) { - ATF_TP_ADD_TC(tp, isc_hmacmd5); - ATF_TP_ADD_TC(tp, isc_hmacsha1); - ATF_TP_ADD_TC(tp, isc_hmacsha224); - ATF_TP_ADD_TC(tp, isc_hmacsha256); - ATF_TP_ADD_TC(tp, isc_hmacsha384); - ATF_TP_ADD_TC(tp, isc_hmacsha512); - ATF_TP_ADD_TC(tp, isc_md5); - ATF_TP_ADD_TC(tp, isc_sha1); - ATF_TP_ADD_TC(tp, isc_sha224); - ATF_TP_ADD_TC(tp, isc_sha256); - ATF_TP_ADD_TC(tp, isc_sha384); - ATF_TP_ADD_TC(tp, isc_sha512); - return (atf_no_error()); -} - diff --git a/lib/isc/tests/isctest.c b/lib/isc/tests/isctest.c deleted file mode 100644 index e118bbf2ad9e..000000000000 --- a/lib/isc/tests/isctest.c +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/*! \file */ - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "isctest.h" - -isc_mem_t *mctx = NULL; -isc_entropy_t *ectx = NULL; -isc_log_t *lctx = NULL; -isc_taskmgr_t *taskmgr = NULL; -isc_timermgr_t *timermgr = NULL; -isc_socketmgr_t *socketmgr = NULL; -int ncpus; - -static isc_boolean_t hash_active = ISC_FALSE; - -/* - * Logging categories: this needs to match the list in bin/named/log.c. - */ -static isc_logcategory_t categories[] = { - { "", 0 }, - { "client", 0 }, - { "network", 0 }, - { "update", 0 }, - { "queries", 0 }, - { "unmatched", 0 }, - { "update-security", 0 }, - { "query-errors", 0 }, - { NULL, 0 } -}; - -static void -cleanup_managers() { - if (socketmgr != NULL) - isc_socketmgr_destroy(&socketmgr); - if (taskmgr != NULL) - isc_taskmgr_destroy(&taskmgr); - if (timermgr != NULL) - isc_timermgr_destroy(&timermgr); -} - -static isc_result_t -create_managers() { - isc_result_t result; -#ifdef ISC_PLATFORM_USETHREADS - ncpus = isc_os_ncpus(); -#else - ncpus = 1; -#endif - - CHECK(isc_taskmgr_create(mctx, ncpus, 0, &taskmgr)); - CHECK(isc_timermgr_create(mctx, &timermgr)); - CHECK(isc_socketmgr_create(mctx, &socketmgr)); - return (ISC_R_SUCCESS); - - cleanup: - cleanup_managers(); - return (result); -} - -isc_result_t -isc_test_begin(FILE *logfile, isc_boolean_t start_managers) { - isc_result_t result; - - isc_mem_debugging |= ISC_MEM_DEBUGRECORD; - CHECK(isc_mem_create(0, 0, &mctx)); - CHECK(isc_entropy_create(mctx, &ectx)); - - CHECK(isc_hash_create(mctx, ectx, 255)); - hash_active = ISC_TRUE; - - if (logfile != NULL) { - isc_logdestination_t destination; - isc_logconfig_t *logconfig = NULL; - - CHECK(isc_log_create(mctx, &lctx, &logconfig)); - isc_log_registercategories(lctx, categories); - isc_log_setcontext(lctx); - - destination.file.stream = logfile; - destination.file.name = NULL; - destination.file.versions = ISC_LOG_ROLLNEVER; - destination.file.maximum_size = 0; - CHECK(isc_log_createchannel(logconfig, "stderr", - ISC_LOG_TOFILEDESC, - ISC_LOG_DYNAMIC, - &destination, 0)); - CHECK(isc_log_usechannel(logconfig, "stderr", NULL, NULL)); - } - -#ifdef ISC_PLATFORM_USETHREADS - ncpus = isc_os_ncpus(); -#else - ncpus = 1; -#endif - - if (start_managers) - CHECK(create_managers()); - - return (ISC_R_SUCCESS); - - cleanup: - isc_test_end(); - return (result); -} - -void -isc_test_end() { - if (taskmgr != NULL) - isc_taskmgr_destroy(&taskmgr); - if (lctx != NULL) - isc_log_destroy(&lctx); - if (hash_active) { - isc_hash_destroy(); - hash_active = ISC_FALSE; - } - if (ectx != NULL) - isc_entropy_detach(&ectx); - - cleanup_managers(); - - if (mctx != NULL) - isc_mem_destroy(&mctx); -} - -/* - * Sleep for 'usec' microseconds. - */ -void -isc_test_nap(isc_uint32_t usec) { -#ifdef HAVE_NANOSLEEP - struct timespec ts; - - ts.tv_sec = usec / 1000000; - ts.tv_nsec = (usec % 1000000) * 1000; - nanosleep(&ts, NULL); -#elif HAVE_USLEEP - usleep(usec); -#else - /* - * No fractional-second sleep function is available, so we - * round up to the nearest second and sleep instead - */ - sleep((usec / 1000000) + 1); -#endif -} diff --git a/lib/isc/tests/isctest.h b/lib/isc/tests/isctest.h deleted file mode 100644 index 03423c807bb7..000000000000 --- a/lib/isc/tests/isctest.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/*! \file */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define CHECK(r) \ - do { \ - result = (r); \ - if (result != ISC_R_SUCCESS) \ - goto cleanup; \ - } while (0) - -extern isc_mem_t *mctx; -extern isc_entropy_t *ectx; -extern isc_log_t *lctx; -extern isc_taskmgr_t *taskmgr; -isc_timermgr_t *timermgr; -isc_socketmgr_t *socketmgr; -extern int ncpus; - -isc_result_t -isc_test_begin(FILE *logfile, isc_boolean_t start_managers); - -void -isc_test_end(void); - -void -isc_test_nap(isc_uint32_t usec); diff --git a/lib/isc/tests/queue_test.c b/lib/isc/tests/queue_test.c deleted file mode 100644 index 74620fef42aa..000000000000 --- a/lib/isc/tests/queue_test.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/*! \file */ - -#include - -#include - -#include -#include - -#include - -#include "isctest.h" - -typedef struct item { - int value; - ISC_QLINK(item_t) qlink; -} item_t; - -typedef ISC_QUEUE(item_t) item_queue_t; - -static void -item_init(item_t *item, int value) { - item->value = value; - ISC_QLINK_INIT(item, qlink); -} - -/* - * Individual unit tests - */ - -/* Test UDP sendto/recv (IPv4) */ -ATF_TC(queue_valid); -ATF_TC_HEAD(queue_valid, tc) { - atf_tc_set_md_var(tc, "descr", "Check queue validity"); -} -ATF_TC_BODY(queue_valid, tc) { - isc_result_t result; - item_queue_t queue; - item_t one, two, three, four, five; - item_t *p; - - UNUSED(tc); - - ISC_QUEUE_INIT(queue, qlink); - - item_init(&one, 1); - item_init(&two, 2); - item_init(&three, 3); - item_init(&four, 4); - item_init(&five, 5); - - result = isc_test_begin(NULL, ISC_TRUE); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - ATF_CHECK(ISC_QUEUE_EMPTY(queue)); - - ISC_QUEUE_POP(queue, qlink, p); - ATF_CHECK(p == NULL); - - ATF_CHECK(! ISC_QLINK_LINKED(&one, qlink)); - ISC_QUEUE_PUSH(queue, &one, qlink); - ATF_CHECK(ISC_QLINK_LINKED(&one, qlink)); - - ATF_CHECK(! ISC_QUEUE_EMPTY(queue)); - - ISC_QUEUE_POP(queue, qlink, p); - ATF_REQUIRE(p != NULL); - ATF_CHECK_EQ(p->value, 1); - ATF_CHECK(ISC_QUEUE_EMPTY(queue)); - ATF_CHECK(! ISC_QLINK_LINKED(p, qlink)); - - ISC_QUEUE_PUSH(queue, p, qlink); - ATF_CHECK(! ISC_QUEUE_EMPTY(queue)); - ATF_CHECK(ISC_QLINK_LINKED(p, qlink)); - - ATF_CHECK(! ISC_QLINK_LINKED(&two, qlink)); - ISC_QUEUE_PUSH(queue, &two, qlink); - ATF_CHECK(ISC_QLINK_LINKED(&two, qlink)); - - ATF_CHECK(! ISC_QLINK_LINKED(&three, qlink)); - ISC_QUEUE_PUSH(queue, &three, qlink); - ATF_CHECK(ISC_QLINK_LINKED(&three, qlink)); - - ATF_CHECK(! ISC_QLINK_LINKED(&four, qlink)); - ISC_QUEUE_PUSH(queue, &four, qlink); - ATF_CHECK(ISC_QLINK_LINKED(&four, qlink)); - - ATF_CHECK(! ISC_QLINK_LINKED(&five, qlink)); - ISC_QUEUE_PUSH(queue, &five, qlink); - ATF_CHECK(ISC_QLINK_LINKED(&five, qlink)); - - ISC_QUEUE_POP(queue, qlink, p); - ATF_REQUIRE(p != NULL); - ATF_CHECK_EQ(p->value, 1); - - ISC_QUEUE_POP(queue, qlink, p); - ATF_REQUIRE(p != NULL); - ATF_CHECK_EQ(p->value, 2); - - ISC_QUEUE_POP(queue, qlink, p); - ATF_REQUIRE(p != NULL); - ATF_CHECK_EQ(p->value, 3); - - ISC_QUEUE_POP(queue, qlink, p); - ATF_REQUIRE(p != NULL); - ATF_CHECK_EQ(p->value, 4); - - ISC_QUEUE_POP(queue, qlink, p); - ATF_REQUIRE(p != NULL); - ATF_CHECK_EQ(p->value, 5); - - ATF_CHECK(ISC_QUEUE_EMPTY(queue)); - - ISC_QUEUE_DESTROY(queue); - isc_test_end(); -} - -/* - * Main - */ -ATF_TP_ADD_TCS(tp) { - ATF_TP_ADD_TC(tp, queue_valid); - - return (atf_no_error()); -} - diff --git a/lib/isc/tests/socket_test.c b/lib/isc/tests/socket_test.c deleted file mode 100644 index 724d79df2bd1..000000000000 --- a/lib/isc/tests/socket_test.c +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/*! \file */ - -#include - -#include - -#include -#include - -#include - -#include "../task_p.h" -#include "isctest.h" - -/* - * Helper functions - */ -typedef struct { - isc_boolean_t done; - isc_result_t result; -} completion_t; - -static void -completion_init(completion_t *completion) { - completion->done = ISC_FALSE; -} - -static void -event_done(isc_task_t *task, isc_event_t *event) { - isc_socketevent_t *dev; - completion_t *completion = event->ev_arg; - - UNUSED(task); - - dev = (isc_socketevent_t *) event; - completion->result = dev->result; - completion->done = ISC_TRUE; - isc_event_free(&event); -} - -static isc_result_t -waitfor(completion_t *completion) { - int i = 0; - while (!completion->done && i++ < 5000) { -#ifndef ISC_PLATFORM_USETHREADS - while (isc__taskmgr_ready(taskmgr)) - isc__taskmgr_dispatch(taskmgr); -#endif - isc_test_nap(1000); - } - if (completion->done) - return (ISC_R_SUCCESS); - return (ISC_R_FAILURE); -} - -/* - * Individual unit tests - */ - -/* Test UDP sendto/recv (IPv4) */ -ATF_TC(udp_sendto); -ATF_TC_HEAD(udp_sendto, tc) { - atf_tc_set_md_var(tc, "descr", "UDP sendto/recv"); -} -ATF_TC_BODY(udp_sendto, tc) { - isc_result_t result; - isc_sockaddr_t addr1, addr2; - struct in_addr in; - isc_socket_t *s1 = NULL, *s2 = NULL; - isc_task_t *task = NULL; - char sendbuf[BUFSIZ], recvbuf[BUFSIZ]; - completion_t completion; - isc_region_t r; - - UNUSED(tc); - - result = isc_test_begin(NULL, ISC_TRUE); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - /* - * Create two sockets: 127.0.0.1/5444 and 127.0.0.1/5445, talking to - * each other. - */ - in.s_addr = inet_addr("127.0.0.1"); - isc_sockaddr_fromin(&addr1, &in, 5444); - isc_sockaddr_fromin(&addr2, &in, 5445); - - result = isc_socket_create(socketmgr, PF_INET, isc_sockettype_udp, &s1); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - result = isc_socket_bind(s1, &addr1, ISC_SOCKET_REUSEADDRESS); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - result = isc_socket_create(socketmgr, PF_INET, isc_sockettype_udp, &s2); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - result = isc_socket_bind(s2, &addr2, ISC_SOCKET_REUSEADDRESS); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - result = isc_task_create(taskmgr, 0, &task); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - strcpy(sendbuf, "Hello"); - r.base = (void *) sendbuf; - r.length = strlen(sendbuf) + 1; - - completion_init(&completion); - result = isc_socket_sendto(s1, &r, task, event_done, &completion, - &addr2, NULL); - ATF_CHECK_EQ(result, ISC_R_SUCCESS); - waitfor(&completion); - ATF_CHECK(completion.done); - ATF_CHECK_EQ(completion.result, ISC_R_SUCCESS); - - r.base = (void *) recvbuf; - r.length = BUFSIZ; - completion_init(&completion); - result = isc_socket_recv(s2, &r, 1, task, event_done, &completion); - ATF_CHECK_EQ(result, ISC_R_SUCCESS); - waitfor(&completion); - ATF_CHECK(completion.done); - ATF_CHECK_EQ(completion.result, ISC_R_SUCCESS); - ATF_CHECK_STREQ(recvbuf, "Hello"); - - isc_task_detach(&task); - - isc_socket_detach(&s1); - isc_socket_detach(&s2); - - isc_test_end(); -} - -/* Test UDP sendto/recv with duplicated socket */ -ATF_TC(udp_dup); -ATF_TC_HEAD(udp_dup, tc) { - atf_tc_set_md_var(tc, "descr", "duplicated socket sendto/recv"); -} -ATF_TC_BODY(udp_dup, tc) { - isc_result_t result; - isc_sockaddr_t addr1, addr2; - struct in_addr in; - isc_socket_t *s1 = NULL, *s2 = NULL, *s3 = NULL; - isc_task_t *task = NULL; - char sendbuf[BUFSIZ], recvbuf[BUFSIZ]; - completion_t completion; - isc_region_t r; - - UNUSED(tc); - - result = isc_test_begin(NULL, ISC_TRUE); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - /* - * Create two sockets: 127.0.0.1/5444 and 127.0.0.1/5445, talking to - * each other. - */ - in.s_addr = inet_addr("127.0.0.1"); - isc_sockaddr_fromin(&addr1, &in, 5444); - isc_sockaddr_fromin(&addr2, &in, 5445); - - result = isc_socket_create(socketmgr, PF_INET, isc_sockettype_udp, &s1); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - result = isc_socket_bind(s1, &addr1, ISC_SOCKET_REUSEADDRESS); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - result = isc_socket_create(socketmgr, PF_INET, isc_sockettype_udp, &s2); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - result = isc_socket_bind(s2, &addr2, ISC_SOCKET_REUSEADDRESS); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - result = isc_socket_dup(s2, &s3); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - result = isc_task_create(taskmgr, 0, &task); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - strcpy(sendbuf, "Hello"); - r.base = (void *) sendbuf; - r.length = strlen(sendbuf) + 1; - - completion_init(&completion); - result = isc_socket_sendto(s1, &r, task, event_done, &completion, - &addr2, NULL); - ATF_CHECK_EQ(result, ISC_R_SUCCESS); - waitfor(&completion); - ATF_CHECK(completion.done); - ATF_CHECK_EQ(completion.result, ISC_R_SUCCESS); - - strcpy(sendbuf, "World"); - r.base = (void *) sendbuf; - r.length = strlen(sendbuf) + 1; - - completion_init(&completion); - result = isc_socket_sendto(s1, &r, task, event_done, &completion, - &addr2, NULL); - ATF_CHECK_EQ(result, ISC_R_SUCCESS); - waitfor(&completion); - ATF_CHECK(completion.done); - ATF_CHECK_EQ(completion.result, ISC_R_SUCCESS); - - r.base = (void *) recvbuf; - r.length = BUFSIZ; - completion_init(&completion); - result = isc_socket_recv(s2, &r, 1, task, event_done, &completion); - ATF_CHECK_EQ(result, ISC_R_SUCCESS); - waitfor(&completion); - ATF_CHECK(completion.done); - ATF_CHECK_EQ(completion.result, ISC_R_SUCCESS); - ATF_CHECK_STREQ(recvbuf, "Hello"); - - r.base = (void *) recvbuf; - r.length = BUFSIZ; - completion_init(&completion); - result = isc_socket_recv(s3, &r, 1, task, event_done, &completion); - ATF_CHECK_EQ(result, ISC_R_SUCCESS); - waitfor(&completion); - ATF_CHECK(completion.done); - ATF_CHECK_EQ(completion.result, ISC_R_SUCCESS); - ATF_CHECK_STREQ(recvbuf, "World"); - - isc_task_detach(&task); - - isc_socket_detach(&s1); - isc_socket_detach(&s2); - isc_socket_detach(&s3); - - isc_test_end(); -} - -/* - * Main - */ -ATF_TP_ADD_TCS(tp) { - ATF_TP_ADD_TC(tp, udp_sendto); - ATF_TP_ADD_TC(tp, udp_dup); - - return (atf_no_error()); -} - diff --git a/lib/isc/tests/symtab_test.c b/lib/isc/tests/symtab_test.c deleted file mode 100644 index 21444b4c48ec..000000000000 --- a/lib/isc/tests/symtab_test.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/*! \file */ - -#include - -#include - -#include - -#include -#include - -#include "isctest.h" - -static void -undefine(char *key, unsigned int type, isc_symvalue_t value, void *arg) { - UNUSED(arg); - - ATF_REQUIRE_EQ(type, 1); - isc_mem_free(mctx, key); - isc_mem_free(mctx, value.as_pointer); -} - -/* - * Individual unit tests - */ - -ATF_TC(symtab_grow); -ATF_TC_HEAD(symtab_grow, tc) { - atf_tc_set_md_var(tc, "descr", "symbol table growth"); -} -ATF_TC_BODY(symtab_grow, tc) { - isc_result_t result; - isc_symtab_t *st = NULL; - isc_symvalue_t value; - isc_symexists_t policy = isc_symexists_reject; - int i; - - UNUSED(tc); - - result = isc_test_begin(NULL, ISC_TRUE); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - result = isc_symtab_create(mctx, 3, undefine, NULL, ISC_FALSE, &st); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - ATF_REQUIRE(st != NULL); - - /* Nothing should be in the table yet */ - - /* - * Put 1024 entries in the table (this should necessate - * regrowing the hash table several times - */ - for (i = 0; i < 1024; i++) { - char str[16], *key; - - snprintf(str, sizeof(str), "%04x", i); - key = isc_mem_strdup(mctx, str); - ATF_REQUIRE(key != NULL); - value.as_pointer = isc_mem_strdup(mctx, str); - ATF_REQUIRE(value.as_pointer != NULL); - result = isc_symtab_define(st, key, 1, value, policy); - ATF_CHECK_EQ(result, ISC_R_SUCCESS); - if (result != ISC_R_SUCCESS) - undefine(key, 1, value, NULL); - } - - /* - * Try to put them in again; this should fail - */ - for (i = 0; i < 1024; i++) { - char str[16], *key; - - snprintf(str, sizeof(str), "%04x", i); - key = isc_mem_strdup(mctx, str); - ATF_REQUIRE(key != NULL); - value.as_pointer = isc_mem_strdup(mctx, str); - ATF_REQUIRE(value.as_pointer != NULL); - result = isc_symtab_define(st, key, 1, value, policy); - ATF_CHECK_EQ(result, ISC_R_EXISTS); - undefine(key, 1, value, NULL); - } - - /* - * Retrieve them; this should succeed - */ - for (i = 0; i < 1024; i++) { - char str[16]; - - snprintf(str, sizeof(str), "%04x", i); - result = isc_symtab_lookup(st, str, 0, &value); - ATF_CHECK_EQ(result, ISC_R_SUCCESS); - ATF_CHECK_STREQ(str, value.as_pointer); - } - - /* - * Undefine them - */ - for (i = 0; i < 1024; i++) { - char str[16]; - - snprintf(str, sizeof(str), "%04x", i); - result = isc_symtab_undefine(st, str, 1); - ATF_CHECK_EQ(result, ISC_R_SUCCESS); - } - - /* - * Retrieve them again; this should fail - */ - for (i = 0; i < 1024; i++) { - char str[16]; - - snprintf(str, sizeof(str), "%04x", i); - result = isc_symtab_lookup(st, str, 0, &value); - ATF_CHECK_EQ(result, ISC_R_NOTFOUND); - } - - isc_symtab_destroy(&st); - isc_test_end(); -} - -/* - * Main - */ -ATF_TP_ADD_TCS(tp) { - ATF_TP_ADD_TC(tp, symtab_grow); - - return (atf_no_error()); -} - diff --git a/lib/isc/tests/task_test.c b/lib/isc/tests/task_test.c deleted file mode 100644 index 7294d861d38a..000000000000 --- a/lib/isc/tests/task_test.c +++ /dev/null @@ -1,416 +0,0 @@ -/* - * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/*! \file */ - -#include - -#include - -#include - -#include -#include - -#include "../task_p.h" -#include "isctest.h" - -/* - * Helper functions - */ - -/* task event handler, sets a boolean to true */ -int counter = 0; -isc_mutex_t set_lock; - -static void -set(isc_task_t *task, isc_event_t *event) { - int *value = (int *) event->ev_arg; - - UNUSED(task); - - isc_event_free(&event); - LOCK(&set_lock); - *value = counter++; - UNLOCK(&set_lock); -} - -static void -set_and_drop(isc_task_t *task, isc_event_t *event) { - int *value = (int *) event->ev_arg; - - UNUSED(task); - - isc_event_free(&event); - LOCK(&set_lock); - *value = (int) isc_taskmgr_mode(taskmgr); - counter++; - UNLOCK(&set_lock); - isc_taskmgr_setmode(taskmgr, isc_taskmgrmode_normal); -} - -/* - * Individual unit tests - */ - -/* Create a task */ -ATF_TC(create_task); -ATF_TC_HEAD(create_task, tc) { - atf_tc_set_md_var(tc, "descr", "create and destroy a task"); -} -ATF_TC_BODY(create_task, tc) { - isc_result_t result; - isc_task_t *task = NULL; - - UNUSED(tc); - - result = isc_test_begin(NULL, ISC_TRUE); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - result = isc_task_create(taskmgr, 0, &task); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - isc_task_destroy(&task); - ATF_REQUIRE_EQ(task, NULL); - - isc_test_end(); -} - -/* Process events */ -ATF_TC(all_events); -ATF_TC_HEAD(all_events, tc) { - atf_tc_set_md_var(tc, "descr", "process task events"); -} -ATF_TC_BODY(all_events, tc) { - isc_result_t result; - isc_task_t *task = NULL; - isc_event_t *event; - int a = 0, b = 0; - int i = 0; - - UNUSED(tc); - - counter = 1; - - result = isc_mutex_init(&set_lock); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - result = isc_test_begin(NULL, ISC_TRUE); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - result = isc_task_create(taskmgr, 0, &task); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - /* First event */ - event = isc_event_allocate(mctx, task, ISC_TASKEVENT_TEST, - set, &a, sizeof (isc_event_t)); - ATF_REQUIRE(event != NULL); - - ATF_CHECK_EQ(a, 0); - isc_task_send(task, &event); - - event = isc_event_allocate(mctx, task, ISC_TASKEVENT_TEST, - set, &b, sizeof (isc_event_t)); - ATF_REQUIRE(event != NULL); - - ATF_CHECK_EQ(b, 0); - isc_task_send(task, &event); - - while ((a == 0 || b == 0) && i++ < 5000) { -#ifndef ISC_PLATFORM_USETHREADS - while (isc__taskmgr_ready(taskmgr)) - isc__taskmgr_dispatch(taskmgr); -#endif - isc_test_nap(1000); - } - - ATF_CHECK(a != 0); - ATF_CHECK(b != 0); - - isc_task_destroy(&task); - ATF_REQUIRE_EQ(task, NULL); - - isc_test_end(); -} - -/* Privileged events */ -ATF_TC(privileged_events); -ATF_TC_HEAD(privileged_events, tc) { - atf_tc_set_md_var(tc, "descr", "process privileged events"); -} -ATF_TC_BODY(privileged_events, tc) { - isc_result_t result; - isc_task_t *task1 = NULL, *task2 = NULL; - isc_event_t *event; - int a = 0, b = 0, c = 0, d = 0, e = 0; - int i = 0; - - UNUSED(tc); - - counter = 1; - result = isc_mutex_init(&set_lock); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - result = isc_test_begin(NULL, ISC_TRUE); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - -#ifdef ISC_PLATFORM_USETHREADS - /* - * Pause the task manager so we can fill up the work queue - * without things happening while we do it. - */ - isc__taskmgr_pause(taskmgr); -#endif - - result = isc_task_create(taskmgr, 0, &task1); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - isc_task_setname(task1, "privileged", NULL); - ATF_CHECK(!isc_task_privilege(task1)); - isc_task_setprivilege(task1, ISC_TRUE); - ATF_CHECK(isc_task_privilege(task1)); - - result = isc_task_create(taskmgr, 0, &task2); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - isc_task_setname(task2, "normal", NULL); - ATF_CHECK(!isc_task_privilege(task2)); - - /* First event: privileged */ - event = isc_event_allocate(mctx, task1, ISC_TASKEVENT_TEST, - set, &a, sizeof (isc_event_t)); - ATF_REQUIRE(event != NULL); - - ATF_CHECK_EQ(a, 0); - isc_task_send(task1, &event); - - /* Second event: not privileged */ - event = isc_event_allocate(mctx, task2, ISC_TASKEVENT_TEST, - set, &b, sizeof (isc_event_t)); - ATF_REQUIRE(event != NULL); - - ATF_CHECK_EQ(b, 0); - isc_task_send(task2, &event); - - /* Third event: privileged */ - event = isc_event_allocate(mctx, task1, ISC_TASKEVENT_TEST, - set, &c, sizeof (isc_event_t)); - ATF_REQUIRE(event != NULL); - - ATF_CHECK_EQ(c, 0); - isc_task_send(task1, &event); - - /* Fourth event: privileged */ - event = isc_event_allocate(mctx, task1, ISC_TASKEVENT_TEST, - set, &d, sizeof (isc_event_t)); - ATF_REQUIRE(event != NULL); - - ATF_CHECK_EQ(d, 0); - isc_task_send(task1, &event); - - /* Fifth event: not privileged */ - event = isc_event_allocate(mctx, task2, ISC_TASKEVENT_TEST, - set, &e, sizeof (isc_event_t)); - ATF_REQUIRE(event != NULL); - - ATF_CHECK_EQ(e, 0); - isc_task_send(task2, &event); - - ATF_CHECK_EQ(isc_taskmgr_mode(taskmgr), isc_taskmgrmode_normal); - isc_taskmgr_setmode(taskmgr, isc_taskmgrmode_privileged); - ATF_CHECK_EQ(isc_taskmgr_mode(taskmgr), isc_taskmgrmode_privileged); - -#ifdef ISC_PLATFORM_USETHREADS - isc__taskmgr_resume(taskmgr); -#endif - - /* We're waiting for *all* variables to be set */ - while ((a == 0 || b == 0 || c == 0 || d == 0 || e == 0) && i++ < 5000) { -#ifndef ISC_PLATFORM_USETHREADS - while (isc__taskmgr_ready(taskmgr)) - isc__taskmgr_dispatch(taskmgr); -#endif - isc_test_nap(1000); - } - - /* - * We can't guarantee what order the events fire, but - * we do know the privileged tasks that set a, c, and d - * would have fired first. - */ - ATF_CHECK(a <= 3); - ATF_CHECK(c <= 3); - ATF_CHECK(d <= 3); - - /* ...and the non-privileged tasks that set b and e, last */ - ATF_CHECK(b >= 4); - ATF_CHECK(e >= 4); - - ATF_CHECK_EQ(counter, 6); - - isc_task_setprivilege(task1, ISC_FALSE); - ATF_CHECK(!isc_task_privilege(task1)); - - ATF_CHECK_EQ(isc_taskmgr_mode(taskmgr), isc_taskmgrmode_normal); - - isc_task_destroy(&task1); - ATF_REQUIRE_EQ(task1, NULL); - isc_task_destroy(&task2); - ATF_REQUIRE_EQ(task2, NULL); - - isc_test_end(); -} - -/* - * Edge case: this tests that the task manager behaves as expected when - * we explicitly set it into normal mode *while* running privileged. - */ -ATF_TC(privilege_drop); -ATF_TC_HEAD(privilege_drop, tc) { - atf_tc_set_md_var(tc, "descr", "process privileged events"); -} -ATF_TC_BODY(privilege_drop, tc) { - isc_result_t result; - isc_task_t *task1 = NULL, *task2 = NULL; - isc_event_t *event; - int a = -1, b = -1, c = -1, d = -1, e = -1; /* non valid states */ - int i = 0; - - UNUSED(tc); - - counter = 1; - result = isc_mutex_init(&set_lock); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - result = isc_test_begin(NULL, ISC_TRUE); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - -#ifdef ISC_PLATFORM_USETHREADS - /* - * Pause the task manager so we can fill up the work queue - * without things happening while we do it. - */ - isc__taskmgr_pause(taskmgr); -#endif - - result = isc_task_create(taskmgr, 0, &task1); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - isc_task_setname(task1, "privileged", NULL); - ATF_CHECK(!isc_task_privilege(task1)); - isc_task_setprivilege(task1, ISC_TRUE); - ATF_CHECK(isc_task_privilege(task1)); - - result = isc_task_create(taskmgr, 0, &task2); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - isc_task_setname(task2, "normal", NULL); - ATF_CHECK(!isc_task_privilege(task2)); - - /* First event: privileged */ - event = isc_event_allocate(mctx, task1, ISC_TASKEVENT_TEST, - set_and_drop, &a, sizeof (isc_event_t)); - ATF_REQUIRE(event != NULL); - - ATF_CHECK_EQ(a, -1); - isc_task_send(task1, &event); - - /* Second event: not privileged */ - event = isc_event_allocate(mctx, task2, ISC_TASKEVENT_TEST, - set_and_drop, &b, sizeof (isc_event_t)); - ATF_REQUIRE(event != NULL); - - ATF_CHECK_EQ(b, -1); - isc_task_send(task2, &event); - - /* Third event: privileged */ - event = isc_event_allocate(mctx, task1, ISC_TASKEVENT_TEST, - set_and_drop, &c, sizeof (isc_event_t)); - ATF_REQUIRE(event != NULL); - - ATF_CHECK_EQ(c, -1); - isc_task_send(task1, &event); - - /* Fourth event: privileged */ - event = isc_event_allocate(mctx, task1, ISC_TASKEVENT_TEST, - set_and_drop, &d, sizeof (isc_event_t)); - ATF_REQUIRE(event != NULL); - - ATF_CHECK_EQ(d, -1); - isc_task_send(task1, &event); - - /* Fifth event: not privileged */ - event = isc_event_allocate(mctx, task2, ISC_TASKEVENT_TEST, - set_and_drop, &e, sizeof (isc_event_t)); - ATF_REQUIRE(event != NULL); - - ATF_CHECK_EQ(e, -1); - isc_task_send(task2, &event); - - ATF_CHECK_EQ(isc_taskmgr_mode(taskmgr), isc_taskmgrmode_normal); - isc_taskmgr_setmode(taskmgr, isc_taskmgrmode_privileged); - ATF_CHECK_EQ(isc_taskmgr_mode(taskmgr), isc_taskmgrmode_privileged); - -#ifdef ISC_PLATFORM_USETHREADS - isc__taskmgr_resume(taskmgr); -#endif - - /* We're waiting for all variables to be set. */ - while ((a == -1 || b == -1 || c == -1 || d == -1 || e == -1) && - i++ < 5000) { -#ifndef ISC_PLATFORM_USETHREADS - while (isc__taskmgr_ready(taskmgr)) - isc__taskmgr_dispatch(taskmgr); -#endif - isc_test_nap(1000); - } - - /* - * We can't guarantee what order the events fire, but - * we do know *exactly one* of the privileged tasks will - * have run in privileged mode... - */ - ATF_CHECK(a == isc_taskmgrmode_privileged || - c == isc_taskmgrmode_privileged || - d == isc_taskmgrmode_privileged); - ATF_CHECK(a + c + d == isc_taskmgrmode_privileged); - - /* ...and neither of the non-privileged tasks did... */ - ATF_CHECK(b == isc_taskmgrmode_normal || e == isc_taskmgrmode_normal); - - /* ...but all five of them did run. */ - ATF_CHECK_EQ(counter, 6); - - ATF_CHECK_EQ(isc_taskmgr_mode(taskmgr), isc_taskmgrmode_normal); - - isc_task_destroy(&task1); - ATF_REQUIRE_EQ(task1, NULL); - isc_task_destroy(&task2); - ATF_REQUIRE_EQ(task2, NULL); - - isc_test_end(); -} - -/* - * Main - */ -ATF_TP_ADD_TCS(tp) { - ATF_TP_ADD_TC(tp, create_task); - ATF_TP_ADD_TC(tp, all_events); - ATF_TP_ADD_TC(tp, privileged_events); - ATF_TP_ADD_TC(tp, privilege_drop); - - return (atf_no_error()); -} - diff --git a/lib/isc/tests/taskpool_test.c b/lib/isc/tests/taskpool_test.c deleted file mode 100644 index aecb694f2f3f..000000000000 --- a/lib/isc/tests/taskpool_test.c +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/*! \file */ - -#include - -#include - -#include - -#include -#include - -#include "isctest.h" - -/* - * Individual unit tests - */ - -/* Create a taskpool */ -ATF_TC(create_pool); -ATF_TC_HEAD(create_pool, tc) { - atf_tc_set_md_var(tc, "descr", "create a taskpool"); -} -ATF_TC_BODY(create_pool, tc) { - isc_result_t result; - isc_taskpool_t *pool = NULL; - - UNUSED(tc); - - result = isc_test_begin(NULL, ISC_TRUE); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - result = isc_taskpool_create(taskmgr, mctx, 8, 2, &pool); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - ATF_REQUIRE_EQ(isc_taskpool_size(pool), 8); - - isc_taskpool_destroy(&pool); - ATF_REQUIRE_EQ(pool, NULL); - - isc_test_end(); -} - -/* Resize a taskpool */ -ATF_TC(expand_pool); -ATF_TC_HEAD(expand_pool, tc) { - atf_tc_set_md_var(tc, "descr", "expand a taskpool"); -} -ATF_TC_BODY(expand_pool, tc) { - isc_result_t result; - isc_taskpool_t *pool1 = NULL, *pool2 = NULL, *hold = NULL; - - UNUSED(tc); - - result = isc_test_begin(NULL, ISC_TRUE); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - result = isc_taskpool_create(taskmgr, mctx, 10, 2, &pool1); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - ATF_REQUIRE_EQ(isc_taskpool_size(pool1), 10); - - /* resizing to a smaller size should have no effect */ - hold = pool1; - result = isc_taskpool_expand(&pool1, 5, &pool2); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - ATF_REQUIRE_EQ(isc_taskpool_size(pool2), 10); - ATF_REQUIRE_EQ(pool2, hold); - ATF_REQUIRE_EQ(pool1, NULL); - pool1 = pool2; - pool2 = NULL; - - /* resizing to the same size should have no effect */ - hold = pool1; - result = isc_taskpool_expand(&pool1, 10, &pool2); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - ATF_REQUIRE_EQ(isc_taskpool_size(pool2), 10); - ATF_REQUIRE_EQ(pool2, hold); - ATF_REQUIRE_EQ(pool1, NULL); - pool1 = pool2; - pool2 = NULL; - - /* resizing to larger size should make a new pool */ - hold = pool1; - result = isc_taskpool_expand(&pool1, 20, &pool2); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - ATF_REQUIRE_EQ(isc_taskpool_size(pool2), 20); - ATF_REQUIRE(pool2 != hold); - ATF_REQUIRE_EQ(pool1, NULL); - - isc_taskpool_destroy(&pool2); - ATF_REQUIRE_EQ(pool2, NULL); - - isc_test_end(); -} - -/* Get tasks */ -ATF_TC(get_tasks); -ATF_TC_HEAD(get_tasks, tc) { - atf_tc_set_md_var(tc, "descr", "create a taskpool"); -} -ATF_TC_BODY(get_tasks, tc) { - isc_result_t result; - isc_taskpool_t *pool = NULL; - isc_task_t *task1 = NULL, *task2 = NULL, *task3 = NULL; - - UNUSED(tc); - - result = isc_test_begin(NULL, ISC_TRUE); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - result = isc_taskpool_create(taskmgr, mctx, 2, 2, &pool); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - ATF_REQUIRE_EQ(isc_taskpool_size(pool), 2); - - /* two tasks in pool; make sure we can access them more than twice */ - isc_taskpool_gettask(pool, &task1); - ATF_REQUIRE(ISCAPI_TASK_VALID(task1)); - - isc_taskpool_gettask(pool, &task2); - ATF_REQUIRE(ISCAPI_TASK_VALID(task2)); - - isc_taskpool_gettask(pool, &task3); - ATF_REQUIRE(ISCAPI_TASK_VALID(task3)); - - isc_task_destroy(&task1); - isc_task_destroy(&task2); - isc_task_destroy(&task3); - - isc_taskpool_destroy(&pool); - ATF_REQUIRE_EQ(pool, NULL); - - isc_test_end(); -} - -/* Get tasks */ -ATF_TC(set_privilege); -ATF_TC_HEAD(set_privilege, tc) { - atf_tc_set_md_var(tc, "descr", "create a taskpool"); -} -ATF_TC_BODY(set_privilege, tc) { - isc_result_t result; - isc_taskpool_t *pool = NULL; - isc_task_t *task1 = NULL, *task2 = NULL, *task3 = NULL; - - UNUSED(tc); - - result = isc_test_begin(NULL, ISC_TRUE); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - - result = isc_taskpool_create(taskmgr, mctx, 2, 2, &pool); - ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); - ATF_REQUIRE_EQ(isc_taskpool_size(pool), 2); - - isc_taskpool_setprivilege(pool, ISC_TRUE); - - isc_taskpool_gettask(pool, &task1); - isc_taskpool_gettask(pool, &task2); - isc_taskpool_gettask(pool, &task3); - - ATF_CHECK(ISCAPI_TASK_VALID(task1)); - ATF_CHECK(ISCAPI_TASK_VALID(task2)); - ATF_CHECK(ISCAPI_TASK_VALID(task3)); - - ATF_CHECK(isc_task_privilege(task1)); - ATF_CHECK(isc_task_privilege(task2)); - ATF_CHECK(isc_task_privilege(task3)); - - isc_taskpool_setprivilege(pool, ISC_FALSE); - - ATF_CHECK(!isc_task_privilege(task1)); - ATF_CHECK(!isc_task_privilege(task2)); - ATF_CHECK(!isc_task_privilege(task3)); - - isc_task_destroy(&task1); - isc_task_destroy(&task2); - isc_task_destroy(&task3); - - isc_taskpool_destroy(&pool); - ATF_REQUIRE_EQ(pool, NULL); - - isc_test_end(); -} - -/* - * Main - */ -ATF_TP_ADD_TCS(tp) { - ATF_TP_ADD_TC(tp, create_pool); - ATF_TP_ADD_TC(tp, expand_pool); - ATF_TP_ADD_TC(tp, get_tasks); - ATF_TP_ADD_TC(tp, set_privilege); - - return (atf_no_error()); -} - diff --git a/lib/isc/timer.c b/lib/isc/timer.c deleted file mode 100644 index 0da251f4c31b..000000000000 --- a/lib/isc/timer.c +++ /dev/null @@ -1,1072 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007-2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/*! \file */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef OPENSSL_LEAKS -#include -#endif - -/* See task.c about the following definition: */ -#ifdef BIND9 -#ifdef ISC_PLATFORM_USETHREADS -#define USE_TIMER_THREAD -#else -#define USE_SHARED_MANAGER -#endif /* ISC_PLATFORM_USETHREADS */ -#endif /* BIND9 */ - -#ifndef USE_TIMER_THREAD -#include "timer_p.h" -#endif /* USE_TIMER_THREAD */ - -#ifdef ISC_TIMER_TRACE -#define XTRACE(s) fprintf(stderr, "%s\n", (s)) -#define XTRACEID(s, t) fprintf(stderr, "%s %p\n", (s), (t)) -#define XTRACETIME(s, d) fprintf(stderr, "%s %u.%09u\n", (s), \ - (d).seconds, (d).nanoseconds) -#define XTRACETIME2(s, d, n) fprintf(stderr, "%s %u.%09u %u.%09u\n", (s), \ - (d).seconds, (d).nanoseconds, (n).seconds, (n).nanoseconds) -#define XTRACETIMER(s, t, d) fprintf(stderr, "%s %p %u.%09u\n", (s), (t), \ - (d).seconds, (d).nanoseconds) -#else -#define XTRACE(s) -#define XTRACEID(s, t) -#define XTRACETIME(s, d) -#define XTRACETIME2(s, d, n) -#define XTRACETIMER(s, t, d) -#endif /* ISC_TIMER_TRACE */ - -#define TIMER_MAGIC ISC_MAGIC('T', 'I', 'M', 'R') -#define VALID_TIMER(t) ISC_MAGIC_VALID(t, TIMER_MAGIC) - -typedef struct isc__timer isc__timer_t; -typedef struct isc__timermgr isc__timermgr_t; - -struct isc__timer { - /*! Not locked. */ - isc_timer_t common; - isc__timermgr_t * manager; - isc_mutex_t lock; - /*! Locked by timer lock. */ - unsigned int references; - isc_time_t idle; - /*! Locked by manager lock. */ - isc_timertype_t type; - isc_time_t expires; - isc_interval_t interval; - isc_task_t * task; - isc_taskaction_t action; - void * arg; - unsigned int index; - isc_time_t due; - LINK(isc__timer_t) link; -}; - -#define TIMER_MANAGER_MAGIC ISC_MAGIC('T', 'I', 'M', 'M') -#define VALID_MANAGER(m) ISC_MAGIC_VALID(m, TIMER_MANAGER_MAGIC) - -struct isc__timermgr { - /* Not locked. */ - isc_timermgr_t common; - isc_mem_t * mctx; - isc_mutex_t lock; - /* Locked by manager lock. */ - isc_boolean_t done; - LIST(isc__timer_t) timers; - unsigned int nscheduled; - isc_time_t due; -#ifdef USE_TIMER_THREAD - isc_condition_t wakeup; - isc_thread_t thread; -#endif /* USE_TIMER_THREAD */ -#ifdef USE_SHARED_MANAGER - unsigned int refs; -#endif /* USE_SHARED_MANAGER */ - isc_heap_t * heap; -}; - -/*% - * The followings can be either static or public, depending on build - * environment. - */ - -#ifdef BIND9 -#define ISC_TIMERFUNC_SCOPE -#else -#define ISC_TIMERFUNC_SCOPE static -#endif - -ISC_TIMERFUNC_SCOPE isc_result_t -isc__timer_create(isc_timermgr_t *manager, isc_timertype_t type, - isc_time_t *expires, isc_interval_t *interval, - isc_task_t *task, isc_taskaction_t action, const void *arg, - isc_timer_t **timerp); -ISC_TIMERFUNC_SCOPE isc_result_t -isc__timer_reset(isc_timer_t *timer, isc_timertype_t type, - isc_time_t *expires, isc_interval_t *interval, - isc_boolean_t purge); -ISC_TIMERFUNC_SCOPE isc_timertype_t -isc__timer_gettype(isc_timer_t *timer); -ISC_TIMERFUNC_SCOPE isc_result_t -isc__timer_touch(isc_timer_t *timer); -ISC_TIMERFUNC_SCOPE void -isc__timer_attach(isc_timer_t *timer0, isc_timer_t **timerp); -ISC_TIMERFUNC_SCOPE void -isc__timer_detach(isc_timer_t **timerp); -ISC_TIMERFUNC_SCOPE isc_result_t -isc__timermgr_create(isc_mem_t *mctx, isc_timermgr_t **managerp); -ISC_TIMERFUNC_SCOPE void -isc__timermgr_poke(isc_timermgr_t *manager0); -ISC_TIMERFUNC_SCOPE void -isc__timermgr_destroy(isc_timermgr_t **managerp); - -static struct isc__timermethods { - isc_timermethods_t methods; - - /*% - * The following are defined just for avoiding unused static functions. - */ -#ifndef BIND9 - void *gettype; -#endif -} timermethods = { - { - isc__timer_attach, - isc__timer_detach, - isc__timer_reset, - isc__timer_touch - } -#ifndef BIND9 - , - (void *)isc__timer_gettype -#endif -}; - -static struct isc__timermgrmethods { - isc_timermgrmethods_t methods; -#ifndef BIND9 - void *poke; /* see above */ -#endif -} timermgrmethods = { - { - isc__timermgr_destroy, - isc__timer_create - } -#ifndef BIND9 - , - (void *)isc__timermgr_poke -#endif -}; - -#ifdef USE_SHARED_MANAGER -/*! - * If the manager is supposed to be shared, there can be only one. - */ -static isc__timermgr_t *timermgr = NULL; -#endif /* USE_SHARED_MANAGER */ - -static inline isc_result_t -schedule(isc__timer_t *timer, isc_time_t *now, isc_boolean_t signal_ok) { - isc_result_t result; - isc__timermgr_t *manager; - isc_time_t due; - int cmp; -#ifdef USE_TIMER_THREAD - isc_boolean_t timedwait; -#endif - - /*! - * Note: the caller must ensure locking. - */ - - REQUIRE(timer->type != isc_timertype_inactive); - -#ifndef USE_TIMER_THREAD - UNUSED(signal_ok); -#endif /* USE_TIMER_THREAD */ - - manager = timer->manager; - -#ifdef USE_TIMER_THREAD - /*! - * If the manager was timed wait, we may need to signal the - * manager to force a wakeup. - */ - timedwait = ISC_TF(manager->nscheduled > 0 && - isc_time_seconds(&manager->due) != 0); -#endif - - /* - * Compute the new due time. - */ - if (timer->type != isc_timertype_once) { - result = isc_time_add(now, &timer->interval, &due); - if (result != ISC_R_SUCCESS) - return (result); - if (timer->type == isc_timertype_limited && - isc_time_compare(&timer->expires, &due) < 0) - due = timer->expires; - } else { - if (isc_time_isepoch(&timer->idle)) - due = timer->expires; - else if (isc_time_isepoch(&timer->expires)) - due = timer->idle; - else if (isc_time_compare(&timer->idle, &timer->expires) < 0) - due = timer->idle; - else - due = timer->expires; - } - - /* - * Schedule the timer. - */ - - if (timer->index > 0) { - /* - * Already scheduled. - */ - cmp = isc_time_compare(&due, &timer->due); - timer->due = due; - switch (cmp) { - case -1: - isc_heap_increased(manager->heap, timer->index); - break; - case 1: - isc_heap_decreased(manager->heap, timer->index); - break; - case 0: - /* Nothing to do. */ - break; - } - } else { - timer->due = due; - result = isc_heap_insert(manager->heap, timer); - if (result != ISC_R_SUCCESS) { - INSIST(result == ISC_R_NOMEMORY); - return (ISC_R_NOMEMORY); - } - manager->nscheduled++; - } - - XTRACETIMER(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER, - ISC_MSG_SCHEDULE, "schedule"), timer, due); - - /* - * If this timer is at the head of the queue, we need to ensure - * that we won't miss it if it has a more recent due time than - * the current "next" timer. We do this either by waking up the - * run thread, or explicitly setting the value in the manager. - */ -#ifdef USE_TIMER_THREAD - - /* - * This is a temporary (probably) hack to fix a bug on tru64 5.1 - * and 5.1a. Sometimes, pthread_cond_timedwait() doesn't actually - * return when the time expires, so here, we check to see if - * we're 15 seconds or more behind, and if we are, we signal - * the dispatcher. This isn't such a bad idea as a general purpose - * watchdog, so perhaps we should just leave it in here. - */ - if (signal_ok && timedwait) { - isc_interval_t fifteen; - isc_time_t then; - - isc_interval_set(&fifteen, 15, 0); - result = isc_time_add(&manager->due, &fifteen, &then); - - if (result == ISC_R_SUCCESS && - isc_time_compare(&then, now) < 0) { - SIGNAL(&manager->wakeup); - signal_ok = ISC_FALSE; - isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_TIMER, ISC_LOG_WARNING, - "*** POKED TIMER ***"); - } - } - - if (timer->index == 1 && signal_ok) { - XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER, - ISC_MSG_SIGNALSCHED, - "signal (schedule)")); - SIGNAL(&manager->wakeup); - } -#else /* USE_TIMER_THREAD */ - if (timer->index == 1 && - isc_time_compare(&timer->due, &manager->due) < 0) - manager->due = timer->due; -#endif /* USE_TIMER_THREAD */ - - return (ISC_R_SUCCESS); -} - -static inline void -deschedule(isc__timer_t *timer) { -#ifdef USE_TIMER_THREAD - isc_boolean_t need_wakeup = ISC_FALSE; -#endif - isc__timermgr_t *manager; - - /* - * The caller must ensure locking. - */ - - manager = timer->manager; - if (timer->index > 0) { -#ifdef USE_TIMER_THREAD - if (timer->index == 1) - need_wakeup = ISC_TRUE; -#endif - isc_heap_delete(manager->heap, timer->index); - timer->index = 0; - INSIST(manager->nscheduled > 0); - manager->nscheduled--; -#ifdef USE_TIMER_THREAD - if (need_wakeup) { - XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER, - ISC_MSG_SIGNALDESCHED, - "signal (deschedule)")); - SIGNAL(&manager->wakeup); - } -#endif /* USE_TIMER_THREAD */ - } -} - -static void -destroy(isc__timer_t *timer) { - isc__timermgr_t *manager = timer->manager; - - /* - * The caller must ensure it is safe to destroy the timer. - */ - - LOCK(&manager->lock); - - (void)isc_task_purgerange(timer->task, - timer, - ISC_TIMEREVENT_FIRSTEVENT, - ISC_TIMEREVENT_LASTEVENT, - NULL); - deschedule(timer); - UNLINK(manager->timers, timer, link); - - UNLOCK(&manager->lock); - - isc_task_detach(&timer->task); - DESTROYLOCK(&timer->lock); - timer->common.impmagic = 0; - timer->common.magic = 0; - isc_mem_put(manager->mctx, timer, sizeof(*timer)); -} - -ISC_TIMERFUNC_SCOPE isc_result_t -isc__timer_create(isc_timermgr_t *manager0, isc_timertype_t type, - isc_time_t *expires, isc_interval_t *interval, - isc_task_t *task, isc_taskaction_t action, const void *arg, - isc_timer_t **timerp) -{ - isc__timermgr_t *manager = (isc__timermgr_t *)manager0; - isc__timer_t *timer; - isc_result_t result; - isc_time_t now; - - /* - * Create a new 'type' timer managed by 'manager'. The timers - * parameters are specified by 'expires' and 'interval'. Events - * will be posted to 'task' and when dispatched 'action' will be - * called with 'arg' as the arg value. The new timer is returned - * in 'timerp'. - */ - - REQUIRE(VALID_MANAGER(manager)); - REQUIRE(task != NULL); - REQUIRE(action != NULL); - if (expires == NULL) - expires = isc_time_epoch; - if (interval == NULL) - interval = isc_interval_zero; - REQUIRE(type == isc_timertype_inactive || - !(isc_time_isepoch(expires) && isc_interval_iszero(interval))); - REQUIRE(timerp != NULL && *timerp == NULL); - REQUIRE(type != isc_timertype_limited || - !(isc_time_isepoch(expires) || isc_interval_iszero(interval))); - - /* - * Get current time. - */ - if (type != isc_timertype_inactive) { - TIME_NOW(&now); - } else { - /* - * We don't have to do this, but it keeps the compiler from - * complaining about "now" possibly being used without being - * set, even though it will never actually happen. - */ - isc_time_settoepoch(&now); - } - - - timer = isc_mem_get(manager->mctx, sizeof(*timer)); - if (timer == NULL) - return (ISC_R_NOMEMORY); - - timer->manager = manager; - timer->references = 1; - - if (type == isc_timertype_once && !isc_interval_iszero(interval)) { - result = isc_time_add(&now, interval, &timer->idle); - if (result != ISC_R_SUCCESS) { - isc_mem_put(manager->mctx, timer, sizeof(*timer)); - return (result); - } - } else - isc_time_settoepoch(&timer->idle); - - timer->type = type; - timer->expires = *expires; - timer->interval = *interval; - timer->task = NULL; - isc_task_attach(task, &timer->task); - timer->action = action; - /* - * Removing the const attribute from "arg" is the best of two - * evils here. If the timer->arg member is made const, then - * it affects a great many recipients of the timer event - * which did not pass in an "arg" that was truly const. - * Changing isc_timer_create() to not have "arg" prototyped as const, - * though, can cause compilers warnings for calls that *do* - * have a truly const arg. The caller will have to carefully - * keep track of whether arg started as a true const. - */ - DE_CONST(arg, timer->arg); - timer->index = 0; - result = isc_mutex_init(&timer->lock); - if (result != ISC_R_SUCCESS) { - isc_task_detach(&timer->task); - isc_mem_put(manager->mctx, timer, sizeof(*timer)); - return (result); - } - ISC_LINK_INIT(timer, link); - timer->common.impmagic = TIMER_MAGIC; - timer->common.magic = ISCAPI_TIMER_MAGIC; - timer->common.methods = (isc_timermethods_t *)&timermethods; - - LOCK(&manager->lock); - - /* - * Note we don't have to lock the timer like we normally would because - * there are no external references to it yet. - */ - - if (type != isc_timertype_inactive) - result = schedule(timer, &now, ISC_TRUE); - else - result = ISC_R_SUCCESS; - if (result == ISC_R_SUCCESS) - APPEND(manager->timers, timer, link); - - UNLOCK(&manager->lock); - - if (result != ISC_R_SUCCESS) { - timer->common.impmagic = 0; - timer->common.magic = 0; - DESTROYLOCK(&timer->lock); - isc_task_detach(&timer->task); - isc_mem_put(manager->mctx, timer, sizeof(*timer)); - return (result); - } - - *timerp = (isc_timer_t *)timer; - - return (ISC_R_SUCCESS); -} - -ISC_TIMERFUNC_SCOPE isc_result_t -isc__timer_reset(isc_timer_t *timer0, isc_timertype_t type, - isc_time_t *expires, isc_interval_t *interval, - isc_boolean_t purge) -{ - isc__timer_t *timer = (isc__timer_t *)timer0; - isc_time_t now; - isc__timermgr_t *manager; - isc_result_t result; - - /* - * Change the timer's type, expires, and interval values to the given - * values. If 'purge' is ISC_TRUE, any pending events from this timer - * are purged from its task's event queue. - */ - - REQUIRE(VALID_TIMER(timer)); - manager = timer->manager; - REQUIRE(VALID_MANAGER(manager)); - - if (expires == NULL) - expires = isc_time_epoch; - if (interval == NULL) - interval = isc_interval_zero; - REQUIRE(type == isc_timertype_inactive || - !(isc_time_isepoch(expires) && isc_interval_iszero(interval))); - REQUIRE(type != isc_timertype_limited || - !(isc_time_isepoch(expires) || isc_interval_iszero(interval))); - - /* - * Get current time. - */ - if (type != isc_timertype_inactive) { - TIME_NOW(&now); - } else { - /* - * We don't have to do this, but it keeps the compiler from - * complaining about "now" possibly being used without being - * set, even though it will never actually happen. - */ - isc_time_settoepoch(&now); - } - - LOCK(&manager->lock); - LOCK(&timer->lock); - - if (purge) - (void)isc_task_purgerange(timer->task, - timer, - ISC_TIMEREVENT_FIRSTEVENT, - ISC_TIMEREVENT_LASTEVENT, - NULL); - timer->type = type; - timer->expires = *expires; - timer->interval = *interval; - if (type == isc_timertype_once && !isc_interval_iszero(interval)) { - result = isc_time_add(&now, interval, &timer->idle); - } else { - isc_time_settoepoch(&timer->idle); - result = ISC_R_SUCCESS; - } - - if (result == ISC_R_SUCCESS) { - if (type == isc_timertype_inactive) { - deschedule(timer); - result = ISC_R_SUCCESS; - } else - result = schedule(timer, &now, ISC_TRUE); - } - - UNLOCK(&timer->lock); - UNLOCK(&manager->lock); - - return (result); -} - -ISC_TIMERFUNC_SCOPE isc_timertype_t -isc__timer_gettype(isc_timer_t *timer0) { - isc__timer_t *timer = (isc__timer_t *)timer0; - isc_timertype_t t; - - REQUIRE(VALID_TIMER(timer)); - - LOCK(&timer->lock); - t = timer->type; - UNLOCK(&timer->lock); - - return (t); -} - -ISC_TIMERFUNC_SCOPE isc_result_t -isc__timer_touch(isc_timer_t *timer0) { - isc__timer_t *timer = (isc__timer_t *)timer0; - isc_result_t result; - isc_time_t now; - - /* - * Set the last-touched time of 'timer' to the current time. - */ - - REQUIRE(VALID_TIMER(timer)); - - LOCK(&timer->lock); - - /* - * We'd like to - * - * REQUIRE(timer->type == isc_timertype_once); - * - * but we cannot without locking the manager lock too, which we - * don't want to do. - */ - - TIME_NOW(&now); - result = isc_time_add(&now, &timer->interval, &timer->idle); - - UNLOCK(&timer->lock); - - return (result); -} - -ISC_TIMERFUNC_SCOPE void -isc__timer_attach(isc_timer_t *timer0, isc_timer_t **timerp) { - isc__timer_t *timer = (isc__timer_t *)timer0; - - /* - * Attach *timerp to timer. - */ - - REQUIRE(VALID_TIMER(timer)); - REQUIRE(timerp != NULL && *timerp == NULL); - - LOCK(&timer->lock); - timer->references++; - UNLOCK(&timer->lock); - - *timerp = (isc_timer_t *)timer; -} - -ISC_TIMERFUNC_SCOPE void -isc__timer_detach(isc_timer_t **timerp) { - isc__timer_t *timer; - isc_boolean_t free_timer = ISC_FALSE; - - /* - * Detach *timerp from its timer. - */ - - REQUIRE(timerp != NULL); - timer = (isc__timer_t *)*timerp; - REQUIRE(VALID_TIMER(timer)); - - LOCK(&timer->lock); - REQUIRE(timer->references > 0); - timer->references--; - if (timer->references == 0) - free_timer = ISC_TRUE; - UNLOCK(&timer->lock); - - if (free_timer) - destroy(timer); - - *timerp = NULL; -} - -static void -dispatch(isc__timermgr_t *manager, isc_time_t *now) { - isc_boolean_t done = ISC_FALSE, post_event, need_schedule; - isc_timerevent_t *event; - isc_eventtype_t type = 0; - isc__timer_t *timer; - isc_result_t result; - isc_boolean_t idle; - - /*! - * The caller must be holding the manager lock. - */ - - while (manager->nscheduled > 0 && !done) { - timer = isc_heap_element(manager->heap, 1); - INSIST(timer->type != isc_timertype_inactive); - if (isc_time_compare(now, &timer->due) >= 0) { - if (timer->type == isc_timertype_ticker) { - type = ISC_TIMEREVENT_TICK; - post_event = ISC_TRUE; - need_schedule = ISC_TRUE; - } else if (timer->type == isc_timertype_limited) { - int cmp; - cmp = isc_time_compare(now, &timer->expires); - if (cmp >= 0) { - type = ISC_TIMEREVENT_LIFE; - post_event = ISC_TRUE; - need_schedule = ISC_FALSE; - } else { - type = ISC_TIMEREVENT_TICK; - post_event = ISC_TRUE; - need_schedule = ISC_TRUE; - } - } else if (!isc_time_isepoch(&timer->expires) && - isc_time_compare(now, - &timer->expires) >= 0) { - type = ISC_TIMEREVENT_LIFE; - post_event = ISC_TRUE; - need_schedule = ISC_FALSE; - } else { - idle = ISC_FALSE; - - LOCK(&timer->lock); - if (!isc_time_isepoch(&timer->idle) && - isc_time_compare(now, - &timer->idle) >= 0) { - idle = ISC_TRUE; - } - UNLOCK(&timer->lock); - if (idle) { - type = ISC_TIMEREVENT_IDLE; - post_event = ISC_TRUE; - need_schedule = ISC_FALSE; - } else { - /* - * Idle timer has been touched; - * reschedule. - */ - XTRACEID(isc_msgcat_get(isc_msgcat, - ISC_MSGSET_TIMER, - ISC_MSG_IDLERESCHED, - "idle reschedule"), - timer); - post_event = ISC_FALSE; - need_schedule = ISC_TRUE; - } - } - - if (post_event) { - XTRACEID(isc_msgcat_get(isc_msgcat, - ISC_MSGSET_TIMER, - ISC_MSG_POSTING, - "posting"), timer); - /* - * XXX We could preallocate this event. - */ - event = (isc_timerevent_t *)isc_event_allocate(manager->mctx, - timer, - type, - timer->action, - timer->arg, - sizeof(*event)); - - if (event != NULL) { - event->due = timer->due; - isc_task_send(timer->task, - ISC_EVENT_PTR(&event)); - } else - UNEXPECTED_ERROR(__FILE__, __LINE__, "%s", - isc_msgcat_get(isc_msgcat, - ISC_MSGSET_TIMER, - ISC_MSG_EVENTNOTALLOC, - "couldn't " - "allocate event")); - } - - timer->index = 0; - isc_heap_delete(manager->heap, 1); - manager->nscheduled--; - - if (need_schedule) { - result = schedule(timer, now, ISC_FALSE); - if (result != ISC_R_SUCCESS) - UNEXPECTED_ERROR(__FILE__, __LINE__, - "%s: %u", - isc_msgcat_get(isc_msgcat, - ISC_MSGSET_TIMER, - ISC_MSG_SCHEDFAIL, - "couldn't schedule " - "timer"), - result); - } - } else { - manager->due = timer->due; - done = ISC_TRUE; - } - } -} - -#ifdef USE_TIMER_THREAD -static isc_threadresult_t -#ifdef _WIN32 /* XXXDCL */ -WINAPI -#endif -run(void *uap) { - isc__timermgr_t *manager = uap; - isc_time_t now; - isc_result_t result; - - LOCK(&manager->lock); - while (!manager->done) { - TIME_NOW(&now); - - XTRACETIME(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_RUNNING, - "running"), now); - - dispatch(manager, &now); - - if (manager->nscheduled > 0) { - XTRACETIME2(isc_msgcat_get(isc_msgcat, - ISC_MSGSET_GENERAL, - ISC_MSG_WAITUNTIL, - "waituntil"), - manager->due, now); - result = WAITUNTIL(&manager->wakeup, &manager->lock, &manager->due); - INSIST(result == ISC_R_SUCCESS || - result == ISC_R_TIMEDOUT); - } else { - XTRACETIME(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_WAIT, "wait"), now); - WAIT(&manager->wakeup, &manager->lock); - } - XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER, - ISC_MSG_WAKEUP, "wakeup")); - } - UNLOCK(&manager->lock); - -#ifdef OPENSSL_LEAKS - ERR_remove_state(0); -#endif - - return ((isc_threadresult_t)0); -} -#endif /* USE_TIMER_THREAD */ - -static isc_boolean_t -sooner(void *v1, void *v2) { - isc__timer_t *t1, *t2; - - t1 = v1; - t2 = v2; - REQUIRE(VALID_TIMER(t1)); - REQUIRE(VALID_TIMER(t2)); - - if (isc_time_compare(&t1->due, &t2->due) < 0) - return (ISC_TRUE); - return (ISC_FALSE); -} - -static void -set_index(void *what, unsigned int index) { - isc__timer_t *timer; - - timer = what; - REQUIRE(VALID_TIMER(timer)); - - timer->index = index; -} - -ISC_TIMERFUNC_SCOPE isc_result_t -isc__timermgr_create(isc_mem_t *mctx, isc_timermgr_t **managerp) { - isc__timermgr_t *manager; - isc_result_t result; - - /* - * Create a timer manager. - */ - - REQUIRE(managerp != NULL && *managerp == NULL); - -#ifdef USE_SHARED_MANAGER - if (timermgr != NULL) { - timermgr->refs++; - *managerp = (isc_timermgr_t *)timermgr; - return (ISC_R_SUCCESS); - } -#endif /* USE_SHARED_MANAGER */ - - manager = isc_mem_get(mctx, sizeof(*manager)); - if (manager == NULL) - return (ISC_R_NOMEMORY); - - manager->common.impmagic = TIMER_MANAGER_MAGIC; - manager->common.magic = ISCAPI_TIMERMGR_MAGIC; - manager->common.methods = (isc_timermgrmethods_t *)&timermgrmethods; - manager->mctx = NULL; - manager->done = ISC_FALSE; - INIT_LIST(manager->timers); - manager->nscheduled = 0; - isc_time_settoepoch(&manager->due); - manager->heap = NULL; - result = isc_heap_create(mctx, sooner, set_index, 0, &manager->heap); - if (result != ISC_R_SUCCESS) { - INSIST(result == ISC_R_NOMEMORY); - isc_mem_put(mctx, manager, sizeof(*manager)); - return (ISC_R_NOMEMORY); - } - result = isc_mutex_init(&manager->lock); - if (result != ISC_R_SUCCESS) { - isc_heap_destroy(&manager->heap); - isc_mem_put(mctx, manager, sizeof(*manager)); - return (result); - } - isc_mem_attach(mctx, &manager->mctx); -#ifdef USE_TIMER_THREAD - if (isc_condition_init(&manager->wakeup) != ISC_R_SUCCESS) { - isc_mem_detach(&manager->mctx); - DESTROYLOCK(&manager->lock); - isc_heap_destroy(&manager->heap); - isc_mem_put(mctx, manager, sizeof(*manager)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_condition_init() %s", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed")); - return (ISC_R_UNEXPECTED); - } - if (isc_thread_create(run, manager, &manager->thread) != - ISC_R_SUCCESS) { - isc_mem_detach(&manager->mctx); - (void)isc_condition_destroy(&manager->wakeup); - DESTROYLOCK(&manager->lock); - isc_heap_destroy(&manager->heap); - isc_mem_put(mctx, manager, sizeof(*manager)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_thread_create() %s", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed")); - return (ISC_R_UNEXPECTED); - } -#endif -#ifdef USE_SHARED_MANAGER - manager->refs = 1; - timermgr = manager; -#endif /* USE_SHARED_MANAGER */ - - *managerp = (isc_timermgr_t *)manager; - - return (ISC_R_SUCCESS); -} - -ISC_TIMERFUNC_SCOPE void -isc__timermgr_poke(isc_timermgr_t *manager0) { -#ifdef USE_TIMER_THREAD - isc__timermgr_t *manager = (isc__timermgr_t *)manager0; - - REQUIRE(VALID_MANAGER(manager)); - - SIGNAL(&manager->wakeup); -#else - UNUSED(manager0); -#endif -} - -ISC_TIMERFUNC_SCOPE void -isc__timermgr_destroy(isc_timermgr_t **managerp) { - isc__timermgr_t *manager; - isc_mem_t *mctx; - - /* - * Destroy a timer manager. - */ - - REQUIRE(managerp != NULL); - manager = (isc__timermgr_t *)*managerp; - REQUIRE(VALID_MANAGER(manager)); - - LOCK(&manager->lock); - -#ifdef USE_SHARED_MANAGER - manager->refs--; - if (manager->refs > 0) { - UNLOCK(&manager->lock); - *managerp = NULL; - return; - } - timermgr = NULL; -#endif /* USE_SHARED_MANAGER */ - -#ifndef USE_TIMER_THREAD - isc__timermgr_dispatch((isc_timermgr_t *)manager); -#endif - - REQUIRE(EMPTY(manager->timers)); - manager->done = ISC_TRUE; - -#ifdef USE_TIMER_THREAD - XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER, - ISC_MSG_SIGNALDESTROY, "signal (destroy)")); - SIGNAL(&manager->wakeup); -#endif /* USE_TIMER_THREAD */ - - UNLOCK(&manager->lock); - -#ifdef USE_TIMER_THREAD - /* - * Wait for thread to exit. - */ - if (isc_thread_join(manager->thread, NULL) != ISC_R_SUCCESS) - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_thread_join() %s", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed")); -#endif /* USE_TIMER_THREAD */ - - /* - * Clean up. - */ -#ifdef USE_TIMER_THREAD - (void)isc_condition_destroy(&manager->wakeup); -#endif /* USE_TIMER_THREAD */ - DESTROYLOCK(&manager->lock); - isc_heap_destroy(&manager->heap); - manager->common.impmagic = 0; - manager->common.magic = 0; - mctx = manager->mctx; - isc_mem_put(mctx, manager, sizeof(*manager)); - isc_mem_detach(&mctx); - - *managerp = NULL; - -#ifdef USE_SHARED_MANAGER - timermgr = NULL; -#endif -} - -#ifndef USE_TIMER_THREAD -isc_result_t -isc__timermgr_nextevent(isc_timermgr_t *manager0, isc_time_t *when) { - isc__timermgr_t *manager = (isc__timermgr_t *)manager0; - -#ifdef USE_SHARED_MANAGER - if (manager == NULL) - manager = timermgr; -#endif - if (manager == NULL || manager->nscheduled == 0) - return (ISC_R_NOTFOUND); - *when = manager->due; - return (ISC_R_SUCCESS); -} - -void -isc__timermgr_dispatch(isc_timermgr_t *manager0) { - isc__timermgr_t *manager = (isc__timermgr_t *)manager0; - isc_time_t now; - -#ifdef USE_SHARED_MANAGER - if (manager == NULL) - manager = timermgr; -#endif - if (manager == NULL) - return; - TIME_NOW(&now); - dispatch(manager, &now); -} -#endif /* USE_TIMER_THREAD */ - -#ifdef USE_TIMERIMPREGISTER -isc_result_t -isc__timer_register() { - return (isc_timer_register(isc__timermgr_create)); -} -#endif diff --git a/lib/isc/timer_api.c b/lib/isc/timer_api.c deleted file mode 100644 index 97e62b3f0ec4..000000000000 --- a/lib/isc/timer_api.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: timer_api.c,v 1.4 2009/09/02 23:48:02 tbox Exp $ */ - -#include - -#include - -#include -#include -#include -#include -#include -#include - -static isc_mutex_t createlock; -static isc_once_t once = ISC_ONCE_INIT; -static isc_timermgrcreatefunc_t timermgr_createfunc = NULL; - -static void -initialize(void) { - RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS); -} - -isc_result_t -isc_timer_register(isc_timermgrcreatefunc_t createfunc) { - isc_result_t result = ISC_R_SUCCESS; - - RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS); - - LOCK(&createlock); - if (timermgr_createfunc == NULL) - timermgr_createfunc = createfunc; - else - result = ISC_R_EXISTS; - UNLOCK(&createlock); - - return (result); -} - -isc_result_t -isc_timermgr_createinctx(isc_mem_t *mctx, isc_appctx_t *actx, - isc_timermgr_t **managerp) -{ - isc_result_t result; - - LOCK(&createlock); - - REQUIRE(timermgr_createfunc != NULL); - result = (*timermgr_createfunc)(mctx, managerp); - - UNLOCK(&createlock); - - if (result == ISC_R_SUCCESS) - isc_appctx_settimermgr(actx, *managerp); - - return (result); -} - -isc_result_t -isc_timermgr_create(isc_mem_t *mctx, isc_timermgr_t **managerp) { - isc_result_t result; - - LOCK(&createlock); - - REQUIRE(timermgr_createfunc != NULL); - result = (*timermgr_createfunc)(mctx, managerp); - - UNLOCK(&createlock); - - return (result); -} - -void -isc_timermgr_destroy(isc_timermgr_t **managerp) { - REQUIRE(*managerp != NULL && ISCAPI_TIMERMGR_VALID(*managerp)); - - (*managerp)->methods->destroy(managerp); - - ENSURE(*managerp == NULL); -} - -isc_result_t -isc_timer_create(isc_timermgr_t *manager, isc_timertype_t type, - isc_time_t *expires, isc_interval_t *interval, - isc_task_t *task, isc_taskaction_t action, const void *arg, - isc_timer_t **timerp) -{ - REQUIRE(ISCAPI_TIMERMGR_VALID(manager)); - - return (manager->methods->timercreate(manager, type, expires, - interval, task, action, arg, - timerp)); -} - -void -isc_timer_attach(isc_timer_t *timer, isc_timer_t **timerp) { - REQUIRE(ISCAPI_TIMER_VALID(timer)); - REQUIRE(timerp != NULL && *timerp == NULL); - - timer->methods->attach(timer, timerp); - - ENSURE(*timerp == timer); -} - -void -isc_timer_detach(isc_timer_t **timerp) { - REQUIRE(timerp != NULL && ISCAPI_TIMER_VALID(*timerp)); - - (*timerp)->methods->detach(timerp); - - ENSURE(*timerp == NULL); -} - -isc_result_t -isc_timer_reset(isc_timer_t *timer, isc_timertype_t type, - isc_time_t *expires, isc_interval_t *interval, - isc_boolean_t purge) -{ - REQUIRE(ISCAPI_TIMER_VALID(timer)); - - return (timer->methods->reset(timer, type, expires, interval, purge)); -} - -isc_result_t -isc_timer_touch(isc_timer_t *timer) { - REQUIRE(ISCAPI_TIMER_VALID(timer)); - - return (timer->methods->touch(timer)); -} diff --git a/lib/isc/timer_p.h b/lib/isc/timer_p.h deleted file mode 100644 index d6f7c996c7e2..000000000000 --- a/lib/isc/timer_p.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: timer_p.h,v 1.12 2009/09/02 23:48:02 tbox Exp $ */ - -#ifndef ISC_TIMER_P_H -#define ISC_TIMER_P_H - -/*! \file */ - -isc_result_t -isc__timermgr_nextevent(isc_timermgr_t *timermgr, isc_time_t *when); - -void -isc__timermgr_dispatch(isc_timermgr_t *timermgr); - -#endif /* ISC_TIMER_P_H */ diff --git a/lib/isc/unix/app.c b/lib/isc/unix/app.c deleted file mode 100644 index 5393be942504..000000000000 --- a/lib/isc/unix/app.c +++ /dev/null @@ -1,946 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: app.c,v 1.64 2009/11/04 05:58:46 marka Exp $ */ - -/*! \file */ - -#include - -#include /* Openserver 5.0.6A and FD_SETSIZE */ -#include - -#include -#include -#include -#include -#include -#include -#ifdef HAVE_EPOLL -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/*% - * For BIND9 internal applications built with threads, we use a single app - * context and let multiple worker, I/O, timer threads do actual jobs. - * For other cases (including BIND9 built without threads) an app context acts - * as an event loop dispatching various events. - */ -#if defined(ISC_PLATFORM_USETHREADS) && defined(BIND9) -#define USE_THREADS_SINGLECTX -#endif - -#ifdef ISC_PLATFORM_USETHREADS -#include -#endif - -#ifndef USE_THREADS_SINGLECTX -#include "../timer_p.h" -#include "../task_p.h" -#include "socket_p.h" -#endif /* USE_THREADS_SINGLECTX */ - -#ifdef ISC_PLATFORM_USETHREADS -static pthread_t blockedthread; -#endif /* ISC_PLATFORM_USETHREADS */ - -/*% - * The following can be either static or public, depending on build environment. - */ - -#ifdef BIND9 -#define ISC_APPFUNC_SCOPE -#else -#define ISC_APPFUNC_SCOPE static -#endif - -ISC_APPFUNC_SCOPE isc_result_t isc__app_start(void); -ISC_APPFUNC_SCOPE isc_result_t isc__app_ctxstart(isc_appctx_t *ctx); -ISC_APPFUNC_SCOPE isc_result_t isc__app_onrun(isc_mem_t *mctx, - isc_task_t *task, - isc_taskaction_t action, - void *arg); -ISC_APPFUNC_SCOPE isc_result_t isc__app_ctxrun(isc_appctx_t *ctx); -ISC_APPFUNC_SCOPE isc_result_t isc__app_run(void); -ISC_APPFUNC_SCOPE isc_result_t isc__app_ctxshutdown(isc_appctx_t *ctx); -ISC_APPFUNC_SCOPE isc_result_t isc__app_shutdown(void); -ISC_APPFUNC_SCOPE isc_result_t isc__app_reload(void); -ISC_APPFUNC_SCOPE isc_result_t isc__app_ctxsuspend(isc_appctx_t *ctx); -ISC_APPFUNC_SCOPE void isc__app_ctxfinish(isc_appctx_t *ctx); -ISC_APPFUNC_SCOPE void isc__app_finish(void); -ISC_APPFUNC_SCOPE void isc__app_block(void); -ISC_APPFUNC_SCOPE void isc__app_unblock(void); -ISC_APPFUNC_SCOPE isc_result_t isc__appctx_create(isc_mem_t *mctx, - isc_appctx_t **ctxp); -ISC_APPFUNC_SCOPE void isc__appctx_destroy(isc_appctx_t **ctxp); -ISC_APPFUNC_SCOPE void isc__appctx_settaskmgr(isc_appctx_t *ctx, - isc_taskmgr_t *taskmgr); -ISC_APPFUNC_SCOPE void isc__appctx_setsocketmgr(isc_appctx_t *ctx, - isc_socketmgr_t *socketmgr); -ISC_APPFUNC_SCOPE void isc__appctx_settimermgr(isc_appctx_t *ctx, - isc_timermgr_t *timermgr); - -/* - * The application context of this module. This implementation actually - * doesn't use it. (This may change in the future). - */ -#define APPCTX_MAGIC ISC_MAGIC('A', 'p', 'c', 'x') -#define VALID_APPCTX(c) ISC_MAGIC_VALID(c, APPCTX_MAGIC) - -typedef struct isc__appctx { - isc_appctx_t common; - isc_mem_t *mctx; - isc_mutex_t lock; - isc_eventlist_t on_run; - isc_boolean_t shutdown_requested; - isc_boolean_t running; - - /*! - * We assume that 'want_shutdown' can be read and written atomically. - */ - isc_boolean_t want_shutdown; - /* - * We assume that 'want_reload' can be read and written atomically. - */ - isc_boolean_t want_reload; - - isc_boolean_t blocked; - - isc_taskmgr_t *taskmgr; - isc_socketmgr_t *socketmgr; - isc_timermgr_t *timermgr; -} isc__appctx_t; - -static isc__appctx_t isc_g_appctx; - -static struct { - isc_appmethods_t methods; - - /*% - * The following are defined just for avoiding unused static functions. - */ -#ifndef BIND9 - void *run, *shutdown, *start, *onrun, *reload, *finish, - *block, *unblock; -#endif -} appmethods = { - { - isc__appctx_destroy, - isc__app_ctxstart, - isc__app_ctxrun, - isc__app_ctxsuspend, - isc__app_ctxshutdown, - isc__app_ctxfinish, - isc__appctx_settaskmgr, - isc__appctx_setsocketmgr, - isc__appctx_settimermgr - } -#ifndef BIND9 - , - (void *)isc__app_run, (void *)isc__app_shutdown, - (void *)isc__app_start, (void *)isc__app_onrun, (void *)isc__app_reload, - (void *)isc__app_finish, (void *)isc__app_block, - (void *)isc__app_unblock -#endif -}; - -#ifdef HAVE_LINUXTHREADS -/*! - * Linux has sigwait(), but it appears to prevent signal handlers from - * running, even if they're not in the set being waited for. This makes - * it impossible to get the default actions for SIGILL, SIGSEGV, etc. - * Instead of messing with it, we just use sigsuspend() instead. - */ -#undef HAVE_SIGWAIT -/*! - * We need to remember which thread is the main thread... - */ -static pthread_t main_thread; -#endif - -#ifndef HAVE_SIGWAIT -static void -exit_action(int arg) { - UNUSED(arg); - isc_g_appctx.want_shutdown = ISC_TRUE; -} - -static void -reload_action(int arg) { - UNUSED(arg); - isc_g_appctx.want_reload = ISC_TRUE; -} -#endif - -static isc_result_t -handle_signal(int sig, void (*handler)(int)) { - struct sigaction sa; - char strbuf[ISC_STRERRORSIZE]; - - memset(&sa, 0, sizeof(sa)); - sa.sa_handler = handler; - - if (sigfillset(&sa.sa_mask) != 0 || - sigaction(sig, &sa, NULL) < 0) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - isc_msgcat_get(isc_msgcat, ISC_MSGSET_APP, - ISC_MSG_SIGNALSETUP, - "handle_signal() %d setup: %s"), - sig, strbuf); - return (ISC_R_UNEXPECTED); - } - - return (ISC_R_SUCCESS); -} - -ISC_APPFUNC_SCOPE isc_result_t -isc__app_ctxstart(isc_appctx_t *ctx0) { - isc__appctx_t *ctx = (isc__appctx_t *)ctx0; - isc_result_t result; - - REQUIRE(VALID_APPCTX(ctx)); - - /* - * Start an ISC library application. - */ - -#ifdef NEED_PTHREAD_INIT - /* - * BSDI 3.1 seg faults in pthread_sigmask() if we don't do this. - */ - presult = pthread_init(); - if (presult != 0) { - isc__strerror(presult, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_app_start() pthread_init: %s", strbuf); - return (ISC_R_UNEXPECTED); - } -#endif - -#ifdef HAVE_LINUXTHREADS - main_thread = pthread_self(); -#endif - - result = isc_mutex_init(&ctx->lock); - if (result != ISC_R_SUCCESS) - return (result); - - ISC_LIST_INIT(ctx->on_run); - - ctx->shutdown_requested = ISC_FALSE; - ctx->running = ISC_FALSE; - ctx->want_shutdown = ISC_FALSE; - ctx->want_reload = ISC_FALSE; - ctx->blocked = ISC_FALSE; - - return (ISC_R_SUCCESS); -} - -ISC_APPFUNC_SCOPE isc_result_t -isc__app_start(void) { - isc_result_t result; - int presult; - sigset_t sset; - char strbuf[ISC_STRERRORSIZE]; - - isc_g_appctx.common.impmagic = APPCTX_MAGIC; - isc_g_appctx.common.magic = ISCAPI_APPCTX_MAGIC; - isc_g_appctx.common.methods = &appmethods.methods; - isc_g_appctx.mctx = NULL; - /* The remaining members will be initialized in ctxstart() */ - - result = isc__app_ctxstart((isc_appctx_t *)&isc_g_appctx); - if (result != ISC_R_SUCCESS) - return (result); - -#ifndef HAVE_SIGWAIT - /* - * Install do-nothing handlers for SIGINT and SIGTERM. - * - * We install them now because BSDI 3.1 won't block - * the default actions, regardless of what we do with - * pthread_sigmask(). - */ - result = handle_signal(SIGINT, exit_action); - if (result != ISC_R_SUCCESS) - return (result); - result = handle_signal(SIGTERM, exit_action); - if (result != ISC_R_SUCCESS) - return (result); -#endif - - /* - * Always ignore SIGPIPE. - */ - result = handle_signal(SIGPIPE, SIG_IGN); - if (result != ISC_R_SUCCESS) - return (result); - - /* - * On Solaris 2, delivery of a signal whose action is SIG_IGN - * will not cause sigwait() to return. We may have inherited - * unexpected actions for SIGHUP, SIGINT, and SIGTERM from our parent - * process (e.g, Solaris cron). Set an action of SIG_DFL to make - * sure sigwait() works as expected. Only do this for SIGTERM and - * SIGINT if we don't have sigwait(), since a different handler is - * installed above. - */ - result = handle_signal(SIGHUP, SIG_DFL); - if (result != ISC_R_SUCCESS) - return (result); - -#ifdef HAVE_SIGWAIT - result = handle_signal(SIGTERM, SIG_DFL); - if (result != ISC_R_SUCCESS) - return (result); - result = handle_signal(SIGINT, SIG_DFL); - if (result != ISC_R_SUCCESS) - return (result); -#endif - -#ifdef ISC_PLATFORM_USETHREADS - /* - * Block SIGHUP, SIGINT, SIGTERM. - * - * If isc_app_start() is called from the main thread before any other - * threads have been created, then the pthread_sigmask() call below - * will result in all threads having SIGHUP, SIGINT and SIGTERM - * blocked by default, ensuring that only the thread that calls - * sigwait() for them will get those signals. - */ - if (sigemptyset(&sset) != 0 || - sigaddset(&sset, SIGHUP) != 0 || - sigaddset(&sset, SIGINT) != 0 || - sigaddset(&sset, SIGTERM) != 0) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_app_start() sigsetops: %s", strbuf); - return (ISC_R_UNEXPECTED); - } - presult = pthread_sigmask(SIG_BLOCK, &sset, NULL); - if (presult != 0) { - isc__strerror(presult, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_app_start() pthread_sigmask: %s", - strbuf); - return (ISC_R_UNEXPECTED); - } -#else /* ISC_PLATFORM_USETHREADS */ - /* - * Unblock SIGHUP, SIGINT, SIGTERM. - * - * If we're not using threads, we need to make sure that SIGHUP, - * SIGINT and SIGTERM are not inherited as blocked from the parent - * process. - */ - if (sigemptyset(&sset) != 0 || - sigaddset(&sset, SIGHUP) != 0 || - sigaddset(&sset, SIGINT) != 0 || - sigaddset(&sset, SIGTERM) != 0) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_app_start() sigsetops: %s", strbuf); - return (ISC_R_UNEXPECTED); - } - presult = sigprocmask(SIG_UNBLOCK, &sset, NULL); - if (presult != 0) { - isc__strerror(presult, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_app_start() sigprocmask: %s", strbuf); - return (ISC_R_UNEXPECTED); - } -#endif /* ISC_PLATFORM_USETHREADS */ - - return (ISC_R_SUCCESS); -} - -ISC_APPFUNC_SCOPE isc_result_t -isc__app_onrun(isc_mem_t *mctx, isc_task_t *task, isc_taskaction_t action, - void *arg) -{ - isc_event_t *event; - isc_task_t *cloned_task = NULL; - isc_result_t result; - - LOCK(&isc_g_appctx.lock); - - if (isc_g_appctx.running) { - result = ISC_R_ALREADYRUNNING; - goto unlock; - } - - /* - * Note that we store the task to which we're going to send the event - * in the event's "sender" field. - */ - isc_task_attach(task, &cloned_task); - event = isc_event_allocate(mctx, cloned_task, ISC_APPEVENT_SHUTDOWN, - action, arg, sizeof(*event)); - if (event == NULL) { - result = ISC_R_NOMEMORY; - goto unlock; - } - - ISC_LIST_APPEND(isc_g_appctx.on_run, event, ev_link); - - result = ISC_R_SUCCESS; - - unlock: - UNLOCK(&isc_g_appctx.lock); - - return (result); -} - -#ifndef USE_THREADS_SINGLECTX -/*! - * Event loop for nonthreaded programs. - */ -static isc_result_t -evloop(isc__appctx_t *ctx) { - isc_result_t result; - - while (!ctx->want_shutdown) { - int n; - isc_time_t when, now; - struct timeval tv, *tvp; - isc_socketwait_t *swait; - isc_boolean_t readytasks; - isc_boolean_t call_timer_dispatch = ISC_FALSE; - - /* - * Check the reload (or suspend) case first for exiting the - * loop as fast as possible in case: - * - the direct call to isc__taskmgr_dispatch() in - * isc__app_ctxrun() completes all the tasks so far, - * - there is thus currently no active task, and - * - there is a timer event - */ - if (ctx->want_reload) { - ctx->want_reload = ISC_FALSE; - return (ISC_R_RELOAD); - } - - readytasks = isc__taskmgr_ready(ctx->taskmgr); - if (readytasks) { - tv.tv_sec = 0; - tv.tv_usec = 0; - tvp = &tv; - call_timer_dispatch = ISC_TRUE; - } else { - result = isc__timermgr_nextevent(ctx->timermgr, &when); - if (result != ISC_R_SUCCESS) - tvp = NULL; - else { - isc_uint64_t us; - - TIME_NOW(&now); - us = isc_time_microdiff(&when, &now); - if (us == 0) - call_timer_dispatch = ISC_TRUE; - tv.tv_sec = us / 1000000; - tv.tv_usec = us % 1000000; - tvp = &tv; - } - } - - swait = NULL; - n = isc__socketmgr_waitevents(ctx->socketmgr, tvp, &swait); - - if (n == 0 || call_timer_dispatch) { - /* - * We call isc__timermgr_dispatch() only when - * necessary, in order to reduce overhead. If the - * select() call indicates a timeout, we need the - * dispatch. Even if not, if we set the 0-timeout - * for the select() call, we need to check the timer - * events. In the 'readytasks' case, there may be no - * timeout event actually, but there is no other way - * to reduce the overhead. - * Note that we do not have to worry about the case - * where a new timer is inserted during the select() - * call, since this loop only runs in the non-thread - * mode. - */ - isc__timermgr_dispatch(ctx->timermgr); - } - if (n > 0) - (void)isc__socketmgr_dispatch(ctx->socketmgr, swait); - (void)isc__taskmgr_dispatch(ctx->taskmgr); - } - return (ISC_R_SUCCESS); -} -#endif /* USE_THREADS_SINGLECTX */ - -#ifndef ISC_PLATFORM_USETHREADS -/* - * This is a gross hack to support waiting for condition - * variables in nonthreaded programs in a limited way; - * see lib/isc/nothreads/include/isc/condition.h. - * We implement isc_condition_wait() by entering the - * event loop recursively until the want_shutdown flag - * is set by isc_condition_signal(). - */ - -/*! - * \brief True if we are currently executing in the recursive - * event loop. - */ -static isc_boolean_t in_recursive_evloop = ISC_FALSE; - -/*! - * \brief True if we are exiting the event loop as the result of - * a call to isc_condition_signal() rather than a shutdown - * or reload. - */ -static isc_boolean_t signalled = ISC_FALSE; - -isc_result_t -isc__nothread_wait_hack(isc_condition_t *cp, isc_mutex_t *mp) { - isc_result_t result; - - UNUSED(cp); - UNUSED(mp); - - INSIST(!in_recursive_evloop); - in_recursive_evloop = ISC_TRUE; - - INSIST(*mp == 1); /* Mutex must be locked on entry. */ - --*mp; - - result = evloop(&isc_g_appctx); - if (result == ISC_R_RELOAD) - isc_g_appctx.want_reload = ISC_TRUE; - if (signalled) { - isc_g_appctx.want_shutdown = ISC_FALSE; - signalled = ISC_FALSE; - } - - ++*mp; - in_recursive_evloop = ISC_FALSE; - return (ISC_R_SUCCESS); -} - -isc_result_t -isc__nothread_signal_hack(isc_condition_t *cp) { - - UNUSED(cp); - - INSIST(in_recursive_evloop); - - isc_g_appctx.want_shutdown = ISC_TRUE; - signalled = ISC_TRUE; - return (ISC_R_SUCCESS); -} - -#endif /* ISC_PLATFORM_USETHREADS */ - -ISC_APPFUNC_SCOPE isc_result_t -isc__app_ctxrun(isc_appctx_t *ctx0) { - isc__appctx_t *ctx = (isc__appctx_t *)ctx0; - int result; - isc_event_t *event, *next_event; - isc_task_t *task; -#ifdef USE_THREADS_SINGLECTX - sigset_t sset; - char strbuf[ISC_STRERRORSIZE]; -#ifdef HAVE_SIGWAIT - int sig; -#endif -#endif /* USE_THREADS_SINGLECTX */ - - REQUIRE(VALID_APPCTX(ctx)); - -#ifdef HAVE_LINUXTHREADS - REQUIRE(main_thread == pthread_self()); -#endif - - LOCK(&ctx->lock); - - if (!ctx->running) { - ctx->running = ISC_TRUE; - - /* - * Post any on-run events (in FIFO order). - */ - for (event = ISC_LIST_HEAD(ctx->on_run); - event != NULL; - event = next_event) { - next_event = ISC_LIST_NEXT(event, ev_link); - ISC_LIST_UNLINK(ctx->on_run, event, ev_link); - task = event->ev_sender; - event->ev_sender = NULL; - isc_task_sendanddetach(&task, &event); - } - - } - - UNLOCK(&ctx->lock); - -#ifndef HAVE_SIGWAIT - /* - * Catch SIGHUP. - * - * We do this here to ensure that the signal handler is installed - * (i.e. that it wasn't a "one-shot" handler). - */ - if (ctx == &isc_g_appctx) { - result = handle_signal(SIGHUP, reload_action); - if (result != ISC_R_SUCCESS) - return (ISC_R_SUCCESS); - } -#endif - -#ifdef USE_THREADS_SINGLECTX - /* - * When we are using multiple contexts, we don't rely on signals. - */ - if (ctx != &isc_g_appctx) - return (ISC_R_SUCCESS); - - /* - * There is no danger if isc_app_shutdown() is called before we wait - * for signals. Signals are blocked, so any such signal will simply - * be made pending and we will get it when we call sigwait(). - */ - - while (!ctx->want_shutdown) { -#ifdef HAVE_SIGWAIT - /* - * Wait for SIGHUP, SIGINT, or SIGTERM. - */ - if (sigemptyset(&sset) != 0 || - sigaddset(&sset, SIGHUP) != 0 || - sigaddset(&sset, SIGINT) != 0 || - sigaddset(&sset, SIGTERM) != 0) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_app_run() sigsetops: %s", strbuf); - return (ISC_R_UNEXPECTED); - } - -#ifndef HAVE_UNIXWARE_SIGWAIT - result = sigwait(&sset, &sig); - if (result == 0) { - if (sig == SIGINT || sig == SIGTERM) - ctx->want_shutdown = ISC_TRUE; - else if (sig == SIGHUP) - ctx->want_reload = ISC_TRUE; - } - -#else /* Using UnixWare sigwait semantics. */ - sig = sigwait(&sset); - if (sig >= 0) { - if (sig == SIGINT || sig == SIGTERM) - ctx->want_shutdown = ISC_TRUE; - else if (sig == SIGHUP) - ctx->want_reload = ISC_TRUE; - } - -#endif /* HAVE_UNIXWARE_SIGWAIT */ -#else /* Don't have sigwait(). */ - /* - * Listen for all signals. - */ - if (sigemptyset(&sset) != 0) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_app_run() sigsetops: %s", - strbuf); - return (ISC_R_UNEXPECTED); - } - result = sigsuspend(&sset); -#endif /* HAVE_SIGWAIT */ - - if (ctx->want_reload) { - ctx->want_reload = ISC_FALSE; - return (ISC_R_RELOAD); - } - - if (ctx->want_shutdown && ctx->blocked) - exit(1); - } - -#else /* USE_THREADS_SINGLECTX */ - - (void)isc__taskmgr_dispatch(ctx->taskmgr); - - result = evloop(ctx); - if (result != ISC_R_SUCCESS) - return (result); - -#endif /* USE_THREADS_SINGLECTX */ - - return (ISC_R_SUCCESS); -} - -ISC_APPFUNC_SCOPE isc_result_t -isc__app_run() { - return (isc__app_ctxrun((isc_appctx_t *)&isc_g_appctx)); -} - -ISC_APPFUNC_SCOPE isc_result_t -isc__app_ctxshutdown(isc_appctx_t *ctx0) { - isc__appctx_t *ctx = (isc__appctx_t *)ctx0; - isc_boolean_t want_kill = ISC_TRUE; - char strbuf[ISC_STRERRORSIZE]; - - REQUIRE(VALID_APPCTX(ctx)); - - LOCK(&ctx->lock); - - REQUIRE(ctx->running); - - if (ctx->shutdown_requested) - want_kill = ISC_FALSE; - else - ctx->shutdown_requested = ISC_TRUE; - - UNLOCK(&ctx->lock); - - if (want_kill) { - if (ctx != &isc_g_appctx) - ctx->want_shutdown = ISC_TRUE; - else { -#ifdef HAVE_LINUXTHREADS - int result; - - result = pthread_kill(main_thread, SIGTERM); - if (result != 0) { - isc__strerror(result, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_app_shutdown() " - "pthread_kill: %s", - strbuf); - return (ISC_R_UNEXPECTED); - } -#else - if (kill(getpid(), SIGTERM) < 0) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_app_shutdown() " - "kill: %s", strbuf); - return (ISC_R_UNEXPECTED); - } -#endif /* HAVE_LINUXTHREADS */ - } - } - - return (ISC_R_SUCCESS); -} - -ISC_APPFUNC_SCOPE isc_result_t -isc__app_shutdown() { - return (isc__app_ctxshutdown((isc_appctx_t *)&isc_g_appctx)); -} - -ISC_APPFUNC_SCOPE isc_result_t -isc__app_ctxsuspend(isc_appctx_t *ctx0) { - isc__appctx_t *ctx = (isc__appctx_t *)ctx0; - isc_boolean_t want_kill = ISC_TRUE; - char strbuf[ISC_STRERRORSIZE]; - - REQUIRE(VALID_APPCTX(ctx)); - - LOCK(&ctx->lock); - - REQUIRE(ctx->running); - - /* - * Don't send the reload signal if we're shutting down. - */ - if (ctx->shutdown_requested) - want_kill = ISC_FALSE; - - UNLOCK(&ctx->lock); - - if (want_kill) { - if (ctx != &isc_g_appctx) - ctx->want_reload = ISC_TRUE; - else { -#ifdef HAVE_LINUXTHREADS - int result; - - result = pthread_kill(main_thread, SIGHUP); - if (result != 0) { - isc__strerror(result, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_app_reload() " - "pthread_kill: %s", - strbuf); - return (ISC_R_UNEXPECTED); - } -#else - if (kill(getpid(), SIGHUP) < 0) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_app_reload() " - "kill: %s", strbuf); - return (ISC_R_UNEXPECTED); - } -#endif - } - } - - return (ISC_R_SUCCESS); -} - -ISC_APPFUNC_SCOPE isc_result_t -isc__app_reload(void) { - return (isc__app_ctxsuspend((isc_appctx_t *)&isc_g_appctx)); -} - -ISC_APPFUNC_SCOPE void -isc__app_ctxfinish(isc_appctx_t *ctx0) { - isc__appctx_t *ctx = (isc__appctx_t *)ctx0; - - REQUIRE(VALID_APPCTX(ctx)); - - DESTROYLOCK(&ctx->lock); -} - -ISC_APPFUNC_SCOPE void -isc__app_finish(void) { - isc__app_ctxfinish((isc_appctx_t *)&isc_g_appctx); -} - -ISC_APPFUNC_SCOPE void -isc__app_block(void) { -#ifdef ISC_PLATFORM_USETHREADS - sigset_t sset; -#endif /* ISC_PLATFORM_USETHREADS */ - REQUIRE(isc_g_appctx.running); - REQUIRE(!isc_g_appctx.blocked); - - isc_g_appctx.blocked = ISC_TRUE; -#ifdef ISC_PLATFORM_USETHREADS - blockedthread = pthread_self(); - RUNTIME_CHECK(sigemptyset(&sset) == 0 && - sigaddset(&sset, SIGINT) == 0 && - sigaddset(&sset, SIGTERM) == 0); - RUNTIME_CHECK(pthread_sigmask(SIG_UNBLOCK, &sset, NULL) == 0); -#endif /* ISC_PLATFORM_USETHREADS */ -} - -ISC_APPFUNC_SCOPE void -isc__app_unblock(void) { -#ifdef ISC_PLATFORM_USETHREADS - sigset_t sset; -#endif /* ISC_PLATFORM_USETHREADS */ - - REQUIRE(isc_g_appctx.running); - REQUIRE(isc_g_appctx.blocked); - - isc_g_appctx.blocked = ISC_FALSE; - -#ifdef ISC_PLATFORM_USETHREADS - REQUIRE(blockedthread == pthread_self()); - - RUNTIME_CHECK(sigemptyset(&sset) == 0 && - sigaddset(&sset, SIGINT) == 0 && - sigaddset(&sset, SIGTERM) == 0); - RUNTIME_CHECK(pthread_sigmask(SIG_BLOCK, &sset, NULL) == 0); -#endif /* ISC_PLATFORM_USETHREADS */ -} - -ISC_APPFUNC_SCOPE isc_result_t -isc__appctx_create(isc_mem_t *mctx, isc_appctx_t **ctxp) { - isc__appctx_t *ctx; - - REQUIRE(mctx != NULL); - REQUIRE(ctxp != NULL && *ctxp == NULL); - - ctx = isc_mem_get(mctx, sizeof(*ctx)); - if (ctx == NULL) - return (ISC_R_NOMEMORY); - - ctx->common.impmagic = APPCTX_MAGIC; - ctx->common.magic = ISCAPI_APPCTX_MAGIC; - ctx->common.methods = &appmethods.methods; - - ctx->mctx = NULL; - isc_mem_attach(mctx, &ctx->mctx); - - ctx->taskmgr = NULL; - ctx->socketmgr = NULL; - ctx->timermgr = NULL; - - *ctxp = (isc_appctx_t *)ctx; - - return (ISC_R_SUCCESS); -} - -ISC_APPFUNC_SCOPE void -isc__appctx_destroy(isc_appctx_t **ctxp) { - isc__appctx_t *ctx; - - REQUIRE(ctxp != NULL); - ctx = (isc__appctx_t *)*ctxp; - REQUIRE(VALID_APPCTX(ctx)); - - isc_mem_putanddetach(&ctx->mctx, ctx, sizeof(*ctx)); - - *ctxp = NULL; -} - -ISC_APPFUNC_SCOPE void -isc__appctx_settaskmgr(isc_appctx_t *ctx0, isc_taskmgr_t *taskmgr) { - isc__appctx_t *ctx = (isc__appctx_t *)ctx0; - - REQUIRE(VALID_APPCTX(ctx)); - - ctx->taskmgr = taskmgr; -} - -ISC_APPFUNC_SCOPE void -isc__appctx_setsocketmgr(isc_appctx_t *ctx0, isc_socketmgr_t *socketmgr) { - isc__appctx_t *ctx = (isc__appctx_t *)ctx0; - - REQUIRE(VALID_APPCTX(ctx)); - - ctx->socketmgr = socketmgr; -} - -ISC_APPFUNC_SCOPE void -isc__appctx_settimermgr(isc_appctx_t *ctx0, isc_timermgr_t *timermgr) { - isc__appctx_t *ctx = (isc__appctx_t *)ctx0; - - REQUIRE(VALID_APPCTX(ctx)); - - ctx->timermgr = timermgr; -} - -#ifdef USE_APPIMPREGISTER -isc_result_t -isc__app_register() { - return (isc_app_register(isc__appctx_create)); -} -#endif diff --git a/lib/isc/unix/entropy.c b/lib/isc/unix/entropy.c deleted file mode 100644 index ab53faf6754e..000000000000 --- a/lib/isc/unix/entropy.c +++ /dev/null @@ -1,605 +0,0 @@ -/* - * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000-2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: entropy.c,v 1.82 2008/12/01 23:47:45 tbox Exp $ */ - -/* \file unix/entropy.c - * \brief - * This is the system dependent part of the ISC entropy API. - */ - -#include - -#include /* Openserver 5.0.6A and FD_SETSIZE */ -#include -#include -#include -#include -#include - -#ifdef HAVE_NANOSLEEP -#include -#endif -#include - -#include -#include - -#ifdef ISC_PLATFORM_NEEDSYSSELECTH -#include -#endif - -#include "errno2result.h" - -/*% - * There is only one variable in the entropy data structures that is not - * system independent, but pulling the structure that uses it into this file - * ultimately means pulling several other independent structures here also to - * resolve their interdependencies. Thus only the problem variable's type - * is defined here. - */ -#define FILESOURCE_HANDLE_TYPE int - -typedef struct { - int handle; - enum { - isc_usocketsource_disconnected, - isc_usocketsource_connecting, - isc_usocketsource_connected, - isc_usocketsource_ndesired, - isc_usocketsource_wrote, - isc_usocketsource_reading - } status; - size_t sz_to_recv; -} isc_entropyusocketsource_t; - -#include "../entropy.c" - -static unsigned int -get_from_filesource(isc_entropysource_t *source, isc_uint32_t desired) { - isc_entropy_t *ent = source->ent; - unsigned char buf[128]; - int fd = source->sources.file.handle; - ssize_t n, ndesired; - unsigned int added; - - if (source->bad) - return (0); - - desired = desired / 8 + (((desired & 0x07) > 0) ? 1 : 0); - - added = 0; - while (desired > 0) { - ndesired = ISC_MIN(desired, sizeof(buf)); - n = read(fd, buf, ndesired); - if (n < 0) { - if (errno == EAGAIN || errno == EINTR) - goto out; - goto err; - } - if (n == 0) - goto err; - - entropypool_adddata(ent, buf, n, n * 8); - added += n * 8; - desired -= n; - } - goto out; - - err: - (void)close(fd); - source->sources.file.handle = -1; - source->bad = ISC_TRUE; - - out: - return (added); -} - -static unsigned int -get_from_usocketsource(isc_entropysource_t *source, isc_uint32_t desired) { - isc_entropy_t *ent = source->ent; - unsigned char buf[128]; - int fd = source->sources.usocket.handle; - ssize_t n = 0, ndesired; - unsigned int added; - size_t sz_to_recv = source->sources.usocket.sz_to_recv; - - if (source->bad) - return (0); - - desired = desired / 8 + (((desired & 0x07) > 0) ? 1 : 0); - - added = 0; - while (desired > 0) { - ndesired = ISC_MIN(desired, sizeof(buf)); - eagain_loop: - - switch ( source->sources.usocket.status ) { - case isc_usocketsource_ndesired: - buf[0] = ndesired; - if ((n = sendto(fd, buf, 1, 0, NULL, 0)) < 0) { - if (errno == EWOULDBLOCK || errno == EINTR || - errno == ECONNRESET) - goto out; - goto err; - } - INSIST(n == 1); - source->sources.usocket.status = - isc_usocketsource_wrote; - goto eagain_loop; - - case isc_usocketsource_connecting: - case isc_usocketsource_connected: - buf[0] = 1; - buf[1] = ndesired; - if ((n = sendto(fd, buf, 2, 0, NULL, 0)) < 0) { - if (errno == EWOULDBLOCK || errno == EINTR || - errno == ECONNRESET) - goto out; - goto err; - } - if (n == 1) { - source->sources.usocket.status = - isc_usocketsource_ndesired; - goto eagain_loop; - } - INSIST(n == 2); - source->sources.usocket.status = - isc_usocketsource_wrote; - /*FALLTHROUGH*/ - - case isc_usocketsource_wrote: - if (recvfrom(fd, buf, 1, 0, NULL, NULL) != 1) { - if (errno == EAGAIN) { - /* - * The problem of EAGAIN (try again - * later) is a major issue on HP-UX. - * Solaris actually tries the recvfrom - * call again, while HP-UX just dies. - * This code is an attempt to let the - * entropy pool fill back up (at least - * that's what I think the problem is.) - * We go to eagain_loop because if we - * just "break", then the "desired" - * amount gets borked. - */ -#ifdef HAVE_NANOSLEEP - struct timespec ts; - - ts.tv_sec = 0; - ts.tv_nsec = 1000000; - nanosleep(&ts, NULL); -#else - usleep(1000); -#endif - goto eagain_loop; - } - if (errno == EWOULDBLOCK || errno == EINTR) - goto out; - goto err; - } - source->sources.usocket.status = - isc_usocketsource_reading; - sz_to_recv = buf[0]; - source->sources.usocket.sz_to_recv = sz_to_recv; - if (sz_to_recv > sizeof(buf)) - goto err; - /*FALLTHROUGH*/ - - case isc_usocketsource_reading: - if (sz_to_recv != 0U) { - n = recv(fd, buf, sz_to_recv, 0); - if (n < 0) { - if (errno == EWOULDBLOCK || - errno == EINTR) - goto out; - goto err; - } - } else - n = 0; - break; - - default: - goto err; - } - - if ((size_t)n != sz_to_recv) - source->sources.usocket.sz_to_recv -= n; - else - source->sources.usocket.status = - isc_usocketsource_connected; - - if (n == 0) - goto out; - - entropypool_adddata(ent, buf, n, n * 8); - added += n * 8; - desired -= n; - } - goto out; - - err: - close(fd); - source->bad = ISC_TRUE; - source->sources.usocket.status = isc_usocketsource_disconnected; - source->sources.usocket.handle = -1; - - out: - return (added); -} - -/* - * Poll each source, trying to get data from it to stuff into the entropy - * pool. - */ -static void -fillpool(isc_entropy_t *ent, unsigned int desired, isc_boolean_t blocking) { - unsigned int added; - unsigned int remaining; - unsigned int needed; - unsigned int nsource; - isc_entropysource_t *source; - - REQUIRE(VALID_ENTROPY(ent)); - - needed = desired; - - /* - * This logic is a little strange, so an explanation is in order. - * - * If needed is 0, it means we are being asked to "fill to whatever - * we think is best." This means that if we have at least a - * partially full pool (say, > 1/4th of the pool) we probably don't - * need to add anything. - * - * Also, we will check to see if the "pseudo" count is too high. - * If it is, try to mix in better data. Too high is currently - * defined as 1/4th of the pool. - * - * Next, if we are asked to add a specific bit of entropy, make - * certain that we will do so. Clamp how much we try to add to - * (DIGEST_SIZE * 8 < needed < POOLBITS - entropy). - * - * Note that if we are in a blocking mode, we will only try to - * get as much data as we need, not as much as we might want - * to build up. - */ - if (needed == 0) { - REQUIRE(!blocking); - - if ((ent->pool.entropy >= RND_POOLBITS / 4) - && (ent->pool.pseudo <= RND_POOLBITS / 4)) - return; - - needed = THRESHOLD_BITS * 4; - } else { - needed = ISC_MAX(needed, THRESHOLD_BITS); - needed = ISC_MIN(needed, RND_POOLBITS); - } - - /* - * In any case, clamp how much we need to how much we can add. - */ - needed = ISC_MIN(needed, RND_POOLBITS - ent->pool.entropy); - - /* - * But wait! If we're not yet initialized, we need at least - * THRESHOLD_BITS - * of randomness. - */ - if (ent->initialized < THRESHOLD_BITS) - needed = ISC_MAX(needed, THRESHOLD_BITS - ent->initialized); - - /* - * Poll each file source to see if we can read anything useful from - * it. XXXMLG When where are multiple sources, we should keep a - * record of which one we last used so we can start from it (or the - * next one) to avoid letting some sources build up entropy while - * others are always drained. - */ - - added = 0; - remaining = needed; - if (ent->nextsource == NULL) { - ent->nextsource = ISC_LIST_HEAD(ent->sources); - if (ent->nextsource == NULL) - return; - } - source = ent->nextsource; - again_file: - for (nsource = 0; nsource < ent->nsources; nsource++) { - unsigned int got; - - if (remaining == 0) - break; - - got = 0; - - switch ( source->type ) { - case ENTROPY_SOURCETYPE_FILE: - got = get_from_filesource(source, remaining); - break; - - case ENTROPY_SOURCETYPE_USOCKET: - got = get_from_usocketsource(source, remaining); - break; - } - - added += got; - - remaining -= ISC_MIN(remaining, got); - - source = ISC_LIST_NEXT(source, link); - if (source == NULL) - source = ISC_LIST_HEAD(ent->sources); - } - ent->nextsource = source; - - if (blocking && remaining != 0) { - int fds; - - fds = wait_for_sources(ent); - if (fds > 0) - goto again_file; - } - - /* - * Here, if there are bits remaining to be had and we can block, - * check to see if we have a callback source. If so, call them. - */ - source = ISC_LIST_HEAD(ent->sources); - while ((remaining != 0) && (source != NULL)) { - unsigned int got; - - got = 0; - - if (source->type == ENTROPY_SOURCETYPE_CALLBACK) - got = get_from_callback(source, remaining, blocking); - - added += got; - remaining -= ISC_MIN(remaining, got); - - if (added >= needed) - break; - - source = ISC_LIST_NEXT(source, link); - } - - /* - * Mark as initialized if we've added enough data. - */ - if (ent->initialized < THRESHOLD_BITS) - ent->initialized += added; -} - -static int -wait_for_sources(isc_entropy_t *ent) { - isc_entropysource_t *source; - int maxfd, fd; - int cc; - fd_set reads; - fd_set writes; - - maxfd = -1; - FD_ZERO(&reads); - FD_ZERO(&writes); - - source = ISC_LIST_HEAD(ent->sources); - while (source != NULL) { - if (source->type == ENTROPY_SOURCETYPE_FILE) { - fd = source->sources.file.handle; - if (fd >= 0) { - maxfd = ISC_MAX(maxfd, fd); - FD_SET(fd, &reads); - } - } - if (source->type == ENTROPY_SOURCETYPE_USOCKET) { - fd = source->sources.usocket.handle; - if (fd >= 0) { - switch (source->sources.usocket.status) { - case isc_usocketsource_disconnected: - break; - case isc_usocketsource_connecting: - case isc_usocketsource_connected: - case isc_usocketsource_ndesired: - maxfd = ISC_MAX(maxfd, fd); - FD_SET(fd, &writes); - break; - case isc_usocketsource_wrote: - case isc_usocketsource_reading: - maxfd = ISC_MAX(maxfd, fd); - FD_SET(fd, &reads); - break; - } - } - } - source = ISC_LIST_NEXT(source, link); - } - - if (maxfd < 0) - return (-1); - - cc = select(maxfd + 1, &reads, &writes, NULL, NULL); - if (cc < 0) - return (-1); - - return (cc); -} - -static void -destroyfilesource(isc_entropyfilesource_t *source) { - (void)close(source->handle); -} - -static void -destroyusocketsource(isc_entropyusocketsource_t *source) { - close(source->handle); -} - -/* - * Make a fd non-blocking - */ -static isc_result_t -make_nonblock(int fd) { - int ret; - int flags; - char strbuf[ISC_STRERRORSIZE]; -#ifdef USE_FIONBIO_IOCTL - int on = 1; - - ret = ioctl(fd, FIONBIO, (char *)&on); -#else - flags = fcntl(fd, F_GETFL, 0); - flags |= PORT_NONBLOCK; - ret = fcntl(fd, F_SETFL, flags); -#endif - - if (ret == -1) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, -#ifdef USE_FIONBIO_IOCTL - "ioctl(%d, FIONBIO, &on): %s", fd, -#else - "fcntl(%d, F_SETFL, %d): %s", fd, flags, -#endif - strbuf); - - return (ISC_R_UNEXPECTED); - } - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname) { - int fd; - struct stat _stat; - isc_boolean_t is_usocket = ISC_FALSE; - isc_boolean_t is_connected = ISC_FALSE; - isc_result_t ret; - isc_entropysource_t *source; - - REQUIRE(VALID_ENTROPY(ent)); - REQUIRE(fname != NULL); - - LOCK(&ent->lock); - - if (stat(fname, &_stat) < 0) { - ret = isc__errno2result(errno); - goto errout; - } - /* - * Solaris 2.5.1 does not have support for sockets (S_IFSOCK), - * but it does return type S_IFIFO (the OS believes that - * the socket is a fifo). This may be an issue if we tell - * the program to look at an actual FIFO as its source of - * entropy. - */ -#if defined(S_ISSOCK) - if (S_ISSOCK(_stat.st_mode)) - is_usocket = ISC_TRUE; -#endif -#if defined(S_ISFIFO) && defined(sun) - if (S_ISFIFO(_stat.st_mode)) - is_usocket = ISC_TRUE; -#endif - if (is_usocket) - fd = socket(PF_UNIX, SOCK_STREAM, 0); - else - fd = open(fname, O_RDONLY | PORT_NONBLOCK, 0); - - if (fd < 0) { - ret = isc__errno2result(errno); - goto errout; - } - - ret = make_nonblock(fd); - if (ret != ISC_R_SUCCESS) - goto closefd; - - if (is_usocket) { - struct sockaddr_un sname; - - memset(&sname, 0, sizeof(sname)); - sname.sun_family = AF_UNIX; - strncpy(sname.sun_path, fname, sizeof(sname.sun_path)); - sname.sun_path[sizeof(sname.sun_path)-1] = '0'; -#ifdef ISC_PLATFORM_HAVESALEN -#if !defined(SUN_LEN) -#define SUN_LEN(su) \ - (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) -#endif - sname.sun_len = SUN_LEN(&sname); -#endif - - if (connect(fd, (struct sockaddr *) &sname, - sizeof(struct sockaddr_un)) < 0) { - if (errno != EINPROGRESS) { - ret = isc__errno2result(errno); - goto closefd; - } - } else - is_connected = ISC_TRUE; - } - - source = isc_mem_get(ent->mctx, sizeof(isc_entropysource_t)); - if (source == NULL) { - ret = ISC_R_NOMEMORY; - goto closefd; - } - - /* - * From here down, no failures can occur. - */ - source->magic = SOURCE_MAGIC; - source->ent = ent; - source->total = 0; - source->bad = ISC_FALSE; - memset(source->name, 0, sizeof(source->name)); - ISC_LINK_INIT(source, link); - if (is_usocket) { - source->sources.usocket.handle = fd; - if (is_connected) - source->sources.usocket.status = - isc_usocketsource_connected; - else - source->sources.usocket.status = - isc_usocketsource_connecting; - source->sources.usocket.sz_to_recv = 0; - source->type = ENTROPY_SOURCETYPE_USOCKET; - } else { - source->sources.file.handle = fd; - source->type = ENTROPY_SOURCETYPE_FILE; - } - - /* - * Hook it into the entropy system. - */ - ISC_LIST_APPEND(ent->sources, source, link); - ent->nsources++; - - UNLOCK(&ent->lock); - return (ISC_R_SUCCESS); - - closefd: - (void)close(fd); - - errout: - UNLOCK(&ent->lock); - - return (ret); -} diff --git a/lib/isc/unix/fsaccess.c b/lib/isc/unix/fsaccess.c deleted file mode 100644 index a2bd89ad7131..000000000000 --- a/lib/isc/unix/fsaccess.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: fsaccess.c,v 1.13 2007/06/19 23:47:18 tbox Exp $ */ - -#include - -#include -#include - -#include - -#include "errno2result.h" - -/*! \file - * \brief - * The OS-independent part of the API is in lib/isc. - */ -#include "../fsaccess.c" - -isc_result_t -isc_fsaccess_set(const char *path, isc_fsaccess_t access) { - struct stat statb; - mode_t mode; - isc_boolean_t is_dir = ISC_FALSE; - isc_fsaccess_t bits; - isc_result_t result; - - if (stat(path, &statb) != 0) - return (isc__errno2result(errno)); - - if ((statb.st_mode & S_IFDIR) != 0) - is_dir = ISC_TRUE; - else if ((statb.st_mode & S_IFREG) == 0) - return (ISC_R_INVALIDFILE); - - result = check_bad_bits(access, is_dir); - if (result != ISC_R_SUCCESS) - return (result); - - /* - * Done with checking bad bits. Set mode_t. - */ - mode = 0; - -#define SET_AND_CLEAR1(modebit) \ - if ((access & bits) != 0) { \ - mode |= modebit; \ - access &= ~bits; \ - } -#define SET_AND_CLEAR(user, group, other) \ - SET_AND_CLEAR1(user); \ - bits <<= STEP; \ - SET_AND_CLEAR1(group); \ - bits <<= STEP; \ - SET_AND_CLEAR1(other); - - bits = ISC_FSACCESS_READ | ISC_FSACCESS_LISTDIRECTORY; - - SET_AND_CLEAR(S_IRUSR, S_IRGRP, S_IROTH); - - bits = ISC_FSACCESS_WRITE | - ISC_FSACCESS_CREATECHILD | - ISC_FSACCESS_DELETECHILD; - - SET_AND_CLEAR(S_IWUSR, S_IWGRP, S_IWOTH); - - bits = ISC_FSACCESS_EXECUTE | - ISC_FSACCESS_ACCESSCHILD; - - SET_AND_CLEAR(S_IXUSR, S_IXGRP, S_IXOTH); - - INSIST(access == 0); - - if (chmod(path, mode) < 0) - return (isc__errno2result(errno)); - - return (ISC_R_SUCCESS); -} diff --git a/lib/isc/unix/include/isc/keyboard.h b/lib/isc/unix/include/isc/keyboard.h deleted file mode 100644 index 43f5e7eec27b..000000000000 --- a/lib/isc/unix/include/isc/keyboard.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: keyboard.h,v 1.11 2007/06/19 23:47:19 tbox Exp $ */ - -#ifndef ISC_KEYBOARD_H -#define ISC_KEYBOARD_H 1 - -/*! \file */ - -#include - -#include -#include - -ISC_LANG_BEGINDECLS - -typedef struct { - int fd; - struct termios saved_mode; - isc_result_t result; -} isc_keyboard_t; - -isc_result_t -isc_keyboard_open(isc_keyboard_t *keyboard); - -isc_result_t -isc_keyboard_close(isc_keyboard_t *keyboard, unsigned int sleepseconds); - -isc_result_t -isc_keyboard_getchar(isc_keyboard_t *keyboard, unsigned char *cp); - -isc_boolean_t -isc_keyboard_canceled(isc_keyboard_t *keyboard); - -ISC_LANG_ENDDECLS - -#endif /* ISC_KEYBOARD_H */ diff --git a/lib/isc/unix/include/isc/netdb.h b/lib/isc/unix/include/isc/netdb.h deleted file mode 100644 index ff12a26e22ae..000000000000 --- a/lib/isc/unix/include/isc/netdb.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: netdb.h,v 1.11 2007/06/19 23:47:19 tbox Exp $ */ - -#ifndef ISC_NETDB_H -#define ISC_NETDB_H 1 - -/***** - ***** Module Info - *****/ - -/*! \file - * \brief - * Portable netdb.h support. - * - * This module is responsible for defining the getby APIs. - * - * MP: - *\li No impact. - * - * Reliability: - *\li No anticipated impact. - * - * Resources: - *\li N/A. - * - * Security: - *\li No anticipated impact. - * - * Standards: - *\li BSD API - */ - -/*** - *** Imports. - ***/ - -#include - -#include - -#endif /* ISC_NETDB_H */ diff --git a/lib/isc/unix/include/isc/syslog.h b/lib/isc/unix/include/isc/syslog.h deleted file mode 100644 index 7e0c88cb3b50..000000000000 --- a/lib/isc/unix/include/isc/syslog.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: syslog.h,v 1.7 2007/06/19 23:47:19 tbox Exp $ */ - -#ifndef ISC_SYSLOG_H -#define ISC_SYSLOG_H 1 - -/*! \file */ - -#include -#include - -ISC_LANG_BEGINDECLS - -isc_result_t -isc_syslog_facilityfromstring(const char *str, int *facilityp); -/*%< - * Convert 'str' to the appropriate syslog facility constant. - * - * Requires: - * - *\li 'str' is not NULL - *\li 'facilityp' is not NULL - * - * Returns: - * \li #ISC_R_SUCCESS - * \li #ISC_R_NOTFOUND - */ - -ISC_LANG_ENDDECLS - -#endif /* ISC_SYSLOG_H */ diff --git a/lib/isc/unix/ipv6.c b/lib/isc/unix/ipv6.c deleted file mode 100644 index 61e984f09d34..000000000000 --- a/lib/isc/unix/ipv6.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: ipv6.c,v 1.14 2007/06/19 23:47:18 tbox Exp $ */ - -/*! \file */ - -#include - -#include - -const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; -const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; diff --git a/lib/isc/unix/keyboard.c b/lib/isc/unix/keyboard.c deleted file mode 100644 index 8ee62d3f5906..000000000000 --- a/lib/isc/unix/keyboard.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: keyboard.c,v 1.13 2007/06/19 23:47:18 tbox Exp $ */ - -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - -isc_result_t -isc_keyboard_open(isc_keyboard_t *keyboard) { - int fd; - isc_result_t ret; - struct termios current_mode; - - REQUIRE(keyboard != NULL); - - fd = open("/dev/tty", O_RDONLY, 0); - if (fd < 0) - return (ISC_R_IOERROR); - - keyboard->fd = fd; - - if (tcgetattr(fd, &keyboard->saved_mode) < 0) { - ret = ISC_R_IOERROR; - goto errout; - } - - current_mode = keyboard->saved_mode; - - current_mode.c_iflag &= - ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); - current_mode.c_oflag &= ~OPOST; - current_mode.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); - current_mode.c_cflag &= ~(CSIZE|PARENB); - current_mode.c_cflag |= CS8; - - current_mode.c_cc[VMIN] = 1; - current_mode.c_cc[VTIME] = 0; - if (tcsetattr(fd, TCSAFLUSH, ¤t_mode) < 0) { - ret = ISC_R_IOERROR; - goto errout; - } - - keyboard->result = ISC_R_SUCCESS; - - return (ISC_R_SUCCESS); - - errout: - close (fd); - - return (ret); -} - -isc_result_t -isc_keyboard_close(isc_keyboard_t *keyboard, unsigned int sleeptime) { - REQUIRE(keyboard != NULL); - - if (sleeptime > 0 && keyboard->result != ISC_R_CANCELED) - (void)sleep(sleeptime); - - (void)tcsetattr(keyboard->fd, TCSAFLUSH, &keyboard->saved_mode); - (void)close(keyboard->fd); - - keyboard->fd = -1; - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_keyboard_getchar(isc_keyboard_t *keyboard, unsigned char *cp) { - ssize_t cc; - unsigned char c; - cc_t *controlchars; - - REQUIRE(keyboard != NULL); - REQUIRE(cp != NULL); - - cc = read(keyboard->fd, &c, 1); - if (cc < 0) { - keyboard->result = ISC_R_IOERROR; - return (keyboard->result); - } - - controlchars = keyboard->saved_mode.c_cc; - if (c == controlchars[VINTR] || c == controlchars[VQUIT]) { - keyboard->result = ISC_R_CANCELED; - return (keyboard->result); - } - - *cp = c; - - return (ISC_R_SUCCESS); -} - -isc_boolean_t -isc_keyboard_canceled(isc_keyboard_t *keyboard) { - return (ISC_TF(keyboard->result == ISC_R_CANCELED)); -} diff --git a/lib/isc/unix/os.c b/lib/isc/unix/os.c deleted file mode 100644 index c050d14c3b6e..000000000000 --- a/lib/isc/unix/os.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: os.c,v 1.18 2007/06/19 23:47:18 tbox Exp $ */ - -#include - -#include - - -#ifdef HAVE_SYSCONF - -#include - -#ifndef __hpux -static inline long -sysconf_ncpus(void) { -#if defined(_SC_NPROCESSORS_ONLN) - return sysconf((_SC_NPROCESSORS_ONLN)); -#elif defined(_SC_NPROC_ONLN) - return sysconf((_SC_NPROC_ONLN)); -#else - return (0); -#endif -} -#endif -#endif /* HAVE_SYSCONF */ - - -#ifdef __hpux - -#include - -static inline int -hpux_ncpus(void) { - struct pst_dynamic psd; - if (pstat_getdynamic(&psd, sizeof(psd), 1, 0) != -1) - return (psd.psd_proc_cnt); - else - return (0); -} - -#endif /* __hpux */ - -#if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_SYSCTLBYNAME) -#include /* for FreeBSD */ -#include /* for NetBSD */ -#include - -static int -sysctl_ncpus(void) { - int ncpu, result; - size_t len; - - len = sizeof(ncpu); - result = sysctlbyname("hw.ncpu", &ncpu, &len , 0, 0); - if (result != -1) - return (ncpu); - return (0); -} -#endif - -unsigned int -isc_os_ncpus(void) { - long ncpus = 0; - -#ifdef __hpux - ncpus = hpux_ncpus(); -#elif defined(HAVE_SYSCONF) - ncpus = sysconf_ncpus(); -#endif -#if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_SYSCTLBYNAME) - if (ncpus <= 0) - ncpus = sysctl_ncpus(); -#endif - if (ncpus <= 0) - ncpus = 1; - - return ((unsigned int)ncpus); -} diff --git a/lib/isc/unix/resource.c b/lib/isc/unix/resource.c deleted file mode 100644 index 29596e2aa6a1..000000000000 --- a/lib/isc/unix/resource.c +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (C) 2004, 2007-2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: resource.c,v 1.23 2009/02/13 23:48:14 tbox Exp $ */ - -#include - -#include -#include /* Required on some systems for . */ -#include - -#include -#include -#include -#include - -#ifdef __linux__ -#include /* To get the large NR_OPEN. */ -#endif - -#if defined(__hpux) && defined(HAVE_SYS_DYNTUNE_H) -#include -#endif - -#include "errno2result.h" - -static isc_result_t -resource2rlim(isc_resource_t resource, int *rlim_resource) { - isc_result_t result = ISC_R_SUCCESS; - - switch (resource) { - case isc_resource_coresize: - *rlim_resource = RLIMIT_CORE; - break; - case isc_resource_cputime: - *rlim_resource = RLIMIT_CPU; - break; - case isc_resource_datasize: - *rlim_resource = RLIMIT_DATA; - break; - case isc_resource_filesize: - *rlim_resource = RLIMIT_FSIZE; - break; - case isc_resource_lockedmemory: -#ifdef RLIMIT_MEMLOCK - *rlim_resource = RLIMIT_MEMLOCK; -#else - result = ISC_R_NOTIMPLEMENTED; -#endif - break; - case isc_resource_openfiles: -#ifdef RLIMIT_NOFILE - *rlim_resource = RLIMIT_NOFILE; -#else - result = ISC_R_NOTIMPLEMENTED; -#endif - break; - case isc_resource_processes: -#ifdef RLIMIT_NPROC - *rlim_resource = RLIMIT_NPROC; -#else - result = ISC_R_NOTIMPLEMENTED; -#endif - break; - case isc_resource_residentsize: -#ifdef RLIMIT_RSS - *rlim_resource = RLIMIT_RSS; -#else - result = ISC_R_NOTIMPLEMENTED; -#endif - break; - case isc_resource_stacksize: - *rlim_resource = RLIMIT_STACK; - break; - default: - /* - * This test is not very robust if isc_resource_t - * changes, but generates a clear assertion message. - */ - REQUIRE(resource >= isc_resource_coresize && - resource <= isc_resource_stacksize); - - result = ISC_R_RANGE; - break; - } - - return (result); -} - -isc_result_t -isc_resource_setlimit(isc_resource_t resource, isc_resourcevalue_t value) { - struct rlimit rl; - ISC_PLATFORM_RLIMITTYPE rlim_value; - int unixresult; - int unixresource; - isc_result_t result; - - result = resource2rlim(resource, &unixresource); - if (result != ISC_R_SUCCESS) - return (result); - - if (value == ISC_RESOURCE_UNLIMITED) - rlim_value = RLIM_INFINITY; - - else { - /* - * isc_resourcevalue_t was chosen as an unsigned 64 bit - * integer so that it could contain the maximum range of - * reasonable values. Unfortunately, this exceeds the typical - * range on Unix systems. Ensure the range of - * ISC_PLATFORM_RLIMITTYPE is not overflowed. - */ - isc_resourcevalue_t rlim_max; - isc_boolean_t rlim_t_is_signed = - ISC_TF(((double)(ISC_PLATFORM_RLIMITTYPE)-1) < 0); - - if (rlim_t_is_signed) - rlim_max = ~((ISC_PLATFORM_RLIMITTYPE)1 << - (sizeof(ISC_PLATFORM_RLIMITTYPE) * 8 - 1)); - else - rlim_max = (ISC_PLATFORM_RLIMITTYPE)-1; - - if (value > rlim_max) - value = rlim_max; - - rlim_value = value; - } - - rl.rlim_cur = rl.rlim_max = rlim_value; - unixresult = setrlimit(unixresource, &rl); - - if (unixresult == 0) - return (ISC_R_SUCCESS); - -#if defined(OPEN_MAX) && defined(__APPLE__) - /* - * The Darwin kernel doesn't accept RLIM_INFINITY for rlim_cur; the - * maximum possible value is OPEN_MAX. BIND8 used to use - * sysconf(_SC_OPEN_MAX) for such a case, but this value is much - * smaller than OPEN_MAX and is not really effective. - */ - if (resource == isc_resource_openfiles && rlim_value == RLIM_INFINITY) { - rl.rlim_cur = OPEN_MAX; - unixresult = setrlimit(unixresource, &rl); - if (unixresult == 0) - return (ISC_R_SUCCESS); - } -#elif defined(__linux__) -#ifndef NR_OPEN -#define NR_OPEN (1024*1024) -#endif - - /* - * Some Linux kernels don't accept RLIM_INFINIT; the maximum - * possible value is the NR_OPEN defined in linux/fs.h. - */ - if (resource == isc_resource_openfiles && rlim_value == RLIM_INFINITY) { - rl.rlim_cur = rl.rlim_max = NR_OPEN; - unixresult = setrlimit(unixresource, &rl); - if (unixresult == 0) - return (ISC_R_SUCCESS); - } -#elif defined(__hpux) && defined(HAVE_SYS_DYNTUNE_H) - if (resource == isc_resource_openfiles && rlim_value == RLIM_INFINITY) { - uint64_t maxfiles; - if (gettune("maxfiles_lim", &maxfiles) == 0) { - rl.rlim_cur = rl.rlim_max = maxfiles; - unixresult = setrlimit(unixresource, &rl); - if (unixresult == 0) - return (ISC_R_SUCCESS); - } - } -#endif - if (resource == isc_resource_openfiles && rlim_value == RLIM_INFINITY) { - if (getrlimit(unixresource, &rl) == 0) { - rl.rlim_cur = rl.rlim_max; - unixresult = setrlimit(unixresource, &rl); - if (unixresult == 0) - return (ISC_R_SUCCESS); - } - } - return (isc__errno2result(errno)); -} - -isc_result_t -isc_resource_getlimit(isc_resource_t resource, isc_resourcevalue_t *value) { - int unixresult; - int unixresource; - struct rlimit rl; - isc_result_t result; - - result = resource2rlim(resource, &unixresource); - if (result == ISC_R_SUCCESS) { - unixresult = getrlimit(unixresource, &rl); - INSIST(unixresult == 0); - *value = rl.rlim_max; - } - - return (result); -} - -isc_result_t -isc_resource_getcurlimit(isc_resource_t resource, isc_resourcevalue_t *value) { - int unixresult; - int unixresource; - struct rlimit rl; - isc_result_t result; - - result = resource2rlim(resource, &unixresource); - if (result == ISC_R_SUCCESS) { - unixresult = getrlimit(unixresource, &rl); - INSIST(unixresult == 0); - *value = rl.rlim_cur; - } - - return (result); -} diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c deleted file mode 100644 index 5fed888a11ae..000000000000 --- a/lib/isc/unix/socket.c +++ /dev/null @@ -1,6011 +0,0 @@ -/* - * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/*! \file */ - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef ISC_PLATFORM_HAVESYSUNH -#include -#endif -#ifdef ISC_PLATFORM_HAVEKQUEUE -#include -#endif -#ifdef ISC_PLATFORM_HAVEEPOLL -#include -#endif -#ifdef ISC_PLATFORM_HAVEDEVPOLL -#if defined(HAVE_SYS_DEVPOLL_H) -#include -#elif defined(HAVE_DEVPOLL_H) -#include -#endif -#endif - -#include "errno2result.h" - -/* See task.c about the following definition: */ -#ifdef BIND9 -#ifdef ISC_PLATFORM_USETHREADS -#define USE_WATCHER_THREAD -#else -#define USE_SHARED_MANAGER -#endif /* ISC_PLATFORM_USETHREADS */ -#endif /* BIND9 */ - -#ifndef USE_WATCHER_THREAD -#include "socket_p.h" -#include "../task_p.h" -#endif /* USE_WATCHER_THREAD */ - -#if defined(SO_BSDCOMPAT) && defined(__linux__) -#include -#endif - -/*% - * Choose the most preferable multiplex method. - */ -#ifdef ISC_PLATFORM_HAVEKQUEUE -#define USE_KQUEUE -#elif defined (ISC_PLATFORM_HAVEEPOLL) -#define USE_EPOLL -#elif defined (ISC_PLATFORM_HAVEDEVPOLL) -#define USE_DEVPOLL -typedef struct { - unsigned int want_read : 1, - want_write : 1; -} pollinfo_t; -#else -#define USE_SELECT -#endif /* ISC_PLATFORM_HAVEKQUEUE */ - -#ifndef USE_WATCHER_THREAD -#if defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL) -struct isc_socketwait { - int nevents; -}; -#elif defined (USE_SELECT) -struct isc_socketwait { - fd_set *readset; - fd_set *writeset; - int nfds; - int maxfd; -}; -#endif /* USE_KQUEUE */ -#endif /* !USE_WATCHER_THREAD */ - -/*% - * Maximum number of allowable open sockets. This is also the maximum - * allowable socket file descriptor. - * - * Care should be taken before modifying this value for select(): - * The API standard doesn't ensure select() accept more than (the system default - * of) FD_SETSIZE descriptors, and the default size should in fact be fine in - * the vast majority of cases. This constant should therefore be increased only - * when absolutely necessary and possible, i.e., the server is exhausting all - * available file descriptors (up to FD_SETSIZE) and the select() function - * and FD_xxx macros support larger values than FD_SETSIZE (which may not - * always by true, but we keep using some of them to ensure as much - * portability as possible). Note also that overall server performance - * may be rather worsened with a larger value of this constant due to - * inherent scalability problems of select(). - * - * As a special note, this value shouldn't have to be touched if - * this is a build for an authoritative only DNS server. - */ -#ifndef ISC_SOCKET_MAXSOCKETS -#if defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL) -#define ISC_SOCKET_MAXSOCKETS 4096 -#elif defined(USE_SELECT) -#define ISC_SOCKET_MAXSOCKETS FD_SETSIZE -#endif /* USE_KQUEUE... */ -#endif /* ISC_SOCKET_MAXSOCKETS */ - -#ifdef USE_SELECT -/*% - * Mac OS X needs a special definition to support larger values in select(). - * We always define this because a larger value can be specified run-time. - */ -#ifdef __APPLE__ -#define _DARWIN_UNLIMITED_SELECT -#endif /* __APPLE__ */ -#endif /* USE_SELECT */ - -#ifdef ISC_SOCKET_USE_POLLWATCH -/*% - * If this macro is defined, enable workaround for a Solaris /dev/poll kernel - * bug: DP_POLL ioctl could keep sleeping even if socket I/O is possible for - * some of the specified FD. The idea is based on the observation that it's - * likely for a busy server to keep receiving packets. It specifically works - * as follows: the socket watcher is first initialized with the state of - * "poll_idle". While it's in the idle state it keeps sleeping until a socket - * event occurs. When it wakes up for a socket I/O event, it moves to the - * poll_active state, and sets the poll timeout to a short period - * (ISC_SOCKET_POLLWATCH_TIMEOUT msec). If timeout occurs in this state, the - * watcher goes to the poll_checking state with the same timeout period. - * In this state, the watcher tries to detect whether this is a break - * during intermittent events or the kernel bug is triggered. If the next - * polling reports an event within the short period, the previous timeout is - * likely to be a kernel bug, and so the watcher goes back to the active state. - * Otherwise, it moves to the idle state again. - * - * It's not clear whether this is a thread-related bug, but since we've only - * seen this with threads, this workaround is used only when enabling threads. - */ - -typedef enum { poll_idle, poll_active, poll_checking } pollstate_t; - -#ifndef ISC_SOCKET_POLLWATCH_TIMEOUT -#define ISC_SOCKET_POLLWATCH_TIMEOUT 10 -#endif /* ISC_SOCKET_POLLWATCH_TIMEOUT */ -#endif /* ISC_SOCKET_USE_POLLWATCH */ - -/*% - * Size of per-FD lock buckets. - */ -#ifdef ISC_PLATFORM_USETHREADS -#define FDLOCK_COUNT 1024 -#define FDLOCK_ID(fd) ((fd) % FDLOCK_COUNT) -#else -#define FDLOCK_COUNT 1 -#define FDLOCK_ID(fd) 0 -#endif /* ISC_PLATFORM_USETHREADS */ - -/*% - * Maximum number of events communicated with the kernel. There should normally - * be no need for having a large number. - */ -#if defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL) -#ifndef ISC_SOCKET_MAXEVENTS -#define ISC_SOCKET_MAXEVENTS 64 -#endif -#endif - -/*% - * Some systems define the socket length argument as an int, some as size_t, - * some as socklen_t. This is here so it can be easily changed if needed. - */ -#ifndef ISC_SOCKADDR_LEN_T -#define ISC_SOCKADDR_LEN_T unsigned int -#endif - -/*% - * Define what the possible "soft" errors can be. These are non-fatal returns - * of various network related functions, like recv() and so on. - * - * For some reason, BSDI (and perhaps others) will sometimes return <0 - * from recv() but will have errno==0. This is broken, but we have to - * work around it here. - */ -#define SOFT_ERROR(e) ((e) == EAGAIN || \ - (e) == EWOULDBLOCK || \ - (e) == EINTR || \ - (e) == 0) - -#define DLVL(x) ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_DEBUG(x) - -/*!< - * DLVL(90) -- Function entry/exit and other tracing. - * DLVL(70) -- Socket "correctness" -- including returning of events, etc. - * DLVL(60) -- Socket data send/receive - * DLVL(50) -- Event tracing, including receiving/sending completion events. - * DLVL(20) -- Socket creation/destruction. - */ -#define TRACE_LEVEL 90 -#define CORRECTNESS_LEVEL 70 -#define IOEVENT_LEVEL 60 -#define EVENT_LEVEL 50 -#define CREATION_LEVEL 20 - -#define TRACE DLVL(TRACE_LEVEL) -#define CORRECTNESS DLVL(CORRECTNESS_LEVEL) -#define IOEVENT DLVL(IOEVENT_LEVEL) -#define EVENT DLVL(EVENT_LEVEL) -#define CREATION DLVL(CREATION_LEVEL) - -typedef isc_event_t intev_t; - -#define SOCKET_MAGIC ISC_MAGIC('I', 'O', 'i', 'o') -#define VALID_SOCKET(s) ISC_MAGIC_VALID(s, SOCKET_MAGIC) - -/*! - * IPv6 control information. If the socket is an IPv6 socket we want - * to collect the destination address and interface so the client can - * set them on outgoing packets. - */ -#ifdef ISC_PLATFORM_HAVEIN6PKTINFO -#ifndef USE_CMSG -#define USE_CMSG 1 -#endif -#endif - -/*% - * NetBSD and FreeBSD can timestamp packets. XXXMLG Should we have - * a setsockopt() like interface to request timestamps, and if the OS - * doesn't do it for us, call gettimeofday() on every UDP receive? - */ -#ifdef SO_TIMESTAMP -#ifndef USE_CMSG -#define USE_CMSG 1 -#endif -#endif - -/*% - * The size to raise the receive buffer to (from BIND 8). - */ -#define RCVBUFSIZE (32*1024) - -/*% - * The number of times a send operation is repeated if the result is EINTR. - */ -#define NRETRIES 10 - -typedef struct isc__socket isc__socket_t; -typedef struct isc__socketmgr isc__socketmgr_t; - -#define NEWCONNSOCK(ev) ((isc__socket_t *)(ev)->newsocket) - -struct isc__socket { - /* Not locked. */ - isc_socket_t common; - isc__socketmgr_t *manager; - isc_mutex_t lock; - isc_sockettype_t type; - const isc_statscounter_t *statsindex; - - /* Locked by socket lock. */ - ISC_LINK(isc__socket_t) link; - unsigned int references; - int fd; - int pf; - char name[16]; - void * tag; - - ISC_LIST(isc_socketevent_t) send_list; - ISC_LIST(isc_socketevent_t) recv_list; - ISC_LIST(isc_socket_newconnev_t) accept_list; - isc_socket_connev_t *connect_ev; - - /* - * Internal events. Posted when a descriptor is readable or - * writable. These are statically allocated and never freed. - * They will be set to non-purgable before use. - */ - intev_t readable_ev; - intev_t writable_ev; - - isc_sockaddr_t peer_address; /* remote address */ - - unsigned int pending_recv : 1, - pending_send : 1, - pending_accept : 1, - listener : 1, /* listener socket */ - connected : 1, - connecting : 1, /* connect pending */ - bound : 1, /* bound to local addr */ - dupped : 1; - -#ifdef ISC_NET_RECVOVERFLOW - unsigned char overflow; /* used for MSG_TRUNC fake */ -#endif - - char *recvcmsgbuf; - ISC_SOCKADDR_LEN_T recvcmsgbuflen; - char *sendcmsgbuf; - ISC_SOCKADDR_LEN_T sendcmsgbuflen; - - void *fdwatcharg; - isc_sockfdwatch_t fdwatchcb; - int fdwatchflags; - isc_task_t *fdwatchtask; -}; - -#define SOCKET_MANAGER_MAGIC ISC_MAGIC('I', 'O', 'm', 'g') -#define VALID_MANAGER(m) ISC_MAGIC_VALID(m, SOCKET_MANAGER_MAGIC) - -struct isc__socketmgr { - /* Not locked. */ - isc_socketmgr_t common; - isc_mem_t *mctx; - isc_mutex_t lock; - isc_mutex_t *fdlock; - isc_stats_t *stats; -#ifdef USE_KQUEUE - int kqueue_fd; - int nevents; - struct kevent *events; -#endif /* USE_KQUEUE */ -#ifdef USE_EPOLL - int epoll_fd; - int nevents; - struct epoll_event *events; -#endif /* USE_EPOLL */ -#ifdef USE_DEVPOLL - int devpoll_fd; - int nevents; - struct pollfd *events; -#endif /* USE_DEVPOLL */ -#ifdef USE_SELECT - int fd_bufsize; -#endif /* USE_SELECT */ - unsigned int maxsocks; -#ifdef ISC_PLATFORM_USETHREADS - int pipe_fds[2]; -#endif - - /* Locked by fdlock. */ - isc__socket_t **fds; - int *fdstate; -#ifdef USE_DEVPOLL - pollinfo_t *fdpollinfo; -#endif - - /* Locked by manager lock. */ - ISC_LIST(isc__socket_t) socklist; -#ifdef USE_SELECT - fd_set *read_fds; - fd_set *read_fds_copy; - fd_set *write_fds; - fd_set *write_fds_copy; - int maxfd; -#endif /* USE_SELECT */ - int reserved; /* unlocked */ -#ifdef USE_WATCHER_THREAD - isc_thread_t watcher; - isc_condition_t shutdown_ok; -#else /* USE_WATCHER_THREAD */ - unsigned int refs; -#endif /* USE_WATCHER_THREAD */ - int maxudp; -}; - -#ifdef USE_SHARED_MANAGER -static isc__socketmgr_t *socketmgr = NULL; -#endif /* USE_SHARED_MANAGER */ - -#define CLOSED 0 /* this one must be zero */ -#define MANAGED 1 -#define CLOSE_PENDING 2 - -/* - * send() and recv() iovec counts - */ -#define MAXSCATTERGATHER_SEND (ISC_SOCKET_MAXSCATTERGATHER) -#ifdef ISC_NET_RECVOVERFLOW -# define MAXSCATTERGATHER_RECV (ISC_SOCKET_MAXSCATTERGATHER + 1) -#else -# define MAXSCATTERGATHER_RECV (ISC_SOCKET_MAXSCATTERGATHER) -#endif - -static isc_result_t socket_create(isc_socketmgr_t *manager0, int pf, - isc_sockettype_t type, - isc_socket_t **socketp, - isc_socket_t *dup_socket); -static void send_recvdone_event(isc__socket_t *, isc_socketevent_t **); -static void send_senddone_event(isc__socket_t *, isc_socketevent_t **); -static void free_socket(isc__socket_t **); -static isc_result_t allocate_socket(isc__socketmgr_t *, isc_sockettype_t, - isc__socket_t **); -static void destroy(isc__socket_t **); -static void internal_accept(isc_task_t *, isc_event_t *); -static void internal_connect(isc_task_t *, isc_event_t *); -static void internal_recv(isc_task_t *, isc_event_t *); -static void internal_send(isc_task_t *, isc_event_t *); -static void internal_fdwatch_write(isc_task_t *, isc_event_t *); -static void internal_fdwatch_read(isc_task_t *, isc_event_t *); -static void process_cmsg(isc__socket_t *, struct msghdr *, isc_socketevent_t *); -static void build_msghdr_send(isc__socket_t *, isc_socketevent_t *, - struct msghdr *, struct iovec *, size_t *); -static void build_msghdr_recv(isc__socket_t *, isc_socketevent_t *, - struct msghdr *, struct iovec *, size_t *); -#ifdef USE_WATCHER_THREAD -static isc_boolean_t process_ctlfd(isc__socketmgr_t *manager); -#endif - -/*% - * The following can be either static or public, depending on build environment. - */ - -#ifdef BIND9 -#define ISC_SOCKETFUNC_SCOPE -#else -#define ISC_SOCKETFUNC_SCOPE static -#endif - -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type, - isc_socket_t **socketp); -ISC_SOCKETFUNC_SCOPE void -isc__socket_attach(isc_socket_t *sock, isc_socket_t **socketp); -ISC_SOCKETFUNC_SCOPE void -isc__socket_detach(isc_socket_t **socketp); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp, - unsigned int maxsocks); -ISC_SOCKETFUNC_SCOPE void -isc__socketmgr_destroy(isc_socketmgr_t **managerp); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_recvv(isc_socket_t *sock, isc_bufferlist_t *buflist, - unsigned int minimum, isc_task_t *task, - isc_taskaction_t action, const void *arg); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_recv(isc_socket_t *sock, isc_region_t *region, - unsigned int minimum, isc_task_t *task, - isc_taskaction_t action, const void *arg); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_recv2(isc_socket_t *sock, isc_region_t *region, - unsigned int minimum, isc_task_t *task, - isc_socketevent_t *event, unsigned int flags); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_send(isc_socket_t *sock, isc_region_t *region, - isc_task_t *task, isc_taskaction_t action, const void *arg); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_sendto(isc_socket_t *sock, isc_region_t *region, - isc_task_t *task, isc_taskaction_t action, const void *arg, - isc_sockaddr_t *address, struct in6_pktinfo *pktinfo); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, const void *arg); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, const void *arg, - isc_sockaddr_t *address, struct in6_pktinfo *pktinfo); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_sendto2(isc_socket_t *sock, isc_region_t *region, - isc_task_t *task, - isc_sockaddr_t *address, struct in6_pktinfo *pktinfo, - isc_socketevent_t *event, unsigned int flags); -ISC_SOCKETFUNC_SCOPE void -isc__socket_cleanunix(isc_sockaddr_t *sockaddr, isc_boolean_t active); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_permunix(isc_sockaddr_t *sockaddr, isc_uint32_t perm, - isc_uint32_t owner, isc_uint32_t group); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_bind(isc_socket_t *sock, isc_sockaddr_t *sockaddr, - unsigned int options); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_filter(isc_socket_t *sock, const char *filter); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_listen(isc_socket_t *sock, unsigned int backlog); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_accept(isc_socket_t *sock, - isc_task_t *task, isc_taskaction_t action, const void *arg); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr, - isc_task_t *task, isc_taskaction_t action, - const void *arg); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_getpeername(isc_socket_t *sock, isc_sockaddr_t *addressp); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_getsockname(isc_socket_t *sock, isc_sockaddr_t *addressp); -ISC_SOCKETFUNC_SCOPE void -isc__socket_cancel(isc_socket_t *sock, isc_task_t *task, unsigned int how); -ISC_SOCKETFUNC_SCOPE isc_sockettype_t -isc__socket_gettype(isc_socket_t *sock); -ISC_SOCKETFUNC_SCOPE isc_boolean_t -isc__socket_isbound(isc_socket_t *sock); -ISC_SOCKETFUNC_SCOPE void -isc__socket_ipv6only(isc_socket_t *sock, isc_boolean_t yes); -#if defined(HAVE_LIBXML2) && defined(BIND9) -ISC_SOCKETFUNC_SCOPE void -isc__socketmgr_renderxml(isc_socketmgr_t *mgr0, xmlTextWriterPtr writer); -#endif - -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_fdwatchcreate(isc_socketmgr_t *manager, int fd, int flags, - isc_sockfdwatch_t callback, void *cbarg, - isc_task_t *task, isc_socket_t **socketp); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_fdwatchpoke(isc_socket_t *sock, int flags); -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_dup(isc_socket_t *sock, isc_socket_t **socketp); -ISC_SOCKETFUNC_SCOPE int -isc__socket_getfd(isc_socket_t *sock); - -static struct { - isc_socketmethods_t methods; - - /*% - * The following are defined just for avoiding unused static functions. - */ -#ifndef BIND9 - void *recvv, *send, *sendv, *sendto2, *cleanunix, *permunix, *filter, - *listen, *accept, *getpeername, *isbound; -#endif -} socketmethods = { - { - isc__socket_attach, - isc__socket_detach, - isc__socket_bind, - isc__socket_sendto, - isc__socket_connect, - isc__socket_recv, - isc__socket_cancel, - isc__socket_getsockname, - isc__socket_gettype, - isc__socket_ipv6only, - isc__socket_fdwatchpoke, - isc__socket_dup, - isc__socket_getfd - } -#ifndef BIND9 - , - (void *)isc__socket_recvv, (void *)isc__socket_send, - (void *)isc__socket_sendv, (void *)isc__socket_sendto2, - (void *)isc__socket_cleanunix, (void *)isc__socket_permunix, - (void *)isc__socket_filter, (void *)isc__socket_listen, - (void *)isc__socket_accept, (void *)isc__socket_getpeername, - (void *)isc__socket_isbound -#endif -}; - -static isc_socketmgrmethods_t socketmgrmethods = { - isc__socketmgr_destroy, - isc__socket_create, - isc__socket_fdwatchcreate -}; - -#define SELECT_POKE_SHUTDOWN (-1) -#define SELECT_POKE_NOTHING (-2) -#define SELECT_POKE_READ (-3) -#define SELECT_POKE_ACCEPT (-3) /*%< Same as _READ */ -#define SELECT_POKE_WRITE (-4) -#define SELECT_POKE_CONNECT (-4) /*%< Same as _WRITE */ -#define SELECT_POKE_CLOSE (-5) - -#define SOCK_DEAD(s) ((s)->references == 0) - -/*% - * Shortcut index arrays to get access to statistics counters. - */ -enum { - STATID_OPEN = 0, - STATID_OPENFAIL = 1, - STATID_CLOSE = 2, - STATID_BINDFAIL = 3, - STATID_CONNECTFAIL = 4, - STATID_CONNECT = 5, - STATID_ACCEPTFAIL = 6, - STATID_ACCEPT = 7, - STATID_SENDFAIL = 8, - STATID_RECVFAIL = 9 -}; -static const isc_statscounter_t upd4statsindex[] = { - isc_sockstatscounter_udp4open, - isc_sockstatscounter_udp4openfail, - isc_sockstatscounter_udp4close, - isc_sockstatscounter_udp4bindfail, - isc_sockstatscounter_udp4connectfail, - isc_sockstatscounter_udp4connect, - -1, - -1, - isc_sockstatscounter_udp4sendfail, - isc_sockstatscounter_udp4recvfail -}; -static const isc_statscounter_t upd6statsindex[] = { - isc_sockstatscounter_udp6open, - isc_sockstatscounter_udp6openfail, - isc_sockstatscounter_udp6close, - isc_sockstatscounter_udp6bindfail, - isc_sockstatscounter_udp6connectfail, - isc_sockstatscounter_udp6connect, - -1, - -1, - isc_sockstatscounter_udp6sendfail, - isc_sockstatscounter_udp6recvfail -}; -static const isc_statscounter_t tcp4statsindex[] = { - isc_sockstatscounter_tcp4open, - isc_sockstatscounter_tcp4openfail, - isc_sockstatscounter_tcp4close, - isc_sockstatscounter_tcp4bindfail, - isc_sockstatscounter_tcp4connectfail, - isc_sockstatscounter_tcp4connect, - isc_sockstatscounter_tcp4acceptfail, - isc_sockstatscounter_tcp4accept, - isc_sockstatscounter_tcp4sendfail, - isc_sockstatscounter_tcp4recvfail -}; -static const isc_statscounter_t tcp6statsindex[] = { - isc_sockstatscounter_tcp6open, - isc_sockstatscounter_tcp6openfail, - isc_sockstatscounter_tcp6close, - isc_sockstatscounter_tcp6bindfail, - isc_sockstatscounter_tcp6connectfail, - isc_sockstatscounter_tcp6connect, - isc_sockstatscounter_tcp6acceptfail, - isc_sockstatscounter_tcp6accept, - isc_sockstatscounter_tcp6sendfail, - isc_sockstatscounter_tcp6recvfail -}; -static const isc_statscounter_t unixstatsindex[] = { - isc_sockstatscounter_unixopen, - isc_sockstatscounter_unixopenfail, - isc_sockstatscounter_unixclose, - isc_sockstatscounter_unixbindfail, - isc_sockstatscounter_unixconnectfail, - isc_sockstatscounter_unixconnect, - isc_sockstatscounter_unixacceptfail, - isc_sockstatscounter_unixaccept, - isc_sockstatscounter_unixsendfail, - isc_sockstatscounter_unixrecvfail -}; -static const isc_statscounter_t fdwatchstatsindex[] = { - -1, - -1, - isc_sockstatscounter_fdwatchclose, - isc_sockstatscounter_fdwatchbindfail, - isc_sockstatscounter_fdwatchconnectfail, - isc_sockstatscounter_fdwatchconnect, - -1, - -1, - isc_sockstatscounter_fdwatchsendfail, - isc_sockstatscounter_fdwatchrecvfail -}; - -#if defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL) || \ - defined(USE_WATCHER_THREAD) -static void -manager_log(isc__socketmgr_t *sockmgr, - isc_logcategory_t *category, isc_logmodule_t *module, int level, - const char *fmt, ...) ISC_FORMAT_PRINTF(5, 6); -static void -manager_log(isc__socketmgr_t *sockmgr, - isc_logcategory_t *category, isc_logmodule_t *module, int level, - const char *fmt, ...) -{ - char msgbuf[2048]; - va_list ap; - - if (! isc_log_wouldlog(isc_lctx, level)) - return; - - va_start(ap, fmt); - vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap); - va_end(ap); - - isc_log_write(isc_lctx, category, module, level, - "sockmgr %p: %s", sockmgr, msgbuf); -} -#endif - -static void -socket_log(isc__socket_t *sock, isc_sockaddr_t *address, - isc_logcategory_t *category, isc_logmodule_t *module, int level, - isc_msgcat_t *msgcat, int msgset, int message, - const char *fmt, ...) ISC_FORMAT_PRINTF(9, 10); -static void -socket_log(isc__socket_t *sock, isc_sockaddr_t *address, - isc_logcategory_t *category, isc_logmodule_t *module, int level, - isc_msgcat_t *msgcat, int msgset, int message, - const char *fmt, ...) -{ - char msgbuf[2048]; - char peerbuf[ISC_SOCKADDR_FORMATSIZE]; - va_list ap; - - if (! isc_log_wouldlog(isc_lctx, level)) - return; - - va_start(ap, fmt); - vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap); - va_end(ap); - - if (address == NULL) { - isc_log_iwrite(isc_lctx, category, module, level, - msgcat, msgset, message, - "socket %p: %s", sock, msgbuf); - } else { - isc_sockaddr_format(address, peerbuf, sizeof(peerbuf)); - isc_log_iwrite(isc_lctx, category, module, level, - msgcat, msgset, message, - "socket %p %s: %s", sock, peerbuf, msgbuf); - } -} - -#if defined(_AIX) && defined(ISC_NET_BSD44MSGHDR) && \ - defined(USE_CMSG) && defined(IPV6_RECVPKTINFO) -/* - * AIX has a kernel bug where IPV6_RECVPKTINFO gets cleared by - * setting IPV6_V6ONLY. - */ -static void -FIX_IPV6_RECVPKTINFO(isc__socket_t *sock) -{ - char strbuf[ISC_STRERRORSIZE]; - int on = 1; - - if (sock->pf != AF_INET6 || sock->type != isc_sockettype_udp) - return; - - if (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, - (void *)&on, sizeof(on)) < 0) { - - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "setsockopt(%d, IPV6_RECVPKTINFO) " - "%s: %s", sock->fd, - isc_msgcat_get(isc_msgcat, - ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, - "failed"), - strbuf); - } -} -#else -#define FIX_IPV6_RECVPKTINFO(sock) (void)0 -#endif - -/*% - * Increment socket-related statistics counters. - */ -static inline void -inc_stats(isc_stats_t *stats, isc_statscounter_t counterid) { - REQUIRE(counterid != -1); - - if (stats != NULL) - isc_stats_increment(stats, counterid); -} - -static inline isc_result_t -watch_fd(isc__socketmgr_t *manager, int fd, int msg) { - isc_result_t result = ISC_R_SUCCESS; - -#ifdef USE_KQUEUE - struct kevent evchange; - - memset(&evchange, 0, sizeof(evchange)); - if (msg == SELECT_POKE_READ) - evchange.filter = EVFILT_READ; - else - evchange.filter = EVFILT_WRITE; - evchange.flags = EV_ADD; - evchange.ident = fd; - if (kevent(manager->kqueue_fd, &evchange, 1, NULL, 0, NULL) != 0) - result = isc__errno2result(errno); - - return (result); -#elif defined(USE_EPOLL) - struct epoll_event event; - - if (msg == SELECT_POKE_READ) - event.events = EPOLLIN; - else - event.events = EPOLLOUT; - memset(&event.data, 0, sizeof(event.data)); - event.data.fd = fd; - if (epoll_ctl(manager->epoll_fd, EPOLL_CTL_ADD, fd, &event) == -1 && - errno != EEXIST) { - result = isc__errno2result(errno); - } - - return (result); -#elif defined(USE_DEVPOLL) - struct pollfd pfd; - int lockid = FDLOCK_ID(fd); - - memset(&pfd, 0, sizeof(pfd)); - if (msg == SELECT_POKE_READ) - pfd.events = POLLIN; - else - pfd.events = POLLOUT; - pfd.fd = fd; - pfd.revents = 0; - LOCK(&manager->fdlock[lockid]); - if (write(manager->devpoll_fd, &pfd, sizeof(pfd)) == -1) - result = isc__errno2result(errno); - else { - if (msg == SELECT_POKE_READ) - manager->fdpollinfo[fd].want_read = 1; - else - manager->fdpollinfo[fd].want_write = 1; - } - UNLOCK(&manager->fdlock[lockid]); - - return (result); -#elif defined(USE_SELECT) - LOCK(&manager->lock); - if (msg == SELECT_POKE_READ) - FD_SET(fd, manager->read_fds); - if (msg == SELECT_POKE_WRITE) - FD_SET(fd, manager->write_fds); - UNLOCK(&manager->lock); - - return (result); -#endif -} - -static inline isc_result_t -unwatch_fd(isc__socketmgr_t *manager, int fd, int msg) { - isc_result_t result = ISC_R_SUCCESS; - -#ifdef USE_KQUEUE - struct kevent evchange; - - memset(&evchange, 0, sizeof(evchange)); - if (msg == SELECT_POKE_READ) - evchange.filter = EVFILT_READ; - else - evchange.filter = EVFILT_WRITE; - evchange.flags = EV_DELETE; - evchange.ident = fd; - if (kevent(manager->kqueue_fd, &evchange, 1, NULL, 0, NULL) != 0) - result = isc__errno2result(errno); - - return (result); -#elif defined(USE_EPOLL) - struct epoll_event event; - - if (msg == SELECT_POKE_READ) - event.events = EPOLLIN; - else - event.events = EPOLLOUT; - memset(&event.data, 0, sizeof(event.data)); - event.data.fd = fd; - if (epoll_ctl(manager->epoll_fd, EPOLL_CTL_DEL, fd, &event) == -1 && - errno != ENOENT) { - char strbuf[ISC_STRERRORSIZE]; - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "epoll_ctl(DEL), %d: %s", fd, strbuf); - result = ISC_R_UNEXPECTED; - } - return (result); -#elif defined(USE_DEVPOLL) - struct pollfd pfds[2]; - size_t writelen = sizeof(pfds[0]); - int lockid = FDLOCK_ID(fd); - - memset(pfds, 0, sizeof(pfds)); - pfds[0].events = POLLREMOVE; - pfds[0].fd = fd; - - /* - * Canceling read or write polling via /dev/poll is tricky. Since it - * only provides a way of canceling per FD, we may need to re-poll the - * socket for the other operation. - */ - LOCK(&manager->fdlock[lockid]); - if (msg == SELECT_POKE_READ && - manager->fdpollinfo[fd].want_write == 1) { - pfds[1].events = POLLOUT; - pfds[1].fd = fd; - writelen += sizeof(pfds[1]); - } - if (msg == SELECT_POKE_WRITE && - manager->fdpollinfo[fd].want_read == 1) { - pfds[1].events = POLLIN; - pfds[1].fd = fd; - writelen += sizeof(pfds[1]); - } - - if (write(manager->devpoll_fd, pfds, writelen) == -1) - result = isc__errno2result(errno); - else { - if (msg == SELECT_POKE_READ) - manager->fdpollinfo[fd].want_read = 0; - else - manager->fdpollinfo[fd].want_write = 0; - } - UNLOCK(&manager->fdlock[lockid]); - - return (result); -#elif defined(USE_SELECT) - LOCK(&manager->lock); - if (msg == SELECT_POKE_READ) - FD_CLR(fd, manager->read_fds); - else if (msg == SELECT_POKE_WRITE) - FD_CLR(fd, manager->write_fds); - UNLOCK(&manager->lock); - - return (result); -#endif -} - -static void -wakeup_socket(isc__socketmgr_t *manager, int fd, int msg) { - isc_result_t result; - int lockid = FDLOCK_ID(fd); - - /* - * This is a wakeup on a socket. If the socket is not in the - * process of being closed, start watching it for either reads - * or writes. - */ - - INSIST(fd >= 0 && fd < (int)manager->maxsocks); - - if (msg == SELECT_POKE_CLOSE) { - /* No one should be updating fdstate, so no need to lock it */ - INSIST(manager->fdstate[fd] == CLOSE_PENDING); - manager->fdstate[fd] = CLOSED; - (void)unwatch_fd(manager, fd, SELECT_POKE_READ); - (void)unwatch_fd(manager, fd, SELECT_POKE_WRITE); - (void)close(fd); - return; - } - - LOCK(&manager->fdlock[lockid]); - if (manager->fdstate[fd] == CLOSE_PENDING) { - UNLOCK(&manager->fdlock[lockid]); - - /* - * We accept (and ignore) any error from unwatch_fd() as we are - * closing the socket, hoping it doesn't leave dangling state in - * the kernel. - * Note that unwatch_fd() must be called after releasing the - * fdlock; otherwise it could cause deadlock due to a lock order - * reversal. - */ - (void)unwatch_fd(manager, fd, SELECT_POKE_READ); - (void)unwatch_fd(manager, fd, SELECT_POKE_WRITE); - return; - } - if (manager->fdstate[fd] != MANAGED) { - UNLOCK(&manager->fdlock[lockid]); - return; - } - UNLOCK(&manager->fdlock[lockid]); - - /* - * Set requested bit. - */ - result = watch_fd(manager, fd, msg); - if (result != ISC_R_SUCCESS) { - /* - * XXXJT: what should we do? Ignoring the failure of watching - * a socket will make the application dysfunctional, but there - * seems to be no reasonable recovery process. - */ - isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, - "failed to start watching FD (%d): %s", - fd, isc_result_totext(result)); - } -} - -#ifdef USE_WATCHER_THREAD -/* - * Poke the select loop when there is something for us to do. - * The write is required (by POSIX) to complete. That is, we - * will not get partial writes. - */ -static void -select_poke(isc__socketmgr_t *mgr, int fd, int msg) { - int cc; - int buf[2]; - char strbuf[ISC_STRERRORSIZE]; - - buf[0] = fd; - buf[1] = msg; - - do { - cc = write(mgr->pipe_fds[1], buf, sizeof(buf)); -#ifdef ENOSR - /* - * Treat ENOSR as EAGAIN but loop slowly as it is - * unlikely to clear fast. - */ - if (cc < 0 && errno == ENOSR) { - sleep(1); - errno = EAGAIN; - } -#endif - } while (cc < 0 && SOFT_ERROR(errno)); - - if (cc < 0) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - FATAL_ERROR(__FILE__, __LINE__, - isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_WRITEFAILED, - "write() failed " - "during watcher poke: %s"), - strbuf); - } - - INSIST(cc == sizeof(buf)); -} - -/* - * Read a message on the internal fd. - */ -static void -select_readmsg(isc__socketmgr_t *mgr, int *fd, int *msg) { - int buf[2]; - int cc; - char strbuf[ISC_STRERRORSIZE]; - - cc = read(mgr->pipe_fds[0], buf, sizeof(buf)); - if (cc < 0) { - *msg = SELECT_POKE_NOTHING; - *fd = -1; /* Silence compiler. */ - if (SOFT_ERROR(errno)) - return; - - isc__strerror(errno, strbuf, sizeof(strbuf)); - FATAL_ERROR(__FILE__, __LINE__, - isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_READFAILED, - "read() failed " - "during watcher poke: %s"), - strbuf); - - return; - } - INSIST(cc == sizeof(buf)); - - *fd = buf[0]; - *msg = buf[1]; -} -#else /* USE_WATCHER_THREAD */ -/* - * Update the state of the socketmgr when something changes. - */ -static void -select_poke(isc__socketmgr_t *manager, int fd, int msg) { - if (msg == SELECT_POKE_SHUTDOWN) - return; - else if (fd >= 0) - wakeup_socket(manager, fd, msg); - return; -} -#endif /* USE_WATCHER_THREAD */ - -/* - * Make a fd non-blocking. - */ -static isc_result_t -make_nonblock(int fd) { - int ret; - int flags; - char strbuf[ISC_STRERRORSIZE]; -#ifdef USE_FIONBIO_IOCTL - int on = 1; - - ret = ioctl(fd, FIONBIO, (char *)&on); -#else - flags = fcntl(fd, F_GETFL, 0); - flags |= PORT_NONBLOCK; - ret = fcntl(fd, F_SETFL, flags); -#endif - - if (ret == -1) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, -#ifdef USE_FIONBIO_IOCTL - "ioctl(%d, FIONBIO, &on): %s", fd, -#else - "fcntl(%d, F_SETFL, %d): %s", fd, flags, -#endif - strbuf); - - return (ISC_R_UNEXPECTED); - } - - return (ISC_R_SUCCESS); -} - -#ifdef USE_CMSG -/* - * Not all OSes support advanced CMSG macros: CMSG_LEN and CMSG_SPACE. - * In order to ensure as much portability as possible, we provide wrapper - * functions of these macros. - * Note that cmsg_space() could run slow on OSes that do not have - * CMSG_SPACE. - */ -static inline ISC_SOCKADDR_LEN_T -cmsg_len(ISC_SOCKADDR_LEN_T len) { -#ifdef CMSG_LEN - return (CMSG_LEN(len)); -#else - ISC_SOCKADDR_LEN_T hdrlen; - - /* - * Cast NULL so that any pointer arithmetic performed by CMSG_DATA - * is correct. - */ - hdrlen = (ISC_SOCKADDR_LEN_T)CMSG_DATA(((struct cmsghdr *)NULL)); - return (hdrlen + len); -#endif -} - -static inline ISC_SOCKADDR_LEN_T -cmsg_space(ISC_SOCKADDR_LEN_T len) { -#ifdef CMSG_SPACE - return (CMSG_SPACE(len)); -#else - struct msghdr msg; - struct cmsghdr *cmsgp; - /* - * XXX: The buffer length is an ad-hoc value, but should be enough - * in a practical sense. - */ - char dummybuf[sizeof(struct cmsghdr) + 1024]; - - memset(&msg, 0, sizeof(msg)); - msg.msg_control = dummybuf; - msg.msg_controllen = sizeof(dummybuf); - - cmsgp = (struct cmsghdr *)dummybuf; - cmsgp->cmsg_len = cmsg_len(len); - - cmsgp = CMSG_NXTHDR(&msg, cmsgp); - if (cmsgp != NULL) - return ((char *)cmsgp - (char *)msg.msg_control); - else - return (0); -#endif -} -#endif /* USE_CMSG */ - -/* - * Process control messages received on a socket. - */ -static void -process_cmsg(isc__socket_t *sock, struct msghdr *msg, isc_socketevent_t *dev) { -#ifdef USE_CMSG - struct cmsghdr *cmsgp; -#ifdef ISC_PLATFORM_HAVEIN6PKTINFO - struct in6_pktinfo *pktinfop; -#endif -#ifdef SO_TIMESTAMP - struct timeval *timevalp; -#endif -#endif - - /* - * sock is used only when ISC_NET_BSD44MSGHDR and USE_CMSG are defined. - * msg and dev are used only when ISC_NET_BSD44MSGHDR is defined. - * They are all here, outside of the CPP tests, because it is - * more consistent with the usual ISC coding style. - */ - UNUSED(sock); - UNUSED(msg); - UNUSED(dev); - -#ifdef ISC_NET_BSD44MSGHDR - -#ifdef MSG_TRUNC - if ((msg->msg_flags & MSG_TRUNC) == MSG_TRUNC) - dev->attributes |= ISC_SOCKEVENTATTR_TRUNC; -#endif - -#ifdef MSG_CTRUNC - if ((msg->msg_flags & MSG_CTRUNC) == MSG_CTRUNC) - dev->attributes |= ISC_SOCKEVENTATTR_CTRUNC; -#endif - -#ifndef USE_CMSG - return; -#else - if (msg->msg_controllen == 0U || msg->msg_control == NULL) - return; - -#ifdef SO_TIMESTAMP - timevalp = NULL; -#endif -#ifdef ISC_PLATFORM_HAVEIN6PKTINFO - pktinfop = NULL; -#endif - - cmsgp = CMSG_FIRSTHDR(msg); - while (cmsgp != NULL) { - socket_log(sock, NULL, TRACE, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_PROCESSCMSG, - "processing cmsg %p", cmsgp); - -#ifdef ISC_PLATFORM_HAVEIN6PKTINFO - if (cmsgp->cmsg_level == IPPROTO_IPV6 - && cmsgp->cmsg_type == IPV6_PKTINFO) { - - pktinfop = (struct in6_pktinfo *)CMSG_DATA(cmsgp); - memcpy(&dev->pktinfo, pktinfop, - sizeof(struct in6_pktinfo)); - dev->attributes |= ISC_SOCKEVENTATTR_PKTINFO; - socket_log(sock, NULL, TRACE, - isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_IFRECEIVED, - "interface received on ifindex %u", - dev->pktinfo.ipi6_ifindex); - if (IN6_IS_ADDR_MULTICAST(&pktinfop->ipi6_addr)) - dev->attributes |= ISC_SOCKEVENTATTR_MULTICAST; - goto next; - } -#endif - -#ifdef SO_TIMESTAMP - if (cmsgp->cmsg_level == SOL_SOCKET - && cmsgp->cmsg_type == SCM_TIMESTAMP) { - timevalp = (struct timeval *)CMSG_DATA(cmsgp); - dev->timestamp.seconds = timevalp->tv_sec; - dev->timestamp.nanoseconds = timevalp->tv_usec * 1000; - dev->attributes |= ISC_SOCKEVENTATTR_TIMESTAMP; - goto next; - } -#endif - - next: - cmsgp = CMSG_NXTHDR(msg, cmsgp); - } -#endif /* USE_CMSG */ - -#endif /* ISC_NET_BSD44MSGHDR */ -} - -/* - * Construct an iov array and attach it to the msghdr passed in. This is - * the SEND constructor, which will use the used region of the buffer - * (if using a buffer list) or will use the internal region (if a single - * buffer I/O is requested). - * - * Nothing can be NULL, and the done event must list at least one buffer - * on the buffer linked list for this function to be meaningful. - * - * If write_countp != NULL, *write_countp will hold the number of bytes - * this transaction can send. - */ -static void -build_msghdr_send(isc__socket_t *sock, isc_socketevent_t *dev, - struct msghdr *msg, struct iovec *iov, size_t *write_countp) -{ - unsigned int iovcount; - isc_buffer_t *buffer; - isc_region_t used; - size_t write_count; - size_t skip_count; - - memset(msg, 0, sizeof(*msg)); - - if (!sock->connected) { - msg->msg_name = (void *)&dev->address.type.sa; - msg->msg_namelen = dev->address.length; - } else { - msg->msg_name = NULL; - msg->msg_namelen = 0; - } - - buffer = ISC_LIST_HEAD(dev->bufferlist); - write_count = 0; - iovcount = 0; - - /* - * Single buffer I/O? Skip what we've done so far in this region. - */ - if (buffer == NULL) { - write_count = dev->region.length - dev->n; - iov[0].iov_base = (void *)(dev->region.base + dev->n); - iov[0].iov_len = write_count; - iovcount = 1; - - goto config; - } - - /* - * Multibuffer I/O. - * Skip the data in the buffer list that we have already written. - */ - skip_count = dev->n; - while (buffer != NULL) { - REQUIRE(ISC_BUFFER_VALID(buffer)); - if (skip_count < isc_buffer_usedlength(buffer)) - break; - skip_count -= isc_buffer_usedlength(buffer); - buffer = ISC_LIST_NEXT(buffer, link); - } - - while (buffer != NULL) { - INSIST(iovcount < MAXSCATTERGATHER_SEND); - - isc_buffer_usedregion(buffer, &used); - - if (used.length > 0) { - iov[iovcount].iov_base = (void *)(used.base - + skip_count); - iov[iovcount].iov_len = used.length - skip_count; - write_count += (used.length - skip_count); - skip_count = 0; - iovcount++; - } - buffer = ISC_LIST_NEXT(buffer, link); - } - - INSIST(skip_count == 0U); - - config: - msg->msg_iov = iov; - msg->msg_iovlen = iovcount; - -#ifdef ISC_NET_BSD44MSGHDR - msg->msg_control = NULL; - msg->msg_controllen = 0; - msg->msg_flags = 0; -#if defined(USE_CMSG) && defined(ISC_PLATFORM_HAVEIN6PKTINFO) - if ((sock->type == isc_sockettype_udp) - && ((dev->attributes & ISC_SOCKEVENTATTR_PKTINFO) != 0)) { -#if defined(IPV6_USE_MIN_MTU) - int use_min_mtu = 1; /* -1, 0, 1 */ -#endif - struct cmsghdr *cmsgp; - struct in6_pktinfo *pktinfop; - - socket_log(sock, NULL, TRACE, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_SENDTODATA, - "sendto pktinfo data, ifindex %u", - dev->pktinfo.ipi6_ifindex); - - msg->msg_controllen = cmsg_space(sizeof(struct in6_pktinfo)); - INSIST(msg->msg_controllen <= sock->sendcmsgbuflen); - msg->msg_control = (void *)sock->sendcmsgbuf; - - cmsgp = (struct cmsghdr *)sock->sendcmsgbuf; - cmsgp->cmsg_level = IPPROTO_IPV6; - cmsgp->cmsg_type = IPV6_PKTINFO; - cmsgp->cmsg_len = cmsg_len(sizeof(struct in6_pktinfo)); - pktinfop = (struct in6_pktinfo *)CMSG_DATA(cmsgp); - memcpy(pktinfop, &dev->pktinfo, sizeof(struct in6_pktinfo)); -#if defined(IPV6_USE_MIN_MTU) - /* - * Set IPV6_USE_MIN_MTU as a per packet option as FreeBSD - * ignores setsockopt(IPV6_USE_MIN_MTU) when IPV6_PKTINFO - * is used. - */ - cmsgp = (struct cmsghdr *)(sock->sendcmsgbuf + - msg->msg_controllen); - msg->msg_controllen += cmsg_space(sizeof(use_min_mtu)); - INSIST(msg->msg_controllen <= sock->sendcmsgbuflen); - - cmsgp->cmsg_level = IPPROTO_IPV6; - cmsgp->cmsg_type = IPV6_USE_MIN_MTU; - cmsgp->cmsg_len = cmsg_len(sizeof(use_min_mtu)); - memcpy(CMSG_DATA(cmsgp), &use_min_mtu, sizeof(use_min_mtu)); -#endif - } -#endif /* USE_CMSG && ISC_PLATFORM_HAVEIPV6 */ -#else /* ISC_NET_BSD44MSGHDR */ - msg->msg_accrights = NULL; - msg->msg_accrightslen = 0; -#endif /* ISC_NET_BSD44MSGHDR */ - - if (write_countp != NULL) - *write_countp = write_count; -} - -/* - * Construct an iov array and attach it to the msghdr passed in. This is - * the RECV constructor, which will use the available region of the buffer - * (if using a buffer list) or will use the internal region (if a single - * buffer I/O is requested). - * - * Nothing can be NULL, and the done event must list at least one buffer - * on the buffer linked list for this function to be meaningful. - * - * If read_countp != NULL, *read_countp will hold the number of bytes - * this transaction can receive. - */ -static void -build_msghdr_recv(isc__socket_t *sock, isc_socketevent_t *dev, - struct msghdr *msg, struct iovec *iov, size_t *read_countp) -{ - unsigned int iovcount; - isc_buffer_t *buffer; - isc_region_t available; - size_t read_count; - - memset(msg, 0, sizeof(struct msghdr)); - - if (sock->type == isc_sockettype_udp) { - memset(&dev->address, 0, sizeof(dev->address)); -#ifdef BROKEN_RECVMSG - if (sock->pf == AF_INET) { - msg->msg_name = (void *)&dev->address.type.sin; - msg->msg_namelen = sizeof(dev->address.type.sin6); - } else if (sock->pf == AF_INET6) { - msg->msg_name = (void *)&dev->address.type.sin6; - msg->msg_namelen = sizeof(dev->address.type.sin6); -#ifdef ISC_PLATFORM_HAVESYSUNH - } else if (sock->pf == AF_UNIX) { - msg->msg_name = (void *)&dev->address.type.sunix; - msg->msg_namelen = sizeof(dev->address.type.sunix); -#endif - } else { - msg->msg_name = (void *)&dev->address.type.sa; - msg->msg_namelen = sizeof(dev->address.type); - } -#else - msg->msg_name = (void *)&dev->address.type.sa; - msg->msg_namelen = sizeof(dev->address.type); -#endif -#ifdef ISC_NET_RECVOVERFLOW - /* If needed, steal one iovec for overflow detection. */ - maxiov--; -#endif - } else { /* TCP */ - msg->msg_name = NULL; - msg->msg_namelen = 0; - dev->address = sock->peer_address; - } - - buffer = ISC_LIST_HEAD(dev->bufferlist); - read_count = 0; - - /* - * Single buffer I/O? Skip what we've done so far in this region. - */ - if (buffer == NULL) { - read_count = dev->region.length - dev->n; - iov[0].iov_base = (void *)(dev->region.base + dev->n); - iov[0].iov_len = read_count; - iovcount = 1; - - goto config; - } - - /* - * Multibuffer I/O. - * Skip empty buffers. - */ - while (buffer != NULL) { - REQUIRE(ISC_BUFFER_VALID(buffer)); - if (isc_buffer_availablelength(buffer) != 0) - break; - buffer = ISC_LIST_NEXT(buffer, link); - } - - iovcount = 0; - while (buffer != NULL) { - INSIST(iovcount < MAXSCATTERGATHER_RECV); - - isc_buffer_availableregion(buffer, &available); - - if (available.length > 0) { - iov[iovcount].iov_base = (void *)(available.base); - iov[iovcount].iov_len = available.length; - read_count += available.length; - iovcount++; - } - buffer = ISC_LIST_NEXT(buffer, link); - } - - config: - - /* - * If needed, set up to receive that one extra byte. Note that - * we know there is at least one iov left, since we stole it - * at the top of this function. - */ -#ifdef ISC_NET_RECVOVERFLOW - if (sock->type == isc_sockettype_udp) { - iov[iovcount].iov_base = (void *)(&sock->overflow); - iov[iovcount].iov_len = 1; - iovcount++; - } -#endif - - msg->msg_iov = iov; - msg->msg_iovlen = iovcount; - -#ifdef ISC_NET_BSD44MSGHDR - msg->msg_control = NULL; - msg->msg_controllen = 0; - msg->msg_flags = 0; -#if defined(USE_CMSG) - if (sock->type == isc_sockettype_udp) { - msg->msg_control = sock->recvcmsgbuf; - msg->msg_controllen = sock->recvcmsgbuflen; - } -#endif /* USE_CMSG */ -#else /* ISC_NET_BSD44MSGHDR */ - msg->msg_accrights = NULL; - msg->msg_accrightslen = 0; -#endif /* ISC_NET_BSD44MSGHDR */ - - if (read_countp != NULL) - *read_countp = read_count; -} - -static void -set_dev_address(isc_sockaddr_t *address, isc__socket_t *sock, - isc_socketevent_t *dev) -{ - if (sock->type == isc_sockettype_udp) { - if (address != NULL) - dev->address = *address; - else - dev->address = sock->peer_address; - } else if (sock->type == isc_sockettype_tcp) { - INSIST(address == NULL); - dev->address = sock->peer_address; - } -} - -static void -destroy_socketevent(isc_event_t *event) { - isc_socketevent_t *ev = (isc_socketevent_t *)event; - - INSIST(ISC_LIST_EMPTY(ev->bufferlist)); - - (ev->destroy)(event); -} - -static isc_socketevent_t * -allocate_socketevent(isc__socket_t *sock, isc_eventtype_t eventtype, - isc_taskaction_t action, const void *arg) -{ - isc_socketevent_t *ev; - - ev = (isc_socketevent_t *)isc_event_allocate(sock->manager->mctx, - sock, eventtype, - action, arg, - sizeof(*ev)); - - if (ev == NULL) - return (NULL); - - ev->result = ISC_R_UNSET; - ISC_LINK_INIT(ev, ev_link); - ISC_LIST_INIT(ev->bufferlist); - ev->region.base = NULL; - ev->n = 0; - ev->offset = 0; - ev->attributes = 0; - ev->destroy = ev->ev_destroy; - ev->ev_destroy = destroy_socketevent; - - return (ev); -} - -#if defined(ISC_SOCKET_DEBUG) -static void -dump_msg(struct msghdr *msg) { - unsigned int i; - - printf("MSGHDR %p\n", msg); - printf("\tname %p, namelen %ld\n", msg->msg_name, - (long) msg->msg_namelen); - printf("\tiov %p, iovlen %ld\n", msg->msg_iov, - (long) msg->msg_iovlen); - for (i = 0; i < (unsigned int)msg->msg_iovlen; i++) - printf("\t\t%d\tbase %p, len %ld\n", i, - msg->msg_iov[i].iov_base, - (long) msg->msg_iov[i].iov_len); -#ifdef ISC_NET_BSD44MSGHDR - printf("\tcontrol %p, controllen %ld\n", msg->msg_control, - (long) msg->msg_controllen); -#endif -} -#endif - -#define DOIO_SUCCESS 0 /* i/o ok, event sent */ -#define DOIO_SOFT 1 /* i/o ok, soft error, no event sent */ -#define DOIO_HARD 2 /* i/o error, event sent */ -#define DOIO_EOF 3 /* EOF, no event sent */ - -static int -doio_recv(isc__socket_t *sock, isc_socketevent_t *dev) { - int cc; - struct iovec iov[MAXSCATTERGATHER_RECV]; - size_t read_count; - size_t actual_count; - struct msghdr msghdr; - isc_buffer_t *buffer; - int recv_errno; - char strbuf[ISC_STRERRORSIZE]; - - build_msghdr_recv(sock, dev, &msghdr, iov, &read_count); - -#if defined(ISC_SOCKET_DEBUG) - dump_msg(&msghdr); -#endif - - cc = recvmsg(sock->fd, &msghdr, 0); - recv_errno = errno; - -#if defined(ISC_SOCKET_DEBUG) - dump_msg(&msghdr); -#endif - - if (cc < 0) { - if (SOFT_ERROR(recv_errno)) - return (DOIO_SOFT); - - if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL)) { - isc__strerror(recv_errno, strbuf, sizeof(strbuf)); - socket_log(sock, NULL, IOEVENT, - isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_DOIORECV, - "doio_recv: recvmsg(%d) %d bytes, err %d/%s", - sock->fd, cc, recv_errno, strbuf); - } - -#define SOFT_OR_HARD(_system, _isc) \ - if (recv_errno == _system) { \ - if (sock->connected) { \ - dev->result = _isc; \ - inc_stats(sock->manager->stats, \ - sock->statsindex[STATID_RECVFAIL]); \ - return (DOIO_HARD); \ - } \ - return (DOIO_SOFT); \ - } -#define ALWAYS_HARD(_system, _isc) \ - if (recv_errno == _system) { \ - dev->result = _isc; \ - inc_stats(sock->manager->stats, \ - sock->statsindex[STATID_RECVFAIL]); \ - return (DOIO_HARD); \ - } - - SOFT_OR_HARD(ECONNREFUSED, ISC_R_CONNREFUSED); - SOFT_OR_HARD(ENETUNREACH, ISC_R_NETUNREACH); - SOFT_OR_HARD(EHOSTUNREACH, ISC_R_HOSTUNREACH); - SOFT_OR_HARD(EHOSTDOWN, ISC_R_HOSTDOWN); - /* HPUX 11.11 can return EADDRNOTAVAIL. */ - SOFT_OR_HARD(EADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL); - ALWAYS_HARD(ENOBUFS, ISC_R_NORESOURCES); - /* - * HPUX returns EPROTO and EINVAL on receiving some ICMP/ICMPv6 - * errors. - */ -#ifdef EPROTO - SOFT_OR_HARD(EPROTO, ISC_R_HOSTUNREACH); -#endif - SOFT_OR_HARD(EINVAL, ISC_R_HOSTUNREACH); - -#undef SOFT_OR_HARD -#undef ALWAYS_HARD - - dev->result = isc__errno2result(recv_errno); - inc_stats(sock->manager->stats, - sock->statsindex[STATID_RECVFAIL]); - return (DOIO_HARD); - } - - /* - * On TCP and UNIX sockets, zero length reads indicate EOF, - * while on UDP sockets, zero length reads are perfectly valid, - * although strange. - */ - switch (sock->type) { - case isc_sockettype_tcp: - case isc_sockettype_unix: - if (cc == 0) - return (DOIO_EOF); - break; - case isc_sockettype_udp: - break; - case isc_sockettype_fdwatch: - default: - INSIST(0); - } - - if (sock->type == isc_sockettype_udp) { - dev->address.length = msghdr.msg_namelen; - if (isc_sockaddr_getport(&dev->address) == 0) { - if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL)) { - socket_log(sock, &dev->address, IOEVENT, - isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_ZEROPORT, - "dropping source port zero packet"); - } - return (DOIO_SOFT); - } - /* - * Simulate a firewall blocking UDP responses bigger than - * 512 bytes. - */ - if (sock->manager->maxudp != 0 && cc > sock->manager->maxudp) - return (DOIO_SOFT); - } - - socket_log(sock, &dev->address, IOEVENT, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_PKTRECV, - "packet received correctly"); - - /* - * Overflow bit detection. If we received MORE bytes than we should, - * this indicates an overflow situation. Set the flag in the - * dev entry and adjust how much we read by one. - */ -#ifdef ISC_NET_RECVOVERFLOW - if ((sock->type == isc_sockettype_udp) && ((size_t)cc > read_count)) { - dev->attributes |= ISC_SOCKEVENTATTR_TRUNC; - cc--; - } -#endif - - /* - * If there are control messages attached, run through them and pull - * out the interesting bits. - */ - if (sock->type == isc_sockettype_udp) - process_cmsg(sock, &msghdr, dev); - - /* - * update the buffers (if any) and the i/o count - */ - dev->n += cc; - actual_count = cc; - buffer = ISC_LIST_HEAD(dev->bufferlist); - while (buffer != NULL && actual_count > 0U) { - REQUIRE(ISC_BUFFER_VALID(buffer)); - if (isc_buffer_availablelength(buffer) <= actual_count) { - actual_count -= isc_buffer_availablelength(buffer); - isc_buffer_add(buffer, - isc_buffer_availablelength(buffer)); - } else { - isc_buffer_add(buffer, actual_count); - actual_count = 0; - POST(actual_count); - break; - } - buffer = ISC_LIST_NEXT(buffer, link); - if (buffer == NULL) { - INSIST(actual_count == 0U); - } - } - - /* - * If we read less than we expected, update counters, - * and let the upper layer poke the descriptor. - */ - if (((size_t)cc != read_count) && (dev->n < dev->minimum)) - return (DOIO_SOFT); - - /* - * Full reads are posted, or partials if partials are ok. - */ - dev->result = ISC_R_SUCCESS; - return (DOIO_SUCCESS); -} - -/* - * Returns: - * DOIO_SUCCESS The operation succeeded. dev->result contains - * ISC_R_SUCCESS. - * - * DOIO_HARD A hard or unexpected I/O error was encountered. - * dev->result contains the appropriate error. - * - * DOIO_SOFT A soft I/O error was encountered. No senddone - * event was sent. The operation should be retried. - * - * No other return values are possible. - */ -static int -doio_send(isc__socket_t *sock, isc_socketevent_t *dev) { - int cc; - struct iovec iov[MAXSCATTERGATHER_SEND]; - size_t write_count; - struct msghdr msghdr; - char addrbuf[ISC_SOCKADDR_FORMATSIZE]; - int attempts = 0; - int send_errno; - char strbuf[ISC_STRERRORSIZE]; - - build_msghdr_send(sock, dev, &msghdr, iov, &write_count); - - resend: - cc = sendmsg(sock->fd, &msghdr, 0); - send_errno = errno; - - /* - * Check for error or block condition. - */ - if (cc < 0) { - if (send_errno == EINTR && ++attempts < NRETRIES) - goto resend; - - if (SOFT_ERROR(send_errno)) - return (DOIO_SOFT); - -#define SOFT_OR_HARD(_system, _isc) \ - if (send_errno == _system) { \ - if (sock->connected) { \ - dev->result = _isc; \ - inc_stats(sock->manager->stats, \ - sock->statsindex[STATID_SENDFAIL]); \ - return (DOIO_HARD); \ - } \ - return (DOIO_SOFT); \ - } -#define ALWAYS_HARD(_system, _isc) \ - if (send_errno == _system) { \ - dev->result = _isc; \ - inc_stats(sock->manager->stats, \ - sock->statsindex[STATID_SENDFAIL]); \ - return (DOIO_HARD); \ - } - - SOFT_OR_HARD(ECONNREFUSED, ISC_R_CONNREFUSED); - ALWAYS_HARD(EACCES, ISC_R_NOPERM); - ALWAYS_HARD(EAFNOSUPPORT, ISC_R_ADDRNOTAVAIL); - ALWAYS_HARD(EADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL); - ALWAYS_HARD(EHOSTUNREACH, ISC_R_HOSTUNREACH); -#ifdef EHOSTDOWN - ALWAYS_HARD(EHOSTDOWN, ISC_R_HOSTUNREACH); -#endif - ALWAYS_HARD(ENETUNREACH, ISC_R_NETUNREACH); - ALWAYS_HARD(ENOBUFS, ISC_R_NORESOURCES); - ALWAYS_HARD(EPERM, ISC_R_HOSTUNREACH); - ALWAYS_HARD(EPIPE, ISC_R_NOTCONNECTED); - ALWAYS_HARD(ECONNRESET, ISC_R_CONNECTIONRESET); - -#undef SOFT_OR_HARD -#undef ALWAYS_HARD - - /* - * The other error types depend on whether or not the - * socket is UDP or TCP. If it is UDP, some errors - * that we expect to be fatal under TCP are merely - * annoying, and are really soft errors. - * - * However, these soft errors are still returned as - * a status. - */ - isc_sockaddr_format(&dev->address, addrbuf, sizeof(addrbuf)); - isc__strerror(send_errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, "internal_send: %s: %s", - addrbuf, strbuf); - dev->result = isc__errno2result(send_errno); - inc_stats(sock->manager->stats, - sock->statsindex[STATID_SENDFAIL]); - return (DOIO_HARD); - } - - if (cc == 0) { - inc_stats(sock->manager->stats, - sock->statsindex[STATID_SENDFAIL]); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "doio_send: send() %s 0", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_RETURNED, "returned")); - } - - /* - * If we write less than we expected, update counters, poke. - */ - dev->n += cc; - if ((size_t)cc != write_count) - return (DOIO_SOFT); - - /* - * Exactly what we wanted to write. We're done with this - * entry. Post its completion event. - */ - dev->result = ISC_R_SUCCESS; - return (DOIO_SUCCESS); -} - -/* - * Kill. - * - * Caller must ensure that the socket is not locked and no external - * references exist. - */ -static void -closesocket(isc__socketmgr_t *manager, isc__socket_t *sock, int fd) { - isc_sockettype_t type = sock->type; - int lockid = FDLOCK_ID(fd); - - /* - * No one has this socket open, so the watcher doesn't have to be - * poked, and the socket doesn't have to be locked. - */ - LOCK(&manager->fdlock[lockid]); - manager->fds[fd] = NULL; - if (type == isc_sockettype_fdwatch) - manager->fdstate[fd] = CLOSED; - else - manager->fdstate[fd] = CLOSE_PENDING; - UNLOCK(&manager->fdlock[lockid]); - if (type == isc_sockettype_fdwatch) { - /* - * The caller may close the socket once this function returns, - * and `fd' may be reassigned for a new socket. So we do - * unwatch_fd() here, rather than defer it via select_poke(). - * Note: this may complicate data protection among threads and - * may reduce performance due to additional locks. One way to - * solve this would be to dup() the watched descriptor, but we - * take a simpler approach at this moment. - */ - (void)unwatch_fd(manager, fd, SELECT_POKE_READ); - (void)unwatch_fd(manager, fd, SELECT_POKE_WRITE); - } else - select_poke(manager, fd, SELECT_POKE_CLOSE); - - inc_stats(manager->stats, sock->statsindex[STATID_CLOSE]); - - /* - * update manager->maxfd here (XXX: this should be implemented more - * efficiently) - */ -#ifdef USE_SELECT - LOCK(&manager->lock); - if (manager->maxfd == fd) { - int i; - - manager->maxfd = 0; - for (i = fd - 1; i >= 0; i--) { - lockid = FDLOCK_ID(i); - - LOCK(&manager->fdlock[lockid]); - if (manager->fdstate[i] == MANAGED) { - manager->maxfd = i; - UNLOCK(&manager->fdlock[lockid]); - break; - } - UNLOCK(&manager->fdlock[lockid]); - } -#ifdef ISC_PLATFORM_USETHREADS - if (manager->maxfd < manager->pipe_fds[0]) - manager->maxfd = manager->pipe_fds[0]; -#endif - } - UNLOCK(&manager->lock); -#endif /* USE_SELECT */ -} - -static void -destroy(isc__socket_t **sockp) { - int fd; - isc__socket_t *sock = *sockp; - isc__socketmgr_t *manager = sock->manager; - - socket_log(sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_DESTROYING, "destroying"); - - INSIST(ISC_LIST_EMPTY(sock->accept_list)); - INSIST(ISC_LIST_EMPTY(sock->recv_list)); - INSIST(ISC_LIST_EMPTY(sock->send_list)); - INSIST(sock->connect_ev == NULL); - REQUIRE(sock->fd == -1 || sock->fd < (int)manager->maxsocks); - - if (sock->fd >= 0) { - fd = sock->fd; - sock->fd = -1; - closesocket(manager, sock, fd); - } - - LOCK(&manager->lock); - - ISC_LIST_UNLINK(manager->socklist, sock, link); - -#ifdef USE_WATCHER_THREAD - if (ISC_LIST_EMPTY(manager->socklist)) - SIGNAL(&manager->shutdown_ok); -#endif /* USE_WATCHER_THREAD */ - - /* can't unlock manager as its memory context is still used */ - free_socket(sockp); - - UNLOCK(&manager->lock); -} - -static isc_result_t -allocate_socket(isc__socketmgr_t *manager, isc_sockettype_t type, - isc__socket_t **socketp) -{ - isc__socket_t *sock; - isc_result_t result; - ISC_SOCKADDR_LEN_T cmsgbuflen; - - sock = isc_mem_get(manager->mctx, sizeof(*sock)); - - if (sock == NULL) - return (ISC_R_NOMEMORY); - - sock->common.magic = 0; - sock->common.impmagic = 0; - sock->references = 0; - - sock->manager = manager; - sock->type = type; - sock->fd = -1; - sock->dupped = 0; - sock->statsindex = NULL; - - ISC_LINK_INIT(sock, link); - - sock->recvcmsgbuf = NULL; - sock->sendcmsgbuf = NULL; - - /* - * set up cmsg buffers - */ - cmsgbuflen = 0; -#if defined(USE_CMSG) && defined(ISC_PLATFORM_HAVEIN6PKTINFO) - cmsgbuflen += cmsg_space(sizeof(struct in6_pktinfo)); -#endif -#if defined(USE_CMSG) && defined(SO_TIMESTAMP) - cmsgbuflen += cmsg_space(sizeof(struct timeval)); -#endif - sock->recvcmsgbuflen = cmsgbuflen; - if (sock->recvcmsgbuflen != 0U) { - sock->recvcmsgbuf = isc_mem_get(manager->mctx, cmsgbuflen); - if (sock->recvcmsgbuf == NULL) { - result = ISC_R_NOMEMORY; - goto error; - } - } - - cmsgbuflen = 0; -#if defined(USE_CMSG) && defined(ISC_PLATFORM_HAVEIN6PKTINFO) - cmsgbuflen += cmsg_space(sizeof(struct in6_pktinfo)); -#if defined(IPV6_USE_MIN_MTU) - /* - * Provide space for working around FreeBSD's broken IPV6_USE_MIN_MTU - * support. - */ - cmsgbuflen += cmsg_space(sizeof(int)); -#endif -#endif - sock->sendcmsgbuflen = cmsgbuflen; - if (sock->sendcmsgbuflen != 0U) { - sock->sendcmsgbuf = isc_mem_get(manager->mctx, cmsgbuflen); - if (sock->sendcmsgbuf == NULL) { - result = ISC_R_NOMEMORY; - goto error; - } - } - - memset(sock->name, 0, sizeof(sock->name)); - sock->tag = NULL; - - /* - * set up list of readers and writers to be initially empty - */ - ISC_LIST_INIT(sock->recv_list); - ISC_LIST_INIT(sock->send_list); - ISC_LIST_INIT(sock->accept_list); - sock->connect_ev = NULL; - sock->pending_recv = 0; - sock->pending_send = 0; - sock->pending_accept = 0; - sock->listener = 0; - sock->connected = 0; - sock->connecting = 0; - sock->bound = 0; - - /* - * initialize the lock - */ - result = isc_mutex_init(&sock->lock); - if (result != ISC_R_SUCCESS) { - sock->common.magic = 0; - sock->common.impmagic = 0; - goto error; - } - - /* - * Initialize readable and writable events - */ - ISC_EVENT_INIT(&sock->readable_ev, sizeof(intev_t), - ISC_EVENTATTR_NOPURGE, NULL, ISC_SOCKEVENT_INTR, - NULL, sock, sock, NULL, NULL); - ISC_EVENT_INIT(&sock->writable_ev, sizeof(intev_t), - ISC_EVENTATTR_NOPURGE, NULL, ISC_SOCKEVENT_INTW, - NULL, sock, sock, NULL, NULL); - - sock->common.magic = ISCAPI_SOCKET_MAGIC; - sock->common.impmagic = SOCKET_MAGIC; - *socketp = sock; - - return (ISC_R_SUCCESS); - - error: - if (sock->recvcmsgbuf != NULL) - isc_mem_put(manager->mctx, sock->recvcmsgbuf, - sock->recvcmsgbuflen); - if (sock->sendcmsgbuf != NULL) - isc_mem_put(manager->mctx, sock->sendcmsgbuf, - sock->sendcmsgbuflen); - isc_mem_put(manager->mctx, sock, sizeof(*sock)); - - return (result); -} - -/* - * This event requires that the various lists be empty, that the reference - * count be 1, and that the magic number is valid. The other socket bits, - * like the lock, must be initialized as well. The fd associated must be - * marked as closed, by setting it to -1 on close, or this routine will - * also close the socket. - */ -static void -free_socket(isc__socket_t **socketp) { - isc__socket_t *sock = *socketp; - - INSIST(sock->references == 0); - INSIST(VALID_SOCKET(sock)); - INSIST(!sock->connecting); - INSIST(!sock->pending_recv); - INSIST(!sock->pending_send); - INSIST(!sock->pending_accept); - INSIST(ISC_LIST_EMPTY(sock->recv_list)); - INSIST(ISC_LIST_EMPTY(sock->send_list)); - INSIST(ISC_LIST_EMPTY(sock->accept_list)); - INSIST(!ISC_LINK_LINKED(sock, link)); - - if (sock->recvcmsgbuf != NULL) - isc_mem_put(sock->manager->mctx, sock->recvcmsgbuf, - sock->recvcmsgbuflen); - if (sock->sendcmsgbuf != NULL) - isc_mem_put(sock->manager->mctx, sock->sendcmsgbuf, - sock->sendcmsgbuflen); - - sock->common.magic = 0; - sock->common.impmagic = 0; - - DESTROYLOCK(&sock->lock); - - isc_mem_put(sock->manager->mctx, sock, sizeof(*sock)); - - *socketp = NULL; -} - -#ifdef SO_BSDCOMPAT -/* - * This really should not be necessary to do. Having to workout - * which kernel version we are on at run time so that we don't cause - * the kernel to issue a warning about us using a deprecated socket option. - * Such warnings should *never* be on by default in production kernels. - * - * We can't do this a build time because executables are moved between - * machines and hence kernels. - * - * We can't just not set SO_BSDCOMAT because some kernels require it. - */ - -static isc_once_t bsdcompat_once = ISC_ONCE_INIT; -isc_boolean_t bsdcompat = ISC_TRUE; - -static void -clear_bsdcompat(void) { -#ifdef __linux__ - struct utsname buf; - char *endp; - long int major; - long int minor; - - uname(&buf); /* Can only fail if buf is bad in Linux. */ - - /* Paranoia in parsing can be increased, but we trust uname(). */ - major = strtol(buf.release, &endp, 10); - if (*endp == '.') { - minor = strtol(endp+1, &endp, 10); - if ((major > 2) || ((major == 2) && (minor >= 4))) { - bsdcompat = ISC_FALSE; - } - } -#endif /* __linux __ */ -} -#endif - -static isc_result_t -opensocket(isc__socketmgr_t *manager, isc__socket_t *sock, - isc__socket_t *dup_socket) -{ - isc_result_t result; - char strbuf[ISC_STRERRORSIZE]; - const char *err = "socket"; - int tries = 0; -#if defined(USE_CMSG) || defined(SO_BSDCOMPAT) - int on = 1; -#endif -#if defined(SO_RCVBUF) - ISC_SOCKADDR_LEN_T optlen; - int size; -#endif - - again: - if (dup_socket == NULL) { - switch (sock->type) { - case isc_sockettype_udp: - sock->fd = socket(sock->pf, SOCK_DGRAM, IPPROTO_UDP); - break; - case isc_sockettype_tcp: - sock->fd = socket(sock->pf, SOCK_STREAM, IPPROTO_TCP); - break; - case isc_sockettype_unix: - sock->fd = socket(sock->pf, SOCK_STREAM, 0); - break; - case isc_sockettype_fdwatch: - /* - * We should not be called for isc_sockettype_fdwatch - * sockets. - */ - INSIST(0); - break; - } - } else { - sock->fd = dup(dup_socket->fd); - sock->dupped = 1; - sock->bound = dup_socket->bound; - } - if (sock->fd == -1 && errno == EINTR && tries++ < 42) - goto again; - -#ifdef F_DUPFD - /* - * Leave a space for stdio and TCP to work in. - */ - if (manager->reserved != 0 && sock->type == isc_sockettype_udp && - sock->fd >= 0 && sock->fd < manager->reserved) { - int new, tmp; - new = fcntl(sock->fd, F_DUPFD, manager->reserved); - tmp = errno; - (void)close(sock->fd); - errno = tmp; - sock->fd = new; - err = "isc_socket_create: fcntl/reserved"; - } else if (sock->fd >= 0 && sock->fd < 20) { - int new, tmp; - new = fcntl(sock->fd, F_DUPFD, 20); - tmp = errno; - (void)close(sock->fd); - errno = tmp; - sock->fd = new; - err = "isc_socket_create: fcntl"; - } -#endif - - if (sock->fd >= (int)manager->maxsocks) { - (void)close(sock->fd); - isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, - isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_TOOMANYFDS, - "socket: file descriptor exceeds limit (%d/%u)", - sock->fd, manager->maxsocks); - return (ISC_R_NORESOURCES); - } - - if (sock->fd < 0) { - switch (errno) { - case EMFILE: - case ENFILE: - isc__strerror(errno, strbuf, sizeof(strbuf)); - isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, - isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_TOOMANYFDS, - "%s: %s", err, strbuf); - /* fallthrough */ - case ENOBUFS: - return (ISC_R_NORESOURCES); - - case EPROTONOSUPPORT: - case EPFNOSUPPORT: - case EAFNOSUPPORT: - /* - * Linux 2.2 (and maybe others) return EINVAL instead of - * EAFNOSUPPORT. - */ - case EINVAL: - return (ISC_R_FAMILYNOSUPPORT); - - default: - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "%s() %s: %s", err, - isc_msgcat_get(isc_msgcat, - ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, - "failed"), - strbuf); - return (ISC_R_UNEXPECTED); - } - } - - if (dup_socket != NULL) - goto setup_done; - - result = make_nonblock(sock->fd); - if (result != ISC_R_SUCCESS) { - (void)close(sock->fd); - return (result); - } - -#ifdef SO_BSDCOMPAT - RUNTIME_CHECK(isc_once_do(&bsdcompat_once, - clear_bsdcompat) == ISC_R_SUCCESS); - if (sock->type != isc_sockettype_unix && bsdcompat && - setsockopt(sock->fd, SOL_SOCKET, SO_BSDCOMPAT, - (void *)&on, sizeof(on)) < 0) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "setsockopt(%d, SO_BSDCOMPAT) %s: %s", - sock->fd, - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed"), - strbuf); - /* Press on... */ - } -#endif - -#ifdef SO_NOSIGPIPE - if (setsockopt(sock->fd, SOL_SOCKET, SO_NOSIGPIPE, - (void *)&on, sizeof(on)) < 0) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "setsockopt(%d, SO_NOSIGPIPE) %s: %s", - sock->fd, - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed"), - strbuf); - /* Press on... */ - } -#endif - -#if defined(USE_CMSG) || defined(SO_RCVBUF) - if (sock->type == isc_sockettype_udp) { - -#if defined(USE_CMSG) -#if defined(SO_TIMESTAMP) - if (setsockopt(sock->fd, SOL_SOCKET, SO_TIMESTAMP, - (void *)&on, sizeof(on)) < 0 - && errno != ENOPROTOOPT) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "setsockopt(%d, SO_TIMESTAMP) %s: %s", - sock->fd, - isc_msgcat_get(isc_msgcat, - ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, - "failed"), - strbuf); - /* Press on... */ - } -#endif /* SO_TIMESTAMP */ - -#if defined(ISC_PLATFORM_HAVEIPV6) - if (sock->pf == AF_INET6 && sock->recvcmsgbuflen == 0U) { - /* - * Warn explicitly because this anomaly can be hidden - * in usual operation (and unexpectedly appear later). - */ - UNEXPECTED_ERROR(__FILE__, __LINE__, - "No buffer available to receive " - "IPv6 destination"); - } -#ifdef ISC_PLATFORM_HAVEIN6PKTINFO -#ifdef IPV6_RECVPKTINFO - /* RFC 3542 */ - if ((sock->pf == AF_INET6) - && (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, - (void *)&on, sizeof(on)) < 0)) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "setsockopt(%d, IPV6_RECVPKTINFO) " - "%s: %s", sock->fd, - isc_msgcat_get(isc_msgcat, - ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, - "failed"), - strbuf); - } -#else - /* RFC 2292 */ - if ((sock->pf == AF_INET6) - && (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_PKTINFO, - (void *)&on, sizeof(on)) < 0)) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "setsockopt(%d, IPV6_PKTINFO) %s: %s", - sock->fd, - isc_msgcat_get(isc_msgcat, - ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, - "failed"), - strbuf); - } -#endif /* IPV6_RECVPKTINFO */ -#endif /* ISC_PLATFORM_HAVEIN6PKTINFO */ -#ifdef IPV6_USE_MIN_MTU /* RFC 3542, not too common yet*/ - /* use minimum MTU */ - if (sock->pf == AF_INET6 && - setsockopt(sock->fd, IPPROTO_IPV6, IPV6_USE_MIN_MTU, - (void *)&on, sizeof(on)) < 0) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "setsockopt(%d, IPV6_USE_MIN_MTU) " - "%s: %s", sock->fd, - isc_msgcat_get(isc_msgcat, - ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, - "failed"), - strbuf); - } -#endif -#if defined(IPV6_MTU) - /* - * Use minimum MTU on IPv6 sockets. - */ - if (sock->pf == AF_INET6) { - int mtu = 1280; - (void)setsockopt(sock->fd, IPPROTO_IPV6, IPV6_MTU, - &mtu, sizeof(mtu)); - } -#endif -#if defined(IPV6_MTU_DISCOVER) && defined(IPV6_PMTUDISC_DONT) - /* - * Turn off Path MTU discovery on IPv6/UDP sockets. - */ - if (sock->pf == AF_INET6) { - int action = IPV6_PMTUDISC_DONT; - (void)setsockopt(sock->fd, IPPROTO_IPV6, - IPV6_MTU_DISCOVER, &action, - sizeof(action)); - } -#endif -#endif /* ISC_PLATFORM_HAVEIPV6 */ -#endif /* defined(USE_CMSG) */ - -#if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT) - /* - * Turn off Path MTU discovery on IPv4/UDP sockets. - */ - if (sock->pf == AF_INET) { - int action = IP_PMTUDISC_DONT; - (void)setsockopt(sock->fd, IPPROTO_IP, IP_MTU_DISCOVER, - &action, sizeof(action)); - } -#endif -#if defined(IP_DONTFRAG) - /* - * Turn off Path MTU discovery on IPv4/UDP sockets. - */ - if (sock->pf == AF_INET) { - int off = 0; - (void)setsockopt(sock->fd, IPPROTO_IP, IP_DONTFRAG, - &off, sizeof(off)); - } -#endif - -#if defined(SO_RCVBUF) - optlen = sizeof(size); - if (getsockopt(sock->fd, SOL_SOCKET, SO_RCVBUF, - (void *)&size, &optlen) >= 0 && - size < RCVBUFSIZE) { - size = RCVBUFSIZE; - if (setsockopt(sock->fd, SOL_SOCKET, SO_RCVBUF, - (void *)&size, sizeof(size)) == -1) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "setsockopt(%d, SO_RCVBUF, %d) %s: %s", - sock->fd, size, - isc_msgcat_get(isc_msgcat, - ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, - "failed"), - strbuf); - } - } -#endif - } -#endif /* defined(USE_CMSG) || defined(SO_RCVBUF) */ - -setup_done: - inc_stats(manager->stats, sock->statsindex[STATID_OPEN]); - - return (ISC_R_SUCCESS); -} - -/* - * Create a 'type' socket or duplicate an existing socket, managed - * by 'manager'. Events will be posted to 'task' and when dispatched - * 'action' will be called with 'arg' as the arg value. The new - * socket is returned in 'socketp'. - */ -static isc_result_t -socket_create(isc_socketmgr_t *manager0, int pf, isc_sockettype_t type, - isc_socket_t **socketp, isc_socket_t *dup_socket) -{ - isc__socket_t *sock = NULL; - isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0; - isc_result_t result; - int lockid; - - REQUIRE(VALID_MANAGER(manager)); - REQUIRE(socketp != NULL && *socketp == NULL); - REQUIRE(type != isc_sockettype_fdwatch); - - result = allocate_socket(manager, type, &sock); - if (result != ISC_R_SUCCESS) - return (result); - - switch (sock->type) { - case isc_sockettype_udp: - sock->statsindex = - (pf == AF_INET) ? upd4statsindex : upd6statsindex; - break; - case isc_sockettype_tcp: - sock->statsindex = - (pf == AF_INET) ? tcp4statsindex : tcp6statsindex; - break; - case isc_sockettype_unix: - sock->statsindex = unixstatsindex; - break; - default: - INSIST(0); - } - - sock->pf = pf; - - result = opensocket(manager, sock, (isc__socket_t *)dup_socket); - if (result != ISC_R_SUCCESS) { - inc_stats(manager->stats, sock->statsindex[STATID_OPENFAIL]); - free_socket(&sock); - return (result); - } - - sock->common.methods = (isc_socketmethods_t *)&socketmethods; - sock->references = 1; - *socketp = (isc_socket_t *)sock; - - /* - * Note we don't have to lock the socket like we normally would because - * there are no external references to it yet. - */ - - lockid = FDLOCK_ID(sock->fd); - LOCK(&manager->fdlock[lockid]); - manager->fds[sock->fd] = sock; - manager->fdstate[sock->fd] = MANAGED; -#ifdef USE_DEVPOLL - INSIST(sock->manager->fdpollinfo[sock->fd].want_read == 0 && - sock->manager->fdpollinfo[sock->fd].want_write == 0); -#endif - UNLOCK(&manager->fdlock[lockid]); - - LOCK(&manager->lock); - ISC_LIST_APPEND(manager->socklist, sock, link); -#ifdef USE_SELECT - if (manager->maxfd < sock->fd) - manager->maxfd = sock->fd; -#endif - UNLOCK(&manager->lock); - - socket_log(sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_CREATED, dup_socket == NULL ? "dupped" : "created"); - - return (ISC_R_SUCCESS); -} - -/*% - * Create a new 'type' socket managed by 'manager'. Events - * will be posted to 'task' and when dispatched 'action' will be - * called with 'arg' as the arg value. The new socket is returned - * in 'socketp'. - */ -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_create(isc_socketmgr_t *manager0, int pf, isc_sockettype_t type, - isc_socket_t **socketp) -{ - return (socket_create(manager0, pf, type, socketp, NULL)); -} - -/*% - * Duplicate an existing socket. The new socket is returned - * in 'socketp'. - */ -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_dup(isc_socket_t *sock0, isc_socket_t **socketp) { - isc__socket_t *sock = (isc__socket_t *)sock0; - - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(socketp != NULL && *socketp == NULL); - - return (socket_create((isc_socketmgr_t *) sock->manager, - sock->pf, sock->type, socketp, - sock0)); -} - -#ifdef BIND9 -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_open(isc_socket_t *sock0) { - isc_result_t result; - isc__socket_t *sock = (isc__socket_t *)sock0; - - REQUIRE(VALID_SOCKET(sock)); - - LOCK(&sock->lock); - REQUIRE(sock->references == 1); - REQUIRE(sock->type != isc_sockettype_fdwatch); - UNLOCK(&sock->lock); - /* - * We don't need to retain the lock hereafter, since no one else has - * this socket. - */ - REQUIRE(sock->fd == -1); - - result = opensocket(sock->manager, sock, NULL); - if (result != ISC_R_SUCCESS) - sock->fd = -1; - - if (result == ISC_R_SUCCESS) { - int lockid = FDLOCK_ID(sock->fd); - - LOCK(&sock->manager->fdlock[lockid]); - sock->manager->fds[sock->fd] = sock; - sock->manager->fdstate[sock->fd] = MANAGED; -#ifdef USE_DEVPOLL - INSIST(sock->manager->fdpollinfo[sock->fd].want_read == 0 && - sock->manager->fdpollinfo[sock->fd].want_write == 0); -#endif - UNLOCK(&sock->manager->fdlock[lockid]); - -#ifdef USE_SELECT - LOCK(&sock->manager->lock); - if (sock->manager->maxfd < sock->fd) - sock->manager->maxfd = sock->fd; - UNLOCK(&sock->manager->lock); -#endif - } - - return (result); -} -#endif /* BIND9 */ - -/* - * Create a new 'type' socket managed by 'manager'. Events - * will be posted to 'task' and when dispatched 'action' will be - * called with 'arg' as the arg value. The new socket is returned - * in 'socketp'. - */ -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_fdwatchcreate(isc_socketmgr_t *manager0, int fd, int flags, - isc_sockfdwatch_t callback, void *cbarg, - isc_task_t *task, isc_socket_t **socketp) -{ - isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0; - isc__socket_t *sock = NULL; - isc_result_t result; - int lockid; - - REQUIRE(VALID_MANAGER(manager)); - REQUIRE(socketp != NULL && *socketp == NULL); - - result = allocate_socket(manager, isc_sockettype_fdwatch, &sock); - if (result != ISC_R_SUCCESS) - return (result); - - sock->fd = fd; - sock->fdwatcharg = cbarg; - sock->fdwatchcb = callback; - sock->fdwatchflags = flags; - sock->fdwatchtask = task; - sock->statsindex = fdwatchstatsindex; - - sock->common.methods = (isc_socketmethods_t *)&socketmethods; - sock->references = 1; - *socketp = (isc_socket_t *)sock; - - /* - * Note we don't have to lock the socket like we normally would because - * there are no external references to it yet. - */ - - lockid = FDLOCK_ID(sock->fd); - LOCK(&manager->fdlock[lockid]); - manager->fds[sock->fd] = sock; - manager->fdstate[sock->fd] = MANAGED; - UNLOCK(&manager->fdlock[lockid]); - - LOCK(&manager->lock); - ISC_LIST_APPEND(manager->socklist, sock, link); -#ifdef USE_SELECT - if (manager->maxfd < sock->fd) - manager->maxfd = sock->fd; -#endif - UNLOCK(&manager->lock); - - if (flags & ISC_SOCKFDWATCH_READ) - select_poke(sock->manager, sock->fd, SELECT_POKE_READ); - if (flags & ISC_SOCKFDWATCH_WRITE) - select_poke(sock->manager, sock->fd, SELECT_POKE_WRITE); - - socket_log(sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_CREATED, "fdwatch-created"); - - return (ISC_R_SUCCESS); -} - -/* - * Indicate to the manager that it should watch the socket again. - * This can be used to restart watching if the previous event handler - * didn't indicate there was more data to be processed. Primarily - * it is for writing but could be used for reading if desired - */ - -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_fdwatchpoke(isc_socket_t *sock0, int flags) -{ - isc__socket_t *sock = (isc__socket_t *)sock0; - - REQUIRE(VALID_SOCKET(sock)); - - /* - * We check both flags first to allow us to get the lock - * once but only if we need it. - */ - - if ((flags & (ISC_SOCKFDWATCH_READ | ISC_SOCKFDWATCH_WRITE)) != 0) { - LOCK(&sock->lock); - if (((flags & ISC_SOCKFDWATCH_READ) != 0) && - !sock->pending_recv) - select_poke(sock->manager, sock->fd, - SELECT_POKE_READ); - if (((flags & ISC_SOCKFDWATCH_WRITE) != 0) && - !sock->pending_send) - select_poke(sock->manager, sock->fd, - SELECT_POKE_WRITE); - UNLOCK(&sock->lock); - } - - socket_log(sock, NULL, TRACE, isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_POKED, "fdwatch-poked flags: %d", flags); - - return (ISC_R_SUCCESS); -} - -/* - * Attach to a socket. Caller must explicitly detach when it is done. - */ -ISC_SOCKETFUNC_SCOPE void -isc__socket_attach(isc_socket_t *sock0, isc_socket_t **socketp) { - isc__socket_t *sock = (isc__socket_t *)sock0; - - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(socketp != NULL && *socketp == NULL); - - LOCK(&sock->lock); - sock->references++; - UNLOCK(&sock->lock); - - *socketp = (isc_socket_t *)sock; -} - -/* - * Dereference a socket. If this is the last reference to it, clean things - * up by destroying the socket. - */ -ISC_SOCKETFUNC_SCOPE void -isc__socket_detach(isc_socket_t **socketp) { - isc__socket_t *sock; - isc_boolean_t kill_socket = ISC_FALSE; - - REQUIRE(socketp != NULL); - sock = (isc__socket_t *)*socketp; - REQUIRE(VALID_SOCKET(sock)); - - LOCK(&sock->lock); - REQUIRE(sock->references > 0); - sock->references--; - if (sock->references == 0) - kill_socket = ISC_TRUE; - UNLOCK(&sock->lock); - - if (kill_socket) - destroy(&sock); - - *socketp = NULL; -} - -#ifdef BIND9 -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_close(isc_socket_t *sock0) { - isc__socket_t *sock = (isc__socket_t *)sock0; - int fd; - isc__socketmgr_t *manager; - - fflush(stdout); - REQUIRE(VALID_SOCKET(sock)); - - LOCK(&sock->lock); - - REQUIRE(sock->references == 1); - REQUIRE(sock->type != isc_sockettype_fdwatch); - REQUIRE(sock->fd >= 0 && sock->fd < (int)sock->manager->maxsocks); - - INSIST(!sock->connecting); - INSIST(!sock->pending_recv); - INSIST(!sock->pending_send); - INSIST(!sock->pending_accept); - INSIST(ISC_LIST_EMPTY(sock->recv_list)); - INSIST(ISC_LIST_EMPTY(sock->send_list)); - INSIST(ISC_LIST_EMPTY(sock->accept_list)); - INSIST(sock->connect_ev == NULL); - - manager = sock->manager; - fd = sock->fd; - sock->fd = -1; - sock->dupped = 0; - memset(sock->name, 0, sizeof(sock->name)); - sock->tag = NULL; - sock->listener = 0; - sock->connected = 0; - sock->connecting = 0; - sock->bound = 0; - isc_sockaddr_any(&sock->peer_address); - - UNLOCK(&sock->lock); - - closesocket(manager, sock, fd); - - return (ISC_R_SUCCESS); -} -#endif /* BIND9 */ - -/* - * I/O is possible on a given socket. Schedule an event to this task that - * will call an internal function to do the I/O. This will charge the - * task with the I/O operation and let our select loop handler get back - * to doing something real as fast as possible. - * - * The socket and manager must be locked before calling this function. - */ -static void -dispatch_recv(isc__socket_t *sock) { - intev_t *iev; - isc_socketevent_t *ev; - isc_task_t *sender; - - INSIST(!sock->pending_recv); - - if (sock->type != isc_sockettype_fdwatch) { - ev = ISC_LIST_HEAD(sock->recv_list); - if (ev == NULL) - return; - socket_log(sock, NULL, EVENT, NULL, 0, 0, - "dispatch_recv: event %p -> task %p", - ev, ev->ev_sender); - sender = ev->ev_sender; - } else { - sender = sock->fdwatchtask; - } - - sock->pending_recv = 1; - iev = &sock->readable_ev; - - sock->references++; - iev->ev_sender = sock; - if (sock->type == isc_sockettype_fdwatch) - iev->ev_action = internal_fdwatch_read; - else - iev->ev_action = internal_recv; - iev->ev_arg = sock; - - isc_task_send(sender, (isc_event_t **)&iev); -} - -static void -dispatch_send(isc__socket_t *sock) { - intev_t *iev; - isc_socketevent_t *ev; - isc_task_t *sender; - - INSIST(!sock->pending_send); - - if (sock->type != isc_sockettype_fdwatch) { - ev = ISC_LIST_HEAD(sock->send_list); - if (ev == NULL) - return; - socket_log(sock, NULL, EVENT, NULL, 0, 0, - "dispatch_send: event %p -> task %p", - ev, ev->ev_sender); - sender = ev->ev_sender; - } else { - sender = sock->fdwatchtask; - } - - sock->pending_send = 1; - iev = &sock->writable_ev; - - sock->references++; - iev->ev_sender = sock; - if (sock->type == isc_sockettype_fdwatch) - iev->ev_action = internal_fdwatch_write; - else - iev->ev_action = internal_send; - iev->ev_arg = sock; - - isc_task_send(sender, (isc_event_t **)&iev); -} - -/* - * Dispatch an internal accept event. - */ -static void -dispatch_accept(isc__socket_t *sock) { - intev_t *iev; - isc_socket_newconnev_t *ev; - - INSIST(!sock->pending_accept); - - /* - * Are there any done events left, or were they all canceled - * before the manager got the socket lock? - */ - ev = ISC_LIST_HEAD(sock->accept_list); - if (ev == NULL) - return; - - sock->pending_accept = 1; - iev = &sock->readable_ev; - - sock->references++; /* keep socket around for this internal event */ - iev->ev_sender = sock; - iev->ev_action = internal_accept; - iev->ev_arg = sock; - - isc_task_send(ev->ev_sender, (isc_event_t **)&iev); -} - -static void -dispatch_connect(isc__socket_t *sock) { - intev_t *iev; - isc_socket_connev_t *ev; - - iev = &sock->writable_ev; - - ev = sock->connect_ev; - INSIST(ev != NULL); /* XXX */ - - INSIST(sock->connecting); - - sock->references++; /* keep socket around for this internal event */ - iev->ev_sender = sock; - iev->ev_action = internal_connect; - iev->ev_arg = sock; - - isc_task_send(ev->ev_sender, (isc_event_t **)&iev); -} - -/* - * Dequeue an item off the given socket's read queue, set the result code - * in the done event to the one provided, and send it to the task it was - * destined for. - * - * If the event to be sent is on a list, remove it before sending. If - * asked to, send and detach from the socket as well. - * - * Caller must have the socket locked if the event is attached to the socket. - */ -static void -send_recvdone_event(isc__socket_t *sock, isc_socketevent_t **dev) { - isc_task_t *task; - - task = (*dev)->ev_sender; - - (*dev)->ev_sender = sock; - - if (ISC_LINK_LINKED(*dev, ev_link)) - ISC_LIST_DEQUEUE(sock->recv_list, *dev, ev_link); - - if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED) - == ISC_SOCKEVENTATTR_ATTACHED) - isc_task_sendanddetach(&task, (isc_event_t **)dev); - else - isc_task_send(task, (isc_event_t **)dev); -} - -/* - * See comments for send_recvdone_event() above. - * - * Caller must have the socket locked if the event is attached to the socket. - */ -static void -send_senddone_event(isc__socket_t *sock, isc_socketevent_t **dev) { - isc_task_t *task; - - INSIST(dev != NULL && *dev != NULL); - - task = (*dev)->ev_sender; - (*dev)->ev_sender = sock; - - if (ISC_LINK_LINKED(*dev, ev_link)) - ISC_LIST_DEQUEUE(sock->send_list, *dev, ev_link); - - if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED) - == ISC_SOCKEVENTATTR_ATTACHED) - isc_task_sendanddetach(&task, (isc_event_t **)dev); - else - isc_task_send(task, (isc_event_t **)dev); -} - -/* - * Call accept() on a socket, to get the new file descriptor. The listen - * socket is used as a prototype to create a new isc_socket_t. The new - * socket has one outstanding reference. The task receiving the event - * will be detached from just after the event is delivered. - * - * On entry to this function, the event delivered is the internal - * readable event, and the first item on the accept_list should be - * the done event we want to send. If the list is empty, this is a no-op, - * so just unlock and return. - */ -static void -internal_accept(isc_task_t *me, isc_event_t *ev) { - isc__socket_t *sock; - isc__socketmgr_t *manager; - isc_socket_newconnev_t *dev; - isc_task_t *task; - ISC_SOCKADDR_LEN_T addrlen; - int fd; - isc_result_t result = ISC_R_SUCCESS; - char strbuf[ISC_STRERRORSIZE]; - const char *err = "accept"; - - UNUSED(me); - - sock = ev->ev_sender; - INSIST(VALID_SOCKET(sock)); - - LOCK(&sock->lock); - socket_log(sock, NULL, TRACE, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTLOCK, - "internal_accept called, locked socket"); - - manager = sock->manager; - INSIST(VALID_MANAGER(manager)); - - INSIST(sock->listener); - INSIST(sock->pending_accept == 1); - sock->pending_accept = 0; - - INSIST(sock->references > 0); - sock->references--; /* the internal event is done with this socket */ - if (sock->references == 0) { - UNLOCK(&sock->lock); - destroy(&sock); - return; - } - - /* - * Get the first item off the accept list. - * If it is empty, unlock the socket and return. - */ - dev = ISC_LIST_HEAD(sock->accept_list); - if (dev == NULL) { - UNLOCK(&sock->lock); - return; - } - - /* - * Try to accept the new connection. If the accept fails with - * EAGAIN or EINTR, simply poke the watcher to watch this socket - * again. Also ignore ECONNRESET, which has been reported to - * be spuriously returned on Linux 2.2.19 although it is not - * a documented error for accept(). ECONNABORTED has been - * reported for Solaris 8. The rest are thrown in not because - * we have seen them but because they are ignored by other - * daemons such as BIND 8 and Apache. - */ - - addrlen = sizeof(NEWCONNSOCK(dev)->peer_address.type); - memset(&NEWCONNSOCK(dev)->peer_address.type, 0, addrlen); - fd = accept(sock->fd, &NEWCONNSOCK(dev)->peer_address.type.sa, - (void *)&addrlen); - -#ifdef F_DUPFD - /* - * Leave a space for stdio to work in. - */ - if (fd >= 0 && fd < 20) { - int new, tmp; - new = fcntl(fd, F_DUPFD, 20); - tmp = errno; - (void)close(fd); - errno = tmp; - fd = new; - err = "accept/fcntl"; - } -#endif - - if (fd < 0) { - if (SOFT_ERROR(errno)) - goto soft_error; - switch (errno) { - case ENFILE: - case EMFILE: - isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, - isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_TOOMANYFDS, - "%s: too many open file descriptors", - err); - goto soft_error; - - case ENOBUFS: - case ENOMEM: - case ECONNRESET: - case ECONNABORTED: - case EHOSTUNREACH: - case EHOSTDOWN: - case ENETUNREACH: - case ENETDOWN: - case ECONNREFUSED: -#ifdef EPROTO - case EPROTO: -#endif -#ifdef ENONET - case ENONET: -#endif - goto soft_error; - default: - break; - } - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "internal_accept: %s() %s: %s", err, - isc_msgcat_get(isc_msgcat, - ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, - "failed"), - strbuf); - fd = -1; - result = ISC_R_UNEXPECTED; - } else { - if (addrlen == 0U) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "internal_accept(): " - "accept() failed to return " - "remote address"); - - (void)close(fd); - goto soft_error; - } else if (NEWCONNSOCK(dev)->peer_address.type.sa.sa_family != - sock->pf) - { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "internal_accept(): " - "accept() returned peer address " - "family %u (expected %u)", - NEWCONNSOCK(dev)->peer_address. - type.sa.sa_family, - sock->pf); - (void)close(fd); - goto soft_error; - } else if (fd >= (int)manager->maxsocks) { - isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, - isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_TOOMANYFDS, - "accept: " - "file descriptor exceeds limit (%d/%u)", - fd, manager->maxsocks); - (void)close(fd); - goto soft_error; - } - } - - if (fd != -1) { - NEWCONNSOCK(dev)->peer_address.length = addrlen; - NEWCONNSOCK(dev)->pf = sock->pf; - } - - /* - * Pull off the done event. - */ - ISC_LIST_UNLINK(sock->accept_list, dev, ev_link); - - /* - * Poke watcher if there are more pending accepts. - */ - if (!ISC_LIST_EMPTY(sock->accept_list)) - select_poke(sock->manager, sock->fd, SELECT_POKE_ACCEPT); - - UNLOCK(&sock->lock); - - if (fd != -1) { - result = make_nonblock(fd); - if (result != ISC_R_SUCCESS) { - (void)close(fd); - fd = -1; - } - } - - /* - * -1 means the new socket didn't happen. - */ - if (fd != -1) { - int lockid = FDLOCK_ID(fd); - - LOCK(&manager->fdlock[lockid]); - manager->fds[fd] = NEWCONNSOCK(dev); - manager->fdstate[fd] = MANAGED; - UNLOCK(&manager->fdlock[lockid]); - - LOCK(&manager->lock); - ISC_LIST_APPEND(manager->socklist, NEWCONNSOCK(dev), link); - - NEWCONNSOCK(dev)->fd = fd; - NEWCONNSOCK(dev)->bound = 1; - NEWCONNSOCK(dev)->connected = 1; - - /* - * Save away the remote address - */ - dev->address = NEWCONNSOCK(dev)->peer_address; - -#ifdef USE_SELECT - if (manager->maxfd < fd) - manager->maxfd = fd; -#endif - - socket_log(sock, &NEWCONNSOCK(dev)->peer_address, CREATION, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTEDCXN, - "accepted connection, new socket %p", - dev->newsocket); - - UNLOCK(&manager->lock); - - inc_stats(manager->stats, sock->statsindex[STATID_ACCEPT]); - } else { - inc_stats(manager->stats, sock->statsindex[STATID_ACCEPTFAIL]); - NEWCONNSOCK(dev)->references--; - free_socket((isc__socket_t **)&dev->newsocket); - } - - /* - * Fill in the done event details and send it off. - */ - dev->result = result; - task = dev->ev_sender; - dev->ev_sender = sock; - - isc_task_sendanddetach(&task, ISC_EVENT_PTR(&dev)); - return; - - soft_error: - select_poke(sock->manager, sock->fd, SELECT_POKE_ACCEPT); - UNLOCK(&sock->lock); - - inc_stats(manager->stats, sock->statsindex[STATID_ACCEPTFAIL]); - return; -} - -static void -internal_recv(isc_task_t *me, isc_event_t *ev) { - isc_socketevent_t *dev; - isc__socket_t *sock; - - INSIST(ev->ev_type == ISC_SOCKEVENT_INTR); - - sock = ev->ev_sender; - INSIST(VALID_SOCKET(sock)); - - LOCK(&sock->lock); - socket_log(sock, NULL, IOEVENT, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALRECV, - "internal_recv: task %p got event %p", me, ev); - - INSIST(sock->pending_recv == 1); - sock->pending_recv = 0; - - INSIST(sock->references > 0); - sock->references--; /* the internal event is done with this socket */ - if (sock->references == 0) { - UNLOCK(&sock->lock); - destroy(&sock); - return; - } - - /* - * Try to do as much I/O as possible on this socket. There are no - * limits here, currently. - */ - dev = ISC_LIST_HEAD(sock->recv_list); - while (dev != NULL) { - switch (doio_recv(sock, dev)) { - case DOIO_SOFT: - goto poke; - - case DOIO_EOF: - /* - * read of 0 means the remote end was closed. - * Run through the event queue and dispatch all - * the events with an EOF result code. - */ - do { - dev->result = ISC_R_EOF; - send_recvdone_event(sock, &dev); - dev = ISC_LIST_HEAD(sock->recv_list); - } while (dev != NULL); - goto poke; - - case DOIO_SUCCESS: - case DOIO_HARD: - send_recvdone_event(sock, &dev); - break; - } - - dev = ISC_LIST_HEAD(sock->recv_list); - } - - poke: - if (!ISC_LIST_EMPTY(sock->recv_list)) - select_poke(sock->manager, sock->fd, SELECT_POKE_READ); - - UNLOCK(&sock->lock); -} - -static void -internal_send(isc_task_t *me, isc_event_t *ev) { - isc_socketevent_t *dev; - isc__socket_t *sock; - - INSIST(ev->ev_type == ISC_SOCKEVENT_INTW); - - /* - * Find out what socket this is and lock it. - */ - sock = (isc__socket_t *)ev->ev_sender; - INSIST(VALID_SOCKET(sock)); - - LOCK(&sock->lock); - socket_log(sock, NULL, IOEVENT, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALSEND, - "internal_send: task %p got event %p", me, ev); - - INSIST(sock->pending_send == 1); - sock->pending_send = 0; - - INSIST(sock->references > 0); - sock->references--; /* the internal event is done with this socket */ - if (sock->references == 0) { - UNLOCK(&sock->lock); - destroy(&sock); - return; - } - - /* - * Try to do as much I/O as possible on this socket. There are no - * limits here, currently. - */ - dev = ISC_LIST_HEAD(sock->send_list); - while (dev != NULL) { - switch (doio_send(sock, dev)) { - case DOIO_SOFT: - goto poke; - - case DOIO_HARD: - case DOIO_SUCCESS: - send_senddone_event(sock, &dev); - break; - } - - dev = ISC_LIST_HEAD(sock->send_list); - } - - poke: - if (!ISC_LIST_EMPTY(sock->send_list)) - select_poke(sock->manager, sock->fd, SELECT_POKE_WRITE); - - UNLOCK(&sock->lock); -} - -static void -internal_fdwatch_write(isc_task_t *me, isc_event_t *ev) { - isc__socket_t *sock; - int more_data; - - INSIST(ev->ev_type == ISC_SOCKEVENT_INTW); - - /* - * Find out what socket this is and lock it. - */ - sock = (isc__socket_t *)ev->ev_sender; - INSIST(VALID_SOCKET(sock)); - - LOCK(&sock->lock); - socket_log(sock, NULL, IOEVENT, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALSEND, - "internal_fdwatch_write: task %p got event %p", me, ev); - - INSIST(sock->pending_send == 1); - - UNLOCK(&sock->lock); - more_data = (sock->fdwatchcb)(me, (isc_socket_t *)sock, - sock->fdwatcharg, ISC_SOCKFDWATCH_WRITE); - LOCK(&sock->lock); - - sock->pending_send = 0; - - INSIST(sock->references > 0); - sock->references--; /* the internal event is done with this socket */ - if (sock->references == 0) { - UNLOCK(&sock->lock); - destroy(&sock); - return; - } - - if (more_data) - select_poke(sock->manager, sock->fd, SELECT_POKE_WRITE); - - UNLOCK(&sock->lock); -} - -static void -internal_fdwatch_read(isc_task_t *me, isc_event_t *ev) { - isc__socket_t *sock; - int more_data; - - INSIST(ev->ev_type == ISC_SOCKEVENT_INTR); - - /* - * Find out what socket this is and lock it. - */ - sock = (isc__socket_t *)ev->ev_sender; - INSIST(VALID_SOCKET(sock)); - - LOCK(&sock->lock); - socket_log(sock, NULL, IOEVENT, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALRECV, - "internal_fdwatch_read: task %p got event %p", me, ev); - - INSIST(sock->pending_recv == 1); - - UNLOCK(&sock->lock); - more_data = (sock->fdwatchcb)(me, (isc_socket_t *)sock, - sock->fdwatcharg, ISC_SOCKFDWATCH_READ); - LOCK(&sock->lock); - - sock->pending_recv = 0; - - INSIST(sock->references > 0); - sock->references--; /* the internal event is done with this socket */ - if (sock->references == 0) { - UNLOCK(&sock->lock); - destroy(&sock); - return; - } - - if (more_data) - select_poke(sock->manager, sock->fd, SELECT_POKE_READ); - - UNLOCK(&sock->lock); -} - -/* - * Process read/writes on each fd here. Avoid locking - * and unlocking twice if both reads and writes are possible. - */ -static void -process_fd(isc__socketmgr_t *manager, int fd, isc_boolean_t readable, - isc_boolean_t writeable) -{ - isc__socket_t *sock; - isc_boolean_t unlock_sock; - isc_boolean_t unwatch_read = ISC_FALSE, unwatch_write = ISC_FALSE; - int lockid = FDLOCK_ID(fd); - - /* - * If the socket is going to be closed, don't do more I/O. - */ - LOCK(&manager->fdlock[lockid]); - if (manager->fdstate[fd] == CLOSE_PENDING) { - UNLOCK(&manager->fdlock[lockid]); - - (void)unwatch_fd(manager, fd, SELECT_POKE_READ); - (void)unwatch_fd(manager, fd, SELECT_POKE_WRITE); - return; - } - - sock = manager->fds[fd]; - unlock_sock = ISC_FALSE; - if (readable) { - if (sock == NULL) { - unwatch_read = ISC_TRUE; - goto check_write; - } - unlock_sock = ISC_TRUE; - LOCK(&sock->lock); - if (!SOCK_DEAD(sock)) { - if (sock->listener) - dispatch_accept(sock); - else - dispatch_recv(sock); - } - unwatch_read = ISC_TRUE; - } -check_write: - if (writeable) { - if (sock == NULL) { - unwatch_write = ISC_TRUE; - goto unlock_fd; - } - if (!unlock_sock) { - unlock_sock = ISC_TRUE; - LOCK(&sock->lock); - } - if (!SOCK_DEAD(sock)) { - if (sock->connecting) - dispatch_connect(sock); - else - dispatch_send(sock); - } - unwatch_write = ISC_TRUE; - } - if (unlock_sock) - UNLOCK(&sock->lock); - - unlock_fd: - UNLOCK(&manager->fdlock[lockid]); - if (unwatch_read) - (void)unwatch_fd(manager, fd, SELECT_POKE_READ); - if (unwatch_write) - (void)unwatch_fd(manager, fd, SELECT_POKE_WRITE); - -} - -#ifdef USE_KQUEUE -static isc_boolean_t -process_fds(isc__socketmgr_t *manager, struct kevent *events, int nevents) { - int i; - isc_boolean_t readable, writable; - isc_boolean_t done = ISC_FALSE; -#ifdef USE_WATCHER_THREAD - isc_boolean_t have_ctlevent = ISC_FALSE; -#endif - - if (nevents == manager->nevents) { - /* - * This is not an error, but something unexpected. If this - * happens, it may indicate the need for increasing - * ISC_SOCKET_MAXEVENTS. - */ - manager_log(manager, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, ISC_LOG_INFO, - "maximum number of FD events (%d) received", - nevents); - } - - for (i = 0; i < nevents; i++) { - REQUIRE(events[i].ident < manager->maxsocks); -#ifdef USE_WATCHER_THREAD - if (events[i].ident == (uintptr_t)manager->pipe_fds[0]) { - have_ctlevent = ISC_TRUE; - continue; - } -#endif - readable = ISC_TF(events[i].filter == EVFILT_READ); - writable = ISC_TF(events[i].filter == EVFILT_WRITE); - process_fd(manager, events[i].ident, readable, writable); - } - -#ifdef USE_WATCHER_THREAD - if (have_ctlevent) - done = process_ctlfd(manager); -#endif - - return (done); -} -#elif defined(USE_EPOLL) -static isc_boolean_t -process_fds(isc__socketmgr_t *manager, struct epoll_event *events, int nevents) -{ - int i; - isc_boolean_t done = ISC_FALSE; -#ifdef USE_WATCHER_THREAD - isc_boolean_t have_ctlevent = ISC_FALSE; -#endif - - if (nevents == manager->nevents) { - manager_log(manager, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, ISC_LOG_INFO, - "maximum number of FD events (%d) received", - nevents); - } - - for (i = 0; i < nevents; i++) { - REQUIRE(events[i].data.fd < (int)manager->maxsocks); -#ifdef USE_WATCHER_THREAD - if (events[i].data.fd == manager->pipe_fds[0]) { - have_ctlevent = ISC_TRUE; - continue; - } -#endif - if ((events[i].events & EPOLLERR) != 0 || - (events[i].events & EPOLLHUP) != 0) { - /* - * epoll does not set IN/OUT bits on an erroneous - * condition, so we need to try both anyway. This is a - * bit inefficient, but should be okay for such rare - * events. Note also that the read or write attempt - * won't block because we use non-blocking sockets. - */ - events[i].events |= (EPOLLIN | EPOLLOUT); - } - process_fd(manager, events[i].data.fd, - (events[i].events & EPOLLIN) != 0, - (events[i].events & EPOLLOUT) != 0); - } - -#ifdef USE_WATCHER_THREAD - if (have_ctlevent) - done = process_ctlfd(manager); -#endif - - return (done); -} -#elif defined(USE_DEVPOLL) -static isc_boolean_t -process_fds(isc__socketmgr_t *manager, struct pollfd *events, int nevents) { - int i; - isc_boolean_t done = ISC_FALSE; -#ifdef USE_WATCHER_THREAD - isc_boolean_t have_ctlevent = ISC_FALSE; -#endif - - if (nevents == manager->nevents) { - manager_log(manager, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, ISC_LOG_INFO, - "maximum number of FD events (%d) received", - nevents); - } - - for (i = 0; i < nevents; i++) { - REQUIRE(events[i].fd < (int)manager->maxsocks); -#ifdef USE_WATCHER_THREAD - if (events[i].fd == manager->pipe_fds[0]) { - have_ctlevent = ISC_TRUE; - continue; - } -#endif - process_fd(manager, events[i].fd, - (events[i].events & POLLIN) != 0, - (events[i].events & POLLOUT) != 0); - } - -#ifdef USE_WATCHER_THREAD - if (have_ctlevent) - done = process_ctlfd(manager); -#endif - - return (done); -} -#elif defined(USE_SELECT) -static void -process_fds(isc__socketmgr_t *manager, int maxfd, fd_set *readfds, - fd_set *writefds) -{ - int i; - - REQUIRE(maxfd <= (int)manager->maxsocks); - - for (i = 0; i < maxfd; i++) { -#ifdef USE_WATCHER_THREAD - if (i == manager->pipe_fds[0] || i == manager->pipe_fds[1]) - continue; -#endif /* USE_WATCHER_THREAD */ - process_fd(manager, i, FD_ISSET(i, readfds), - FD_ISSET(i, writefds)); - } -} -#endif - -#ifdef USE_WATCHER_THREAD -static isc_boolean_t -process_ctlfd(isc__socketmgr_t *manager) { - int msg, fd; - - for (;;) { - select_readmsg(manager, &fd, &msg); - - manager_log(manager, IOEVENT, - isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_WATCHERMSG, - "watcher got message %d " - "for socket %d"), msg, fd); - - /* - * Nothing to read? - */ - if (msg == SELECT_POKE_NOTHING) - break; - - /* - * Handle shutdown message. We really should - * jump out of this loop right away, but - * it doesn't matter if we have to do a little - * more work first. - */ - if (msg == SELECT_POKE_SHUTDOWN) - return (ISC_TRUE); - - /* - * This is a wakeup on a socket. Look - * at the event queue for both read and write, - * and decide if we need to watch on it now - * or not. - */ - wakeup_socket(manager, fd, msg); - } - - return (ISC_FALSE); -} - -/* - * This is the thread that will loop forever, always in a select or poll - * call. - * - * When select returns something to do, track down what thread gets to do - * this I/O and post the event to it. - */ -static isc_threadresult_t -watcher(void *uap) { - isc__socketmgr_t *manager = uap; - isc_boolean_t done; - int cc; -#ifdef USE_KQUEUE - const char *fnname = "kevent()"; -#elif defined (USE_EPOLL) - const char *fnname = "epoll_wait()"; -#elif defined(USE_DEVPOLL) - const char *fnname = "ioctl(DP_POLL)"; - struct dvpoll dvp; -#elif defined (USE_SELECT) - const char *fnname = "select()"; - int maxfd; - int ctlfd; -#endif - char strbuf[ISC_STRERRORSIZE]; -#ifdef ISC_SOCKET_USE_POLLWATCH - pollstate_t pollstate = poll_idle; -#endif - -#if defined (USE_SELECT) - /* - * Get the control fd here. This will never change. - */ - ctlfd = manager->pipe_fds[0]; -#endif - done = ISC_FALSE; - while (!done) { - do { -#ifdef USE_KQUEUE - cc = kevent(manager->kqueue_fd, NULL, 0, - manager->events, manager->nevents, NULL); -#elif defined(USE_EPOLL) - cc = epoll_wait(manager->epoll_fd, manager->events, - manager->nevents, -1); -#elif defined(USE_DEVPOLL) - dvp.dp_fds = manager->events; - dvp.dp_nfds = manager->nevents; -#ifndef ISC_SOCKET_USE_POLLWATCH - dvp.dp_timeout = -1; -#else - if (pollstate == poll_idle) - dvp.dp_timeout = -1; - else - dvp.dp_timeout = ISC_SOCKET_POLLWATCH_TIMEOUT; -#endif /* ISC_SOCKET_USE_POLLWATCH */ - cc = ioctl(manager->devpoll_fd, DP_POLL, &dvp); -#elif defined(USE_SELECT) - LOCK(&manager->lock); - memcpy(manager->read_fds_copy, manager->read_fds, - manager->fd_bufsize); - memcpy(manager->write_fds_copy, manager->write_fds, - manager->fd_bufsize); - maxfd = manager->maxfd + 1; - UNLOCK(&manager->lock); - - cc = select(maxfd, manager->read_fds_copy, - manager->write_fds_copy, NULL, NULL); -#endif /* USE_KQUEUE */ - - if (cc < 0 && !SOFT_ERROR(errno)) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - FATAL_ERROR(__FILE__, __LINE__, - "%s %s: %s", fnname, - isc_msgcat_get(isc_msgcat, - ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, - "failed"), strbuf); - } - -#if defined(USE_DEVPOLL) && defined(ISC_SOCKET_USE_POLLWATCH) - if (cc == 0) { - if (pollstate == poll_active) - pollstate = poll_checking; - else if (pollstate == poll_checking) - pollstate = poll_idle; - } else if (cc > 0) { - if (pollstate == poll_checking) { - /* - * XXX: We'd like to use a more - * verbose log level as it's actually an - * unexpected event, but the kernel bug - * reportedly happens pretty frequently - * (and it can also be a false positive) - * so it would be just too noisy. - */ - manager_log(manager, - ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, - ISC_LOG_DEBUG(1), - "unexpected POLL timeout"); - } - pollstate = poll_active; - } -#endif - } while (cc < 0); - -#if defined(USE_KQUEUE) || defined (USE_EPOLL) || defined (USE_DEVPOLL) - done = process_fds(manager, manager->events, cc); -#elif defined(USE_SELECT) - process_fds(manager, maxfd, manager->read_fds_copy, - manager->write_fds_copy); - - /* - * Process reads on internal, control fd. - */ - if (FD_ISSET(ctlfd, manager->read_fds_copy)) - done = process_ctlfd(manager); -#endif - } - - manager_log(manager, TRACE, "%s", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_EXITING, "watcher exiting")); - - return ((isc_threadresult_t)0); -} -#endif /* USE_WATCHER_THREAD */ - -#ifdef BIND9 -ISC_SOCKETFUNC_SCOPE void -isc__socketmgr_setreserved(isc_socketmgr_t *manager0, isc_uint32_t reserved) { - isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0; - - REQUIRE(VALID_MANAGER(manager)); - - manager->reserved = reserved; -} - -ISC_SOCKETFUNC_SCOPE void -isc___socketmgr_maxudp(isc_socketmgr_t *manager0, int maxudp) { - isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0; - - REQUIRE(VALID_MANAGER(manager)); - - manager->maxudp = maxudp; -} -#endif /* BIND9 */ - -/* - * Create a new socket manager. - */ - -static isc_result_t -setup_watcher(isc_mem_t *mctx, isc__socketmgr_t *manager) { - isc_result_t result; -#if defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL) - char strbuf[ISC_STRERRORSIZE]; -#endif - -#ifdef USE_KQUEUE - manager->nevents = ISC_SOCKET_MAXEVENTS; - manager->events = isc_mem_get(mctx, sizeof(struct kevent) * - manager->nevents); - if (manager->events == NULL) - return (ISC_R_NOMEMORY); - manager->kqueue_fd = kqueue(); - if (manager->kqueue_fd == -1) { - result = isc__errno2result(errno); - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "kqueue %s: %s", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed"), - strbuf); - isc_mem_put(mctx, manager->events, - sizeof(struct kevent) * manager->nevents); - return (result); - } - -#ifdef USE_WATCHER_THREAD - result = watch_fd(manager, manager->pipe_fds[0], SELECT_POKE_READ); - if (result != ISC_R_SUCCESS) { - close(manager->kqueue_fd); - isc_mem_put(mctx, manager->events, - sizeof(struct kevent) * manager->nevents); - return (result); - } -#endif /* USE_WATCHER_THREAD */ -#elif defined(USE_EPOLL) - manager->nevents = ISC_SOCKET_MAXEVENTS; - manager->events = isc_mem_get(mctx, sizeof(struct epoll_event) * - manager->nevents); - if (manager->events == NULL) - return (ISC_R_NOMEMORY); - manager->epoll_fd = epoll_create(manager->nevents); - if (manager->epoll_fd == -1) { - result = isc__errno2result(errno); - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "epoll_create %s: %s", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed"), - strbuf); - isc_mem_put(mctx, manager->events, - sizeof(struct epoll_event) * manager->nevents); - return (result); - } -#ifdef USE_WATCHER_THREAD - result = watch_fd(manager, manager->pipe_fds[0], SELECT_POKE_READ); - if (result != ISC_R_SUCCESS) { - close(manager->epoll_fd); - isc_mem_put(mctx, manager->events, - sizeof(struct epoll_event) * manager->nevents); - return (result); - } -#endif /* USE_WATCHER_THREAD */ -#elif defined(USE_DEVPOLL) - /* - * XXXJT: /dev/poll seems to reject large numbers of events, - * so we should be careful about redefining ISC_SOCKET_MAXEVENTS. - */ - manager->nevents = ISC_SOCKET_MAXEVENTS; - manager->events = isc_mem_get(mctx, sizeof(struct pollfd) * - manager->nevents); - if (manager->events == NULL) - return (ISC_R_NOMEMORY); - /* - * Note: fdpollinfo should be able to support all possible FDs, so - * it must have maxsocks entries (not nevents). - */ - manager->fdpollinfo = isc_mem_get(mctx, sizeof(pollinfo_t) * - manager->maxsocks); - if (manager->fdpollinfo == NULL) { - isc_mem_put(mctx, manager->events, - sizeof(struct pollfd) * manager->nevents); - return (ISC_R_NOMEMORY); - } - memset(manager->fdpollinfo, 0, sizeof(pollinfo_t) * manager->maxsocks); - manager->devpoll_fd = open("/dev/poll", O_RDWR); - if (manager->devpoll_fd == -1) { - result = isc__errno2result(errno); - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "open(/dev/poll) %s: %s", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed"), - strbuf); - isc_mem_put(mctx, manager->events, - sizeof(struct pollfd) * manager->nevents); - isc_mem_put(mctx, manager->fdpollinfo, - sizeof(pollinfo_t) * manager->maxsocks); - return (result); - } -#ifdef USE_WATCHER_THREAD - result = watch_fd(manager, manager->pipe_fds[0], SELECT_POKE_READ); - if (result != ISC_R_SUCCESS) { - close(manager->devpoll_fd); - isc_mem_put(mctx, manager->events, - sizeof(struct pollfd) * manager->nevents); - isc_mem_put(mctx, manager->fdpollinfo, - sizeof(pollinfo_t) * manager->maxsocks); - return (result); - } -#endif /* USE_WATCHER_THREAD */ -#elif defined(USE_SELECT) - UNUSED(result); - -#if ISC_SOCKET_MAXSOCKETS > FD_SETSIZE - /* - * Note: this code should also cover the case of MAXSOCKETS <= - * FD_SETSIZE, but we separate the cases to avoid possible portability - * issues regarding howmany() and the actual representation of fd_set. - */ - manager->fd_bufsize = howmany(manager->maxsocks, NFDBITS) * - sizeof(fd_mask); -#else - manager->fd_bufsize = sizeof(fd_set); -#endif - - manager->read_fds = NULL; - manager->read_fds_copy = NULL; - manager->write_fds = NULL; - manager->write_fds_copy = NULL; - - manager->read_fds = isc_mem_get(mctx, manager->fd_bufsize); - if (manager->read_fds != NULL) - manager->read_fds_copy = isc_mem_get(mctx, manager->fd_bufsize); - if (manager->read_fds_copy != NULL) - manager->write_fds = isc_mem_get(mctx, manager->fd_bufsize); - if (manager->write_fds != NULL) { - manager->write_fds_copy = isc_mem_get(mctx, - manager->fd_bufsize); - } - if (manager->write_fds_copy == NULL) { - if (manager->write_fds != NULL) { - isc_mem_put(mctx, manager->write_fds, - manager->fd_bufsize); - } - if (manager->read_fds_copy != NULL) { - isc_mem_put(mctx, manager->read_fds_copy, - manager->fd_bufsize); - } - if (manager->read_fds != NULL) { - isc_mem_put(mctx, manager->read_fds, - manager->fd_bufsize); - } - return (ISC_R_NOMEMORY); - } - memset(manager->read_fds, 0, manager->fd_bufsize); - memset(manager->write_fds, 0, manager->fd_bufsize); - -#ifdef USE_WATCHER_THREAD - (void)watch_fd(manager, manager->pipe_fds[0], SELECT_POKE_READ); - manager->maxfd = manager->pipe_fds[0]; -#else /* USE_WATCHER_THREAD */ - manager->maxfd = 0; -#endif /* USE_WATCHER_THREAD */ -#endif /* USE_KQUEUE */ - - return (ISC_R_SUCCESS); -} - -static void -cleanup_watcher(isc_mem_t *mctx, isc__socketmgr_t *manager) { -#ifdef USE_WATCHER_THREAD - isc_result_t result; - - result = unwatch_fd(manager, manager->pipe_fds[0], SELECT_POKE_READ); - if (result != ISC_R_SUCCESS) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "epoll_ctl(DEL) %s", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed")); - } -#endif /* USE_WATCHER_THREAD */ - -#ifdef USE_KQUEUE - close(manager->kqueue_fd); - isc_mem_put(mctx, manager->events, - sizeof(struct kevent) * manager->nevents); -#elif defined(USE_EPOLL) - close(manager->epoll_fd); - isc_mem_put(mctx, manager->events, - sizeof(struct epoll_event) * manager->nevents); -#elif defined(USE_DEVPOLL) - close(manager->devpoll_fd); - isc_mem_put(mctx, manager->events, - sizeof(struct pollfd) * manager->nevents); - isc_mem_put(mctx, manager->fdpollinfo, - sizeof(pollinfo_t) * manager->maxsocks); -#elif defined(USE_SELECT) - if (manager->read_fds != NULL) - isc_mem_put(mctx, manager->read_fds, manager->fd_bufsize); - if (manager->read_fds_copy != NULL) - isc_mem_put(mctx, manager->read_fds_copy, manager->fd_bufsize); - if (manager->write_fds != NULL) - isc_mem_put(mctx, manager->write_fds, manager->fd_bufsize); - if (manager->write_fds_copy != NULL) - isc_mem_put(mctx, manager->write_fds_copy, manager->fd_bufsize); -#endif /* USE_KQUEUE */ -} - -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp) { - return (isc__socketmgr_create2(mctx, managerp, 0)); -} - -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp, - unsigned int maxsocks) -{ - int i; - isc__socketmgr_t *manager; -#ifdef USE_WATCHER_THREAD - char strbuf[ISC_STRERRORSIZE]; -#endif - isc_result_t result; - - REQUIRE(managerp != NULL && *managerp == NULL); - -#ifdef USE_SHARED_MANAGER - if (socketmgr != NULL) { - /* Don't allow maxsocks to be updated */ - if (maxsocks > 0 && socketmgr->maxsocks != maxsocks) - return (ISC_R_EXISTS); - - socketmgr->refs++; - *managerp = (isc_socketmgr_t *)socketmgr; - return (ISC_R_SUCCESS); - } -#endif /* USE_SHARED_MANAGER */ - - if (maxsocks == 0) - maxsocks = ISC_SOCKET_MAXSOCKETS; - - manager = isc_mem_get(mctx, sizeof(*manager)); - if (manager == NULL) - return (ISC_R_NOMEMORY); - - /* zero-clear so that necessary cleanup on failure will be easy */ - memset(manager, 0, sizeof(*manager)); - manager->maxsocks = maxsocks; - manager->reserved = 0; - manager->maxudp = 0; - manager->fds = isc_mem_get(mctx, - manager->maxsocks * sizeof(isc__socket_t *)); - if (manager->fds == NULL) { - result = ISC_R_NOMEMORY; - goto free_manager; - } - manager->fdstate = isc_mem_get(mctx, manager->maxsocks * sizeof(int)); - if (manager->fdstate == NULL) { - result = ISC_R_NOMEMORY; - goto free_manager; - } - manager->stats = NULL; - - manager->common.methods = &socketmgrmethods; - manager->common.magic = ISCAPI_SOCKETMGR_MAGIC; - manager->common.impmagic = SOCKET_MANAGER_MAGIC; - manager->mctx = NULL; - memset(manager->fds, 0, manager->maxsocks * sizeof(isc_socket_t *)); - ISC_LIST_INIT(manager->socklist); - result = isc_mutex_init(&manager->lock); - if (result != ISC_R_SUCCESS) - goto free_manager; - manager->fdlock = isc_mem_get(mctx, FDLOCK_COUNT * sizeof(isc_mutex_t)); - if (manager->fdlock == NULL) { - result = ISC_R_NOMEMORY; - goto cleanup_lock; - } - for (i = 0; i < FDLOCK_COUNT; i++) { - result = isc_mutex_init(&manager->fdlock[i]); - if (result != ISC_R_SUCCESS) { - while (--i >= 0) - DESTROYLOCK(&manager->fdlock[i]); - isc_mem_put(mctx, manager->fdlock, - FDLOCK_COUNT * sizeof(isc_mutex_t)); - manager->fdlock = NULL; - goto cleanup_lock; - } - } - -#ifdef USE_WATCHER_THREAD - if (isc_condition_init(&manager->shutdown_ok) != ISC_R_SUCCESS) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_condition_init() %s", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed")); - result = ISC_R_UNEXPECTED; - goto cleanup_lock; - } - - /* - * Create the special fds that will be used to wake up the - * select/poll loop when something internal needs to be done. - */ - if (pipe(manager->pipe_fds) != 0) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "pipe() %s: %s", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed"), - strbuf); - result = ISC_R_UNEXPECTED; - goto cleanup_condition; - } - - RUNTIME_CHECK(make_nonblock(manager->pipe_fds[0]) == ISC_R_SUCCESS); -#if 0 - RUNTIME_CHECK(make_nonblock(manager->pipe_fds[1]) == ISC_R_SUCCESS); -#endif -#endif /* USE_WATCHER_THREAD */ - -#ifdef USE_SHARED_MANAGER - manager->refs = 1; -#endif /* USE_SHARED_MANAGER */ - - /* - * Set up initial state for the select loop - */ - result = setup_watcher(mctx, manager); - if (result != ISC_R_SUCCESS) - goto cleanup; - memset(manager->fdstate, 0, manager->maxsocks * sizeof(int)); -#ifdef USE_WATCHER_THREAD - /* - * Start up the select/poll thread. - */ - if (isc_thread_create(watcher, manager, &manager->watcher) != - ISC_R_SUCCESS) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_thread_create() %s", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed")); - cleanup_watcher(mctx, manager); - result = ISC_R_UNEXPECTED; - goto cleanup; - } -#endif /* USE_WATCHER_THREAD */ - isc_mem_attach(mctx, &manager->mctx); - -#ifdef USE_SHARED_MANAGER - socketmgr = manager; -#endif /* USE_SHARED_MANAGER */ - *managerp = (isc_socketmgr_t *)manager; - - return (ISC_R_SUCCESS); - -cleanup: -#ifdef USE_WATCHER_THREAD - (void)close(manager->pipe_fds[0]); - (void)close(manager->pipe_fds[1]); -#endif /* USE_WATCHER_THREAD */ - -#ifdef USE_WATCHER_THREAD -cleanup_condition: - (void)isc_condition_destroy(&manager->shutdown_ok); -#endif /* USE_WATCHER_THREAD */ - - -cleanup_lock: - if (manager->fdlock != NULL) { - for (i = 0; i < FDLOCK_COUNT; i++) - DESTROYLOCK(&manager->fdlock[i]); - } - DESTROYLOCK(&manager->lock); - -free_manager: - if (manager->fdlock != NULL) { - isc_mem_put(mctx, manager->fdlock, - FDLOCK_COUNT * sizeof(isc_mutex_t)); - } - if (manager->fdstate != NULL) { - isc_mem_put(mctx, manager->fdstate, - manager->maxsocks * sizeof(int)); - } - if (manager->fds != NULL) { - isc_mem_put(mctx, manager->fds, - manager->maxsocks * sizeof(isc_socket_t *)); - } - isc_mem_put(mctx, manager, sizeof(*manager)); - - return (result); -} - -#ifdef BIND9 -isc_result_t -isc__socketmgr_getmaxsockets(isc_socketmgr_t *manager0, unsigned int *nsockp) { - isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0; - REQUIRE(VALID_MANAGER(manager)); - REQUIRE(nsockp != NULL); - - *nsockp = manager->maxsocks; - - return (ISC_R_SUCCESS); -} - -void -isc__socketmgr_setstats(isc_socketmgr_t *manager0, isc_stats_t *stats) { - isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0; - - REQUIRE(VALID_MANAGER(manager)); - REQUIRE(ISC_LIST_EMPTY(manager->socklist)); - REQUIRE(manager->stats == NULL); - REQUIRE(isc_stats_ncounters(stats) == isc_sockstatscounter_max); - - isc_stats_attach(stats, &manager->stats); -} -#endif - -ISC_SOCKETFUNC_SCOPE void -isc__socketmgr_destroy(isc_socketmgr_t **managerp) { - isc__socketmgr_t *manager; - int i; - isc_mem_t *mctx; - - /* - * Destroy a socket manager. - */ - - REQUIRE(managerp != NULL); - manager = (isc__socketmgr_t *)*managerp; - REQUIRE(VALID_MANAGER(manager)); - -#ifdef USE_SHARED_MANAGER - manager->refs--; - if (manager->refs > 0) { - *managerp = NULL; - return; - } - socketmgr = NULL; -#endif /* USE_SHARED_MANAGER */ - - LOCK(&manager->lock); - - /* - * Wait for all sockets to be destroyed. - */ - while (!ISC_LIST_EMPTY(manager->socklist)) { -#ifdef USE_WATCHER_THREAD - manager_log(manager, CREATION, "%s", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_SOCKETSREMAIN, - "sockets exist")); - WAIT(&manager->shutdown_ok, &manager->lock); -#else /* USE_WATCHER_THREAD */ - UNLOCK(&manager->lock); - isc__taskmgr_dispatch(NULL); - LOCK(&manager->lock); -#endif /* USE_WATCHER_THREAD */ - } - - UNLOCK(&manager->lock); - - /* - * Here, poke our select/poll thread. Do this by closing the write - * half of the pipe, which will send EOF to the read half. - * This is currently a no-op in the non-threaded case. - */ - select_poke(manager, 0, SELECT_POKE_SHUTDOWN); - -#ifdef USE_WATCHER_THREAD - /* - * Wait for thread to exit. - */ - if (isc_thread_join(manager->watcher, NULL) != ISC_R_SUCCESS) - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_thread_join() %s", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed")); -#endif /* USE_WATCHER_THREAD */ - - /* - * Clean up. - */ - cleanup_watcher(manager->mctx, manager); - -#ifdef USE_WATCHER_THREAD - (void)close(manager->pipe_fds[0]); - (void)close(manager->pipe_fds[1]); - (void)isc_condition_destroy(&manager->shutdown_ok); -#endif /* USE_WATCHER_THREAD */ - - for (i = 0; i < (int)manager->maxsocks; i++) - if (manager->fdstate[i] == CLOSE_PENDING) /* no need to lock */ - (void)close(i); - - isc_mem_put(manager->mctx, manager->fds, - manager->maxsocks * sizeof(isc__socket_t *)); - isc_mem_put(manager->mctx, manager->fdstate, - manager->maxsocks * sizeof(int)); - - if (manager->stats != NULL) - isc_stats_detach(&manager->stats); - - if (manager->fdlock != NULL) { - for (i = 0; i < FDLOCK_COUNT; i++) - DESTROYLOCK(&manager->fdlock[i]); - isc_mem_put(manager->mctx, manager->fdlock, - FDLOCK_COUNT * sizeof(isc_mutex_t)); - } - DESTROYLOCK(&manager->lock); - manager->common.magic = 0; - manager->common.impmagic = 0; - mctx= manager->mctx; - isc_mem_put(mctx, manager, sizeof(*manager)); - - isc_mem_detach(&mctx); - - *managerp = NULL; - -#ifdef USE_SHARED_MANAGER - socketmgr = NULL; -#endif -} - -static isc_result_t -socket_recv(isc__socket_t *sock, isc_socketevent_t *dev, isc_task_t *task, - unsigned int flags) -{ - int io_state; - isc_boolean_t have_lock = ISC_FALSE; - isc_task_t *ntask = NULL; - isc_result_t result = ISC_R_SUCCESS; - - dev->ev_sender = task; - - if (sock->type == isc_sockettype_udp) { - io_state = doio_recv(sock, dev); - } else { - LOCK(&sock->lock); - have_lock = ISC_TRUE; - - if (ISC_LIST_EMPTY(sock->recv_list)) - io_state = doio_recv(sock, dev); - else - io_state = DOIO_SOFT; - } - - switch (io_state) { - case DOIO_SOFT: - /* - * We couldn't read all or part of the request right now, so - * queue it. - * - * Attach to socket and to task - */ - isc_task_attach(task, &ntask); - dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED; - - if (!have_lock) { - LOCK(&sock->lock); - have_lock = ISC_TRUE; - } - - /* - * Enqueue the request. If the socket was previously not being - * watched, poke the watcher to start paying attention to it. - */ - if (ISC_LIST_EMPTY(sock->recv_list) && !sock->pending_recv) - select_poke(sock->manager, sock->fd, SELECT_POKE_READ); - ISC_LIST_ENQUEUE(sock->recv_list, dev, ev_link); - - socket_log(sock, NULL, EVENT, NULL, 0, 0, - "socket_recv: event %p -> task %p", - dev, ntask); - - if ((flags & ISC_SOCKFLAG_IMMEDIATE) != 0) - result = ISC_R_INPROGRESS; - break; - - case DOIO_EOF: - dev->result = ISC_R_EOF; - /* fallthrough */ - - case DOIO_HARD: - case DOIO_SUCCESS: - if ((flags & ISC_SOCKFLAG_IMMEDIATE) == 0) - send_recvdone_event(sock, &dev); - break; - } - - if (have_lock) - UNLOCK(&sock->lock); - - return (result); -} - -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_recvv(isc_socket_t *sock0, isc_bufferlist_t *buflist, - unsigned int minimum, isc_task_t *task, - isc_taskaction_t action, const void *arg) -{ - isc__socket_t *sock = (isc__socket_t *)sock0; - isc_socketevent_t *dev; - isc__socketmgr_t *manager; - unsigned int iocount; - isc_buffer_t *buffer; - - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(buflist != NULL); - REQUIRE(!ISC_LIST_EMPTY(*buflist)); - REQUIRE(task != NULL); - REQUIRE(action != NULL); - - manager = sock->manager; - REQUIRE(VALID_MANAGER(manager)); - - iocount = isc_bufferlist_availablecount(buflist); - REQUIRE(iocount > 0); - - INSIST(sock->bound); - - dev = allocate_socketevent(sock, ISC_SOCKEVENT_RECVDONE, action, arg); - if (dev == NULL) - return (ISC_R_NOMEMORY); - - /* - * UDP sockets are always partial read - */ - if (sock->type == isc_sockettype_udp) - dev->minimum = 1; - else { - if (minimum == 0) - dev->minimum = iocount; - else - dev->minimum = minimum; - } - - /* - * Move each buffer from the passed in list to our internal one. - */ - buffer = ISC_LIST_HEAD(*buflist); - while (buffer != NULL) { - ISC_LIST_DEQUEUE(*buflist, buffer, link); - ISC_LIST_ENQUEUE(dev->bufferlist, buffer, link); - buffer = ISC_LIST_HEAD(*buflist); - } - - return (socket_recv(sock, dev, task, 0)); -} - -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_recv(isc_socket_t *sock0, isc_region_t *region, - unsigned int minimum, isc_task_t *task, - isc_taskaction_t action, const void *arg) -{ - isc__socket_t *sock = (isc__socket_t *)sock0; - isc_socketevent_t *dev; - isc__socketmgr_t *manager; - - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(action != NULL); - - manager = sock->manager; - REQUIRE(VALID_MANAGER(manager)); - - INSIST(sock->bound); - - dev = allocate_socketevent(sock, ISC_SOCKEVENT_RECVDONE, action, arg); - if (dev == NULL) - return (ISC_R_NOMEMORY); - - return (isc__socket_recv2(sock0, region, minimum, task, dev, 0)); -} - -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_recv2(isc_socket_t *sock0, isc_region_t *region, - unsigned int minimum, isc_task_t *task, - isc_socketevent_t *event, unsigned int flags) -{ - isc__socket_t *sock = (isc__socket_t *)sock0; - - event->ev_sender = sock; - event->result = ISC_R_UNSET; - ISC_LIST_INIT(event->bufferlist); - event->region = *region; - event->n = 0; - event->offset = 0; - event->attributes = 0; - - /* - * UDP sockets are always partial read. - */ - if (sock->type == isc_sockettype_udp) - event->minimum = 1; - else { - if (minimum == 0) - event->minimum = region->length; - else - event->minimum = minimum; - } - - return (socket_recv(sock, event, task, flags)); -} - -static isc_result_t -socket_send(isc__socket_t *sock, isc_socketevent_t *dev, isc_task_t *task, - isc_sockaddr_t *address, struct in6_pktinfo *pktinfo, - unsigned int flags) -{ - int io_state; - isc_boolean_t have_lock = ISC_FALSE; - isc_task_t *ntask = NULL; - isc_result_t result = ISC_R_SUCCESS; - - dev->ev_sender = task; - - set_dev_address(address, sock, dev); - if (pktinfo != NULL) { - dev->attributes |= ISC_SOCKEVENTATTR_PKTINFO; - dev->pktinfo = *pktinfo; - - if (!isc_sockaddr_issitelocal(&dev->address) && - !isc_sockaddr_islinklocal(&dev->address)) { - socket_log(sock, NULL, TRACE, isc_msgcat, - ISC_MSGSET_SOCKET, ISC_MSG_PKTINFOPROVIDED, - "pktinfo structure provided, ifindex %u " - "(set to 0)", pktinfo->ipi6_ifindex); - - /* - * Set the pktinfo index to 0 here, to let the - * kernel decide what interface it should send on. - */ - dev->pktinfo.ipi6_ifindex = 0; - } - } - - if (sock->type == isc_sockettype_udp) - io_state = doio_send(sock, dev); - else { - LOCK(&sock->lock); - have_lock = ISC_TRUE; - - if (ISC_LIST_EMPTY(sock->send_list)) - io_state = doio_send(sock, dev); - else - io_state = DOIO_SOFT; - } - - switch (io_state) { - case DOIO_SOFT: - /* - * We couldn't send all or part of the request right now, so - * queue it unless ISC_SOCKFLAG_NORETRY is set. - */ - if ((flags & ISC_SOCKFLAG_NORETRY) == 0) { - isc_task_attach(task, &ntask); - dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED; - - if (!have_lock) { - LOCK(&sock->lock); - have_lock = ISC_TRUE; - } - - /* - * Enqueue the request. If the socket was previously - * not being watched, poke the watcher to start - * paying attention to it. - */ - if (ISC_LIST_EMPTY(sock->send_list) && - !sock->pending_send) - select_poke(sock->manager, sock->fd, - SELECT_POKE_WRITE); - ISC_LIST_ENQUEUE(sock->send_list, dev, ev_link); - - socket_log(sock, NULL, EVENT, NULL, 0, 0, - "socket_send: event %p -> task %p", - dev, ntask); - - if ((flags & ISC_SOCKFLAG_IMMEDIATE) != 0) - result = ISC_R_INPROGRESS; - break; - } - - case DOIO_HARD: - case DOIO_SUCCESS: - if ((flags & ISC_SOCKFLAG_IMMEDIATE) == 0) - send_senddone_event(sock, &dev); - break; - } - - if (have_lock) - UNLOCK(&sock->lock); - - return (result); -} - -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_send(isc_socket_t *sock, isc_region_t *region, - isc_task_t *task, isc_taskaction_t action, const void *arg) -{ - /* - * REQUIRE() checking is performed in isc_socket_sendto(). - */ - return (isc__socket_sendto(sock, region, task, action, arg, NULL, - NULL)); -} - -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_sendto(isc_socket_t *sock0, isc_region_t *region, - isc_task_t *task, isc_taskaction_t action, const void *arg, - isc_sockaddr_t *address, struct in6_pktinfo *pktinfo) -{ - isc__socket_t *sock = (isc__socket_t *)sock0; - isc_socketevent_t *dev; - isc__socketmgr_t *manager; - - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(region != NULL); - REQUIRE(task != NULL); - REQUIRE(action != NULL); - - manager = sock->manager; - REQUIRE(VALID_MANAGER(manager)); - - INSIST(sock->bound); - - dev = allocate_socketevent(sock, ISC_SOCKEVENT_SENDDONE, action, arg); - if (dev == NULL) - return (ISC_R_NOMEMORY); - - dev->region = *region; - - return (socket_send(sock, dev, task, address, pktinfo, 0)); -} - -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, const void *arg) -{ - return (isc__socket_sendtov(sock, buflist, task, action, arg, NULL, - NULL)); -} - -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_sendtov(isc_socket_t *sock0, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, const void *arg, - isc_sockaddr_t *address, struct in6_pktinfo *pktinfo) -{ - isc__socket_t *sock = (isc__socket_t *)sock0; - isc_socketevent_t *dev; - isc__socketmgr_t *manager; - unsigned int iocount; - isc_buffer_t *buffer; - - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(buflist != NULL); - REQUIRE(!ISC_LIST_EMPTY(*buflist)); - REQUIRE(task != NULL); - REQUIRE(action != NULL); - - manager = sock->manager; - REQUIRE(VALID_MANAGER(manager)); - - iocount = isc_bufferlist_usedcount(buflist); - REQUIRE(iocount > 0); - - dev = allocate_socketevent(sock, ISC_SOCKEVENT_SENDDONE, action, arg); - if (dev == NULL) - return (ISC_R_NOMEMORY); - - /* - * Move each buffer from the passed in list to our internal one. - */ - buffer = ISC_LIST_HEAD(*buflist); - while (buffer != NULL) { - ISC_LIST_DEQUEUE(*buflist, buffer, link); - ISC_LIST_ENQUEUE(dev->bufferlist, buffer, link); - buffer = ISC_LIST_HEAD(*buflist); - } - - return (socket_send(sock, dev, task, address, pktinfo, 0)); -} - -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_sendto2(isc_socket_t *sock0, isc_region_t *region, - isc_task_t *task, - isc_sockaddr_t *address, struct in6_pktinfo *pktinfo, - isc_socketevent_t *event, unsigned int flags) -{ - isc__socket_t *sock = (isc__socket_t *)sock0; - - REQUIRE(VALID_SOCKET(sock)); - REQUIRE((flags & ~(ISC_SOCKFLAG_IMMEDIATE|ISC_SOCKFLAG_NORETRY)) == 0); - if ((flags & ISC_SOCKFLAG_NORETRY) != 0) - REQUIRE(sock->type == isc_sockettype_udp); - event->ev_sender = sock; - event->result = ISC_R_UNSET; - ISC_LIST_INIT(event->bufferlist); - event->region = *region; - event->n = 0; - event->offset = 0; - event->attributes = 0; - - return (socket_send(sock, event, task, address, pktinfo, flags)); -} - -ISC_SOCKETFUNC_SCOPE void -isc__socket_cleanunix(isc_sockaddr_t *sockaddr, isc_boolean_t active) { -#ifdef ISC_PLATFORM_HAVESYSUNH - int s; - struct stat sb; - char strbuf[ISC_STRERRORSIZE]; - - if (sockaddr->type.sa.sa_family != AF_UNIX) - return; - -#ifndef S_ISSOCK -#if defined(S_IFMT) && defined(S_IFSOCK) -#define S_ISSOCK(mode) ((mode & S_IFMT)==S_IFSOCK) -#elif defined(_S_IFMT) && defined(S_IFSOCK) -#define S_ISSOCK(mode) ((mode & _S_IFMT)==S_IFSOCK) -#endif -#endif - -#ifndef S_ISFIFO -#if defined(S_IFMT) && defined(S_IFIFO) -#define S_ISFIFO(mode) ((mode & S_IFMT)==S_IFIFO) -#elif defined(_S_IFMT) && defined(S_IFIFO) -#define S_ISFIFO(mode) ((mode & _S_IFMT)==S_IFIFO) -#endif -#endif - -#if !defined(S_ISFIFO) && !defined(S_ISSOCK) -#error You need to define S_ISFIFO and S_ISSOCK as appropriate for your platform. See . -#endif - -#ifndef S_ISFIFO -#define S_ISFIFO(mode) 0 -#endif - -#ifndef S_ISSOCK -#define S_ISSOCK(mode) 0 -#endif - - if (active) { - if (stat(sockaddr->type.sunix.sun_path, &sb) < 0) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, - "isc_socket_cleanunix: stat(%s): %s", - sockaddr->type.sunix.sun_path, strbuf); - return; - } - if (!(S_ISSOCK(sb.st_mode) || S_ISFIFO(sb.st_mode))) { - isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, - "isc_socket_cleanunix: %s: not a socket", - sockaddr->type.sunix.sun_path); - return; - } - if (unlink(sockaddr->type.sunix.sun_path) < 0) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, - "isc_socket_cleanunix: unlink(%s): %s", - sockaddr->type.sunix.sun_path, strbuf); - } - return; - } - - s = socket(AF_UNIX, SOCK_STREAM, 0); - if (s < 0) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING, - "isc_socket_cleanunix: socket(%s): %s", - sockaddr->type.sunix.sun_path, strbuf); - return; - } - - if (stat(sockaddr->type.sunix.sun_path, &sb) < 0) { - switch (errno) { - case ENOENT: /* We exited cleanly last time */ - break; - default: - isc__strerror(errno, strbuf, sizeof(strbuf)); - isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING, - "isc_socket_cleanunix: stat(%s): %s", - sockaddr->type.sunix.sun_path, strbuf); - break; - } - goto cleanup; - } - - if (!(S_ISSOCK(sb.st_mode) || S_ISFIFO(sb.st_mode))) { - isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING, - "isc_socket_cleanunix: %s: not a socket", - sockaddr->type.sunix.sun_path); - goto cleanup; - } - - if (connect(s, (struct sockaddr *)&sockaddr->type.sunix, - sizeof(sockaddr->type.sunix)) < 0) { - switch (errno) { - case ECONNREFUSED: - case ECONNRESET: - if (unlink(sockaddr->type.sunix.sun_path) < 0) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, - ISC_LOG_WARNING, - "isc_socket_cleanunix: " - "unlink(%s): %s", - sockaddr->type.sunix.sun_path, - strbuf); - } - break; - default: - isc__strerror(errno, strbuf, sizeof(strbuf)); - isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING, - "isc_socket_cleanunix: connect(%s): %s", - sockaddr->type.sunix.sun_path, strbuf); - break; - } - } - cleanup: - close(s); -#else - UNUSED(sockaddr); - UNUSED(active); -#endif -} - -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_permunix(isc_sockaddr_t *sockaddr, isc_uint32_t perm, - isc_uint32_t owner, isc_uint32_t group) -{ -#ifdef ISC_PLATFORM_HAVESYSUNH - isc_result_t result = ISC_R_SUCCESS; - char strbuf[ISC_STRERRORSIZE]; - char path[sizeof(sockaddr->type.sunix.sun_path)]; -#ifdef NEED_SECURE_DIRECTORY - char *slash; -#endif - - REQUIRE(sockaddr->type.sa.sa_family == AF_UNIX); - INSIST(strlen(sockaddr->type.sunix.sun_path) < sizeof(path)); - strcpy(path, sockaddr->type.sunix.sun_path); - -#ifdef NEED_SECURE_DIRECTORY - slash = strrchr(path, '/'); - if (slash != NULL) { - if (slash != path) - *slash = '\0'; - else - strcpy(path, "/"); - } else - strcpy(path, "."); -#endif - - if (chmod(path, perm) < 0) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, - "isc_socket_permunix: chmod(%s, %d): %s", - path, perm, strbuf); - result = ISC_R_FAILURE; - } - if (chown(path, owner, group) < 0) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, - "isc_socket_permunix: chown(%s, %d, %d): %s", - path, owner, group, - strbuf); - result = ISC_R_FAILURE; - } - return (result); -#else - UNUSED(sockaddr); - UNUSED(perm); - UNUSED(owner); - UNUSED(group); - return (ISC_R_NOTIMPLEMENTED); -#endif -} - -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_bind(isc_socket_t *sock0, isc_sockaddr_t *sockaddr, - unsigned int options) { - isc__socket_t *sock = (isc__socket_t *)sock0; - char strbuf[ISC_STRERRORSIZE]; - int on = 1; - - REQUIRE(VALID_SOCKET(sock)); - - LOCK(&sock->lock); - - INSIST(!sock->bound); - INSIST(!sock->dupped); - - if (sock->pf != sockaddr->type.sa.sa_family) { - UNLOCK(&sock->lock); - return (ISC_R_FAMILYMISMATCH); - } - - /* - * Only set SO_REUSEADDR when we want a specific port. - */ -#ifdef AF_UNIX - if (sock->pf == AF_UNIX) - goto bind_socket; -#endif - if ((options & ISC_SOCKET_REUSEADDRESS) != 0 && - isc_sockaddr_getport(sockaddr) != (in_port_t)0 && - setsockopt(sock->fd, SOL_SOCKET, SO_REUSEADDR, (void *)&on, - sizeof(on)) < 0) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "setsockopt(%d) %s", sock->fd, - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed")); - /* Press on... */ - } -#ifdef AF_UNIX - bind_socket: -#endif - if (bind(sock->fd, &sockaddr->type.sa, sockaddr->length) < 0) { - inc_stats(sock->manager->stats, - sock->statsindex[STATID_BINDFAIL]); - - UNLOCK(&sock->lock); - switch (errno) { - case EACCES: - return (ISC_R_NOPERM); - case EADDRNOTAVAIL: - return (ISC_R_ADDRNOTAVAIL); - case EADDRINUSE: - return (ISC_R_ADDRINUSE); - case EINVAL: - return (ISC_R_BOUND); - default: - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, "bind: %s", - strbuf); - return (ISC_R_UNEXPECTED); - } - } - - socket_log(sock, sockaddr, TRACE, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_BOUND, "bound"); - sock->bound = 1; - - UNLOCK(&sock->lock); - return (ISC_R_SUCCESS); -} - -/* - * Enable this only for specific OS versions, and only when they have repaired - * their problems with it. Until then, this is is broken and needs to be - * diabled by default. See RT22589 for details. - */ -#undef ENABLE_ACCEPTFILTER - -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_filter(isc_socket_t *sock0, const char *filter) { - isc__socket_t *sock = (isc__socket_t *)sock0; -#if defined(SO_ACCEPTFILTER) && defined(ENABLE_ACCEPTFILTER) - char strbuf[ISC_STRERRORSIZE]; - struct accept_filter_arg afa; -#else - UNUSED(sock); - UNUSED(filter); -#endif - - REQUIRE(VALID_SOCKET(sock)); - -#if defined(SO_ACCEPTFILTER) && defined(ENABLE_ACCEPTFILTER) - bzero(&afa, sizeof(afa)); - strncpy(afa.af_name, filter, sizeof(afa.af_name)); - if (setsockopt(sock->fd, SOL_SOCKET, SO_ACCEPTFILTER, - &afa, sizeof(afa)) == -1) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - socket_log(sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_FILTER, "setsockopt(SO_ACCEPTFILTER): %s", - strbuf); - return (ISC_R_FAILURE); - } - return (ISC_R_SUCCESS); -#else - return (ISC_R_NOTIMPLEMENTED); -#endif -} - -/* - * Set up to listen on a given socket. We do this by creating an internal - * event that will be dispatched when the socket has read activity. The - * watcher will send the internal event to the task when there is a new - * connection. - * - * Unlike in read, we don't preallocate a done event here. Every time there - * is a new connection we'll have to allocate a new one anyway, so we might - * as well keep things simple rather than having to track them. - */ -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_listen(isc_socket_t *sock0, unsigned int backlog) { - isc__socket_t *sock = (isc__socket_t *)sock0; - char strbuf[ISC_STRERRORSIZE]; - - REQUIRE(VALID_SOCKET(sock)); - - LOCK(&sock->lock); - - REQUIRE(!sock->listener); - REQUIRE(sock->bound); - REQUIRE(sock->type == isc_sockettype_tcp || - sock->type == isc_sockettype_unix); - - if (backlog == 0) - backlog = SOMAXCONN; - - if (listen(sock->fd, (int)backlog) < 0) { - UNLOCK(&sock->lock); - isc__strerror(errno, strbuf, sizeof(strbuf)); - - UNEXPECTED_ERROR(__FILE__, __LINE__, "listen: %s", strbuf); - - return (ISC_R_UNEXPECTED); - } - - sock->listener = 1; - - UNLOCK(&sock->lock); - return (ISC_R_SUCCESS); -} - -/* - * This should try to do aggressive accept() XXXMLG - */ -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_accept(isc_socket_t *sock0, - isc_task_t *task, isc_taskaction_t action, const void *arg) -{ - isc__socket_t *sock = (isc__socket_t *)sock0; - isc_socket_newconnev_t *dev; - isc__socketmgr_t *manager; - isc_task_t *ntask = NULL; - isc__socket_t *nsock; - isc_result_t result; - isc_boolean_t do_poke = ISC_FALSE; - - REQUIRE(VALID_SOCKET(sock)); - manager = sock->manager; - REQUIRE(VALID_MANAGER(manager)); - - LOCK(&sock->lock); - - REQUIRE(sock->listener); - - /* - * Sender field is overloaded here with the task we will be sending - * this event to. Just before the actual event is delivered the - * actual ev_sender will be touched up to be the socket. - */ - dev = (isc_socket_newconnev_t *) - isc_event_allocate(manager->mctx, task, ISC_SOCKEVENT_NEWCONN, - action, arg, sizeof(*dev)); - if (dev == NULL) { - UNLOCK(&sock->lock); - return (ISC_R_NOMEMORY); - } - ISC_LINK_INIT(dev, ev_link); - - result = allocate_socket(manager, sock->type, &nsock); - if (result != ISC_R_SUCCESS) { - isc_event_free(ISC_EVENT_PTR(&dev)); - UNLOCK(&sock->lock); - return (result); - } - - /* - * Attach to socket and to task. - */ - isc_task_attach(task, &ntask); - if (isc_task_exiting(ntask)) { - free_socket(&nsock); - isc_task_detach(&ntask); - isc_event_free(ISC_EVENT_PTR(&dev)); - UNLOCK(&sock->lock); - return (ISC_R_SHUTTINGDOWN); - } - nsock->references++; - nsock->statsindex = sock->statsindex; - - dev->ev_sender = ntask; - dev->newsocket = (isc_socket_t *)nsock; - - /* - * Poke watcher here. We still have the socket locked, so there - * is no race condition. We will keep the lock for such a short - * bit of time waking it up now or later won't matter all that much. - */ - if (ISC_LIST_EMPTY(sock->accept_list)) - do_poke = ISC_TRUE; - - ISC_LIST_ENQUEUE(sock->accept_list, dev, ev_link); - - if (do_poke) - select_poke(manager, sock->fd, SELECT_POKE_ACCEPT); - - UNLOCK(&sock->lock); - return (ISC_R_SUCCESS); -} - -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_connect(isc_socket_t *sock0, isc_sockaddr_t *addr, - isc_task_t *task, isc_taskaction_t action, const void *arg) -{ - isc__socket_t *sock = (isc__socket_t *)sock0; - isc_socket_connev_t *dev; - isc_task_t *ntask = NULL; - isc__socketmgr_t *manager; - int cc; - char strbuf[ISC_STRERRORSIZE]; - char addrbuf[ISC_SOCKADDR_FORMATSIZE]; - - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(addr != NULL); - REQUIRE(task != NULL); - REQUIRE(action != NULL); - - manager = sock->manager; - REQUIRE(VALID_MANAGER(manager)); - REQUIRE(addr != NULL); - - if (isc_sockaddr_ismulticast(addr)) - return (ISC_R_MULTICAST); - - LOCK(&sock->lock); - - REQUIRE(!sock->connecting); - - dev = (isc_socket_connev_t *)isc_event_allocate(manager->mctx, sock, - ISC_SOCKEVENT_CONNECT, - action, arg, - sizeof(*dev)); - if (dev == NULL) { - UNLOCK(&sock->lock); - return (ISC_R_NOMEMORY); - } - ISC_LINK_INIT(dev, ev_link); - - /* - * Try to do the connect right away, as there can be only one - * outstanding, and it might happen to complete. - */ - sock->peer_address = *addr; - cc = connect(sock->fd, &addr->type.sa, addr->length); - if (cc < 0) { - /* - * HP-UX "fails" to connect a UDP socket and sets errno to - * EINPROGRESS if it's non-blocking. We'd rather regard this as - * a success and let the user detect it if it's really an error - * at the time of sending a packet on the socket. - */ - if (sock->type == isc_sockettype_udp && errno == EINPROGRESS) { - cc = 0; - goto success; - } - if (SOFT_ERROR(errno) || errno == EINPROGRESS) - goto queue; - - switch (errno) { -#define ERROR_MATCH(a, b) case a: dev->result = b; goto err_exit; - ERROR_MATCH(EACCES, ISC_R_NOPERM); - ERROR_MATCH(EADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL); - ERROR_MATCH(EAFNOSUPPORT, ISC_R_ADDRNOTAVAIL); - ERROR_MATCH(ECONNREFUSED, ISC_R_CONNREFUSED); - ERROR_MATCH(EHOSTUNREACH, ISC_R_HOSTUNREACH); -#ifdef EHOSTDOWN - ERROR_MATCH(EHOSTDOWN, ISC_R_HOSTUNREACH); -#endif - ERROR_MATCH(ENETUNREACH, ISC_R_NETUNREACH); - ERROR_MATCH(ENOBUFS, ISC_R_NORESOURCES); - ERROR_MATCH(EPERM, ISC_R_HOSTUNREACH); - ERROR_MATCH(EPIPE, ISC_R_NOTCONNECTED); - ERROR_MATCH(ECONNRESET, ISC_R_CONNECTIONRESET); -#undef ERROR_MATCH - } - - sock->connected = 0; - - isc__strerror(errno, strbuf, sizeof(strbuf)); - isc_sockaddr_format(addr, addrbuf, sizeof(addrbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, "connect(%s) %d/%s", - addrbuf, errno, strbuf); - - UNLOCK(&sock->lock); - inc_stats(sock->manager->stats, - sock->statsindex[STATID_CONNECTFAIL]); - isc_event_free(ISC_EVENT_PTR(&dev)); - return (ISC_R_UNEXPECTED); - - err_exit: - sock->connected = 0; - isc_task_send(task, ISC_EVENT_PTR(&dev)); - - UNLOCK(&sock->lock); - inc_stats(sock->manager->stats, - sock->statsindex[STATID_CONNECTFAIL]); - return (ISC_R_SUCCESS); - } - - /* - * If connect completed, fire off the done event. - */ - success: - if (cc == 0) { - sock->connected = 1; - sock->bound = 1; - dev->result = ISC_R_SUCCESS; - isc_task_send(task, ISC_EVENT_PTR(&dev)); - - UNLOCK(&sock->lock); - - inc_stats(sock->manager->stats, - sock->statsindex[STATID_CONNECT]); - - return (ISC_R_SUCCESS); - } - - queue: - - /* - * Attach to task. - */ - isc_task_attach(task, &ntask); - - sock->connecting = 1; - - dev->ev_sender = ntask; - - /* - * Poke watcher here. We still have the socket locked, so there - * is no race condition. We will keep the lock for such a short - * bit of time waking it up now or later won't matter all that much. - */ - if (sock->connect_ev == NULL) - select_poke(manager, sock->fd, SELECT_POKE_CONNECT); - - sock->connect_ev = dev; - - UNLOCK(&sock->lock); - return (ISC_R_SUCCESS); -} - -/* - * Called when a socket with a pending connect() finishes. - */ -static void -internal_connect(isc_task_t *me, isc_event_t *ev) { - isc__socket_t *sock; - isc_socket_connev_t *dev; - isc_task_t *task; - int cc; - ISC_SOCKADDR_LEN_T optlen; - char strbuf[ISC_STRERRORSIZE]; - char peerbuf[ISC_SOCKADDR_FORMATSIZE]; - - UNUSED(me); - INSIST(ev->ev_type == ISC_SOCKEVENT_INTW); - - sock = ev->ev_sender; - INSIST(VALID_SOCKET(sock)); - - LOCK(&sock->lock); - - /* - * When the internal event was sent the reference count was bumped - * to keep the socket around for us. Decrement the count here. - */ - INSIST(sock->references > 0); - sock->references--; - if (sock->references == 0) { - UNLOCK(&sock->lock); - destroy(&sock); - return; - } - - /* - * Has this event been canceled? - */ - dev = sock->connect_ev; - if (dev == NULL) { - INSIST(!sock->connecting); - UNLOCK(&sock->lock); - return; - } - - INSIST(sock->connecting); - sock->connecting = 0; - - /* - * Get any possible error status here. - */ - optlen = sizeof(cc); - if (getsockopt(sock->fd, SOL_SOCKET, SO_ERROR, - (void *)&cc, (void *)&optlen) < 0) - cc = errno; - else - errno = cc; - - if (errno != 0) { - /* - * If the error is EAGAIN, just re-select on this - * fd and pretend nothing strange happened. - */ - if (SOFT_ERROR(errno) || errno == EINPROGRESS) { - sock->connecting = 1; - select_poke(sock->manager, sock->fd, - SELECT_POKE_CONNECT); - UNLOCK(&sock->lock); - - return; - } - - inc_stats(sock->manager->stats, - sock->statsindex[STATID_CONNECTFAIL]); - - /* - * Translate other errors into ISC_R_* flavors. - */ - switch (errno) { -#define ERROR_MATCH(a, b) case a: dev->result = b; break; - ERROR_MATCH(EACCES, ISC_R_NOPERM); - ERROR_MATCH(EADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL); - ERROR_MATCH(EAFNOSUPPORT, ISC_R_ADDRNOTAVAIL); - ERROR_MATCH(ECONNREFUSED, ISC_R_CONNREFUSED); - ERROR_MATCH(EHOSTUNREACH, ISC_R_HOSTUNREACH); -#ifdef EHOSTDOWN - ERROR_MATCH(EHOSTDOWN, ISC_R_HOSTUNREACH); -#endif - ERROR_MATCH(ENETUNREACH, ISC_R_NETUNREACH); - ERROR_MATCH(ENOBUFS, ISC_R_NORESOURCES); - ERROR_MATCH(EPERM, ISC_R_HOSTUNREACH); - ERROR_MATCH(EPIPE, ISC_R_NOTCONNECTED); - ERROR_MATCH(ETIMEDOUT, ISC_R_TIMEDOUT); - ERROR_MATCH(ECONNRESET, ISC_R_CONNECTIONRESET); -#undef ERROR_MATCH - default: - dev->result = ISC_R_UNEXPECTED; - isc_sockaddr_format(&sock->peer_address, peerbuf, - sizeof(peerbuf)); - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "internal_connect: connect(%s) %s", - peerbuf, strbuf); - } - } else { - inc_stats(sock->manager->stats, - sock->statsindex[STATID_CONNECT]); - dev->result = ISC_R_SUCCESS; - sock->connected = 1; - sock->bound = 1; - } - - sock->connect_ev = NULL; - - UNLOCK(&sock->lock); - - task = dev->ev_sender; - dev->ev_sender = sock; - isc_task_sendanddetach(&task, ISC_EVENT_PTR(&dev)); -} - -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_getpeername(isc_socket_t *sock0, isc_sockaddr_t *addressp) { - isc__socket_t *sock = (isc__socket_t *)sock0; - isc_result_t result; - - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(addressp != NULL); - - LOCK(&sock->lock); - - if (sock->connected) { - *addressp = sock->peer_address; - result = ISC_R_SUCCESS; - } else { - result = ISC_R_NOTCONNECTED; - } - - UNLOCK(&sock->lock); - - return (result); -} - -ISC_SOCKETFUNC_SCOPE isc_result_t -isc__socket_getsockname(isc_socket_t *sock0, isc_sockaddr_t *addressp) { - isc__socket_t *sock = (isc__socket_t *)sock0; - ISC_SOCKADDR_LEN_T len; - isc_result_t result; - char strbuf[ISC_STRERRORSIZE]; - - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(addressp != NULL); - - LOCK(&sock->lock); - - if (!sock->bound) { - result = ISC_R_NOTBOUND; - goto out; - } - - result = ISC_R_SUCCESS; - - len = sizeof(addressp->type); - if (getsockname(sock->fd, &addressp->type.sa, (void *)&len) < 0) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, "getsockname: %s", - strbuf); - result = ISC_R_UNEXPECTED; - goto out; - } - addressp->length = (unsigned int)len; - - out: - UNLOCK(&sock->lock); - - return (result); -} - -/* - * Run through the list of events on this socket, and cancel the ones - * queued for task "task" of type "how". "how" is a bitmask. - */ -ISC_SOCKETFUNC_SCOPE void -isc__socket_cancel(isc_socket_t *sock0, isc_task_t *task, unsigned int how) { - isc__socket_t *sock = (isc__socket_t *)sock0; - - REQUIRE(VALID_SOCKET(sock)); - - /* - * Quick exit if there is nothing to do. Don't even bother locking - * in this case. - */ - if (how == 0) - return; - - LOCK(&sock->lock); - - /* - * All of these do the same thing, more or less. - * Each will: - * o If the internal event is marked as "posted" try to - * remove it from the task's queue. If this fails, mark it - * as canceled instead, and let the task clean it up later. - * o For each I/O request for that task of that type, post - * its done event with status of "ISC_R_CANCELED". - * o Reset any state needed. - */ - if (((how & ISC_SOCKCANCEL_RECV) == ISC_SOCKCANCEL_RECV) - && !ISC_LIST_EMPTY(sock->recv_list)) { - isc_socketevent_t *dev; - isc_socketevent_t *next; - isc_task_t *current_task; - - dev = ISC_LIST_HEAD(sock->recv_list); - - while (dev != NULL) { - current_task = dev->ev_sender; - next = ISC_LIST_NEXT(dev, ev_link); - - if ((task == NULL) || (task == current_task)) { - dev->result = ISC_R_CANCELED; - send_recvdone_event(sock, &dev); - } - dev = next; - } - } - - if (((how & ISC_SOCKCANCEL_SEND) == ISC_SOCKCANCEL_SEND) - && !ISC_LIST_EMPTY(sock->send_list)) { - isc_socketevent_t *dev; - isc_socketevent_t *next; - isc_task_t *current_task; - - dev = ISC_LIST_HEAD(sock->send_list); - - while (dev != NULL) { - current_task = dev->ev_sender; - next = ISC_LIST_NEXT(dev, ev_link); - - if ((task == NULL) || (task == current_task)) { - dev->result = ISC_R_CANCELED; - send_senddone_event(sock, &dev); - } - dev = next; - } - } - - if (((how & ISC_SOCKCANCEL_ACCEPT) == ISC_SOCKCANCEL_ACCEPT) - && !ISC_LIST_EMPTY(sock->accept_list)) { - isc_socket_newconnev_t *dev; - isc_socket_newconnev_t *next; - isc_task_t *current_task; - - dev = ISC_LIST_HEAD(sock->accept_list); - while (dev != NULL) { - current_task = dev->ev_sender; - next = ISC_LIST_NEXT(dev, ev_link); - - if ((task == NULL) || (task == current_task)) { - - ISC_LIST_UNLINK(sock->accept_list, dev, - ev_link); - - NEWCONNSOCK(dev)->references--; - free_socket((isc__socket_t **)&dev->newsocket); - - dev->result = ISC_R_CANCELED; - dev->ev_sender = sock; - isc_task_sendanddetach(¤t_task, - ISC_EVENT_PTR(&dev)); - } - - dev = next; - } - } - - /* - * Connecting is not a list. - */ - if (((how & ISC_SOCKCANCEL_CONNECT) == ISC_SOCKCANCEL_CONNECT) - && sock->connect_ev != NULL) { - isc_socket_connev_t *dev; - isc_task_t *current_task; - - INSIST(sock->connecting); - sock->connecting = 0; - - dev = sock->connect_ev; - current_task = dev->ev_sender; - - if ((task == NULL) || (task == current_task)) { - sock->connect_ev = NULL; - - dev->result = ISC_R_CANCELED; - dev->ev_sender = sock; - isc_task_sendanddetach(¤t_task, - ISC_EVENT_PTR(&dev)); - } - } - - UNLOCK(&sock->lock); -} - -ISC_SOCKETFUNC_SCOPE isc_sockettype_t -isc__socket_gettype(isc_socket_t *sock0) { - isc__socket_t *sock = (isc__socket_t *)sock0; - - REQUIRE(VALID_SOCKET(sock)); - - return (sock->type); -} - -ISC_SOCKETFUNC_SCOPE isc_boolean_t -isc__socket_isbound(isc_socket_t *sock0) { - isc__socket_t *sock = (isc__socket_t *)sock0; - isc_boolean_t val; - - REQUIRE(VALID_SOCKET(sock)); - - LOCK(&sock->lock); - val = ((sock->bound) ? ISC_TRUE : ISC_FALSE); - UNLOCK(&sock->lock); - - return (val); -} - -ISC_SOCKETFUNC_SCOPE void -isc__socket_ipv6only(isc_socket_t *sock0, isc_boolean_t yes) { - isc__socket_t *sock = (isc__socket_t *)sock0; -#if defined(IPV6_V6ONLY) - int onoff = yes ? 1 : 0; -#else - UNUSED(yes); - UNUSED(sock); -#endif - - REQUIRE(VALID_SOCKET(sock)); - INSIST(!sock->dupped); - -#ifdef IPV6_V6ONLY - if (sock->pf == AF_INET6) { - if (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_V6ONLY, - (void *)&onoff, sizeof(int)) < 0) { - char strbuf[ISC_STRERRORSIZE]; - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "setsockopt(%d, IPV6_V6ONLY) " - "%s: %s", sock->fd, - isc_msgcat_get(isc_msgcat, - ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, - "failed"), - strbuf); - } - } - FIX_IPV6_RECVPKTINFO(sock); /* AIX */ -#endif -} - -#ifndef USE_WATCHER_THREAD -/* - * In our assumed scenario, we can simply use a single static object. - * XXX: this is not true if the application uses multiple threads with - * 'multi-context' mode. Fixing this is a future TODO item. - */ -static isc_socketwait_t swait_private; - -int -isc__socketmgr_waitevents(isc_socketmgr_t *manager0, struct timeval *tvp, - isc_socketwait_t **swaitp) -{ - isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0; - - - int n; -#ifdef USE_KQUEUE - struct timespec ts, *tsp; -#endif -#ifdef USE_EPOLL - int timeout; -#endif -#ifdef USE_DEVPOLL - struct dvpoll dvp; -#endif - - REQUIRE(swaitp != NULL && *swaitp == NULL); - -#ifdef USE_SHARED_MANAGER - if (manager == NULL) - manager = socketmgr; -#endif - if (manager == NULL) - return (0); - -#ifdef USE_KQUEUE - if (tvp != NULL) { - ts.tv_sec = tvp->tv_sec; - ts.tv_nsec = tvp->tv_usec * 1000; - tsp = &ts; - } else - tsp = NULL; - swait_private.nevents = kevent(manager->kqueue_fd, NULL, 0, - manager->events, manager->nevents, - tsp); - n = swait_private.nevents; -#elif defined(USE_EPOLL) - if (tvp != NULL) - timeout = tvp->tv_sec * 1000 + (tvp->tv_usec + 999) / 1000; - else - timeout = -1; - swait_private.nevents = epoll_wait(manager->epoll_fd, - manager->events, - manager->nevents, timeout); - n = swait_private.nevents; -#elif defined(USE_DEVPOLL) - dvp.dp_fds = manager->events; - dvp.dp_nfds = manager->nevents; - if (tvp != NULL) { - dvp.dp_timeout = tvp->tv_sec * 1000 + - (tvp->tv_usec + 999) / 1000; - } else - dvp.dp_timeout = -1; - swait_private.nevents = ioctl(manager->devpoll_fd, DP_POLL, &dvp); - n = swait_private.nevents; -#elif defined(USE_SELECT) - memcpy(manager->read_fds_copy, manager->read_fds, manager->fd_bufsize); - memcpy(manager->write_fds_copy, manager->write_fds, - manager->fd_bufsize); - - swait_private.readset = manager->read_fds_copy; - swait_private.writeset = manager->write_fds_copy; - swait_private.maxfd = manager->maxfd + 1; - - n = select(swait_private.maxfd, swait_private.readset, - swait_private.writeset, NULL, tvp); -#endif - - *swaitp = &swait_private; - return (n); -} - -isc_result_t -isc__socketmgr_dispatch(isc_socketmgr_t *manager0, isc_socketwait_t *swait) { - isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0; - - REQUIRE(swait == &swait_private); - -#ifdef USE_SHARED_MANAGER - if (manager == NULL) - manager = socketmgr; -#endif - if (manager == NULL) - return (ISC_R_NOTFOUND); - -#if defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL) - (void)process_fds(manager, manager->events, swait->nevents); - return (ISC_R_SUCCESS); -#elif defined(USE_SELECT) - process_fds(manager, swait->maxfd, swait->readset, swait->writeset); - return (ISC_R_SUCCESS); -#endif -} -#endif /* USE_WATCHER_THREAD */ - -#ifdef BIND9 -void -isc__socket_setname(isc_socket_t *socket0, const char *name, void *tag) { - isc__socket_t *socket = (isc__socket_t *)socket0; - - /* - * Name 'socket'. - */ - - REQUIRE(VALID_SOCKET(socket)); - - LOCK(&socket->lock); - memset(socket->name, 0, sizeof(socket->name)); - strncpy(socket->name, name, sizeof(socket->name) - 1); - socket->tag = tag; - UNLOCK(&socket->lock); -} - -ISC_SOCKETFUNC_SCOPE const char * -isc__socket_getname(isc_socket_t *socket0) { - isc__socket_t *socket = (isc__socket_t *)socket0; - - return (socket->name); -} - -void * -isc__socket_gettag(isc_socket_t *socket0) { - isc__socket_t *socket = (isc__socket_t *)socket0; - - return (socket->tag); -} -#endif /* BIND9 */ - -#ifdef USE_SOCKETIMPREGISTER -isc_result_t -isc__socket_register() { - return (isc_socket_register(isc__socketmgr_create)); -} -#endif - -ISC_SOCKETFUNC_SCOPE int -isc__socket_getfd(isc_socket_t *socket0) { - isc__socket_t *socket = (isc__socket_t *)socket0; - - return ((short) socket->fd); -} - -#if defined(HAVE_LIBXML2) && defined(BIND9) - -static const char * -_socktype(isc_sockettype_t type) -{ - if (type == isc_sockettype_udp) - return ("udp"); - else if (type == isc_sockettype_tcp) - return ("tcp"); - else if (type == isc_sockettype_unix) - return ("unix"); - else if (type == isc_sockettype_fdwatch) - return ("fdwatch"); - else - return ("not-initialized"); -} - -ISC_SOCKETFUNC_SCOPE void -isc_socketmgr_renderxml(isc_socketmgr_t *mgr0, xmlTextWriterPtr writer) { - isc__socketmgr_t *mgr = (isc__socketmgr_t *)mgr0; - isc__socket_t *sock; - char peerbuf[ISC_SOCKADDR_FORMATSIZE]; - isc_sockaddr_t addr; - ISC_SOCKADDR_LEN_T len; - - LOCK(&mgr->lock); - -#ifdef USE_SHARED_MANAGER - xmlTextWriterStartElement(writer, ISC_XMLCHAR "references"); - xmlTextWriterWriteFormatString(writer, "%d", mgr->refs); - xmlTextWriterEndElement(writer); -#endif /* USE_SHARED_MANAGER */ - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "sockets"); - sock = ISC_LIST_HEAD(mgr->socklist); - while (sock != NULL) { - LOCK(&sock->lock); - xmlTextWriterStartElement(writer, ISC_XMLCHAR "socket"); - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "id"); - xmlTextWriterWriteFormatString(writer, "%p", sock); - xmlTextWriterEndElement(writer); - - if (sock->name[0] != 0) { - xmlTextWriterStartElement(writer, ISC_XMLCHAR "name"); - xmlTextWriterWriteFormatString(writer, "%s", - sock->name); - xmlTextWriterEndElement(writer); /* name */ - } - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "references"); - xmlTextWriterWriteFormatString(writer, "%d", sock->references); - xmlTextWriterEndElement(writer); - - xmlTextWriterWriteElement(writer, ISC_XMLCHAR "type", - ISC_XMLCHAR _socktype(sock->type)); - - if (sock->connected) { - isc_sockaddr_format(&sock->peer_address, peerbuf, - sizeof(peerbuf)); - xmlTextWriterWriteElement(writer, - ISC_XMLCHAR "peer-address", - ISC_XMLCHAR peerbuf); - } - - len = sizeof(addr); - if (getsockname(sock->fd, &addr.type.sa, (void *)&len) == 0) { - isc_sockaddr_format(&addr, peerbuf, sizeof(peerbuf)); - xmlTextWriterWriteElement(writer, - ISC_XMLCHAR "local-address", - ISC_XMLCHAR peerbuf); - } - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "states"); - if (sock->pending_recv) - xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", - ISC_XMLCHAR "pending-receive"); - if (sock->pending_send) - xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", - ISC_XMLCHAR "pending-send"); - if (sock->pending_accept) - xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", - ISC_XMLCHAR "pending_accept"); - if (sock->listener) - xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", - ISC_XMLCHAR "listener"); - if (sock->connected) - xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", - ISC_XMLCHAR "connected"); - if (sock->connecting) - xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", - ISC_XMLCHAR "connecting"); - if (sock->bound) - xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", - ISC_XMLCHAR "bound"); - - xmlTextWriterEndElement(writer); /* states */ - - xmlTextWriterEndElement(writer); /* socket */ - - UNLOCK(&sock->lock); - sock = ISC_LIST_NEXT(sock, link); - } - xmlTextWriterEndElement(writer); /* sockets */ - - UNLOCK(&mgr->lock); -} -#endif /* HAVE_LIBXML2 */ diff --git a/lib/isc/unix/socket_p.h b/lib/isc/unix/socket_p.h deleted file mode 100644 index 13160117391f..000000000000 --- a/lib/isc/unix/socket_p.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: socket_p.h,v 1.15 2009/09/02 23:48:03 tbox Exp $ */ - -#ifndef ISC_SOCKET_P_H -#define ISC_SOCKET_P_H - -/*! \file */ - -#ifdef ISC_PLATFORM_NEEDSYSSELECTH -#include -#endif - -typedef struct isc_socketwait isc_socketwait_t; -int isc__socketmgr_waitevents(isc_socketmgr_t *, struct timeval *, - isc_socketwait_t **); -isc_result_t isc__socketmgr_dispatch(isc_socketmgr_t *, isc_socketwait_t *); -#endif /* ISC_SOCKET_P_H */ diff --git a/lib/isc/unix/syslog.c b/lib/isc/unix/syslog.c deleted file mode 100644 index 997508e32b44..000000000000 --- a/lib/isc/unix/syslog.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: syslog.c,v 1.8 2007/09/13 04:45:18 each Exp $ */ - -/*! \file */ - -#include - -#include -#include - -#include -#include -#include -#include - -static struct dsn_c_pvt_sfnt { - int val; - const char *strval; -} facilities[] = { - { LOG_KERN, "kern" }, - { LOG_USER, "user" }, - { LOG_MAIL, "mail" }, - { LOG_DAEMON, "daemon" }, - { LOG_AUTH, "auth" }, - { LOG_SYSLOG, "syslog" }, - { LOG_LPR, "lpr" }, -#ifdef LOG_NEWS - { LOG_NEWS, "news" }, -#endif -#ifdef LOG_UUCP - { LOG_UUCP, "uucp" }, -#endif -#ifdef LOG_CRON - { LOG_CRON, "cron" }, -#endif -#ifdef LOG_AUTHPRIV - { LOG_AUTHPRIV, "authpriv" }, -#endif -#ifdef LOG_FTP - { LOG_FTP, "ftp" }, -#endif - { LOG_LOCAL0, "local0"}, - { LOG_LOCAL1, "local1"}, - { LOG_LOCAL2, "local2"}, - { LOG_LOCAL3, "local3"}, - { LOG_LOCAL4, "local4"}, - { LOG_LOCAL5, "local5"}, - { LOG_LOCAL6, "local6"}, - { LOG_LOCAL7, "local7"}, - { 0, NULL } -}; - -isc_result_t -isc_syslog_facilityfromstring(const char *str, int *facilityp) { - int i; - - REQUIRE(str != NULL); - REQUIRE(facilityp != NULL); - - for (i = 0; facilities[i].strval != NULL; i++) { - if (strcasecmp(facilities[i].strval, str) == 0) { - *facilityp = facilities[i].val; - return (ISC_R_SUCCESS); - } - } - return (ISC_R_NOTFOUND); - -} diff --git a/lib/isc/version.c b/lib/isc/version.c deleted file mode 100644 index bfe4d6d6e100..000000000000 --- a/lib/isc/version.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: version.c,v 1.15 2007/06/19 23:47:17 tbox Exp $ */ - -/*! \file */ - -#include - -const char isc_version[] = VERSION; - -const unsigned int isc_libinterface = LIBINTERFACE; -const unsigned int isc_librevision = LIBREVISION; -const unsigned int isc_libage = LIBAGE; diff --git a/lib/isc/win32/DLLMain.c b/lib/isc/win32/DLLMain.c deleted file mode 100644 index ed84fcf6c35c..000000000000 --- a/lib/isc/win32/DLLMain.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: DLLMain.c,v 1.7 2007/06/18 23:47:49 tbox Exp $ */ - -#include -#include - -/* - * Called when we enter the DLL - */ -__declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE hinstDLL, - DWORD fdwReason, LPVOID lpvReserved) -{ - switch (fdwReason) - { - /* - * The DLL is loading due to process - * initialization or a call to LoadLibrary. - */ - case DLL_PROCESS_ATTACH: - break; - - /* The attached process creates a new thread. */ - case DLL_THREAD_ATTACH: - break; - - /* The thread of the attached process terminates. */ - case DLL_THREAD_DETACH: - break; - - /* - * The DLL is unloading from a process due to - * process termination or a call to FreeLibrary. - */ - case DLL_PROCESS_DETACH: - break; - - default: - break; - } - return (TRUE); -} - diff --git a/lib/isc/win32/app.c b/lib/isc/win32/app.c deleted file mode 100644 index 04b1638783eb..000000000000 --- a/lib/isc/win32/app.c +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: app.c,v 1.9 2009/09/02 23:48:03 tbox Exp $ */ - -#include - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static isc_eventlist_t on_run; -static isc_mutex_t lock; -static isc_boolean_t shutdown_requested = ISC_FALSE; -static isc_boolean_t running = ISC_FALSE; -/* - * We assume that 'want_shutdown' can be read and written atomically. - */ -static isc_boolean_t want_shutdown = ISC_FALSE; -/* - * We assume that 'want_reload' can be read and written atomically. - */ -static isc_boolean_t want_reload = ISC_FALSE; - -static isc_boolean_t blocked = ISC_FALSE; - -static isc_thread_t blockedthread; - -/* Events to wait for */ - -#define NUM_EVENTS 2 - -enum { - RELOAD_EVENT, - SHUTDOWN_EVENT -}; - -static HANDLE hEvents[NUM_EVENTS]; -DWORD dwWaitResult; - -/* - * We need to remember which thread is the main thread... - */ -static isc_thread_t main_thread; - -isc_result_t -isc__app_start(void) { - isc_result_t result; - - /* - * Start an ISC library application. - */ - - main_thread = GetCurrentThread(); - - result = isc_mutex_init(&lock); - if (result != ISC_R_SUCCESS) - return (result); - - /* Create the reload event in a non-signaled state */ - hEvents[RELOAD_EVENT] = CreateEvent(NULL, FALSE, FALSE, NULL); - - /* Create the shutdown event in a non-signaled state */ - hEvents[SHUTDOWN_EVENT] = CreateEvent(NULL, FALSE, FALSE, NULL); - - ISC_LIST_INIT(on_run); - return (ISC_R_SUCCESS); -} - -isc_result_t -isc__app_onrun(isc_mem_t *mctx, isc_task_t *task, isc_taskaction_t action, - void *arg) { - isc_event_t *event; - isc_task_t *cloned_task = NULL; - isc_result_t result; - - - LOCK(&lock); - if (running) { - result = ISC_R_ALREADYRUNNING; - goto unlock; - } - - /* - * Note that we store the task to which we're going to send the event - * in the event's "sender" field. - */ - isc_task_attach(task, &cloned_task); - event = isc_event_allocate(mctx, cloned_task, ISC_APPEVENT_SHUTDOWN, - action, arg, sizeof(*event)); - if (event == NULL) { - result = ISC_R_NOMEMORY; - goto unlock; - } - - ISC_LIST_APPEND(on_run, event, ev_link); - result = ISC_R_SUCCESS; - - unlock: - UNLOCK(&lock); - return (result); -} - -isc_result_t -isc__app_run(void) { - isc_event_t *event, *next_event; - isc_task_t *task; - HANDLE *pHandles = NULL; - - REQUIRE(main_thread == GetCurrentThread()); - LOCK(&lock); - if (!running) { - running = ISC_TRUE; - - /* - * Post any on-run events (in FIFO order). - */ - for (event = ISC_LIST_HEAD(on_run); - event != NULL; - event = next_event) { - next_event = ISC_LIST_NEXT(event, ev_link); - ISC_LIST_UNLINK(on_run, event, ev_link); - task = event->ev_sender; - event->ev_sender = NULL; - isc_task_sendanddetach(&task, &event); - } - - } - - UNLOCK(&lock); - - /* - * There is no danger if isc_app_shutdown() is called before we wait - * for events. - */ - - while (!want_shutdown) { - dwWaitResult = WaitForMultipleObjects(NUM_EVENTS, hEvents, - FALSE, INFINITE); - - /* See why we returned */ - - if (WaitSucceeded(dwWaitResult, NUM_EVENTS)) { - /* - * The return was due to one of the events - * being signaled - */ - switch (WaitSucceededIndex(dwWaitResult)) { - case RELOAD_EVENT: - want_reload = ISC_TRUE; - break; - - case SHUTDOWN_EVENT: - want_shutdown = ISC_TRUE; - break; - } - } - if (want_reload) { - want_reload = ISC_FALSE; - return (ISC_R_RELOAD); - } - - if (want_shutdown && blocked) - exit(-1); - } - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc__app_shutdown(void) { - isc_boolean_t want_kill = ISC_TRUE; - - LOCK(&lock); - REQUIRE(running); - - if (shutdown_requested) - want_kill = ISC_FALSE; /* We're only signaling once */ - else - shutdown_requested = ISC_TRUE; - - UNLOCK(&lock); - if (want_kill) - SetEvent(hEvents[SHUTDOWN_EVENT]); - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc__app_reload(void) { - isc_boolean_t want_reload = ISC_TRUE; - - LOCK(&lock); - REQUIRE(running); - - /* - * Don't send the reload signal if we're shutting down. - */ - if (shutdown_requested) - want_reload = ISC_FALSE; - - UNLOCK(&lock); - if (want_reload) - SetEvent(hEvents[RELOAD_EVENT]); - - return (ISC_R_SUCCESS); -} - -void -isc__app_finish(void) { - DESTROYLOCK(&lock); -} - -void -isc__app_block(void) { - REQUIRE(running); - REQUIRE(!blocked); - - blocked = ISC_TRUE; - blockedthread = GetCurrentThread(); -} - -void -isc__app_unblock(void) { - REQUIRE(running); - REQUIRE(blocked); - blocked = ISC_FALSE; - REQUIRE(blockedthread == GetCurrentThread()); -} diff --git a/lib/isc/win32/dir.c b/lib/isc/win32/dir.c deleted file mode 100644 index 14fadde46af3..000000000000 --- a/lib/isc/win32/dir.c +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright (C) 2004, 2007-2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/* Principal Authors: DCL */ - -#include - -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include "errno2result.h" - -#define ISC_DIR_MAGIC ISC_MAGIC('D', 'I', 'R', '*') -#define VALID_DIR(dir) ISC_MAGIC_VALID(dir, ISC_DIR_MAGIC) - -static isc_result_t -start_directory(isc_dir_t *p); - -void -isc_dir_init(isc_dir_t *dir) { - REQUIRE(dir != NULL); - - dir->dirname[0] = '\0'; - - dir->entry.name[0] = '\0'; - dir->entry.length = 0; - memset(&(dir->entry.find_data), 0, sizeof(dir->entry.find_data)); - - dir->entry_filled = ISC_FALSE; - dir->search_handle = INVALID_HANDLE_VALUE; - - dir->magic = ISC_DIR_MAGIC; -} - -/* - * Allocate workspace and open directory stream. If either one fails, - * NULL will be returned. - */ -isc_result_t -isc_dir_open(isc_dir_t *dir, const char *dirname) { - char *p; - isc_result_t result; - - REQUIRE(dirname != NULL); - REQUIRE(VALID_DIR(dir) && dir->search_handle == INVALID_HANDLE_VALUE); - - /* - * Copy directory name. Need to have enough space for the name, - * a possible path separator, the wildcard, and the final NUL. - */ - if (strlen(dirname) + 3 > sizeof(dir->dirname)) - /* XXXDCL ? */ - return (ISC_R_NOSPACE); - strcpy(dir->dirname, dirname); - - /* - * Append path separator, if needed, and "*". - */ - p = dir->dirname + strlen(dir->dirname); - if (dir->dirname < p && *(p - 1) != '\\' && *(p - 1) != ':') - *p++ = '\\'; - *p++ = '*'; - *p = '\0'; - - /* - * Open stream. - */ - result = start_directory(dir); - - return (result); -} - -/* - * Return previously retrieved file or get next one. Unix's dirent has - * separate open and read functions, but the Win32 and DOS interfaces open - * the dir stream and reads the first file in one operation. - */ -isc_result_t -isc_dir_read(isc_dir_t *dir) { - REQUIRE(VALID_DIR(dir) && dir->search_handle != INVALID_HANDLE_VALUE); - - if (dir->entry_filled) - /* - * start_directory() already filled in the first entry. - */ - dir->entry_filled = ISC_FALSE; - - else { - /* - * Fetch next file in directory. - */ - if (FindNextFile(dir->search_handle, - &dir->entry.find_data) == FALSE) - /* - * Either the last file has been processed or - * an error has occurred. The former is not - * really an error, but the latter is. - */ - if (GetLastError() == ERROR_NO_MORE_FILES) - return (ISC_R_NOMORE); - else - return (ISC_R_UNEXPECTED); - } - - /* - * Make sure that the space for the name is long enough. - */ - strcpy(dir->entry.name, dir->entry.find_data.cFileName); - dir->entry.length = strlen(dir->entry.name); - - return (ISC_R_SUCCESS); -} - -/* - * Close directory stream. - */ -void -isc_dir_close(isc_dir_t *dir) { - REQUIRE(VALID_DIR(dir) && dir->search_handle != INVALID_HANDLE_VALUE); - - FindClose(dir->search_handle); - dir->search_handle = INVALID_HANDLE_VALUE; -} - -/* - * Reposition directory stream at start. - */ -isc_result_t -isc_dir_reset(isc_dir_t *dir) { - isc_result_t result; - - REQUIRE(VALID_DIR(dir) && dir->search_handle != INVALID_HANDLE_VALUE); - REQUIRE(dir->dirname != NULL); - - /* - * NT cannot reposition the seek pointer to the beginning of the - * the directory stream, but rather the directory needs to be - * closed and reopened. The latter might fail. - */ - - isc_dir_close(dir); - - result = start_directory(dir); - - return (result); -} - -/* - * Initialize isc_dir_t structure with new directory. The function - * returns 0 on failure and nonzero on success. - * - * Note: - * - Be sure to close previous stream before opening new one - */ -static isc_result_t -start_directory(isc_dir_t *dir) -{ - REQUIRE(VALID_DIR(dir)); - REQUIRE(dir->search_handle == INVALID_HANDLE_VALUE); - - dir->entry_filled = ISC_FALSE; - - /* - * Open stream and retrieve first file. - */ - dir->search_handle = FindFirstFile(dir->dirname, - &dir->entry.find_data); - - if (dir->search_handle == INVALID_HANDLE_VALUE) { - /* - * Something went wrong but we don't know what. GetLastError() - * could give us more information about the error, but the - * MSDN documentation is frustratingly thin about what - * possible errors could have resulted. (Score one for - * the Unix manual pages.) So there is just this lame error - * instead of being able to differentiate ISC_R_NOTFOUND - * from ISC_R_UNEXPECTED. - */ - return (ISC_R_FAILURE); - } - - /* - * Make sure that the space for the name is long enough. - */ - INSIST(sizeof(dir->entry.name) > - strlen(dir->entry.find_data.cFileName)); - - /* - * Fill in the data for the first entry of the directory. - */ - strcpy(dir->entry.name, dir->entry.find_data.cFileName); - dir->entry.length = strlen(dir->entry.name); - - dir->entry_filled = ISC_TRUE; - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_dir_chdir(const char *dirname) { - /* - * Change the current directory to 'dirname'. - */ - - REQUIRE(dirname != NULL); - - if (chdir(dirname) < 0) - return (isc__errno2result(errno)); - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_dir_chroot(const char *dirname) { - return (ISC_R_NOTIMPLEMENTED); -} - -isc_result_t -isc_dir_createunique(char *templet) { - isc_result_t result; - char *x; - char *p; - int i; - int pid; - - REQUIRE(templet != NULL); - - /* - * mkdtemp is not portable, so this emulates it. - */ - - pid = getpid(); - - /* - * Replace trailing Xs with the process-id, zero-filled. - */ - for (x = templet + strlen(templet) - 1; *x == 'X' && x >= templet; - x--, pid /= 10) - *x = pid % 10 + '0'; - - x++; /* Set x to start of ex-Xs. */ - - do { - i = mkdir(templet); - i = chmod(templet, 0700); - - if (i == 0 || errno != EEXIST) - break; - - /* - * The BSD algorithm. - */ - p = x; - while (*p != '\0') { - if (isdigit(*p & 0xff)) - *p = 'a'; - else if (*p != 'z') - ++*p; - else { - /* - * Reset character and move to next. - */ - *p++ = 'a'; - continue; - } - - break; - } - - if (*p == '\0') { - /* - * Tried all combinations. errno should already - * be EEXIST, but ensure it is anyway for - * isc__errno2result(). - */ - errno = EEXIST; - break; - } - } while (1); - - if (i == -1) - result = isc__errno2result(errno); - else - result = ISC_R_SUCCESS; - - return (result); -} diff --git a/lib/isc/win32/entropy.c b/lib/isc/win32/entropy.c deleted file mode 100644 index 5a316e6e5cff..000000000000 --- a/lib/isc/win32/entropy.c +++ /dev/null @@ -1,307 +0,0 @@ -/* - * Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: entropy.c,v 1.10 2009/01/18 23:48:14 tbox Exp $ */ - -/* - * This is the system dependent part of the ISC entropy API. - */ - -#include - -#include -#include - -#include -#include -#include - -/* - * There is only one variable in the entropy data structures that is not - * system independent, but pulling the structure that uses it into this file - * ultimately means pulling several other independent structures here also to - * resolve their interdependencies. Thus only the problem variable's type - * is defined here. - */ -#define FILESOURCE_HANDLE_TYPE HCRYPTPROV - -typedef struct { - int dummy; -} isc_entropyusocketsource_t; - -#include "../entropy.c" - -static unsigned int -get_from_filesource(isc_entropysource_t *source, isc_uint32_t desired) { - isc_entropy_t *ent = source->ent; - unsigned char buf[128]; - HCRYPTPROV hcryptprov = source->sources.file.handle; - ssize_t ndesired; - unsigned int added; - - if (source->bad) - return (0); - - desired = desired / 8 + (((desired & 0x07) > 0) ? 1 : 0); - - added = 0; - while (desired > 0) { - ndesired = ISC_MIN(desired, sizeof(buf)); - if (!CryptGenRandom(hcryptprov, ndesired, buf)) { - CryptReleaseContext(hcryptprov, 0); - source->bad = ISC_TRUE; - goto out; - } - - entropypool_adddata(ent, buf, ndesired, ndesired * 8); - added += ndesired * 8; - desired -= ndesired; - } - - out: - return (added); -} - -/* - * Poll each source, trying to get data from it to stuff into the entropy - * pool. - */ -static void -fillpool(isc_entropy_t *ent, unsigned int desired, isc_boolean_t blocking) { - unsigned int added; - unsigned int remaining; - unsigned int needed; - unsigned int nsource; - isc_entropysource_t *source; - isc_entropysource_t *firstsource; - - REQUIRE(VALID_ENTROPY(ent)); - - needed = desired; - - /* - * This logic is a little strange, so an explanation is in order. - * - * If needed is 0, it means we are being asked to "fill to whatever - * we think is best." This means that if we have at least a - * partially full pool (say, > 1/4th of the pool) we probably don't - * need to add anything. - * - * Also, we will check to see if the "pseudo" count is too high. - * If it is, try to mix in better data. Too high is currently - * defined as 1/4th of the pool. - * - * Next, if we are asked to add a specific bit of entropy, make - * certain that we will do so. Clamp how much we try to add to - * (DIGEST_SIZE * 8 < needed < POOLBITS - entropy). - * - * Note that if we are in a blocking mode, we will only try to - * get as much data as we need, not as much as we might want - * to build up. - */ - if (needed == 0) { - REQUIRE(!blocking); - - if ((ent->pool.entropy >= RND_POOLBITS / 4) - && (ent->pool.pseudo <= RND_POOLBITS / 4)) - return; - - needed = THRESHOLD_BITS * 4; - } else { - needed = ISC_MAX(needed, THRESHOLD_BITS); - needed = ISC_MIN(needed, RND_POOLBITS); - } - - /* - * In any case, clamp how much we need to how much we can add. - */ - needed = ISC_MIN(needed, RND_POOLBITS - ent->pool.entropy); - - /* - * But wait! If we're not yet initialized, we need at least - * THRESHOLD_BITS - * of randomness. - */ - if (ent->initialized < THRESHOLD_BITS) - needed = ISC_MAX(needed, THRESHOLD_BITS - ent->initialized); - - /* - * Poll each file source to see if we can read anything useful from - * it. XXXMLG When where are multiple sources, we should keep a - * record of which one we last used so we can start from it (or the - * next one) to avoid letting some sources build up entropy while - * others are always drained. - */ - - added = 0; - remaining = needed; - if (ent->nextsource == NULL) { - ent->nextsource = ISC_LIST_HEAD(ent->sources); - if (ent->nextsource == NULL) - return; - } - source = ent->nextsource; - /* - * Remember the first source so we can break if we have looped back to - * the beginning and still have nothing - */ - firstsource = source; - again_file: - for (nsource = 0; nsource < ent->nsources; nsource++) { - unsigned int got; - - if (remaining == 0) - break; - - got = 0; - - if (source->type == ENTROPY_SOURCETYPE_FILE) - got = get_from_filesource(source, remaining); - - added += got; - - remaining -= ISC_MIN(remaining, got); - - source = ISC_LIST_NEXT(source, link); - if (source == NULL) - source = ISC_LIST_HEAD(ent->sources); - } - ent->nextsource = source; - - /* - * Go again only if there's been progress and we've not - * gone back to the beginning - */ - if (!(ent->nextsource == firstsource && added == 0)) { - if (blocking && remaining != 0) { - goto again_file; - } - } - - /* - * Here, if there are bits remaining to be had and we can block, - * check to see if we have a callback source. If so, call them. - */ - source = ISC_LIST_HEAD(ent->sources); - while ((remaining != 0) && (source != NULL)) { - unsigned int got; - - got = 0; - - if (source->type == ENTROPY_SOURCETYPE_CALLBACK) - got = get_from_callback(source, remaining, blocking); - - added += got; - remaining -= ISC_MIN(remaining, got); - - if (added >= needed) - break; - - source = ISC_LIST_NEXT(source, link); - } - - /* - * Mark as initialized if we've added enough data. - */ - if (ent->initialized < THRESHOLD_BITS) - ent->initialized += added; -} - - - -/* - * Requires "ent" be locked. - */ -static void -destroyfilesource(isc_entropyfilesource_t *source) { - CryptReleaseContext(source->handle, 0); -} - -static void -destroyusocketsource(isc_entropyusocketsource_t *source) { - UNUSED(source); -} - - -isc_result_t -isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname) { - isc_result_t ret; - isc_entropysource_t *source; - HCRYPTPROV hcryptprov; - DWORD errval; - BOOL err; - - REQUIRE(VALID_ENTROPY(ent)); - REQUIRE(fname != NULL); - - LOCK(&ent->lock); - - source = NULL; - - /* - * The first time we just try to acquire the context - */ - err = CryptAcquireContext(&hcryptprov, NULL, NULL, PROV_RSA_FULL, - CRYPT_VERIFYCONTEXT); - if (!err){ - errval = GetLastError(); - ret = ISC_R_IOERROR; - goto errout; - } - - source = isc_mem_get(ent->mctx, sizeof(isc_entropysource_t)); - if (source == NULL) { - ret = ISC_R_NOMEMORY; - goto closecontext; - } - - /* - * From here down, no failures can occur. - */ - source->magic = SOURCE_MAGIC; - source->type = ENTROPY_SOURCETYPE_FILE; - source->ent = ent; - source->total = 0; - source->bad = ISC_FALSE; - memset(source->name, 0, sizeof(source->name)); - ISC_LINK_INIT(source, link); - source->sources.file.handle = hcryptprov; - - /* - * Hook it into the entropy system. - */ - ISC_LIST_APPEND(ent->sources, source, link); - ent->nsources++; - - UNLOCK(&ent->lock); - return (ISC_R_SUCCESS); - - closecontext: - CryptReleaseContext(hcryptprov, 0); - - errout: - if (source != NULL) - isc_mem_put(ent->mctx, source, sizeof(isc_entropysource_t)); - - UNLOCK(&ent->lock); - - return (ret); -} - - - - diff --git a/lib/isc/win32/errno2result.c b/lib/isc/win32/errno2result.c deleted file mode 100644 index c3d54d632e8d..000000000000 --- a/lib/isc/win32/errno2result.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: errno2result.c,v 1.17 2008/09/12 04:46:25 marka Exp $ */ - -#include - -#include -#include "errno2result.h" -#include -#include -#include - -/* - * Convert a POSIX errno value into an isc_result_t. The - * list of supported errno values is not complete; new users - * of this function should add any expected errors that are - * not already there. - */ -isc_result_t -isc__errno2resultx(int posixerrno, const char *file, int line) { - char strbuf[ISC_STRERRORSIZE]; - - switch (posixerrno) { - case ENOTDIR: - case WSAELOOP: - case WSAEINVAL: - case EINVAL: /* XXX sometimes this is not for files */ - case ENAMETOOLONG: - case WSAENAMETOOLONG: - case EBADF: - case WSAEBADF: - return (ISC_R_INVALIDFILE); - case ENOENT: - return (ISC_R_FILENOTFOUND); - case EACCES: - case WSAEACCES: - case EPERM: - return (ISC_R_NOPERM); - case EEXIST: - return (ISC_R_FILEEXISTS); - case EIO: - return (ISC_R_IOERROR); - case ENOMEM: - return (ISC_R_NOMEMORY); - case ENFILE: - case EMFILE: - case WSAEMFILE: - return (ISC_R_TOOMANYOPENFILES); - case ERROR_CANCELLED: - return (ISC_R_CANCELED); - case ERROR_CONNECTION_REFUSED: - case WSAECONNREFUSED: - return (ISC_R_CONNREFUSED); - case WSAENOTCONN: - case ERROR_CONNECTION_INVALID: - return (ISC_R_NOTCONNECTED); - case ERROR_HOST_UNREACHABLE: - case WSAEHOSTUNREACH: - return (ISC_R_HOSTUNREACH); - case ERROR_NETWORK_UNREACHABLE: - case WSAENETUNREACH: - return (ISC_R_NETUNREACH); - case ERROR_NO_NETWORK: - return (ISC_R_NETUNREACH); - case ERROR_PORT_UNREACHABLE: - return (ISC_R_HOSTUNREACH); - case ERROR_SEM_TIMEOUT: - return (ISC_R_TIMEDOUT); - case WSAECONNRESET: - case WSAENETRESET: - case WSAECONNABORTED: - case WSAEDISCON: - case ERROR_OPERATION_ABORTED: - case ERROR_CONNECTION_ABORTED: - case ERROR_REQUEST_ABORTED: - return (ISC_R_CONNECTIONRESET); - case WSAEADDRNOTAVAIL: - return (ISC_R_ADDRNOTAVAIL); - case ERROR_NETNAME_DELETED: - case WSAENETDOWN: - return (ISC_R_NETUNREACH); - case WSAEHOSTDOWN: - return (ISC_R_HOSTUNREACH); - case WSAENOBUFS: - return (ISC_R_NORESOURCES); - default: - isc__strerror(posixerrno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(file, line, "unable to convert errno " - "to isc_result: %d: %s", posixerrno, strbuf); - /* - * XXXDCL would be nice if perhaps this function could - * return the system's error string, so the caller - * might have something more descriptive than "unexpected - * error" to log with. - */ - return (ISC_R_UNEXPECTED); - } -} diff --git a/lib/isc/win32/errno2result.h b/lib/isc/win32/errno2result.h deleted file mode 100644 index 41682db39bd0..000000000000 --- a/lib/isc/win32/errno2result.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: errno2result.h,v 1.10 2007/06/19 23:47:19 tbox Exp $ */ - -#ifndef UNIX_ERRNO2RESULT_H -#define UNIX_ERRNO2RESULT_H 1 - -/* XXXDCL this should be moved to lib/isc/include/isc/errno2result.h. */ - -#include /* Provides errno. */ - -#include -#include - -ISC_LANG_BEGINDECLS - -#define isc__errno2result(posixerrno) \ - isc__errno2resultx(posixerrno, __FILE__, __LINE__) - -isc_result_t -isc__errno2resultx(int posixerrno, const char *file, int line); - -ISC_LANG_ENDDECLS - -#endif /* UNIX_ERRNO2RESULT_H */ diff --git a/lib/isc/win32/file.c b/lib/isc/win32/file.c deleted file mode 100644 index c6b9e4f56f1f..000000000000 --- a/lib/isc/win32/file.c +++ /dev/null @@ -1,619 +0,0 @@ -/* - * Copyright (C) 2004, 2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -#include - -#undef rename -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "errno2result.h" - -/* - * Emulate UNIX mkstemp, which returns an open FD to the new file - * - */ -static int -gettemp(char *path, int *doopen) { - char *start, *trv; - struct stat sbuf; - int pid; - - trv = strrchr(path, 'X'); - trv++; - pid = getpid(); - /* extra X's get set to 0's */ - while (*--trv == 'X') { - *trv = (pid % 10) + '0'; - pid /= 10; - } - /* - * check the target directory; if you have six X's and it - * doesn't exist this runs for a *very* long time. - */ - for (start = trv + 1;; --trv) { - if (trv <= path) - break; - if (*trv == '\\') { - *trv = '\0'; - if (stat(path, &sbuf)) - return (0); - if (!S_ISDIR(sbuf.st_mode)) { - errno = ENOTDIR; - return (0); - } - *trv = '\\'; - break; - } - } - - for (;;) { - if (doopen) { - if ((*doopen = - open(path, O_CREAT|O_EXCL|O_RDWR, - _S_IREAD | _S_IWRITE)) >= 0) - return (1); - if (errno != EEXIST) - return (0); - } else if (stat(path, &sbuf)) - return (errno == ENOENT ? 1 : 0); - - /* tricky little algorithm for backward compatibility */ - for (trv = start;;) { - if (!*trv) - return (0); - if (*trv == 'z') - *trv++ = 'a'; - else { - if (isdigit(*trv)) - *trv = 'a'; - else - ++*trv; - break; - } - } - } - /*NOTREACHED*/ -} - -static int -mkstemp(char *path) { - int fd; - - return (gettemp(path, &fd) ? fd : -1); -} - -/* - * XXXDCL As the API for accessing file statistics undoubtedly gets expanded, - * it might be good to provide a mechanism that allows for the results - * of a previous stat() to be used again without having to do another stat, - * such as perl's mechanism of using "_" in place of a file name to indicate - * that the results of the last stat should be used. But then you get into - * annoying MP issues. BTW, Win32 has stat(). - */ -static isc_result_t -file_stats(const char *file, struct stat *stats) { - isc_result_t result = ISC_R_SUCCESS; - - REQUIRE(file != NULL); - REQUIRE(stats != NULL); - - if (stat(file, stats) != 0) - result = isc__errno2result(errno); - - return (result); -} - -/* - * isc_file_safemovefile is needed to be defined here to ensure that - * any file with the new name is renamed to a backup name and then the - * rename is done. If all goes well then the backup can be deleted, - * otherwise it gets renamed back. - */ - -int -isc_file_safemovefile(const char *oldname, const char *newname) { - BOOL filestatus; - char buf[512]; - struct stat sbuf; - BOOL exists = FALSE; - int tmpfd; - - /* - * Make sure we have something to do - */ - if (stat(oldname, &sbuf) != 0) { - errno = ENOENT; - return (-1); - } - - /* - * Rename to a backup the new file if it still exists - */ - if (stat(newname, &sbuf) == 0) { - exists = TRUE; - strcpy(buf, newname); - strcat(buf, ".XXXXX"); - tmpfd = mkstemp(buf); - if (tmpfd > 0) - _close(tmpfd); - DeleteFile(buf); - _chmod(newname, _S_IREAD | _S_IWRITE); - - filestatus = MoveFile(newname, buf); - } - /* Now rename the file to the new name - */ - _chmod(oldname, _S_IREAD | _S_IWRITE); - - filestatus = MoveFile(oldname, newname); - if (filestatus == 0) { - /* - * Try to rename the backup back to the original name - * if the backup got created - */ - if (exists == TRUE) { - filestatus = MoveFile(buf, newname); - if (filestatus == 0) - errno = EACCES; - } - return (-1); - } - - /* - * Delete the backup file if it got created - */ - if (exists == TRUE) - filestatus = DeleteFile(buf); - return (0); -} - -isc_result_t -isc_file_getmodtime(const char *file, isc_time_t *time) { - int fh; - - REQUIRE(file != NULL); - REQUIRE(time != NULL); - - if ((fh = open(file, _O_RDONLY | _O_BINARY)) < 0) - return (isc__errno2result(errno)); - - if (!GetFileTime((HANDLE) _get_osfhandle(fh), - NULL, - NULL, - &time->absolute)) - { - close(fh); - errno = EINVAL; - return (isc__errno2result(errno)); - } - close(fh); - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_file_settime(const char *file, isc_time_t *time) { - int fh; - - REQUIRE(file != NULL && time != NULL); - - if ((fh = open(file, _O_RDWR | _O_BINARY)) < 0) - return (isc__errno2result(errno)); - - /* - * Set the date via the filedate system call and return. Failing - * this call implies the new file times are not supported by the - * underlying file system. - */ - if (!SetFileTime((HANDLE) _get_osfhandle(fh), - NULL, - &time->absolute, - &time->absolute)) - { - close(fh); - errno = EINVAL; - return (isc__errno2result(errno)); - } - - close(fh); - return (ISC_R_SUCCESS); - -} - -#undef TEMPLATE -#define TEMPLATE "XXXXXXXXXX.tmp" /* 14 characters. */ - -isc_result_t -isc_file_mktemplate(const char *path, char *buf, size_t buflen) { - return (isc_file_template(path, TEMPLATE, buf, buflen)); -} - -isc_result_t -isc_file_template(const char *path, const char *templet, char *buf, - size_t buflen) { - char *s; - - REQUIRE(path != NULL); - REQUIRE(templet != NULL); - REQUIRE(buf != NULL); - - s = strrchr(templet, '\\'); - if (s != NULL) - templet = s + 1; - - s = strrchr(path, '\\'); - - if (s != NULL) { - if ((s - path + 1 + strlen(templet) + 1) > buflen) - return (ISC_R_NOSPACE); - - strncpy(buf, path, s - path + 1); - buf[s - path + 1] = '\0'; - strcat(buf, templet); - } else { - if ((strlen(templet) + 1) > buflen) - return (ISC_R_NOSPACE); - - strcpy(buf, templet); - } - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_file_renameunique(const char *file, char *templet) { - int fd = -1; - int res = 0; - isc_result_t result = ISC_R_SUCCESS; - - REQUIRE(file != NULL); - REQUIRE(templet != NULL); - - fd = mkstemp(templet); - if (fd == -1) - result = isc__errno2result(errno); - else - close(fd); - - if (result == ISC_R_SUCCESS) { - res = isc_file_safemovefile(file, templet); - if (res != 0) { - result = isc__errno2result(errno); - (void)unlink(templet); - } - } - return (result); -} - -isc_result_t -isc_file_openuniqueprivate(char *templet, FILE **fp) { - int mode = _S_IREAD | _S_IWRITE; - return (isc_file_openuniquemode(templet, mode, fp)); -} - -isc_result_t -isc_file_openunique(char *templet, FILE **fp) { - int mode = _S_IREAD | _S_IWRITE; - return (isc_file_openuniquemode(templet, mode, fp)); -} - -isc_result_t -isc_file_openuniquemode(char *templet, int mode, FILE **fp) { - int fd; - FILE *f; - isc_result_t result = ISC_R_SUCCESS; - - REQUIRE(templet != NULL); - REQUIRE(fp != NULL && *fp == NULL); - - /* - * Win32 does not have mkstemp. Using emulation above. - */ - fd = mkstemp(templet); - - if (fd == -1) - result = isc__errno2result(errno); - if (result == ISC_R_SUCCESS) { -#if 1 - UNUSED(mode); -#else - (void)fchmod(fd, mode); -#endif - f = fdopen(fd, "w+"); - if (f == NULL) { - result = isc__errno2result(errno); - (void)remove(templet); - (void)close(fd); - } else - *fp = f; - } - - return (result); -} - -isc_result_t -isc_file_remove(const char *filename) { - int r; - - REQUIRE(filename != NULL); - - r = unlink(filename); - if (r == 0) - return (ISC_R_SUCCESS); - else - return (isc__errno2result(errno)); -} - -isc_result_t -isc_file_rename(const char *oldname, const char *newname) { - int r; - - REQUIRE(oldname != NULL); - REQUIRE(newname != NULL); - - r = isc_file_safemovefile(oldname, newname); - if (r == 0) - return (ISC_R_SUCCESS); - else - return (isc__errno2result(errno)); -} - -isc_boolean_t -isc_file_exists(const char *pathname) { - struct stat stats; - - REQUIRE(pathname != NULL); - - return (ISC_TF(file_stats(pathname, &stats) == ISC_R_SUCCESS)); -} - -isc_result_t -isc_file_isplainfile(const char *filename) { - /* - * This function returns success if filename is a plain file. - */ - struct stat filestat; - memset(&filestat,0,sizeof(struct stat)); - - if ((stat(filename, &filestat)) == -1) - return(isc__errno2result(errno)); - - if(! S_ISREG(filestat.st_mode)) - return(ISC_R_INVALIDFILE); - - return(ISC_R_SUCCESS); -} - -isc_boolean_t -isc_file_isabsolute(const char *filename) { - REQUIRE(filename != NULL); - /* - * Look for c:\path\... style, c:/path/... or \\computer\shar\path... - * the UNC style file specs - */ - if ((filename[0] == '\\') && (filename[1] == '\\')) - return (ISC_TRUE); - if (isalpha(filename[0]) && filename[1] == ':' && filename[2] == '\\') - return (ISC_TRUE); - if (isalpha(filename[0]) && filename[1] == ':' && filename[2] == '/') - return (ISC_TRUE); - return (ISC_FALSE); -} - -isc_boolean_t -isc_file_iscurrentdir(const char *filename) { - REQUIRE(filename != NULL); - return (ISC_TF(filename[0] == '.' && filename[1] == '\0')); -} - -isc_boolean_t -isc_file_ischdiridempotent(const char *filename) { - REQUIRE(filename != NULL); - - if (isc_file_isabsolute(filename)) - return (ISC_TRUE); - if (filename[0] == '\\') - return (ISC_TRUE); - if (filename[0] == '/') - return (ISC_TRUE); - if (isc_file_iscurrentdir(filename)) - return (ISC_TRUE); - return (ISC_FALSE); -} - -const char * -isc_file_basename(const char *filename) { - char *s; - - REQUIRE(filename != NULL); - - s = strrchr(filename, '\\'); - if (s == NULL) - return (filename); - return (s + 1); -} - -isc_result_t -isc_file_progname(const char *filename, char *progname, size_t namelen) { - const char *s; - char *p; - size_t len; - - REQUIRE(filename != NULL); - REQUIRE(progname != NULL); - - /* - * Strip the path from the name - */ - s = isc_file_basename(filename); - if (s == NULL) { - return (ISC_R_NOSPACE); - } - - /* - * Strip any and all suffixes - */ - p = strchr(s, '.'); - if (p == NULL) { - if (namelen <= strlen(s)) - return (ISC_R_NOSPACE); - - strcpy(progname, s); - return (ISC_R_SUCCESS); - } - - /* - * Copy the result to the buffer - */ - len = p - s; - if (len >= namelen) - return (ISC_R_NOSPACE); - - strncpy(progname, s, len); - progname[len] = '\0'; - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_file_absolutepath(const char *filename, char *path, size_t pathlen) { - char *ptrname; - DWORD retval; - - REQUIRE(filename != NULL); - REQUIRE(path != NULL); - - retval = GetFullPathName(filename, pathlen, path, &ptrname); - - /* Something went wrong in getting the path */ - if (retval == 0) - return (ISC_R_NOTFOUND); - /* Caller needs to provide a larger buffer to contain the string */ - if (retval >= pathlen) - return (ISC_R_NOSPACE); - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_file_truncate(const char *filename, isc_offset_t size) { - int fh; - - REQUIRE(filename != NULL && size >= 0); - - if ((fh = open(filename, _O_RDWR | _O_BINARY)) < 0) - return (isc__errno2result(errno)); - - if(_chsize(fh, size) != 0) { - close(fh); - return (isc__errno2result(errno)); - } - close(fh); - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_file_safecreate(const char *filename, FILE **fp) { - isc_result_t result; - int flags; - struct stat sb; - FILE *f; - int fd; - - REQUIRE(filename != NULL); - REQUIRE(fp != NULL && *fp == NULL); - - result = file_stats(filename, &sb); - if (result == ISC_R_SUCCESS) { - if ((sb.st_mode & S_IFREG) == 0) - return (ISC_R_INVALIDFILE); - flags = O_WRONLY | O_TRUNC; - } else if (result == ISC_R_FILENOTFOUND) { - flags = O_WRONLY | O_CREAT | O_EXCL; - } else - return (result); - - fd = open(filename, flags, S_IRUSR | S_IWUSR); - if (fd == -1) - return (isc__errno2result(errno)); - - f = fdopen(fd, "w"); - if (f == NULL) { - result = isc__errno2result(errno); - close(fd); - return (result); - } - - *fp = f; - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirname, char **basename) -{ - char *dir, *file, *slash; - char *backslash; - - slash = strrchr(path, '/'); - - backslash = strrchr(path, '\\'); - if ((slash != NULL && backslash != NULL && backslash > slash) || - (slash == NULL && backslash != NULL)) - slash = backslash; - - if (slash == path) { - file = ++slash; - dir = isc_mem_strdup(mctx, "/"); - } else if (slash != NULL) { - file = ++slash; - dir = isc_mem_allocate(mctx, slash - path); - if (dir != NULL) - strlcpy(dir, path, slash - path); - } else { - file = path; - dir = isc_mem_strdup(mctx, "."); - } - - if (dir == NULL) - return (ISC_R_NOMEMORY); - - if (*file == '\0') { - isc_mem_free(mctx, dir); - return (ISC_R_INVALIDFILE); - } - - *dirname = dir; - *basename = file; - - return (ISC_R_SUCCESS); -} diff --git a/lib/isc/win32/fsaccess.c b/lib/isc/win32/fsaccess.c deleted file mode 100644 index 8de793f0a858..000000000000 --- a/lib/isc/win32/fsaccess.c +++ /dev/null @@ -1,375 +0,0 @@ -/* - * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: fsaccess.c,v 1.15 2007/06/19 23:47:19 tbox Exp $ */ - -/* - * Note that Win32 does not have the concept of files having access - * and ownership bits. The FAT File system only has a readonly flag - * for everyone and that's all. NTFS uses ACL's which is a totally - * different concept of controlling access. - * - * This code needs to be revisited to set up proper access control for - * NTFS file systems. Nothing can be done for FAT file systems. - */ - -#include - -#include - -#include -#include -#include -#include - -#include -#include - -#include "errno2result.h" - -/* - * The OS-independent part of the API is in lib/isc. - */ -#include "../fsaccess.c" - -/* Store the user account name locally */ -static char username[255] = "\0"; -static DWORD namelen = 0; - -/* - * In order to set or retrieve access information, we need to obtain - * the File System type. These could be UNC-type shares. - */ - -BOOL -is_ntfs(const char * file) { - - char drive[255]; - char FSType[20]; - char tmpbuf[256]; - char *machinename; - char *sharename; - char filename[1024]; - - REQUIRE(filename != NULL); - - if (isc_file_absolutepath(file, filename, - sizeof(filename)) != ISC_R_SUCCESS) { - return (FALSE); - } - - /* - * Look for c:\path\... style, c:/path/... or \\computer\shar\path... - * the UNC style file specs - */ - if (isalpha(filename[0]) && filename[1] == ':' && - (filename[2] == '\\' || filename[2] == '/')) { - strncpy(drive, filename, 3); - drive[3] = '\0'; - } - - else if ((filename[0] == '\\') && (filename[1] == '\\')) { - /* Find the machine and share name and rebuild the UNC */ - strcpy(tmpbuf, filename); - machinename = strtok(tmpbuf, "\\"); - sharename = strtok(NULL, "\\"); - strcpy(drive, "\\\\"); - strcat(drive, machinename); - strcat(drive, "\\"); - strcat(drive, sharename); - strcat(drive, "\\"); - - } - else /* Not determinable */ - return (FALSE); - - GetVolumeInformation(drive, NULL, 0, NULL, 0, NULL, FSType, - sizeof(FSType)); - if(strcmp(FSType,"NTFS") == 0) - return (TRUE); - else - return (FALSE); -} - -/* - * If it's not NTFS, we assume that it is FAT and proceed - * with almost nothing to do. Only the write flag can be set or - * cleared. - */ -isc_result_t -FAT_fsaccess_set(const char *path, isc_fsaccess_t access) { - int mode; - isc_fsaccess_t bits; - - /* - * Done with checking bad bits. Set mode_t. - */ - mode = 0; - -#define SET_AND_CLEAR1(modebit) \ - if ((access & bits) != 0) { \ - mode |= modebit; \ - access &= ~bits; \ - } -#define SET_AND_CLEAR(user, group, other) \ - SET_AND_CLEAR1(user); \ - bits <<= STEP; \ - SET_AND_CLEAR1(group); \ - bits <<= STEP; \ - SET_AND_CLEAR1(other); - - bits = ISC_FSACCESS_READ | ISC_FSACCESS_LISTDIRECTORY; - - SET_AND_CLEAR(S_IRUSR, S_IRGRP, S_IROTH); - - bits = ISC_FSACCESS_WRITE | - ISC_FSACCESS_CREATECHILD | - ISC_FSACCESS_DELETECHILD; - - SET_AND_CLEAR(S_IWUSR, S_IWGRP, S_IWOTH); - - INSIST(access == 0); - - if (_chmod(path, mode) < 0) - return (isc__errno2result(errno)); - - return (ISC_R_SUCCESS); -} - -isc_result_t -NTFS_Access_Control(const char *filename, const char *user, int access, - isc_boolean_t isdir) { - SECURITY_DESCRIPTOR sd; - BYTE aclBuffer[1024]; - PACL pacl=(PACL)&aclBuffer; - BYTE sidBuffer[100]; - PSID psid=(PSID) &sidBuffer; - DWORD sidBufferSize = sizeof(sidBuffer); - BYTE adminSidBuffer[100]; - PSID padminsid=(PSID) &adminSidBuffer; - DWORD adminSidBufferSize = sizeof(adminSidBuffer); - BYTE otherSidBuffer[100]; - PSID pothersid=(PSID) &otherSidBuffer; - DWORD otherSidBufferSize = sizeof(otherSidBuffer); - char domainBuffer[100]; - DWORD domainBufferSize = sizeof(domainBuffer); - SID_NAME_USE snu; - int errval; - DWORD NTFSbits; - int caccess; - - - /* Initialize an ACL */ - if (!InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION)) - return (ISC_R_NOPERM); - if (!InitializeAcl(pacl, sizeof(aclBuffer), ACL_REVISION)) - return (ISC_R_NOPERM); - if (!LookupAccountName(0, user, psid, &sidBufferSize, domainBuffer, - &domainBufferSize, &snu)) - return (ISC_R_NOPERM); - domainBufferSize = sizeof(domainBuffer); - if (!LookupAccountName(0, "Administrators", padminsid, - &adminSidBufferSize, domainBuffer, &domainBufferSize, &snu)) { - errval = GetLastError(); - return (ISC_R_NOPERM); - } - domainBufferSize = sizeof(domainBuffer); - if (!LookupAccountName(0, "Everyone", pothersid, - &otherSidBufferSize, domainBuffer, &domainBufferSize, &snu)) { - errval = GetLastError(); - return (ISC_R_NOPERM); - } - - caccess = access; - /* Owner check */ - - NTFSbits = 0; - if (caccess & ISC_FSACCESS_READ) - NTFSbits |= FILE_GENERIC_READ; - if (caccess & ISC_FSACCESS_WRITE) - NTFSbits |= FILE_GENERIC_WRITE; - if (caccess & ISC_FSACCESS_EXECUTE) - NTFSbits |= FILE_GENERIC_EXECUTE; - - /* For directories check the directory-specific bits */ - if (isdir == ISC_TRUE) { - if (caccess & ISC_FSACCESS_CREATECHILD) - NTFSbits |= FILE_ADD_SUBDIRECTORY | FILE_ADD_FILE; - if (caccess & ISC_FSACCESS_DELETECHILD) - NTFSbits |= FILE_DELETE_CHILD; - if (caccess & ISC_FSACCESS_LISTDIRECTORY) - NTFSbits |= FILE_LIST_DIRECTORY; - if (caccess & ISC_FSACCESS_ACCESSCHILD) - NTFSbits |= FILE_TRAVERSE; - } - - if (NTFSbits == (FILE_GENERIC_READ | FILE_GENERIC_WRITE - | FILE_GENERIC_EXECUTE)) - NTFSbits |= FILE_ALL_ACCESS; - /* - * Owner and Administrator also get STANDARD_RIGHTS_ALL - * to ensure that they have full control - */ - - NTFSbits |= STANDARD_RIGHTS_ALL; - - /* Add the ACE to the ACL */ - if (!AddAccessAllowedAce(pacl, ACL_REVISION, NTFSbits, psid)) - return (ISC_R_NOPERM); - if (!AddAccessAllowedAce(pacl, ACL_REVISION, NTFSbits, padminsid)) - return (ISC_R_NOPERM); - - /* - * Group is ignored since we can be in multiple groups or no group - * and its meaning is not clear on Win32 - */ - - caccess = caccess >> STEP; - - /* - * Other check. We translate this to be the same as Everyone - */ - - caccess = caccess >> STEP; - - NTFSbits = 0; - if (caccess & ISC_FSACCESS_READ) - NTFSbits |= FILE_GENERIC_READ; - if (caccess & ISC_FSACCESS_WRITE) - NTFSbits |= FILE_GENERIC_WRITE; - if (caccess & ISC_FSACCESS_EXECUTE) - NTFSbits |= FILE_GENERIC_EXECUTE; - - /* For directories check the directory-specific bits */ - if (isdir == TRUE) { - if (caccess & ISC_FSACCESS_CREATECHILD) - NTFSbits |= FILE_ADD_SUBDIRECTORY | FILE_ADD_FILE; - if (caccess & ISC_FSACCESS_DELETECHILD) - NTFSbits |= FILE_DELETE_CHILD; - if (caccess & ISC_FSACCESS_LISTDIRECTORY) - NTFSbits |= FILE_LIST_DIRECTORY; - if (caccess & ISC_FSACCESS_ACCESSCHILD) - NTFSbits |= FILE_TRAVERSE; - } - /* Add the ACE to the ACL */ - if (!AddAccessAllowedAce(pacl, ACL_REVISION, NTFSbits, - pothersid)) - return (ISC_R_NOPERM); - - if (!SetSecurityDescriptorDacl(&sd, TRUE, pacl, FALSE)) - return (ISC_R_NOPERM); - if (!SetFileSecurity(filename, DACL_SECURITY_INFORMATION, &sd)) { - return (ISC_R_NOPERM); - } - - return(ISC_R_SUCCESS); -} - -isc_result_t -NTFS_fsaccess_set(const char *path, isc_fsaccess_t access, - isc_boolean_t isdir){ - - /* - * For NTFS we first need to get the name of the account under - * which BIND is running - */ - if (namelen <= 0) { - namelen = sizeof(username); - if (GetUserName(username, &namelen) == 0) - return (ISC_R_FAILURE); - } - return (NTFS_Access_Control(path, username, access, isdir)); -} - -isc_result_t -isc_fsaccess_set(const char *path, isc_fsaccess_t access) { - struct stat statb; - isc_boolean_t is_dir = ISC_FALSE; - isc_result_t result; - - if (stat(path, &statb) != 0) - return (isc__errno2result(errno)); - - if ((statb.st_mode & S_IFDIR) != 0) - is_dir = ISC_TRUE; - else if ((statb.st_mode & S_IFREG) == 0) - return (ISC_R_INVALIDFILE); - - result = check_bad_bits(access, is_dir); - if (result != ISC_R_SUCCESS) - return (result); - - /* - * Determine if this is a FAT or NTFS disk and - * call the appropriate function to set the permissions - */ - if (is_ntfs(path)) - return (NTFS_fsaccess_set(path, access, is_dir)); - else - return (FAT_fsaccess_set(path, access)); -} - -isc_result_t -isc_fsaccess_changeowner(const char *filename, const char *user) { - SECURITY_DESCRIPTOR psd; - BYTE sidBuffer[500]; - BYTE groupBuffer[500]; - PSID psid=(PSID) &sidBuffer; - DWORD sidBufferSize = sizeof(sidBuffer); - char domainBuffer[100]; - DWORD domainBufferSize = sizeof(domainBuffer); - SID_NAME_USE snu; - PSID pSidGroup = (PSID) &groupBuffer; - DWORD groupBufferSize = sizeof(groupBuffer); - - - /* - * Determine if this is a FAT or NTFS disk and - * call the appropriate function to set the ownership - * FAT disks do not have ownership attributes so it's - * a noop. - */ - if (is_ntfs(filename) == FALSE) - return (ISC_R_SUCCESS); - - if (!InitializeSecurityDescriptor(&psd, SECURITY_DESCRIPTOR_REVISION)) - return (ISC_R_NOPERM); - - if (!LookupAccountName(0, user, psid, &sidBufferSize, domainBuffer, - &domainBufferSize, &snu)) - return (ISC_R_NOPERM); - - /* Make sure administrators can get to it */ - domainBufferSize = sizeof(domainBuffer); - if (!LookupAccountName(0, "Administrators", pSidGroup, - &groupBufferSize, domainBuffer, &domainBufferSize, &snu)) - return (ISC_R_NOPERM); - - if (!SetSecurityDescriptorOwner(&psd, psid, FALSE)) - return (ISC_R_NOPERM); - - if (!SetSecurityDescriptorGroup(&psd, pSidGroup, FALSE)) - return (ISC_R_NOPERM); - - if (!SetFileSecurity(filename, - OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION, - &psd)) - return (ISC_R_NOPERM); - - return (ISC_R_SUCCESS); -} - diff --git a/lib/isc/win32/include/isc/bind_registry.h b/lib/isc/win32/include/isc/bind_registry.h deleted file mode 100644 index c4dc8768d881..000000000000 --- a/lib/isc/win32/include/isc/bind_registry.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: bind_registry.h,v 1.8 2007/06/19 23:47:20 tbox Exp $ */ - -#ifndef ISC_BINDREGISTRY_H -#define ISC_BINDREGISTRY_H - -/* - * BIND makes use of the following Registry keys in various places, especially - * during startup and installation - */ - -#define BIND_SUBKEY "Software\\ISC\\BIND" -#define BIND_SESSION "CurrentSession" -#define BIND_SESSION_SUBKEY "Software\\ISC\\BIND\\CurrentSession" -#define BIND_UNINSTALL_SUBKEY \ - "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ISC BIND" - -#define EVENTLOG_APP_SUBKEY \ - "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application" -#define BIND_MESSAGE_SUBKEY \ - "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\named" -#define BIND_MESSAGE_NAME "named" - -#define BIND_SERVICE_SUBKEY \ - "SYSTEM\\CurrentControlSet\\Services\\named" - - -#define BIND_CONFIGFILE 0 -#define BIND_DEBUGLEVEL 1 -#define BIND_QUERYLOG 2 -#define BIND_FOREGROUND 3 -#define BIND_PORT 4 - -#endif /* ISC_BINDREGISTRY_H */ diff --git a/lib/isc/win32/include/isc/bindevt.h b/lib/isc/win32/include/isc/bindevt.h deleted file mode 100644 index 72cf2d1fc506..000000000000 --- a/lib/isc/win32/include/isc/bindevt.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: bindevt.h,v 1.6 2007/06/19 23:47:20 tbox Exp $ */ - -#ifndef ISC_BINDEVT_H -#define ISC_BINDEVT_H 1 - -/* - * This is used for the event log for both logging the messages and - * later on by the event viewer when looking at the events - */ - -/* - * Values are 32 bit values layed out as follows: - * - * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 - * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 - * +---+-+-+-----------------------+-------------------------------+ - * |Sev|C|R| Facility | Code | - * +---+-+-+-----------------------+-------------------------------+ - * - * where - * - * Sev - is the severity code - * - * 00 - Success - * 01 - Informational - * 10 - Warning - * 11 - Error - * - * C - is the Customer code flag - * - * R - is a reserved bit - * - * Facility - is the facility code - * - * Code - is the facility's status code - * - * - * Define the facility codes - */ - - -/* - * Define the severity codes - */ - - -/* - * MessageId: BIND_ERR_MSG - * - * MessageText: - * - * %1 - */ -#define BIND_ERR_MSG ((DWORD)0xC0000001L) - -/* - * MessageId: BIND_WARN_MSG - * - * MessageText: - * - * %1 - */ -#define BIND_WARN_MSG ((DWORD)0x80000002L) - -/* - * MessageId: BIND_INFO_MSG - * - * MessageText: - * - * %1 - */ -#define BIND_INFO_MSG ((DWORD)0x40000003L) - -#endif /* ISC_BINDEVT_H */ diff --git a/lib/isc/win32/include/isc/keyboard.h b/lib/isc/win32/include/isc/keyboard.h deleted file mode 100644 index e781c5fa167c..000000000000 --- a/lib/isc/win32/include/isc/keyboard.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: keyboard.h,v 1.6 2007/06/19 23:47:20 tbox Exp $ */ - -#ifndef ISC_KEYBOARD_H -#define ISC_KEYBOARD_H 1 - -#include -#include - -ISC_LANG_BEGINDECLS - -typedef struct { - int fd; - isc_result_t result; -} isc_keyboard_t; - -isc_result_t -isc_keyboard_open(isc_keyboard_t *keyboard); - -isc_result_t -isc_keyboard_close(isc_keyboard_t *keyboard, unsigned int sleepseconds); - -isc_result_t -isc_keyboard_getchar(isc_keyboard_t *keyboard, unsigned char *cp); - -isc_boolean_t -isc_keyboard_canceled(isc_keyboard_t *keyboard); - -ISC_LANG_ENDDECLS - -#endif /* ISC_KEYBOARD_H */ diff --git a/lib/isc/win32/include/isc/netdb.h b/lib/isc/win32/include/isc/netdb.h deleted file mode 100644 index 6625afdbd354..000000000000 --- a/lib/isc/win32/include/isc/netdb.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: netdb.h,v 1.9 2007/06/19 23:47:20 tbox Exp $ */ - -#ifndef ISC_NETDB_H -#define ISC_NETDB_H 1 - -/***** - ***** Module Info - *****/ - -/* - * Portable netdb.h support. - * - * This module is responsible for defining the getby APIs. - * - * MP: - * No impact. - * - * Reliability: - * No anticipated impact. - * - * Resources: - * N/A. - * - * Security: - * No anticipated impact. - * - * Standards: - * BSD API - */ - -/*** - *** Imports. - ***/ - -#include - -#endif /* ISC_NETDB_H */ diff --git a/lib/isc/win32/include/isc/ntgroups.h b/lib/isc/win32/include/isc/ntgroups.h deleted file mode 100644 index b4cd020e5132..000000000000 --- a/lib/isc/win32/include/isc/ntgroups.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: ntgroups.h,v 1.5 2007/06/19 23:47:20 tbox Exp $ */ - -#ifndef ISC_NTGROUPS_H -#define ISC_NTGROUPS_H 1 - -#include -#include - -ISC_LANG_BEGINDECLS - - -isc_result_t -isc_ntsecurity_getaccountgroups(char *name, char **Groups, unsigned int maxgroups, - unsigned int *total); - -ISC_LANG_ENDDECLS - -#endif /* ISC_NTGROUPS_H */ diff --git a/lib/isc/win32/include/isc/ntpaths.h b/lib/isc/win32/include/isc/ntpaths.h deleted file mode 100644 index 39bcb6276f6c..000000000000 --- a/lib/isc/win32/include/isc/ntpaths.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: ntpaths.h,v 1.20 2009/07/14 22:54:57 each Exp $ */ - -/* - * Windows-specific path definitions - * These routines are used to set up and return system-specific path - * information about the files enumerated in NtPaths - */ - -#ifndef ISC_NTPATHS_H -#define ISC_NTPATHS_H - -#include - -/* - * Index of paths needed - */ -enum NtPaths { - NAMED_CONF_PATH, - LWRES_CONF_PATH, - RESOLV_CONF_PATH, - RNDC_CONF_PATH, - NAMED_PID_PATH, - LWRESD_PID_PATH, - LOCAL_STATE_DIR, - SYS_CONF_DIR, - RNDC_KEY_PATH, - SESSION_KEY_PATH -}; - -/* - * Define macros to get the path of the config files - */ -#define NAMED_CONFFILE isc_ntpaths_get(NAMED_CONF_PATH) -#define RNDC_CONFFILE isc_ntpaths_get(RNDC_CONF_PATH) -#define RNDC_KEYFILE isc_ntpaths_get(RNDC_KEY_PATH) -#define SESSION_KEYFILE isc_ntpaths_get(SESSION_KEY_PATH) -#define RESOLV_CONF isc_ntpaths_get(RESOLV_CONF_PATH) - -/* - * Information about where the files are on disk - */ -#define NS_LOCALSTATEDIR "/dns/bin" -#define NS_SYSCONFDIR "/dns/etc" - -ISC_LANG_BEGINDECLS - -void -isc_ntpaths_init(void); - -char * -isc_ntpaths_get(int); - -ISC_LANG_ENDDECLS - -#endif /* ISC_NTPATHS_H */ diff --git a/lib/isc/win32/include/isc/syslog.h b/lib/isc/win32/include/isc/syslog.h deleted file mode 100644 index 765c0e532e8f..000000000000 --- a/lib/isc/win32/include/isc/syslog.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: syslog.h,v 1.5 2007/06/19 23:47:20 tbox Exp $ */ - -#ifndef ISC_SYSLOG_H -#define ISC_SYSLOG_H 1 - -#include -#include - -ISC_LANG_BEGINDECLS - -isc_result_t -isc_syslog_facilityfromstring(const char *str, int *facilityp); -/* - * Convert 'str' to the appropriate syslog facility constant. - * - * Requires: - * - * 'str' is not NULL - * 'facilityp' is not NULL - * - * Returns: - * ISC_R_SUCCESS - * ISC_R_NOTFOUND - */ - -ISC_LANG_ENDDECLS - -#endif /* ISC_SYSLOG_H */ diff --git a/lib/isc/win32/ipv6.c b/lib/isc/win32/ipv6.c deleted file mode 100644 index 511ae21f4255..000000000000 --- a/lib/isc/win32/ipv6.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: ipv6.c,v 1.8 2007/06/19 23:47:19 tbox Exp $ */ - -#include -#include - -LIBISC_EXTERNAL_DATA const struct in6_addr isc_in6addr_any = - IN6ADDR_ANY_INIT; - -LIBISC_EXTERNAL_DATA const struct in6_addr isc_in6addr_loopback = - IN6ADDR_LOOPBACK_INIT; diff --git a/lib/isc/win32/keyboard.c b/lib/isc/win32/keyboard.c deleted file mode 100644 index d569e7ca8ee9..000000000000 --- a/lib/isc/win32/keyboard.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: keyboard.c,v 1.7 2007/06/19 23:47:19 tbox Exp $ */ - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -isc_result_t -isc_keyboard_open(isc_keyboard_t *keyboard) { - int fd; - - REQUIRE(keyboard != NULL); - - fd = _fileno(stdin); - if (fd < 0) - return (ISC_R_IOERROR); - - keyboard->fd = fd; - - keyboard->result = ISC_R_SUCCESS; - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_keyboard_close(isc_keyboard_t *keyboard, unsigned int sleeptime) { - REQUIRE(keyboard != NULL); - - if (sleeptime > 0 && keyboard->result != ISC_R_CANCELED) - (void)Sleep(sleeptime*1000); - - keyboard->fd = -1; - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_keyboard_getchar(isc_keyboard_t *keyboard, unsigned char *cp) { - ssize_t cc; - unsigned char c; - - REQUIRE(keyboard != NULL); - REQUIRE(cp != NULL); - - cc = read(keyboard->fd, &c, 1); - if (cc < 0) { - keyboard->result = ISC_R_IOERROR; - return (keyboard->result); - } - - *cp = c; - - return (ISC_R_SUCCESS); -} - -isc_boolean_t -isc_keyboard_canceled(isc_keyboard_t *keyboard) { - return (ISC_TF(keyboard->result == ISC_R_CANCELED)); -} - diff --git a/lib/isc/win32/libgen.h b/lib/isc/win32/libgen.h deleted file mode 100644 index 1c58a9569a0e..000000000000 --- a/lib/isc/win32/libgen.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: libgen.h,v 1.3 2009/07/17 23:47:41 tbox Exp $ */ - -#ifndef LIBGEN_H -#define LIBGEN_H 1 - -char *basename(const char *); -char *dirname(const char *); - -#endif diff --git a/lib/isc/win32/libisc.def b/lib/isc/win32/libisc.def deleted file mode 100644 index fb084103da53..000000000000 --- a/lib/isc/win32/libisc.def +++ /dev/null @@ -1,583 +0,0 @@ -LIBRARY libisc - -; Exported Functions -EXPORTS - -NTReportError -closelog -isc___mem_allocate -isc___mem_free -isc___mem_get -isc___mem_put -isc___mem_putanddetach -isc___mem_reallocate -isc___mem_strdup -isc___mempool_get -isc___mempool_put -isc___socketmgr_maxudp -isc__app_block -isc__app_finish -isc__app_onrun -isc__app_reload -isc__app_run -isc__app_shutdown -isc__app_start -isc__app_unblock -isc__backtrace_nsymbols -isc__backtrace_symtable -isc__buffer_activeregion -isc__buffer_add -isc__buffer_availableregion -isc__buffer_back -isc__buffer_clear -isc__buffer_consumedregion -isc__buffer_first -isc__buffer_forward -isc__buffer_init -isc__buffer_invalidate -isc__buffer_putmem -isc__buffer_putstr -isc__buffer_putuint16 -isc__buffer_putuint32 -isc__buffer_putuint48 -isc__buffer_putuint8 -isc__buffer_region -isc__buffer_remainingregion -isc__buffer_setactive -isc__buffer_subtract -isc__buffer_usedregion -isc__mem_attach -isc__mem_checkdestroyed -isc__mem_create -isc__mem_create2 -isc__mem_createx -isc__mem_createx2 -isc__mem_destroy -isc__mem_detach -isc__mem_getname -isc__mem_getquota -isc__mem_gettag -isc__mem_inuse -isc__mem_isovermem -isc__mem_ondestroy -isc__mem_references -isc__mem_setdestroycheck -isc__mem_setname -isc__mem_setquota -isc__mem_setwater -isc__mem_stats -isc__mem_waterack -isc__mempool_associatelock -isc__mempool_create -isc__mempool_destroy -isc__mempool_getallocated -isc__mempool_getfillcount -isc__mempool_getfreecount -isc__mempool_getfreemax -isc__mempool_getmaxalloc -isc__mempool_setfillcount -isc__mempool_setfreemax -isc__mempool_setmaxalloc -isc__mempool_setname -isc__socket_accept -isc__socket_attach -isc__socket_bind -isc__socket_cancel -isc__socket_cleanunix -isc__socket_close -isc__socket_connect -isc__socket_create -isc__socket_detach -isc__socket_dup -isc__socket_filter -isc__socket_getfd -isc__socket_getname -isc__socket_getpeername -isc__socket_getsockname -isc__socket_gettag -isc__socket_gettype -isc__socket_ipv6only -isc__socket_isbound -isc__socket_listen -isc__socket_open -isc__socket_permunix -isc__socket_recv -isc__socket_recv2 -isc__socket_recvv -isc__socket_send -isc__socket_sendto -isc__socket_sendto2 -isc__socket_sendtov -isc__socket_sendv -isc__socket_setname -isc__socketmgr_create -isc__socketmgr_create2 -isc__socketmgr_destroy -isc__socketmgr_getmaxsockets -isc__socketmgr_setreserved -isc__socketmgr_setstats -isc__strerror -isc__task_attach -isc__task_beginexclusive -isc__task_create -isc__task_destroy -isc__task_detach -isc__task_endexclusive -isc__task_getcurrenttime -isc__task_getname -isc__task_gettag -isc__task_onshutdown -isc__task_privilege -isc__task_purge -isc__task_purgeevent -isc__task_purgerange -isc__task_send -isc__task_sendanddetach -isc__task_setname -isc__task_setprivilege -isc__task_shutdown -isc__task_unsend -isc__task_unsendrange -isc__taskmgr_create -isc__taskmgr_destroy -isc__taskmgr_mode -isc__taskmgr_setmode -isc__timer_attach -isc__timer_create -isc__timer_detach -isc__timer_reset -isc__timer_touch -isc__timermgr_create -isc__timermgr_destroy -isc__timermgr_poke -isc_assertion_failed -isc_assertion_setcallback -isc_assertion_typetotext -isc_backtrace_getsymbol -isc_backtrace_getsymbolfromindex -isc_backtrace_gettrace -isc_base32_decoderegion -isc_base32_decodestring -isc_base32_tobuffer -isc_base32_totext -isc_base32hex_decoderegion -isc_base32hex_decodestring -isc_base32hex_tobuffer -isc_base32hex_totext -isc_base64_decodestring -isc_base64_tobuffer -isc_base64_totext -isc_bitstring_copy -isc_bitstring_init -isc_bitstring_invalidate -isc_buffer_allocate -isc_buffer_compact -isc_buffer_copyregion -isc_buffer_free -isc_buffer_getuint16 -isc_buffer_getuint32 -isc_buffer_getuint8 -isc_buffer_reinit -isc_bufferlist_availablecount -isc_bufferlist_usedcount -isc_commandline_parse -isc_condition_broadcast -isc_condition_destroy -isc_condition_init -isc_condition_signal -isc_condition_wait -isc_condition_waituntil -isc_dir_chdir -isc_dir_chroot -isc_dir_close -isc_dir_init -isc_dir_open -isc_dir_read -isc_dir_reset -isc_entropy_addcallbacksample -isc_entropy_addsample -isc_entropy_attach -isc_entropy_create -isc_entropy_createcallbacksource -isc_entropy_createfilesource -isc_entropy_createsamplesource -isc_entropy_destroysource -isc_entropy_detach -isc_entropy_getdata -isc_entropy_putdata -isc_entropy_stats -isc_entropy_status -isc_entropy_stopcallbacksources -isc_entropy_usebestsource -isc_error_fatal -isc_error_runtimecheck -isc_error_setfatal -isc_error_setunexpected -isc_error_unexpected -isc_event_allocate -isc_event_free -isc_file_absolutepath -isc_file_basename -isc_file_exists -isc_file_getmodtime -isc_file_isabsolute -isc_file_ischdiridempotent -isc_file_iscurrentdir -isc_file_isplainfile -isc_file_mktemplate -isc_file_openunique -isc_file_openuniquemode -isc_file_openuniqueprivate -isc_file_progname -isc_file_remove -isc_file_rename -isc_file_renameunique -isc_file_safecreate -isc_file_safemovefile -isc_file_settime -isc_file_splitpath -isc_file_template -isc_file_truncate -isc_fsaccess_add -isc_fsaccess_changeowner -isc_fsaccess_remove -isc_fsaccess_set -isc_hash_calc -isc_hash_create -isc_hash_ctxattach -isc_hash_ctxcalc -isc_hash_ctxcreate -isc_hash_ctxdetach -isc_hash_ctxinit -isc_hash_destroy -isc_hash_init -isc_heap_create -isc_heap_decreased -isc_heap_delete -isc_heap_destroy -isc_heap_element -isc_heap_increased -isc_heap_insert -isc_hex_decodestring -isc_hex_tobuffer -isc_hex_totext -isc_hmacmd5_init -isc_hmacmd5_invalidate -isc_hmacmd5_sign -isc_hmacmd5_update -isc_hmacmd5_verify -isc_hmacmd5_verify2 -isc_hmacsha1_init -isc_hmacsha1_invalidate -isc_hmacsha1_sign -isc_hmacsha1_update -isc_hmacsha1_verify -isc_hmacsha224_init -isc_hmacsha224_invalidate -isc_hmacsha224_sign -isc_hmacsha224_update -isc_hmacsha224_verify -isc_hmacsha256_init -isc_hmacsha256_invalidate -isc_hmacsha256_sign -isc_hmacsha256_update -isc_hmacsha256_verify -isc_hmacsha384_init -isc_hmacsha384_invalidate -isc_hmacsha384_sign -isc_hmacsha384_update -isc_hmacsha384_verify -isc_hmacsha512_init -isc_hmacsha512_invalidate -isc_hmacsha512_sign -isc_hmacsha512_update -isc_hmacsha512_verify -isc_httpdmgr_addurl -isc_httpdmgr_create -isc_httpdmgr_shutdown -isc_interfaceiter_create -isc_interfaceiter_current -isc_interfaceiter_destroy -isc_interfaceiter_first -isc_interfaceiter_next -isc_interval_iszero -isc_interval_set -isc_iterated_hash -isc_keyboard_canceled -isc_keyboard_close -isc_keyboard_getchar -isc_keyboard_open -isc_lex_close -isc_lex_create -isc_lex_destroy -isc_lex_getcomments -isc_lex_getlasttokentext -isc_lex_getmastertoken -isc_lex_getoctaltoken -isc_lex_getsourceline -isc_lex_getsourcename -isc_lex_getspecials -isc_lex_gettoken -isc_lex_isfile -isc_lex_openbuffer -isc_lex_openfile -isc_lex_openstream -isc_lex_setcomments -isc_lex_setspecials -isc_lex_ungettoken -isc_lfsr_generate -isc_lfsr_generate32 -isc_lfsr_init -isc_lfsr_skip -isc_lib_initmsgcat -isc_log_categorybyname -isc_log_closefilelogs -isc_log_create -isc_log_createchannel -isc_log_destroy -isc_log_getdebuglevel -isc_log_getduplicateinterval -isc_log_gettag -isc_log_ivwrite -isc_log_ivwrite1 -isc_log_iwrite -isc_log_iwrite1 -isc_log_modulebyname -isc_log_opensyslog -isc_log_registercategories -isc_log_registermodules -isc_log_setcontext -isc_log_setdebuglevel -isc_log_setduplicateinterval -isc_log_settag -isc_log_usechannel -isc_log_vwrite -isc_log_vwrite1 -isc_log_wouldlog -isc_log_write -isc_log_write1 -isc_logconfig_create -isc_logconfig_destroy -isc_logconfig_get -isc_logconfig_use -isc_md5_final -isc_md5_init -isc_md5_invalidate -isc_md5_update -isc_mem_renderxml -isc_msgcat_close -isc_msgcat_get -isc_msgcat_open -isc_mutexblock_destroy -isc_mutexblock_init -isc_net_aton -isc_net_disableipv4 -isc_net_disableipv6 -isc_net_getudpportrange -isc_net_ntop -isc_net_probe_ipv6only -isc_net_probe_ipv6pktinfo -isc_net_probeipv4 -isc_net_probeipv6 -isc_net_probeunix -isc_net_pton -isc_netaddr_any -isc_netaddr_any6 -isc_netaddr_eqprefix -isc_netaddr_equal -isc_netaddr_format -isc_netaddr_fromin -isc_netaddr_fromin6 -isc_netaddr_frompath -isc_netaddr_fromsockaddr -isc_netaddr_fromv4mapped -isc_netaddr_getzone -isc_netaddr_ismulticast -isc_netaddr_masktoprefixlen -isc_netaddr_prefixok -isc_netaddr_setzone -isc_netaddr_totext -isc_netscope_pton -isc_ntpaths_get -isc_ntpaths_init -isc_once_do -isc_ondestroy_init -isc_ondestroy_notify -isc_ondestroy_register -isc_os_ncpus -isc_parse_uint16 -isc_parse_uint32 -isc_parse_uint8 -isc_portset_add -isc_portset_addrange -isc_portset_create -isc_portset_destroy -isc_portset_isset -isc_portset_nports -isc_portset_remove -isc_portset_removerange -isc_quota_attach -isc_quota_destroy -isc_quota_detach -isc_quota_init -isc_quota_max -isc_quota_release -isc_quota_reserve -isc_quota_soft -isc_radix_create -isc_radix_destroy -isc_radix_insert -isc_radix_process -isc_radix_remove -isc_radix_search -isc_random_get -isc_random_jitter -isc_random_seed -isc_ratelimiter_attach -isc_ratelimiter_create -isc_ratelimiter_detach -isc_ratelimiter_enqueue -isc_ratelimiter_setinterval -isc_ratelimiter_setpertic -isc_ratelimiter_shutdown -isc_refcount_init -isc_region_compare -isc_resource_getcurlimit -isc_resource_getlimit -isc_resource_setlimit -isc_result_register -isc_result_totext -isc_rwlock_destroy -isc_rwlock_downgrade -isc_rwlock_init -isc_rwlock_lock -isc_rwlock_trylock -isc_rwlock_tryupgrade -isc_rwlock_unlock -isc_serial_eq -isc_serial_ge -isc_serial_gt -isc_serial_le -isc_serial_lt -isc_serial_ne -isc_sha1_final -isc_sha1_init -isc_sha1_invalidate -isc_sha1_update -isc_sha224_final -isc_sha224_init -isc_sha224_invalidate -isc_sha224_update -isc_sha256_data -isc_sha256_final -isc_sha256_init -isc_sha256_invalidate -isc_sha256_update -isc_sha384_final -isc_sha384_init -isc_sha384_invalidate -isc_sha384_update -isc_sha512_final -isc_sha512_init -isc_sha512_invalidate -isc_sha512_update -isc_sockaddr_any -isc_sockaddr_any6 -isc_sockaddr_anyofpf -isc_sockaddr_compare -isc_sockaddr_eqaddr -isc_sockaddr_eqaddrprefix -isc_sockaddr_equal -isc_sockaddr_format -isc_sockaddr_fromin -isc_sockaddr_fromin6 -isc_sockaddr_fromnetaddr -isc_sockaddr_frompath -isc_sockaddr_getport -isc_sockaddr_hash -isc_sockaddr_isexperimental -isc_sockaddr_ismulticast -isc_sockaddr_pf -isc_sockaddr_setport -isc_sockaddr_totext -isc_sockaddr_v6fromin -isc_socketmgr_renderxml -isc_stats_attach -isc_stats_create -isc_stats_decrement -isc_stats_detach -isc_stats_dump -isc_stats_increment -isc_stats_ncounters -isc_stdio_close -isc_stdio_flush -isc_stdio_open -isc_stdio_read -isc_stdio_seek -isc_stdio_sync -isc_stdio_write -isc_stdtime_get -isc_string_append -isc_string_append_truncate -isc_string_copy -isc_string_copy_truncate -isc_string_printf -isc_string_printf_truncate -isc_string_regiondup -isc_string_separate -isc_string_strlcat -isc_string_strlcpy -isc_string_touint64 -isc_symtab_create -isc_symtab_define -isc_symtab_destroy -isc_symtab_lookup -isc_symtab_undefine -isc_syslog_facilityfromstring -isc_taskmgr_renderxml -isc_taskpool_create -isc_taskpool_destroy -isc_taskpool_expand -isc_taskpool_gettask -isc_taskpool_setprivilege -isc_taskpool_size -isc_thread_create -isc_thread_join -isc_thread_key_create -isc_thread_key_delete -isc_thread_key_getspecific -isc_thread_key_setspecific -isc_thread_setconcurrency -isc_time_add -isc_time_compare -isc_time_formatISO8601 -isc_time_formattimestamp -isc_time_isepoch -isc_time_microdiff -isc_time_nanoseconds -isc_time_now -isc_time_nowplusinterval -isc_time_seconds -isc_time_set -isc_time_settoepoch -isc_time_subtract -isc_win32os_majorversion -isc_win32os_minorversion -isc_win32os_servicepackmajor -isc_win32os_servicepackminor -isc_win32os_versioncheck -openlog -syslog - -; Exported Data - -EXPORTS - -isc_commandline_argument DATA -isc_commandline_errprint DATA -isc_commandline_index DATA -isc_commandline_option DATA -isc_commandline_progname DATA -isc_commandline_reset DATA -isc_mem_debugging DATA - diff --git a/lib/isc/win32/libisc.dsp b/lib/isc/win32/libisc.dsp deleted file mode 100644 index 8e4441c39fab..000000000000 --- a/lib/isc/win32/libisc.dsp +++ /dev/null @@ -1,802 +0,0 @@ -# Microsoft Developer Studio Project File - Name="libisc" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=libisc - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libisc.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libisc.mak" CFG="libisc - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libisc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libisc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libisc - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "BIND9" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBISC_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "./" /I "../../../" /I "../../../../libxml2-2.7.3/include" /I "include" /I "../include" /I "../noatomic/include" /I "win32" /I "../../isccfg/include" /D "BIND9" /D "WIN32" /D "NDEBUG" /D "__STDC__" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBISC_EXPORTS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 ../../../../libxml2-2.7.3/win32/bin.msvc/libxml2.lib -# ADD LINK32 user32.lib advapi32.lib ws2_32.lib /nologo /dll /machine:I386 /out:"../../../Build/Release/libisc.dll" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "BIND9" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBISC_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "./" /I "../../../" /I "../../../../libxml2-2.7.3/include" /I "include" /I "../include" /I "../noatomic/include" /I "win32" /I "../../isccfg/include" /D "BIND9" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__STDC__" /D "_MBCS" /D "_USRDLL" /D "LIBISC_EXPORTS" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ../../../../libxml2-2.7.3/win32/bin.msvc/libxml2.lib -# ADD LINK32 user32.lib advapi32.lib ws2_32.lib /nologo /dll /map /debug /machine:I386 /out:"../../../Build/Debug/libisc.dll" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "libisc - Win32 Release" -# Name "libisc - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\app.c -# End Source File -# Begin Source File - -SOURCE=.\condition.c -# End Source File -# Begin Source File - -SOURCE=.\dir.c -# End Source File -# Begin Source File - -SOURCE=.\DLLMain.c -# End Source File -# Begin Source File - -SOURCE=.\entropy.c -# End Source File -# Begin Source File - -SOURCE=.\errno2result.c -# End Source File -# Begin Source File - -SOURCE=.\file.c -# End Source File -# Begin Source File - -SOURCE=.\fsaccess.c -# End Source File -# Begin Source File - -SOURCE=.\interfaceiter.c -# End Source File -# Begin Source File - -SOURCE=.\ipv6.c -# End Source File -# Begin Source File - -SOURCE=..\iterated_hash.c -# End Source File -# Begin Source File - -SOURCE=.\keyboard.c -# End Source File -# Begin Source File - -SOURCE=.\net.c -# End Source File -# Begin Source File - -SOURCE=.\ntpaths.c -# End Source File -# Begin Source File - -SOURCE=.\once.c -# End Source File -# Begin Source File - -SOURCE=.\os.c -# End Source File -# Begin Source File - -SOURCE=.\resource.c -# End Source File -# Begin Source File - -SOURCE=.\socket.c -# End Source File -# Begin Source File - -SOURCE=.\strerror.c -# End Source File -# Begin Source File - -SOURCE=.\stdio.c -# End Source File -# Begin Source File - -SOURCE=.\stdtime.c -# End Source File -# Begin Source File - -SOURCE=.\syslog.c -# End Source File -# Begin Source File - -SOURCE=.\thread.c -# End Source File -# Begin Source File - -SOURCE=.\time.c -# End Source File -# Begin Source File - -SOURCE=.\version.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\include\isc\app.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\assertions.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\backtrace.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\backtrace-emptytbl.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\base32.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\base64.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\bind_registry.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\bindevt.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\bitstring.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\boolean.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\buffer.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\bufferlist.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\commandline.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\condition.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\config.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\dir.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\entropy.h -# End Source File -# Begin Source File - -SOURCE=.\errno2result.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\error.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\event.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\eventclass.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\file.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\formatcheck.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\fsaccess.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\hash.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\heap.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\hex.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\hmacmd5.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\hmacsha.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\httpd.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\int.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\interfaceiter.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\ipv6.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\iterated_hash.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\keyboard.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\lang.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\lex.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\lfsr.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\lib.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\list.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\log.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\magic.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\md5.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\mem.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\msgcat.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\msioctl.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\mutex.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\mutexblock.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\net.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\netaddr.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\netscope.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\netdb.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\ntpaths.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\offset.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\once.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\ondestroy.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\parseint.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\portset.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\os.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\platform.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\print.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\quota.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\radix.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\random.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\ratelimiter.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\refcount.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\region.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\resource.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\result.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\resultclass.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\rwlock.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\serial.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\sha1.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\sha2.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\sockaddr.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\socket.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\stats.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\stdio.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\strerror.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\stdtime.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\string.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\symtab.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\syslog.h -# End Source File -# Begin Source File - -SOURCE=.\syslog.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\task.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\taskpool.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\thread.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\time.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\timer.h -# End Source File -# Begin Source File - -SOURCE=.\include\isc\win32os.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\types.h -# End Source File -# Begin Source File - -SOURCE=.\unistd.h -# End Source File -# Begin Source File - -SOURCE=..\include\isc\util.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\versions.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# Begin Group "Main Isc Lib" - -# PROP Default_Filter "c" -# Begin Source File - -SOURCE=..\assertions.c -# End Source File -# Begin Source File - -SOURCE=..\backtrace.c -# End Source File -# Begin Source File - -SOURCE=..\backtrace-emptytbl.c -# End Source File -# Begin Source File - -SOURCE=..\base32.c -# End Source File -# Begin Source File - -SOURCE=..\base64.c -# End Source File -# Begin Source File - -SOURCE=..\bitstring.c -# End Source File -# Begin Source File - -SOURCE=..\buffer.c -# End Source File -# Begin Source File - -SOURCE=..\bufferlist.c -# End Source File -# Begin Source File - -SOURCE=..\commandline.c -# End Source File -# Begin Source File - -SOURCE=..\error.c -# End Source File -# Begin Source File - -SOURCE=..\event.c -# End Source File -# Begin Source File - -SOURCE=..\hash.c -# End Source File -# Begin Source File - -SOURCE=..\heap.c -# End Source File -# Begin Source File - -SOURCE=..\hex.c -# End Source File -# Begin Source File - -SOURCE=..\hmacmd5.c -# End Source File -# Begin Source File - -SOURCE=..\hmacsha.c -# End Source File -# Begin Source File - -SOURCE=..\httpd.c -# End Source File -# Begin Source File - -SOURCE=..\inet_aton.c -# End Source File -# Begin Source File - -SOURCE=..\inet_ntop.c -# End Source File -# Begin Source File - -SOURCE=..\inet_pton.c -# End Source File -# Begin Source File - -SOURCE=..\lex.c -# End Source File -# Begin Source File - -SOURCE=..\lfsr.c -# End Source File -# Begin Source File - -SOURCE=..\lib.c -# End Source File -# Begin Source File - -SOURCE=..\log.c -# End Source File -# Begin Source File - -SOURCE=..\md5.c -# End Source File -# Begin Source File - -SOURCE=..\mem.c -# End Source File -# Begin Source File - -SOURCE=..\nls\msgcat.c -# End Source File -# Begin Source File - -SOURCE=..\mutexblock.c -# End Source File -# Begin Source File - -SOURCE=..\netaddr.c -# End Source File -# Begin Source File - -SOURCE=..\netscope.c -# End Source File -# Begin Source File - -SOURCE=..\ondestroy.c -# End Source File -# Begin Source File - -SOURCE=..\parseint.c -# End Source File -# Begin Source File - -SOURCE=..\portset.c -# End Source File -# Begin Source File - -SOURCE=..\quota.c -# End Source File -# Begin Source File - -SOURCE=..\radix.c -# End Source File -# Begin Source File - -SOURCE=..\random.c -# End Source File -# Begin Source File - -SOURCE=..\ratelimiter.c -# End Source File -# Begin Source File - -SOURCE=..\refcount.c -# End Source File -# Begin Source File - -SOURCE=..\region.c -# End Source File -# Begin Source File - -SOURCE=..\result.c -# End Source File -# Begin Source File - -SOURCE=..\rwlock.c -# End Source File -# Begin Source File - -SOURCE=..\serial.c -# End Source File -# Begin Source File - -SOURCE=..\sha1.c -# End Source File -# Begin Source File - -SOURCE=..\sha2.c -# End Source File -# Begin Source File - -SOURCE=..\sockaddr.c -# End Source File -# Begin Source File - -SOURCE=..\stats.c -# End Source File -# Begin Source File - -SOURCE=..\string.c -# End Source File -# Begin Source File - -SOURCE=..\symtab.c -# End Source File -# Begin Source File - -SOURCE=..\task.c -# End Source File -# Begin Source File - -SOURCE=..\taskpool.c -# End Source File -# Begin Source File - -SOURCE=..\timer.c -# End Source File -# Begin Source File - -SOURCE=.\win32os.c -# End Source File -# End Group -# Begin Source File - -SOURCE=..\noatomic\include\atomic.h -# End Source File -# Begin Source File - -SOURCE=.\libisc.def -# End Source File -# End Target -# End Project diff --git a/lib/isc/win32/libisc.dsw b/lib/isc/win32/libisc.dsw deleted file mode 100644 index c66c56e531d1..000000000000 --- a/lib/isc/win32/libisc.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "libisc"=".\libisc.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/lib/isc/win32/libisc.mak b/lib/isc/win32/libisc.mak deleted file mode 100644 index e15b46b3f862..000000000000 --- a/lib/isc/win32/libisc.mak +++ /dev/null @@ -1,2055 +0,0 @@ -# Microsoft Developer Studio Generated NMAKE File, Based on libisc.dsp -!IF "$(CFG)" == "" -CFG=libisc - Win32 Debug -!MESSAGE No configuration specified. Defaulting to libisc - Win32 Debug. -!ENDIF - -!IF "$(CFG)" != "libisc - Win32 Release" && "$(CFG)" != "libisc - Win32 Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libisc.mak" CFG="libisc - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libisc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libisc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF - -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe -LIBXML=../../../../libxml2-2.7.3/win32/bin.msvc/libxml2.lib - -!IF "$(CFG)" == "libisc - Win32 Release" -_VC_MANIFEST_INC=0 -_VC_MANIFEST_BASENAME=__VC80 -!ELSE -_VC_MANIFEST_INC=1 -_VC_MANIFEST_BASENAME=__VC80.Debug -!ENDIF - -#################################################### -# Specifying name of temporary resource file used only in incremental builds: - -!if "$(_VC_MANIFEST_INC)" == "1" -_VC_MANIFEST_AUTO_RES=$(_VC_MANIFEST_BASENAME).auto.res -!else -_VC_MANIFEST_AUTO_RES= -!endif - -#################################################### -# _VC_MANIFEST_EMBED_EXE - command to embed manifest in EXE: - -!if "$(_VC_MANIFEST_INC)" == "1" - -#MT_SPECIAL_RETURN=1090650113 -#MT_SPECIAL_SWITCH=-notify_resource_update -MT_SPECIAL_RETURN=0 -MT_SPECIAL_SWITCH= -_VC_MANIFEST_EMBED_EXE= \ -if exist $@.manifest mt.exe -manifest $@.manifest -out:$(_VC_MANIFEST_BASENAME).auto.manifest $(MT_SPECIAL_SWITCH) & \ -if "%ERRORLEVEL%" == "$(MT_SPECIAL_RETURN)" \ -rc /r $(_VC_MANIFEST_BASENAME).auto.rc & \ -link $** /out:$@ $(LFLAGS) - -!else - -_VC_MANIFEST_EMBED_EXE= \ -if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;1 - -!endif - -#################################################### -# _VC_MANIFEST_EMBED_DLL - command to embed manifest in DLL: - -!if "$(_VC_MANIFEST_INC)" == "1" - -#MT_SPECIAL_RETURN=1090650113 -#MT_SPECIAL_SWITCH=-notify_resource_update -MT_SPECIAL_RETURN=0 -MT_SPECIAL_SWITCH= -_VC_MANIFEST_EMBED_EXE= \ -if exist $@.manifest mt.exe -manifest $@.manifest -out:$(_VC_MANIFEST_BASENAME).auto.manifest $(MT_SPECIAL_SWITCH) & \ -if "%ERRORLEVEL%" == "$(MT_SPECIAL_RETURN)" \ -rc /r $(_VC_MANIFEST_BASENAME).auto.rc & \ -link $** /out:$@ $(LFLAGS) - -!else - -_VC_MANIFEST_EMBED_EXE= \ -if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;2 - -!endif -#################################################### -# _VC_MANIFEST_CLEAN - command to clean resources files generated temporarily: - -!if "$(_VC_MANIFEST_INC)" == "1" - -_VC_MANIFEST_CLEAN=-del $(_VC_MANIFEST_BASENAME).auto.res \ - $(_VC_MANIFEST_BASENAME).auto.rc \ - $(_VC_MANIFEST_BASENAME).auto.manifest - -!else - -_VC_MANIFEST_CLEAN= - -!endif - -!IF "$(CFG)" == "libisc - Win32 Release" - -OUTDIR=.\Release -INTDIR=.\Release - -ALL : "..\..\..\Build\Release\libisc.dll" - - -CLEAN : - -@erase "$(INTDIR)\app.obj" - -@erase "$(INTDIR)\assertions.obj" - -@erase "$(INTDIR)\backtrace.obj" - -@erase "$(INTDIR)\backtrace-emptytbl.obj" - -@erase "$(INTDIR)\base32.obj" - -@erase "$(INTDIR)\base64.obj" - -@erase "$(INTDIR)\bitstring.obj" - -@erase "$(INTDIR)\buffer.obj" - -@erase "$(INTDIR)\bufferlist.obj" - -@erase "$(INTDIR)\commandline.obj" - -@erase "$(INTDIR)\condition.obj" - -@erase "$(INTDIR)\dir.obj" - -@erase "$(INTDIR)\DLLMain.obj" - -@erase "$(INTDIR)\entropy.obj" - -@erase "$(INTDIR)\errno2result.obj" - -@erase "$(INTDIR)\error.obj" - -@erase "$(INTDIR)\event.obj" - -@erase "$(INTDIR)\file.obj" - -@erase "$(INTDIR)\fsaccess.obj" - -@erase "$(INTDIR)\hash.obj" - -@erase "$(INTDIR)\heap.obj" - -@erase "$(INTDIR)\hex.obj" - -@erase "$(INTDIR)\hmacmd5.obj" - -@erase "$(INTDIR)\hmacsha.obj" - -@erase "$(INTDIR)\httpd.obj" - -@erase "$(INTDIR)\inet_aton.obj" - -@erase "$(INTDIR)\inet_ntop.obj" - -@erase "$(INTDIR)\inet_pton.obj" - -@erase "$(INTDIR)\interfaceiter.obj" - -@erase "$(INTDIR)\ipv6.obj" - -@erase "$(INTDIR)\iterated_hash.obj" - -@erase "$(INTDIR)\keyboard.obj" - -@erase "$(INTDIR)\lex.obj" - -@erase "$(INTDIR)\lfsr.obj" - -@erase "$(INTDIR)\lib.obj" - -@erase "$(INTDIR)\log.obj" - -@erase "$(INTDIR)\md5.obj" - -@erase "$(INTDIR)\mem.obj" - -@erase "$(INTDIR)\msgcat.obj" - -@erase "$(INTDIR)\mutexblock.obj" - -@erase "$(INTDIR)\net.obj" - -@erase "$(INTDIR)\netaddr.obj" - -@erase "$(INTDIR)\netscope.obj" - -@erase "$(INTDIR)\ntpaths.obj" - -@erase "$(INTDIR)\once.obj" - -@erase "$(INTDIR)\ondestroy.obj" - -@erase "$(INTDIR)\os.obj" - -@erase "$(INTDIR)\parseint.obj" - -@erase "$(INTDIR)\portset.obj" - -@erase "$(INTDIR)\quota.obj" - -@erase "$(INTDIR)\radix.obj" - -@erase "$(INTDIR)\random.obj" - -@erase "$(INTDIR)\ratelimiter.obj" - -@erase "$(INTDIR)\refcount.obj" - -@erase "$(INTDIR)\region.obj" - -@erase "$(INTDIR)\resource.obj" - -@erase "$(INTDIR)\result.obj" - -@erase "$(INTDIR)\rwlock.obj" - -@erase "$(INTDIR)\serial.obj" - -@erase "$(INTDIR)\sha1.obj" - -@erase "$(INTDIR)\sha2.obj" - -@erase "$(INTDIR)\sockaddr.obj" - -@erase "$(INTDIR)\socket.obj" - -@erase "$(INTDIR)\stats.obj" - -@erase "$(INTDIR)\stdio.obj" - -@erase "$(INTDIR)\stdtime.obj" - -@erase "$(INTDIR)\strerror.obj" - -@erase "$(INTDIR)\string.obj" - -@erase "$(INTDIR)\symtab.obj" - -@erase "$(INTDIR)\syslog.obj" - -@erase "$(INTDIR)\task.obj" - -@erase "$(INTDIR)\taskpool.obj" - -@erase "$(INTDIR)\thread.obj" - -@erase "$(INTDIR)\time.obj" - -@erase "$(INTDIR)\timer.obj" - -@erase "$(INTDIR)\vc60.idb" - -@erase "$(INTDIR)\version.obj" - -@erase "$(INTDIR)\win32os.obj" - -@erase "$(OUTDIR)\libisc.exp" - -@erase "$(OUTDIR)\libisc.lib" - -@erase "..\..\..\Build\Release\libisc.dll" - -@$(_VC_MANIFEST_CLEAN) - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "./" /I "../../../" /I "include" /I "../include" /I "../../../lib/isc/noatomic/include" /I "win32" /I "../../isccfg/include" /I "../../../../libxml2-2.7.3/include" /D "BIND9" /D "WIN32" /D "NDEBUG" /D "__STDC__" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBISC_EXPORTS" /Fp"$(INTDIR)\libisc.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c -MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\libisc.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -LINK32_FLAGS=user32.lib advapi32.lib ws2_32.lib $(LIBXML) /nologo /dll /incremental:no /pdb:"$(OUTDIR)\libisc.pdb" /machine:I386 /def:".\libisc.def" /out:"../../../Build/Release/libisc.dll" /implib:"$(OUTDIR)\libisc.lib" -DEF_FILE= \ - ".\libisc.def" -LINK32_OBJS= \ - "$(INTDIR)\app.obj" \ - "$(INTDIR)\condition.obj" \ - "$(INTDIR)\dir.obj" \ - "$(INTDIR)\DLLMain.obj" \ - "$(INTDIR)\entropy.obj" \ - "$(INTDIR)\errno2result.obj" \ - "$(INTDIR)\file.obj" \ - "$(INTDIR)\fsaccess.obj" \ - "$(INTDIR)\interfaceiter.obj" \ - "$(INTDIR)\ipv6.obj" \ - "$(INTDIR)\iterated_hash.obj" \ - "$(INTDIR)\keyboard.obj" \ - "$(INTDIR)\net.obj" \ - "$(INTDIR)\ntpaths.obj" \ - "$(INTDIR)\once.obj" \ - "$(INTDIR)\os.obj" \ - "$(INTDIR)\resource.obj" \ - "$(INTDIR)\socket.obj" \ - "$(INTDIR)\stdio.obj" \ - "$(INTDIR)\stdtime.obj" \ - "$(INTDIR)\strerror.obj" \ - "$(INTDIR)\syslog.obj" \ - "$(INTDIR)\thread.obj" \ - "$(INTDIR)\time.obj" \ - "$(INTDIR)\version.obj" \ - "$(INTDIR)\win32os.obj" \ - "$(INTDIR)\assertions.obj" \ - "$(INTDIR)\backtrace.obj" \ - "$(INTDIR)\backtrace-emptytbl.obj" \ - "$(INTDIR)\base32.obj" \ - "$(INTDIR)\base64.obj" \ - "$(INTDIR)\bitstring.obj" \ - "$(INTDIR)\buffer.obj" \ - "$(INTDIR)\bufferlist.obj" \ - "$(INTDIR)\commandline.obj" \ - "$(INTDIR)\error.obj" \ - "$(INTDIR)\event.obj" \ - "$(INTDIR)\hash.obj" \ - "$(INTDIR)\heap.obj" \ - "$(INTDIR)\hex.obj" \ - "$(INTDIR)\hmacmd5.obj" \ - "$(INTDIR)\hmacsha.obj" \ - "$(INTDIR)\httpd.obj" \ - "$(INTDIR)\inet_aton.obj" \ - "$(INTDIR)\inet_ntop.obj" \ - "$(INTDIR)\inet_pton.obj" \ - "$(INTDIR)\lex.obj" \ - "$(INTDIR)\lfsr.obj" \ - "$(INTDIR)\lib.obj" \ - "$(INTDIR)\log.obj" \ - "$(INTDIR)\md5.obj" \ - "$(INTDIR)\mem.obj" \ - "$(INTDIR)\msgcat.obj" \ - "$(INTDIR)\mutexblock.obj" \ - "$(INTDIR)\netaddr.obj" \ - "$(INTDIR)\netscope.obj" \ - "$(INTDIR)\ondestroy.obj" \ - "$(INTDIR)\quota.obj" \ - "$(INTDIR)\radix.obj" \ - "$(INTDIR)\random.obj" \ - "$(INTDIR)\ratelimiter.obj" \ - "$(INTDIR)\refcount.obj" \ - "$(INTDIR)\result.obj" \ - "$(INTDIR)\rwlock.obj" \ - "$(INTDIR)\serial.obj" \ - "$(INTDIR)\sha1.obj" \ - "$(INTDIR)\sha2.obj" \ - "$(INTDIR)\sockaddr.obj" \ - "$(INTDIR)\stats.obj" \ - "$(INTDIR)\string.obj" \ - "$(INTDIR)\symtab.obj" \ - "$(INTDIR)\task.obj" \ - "$(INTDIR)\taskpool.obj" \ - "$(INTDIR)\timer.obj" \ - "$(INTDIR)\parseint.obj" \ - "$(INTDIR)\portset.obj" \ - "$(INTDIR)\region.obj" - -"..\..\..\Build\Release\libisc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - $(_VC_MANIFEST_EMBED_DLL) - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - -OUTDIR=.\Debug -INTDIR=.\Debug -# Begin Custom Macros -OutDir=.\Debug -# End Custom Macros - -ALL : "..\..\..\Build\Debug\libisc.dll" "$(OUTDIR)\libisc.bsc" - - -CLEAN : - -@erase "$(INTDIR)\app.obj" - -@erase "$(INTDIR)\app.sbr" - -@erase "$(INTDIR)\assertions.obj" - -@erase "$(INTDIR)\assertions.sbr" - -@erase "$(INTDIR)\backtrace.obj" - -@erase "$(INTDIR)\backtrace-emptytbl.obj" - -@erase "$(INTDIR)\backtrace.sbr" - -@erase "$(INTDIR)\backtrace-emptytbl.sbr" - -@erase "$(INTDIR)\base32.obj" - -@erase "$(INTDIR)\base32.sbr" - -@erase "$(INTDIR)\base64.obj" - -@erase "$(INTDIR)\base64.sbr" - -@erase "$(INTDIR)\bitstring.obj" - -@erase "$(INTDIR)\bitstring.sbr" - -@erase "$(INTDIR)\buffer.obj" - -@erase "$(INTDIR)\buffer.sbr" - -@erase "$(INTDIR)\bufferlist.obj" - -@erase "$(INTDIR)\bufferlist.sbr" - -@erase "$(INTDIR)\commandline.obj" - -@erase "$(INTDIR)\commandline.sbr" - -@erase "$(INTDIR)\condition.obj" - -@erase "$(INTDIR)\condition.sbr" - -@erase "$(INTDIR)\dir.obj" - -@erase "$(INTDIR)\dir.sbr" - -@erase "$(INTDIR)\DLLMain.obj" - -@erase "$(INTDIR)\DLLMain.sbr" - -@erase "$(INTDIR)\entropy.obj" - -@erase "$(INTDIR)\entropy.sbr" - -@erase "$(INTDIR)\errno2result.obj" - -@erase "$(INTDIR)\errno2result.sbr" - -@erase "$(INTDIR)\error.obj" - -@erase "$(INTDIR)\error.sbr" - -@erase "$(INTDIR)\event.obj" - -@erase "$(INTDIR)\event.sbr" - -@erase "$(INTDIR)\file.obj" - -@erase "$(INTDIR)\file.sbr" - -@erase "$(INTDIR)\fsaccess.obj" - -@erase "$(INTDIR)\fsaccess.sbr" - -@erase "$(INTDIR)\hash.obj" - -@erase "$(INTDIR)\hash.sbr" - -@erase "$(INTDIR)\heap.obj" - -@erase "$(INTDIR)\heap.sbr" - -@erase "$(INTDIR)\hex.obj" - -@erase "$(INTDIR)\hex.sbr" - -@erase "$(INTDIR)\hmacmd5.obj" - -@erase "$(INTDIR)\hmacmd5.sbr" - -@erase "$(INTDIR)\hmacsha.obj" - -@erase "$(INTDIR)\hmacsha.sbr" - -@erase "$(INTDIR)\httpd.obj" - -@erase "$(INTDIR)\httpd.sbr" - -@erase "$(INTDIR)\inet_aton.obj" - -@erase "$(INTDIR)\inet_aton.sbr" - -@erase "$(INTDIR)\inet_ntop.obj" - -@erase "$(INTDIR)\inet_ntop.sbr" - -@erase "$(INTDIR)\inet_pton.obj" - -@erase "$(INTDIR)\inet_pton.sbr" - -@erase "$(INTDIR)\interfaceiter.obj" - -@erase "$(INTDIR)\interfaceiter.sbr" - -@erase "$(INTDIR)\ipv6.obj" - -@erase "$(INTDIR)\ipv6.sbr" - -@erase "$(INTDIR)\iterated_hash.obj" - -@erase "$(INTDIR)\iterated_hash.sbr" - -@erase "$(INTDIR)\keyboard.obj" - -@erase "$(INTDIR)\keyboard.sbr" - -@erase "$(INTDIR)\lex.obj" - -@erase "$(INTDIR)\lex.sbr" - -@erase "$(INTDIR)\lfsr.obj" - -@erase "$(INTDIR)\lfsr.sbr" - -@erase "$(INTDIR)\lib.obj" - -@erase "$(INTDIR)\lib.sbr" - -@erase "$(INTDIR)\log.obj" - -@erase "$(INTDIR)\log.sbr" - -@erase "$(INTDIR)\md5.obj" - -@erase "$(INTDIR)\md5.sbr" - -@erase "$(INTDIR)\mem.obj" - -@erase "$(INTDIR)\mem.sbr" - -@erase "$(INTDIR)\msgcat.obj" - -@erase "$(INTDIR)\msgcat.sbr" - -@erase "$(INTDIR)\mutexblock.obj" - -@erase "$(INTDIR)\mutexblock.sbr" - -@erase "$(INTDIR)\net.obj" - -@erase "$(INTDIR)\net.sbr" - -@erase "$(INTDIR)\netaddr.obj" - -@erase "$(INTDIR)\netaddr.sbr" - -@erase "$(INTDIR)\netscope.obj" - -@erase "$(INTDIR)\netscope.sbr" - -@erase "$(INTDIR)\ntpaths.obj" - -@erase "$(INTDIR)\ntpaths.sbr" - -@erase "$(INTDIR)\once.obj" - -@erase "$(INTDIR)\once.sbr" - -@erase "$(INTDIR)\ondestroy.obj" - -@erase "$(INTDIR)\ondestroy.sbr" - -@erase "$(INTDIR)\os.obj" - -@erase "$(INTDIR)\os.sbr" - -@erase "$(INTDIR)\parseint.obj" - -@erase "$(INTDIR)\parseint.sbr" - -@erase "$(INTDIR)\portset.obj" - -@erase "$(INTDIR)\portset.sbr" - -@erase "$(INTDIR)\quota.obj" - -@erase "$(INTDIR)\quota.sbr" - -@erase "$(INTDIR)\radix.obj" - -@erase "$(INTDIR)\radix.sbr" - -@erase "$(INTDIR)\random.obj" - -@erase "$(INTDIR)\random.sbr" - -@erase "$(INTDIR)\ratelimiter.obj" - -@erase "$(INTDIR)\ratelimiter.sbr" - -@erase "$(INTDIR)\refcount.obj" - -@erase "$(INTDIR)\refcount.sbr" - -@erase "$(INTDIR)\region.obj" - -@erase "$(INTDIR)\region.sbr" - -@erase "$(INTDIR)\resource.obj" - -@erase "$(INTDIR)\resource.sbr" - -@erase "$(INTDIR)\result.obj" - -@erase "$(INTDIR)\result.sbr" - -@erase "$(INTDIR)\rwlock.obj" - -@erase "$(INTDIR)\rwlock.sbr" - -@erase "$(INTDIR)\serial.obj" - -@erase "$(INTDIR)\serial.sbr" - -@erase "$(INTDIR)\sha1.obj" - -@erase "$(INTDIR)\sha1.sbr" - -@erase "$(INTDIR)\sha2.obj" - -@erase "$(INTDIR)\sha2.sbr" - -@erase "$(INTDIR)\sockaddr.obj" - -@erase "$(INTDIR)\sockaddr.sbr" - -@erase "$(INTDIR)\socket.obj" - -@erase "$(INTDIR)\socket.sbr" - -@erase "$(INTDIR)\stats.obj" - -@erase "$(INTDIR)\stats.sbr" - -@erase "$(INTDIR)\stdio.obj" - -@erase "$(INTDIR)\stdio.sbr" - -@erase "$(INTDIR)\stdtime.obj" - -@erase "$(INTDIR)\stdtime.sbr" - -@erase "$(INTDIR)\strerror.obj" - -@erase "$(INTDIR)\strerror.sbr" - -@erase "$(INTDIR)\string.obj" - -@erase "$(INTDIR)\string.sbr" - -@erase "$(INTDIR)\symtab.obj" - -@erase "$(INTDIR)\symtab.sbr" - -@erase "$(INTDIR)\syslog.obj" - -@erase "$(INTDIR)\syslog.sbr" - -@erase "$(INTDIR)\task.obj" - -@erase "$(INTDIR)\task.sbr" - -@erase "$(INTDIR)\taskpool.obj" - -@erase "$(INTDIR)\taskpool.sbr" - -@erase "$(INTDIR)\thread.obj" - -@erase "$(INTDIR)\thread.sbr" - -@erase "$(INTDIR)\time.obj" - -@erase "$(INTDIR)\time.sbr" - -@erase "$(INTDIR)\timer.obj" - -@erase "$(INTDIR)\timer.sbr" - -@erase "$(INTDIR)\vc60.idb" - -@erase "$(INTDIR)\vc60.pdb" - -@erase "$(INTDIR)\version.obj" - -@erase "$(INTDIR)\version.sbr" - -@erase "$(INTDIR)\win32os.obj" - -@erase "$(INTDIR)\win32os.sbr" - -@erase "$(OUTDIR)\libisc.bsc" - -@erase "$(OUTDIR)\libisc.exp" - -@erase "$(OUTDIR)\libisc.lib" - -@erase "$(OUTDIR)\libisc.map" - -@erase "$(OUTDIR)\libisc.pdb" - -@erase "..\..\..\Build\Debug\libisc.dll" - -@erase "..\..\..\Build\Debug\libisc.ilk" - -@$(_VC_MANIFEST_CLEAN) - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od /I "./" /I "../../../" /I "include" /I "../include" /I "../../../lib/isc/noatomic/include" /I "win32" /I "../../isccfg/include" /I "../../../../libxml2-2.7.3/include" /D "BIND9" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__STDC__" /D "_MBCS" /D "_USRDLL" /D "LIBISC_EXPORTS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\libisc.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c -MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\libisc.bsc" -BSC32_SBRS= \ - "$(INTDIR)\app.sbr" \ - "$(INTDIR)\condition.sbr" \ - "$(INTDIR)\dir.sbr" \ - "$(INTDIR)\DLLMain.sbr" \ - "$(INTDIR)\entropy.sbr" \ - "$(INTDIR)\errno2result.sbr" \ - "$(INTDIR)\file.sbr" \ - "$(INTDIR)\fsaccess.sbr" \ - "$(INTDIR)\interfaceiter.sbr" \ - "$(INTDIR)\ipv6.sbr" \ - "$(INTDIR)\iterated_hash.sbr" \ - "$(INTDIR)\keyboard.sbr" \ - "$(INTDIR)\net.sbr" \ - "$(INTDIR)\ntpaths.sbr" \ - "$(INTDIR)\once.sbr" \ - "$(INTDIR)\os.sbr" \ - "$(INTDIR)\resource.sbr" \ - "$(INTDIR)\socket.sbr" \ - "$(INTDIR)\stdio.sbr" \ - "$(INTDIR)\stdtime.sbr" \ - "$(INTDIR)\strerror.sbr" \ - "$(INTDIR)\syslog.sbr" \ - "$(INTDIR)\thread.sbr" \ - "$(INTDIR)\time.sbr" \ - "$(INTDIR)\version.sbr" \ - "$(INTDIR)\win32os.sbr" \ - "$(INTDIR)\assertions.sbr" \ - "$(INTDIR)\backtrace.sbr" \ - "$(INTDIR)\backtrace-emptytbl.sbr" \ - "$(INTDIR)\base32.sbr" \ - "$(INTDIR)\base64.sbr" \ - "$(INTDIR)\bitstring.sbr" \ - "$(INTDIR)\buffer.sbr" \ - "$(INTDIR)\bufferlist.sbr" \ - "$(INTDIR)\commandline.sbr" \ - "$(INTDIR)\error.sbr" \ - "$(INTDIR)\event.sbr" \ - "$(INTDIR)\hash.sbr" \ - "$(INTDIR)\heap.sbr" \ - "$(INTDIR)\hex.sbr" \ - "$(INTDIR)\hmacmd5.sbr" \ - "$(INTDIR)\hmacsha.sbr" \ - "$(INTDIR)\httpd.sbr" \ - "$(INTDIR)\inet_aton.sbr" \ - "$(INTDIR)\inet_ntop.sbr" \ - "$(INTDIR)\inet_pton.sbr" \ - "$(INTDIR)\lex.sbr" \ - "$(INTDIR)\lfsr.sbr" \ - "$(INTDIR)\lib.sbr" \ - "$(INTDIR)\log.sbr" \ - "$(INTDIR)\md5.sbr" \ - "$(INTDIR)\mem.sbr" \ - "$(INTDIR)\msgcat.sbr" \ - "$(INTDIR)\mutexblock.sbr" \ - "$(INTDIR)\netaddr.sbr" \ - "$(INTDIR)\netscope.sbr" \ - "$(INTDIR)\ondestroy.sbr" \ - "$(INTDIR)\quota.sbr" \ - "$(INTDIR)\radix.sbr" \ - "$(INTDIR)\random.sbr" \ - "$(INTDIR)\ratelimiter.sbr" \ - "$(INTDIR)\refcount.sbr" \ - "$(INTDIR)\result.sbr" \ - "$(INTDIR)\rwlock.sbr" \ - "$(INTDIR)\serial.sbr" \ - "$(INTDIR)\sha1.sbr" \ - "$(INTDIR)\sha2.sbr" \ - "$(INTDIR)\sockaddr.sbr" \ - "$(INTDIR)\stats.sbr" \ - "$(INTDIR)\string.sbr" \ - "$(INTDIR)\symtab.sbr" \ - "$(INTDIR)\task.sbr" \ - "$(INTDIR)\taskpool.sbr" \ - "$(INTDIR)\timer.sbr" \ - "$(INTDIR)\parseint.sbr" \ - "$(INTDIR)\portset.sbr" \ - "$(INTDIR)\region.sbr" - -"$(OUTDIR)\libisc.bsc" : "$(OUTDIR)" $(BSC32_SBRS) - $(BSC32) @<< - $(BSC32_FLAGS) $(BSC32_SBRS) -<< - -LINK32=link.exe -LINK32_FLAGS=user32.lib advapi32.lib ws2_32.lib $(LIBXML) /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\libisc.pdb" /map:"$(INTDIR)\libisc.map" /debug /machine:I386 /def:".\libisc.def" /out:"../../../Build/Debug/libisc.dll" /implib:"$(OUTDIR)\libisc.lib" /pdbtype:sept -DEF_FILE= \ - ".\libisc.def" -LINK32_OBJS= \ - "$(INTDIR)\app.obj" \ - "$(INTDIR)\condition.obj" \ - "$(INTDIR)\dir.obj" \ - "$(INTDIR)\DLLMain.obj" \ - "$(INTDIR)\entropy.obj" \ - "$(INTDIR)\errno2result.obj" \ - "$(INTDIR)\file.obj" \ - "$(INTDIR)\fsaccess.obj" \ - "$(INTDIR)\interfaceiter.obj" \ - "$(INTDIR)\ipv6.obj" \ - "$(INTDIR)\iterated_hash.obj" \ - "$(INTDIR)\keyboard.obj" \ - "$(INTDIR)\net.obj" \ - "$(INTDIR)\ntpaths.obj" \ - "$(INTDIR)\once.obj" \ - "$(INTDIR)\os.obj" \ - "$(INTDIR)\resource.obj" \ - "$(INTDIR)\socket.obj" \ - "$(INTDIR)\stdio.obj" \ - "$(INTDIR)\stdtime.obj" \ - "$(INTDIR)\strerror.obj" \ - "$(INTDIR)\syslog.obj" \ - "$(INTDIR)\thread.obj" \ - "$(INTDIR)\time.obj" \ - "$(INTDIR)\version.obj" \ - "$(INTDIR)\win32os.obj" \ - "$(INTDIR)\assertions.obj" \ - "$(INTDIR)\backtrace.obj" \ - "$(INTDIR)\backtrace-emptytbl.obj" \ - "$(INTDIR)\base32.obj" \ - "$(INTDIR)\base64.obj" \ - "$(INTDIR)\bitstring.obj" \ - "$(INTDIR)\buffer.obj" \ - "$(INTDIR)\bufferlist.obj" \ - "$(INTDIR)\commandline.obj" \ - "$(INTDIR)\error.obj" \ - "$(INTDIR)\event.obj" \ - "$(INTDIR)\hash.obj" \ - "$(INTDIR)\heap.obj" \ - "$(INTDIR)\hex.obj" \ - "$(INTDIR)\hmacmd5.obj" \ - "$(INTDIR)\hmacsha.obj" \ - "$(INTDIR)\httpd.obj" \ - "$(INTDIR)\inet_aton.obj" \ - "$(INTDIR)\inet_ntop.obj" \ - "$(INTDIR)\inet_pton.obj" \ - "$(INTDIR)\lex.obj" \ - "$(INTDIR)\lfsr.obj" \ - "$(INTDIR)\lib.obj" \ - "$(INTDIR)\log.obj" \ - "$(INTDIR)\md5.obj" \ - "$(INTDIR)\mem.obj" \ - "$(INTDIR)\msgcat.obj" \ - "$(INTDIR)\mutexblock.obj" \ - "$(INTDIR)\netaddr.obj" \ - "$(INTDIR)\netscope.obj" \ - "$(INTDIR)\ondestroy.obj" \ - "$(INTDIR)\quota.obj" \ - "$(INTDIR)\radix.obj" \ - "$(INTDIR)\random.obj" \ - "$(INTDIR)\ratelimiter.obj" \ - "$(INTDIR)\refcount.obj" \ - "$(INTDIR)\result.obj" \ - "$(INTDIR)\rwlock.obj" \ - "$(INTDIR)\serial.obj" \ - "$(INTDIR)\sha1.obj" \ - "$(INTDIR)\sha2.obj" \ - "$(INTDIR)\sockaddr.obj" \ - "$(INTDIR)\stats.obj" \ - "$(INTDIR)\string.obj" \ - "$(INTDIR)\symtab.obj" \ - "$(INTDIR)\task.obj" \ - "$(INTDIR)\taskpool.obj" \ - "$(INTDIR)\timer.obj" \ - "$(INTDIR)\parseint.obj" \ - "$(INTDIR)\portset.obj" \ - "$(INTDIR)\region.obj" - -"..\..\..\Build\Debug\libisc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - $(_VC_MANIFEST_EMBED_DLL) - -!ENDIF - -.c{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - - -!IF "$(NO_EXTERNAL_DEPS)" != "1" -!IF EXISTS("libisc.dep") -!INCLUDE "libisc.dep" -!ELSE -!MESSAGE Warning: cannot find "libisc.dep" -!ENDIF -!ENDIF - - -!IF "$(CFG)" == "libisc - Win32 Release" || "$(CFG)" == "libisc - Win32 Debug" -SOURCE=.\app.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\app.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\app.obj" "$(INTDIR)\app.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\condition.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\condition.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\condition.obj" "$(INTDIR)\condition.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\dir.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\dir.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\dir.obj" "$(INTDIR)\dir.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\DLLMain.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\DLLMain.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\DLLMain.obj" "$(INTDIR)\DLLMain.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\entropy.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\entropy.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\entropy.obj" "$(INTDIR)\entropy.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\errno2result.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\errno2result.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\errno2result.obj" "$(INTDIR)\errno2result.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\file.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\file.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\file.obj" "$(INTDIR)\file.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\fsaccess.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\fsaccess.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\fsaccess.obj" "$(INTDIR)\fsaccess.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\interfaceiter.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\interfaceiter.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\interfaceiter.obj" "$(INTDIR)\interfaceiter.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\ipv6.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\ipv6.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\ipv6.obj" "$(INTDIR)\ipv6.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - - -SOURCE=.\keyboard.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\keyboard.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\keyboard.obj" "$(INTDIR)\keyboard.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\net.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\net.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\net.obj" "$(INTDIR)\net.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\ntpaths.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\ntpaths.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\ntpaths.obj" "$(INTDIR)\ntpaths.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\once.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\once.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\once.obj" "$(INTDIR)\once.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\os.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\os.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\os.obj" "$(INTDIR)\os.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\resource.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\resource.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\resource.obj" "$(INTDIR)\resource.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\socket.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\socket.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\socket.obj" "$(INTDIR)\socket.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\stdio.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\stdio.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\stdio.obj" "$(INTDIR)\stdio.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\stdtime.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\stdtime.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\stdtime.obj" "$(INTDIR)\stdtime.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\strerror.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\strerror.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\strerror.obj" "$(INTDIR)\strerror.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\syslog.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\syslog.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\syslog.obj" "$(INTDIR)\syslog.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\thread.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\thread.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\thread.obj" "$(INTDIR)\thread.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\time.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\time.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\time.obj" "$(INTDIR)\time.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\version.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\version.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\version.obj" "$(INTDIR)\version.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\win32os.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\win32os.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\win32os.obj" "$(INTDIR)\win32os.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=..\assertions.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\assertions.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\assertions.obj" "$(INTDIR)\assertions.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\backtrace.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\backtrace.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\backtrace.obj" "$(INTDIR)\backtrace.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\backtrace-emptytbl.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\backtrace-emptytbl.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\backtrace-emptytbl.obj" "$(INTDIR)\backtrace-emptytbl.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\base32.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\base32.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\base32.obj" "$(INTDIR)\base32.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\base64.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\base64.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\base64.obj" "$(INTDIR)\base64.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\bitstring.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\bitstring.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\bitstring.obj" "$(INTDIR)\bitstring.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\buffer.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\buffer.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\buffer.obj" "$(INTDIR)\buffer.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\bufferlist.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\bufferlist.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\bufferlist.obj" "$(INTDIR)\bufferlist.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\commandline.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\commandline.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\commandline.obj" "$(INTDIR)\commandline.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\error.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\error.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\error.obj" "$(INTDIR)\error.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\event.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\event.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\event.obj" "$(INTDIR)\event.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\hash.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\hash.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\hash.obj" "$(INTDIR)\hash.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\heap.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\heap.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\heap.obj" "$(INTDIR)\heap.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\hex.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\hex.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\hex.obj" "$(INTDIR)\hex.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\hmacmd5.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\hmacmd5.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\hmacmd5.obj" "$(INTDIR)\hmacmd5.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\hmacsha.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\hmacsha.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\hmacsha.obj" "$(INTDIR)\hmacsha.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\httpd.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\httpd.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\httpd.obj" "$(INTDIR)\httpd.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\inet_aton.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\inet_aton.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\inet_aton.obj" "$(INTDIR)\inet_aton.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\inet_ntop.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\inet_ntop.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\inet_ntop.obj" "$(INTDIR)\inet_ntop.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\inet_pton.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\inet_pton.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\inet_pton.obj" "$(INTDIR)\inet_pton.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\iterated_hash.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\iterated_hash.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\iterated_hash.obj" "$(INTDIR)\iterated_hash.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\lex.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\lex.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\lex.obj" "$(INTDIR)\lex.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\lfsr.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\lfsr.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\lfsr.obj" "$(INTDIR)\lfsr.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\lib.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\lib.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\lib.obj" "$(INTDIR)\lib.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\log.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\log.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\log.obj" "$(INTDIR)\log.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\md5.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\md5.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\md5.obj" "$(INTDIR)\md5.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\mem.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\mem.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\mem.obj" "$(INTDIR)\mem.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\nls\msgcat.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\msgcat.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\msgcat.obj" "$(INTDIR)\msgcat.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\mutexblock.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\mutexblock.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\mutexblock.obj" "$(INTDIR)\mutexblock.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\netaddr.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\netaddr.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\netaddr.obj" "$(INTDIR)\netaddr.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\netscope.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\netscope.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\netscope.obj" "$(INTDIR)\netscope.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\ondestroy.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\ondestroy.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\ondestroy.obj" "$(INTDIR)\ondestroy.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\parseint.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\parseint.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\parseint.obj" "$(INTDIR)\parseint.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\portset.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\portset.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\portset.obj" "$(INTDIR)\portset.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\quota.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\quota.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\quota.obj" "$(INTDIR)\quota.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\radix.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\radix.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\radix.obj" "$(INTDIR)\radix.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\random.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\random.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\random.obj" "$(INTDIR)\random.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\ratelimiter.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\ratelimiter.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\ratelimiter.obj" "$(INTDIR)\ratelimiter.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\refcount.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\refcount.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\refcount.obj" "$(INTDIR)\refcount.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\region.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\region.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\region.obj" "$(INTDIR)\region.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\result.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\result.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\result.obj" "$(INTDIR)\result.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\rwlock.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\rwlock.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\rwlock.obj" "$(INTDIR)\rwlock.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\serial.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\serial.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\serial.obj" "$(INTDIR)\serial.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\sha1.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\sha1.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\sha1.obj" "$(INTDIR)\sha1.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\sha2.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\sha2.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\sha2.obj" "$(INTDIR)\sha2.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\sockaddr.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\sockaddr.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\sockaddr.obj" "$(INTDIR)\sockaddr.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\stats.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\stats.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\stats.obj" "$(INTDIR)\stats.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\string.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\string.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\string.obj" "$(INTDIR)\string.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\symtab.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\symtab.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\symtab.obj" "$(INTDIR)\symtab.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\task.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\task.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\task.obj" "$(INTDIR)\task.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\taskpool.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\taskpool.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\taskpool.obj" "$(INTDIR)\taskpool.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=..\timer.c - -!IF "$(CFG)" == "libisc - Win32 Release" - - -"$(INTDIR)\timer.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "libisc - Win32 Debug" - - -"$(INTDIR)\timer.obj" "$(INTDIR)\timer.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - - -!ENDIF - -#################################################### -# Commands to generate initial empty manifest file and the RC file -# that references it, and for generating the .res file: - -$(_VC_MANIFEST_BASENAME).auto.res : $(_VC_MANIFEST_BASENAME).auto.rc - -$(_VC_MANIFEST_BASENAME).auto.rc : $(_VC_MANIFEST_BASENAME).auto.manifest - type <<$@ -#include -1RT_MANIFEST"$(_VC_MANIFEST_BASENAME).auto.manifest" -<< KEEP - -$(_VC_MANIFEST_BASENAME).auto.manifest : - type <<$@ - - - -<< KEEP diff --git a/lib/isc/win32/netdb.h b/lib/isc/win32/netdb.h deleted file mode 100644 index f8d936a99f35..000000000000 --- a/lib/isc/win32/netdb.h +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright (C) 2004, 2006, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: netdb.h,v 1.9 2009/01/18 23:48:14 tbox Exp $ */ - -#ifndef NETDB_H -#define NETDB_H 1 - -#include -#include - -/* - * Define if does not declare struct addrinfo. - */ - -struct addrinfo { - int ai_flags; /* AI_PASSIVE, AI_CANONNAME */ - int ai_family; /* PF_xxx */ - int ai_socktype; /* SOCK_xxx */ - int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ - size_t ai_addrlen; /* Length of ai_addr */ - char *ai_canonname; /* Canonical name for hostname */ - struct sockaddr *ai_addr; /* Binary address */ - struct addrinfo *ai_next; /* Next structure in linked list */ -}; - - -/* - * Undefine all \#defines we are interested in as may or may not have - * defined them. - */ - -/* - * Error return codes from gethostbyname() and gethostbyaddr() - * (left in extern int h_errno). - */ - -#undef NETDB_INTERNAL -#undef NETDB_SUCCESS -#undef HOST_NOT_FOUND -#undef TRY_AGAIN -#undef NO_RECOVERY -#undef NO_DATA -#undef NO_ADDRESS - -#define NETDB_INTERNAL -1 /* see errno */ -#define NETDB_SUCCESS 0 /* no problem */ -#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */ -#define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL */ -#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ -#define NO_DATA 4 /* Valid name, no data record of requested type */ -#define NO_ADDRESS NO_DATA /* no address, look for MX record */ - -/* - * Error return codes from getaddrinfo() - */ - -#undef EAI_ADDRFAMILY -#undef EAI_AGAIN -#undef EAI_BADFLAGS -#undef EAI_FAIL -#undef EAI_FAMILY -#undef EAI_MEMORY -#undef EAI_NODATA -#undef EAI_NONAME -#undef EAI_SERVICE -#undef EAI_SOCKTYPE -#undef EAI_SYSTEM -#undef EAI_BADHINTS -#undef EAI_PROTOCOL -#undef EAI_MAX - -#define EAI_ADDRFAMILY 1 /* address family for hostname not supported */ -#define EAI_AGAIN 2 /* temporary failure in name resolution */ -#define EAI_BADFLAGS 3 /* invalid value for ai_flags */ -#define EAI_FAIL 4 /* non-recoverable failure in name resolution */ -#define EAI_FAMILY 5 /* ai_family not supported */ -#define EAI_MEMORY 6 /* memory allocation failure */ -#define EAI_NODATA 7 /* no address associated with hostname */ -#define EAI_NONAME 8 /* hostname nor servname provided, or not known */ -#define EAI_SERVICE 9 /* servname not supported for ai_socktype */ -#define EAI_SOCKTYPE 10 /* ai_socktype not supported */ -#define EAI_SYSTEM 11 /* system error returned in errno */ -#define EAI_BADHINTS 12 -#define EAI_PROTOCOL 13 -#define EAI_MAX 14 - -/* - * Flag values for getaddrinfo() - */ -#undef AI_PASSIVE -#undef AI_CANONNAME -#undef AI_NUMERICHOST - -#define AI_PASSIVE 0x00000001 -#define AI_CANONNAME 0x00000002 -#define AI_NUMERICHOST 0x00000004 - -/* - * Flag values for getipnodebyname() - */ -#undef AI_V4MAPPED -#undef AI_ALL -#undef AI_ADDRCONFIG -#undef AI_DEFAULT - -#define AI_V4MAPPED 0x00000008 -#define AI_ALL 0x00000010 -#define AI_ADDRCONFIG 0x00000020 -#define AI_DEFAULT (AI_V4MAPPED|AI_ADDRCONFIG) - -/* - * Constants for getnameinfo() - */ -#undef NI_MAXHOST -#undef NI_MAXSERV - -#define NI_MAXHOST 1025 -#define NI_MAXSERV 32 - -/* - * Flag values for getnameinfo() - */ -#undef NI_NOFQDN -#undef NI_NUMERICHOST -#undef NI_NAMEREQD -#undef NI_NUMERICSERV -#undef NI_DGRAM -#undef NI_NUMERICSCOPE - -#define NI_NOFQDN 0x00000001 -#define NI_NUMERICHOST 0x00000002 -#define NI_NAMEREQD 0x00000004 -#define NI_NUMERICSERV 0x00000008 -#define NI_DGRAM 0x00000010 -#define NI_NUMERICSCOPE 0x00000020 /*2553bis-00*/ - -/* - * Structures for getrrsetbyname() - */ -struct rdatainfo { - unsigned int rdi_length; - unsigned char *rdi_data; -}; - -struct rrsetinfo { - unsigned int rri_flags; - int rri_rdclass; - int rri_rdtype; - unsigned int rri_ttl; - unsigned int rri_nrdatas; - unsigned int rri_nsigs; - char *rri_name; - struct rdatainfo *rri_rdatas; - struct rdatainfo *rri_sigs; -}; - -/* - * Flags for getrrsetbyname() - */ -#define RRSET_VALIDATED 0x00000001 - /* Set was dnssec validated */ - -/* - * Return codes for getrrsetbyname() - */ -#define ERRSET_SUCCESS 0 -#define ERRSET_NOMEMORY 1 -#define ERRSET_FAIL 2 -#define ERRSET_INVAL 3 - - -#endif /* NETDB_H */ diff --git a/lib/isc/win32/ntgroups.c b/lib/isc/win32/ntgroups.c deleted file mode 100644 index 729cf07e74f0..000000000000 --- a/lib/isc/win32/ntgroups.c +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright (C) 2004, 2006, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: ntgroups.c,v 1.12 2009/09/29 23:48:04 tbox Exp $ */ - -/* - * The NT Groups have two groups that are not well documented and are - * not normally seen: None and Everyone. A user account belongs to - * any number of groups, but if it is not a member of any group then - * it is a member of the None Group. The None group is not listed - * anywhere. You cannot remove an account from the none group except - * by making it a member of some other group, The second group is the - * Everyone group. All accounts, no matter how many groups that they - * belong to, also belong to the Everyone group. You cannot remove an - * account from the Everyone group. - */ - -#ifndef UNICODE -#define UNICODE -#endif /* UNICODE */ - -/* - * Silence warnings. - */ -#define _CRT_SECURE_NO_DEPRECATE 1 - -#include -#include -#include - -#include -#include - -#define MAX_NAME_LENGTH 256 - -isc_result_t -isc_ntsecurity_getaccountgroups(char *username, char **GroupList, - unsigned int maxgroups, - unsigned int *totalGroups) { - LPGROUP_USERS_INFO_0 pTmpBuf; - LPLOCALGROUP_USERS_INFO_0 pTmpLBuf; - DWORD i; - LPLOCALGROUP_USERS_INFO_0 pBuf = NULL; - LPGROUP_USERS_INFO_0 pgrpBuf = NULL; - DWORD dwLevel = 0; - DWORD dwFlags = LG_INCLUDE_INDIRECT; - DWORD dwPrefMaxLen = MAX_PREFERRED_LENGTH; - DWORD dwEntriesRead = 0; - DWORD dwTotalEntries = 0; - NET_API_STATUS nStatus; - DWORD dwTotalCount = 0; - size_t retlen; - wchar_t user[MAX_NAME_LENGTH]; - - retlen = mbstowcs(user, username, MAX_NAME_LENGTH); - - *totalGroups = 0; - /* - * Call the NetUserGetLocalGroups function - * specifying information level 0. - * - * The LG_INCLUDE_INDIRECT flag specifies that the - * function should also return the names of the local - * groups in which the user is indirectly a member. - */ - nStatus = NetUserGetLocalGroups(NULL, - user, - dwLevel, - dwFlags, - (LPBYTE *) &pBuf, - dwPrefMaxLen, - &dwEntriesRead, - &dwTotalEntries); - /* - * See if the call succeeds, - */ - if (nStatus != NERR_Success) { - if (nStatus == ERROR_ACCESS_DENIED) - return (ISC_R_NOPERM); - if (nStatus == ERROR_MORE_DATA) - return (ISC_R_NOSPACE); - if (nStatus == NERR_UserNotFound) - dwEntriesRead = 0; - } - - dwTotalCount = 0; - if (pBuf != NULL) { - pTmpLBuf = pBuf; - /* - * Loop through the entries - */ - for (i = 0; - (i < dwEntriesRead && *totalGroups < maxgroups); i++) { - assert(pTmpLBuf != NULL); - if (pTmpLBuf == NULL) - break; - retlen = wcslen(pTmpLBuf->lgrui0_name); - GroupList[*totalGroups] = (char *) malloc(retlen +1); - if (GroupList[*totalGroups] == NULL) - return (ISC_R_NOMEMORY); - - retlen = wcstombs(GroupList[*totalGroups], - pTmpLBuf->lgrui0_name, retlen); - GroupList[*totalGroups][retlen] = '\0'; - if (strcmp(GroupList[*totalGroups], "None") == 0) - free(GroupList[*totalGroups]); - else - (*totalGroups)++; - pTmpLBuf++; - } - } - /* Free the allocated memory. */ - if (pBuf != NULL) - NetApiBufferFree(pBuf); - - - /* - * Call the NetUserGetGroups function, specifying level 0. - */ - nStatus = NetUserGetGroups(NULL, - user, - dwLevel, - (LPBYTE*)&pgrpBuf, - dwPrefMaxLen, - &dwEntriesRead, - &dwTotalEntries); - /* - * See if the call succeeds, - */ - if (nStatus != NERR_Success) { - if (nStatus == ERROR_ACCESS_DENIED) - return (ISC_R_NOPERM); - if (nStatus == ERROR_MORE_DATA) - return (ISC_R_NOSPACE); - if (nStatus == NERR_UserNotFound) - dwEntriesRead = 0; - } - - if (pgrpBuf != NULL) { - pTmpBuf = pgrpBuf; - /* - * Loop through the entries - */ - for (i = 0; - (i < dwEntriesRead && *totalGroups < maxgroups); i++) { - assert(pTmpBuf != NULL); - - if (pTmpBuf == NULL) - break; - retlen = wcslen(pTmpBuf->grui0_name); - GroupList[*totalGroups] = (char *) malloc(retlen +1); - if (GroupList[*totalGroups] == NULL) - return (ISC_R_NOMEMORY); - - retlen = wcstombs(GroupList[*totalGroups], - pTmpBuf->grui0_name, retlen); - GroupList[*totalGroups][retlen] = '\0'; - if (strcmp(GroupList[*totalGroups], "None") == 0) - free(GroupList[*totalGroups]); - else - (*totalGroups)++; - pTmpBuf++; - } - } - /* - * Free the allocated memory. - */ - if (pgrpBuf != NULL) - NetApiBufferFree(pgrpBuf); - - return (ISC_R_SUCCESS); -} diff --git a/lib/isc/win32/ntpaths.c b/lib/isc/win32/ntpaths.c deleted file mode 100644 index 1ff8c5a9b5c3..000000000000 --- a/lib/isc/win32/ntpaths.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: ntpaths.c,v 1.15 2009/07/14 22:54:57 each Exp $ */ - -/* - * This module fetches the required path information that is specific - * to NT systems which can have its configuration and system files - * almost anywhere. It can be used to override whatever the application - * had previously assigned to the pointer. Basic information about the - * file locations are stored in the registry. - */ - -#include -#include -#include - -/* - * Module Variables - */ - -static char systemDir[MAX_PATH]; -static char namedBase[MAX_PATH]; -static char ns_confFile[MAX_PATH]; -static char lwresd_confFile[MAX_PATH]; -static char lwresd_resolvconfFile[MAX_PATH]; -static char rndc_confFile[MAX_PATH]; -static char ns_defaultpidfile[MAX_PATH]; -static char lwresd_defaultpidfile[MAX_PATH]; -static char local_state_dir[MAX_PATH]; -static char sys_conf_dir[MAX_PATH]; -static char rndc_keyFile[MAX_PATH]; -static char session_keyFile[MAX_PATH]; - -static DWORD baseLen = MAX_PATH; -static BOOL Initialized = FALSE; - -void -isc_ntpaths_init() { - HKEY hKey; - BOOL keyFound = TRUE; - - memset(namedBase, 0, MAX_PATH); - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, BIND_SUBKEY, 0, KEY_READ, &hKey) - != ERROR_SUCCESS) - keyFound = FALSE; - - if (keyFound == TRUE) { - /* Get the named directory */ - if (RegQueryValueEx(hKey, "InstallDir", NULL, NULL, - (LPBYTE)namedBase, &baseLen) != ERROR_SUCCESS) - keyFound = FALSE; - RegCloseKey(hKey); - } - - GetSystemDirectory(systemDir, MAX_PATH); - - if (keyFound == FALSE) - /* Use the System Directory as a default */ - strcpy(namedBase, systemDir); - - strcpy(ns_confFile, namedBase); - strcat(ns_confFile, "\\etc\\named.conf"); - - strcpy(lwresd_confFile, namedBase); - strcat(lwresd_confFile, "\\etc\\lwresd.conf"); - - strcpy(lwresd_resolvconfFile, systemDir); - strcat(lwresd_resolvconfFile, "\\Drivers\\etc\\resolv.conf"); - - strcpy(rndc_keyFile, namedBase); - strcat(rndc_keyFile, "\\etc\\rndc.key"); - - strcpy(session_keyFile, namedBase); - strcat(session_keyFile, "\\etc\\session.key"); - - strcpy(rndc_confFile, namedBase); - strcat(rndc_confFile, "\\etc\\rndc.conf"); - strcpy(ns_defaultpidfile, namedBase); - strcat(ns_defaultpidfile, "\\etc\\named.pid"); - - strcpy(lwresd_defaultpidfile, namedBase); - strcat(lwresd_defaultpidfile, "\\etc\\lwresd.pid"); - - strcpy(local_state_dir, namedBase); - strcat(local_state_dir, "\\bin"); - - strcpy(sys_conf_dir, namedBase); - strcat(sys_conf_dir, "\\etc"); - - Initialized = TRUE; -} - -char * -isc_ntpaths_get(int ind) { - if (!Initialized) - isc_ntpaths_init(); - - switch (ind) { - case NAMED_CONF_PATH: - return (ns_confFile); - break; - case LWRES_CONF_PATH: - return (lwresd_confFile); - break; - case RESOLV_CONF_PATH: - return (lwresd_resolvconfFile); - break; - case RNDC_CONF_PATH: - return (rndc_confFile); - break; - case NAMED_PID_PATH: - return (ns_defaultpidfile); - break; - case LWRESD_PID_PATH: - return (lwresd_defaultpidfile); - break; - case LOCAL_STATE_DIR: - return (local_state_dir); - break; - case SYS_CONF_DIR: - return (sys_conf_dir); - break; - case RNDC_KEY_PATH: - return (rndc_keyFile); - break; - case SESSION_KEY_PATH: - return (session_keyFile); - break; - default: - return (NULL); - } -} diff --git a/lib/isc/win32/os.c b/lib/isc/win32/os.c deleted file mode 100644 index bbd5f1d6c190..000000000000 --- a/lib/isc/win32/os.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: os.c,v 1.8 2007/06/19 23:47:19 tbox Exp $ */ - -#include - -#include - -static BOOL bInit = FALSE; -static SYSTEM_INFO SystemInfo; - -static void -initialize_action(void) { - if (bInit) - return; - - GetSystemInfo(&SystemInfo); - bInit = TRUE; -} - -unsigned int -isc_os_ncpus(void) { - long ncpus = 1; - initialize_action(); - ncpus = SystemInfo.dwNumberOfProcessors; - if (ncpus <= 0) - ncpus = 1; - - return ((unsigned int)ncpus); -} diff --git a/lib/isc/win32/resource.c b/lib/isc/win32/resource.c deleted file mode 100644 index e7e7cf414646..000000000000 --- a/lib/isc/win32/resource.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2004, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: resource.c,v 1.10 2008/07/11 23:47:09 tbox Exp $ */ - -#include - -#include - -#include -#include -#include -#include - -#include "errno2result.h" - -/* - * Windows limits the maximum number of open files to 2048 - */ - -#define WIN32_MAX_OPEN_FILES 2048 - -isc_result_t -isc_resource_setlimit(isc_resource_t resource, isc_resourcevalue_t value) { - isc_resourcevalue_t rlim_value; - int wresult; - - if (resource != isc_resource_openfiles) - return (ISC_R_NOTIMPLEMENTED); - - - if (value == ISC_RESOURCE_UNLIMITED) - rlim_value = WIN32_MAX_OPEN_FILES; - else - rlim_value = min(value, WIN32_MAX_OPEN_FILES); - - wresult = _setmaxstdio((int) rlim_value); - - if (wresult > 0) - return (ISC_R_SUCCESS); - else - return (isc__errno2result(errno)); -} - -isc_result_t -isc_resource_getlimit(isc_resource_t resource, isc_resourcevalue_t *value) { - - if (resource != isc_resource_openfiles) - return (ISC_R_NOTIMPLEMENTED); - - *value = WIN32_MAX_OPEN_FILES; - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_resource_getcurlimit(isc_resource_t resource, isc_resourcevalue_t *value) { - return (isc_resource_getlimit(resource, value)); -} diff --git a/lib/isc/win32/socket.c b/lib/isc/win32/socket.c deleted file mode 100644 index ffcefb0606c8..000000000000 --- a/lib/isc/win32/socket.c +++ /dev/null @@ -1,3967 +0,0 @@ -/* - * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000-2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/* This code uses functions which are only available on Server 2003 and - * higher, and Windows XP and higher. - * - * This code is by nature multithreaded and takes advantage of various - * features to pass on information through the completion port for - * when I/O is completed. All sends, receives, accepts, and connects are - * completed through the completion port. - * - * The number of Completion Port Worker threads used is the total number - * of CPU's + 1. This increases the likelihood that a Worker Thread is - * available for processing a completed request. - * - * XXXPDM 5 August, 2002 - */ - -#define MAKE_EXTERNAL 1 -#include - -#include - -#ifndef _WINSOCKAPI_ -#define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */ -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "errno2result.h" - -/* - * How in the world can Microsoft exist with APIs like this? - * We can't actually call this directly, because it turns out - * no library exports this function. Instead, we need to - * issue a runtime call to get the address. - */ -LPFN_CONNECTEX ISCConnectEx; -LPFN_ACCEPTEX ISCAcceptEx; -LPFN_GETACCEPTEXSOCKADDRS ISCGetAcceptExSockaddrs; - -/* - * Run expensive internal consistency checks. - */ -#ifdef ISC_SOCKET_CONSISTENCY_CHECKS -#define CONSISTENT(sock) consistent(sock) -#else -#define CONSISTENT(sock) do {} while (0) -#endif -static void consistent(isc_socket_t *sock); - -/* - * Define this macro to control the behavior of connection - * resets on UDP sockets. See Microsoft KnowledgeBase Article Q263823 - * for details. - * NOTE: This requires that Windows 2000 systems install Service Pack 2 - * or later. - */ -#ifndef SIO_UDP_CONNRESET -#define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12) -#endif - -/* - * Some systems define the socket length argument as an int, some as size_t, - * some as socklen_t. This is here so it can be easily changed if needed. - */ -#ifndef ISC_SOCKADDR_LEN_T -#define ISC_SOCKADDR_LEN_T unsigned int -#endif - -/* - * Define what the possible "soft" errors can be. These are non-fatal returns - * of various network related functions, like recv() and so on. - */ -#define SOFT_ERROR(e) ((e) == WSAEINTR || \ - (e) == WSAEWOULDBLOCK || \ - (e) == EWOULDBLOCK || \ - (e) == EINTR || \ - (e) == EAGAIN || \ - (e) == 0) - -/* - * Pending errors are not really errors and should be - * kept separate - */ -#define PENDING_ERROR(e) ((e) == WSA_IO_PENDING || (e) == 0) - -#define DOIO_SUCCESS 0 /* i/o ok, event sent */ -#define DOIO_SOFT 1 /* i/o ok, soft error, no event sent */ -#define DOIO_HARD 2 /* i/o error, event sent */ -#define DOIO_EOF 3 /* EOF, no event sent */ -#define DOIO_PENDING 4 /* status when i/o is in process */ -#define DOIO_NEEDMORE 5 /* IO was processed, but we need more due to minimum */ - -#define DLVL(x) ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_DEBUG(x) - -/* - * DLVL(90) -- Function entry/exit and other tracing. - * DLVL(70) -- Socket "correctness" -- including returning of events, etc. - * DLVL(60) -- Socket data send/receive - * DLVL(50) -- Event tracing, including receiving/sending completion events. - * DLVL(20) -- Socket creation/destruction. - */ -#define TRACE_LEVEL 90 -#define CORRECTNESS_LEVEL 70 -#define IOEVENT_LEVEL 60 -#define EVENT_LEVEL 50 -#define CREATION_LEVEL 20 - -#define TRACE DLVL(TRACE_LEVEL) -#define CORRECTNESS DLVL(CORRECTNESS_LEVEL) -#define IOEVENT DLVL(IOEVENT_LEVEL) -#define EVENT DLVL(EVENT_LEVEL) -#define CREATION DLVL(CREATION_LEVEL) - -typedef isc_event_t intev_t; - -/* - * Socket State - */ -enum { - SOCK_INITIALIZED, /* Socket Initialized */ - SOCK_OPEN, /* Socket opened but nothing yet to do */ - SOCK_DATA, /* Socket sending or receiving data */ - SOCK_LISTEN, /* TCP Socket listening for connects */ - SOCK_ACCEPT, /* TCP socket is waiting to accept */ - SOCK_CONNECT, /* TCP Socket connecting */ - SOCK_CLOSED, /* Socket has been closed */ -}; - -#define SOCKET_MAGIC ISC_MAGIC('I', 'O', 'i', 'o') -#define VALID_SOCKET(t) ISC_MAGIC_VALID(t, SOCKET_MAGIC) - -/* - * IPv6 control information. If the socket is an IPv6 socket we want - * to collect the destination address and interface so the client can - * set them on outgoing packets. - */ -#ifdef ISC_PLATFORM_HAVEIPV6 -#ifndef USE_CMSG -#define USE_CMSG 1 -#endif -#endif - -/* - * We really don't want to try and use these control messages. Win32 - * doesn't have this mechanism before XP. - */ -#undef USE_CMSG - -/* - * Message header for recvmsg and sendmsg calls. - * Used value-result for recvmsg, value only for sendmsg. - */ -struct msghdr { - SOCKADDR_STORAGE to_addr; /* UDP send/recv address */ - int to_addr_len; /* length of the address */ - WSABUF *msg_iov; /* scatter/gather array */ - u_int msg_iovlen; /* # elements in msg_iov */ - void *msg_control; /* ancillary data, see below */ - u_int msg_controllen; /* ancillary data buffer len */ - int msg_totallen; /* total length of this message */ -} msghdr; - -/* - * The size to raise the receive buffer to. - */ -#define RCVBUFSIZE (32*1024) - -/* - * The number of times a send operation is repeated if the result - * is WSAEINTR. - */ -#define NRETRIES 10 - -struct isc_socket { - /* Not locked. */ - unsigned int magic; - isc_socketmgr_t *manager; - isc_mutex_t lock; - isc_sockettype_t type; - - /* Pointers to scatter/gather buffers */ - WSABUF iov[ISC_SOCKET_MAXSCATTERGATHER]; - - /* Locked by socket lock. */ - ISC_LINK(isc_socket_t) link; - unsigned int references; /* EXTERNAL references */ - SOCKET fd; /* file handle */ - int pf; /* protocol family */ - char name[16]; - void * tag; - - /* - * Each recv() call uses this buffer. It is a per-socket receive - * buffer that allows us to decouple the system recv() from the - * recv_list done events. This means the items on the recv_list - * can be removed without having to cancel pending system recv() - * calls. It also allows us to read-ahead in some cases. - */ - struct { - SOCKADDR_STORAGE from_addr; // UDP send/recv address - int from_addr_len; // length of the address - char *base; // the base of the buffer - char *consume_position; // where to start copying data from next - unsigned int len; // the actual size of this buffer - unsigned int remaining; // the number of bytes remaining - } recvbuf; - - ISC_LIST(isc_socketevent_t) send_list; - ISC_LIST(isc_socketevent_t) recv_list; - ISC_LIST(isc_socket_newconnev_t) accept_list; - isc_socket_connev_t *connect_ev; - - isc_sockaddr_t address; /* remote address */ - - unsigned int listener : 1, /* listener socket */ - connected : 1, - pending_connect : 1, /* connect pending */ - bound : 1, /* bound to local addr */ - dupped : 1; /* created by isc_socket_dup() */ - unsigned int pending_iocp; /* Should equal the counters below. Debug. */ - unsigned int pending_recv; /* Number of outstanding recv() calls. */ - unsigned int pending_send; /* Number of outstanding send() calls. */ - unsigned int pending_accept; /* Number of outstanding accept() calls. */ - unsigned int state; /* Socket state. Debugging and consistency checking. */ - int state_lineno; /* line which last touched state */ -}; - -#define _set_state(sock, _state) do { (sock)->state = (_state); (sock)->state_lineno = __LINE__; } while (0) - -/* - * Buffer structure - */ -typedef struct buflist buflist_t; - -struct buflist { - void *buf; - unsigned int buflen; - ISC_LINK(buflist_t) link; -}; - -/* - * I/O Completion ports Info structures - */ - -static HANDLE hHeapHandle = NULL; -typedef struct IoCompletionInfo { - OVERLAPPED overlapped; - isc_socketevent_t *dev; /* send()/recv() done event */ - isc_socket_connev_t *cdev; /* connect() done event */ - isc_socket_newconnev_t *adev; /* accept() done event */ - void *acceptbuffer; - DWORD received_bytes; - int request_type; - struct msghdr messagehdr; - ISC_LIST(buflist_t) bufferlist; /*%< list of buffers */ -} IoCompletionInfo; - -/* - * Define a maximum number of I/O Completion Port worker threads - * to handle the load on the Completion Port. The actual number - * used is the number of CPU's + 1. - */ -#define MAX_IOCPTHREADS 20 - -#define SOCKET_MANAGER_MAGIC ISC_MAGIC('I', 'O', 'm', 'g') -#define VALID_MANAGER(m) ISC_MAGIC_VALID(m, SOCKET_MANAGER_MAGIC) - -struct isc_socketmgr { - /* Not locked. */ - unsigned int magic; - isc_mem_t *mctx; - isc_mutex_t lock; - isc_stats_t *stats; - - /* Locked by manager lock. */ - ISC_LIST(isc_socket_t) socklist; - isc_boolean_t bShutdown; - isc_condition_t shutdown_ok; - HANDLE hIoCompletionPort; - int maxIOCPThreads; - HANDLE hIOCPThreads[MAX_IOCPTHREADS]; - DWORD dwIOCPThreadIds[MAX_IOCPTHREADS]; - - /* - * Debugging. - * Modified by InterlockedIncrement() and InterlockedDecrement() - */ - LONG totalSockets; - LONG iocp_total; -}; - -enum { - SOCKET_RECV, - SOCKET_SEND, - SOCKET_ACCEPT, - SOCKET_CONNECT -}; - -/* - * send() and recv() iovec counts - */ -#define MAXSCATTERGATHER_SEND (ISC_SOCKET_MAXSCATTERGATHER) -#define MAXSCATTERGATHER_RECV (ISC_SOCKET_MAXSCATTERGATHER) - -static isc_result_t socket_create(isc_socketmgr_t *manager0, int pf, - isc_sockettype_t type, - isc_socket_t **socketp, - isc_socket_t *dup_socket); -static isc_threadresult_t WINAPI SocketIoThread(LPVOID ThreadContext); -static void maybe_free_socket(isc_socket_t **, int); -static void free_socket(isc_socket_t **, int); -static isc_boolean_t senddone_is_active(isc_socket_t *sock, isc_socketevent_t *dev); -static isc_boolean_t acceptdone_is_active(isc_socket_t *sock, isc_socket_newconnev_t *dev); -static isc_boolean_t connectdone_is_active(isc_socket_t *sock, isc_socket_connev_t *dev); -static void send_recvdone_event(isc_socket_t *sock, isc_socketevent_t **dev); -static void send_senddone_event(isc_socket_t *sock, isc_socketevent_t **dev); -static void send_acceptdone_event(isc_socket_t *sock, isc_socket_newconnev_t **adev); -static void send_connectdone_event(isc_socket_t *sock, isc_socket_connev_t **cdev); -static void send_recvdone_abort(isc_socket_t *sock, isc_result_t result); -static void queue_receive_event(isc_socket_t *sock, isc_task_t *task, isc_socketevent_t *dev); -static void queue_receive_request(isc_socket_t *sock); - -/* - * This is used to dump the contents of the sock structure - * You should make sure that the sock is locked before - * dumping it. Since the code uses simple printf() statements - * it should only be used interactively. - */ -void -sock_dump(isc_socket_t *sock) { - isc_socketevent_t *ldev; - isc_socket_newconnev_t *ndev; - -#if 0 - isc_sockaddr_t addr; - char socktext[256]; - - isc_socket_getpeername(sock, &addr); - isc_sockaddr_format(&addr, socktext, sizeof(socktext)); - printf("Remote Socket: %s\n", socktext); - isc_socket_getsockname(sock, &addr); - isc_sockaddr_format(&addr, socktext, sizeof(socktext)); - printf("This Socket: %s\n", socktext); -#endif - - printf("\n\t\tSock Dump\n"); - printf("\t\tfd: %u\n", sock->fd); - printf("\t\treferences: %d\n", sock->references); - printf("\t\tpending_accept: %d\n", sock->pending_accept); - printf("\t\tconnecting: %d\n", sock->pending_connect); - printf("\t\tconnected: %d\n", sock->connected); - printf("\t\tbound: %d\n", sock->bound); - printf("\t\tpending_iocp: %d\n", sock->pending_iocp); - printf("\t\tsocket type: %d\n", sock->type); - - printf("\n\t\tSock Recv List\n"); - ldev = ISC_LIST_HEAD(sock->recv_list); - while (ldev != NULL) { - printf("\t\tdev: %p\n", ldev); - ldev = ISC_LIST_NEXT(ldev, ev_link); - } - - printf("\n\t\tSock Send List\n"); - ldev = ISC_LIST_HEAD(sock->send_list); - while (ldev != NULL) { - printf("\t\tdev: %p\n", ldev); - ldev = ISC_LIST_NEXT(ldev, ev_link); - } - - printf("\n\t\tSock Accept List\n"); - ndev = ISC_LIST_HEAD(sock->accept_list); - while (ndev != NULL) { - printf("\t\tdev: %p\n", ldev); - ndev = ISC_LIST_NEXT(ndev, ev_link); - } -} - -static void -socket_log(int lineno, isc_socket_t *sock, isc_sockaddr_t *address, - isc_logcategory_t *category, isc_logmodule_t *module, int level, - isc_msgcat_t *msgcat, int msgset, int message, - const char *fmt, ...) ISC_FORMAT_PRINTF(9, 10); - -/* This function will add an entry to the I/O completion port - * that will signal the I/O thread to exit (gracefully) - */ -static void -signal_iocompletionport_exit(isc_socketmgr_t *manager) { - int i; - int errval; - char strbuf[ISC_STRERRORSIZE]; - - REQUIRE(VALID_MANAGER(manager)); - for (i = 0; i < manager->maxIOCPThreads; i++) { - if (!PostQueuedCompletionStatus(manager->hIoCompletionPort, - 0, 0, 0)) { - errval = GetLastError(); - isc__strerror(errval, strbuf, sizeof(strbuf)); - FATAL_ERROR(__FILE__, __LINE__, - isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_FAILED, - "Can't request service thread to exit: %s"), - strbuf); - } - } -} - -/* - * Create the worker threads for the I/O Completion Port - */ -void -iocompletionport_createthreads(int total_threads, isc_socketmgr_t *manager) { - int errval; - char strbuf[ISC_STRERRORSIZE]; - int i; - - INSIST(total_threads > 0); - REQUIRE(VALID_MANAGER(manager)); - /* - * We need at least one - */ - for (i = 0; i < total_threads; i++) { - manager->hIOCPThreads[i] = CreateThread(NULL, 0, SocketIoThread, - manager, 0, - &manager->dwIOCPThreadIds[i]); - if (manager->hIOCPThreads[i] == NULL) { - errval = GetLastError(); - isc__strerror(errval, strbuf, sizeof(strbuf)); - FATAL_ERROR(__FILE__, __LINE__, - isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_FAILED, - "Can't create IOCP thread: %s"), - strbuf); - exit(1); - } - } -} - -/* - * Create/initialise the I/O completion port - */ -void -iocompletionport_init(isc_socketmgr_t *manager) { - int errval; - char strbuf[ISC_STRERRORSIZE]; - - REQUIRE(VALID_MANAGER(manager)); - /* - * Create a private heap to handle the socket overlapped structure - * The minimum number of structures is 10, there is no maximum - */ - hHeapHandle = HeapCreate(0, 10 * sizeof(IoCompletionInfo), 0); - if (hHeapHandle == NULL) { - errval = GetLastError(); - isc__strerror(errval, strbuf, sizeof(strbuf)); - FATAL_ERROR(__FILE__, __LINE__, - isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_FAILED, - "HeapCreate() failed during " - "initialization: %s"), - strbuf); - exit(1); - } - - manager->maxIOCPThreads = min(isc_os_ncpus() + 1, MAX_IOCPTHREADS); - - /* Now Create the Completion Port */ - manager->hIoCompletionPort = CreateIoCompletionPort( - INVALID_HANDLE_VALUE, NULL, - 0, manager->maxIOCPThreads); - if (manager->hIoCompletionPort == NULL) { - errval = GetLastError(); - isc__strerror(errval, strbuf, sizeof(strbuf)); - FATAL_ERROR(__FILE__, __LINE__, - isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_FAILED, - "CreateIoCompletionPort() failed " - "during initialization: %s"), - strbuf); - exit(1); - } - - /* - * Worker threads for servicing the I/O - */ - iocompletionport_createthreads(manager->maxIOCPThreads, manager); -} - -/* - * Associate a socket with an IO Completion Port. This allows us to queue events for it - * and have our worker pool of threads process them. - */ -void -iocompletionport_update(isc_socket_t *sock) { - HANDLE hiocp; - char strbuf[ISC_STRERRORSIZE]; - - REQUIRE(VALID_SOCKET(sock)); - - hiocp = CreateIoCompletionPort((HANDLE)sock->fd, - sock->manager->hIoCompletionPort, (ULONG_PTR)sock, 0); - - if (hiocp == NULL) { - DWORD errval = GetLastError(); - isc__strerror(errval, strbuf, sizeof(strbuf)); - isc_log_iwrite(isc_lctx, - ISC_LOGCATEGORY_GENERAL, - ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, - isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_TOOMANYHANDLES, - "iocompletionport_update: failed to open" - " io completion port: %s", - strbuf); - - /* XXXMLG temporary hack to make failures detected. - * This function should return errors to the caller, not - * exit here. - */ - FATAL_ERROR(__FILE__, __LINE__, - isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_FAILED, - "CreateIoCompletionPort() failed " - "during initialization: %s"), - strbuf); - exit(1); - } - - InterlockedIncrement(&sock->manager->iocp_total); -} - -/* - * Routine to cleanup and then close the socket. - * Only close the socket here if it is NOT associated - * with an event, otherwise the WSAWaitForMultipleEvents - * may fail due to the fact that the Wait should not - * be running while closing an event or a socket. - * The socket is locked before calling this function - */ -void -socket_close(isc_socket_t *sock) { - - REQUIRE(sock != NULL); - - if (sock->fd != INVALID_SOCKET) { - closesocket(sock->fd); - sock->fd = INVALID_SOCKET; - _set_state(sock, SOCK_CLOSED); - InterlockedDecrement(&sock->manager->totalSockets); - } -} - -static isc_once_t initialise_once = ISC_ONCE_INIT; -static isc_boolean_t initialised = ISC_FALSE; - -static void -initialise(void) { - WORD wVersionRequested; - WSADATA wsaData; - int err; - SOCKET sock; - GUID GUIDConnectEx = WSAID_CONNECTEX; - GUID GUIDAcceptEx = WSAID_ACCEPTEX; - GUID GUIDGetAcceptExSockaddrs = WSAID_GETACCEPTEXSOCKADDRS; - DWORD dwBytes; - - /* Need Winsock 2.2 or better */ - wVersionRequested = MAKEWORD(2, 2); - - err = WSAStartup(wVersionRequested, &wsaData); - if (err != 0) { - char strbuf[ISC_STRERRORSIZE]; - isc__strerror(err, strbuf, sizeof(strbuf)); - FATAL_ERROR(__FILE__, __LINE__, "WSAStartup() %s: %s", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed"), - strbuf); - exit(1); - } - /* - * The following APIs do not exist as functions in a library, but we must - * ask winsock for them. They are "extensions" -- but why they cannot be - * actual functions is beyond me. So, ask winsock for the pointers to the - * functions we need. - */ - sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - INSIST(sock != INVALID_SOCKET); - err = WSAIoctl(sock, SIO_GET_EXTENSION_FUNCTION_POINTER, - &GUIDConnectEx, sizeof(GUIDConnectEx), - &ISCConnectEx, sizeof(ISCConnectEx), - &dwBytes, NULL, NULL); - INSIST(err == 0); - - err = WSAIoctl(sock, SIO_GET_EXTENSION_FUNCTION_POINTER, - &GUIDAcceptEx, sizeof(GUIDAcceptEx), - &ISCAcceptEx, sizeof(ISCAcceptEx), - &dwBytes, NULL, NULL); - INSIST(err == 0); - - err = WSAIoctl(sock, SIO_GET_EXTENSION_FUNCTION_POINTER, - &GUIDGetAcceptExSockaddrs, sizeof(GUIDGetAcceptExSockaddrs), - &ISCGetAcceptExSockaddrs, sizeof(ISCGetAcceptExSockaddrs), - &dwBytes, NULL, NULL); - INSIST(err == 0); - - closesocket(sock); - - initialised = ISC_TRUE; -} - -/* - * Initialize socket services - */ -void -InitSockets(void) { - RUNTIME_CHECK(isc_once_do(&initialise_once, - initialise) == ISC_R_SUCCESS); - if (!initialised) - exit(1); -} - -int -internal_sendmsg(isc_socket_t *sock, IoCompletionInfo *lpo, - struct msghdr *messagehdr, int flags, int *Error) -{ - int Result; - DWORD BytesSent; - DWORD Flags = flags; - int total_sent; - - *Error = 0; - Result = WSASendTo(sock->fd, messagehdr->msg_iov, - messagehdr->msg_iovlen, &BytesSent, - Flags, (SOCKADDR *)&messagehdr->to_addr, - messagehdr->to_addr_len, (LPWSAOVERLAPPED)lpo, - NULL); - - total_sent = (int)BytesSent; - - /* Check for errors.*/ - if (Result == SOCKET_ERROR) { - *Error = WSAGetLastError(); - - switch (*Error) { - case WSA_IO_INCOMPLETE: - case WSA_WAIT_IO_COMPLETION: - case WSA_IO_PENDING: - case NO_ERROR: /* Strange, but okay */ - sock->pending_iocp++; - sock->pending_send++; - break; - - default: - return (-1); - break; - } - } else { - sock->pending_iocp++; - sock->pending_send++; - } - - if (lpo != NULL) - return (0); - else - return (total_sent); -} - -static void -queue_receive_request(isc_socket_t *sock) { - DWORD Flags = 0; - DWORD NumBytes = 0; - int total_bytes = 0; - int Result; - int Error; - int need_retry; - WSABUF iov[1]; - IoCompletionInfo *lpo = NULL; - isc_result_t isc_result; - - retry: - need_retry = ISC_FALSE; - - /* - * If we already have a receive pending, do nothing. - */ - if (sock->pending_recv > 0) { - if (lpo != NULL) - HeapFree(hHeapHandle, 0, lpo); - return; - } - - /* - * If no one is waiting, do nothing. - */ - if (ISC_LIST_EMPTY(sock->recv_list)) { - if (lpo != NULL) - HeapFree(hHeapHandle, 0, lpo); - return; - } - - INSIST(sock->recvbuf.remaining == 0); - INSIST(sock->fd != INVALID_SOCKET); - - iov[0].len = sock->recvbuf.len; - iov[0].buf = sock->recvbuf.base; - - if (lpo == NULL) { - lpo = (IoCompletionInfo *)HeapAlloc(hHeapHandle, - HEAP_ZERO_MEMORY, - sizeof(IoCompletionInfo)); - RUNTIME_CHECK(lpo != NULL); - } else - ZeroMemory(lpo, sizeof(IoCompletionInfo)); - lpo->request_type = SOCKET_RECV; - - sock->recvbuf.from_addr_len = sizeof(sock->recvbuf.from_addr); - - Error = 0; - Result = WSARecvFrom((SOCKET)sock->fd, iov, 1, - &NumBytes, &Flags, - (SOCKADDR *)&sock->recvbuf.from_addr, - &sock->recvbuf.from_addr_len, - (LPWSAOVERLAPPED)lpo, NULL); - - /* Check for errors. */ - if (Result == SOCKET_ERROR) { - Error = WSAGetLastError(); - - switch (Error) { - case WSA_IO_PENDING: - sock->pending_iocp++; - sock->pending_recv++; - break; - - /* direct error: no completion event */ - case ERROR_HOST_UNREACHABLE: - case WSAENETRESET: - case WSAECONNRESET: - if (!sock->connected) { - /* soft error */ - need_retry = ISC_TRUE; - break; - } - /* FALLTHROUGH */ - - default: - isc_result = isc__errno2result(Error); - if (isc_result == ISC_R_UNEXPECTED) - UNEXPECTED_ERROR(__FILE__, __LINE__, - "WSARecvFrom: Windows error code: %d, isc result %d", - Error, isc_result); - send_recvdone_abort(sock, isc_result); - HeapFree(hHeapHandle, 0, lpo); - lpo = NULL; - break; - } - } else { - /* - * The recv() finished immediately, but we will still get - * a completion event. Rather than duplicate code, let - * that thread handle sending the data along its way. - */ - sock->pending_iocp++; - sock->pending_recv++; - } - - socket_log(__LINE__, sock, NULL, IOEVENT, - isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_DOIORECV, - "queue_io_request: fd %d result %d error %d", - sock->fd, Result, Error); - - CONSISTENT(sock); - - if (need_retry) - goto retry; -} - -static void -manager_log(isc_socketmgr_t *sockmgr, isc_logcategory_t *category, - isc_logmodule_t *module, int level, const char *fmt, ...) -{ - char msgbuf[2048]; - va_list ap; - - if (!isc_log_wouldlog(isc_lctx, level)) - return; - - va_start(ap, fmt); - vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap); - va_end(ap); - - isc_log_write(isc_lctx, category, module, level, - "sockmgr %p: %s", sockmgr, msgbuf); -} - -static void -socket_log(int lineno, isc_socket_t *sock, isc_sockaddr_t *address, - isc_logcategory_t *category, isc_logmodule_t *module, int level, - isc_msgcat_t *msgcat, int msgset, int message, - const char *fmt, ...) -{ - char msgbuf[2048]; - char peerbuf[256]; - va_list ap; - - - if (!isc_log_wouldlog(isc_lctx, level)) - return; - - va_start(ap, fmt); - vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap); - va_end(ap); - - if (address == NULL) { - isc_log_iwrite(isc_lctx, category, module, level, - msgcat, msgset, message, - "socket %p line %d: %s", sock, lineno, msgbuf); - } else { - isc_sockaddr_format(address, peerbuf, sizeof(peerbuf)); - isc_log_iwrite(isc_lctx, category, module, level, - msgcat, msgset, message, - "socket %p line %d peer %s: %s", sock, lineno, - peerbuf, msgbuf); - } - -} - -/* - * Make an fd SOCKET non-blocking. - */ -static isc_result_t -make_nonblock(SOCKET fd) { - int ret; - unsigned long flags = 1; - char strbuf[ISC_STRERRORSIZE]; - - /* Set the socket to non-blocking */ - ret = ioctlsocket(fd, FIONBIO, &flags); - - if (ret == -1) { - isc__strerror(errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "ioctlsocket(%d, FIOBIO, %d): %s", - fd, flags, strbuf); - - return (ISC_R_UNEXPECTED); - } - - return (ISC_R_SUCCESS); -} - -/* - * Windows 2000 systems incorrectly cause UDP sockets using WSARecvFrom - * to not work correctly, returning a WSACONNRESET error when a WSASendTo - * fails with an "ICMP port unreachable" response and preventing the - * socket from using the WSARecvFrom in subsequent operations. - * The function below fixes this, but requires that Windows 2000 - * Service Pack 2 or later be installed on the system. NT 4.0 - * systems are not affected by this and work correctly. - * See Microsoft Knowledge Base Article Q263823 for details of this. - */ -isc_result_t -connection_reset_fix(SOCKET fd) { - DWORD dwBytesReturned = 0; - BOOL bNewBehavior = FALSE; - DWORD status; - - if (isc_win32os_majorversion() < 5) - return (ISC_R_SUCCESS); /* NT 4.0 has no problem */ - - /* disable bad behavior using IOCTL: SIO_UDP_CONNRESET */ - status = WSAIoctl(fd, SIO_UDP_CONNRESET, &bNewBehavior, - sizeof(bNewBehavior), NULL, 0, - &dwBytesReturned, NULL, NULL); - if (status != SOCKET_ERROR) - return (ISC_R_SUCCESS); - else { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "WSAIoctl(SIO_UDP_CONNRESET, oldBehaviour) %s", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed")); - return (ISC_R_UNEXPECTED); - } -} - -/* - * Construct an iov array and attach it to the msghdr passed in. This is - * the SEND constructor, which will use the used region of the buffer - * (if using a buffer list) or will use the internal region (if a single - * buffer I/O is requested). - * - * Nothing can be NULL, and the done event must list at least one buffer - * on the buffer linked list for this function to be meaningful. - */ -static void -build_msghdr_send(isc_socket_t *sock, isc_socketevent_t *dev, - struct msghdr *msg, char *cmsg, WSABUF *iov, - IoCompletionInfo *lpo) -{ - unsigned int iovcount; - isc_buffer_t *buffer; - buflist_t *cpbuffer; - isc_region_t used; - size_t write_count; - size_t skip_count; - - memset(msg, 0, sizeof(*msg)); - - memcpy(&msg->to_addr, &dev->address.type, dev->address.length); - msg->to_addr_len = dev->address.length; - - buffer = ISC_LIST_HEAD(dev->bufferlist); - write_count = 0; - iovcount = 0; - - /* - * Single buffer I/O? Skip what we've done so far in this region. - */ - if (buffer == NULL) { - write_count = dev->region.length - dev->n; - cpbuffer = HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY, sizeof(buflist_t)); - RUNTIME_CHECK(cpbuffer != NULL); - cpbuffer->buf = HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY, write_count); - RUNTIME_CHECK(cpbuffer->buf != NULL); - - socket_log(__LINE__, sock, NULL, TRACE, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTLOCK, - "alloc_buffer %p %d %p %d", cpbuffer, sizeof(buflist_t), - cpbuffer->buf, write_count); - - memcpy(cpbuffer->buf,(dev->region.base + dev->n), write_count); - cpbuffer->buflen = write_count; - ISC_LIST_ENQUEUE(lpo->bufferlist, cpbuffer, link); - iov[0].buf = cpbuffer->buf; - iov[0].len = write_count; - iovcount = 1; - - goto config; - } - - /* - * Multibuffer I/O. - * Skip the data in the buffer list that we have already written. - */ - skip_count = dev->n; - while (buffer != NULL) { - REQUIRE(ISC_BUFFER_VALID(buffer)); - if (skip_count < isc_buffer_usedlength(buffer)) - break; - skip_count -= isc_buffer_usedlength(buffer); - buffer = ISC_LIST_NEXT(buffer, link); - } - - while (buffer != NULL) { - INSIST(iovcount < MAXSCATTERGATHER_SEND); - - isc_buffer_usedregion(buffer, &used); - - if (used.length > 0) { - int uselen = used.length - skip_count; - cpbuffer = HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY, sizeof(buflist_t)); - RUNTIME_CHECK(cpbuffer != NULL); - cpbuffer->buf = HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY, uselen); - RUNTIME_CHECK(cpbuffer->buf != NULL); - - socket_log(__LINE__, sock, NULL, TRACE, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTLOCK, - "alloc_buffer %p %d %p %d", cpbuffer, sizeof(buflist_t), - cpbuffer->buf, write_count); - - memcpy(cpbuffer->buf,(used.base + skip_count), uselen); - cpbuffer->buflen = uselen; - iov[iovcount].buf = cpbuffer->buf; - iov[iovcount].len = used.length - skip_count; - write_count += uselen; - skip_count = 0; - iovcount++; - } - buffer = ISC_LIST_NEXT(buffer, link); - } - - INSIST(skip_count == 0); - - config: - msg->msg_iov = iov; - msg->msg_iovlen = iovcount; - msg->msg_totallen = write_count; -} - -static void -set_dev_address(isc_sockaddr_t *address, isc_socket_t *sock, - isc_socketevent_t *dev) -{ - if (sock->type == isc_sockettype_udp) { - if (address != NULL) - dev->address = *address; - else - dev->address = sock->address; - } else if (sock->type == isc_sockettype_tcp) { - INSIST(address == NULL); - dev->address = sock->address; - } -} - -static void -destroy_socketevent(isc_event_t *event) { - isc_socketevent_t *ev = (isc_socketevent_t *)event; - - INSIST(ISC_LIST_EMPTY(ev->bufferlist)); - - (ev->destroy)(event); -} - -static isc_socketevent_t * -allocate_socketevent(isc_socket_t *sock, isc_eventtype_t eventtype, - isc_taskaction_t action, const void *arg) -{ - isc_socketevent_t *ev; - - ev = (isc_socketevent_t *)isc_event_allocate(sock->manager->mctx, - sock, eventtype, - action, arg, - sizeof(*ev)); - if (ev == NULL) - return (NULL); - - ev->result = ISC_R_IOERROR; // XXXMLG temporary change to detect failure to set - ISC_LINK_INIT(ev, ev_link); - ISC_LIST_INIT(ev->bufferlist); - ev->region.base = NULL; - ev->n = 0; - ev->offset = 0; - ev->attributes = 0; - ev->destroy = ev->ev_destroy; - ev->ev_destroy = destroy_socketevent; - - return (ev); -} - -#if defined(ISC_SOCKET_DEBUG) -static void -dump_msg(struct msghdr *msg, isc_socket_t *sock) { - unsigned int i; - - printf("MSGHDR %p, Socket #: %u\n", msg, sock->fd); - printf("\tname %p, namelen %d\n", msg->msg_name, msg->msg_namelen); - printf("\tiov %p, iovlen %d\n", msg->msg_iov, msg->msg_iovlen); - for (i = 0; i < (unsigned int)msg->msg_iovlen; i++) - printf("\t\t%d\tbase %p, len %d\n", i, - msg->msg_iov[i].buf, - msg->msg_iov[i].len); -} -#endif - -/* - * map the error code - */ -int -map_socket_error(isc_socket_t *sock, int windows_errno, int *isc_errno, - char *errorstring, size_t bufsize) { - - int doreturn; - switch (windows_errno) { - case WSAECONNREFUSED: - *isc_errno = ISC_R_CONNREFUSED; - if (sock->connected) - doreturn = DOIO_HARD; - else - doreturn = DOIO_SOFT; - break; - case WSAENETUNREACH: - case ERROR_NETWORK_UNREACHABLE: - *isc_errno = ISC_R_NETUNREACH; - if (sock->connected) - doreturn = DOIO_HARD; - else - doreturn = DOIO_SOFT; - break; - case ERROR_PORT_UNREACHABLE: - case ERROR_HOST_UNREACHABLE: - case WSAEHOSTUNREACH: - *isc_errno = ISC_R_HOSTUNREACH; - if (sock->connected) - doreturn = DOIO_HARD; - else - doreturn = DOIO_SOFT; - break; - case WSAENETDOWN: - *isc_errno = ISC_R_NETDOWN; - if (sock->connected) - doreturn = DOIO_HARD; - else - doreturn = DOIO_SOFT; - break; - case WSAEHOSTDOWN: - *isc_errno = ISC_R_HOSTDOWN; - if (sock->connected) - doreturn = DOIO_HARD; - else - doreturn = DOIO_SOFT; - break; - case WSAEACCES: - *isc_errno = ISC_R_NOPERM; - if (sock->connected) - doreturn = DOIO_HARD; - else - doreturn = DOIO_SOFT; - break; - case WSAECONNRESET: - case WSAENETRESET: - case WSAECONNABORTED: - case WSAEDISCON: - *isc_errno = ISC_R_CONNECTIONRESET; - if (sock->connected) - doreturn = DOIO_HARD; - else - doreturn = DOIO_SOFT; - break; - case WSAENOTCONN: - *isc_errno = ISC_R_NOTCONNECTED; - if (sock->connected) - doreturn = DOIO_HARD; - else - doreturn = DOIO_SOFT; - break; - case ERROR_OPERATION_ABORTED: - case ERROR_CONNECTION_ABORTED: - case ERROR_REQUEST_ABORTED: - *isc_errno = ISC_R_CONNECTIONRESET; - doreturn = DOIO_HARD; - break; - case WSAENOBUFS: - *isc_errno = ISC_R_NORESOURCES; - doreturn = DOIO_HARD; - break; - case WSAEAFNOSUPPORT: - *isc_errno = ISC_R_FAMILYNOSUPPORT; - doreturn = DOIO_HARD; - break; - case WSAEADDRNOTAVAIL: - *isc_errno = ISC_R_ADDRNOTAVAIL; - doreturn = DOIO_HARD; - break; - case WSAEDESTADDRREQ: - *isc_errno = ISC_R_BADADDRESSFORM; - doreturn = DOIO_HARD; - break; - case ERROR_NETNAME_DELETED: - *isc_errno = ISC_R_NETDOWN; - doreturn = DOIO_HARD; - break; - default: - *isc_errno = ISC_R_IOERROR; - doreturn = DOIO_HARD; - break; - } - if (doreturn == DOIO_HARD) { - isc__strerror(windows_errno, errorstring, bufsize); - } - return (doreturn); -} - -static void -fill_recv(isc_socket_t *sock, isc_socketevent_t *dev) { - isc_region_t r; - int copylen; - isc_buffer_t *buffer; - - INSIST(dev->n < dev->minimum); - INSIST(sock->recvbuf.remaining > 0); - INSIST(sock->pending_recv == 0); - - if (sock->type == isc_sockettype_udp) { - dev->address.length = sock->recvbuf.from_addr_len; - memcpy(&dev->address.type, &sock->recvbuf.from_addr, - sock->recvbuf.from_addr_len); - if (isc_sockaddr_getport(&dev->address) == 0) { - if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL)) { - socket_log(__LINE__, sock, &dev->address, IOEVENT, - isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_ZEROPORT, - "dropping source port zero packet"); - } - sock->recvbuf.remaining = 0; - return; - } - } else if (sock->type == isc_sockettype_tcp) { - dev->address = sock->address; - } - - /* - * Run through the list of buffers we were given, and find the - * first one with space. Once it is found, loop through, filling - * the buffers as much as possible. - */ - buffer = ISC_LIST_HEAD(dev->bufferlist); - if (buffer != NULL) { // Multi-buffer receive - while (buffer != NULL && sock->recvbuf.remaining > 0) { - REQUIRE(ISC_BUFFER_VALID(buffer)); - if (isc_buffer_availablelength(buffer) > 0) { - isc_buffer_availableregion(buffer, &r); - copylen = min(r.length, sock->recvbuf.remaining); - memcpy(r.base, sock->recvbuf.consume_position, copylen); - sock->recvbuf.consume_position += copylen; - sock->recvbuf.remaining -= copylen; - isc_buffer_add(buffer, copylen); - dev->n += copylen; - } - buffer = ISC_LIST_NEXT(buffer, link); - } - } else { // Single-buffer receive - copylen = min(dev->region.length - dev->n, sock->recvbuf.remaining); - memcpy(dev->region.base + dev->n, sock->recvbuf.consume_position, copylen); - sock->recvbuf.consume_position += copylen; - sock->recvbuf.remaining -= copylen; - dev->n += copylen; - } - - /* - * UDP receives are all-consuming. That is, if we have 4k worth of - * data in our receive buffer, and the caller only gave us - * 1k of space, we will toss the remaining 3k of data. TCP - * will keep the extra data around and use it for later requests. - */ - if (sock->type == isc_sockettype_udp) - sock->recvbuf.remaining = 0; -} - -/* - * Copy out as much data from the internal buffer to done events. - * As each done event is filled, send it along its way. - */ -static void -completeio_recv(isc_socket_t *sock) -{ - isc_socketevent_t *dev; - - /* - * If we are in the process of filling our buffer, we cannot - * touch it yet, so don't. - */ - if (sock->pending_recv > 0) - return; - - while (sock->recvbuf.remaining > 0 && !ISC_LIST_EMPTY(sock->recv_list)) { - dev = ISC_LIST_HEAD(sock->recv_list); - - /* - * See if we have sufficient data in our receive buffer - * to handle this. If we do, copy out the data. - */ - fill_recv(sock, dev); - - /* - * Did we satisfy it? - */ - if (dev->n >= dev->minimum) { - dev->result = ISC_R_SUCCESS; - send_recvdone_event(sock, &dev); - } - } -} - -/* - * Returns: - * DOIO_SUCCESS The operation succeeded. dev->result contains - * ISC_R_SUCCESS. - * - * DOIO_HARD A hard or unexpected I/O error was encountered. - * dev->result contains the appropriate error. - * - * DOIO_SOFT A soft I/O error was encountered. No senddone - * event was sent. The operation should be retried. - * - * No other return values are possible. - */ -static int -completeio_send(isc_socket_t *sock, isc_socketevent_t *dev, - struct msghdr *messagehdr, int cc, int send_errno) -{ - char addrbuf[ISC_SOCKADDR_FORMATSIZE]; - char strbuf[ISC_STRERRORSIZE]; - - if (send_errno != 0) { - if (SOFT_ERROR(send_errno)) - return (DOIO_SOFT); - - return (map_socket_error(sock, send_errno, &dev->result, - strbuf, sizeof(strbuf))); - - /* - * The other error types depend on whether or not the - * socket is UDP or TCP. If it is UDP, some errors - * that we expect to be fatal under TCP are merely - * annoying, and are really soft errors. - * - * However, these soft errors are still returned as - * a status. - */ - isc_sockaddr_format(&dev->address, addrbuf, sizeof(addrbuf)); - isc__strerror(send_errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, "completeio_send: %s: %s", - addrbuf, strbuf); - dev->result = isc__errno2result(send_errno); - return (DOIO_HARD); - } - - /* - * If we write less than we expected, update counters, poke. - */ - dev->n += cc; - if (cc != messagehdr->msg_totallen) - return (DOIO_SOFT); - - /* - * Exactly what we wanted to write. We're done with this - * entry. Post its completion event. - */ - dev->result = ISC_R_SUCCESS; - return (DOIO_SUCCESS); -} - -static int -startio_send(isc_socket_t *sock, isc_socketevent_t *dev, int *nbytes, - int *send_errno) -{ - char *cmsg = NULL; - char strbuf[ISC_STRERRORSIZE]; - IoCompletionInfo *lpo; - int status; - struct msghdr *msghdr; - - lpo = (IoCompletionInfo *)HeapAlloc(hHeapHandle, - HEAP_ZERO_MEMORY, - sizeof(IoCompletionInfo)); - RUNTIME_CHECK(lpo != NULL); - lpo->request_type = SOCKET_SEND; - lpo->dev = dev; - msghdr = &lpo->messagehdr; - memset(msghdr, 0, sizeof(struct msghdr)); - ISC_LIST_INIT(lpo->bufferlist); - - build_msghdr_send(sock, dev, msghdr, cmsg, sock->iov, lpo); - - *nbytes = internal_sendmsg(sock, lpo, msghdr, 0, send_errno); - - if (*nbytes < 0) { - /* - * I/O has been initiated - * completion will be through the completion port - */ - if (PENDING_ERROR(*send_errno)) { - status = DOIO_PENDING; - goto done; - } - - if (SOFT_ERROR(*send_errno)) { - status = DOIO_SOFT; - goto done; - } - - /* - * If we got this far then something is wrong - */ - if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL)) { - isc__strerror(*send_errno, strbuf, sizeof(strbuf)); - socket_log(__LINE__, sock, NULL, IOEVENT, - isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_INTERNALSEND, - "startio_send: internal_sendmsg(%d) %d " - "bytes, err %d/%s", - sock->fd, *nbytes, *send_errno, strbuf); - } - status = DOIO_HARD; - goto done; - } - dev->result = ISC_R_SUCCESS; - status = DOIO_SOFT; - done: - _set_state(sock, SOCK_DATA); - return (status); -} - -static isc_result_t -allocate_socket(isc_socketmgr_t *manager, isc_sockettype_t type, - isc_socket_t **socketp) { - isc_socket_t *sock; - isc_result_t result; - - sock = isc_mem_get(manager->mctx, sizeof(*sock)); - - if (sock == NULL) - return (ISC_R_NOMEMORY); - - sock->magic = 0; - sock->references = 0; - - sock->manager = manager; - sock->type = type; - sock->fd = INVALID_SOCKET; - - ISC_LINK_INIT(sock, link); - - /* - * set up list of readers and writers to be initially empty - */ - ISC_LIST_INIT(sock->recv_list); - ISC_LIST_INIT(sock->send_list); - ISC_LIST_INIT(sock->accept_list); - sock->connect_ev = NULL; - sock->pending_accept = 0; - sock->pending_recv = 0; - sock->pending_send = 0; - sock->pending_iocp = 0; - sock->listener = 0; - sock->connected = 0; - sock->pending_connect = 0; - sock->bound = 0; - sock->dupped = 0; - memset(sock->name, 0, sizeof(sock->name)); // zero the name field - _set_state(sock, SOCK_INITIALIZED); - - sock->recvbuf.len = 65536; - sock->recvbuf.consume_position = sock->recvbuf.base; - sock->recvbuf.remaining = 0; - sock->recvbuf.base = isc_mem_get(manager->mctx, sock->recvbuf.len); // max buffer size - if (sock->recvbuf.base == NULL) { - sock->magic = 0; - goto error; - } - - /* - * initialize the lock - */ - result = isc_mutex_init(&sock->lock); - if (result != ISC_R_SUCCESS) { - sock->magic = 0; - isc_mem_put(manager->mctx, sock->recvbuf.base, sock->recvbuf.len); - sock->recvbuf.base = NULL; - goto error; - } - - socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0, - "allocated"); - - sock->magic = SOCKET_MAGIC; - *socketp = sock; - - return (ISC_R_SUCCESS); - - error: - isc_mem_put(manager->mctx, sock, sizeof(*sock)); - - return (result); -} - -/* - * Verify that the socket state is consistent. - */ -static void -consistent(isc_socket_t *sock) { - - isc_socketevent_t *dev; - isc_socket_newconnev_t *nev; - unsigned int count; - char *crash_reason; - isc_boolean_t crash = ISC_FALSE; - - REQUIRE(sock->pending_iocp == sock->pending_recv + sock->pending_send - + sock->pending_accept + sock->pending_connect); - - dev = ISC_LIST_HEAD(sock->send_list); - count = 0; - while (dev != NULL) { - count++; - dev = ISC_LIST_NEXT(dev, ev_link); - } - if (count > sock->pending_send) { - crash = ISC_TRUE; - crash_reason = "send_list > sock->pending_send"; - } - - nev = ISC_LIST_HEAD(sock->accept_list); - count = 0; - while (nev != NULL) { - count++; - nev = ISC_LIST_NEXT(nev, ev_link); - } - if (count > sock->pending_accept) { - crash = ISC_TRUE; - crash_reason = "send_list > sock->pending_send"; - } - - if (crash) { - socket_log(__LINE__, sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_DESTROYING, "SOCKET INCONSISTENT: %s", - crash_reason); - sock_dump(sock); - INSIST(crash == ISC_FALSE); - } -} - -/* - * Maybe free the socket. - * - * This function will verify tht the socket is no longer in use in any way, - * either internally or externally. This is the only place where this - * check is to be made; if some bit of code believes that IT is done with - * the socket (e.g., some reference counter reaches zero), it should call - * this function. - * - * When calling this function, the socket must be locked, and the manager - * must be unlocked. - * - * When this function returns, *socketp will be NULL. No tricks to try - * to hold on to this pointer are allowed. - */ -static void -maybe_free_socket(isc_socket_t **socketp, int lineno) { - isc_socket_t *sock = *socketp; - *socketp = NULL; - - INSIST(VALID_SOCKET(sock)); - CONSISTENT(sock); - - if (sock->pending_iocp > 0 - || sock->pending_recv > 0 - || sock->pending_send > 0 - || sock->pending_accept > 0 - || sock->references > 0 - || sock->pending_connect == 1 - || !ISC_LIST_EMPTY(sock->recv_list) - || !ISC_LIST_EMPTY(sock->send_list) - || !ISC_LIST_EMPTY(sock->accept_list) - || sock->fd != INVALID_SOCKET) { - UNLOCK(&sock->lock); - return; - } - UNLOCK(&sock->lock); - - free_socket(&sock, lineno); -} - -void -free_socket(isc_socket_t **sockp, int lineno) { - isc_socketmgr_t *manager; - isc_socket_t *sock = *sockp; - *sockp = NULL; - - manager = sock->manager; - - /* - * Seems we can free the socket after all. - */ - manager = sock->manager; - socket_log(__LINE__, sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_DESTROYING, "freeing socket line %d fd %d lock %p semaphore %p", - lineno, sock->fd, &sock->lock, sock->lock.LockSemaphore); - - sock->magic = 0; - DESTROYLOCK(&sock->lock); - - if (sock->recvbuf.base != NULL) - isc_mem_put(manager->mctx, sock->recvbuf.base, sock->recvbuf.len); - - LOCK(&manager->lock); - if (ISC_LINK_LINKED(sock, link)) - ISC_LIST_UNLINK(manager->socklist, sock, link); - isc_mem_put(manager->mctx, sock, sizeof(*sock)); - - if (ISC_LIST_EMPTY(manager->socklist)) - SIGNAL(&manager->shutdown_ok); - UNLOCK(&manager->lock); -} - -/* - * Create a new 'type' socket managed by 'manager'. Events - * will be posted to 'task' and when dispatched 'action' will be - * called with 'arg' as the arg value. The new socket is returned - * in 'socketp'. - */ -static isc_result_t -socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type, - isc_socket_t **socketp, isc_socket_t *dup_socket) -{ - isc_socket_t *sock = NULL; - isc_result_t result; -#if defined(USE_CMSG) - int on = 1; -#endif -#if defined(SO_RCVBUF) - ISC_SOCKADDR_LEN_T optlen; - int size; -#endif - int socket_errno; - char strbuf[ISC_STRERRORSIZE]; - - REQUIRE(VALID_MANAGER(manager)); - REQUIRE(socketp != NULL && *socketp == NULL); - REQUIRE(type != isc_sockettype_fdwatch); - - if (dup_socket != NULL) - return (ISC_R_NOTIMPLEMENTED); - - result = allocate_socket(manager, type, &sock); - if (result != ISC_R_SUCCESS) - return (result); - - sock->pf = pf; -#if 0 - if (dup_socket == NULL) { -#endif - switch (type) { - case isc_sockettype_udp: - sock->fd = socket(pf, SOCK_DGRAM, IPPROTO_UDP); - if (sock->fd != INVALID_SOCKET) { - result = connection_reset_fix(sock->fd); - if (result != ISC_R_SUCCESS) { - socket_log(__LINE__, sock, - NULL, EVENT, NULL, 0, 0, - "closed %d %d %d " - "con_reset_fix_failed", - sock->pending_recv, - sock->pending_send, - sock->references); - closesocket(sock->fd); - _set_state(sock, SOCK_CLOSED); - sock->fd = INVALID_SOCKET; - free_socket(&sock, __LINE__); - return (result); - } - } - break; - case isc_sockettype_tcp: - sock->fd = socket(pf, SOCK_STREAM, IPPROTO_TCP); - break; - } -#if 0 - } else { - /* - * XXX: dup() is deprecated in windows, use _dup() - * instead. In future we may want to investigate - * WSADuplicateSocket(). - */ - sock->fd = _dup(dup_socket->fd); - sock->dupped = 1; - sock->bound = dup_socket->bound; - } -#endif - - if (sock->fd == INVALID_SOCKET) { - socket_errno = WSAGetLastError(); - free_socket(&sock, __LINE__); - - switch (socket_errno) { - case WSAEMFILE: - case WSAENOBUFS: - return (ISC_R_NORESOURCES); - - case WSAEPROTONOSUPPORT: - case WSAEPFNOSUPPORT: - case WSAEAFNOSUPPORT: - return (ISC_R_FAMILYNOSUPPORT); - - default: - isc__strerror(socket_errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "socket() %s: %s", - isc_msgcat_get(isc_msgcat, - ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, - "failed"), - strbuf); - return (ISC_R_UNEXPECTED); - } - } - - result = make_nonblock(sock->fd); - if (result != ISC_R_SUCCESS) { - socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0, - "closed %d %d %d make_nonblock_failed", - sock->pending_recv, sock->pending_send, - sock->references); - closesocket(sock->fd); - sock->fd = INVALID_SOCKET; - free_socket(&sock, __LINE__); - return (result); - } - - -#if defined(USE_CMSG) || defined(SO_RCVBUF) - if (type == isc_sockettype_udp) { - -#if defined(USE_CMSG) -#if defined(ISC_PLATFORM_HAVEIPV6) -#ifdef IPV6_RECVPKTINFO - /* 2292bis */ - if ((pf == AF_INET6) - && (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, - (char *)&on, sizeof(on)) < 0)) { - isc__strerror(WSAGetLastError(), strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "setsockopt(%d, IPV6_RECVPKTINFO) " - "%s: %s", sock->fd, - isc_msgcat_get(isc_msgcat, - ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, - "failed"), - strbuf); - } -#else - /* 2292 */ - if ((pf == AF_INET6) - && (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_PKTINFO, - (char *)&on, sizeof(on)) < 0)) { - isc__strerror(WSAGetLastError(), strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "setsockopt(%d, IPV6_PKTINFO) %s: %s", - sock->fd, - isc_msgcat_get(isc_msgcat, - ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, - "failed"), - strbuf); - } -#endif /* IPV6_RECVPKTINFO */ -#ifdef IPV6_USE_MIN_MTU /*2292bis, not too common yet*/ - /* use minimum MTU */ - if (pf == AF_INET6) { - (void)setsockopt(sock->fd, IPPROTO_IPV6, - IPV6_USE_MIN_MTU, - (char *)&on, sizeof(on)); - } -#endif -#endif /* ISC_PLATFORM_HAVEIPV6 */ -#endif /* defined(USE_CMSG) */ - -#if defined(SO_RCVBUF) - optlen = sizeof(size); - if (getsockopt(sock->fd, SOL_SOCKET, SO_RCVBUF, - (char *)&size, &optlen) >= 0 && - size < RCVBUFSIZE) { - size = RCVBUFSIZE; - (void)setsockopt(sock->fd, SOL_SOCKET, SO_RCVBUF, - (char *)&size, sizeof(size)); - } -#endif - - } -#endif /* defined(USE_CMSG) || defined(SO_RCVBUF) */ - - _set_state(sock, SOCK_OPEN); - sock->references = 1; - *socketp = sock; - - iocompletionport_update(sock); - - /* - * Note we don't have to lock the socket like we normally would because - * there are no external references to it yet. - */ - LOCK(&manager->lock); - ISC_LIST_APPEND(manager->socklist, sock, link); - InterlockedIncrement(&manager->totalSockets); - UNLOCK(&manager->lock); - - socket_log(__LINE__, sock, NULL, CREATION, isc_msgcat, - ISC_MSGSET_SOCKET, ISC_MSG_CREATED, - "created %u type %u", sock->fd, type); - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc__socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type, - isc_socket_t **socketp) -{ - return (socket_create(manager, pf, type, socketp, NULL)); -} - -isc_result_t -isc__socket_dup(isc_socket_t *sock, isc_socket_t **socketp) { - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(socketp != NULL && *socketp == NULL); - -#if 1 - return (ISC_R_NOTIMPLEMENTED); -#else - return (socket_create(sock->manager, sock->pf, sock->type, - socketp, sock)); -#endif -} - -isc_result_t -isc_socket_open(isc_socket_t *sock) { - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(sock->type != isc_sockettype_fdwatch); - - return (ISC_R_NOTIMPLEMENTED); -} - -/* - * Attach to a socket. Caller must explicitly detach when it is done. - */ -void -isc__socket_attach(isc_socket_t *sock, isc_socket_t **socketp) { - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(socketp != NULL && *socketp == NULL); - - LOCK(&sock->lock); - CONSISTENT(sock); - sock->references++; - UNLOCK(&sock->lock); - - *socketp = sock; -} - -/* - * Dereference a socket. If this is the last reference to it, clean things - * up by destroying the socket. - */ -void -isc__socket_detach(isc_socket_t **socketp) { - isc_socket_t *sock; - isc_boolean_t kill_socket = ISC_FALSE; - - REQUIRE(socketp != NULL); - sock = *socketp; - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(sock->type != isc_sockettype_fdwatch); - - LOCK(&sock->lock); - CONSISTENT(sock); - REQUIRE(sock->references > 0); - sock->references--; - - socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0, - "detach_socket %d %d %d", - sock->pending_recv, sock->pending_send, - sock->references); - - if (sock->references == 0 && sock->fd != INVALID_SOCKET) { - closesocket(sock->fd); - sock->fd = INVALID_SOCKET; - _set_state(sock, SOCK_CLOSED); - } - - maybe_free_socket(&sock, __LINE__); - - *socketp = NULL; -} - -isc_result_t -isc_socket_close(isc_socket_t *sock) { - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(sock->type != isc_sockettype_fdwatch); - - return (ISC_R_NOTIMPLEMENTED); -} - -/* - * Dequeue an item off the given socket's read queue, set the result code - * in the done event to the one provided, and send it to the task it was - * destined for. - * - * If the event to be sent is on a list, remove it before sending. If - * asked to, send and detach from the task as well. - * - * Caller must have the socket locked if the event is attached to the socket. - */ -static void -send_recvdone_event(isc_socket_t *sock, isc_socketevent_t **dev) { - isc_task_t *task; - - task = (*dev)->ev_sender; - (*dev)->ev_sender = sock; - - if (ISC_LINK_LINKED(*dev, ev_link)) - ISC_LIST_DEQUEUE(sock->recv_list, *dev, ev_link); - - if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED) - == ISC_SOCKEVENTATTR_ATTACHED) - isc_task_sendanddetach(&task, (isc_event_t **)dev); - else - isc_task_send(task, (isc_event_t **)dev); - - CONSISTENT(sock); -} - -/* - * See comments for send_recvdone_event() above. - */ -static void -send_senddone_event(isc_socket_t *sock, isc_socketevent_t **dev) { - isc_task_t *task; - - INSIST(dev != NULL && *dev != NULL); - - task = (*dev)->ev_sender; - (*dev)->ev_sender = sock; - - if (ISC_LINK_LINKED(*dev, ev_link)) - ISC_LIST_DEQUEUE(sock->send_list, *dev, ev_link); - - if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED) - == ISC_SOCKEVENTATTR_ATTACHED) - isc_task_sendanddetach(&task, (isc_event_t **)dev); - else - isc_task_send(task, (isc_event_t **)dev); - - CONSISTENT(sock); -} - -/* - * See comments for send_recvdone_event() above. - */ -static void -send_acceptdone_event(isc_socket_t *sock, isc_socket_newconnev_t **adev) { - isc_task_t *task; - - INSIST(adev != NULL && *adev != NULL); - - task = (*adev)->ev_sender; - (*adev)->ev_sender = sock; - - if (ISC_LINK_LINKED(*adev, ev_link)) - ISC_LIST_DEQUEUE(sock->accept_list, *adev, ev_link); - - isc_task_sendanddetach(&task, (isc_event_t **)adev); - - CONSISTENT(sock); -} - -/* - * See comments for send_recvdone_event() above. - */ -static void -send_connectdone_event(isc_socket_t *sock, isc_socket_connev_t **cdev) { - isc_task_t *task; - - INSIST(cdev != NULL && *cdev != NULL); - - task = (*cdev)->ev_sender; - (*cdev)->ev_sender = sock; - - sock->connect_ev = NULL; - - isc_task_sendanddetach(&task, (isc_event_t **)cdev); - - CONSISTENT(sock); -} - -/* - * On entry to this function, the event delivered is the internal - * readable event, and the first item on the accept_list should be - * the done event we want to send. If the list is empty, this is a no-op, - * so just close the new connection, unlock, and return. - * - * Note the socket is locked before entering here - */ -static void -internal_accept(isc_socket_t *sock, IoCompletionInfo *lpo, int accept_errno) { - isc_socket_newconnev_t *adev; - isc_result_t result = ISC_R_SUCCESS; - isc_socket_t *nsock; - struct sockaddr *localaddr; - int localaddr_len = sizeof(*localaddr); - struct sockaddr *remoteaddr; - int remoteaddr_len = sizeof(*remoteaddr); - - INSIST(VALID_SOCKET(sock)); - LOCK(&sock->lock); - CONSISTENT(sock); - - socket_log(__LINE__, sock, NULL, TRACE, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTLOCK, - "internal_accept called"); - - INSIST(sock->listener); - - INSIST(sock->pending_iocp > 0); - sock->pending_iocp--; - INSIST(sock->pending_accept > 0); - sock->pending_accept--; - - adev = lpo->adev; - - /* - * If the event is no longer in the list we can just return. - */ - if (!acceptdone_is_active(sock, adev)) - goto done; - - nsock = adev->newsocket; - - /* - * Pull off the done event. - */ - ISC_LIST_UNLINK(sock->accept_list, adev, ev_link); - - /* - * Extract the addresses from the socket, copy them into the structure, - * and return the new socket. - */ - ISCGetAcceptExSockaddrs(lpo->acceptbuffer, 0, - sizeof(SOCKADDR_STORAGE) + 16, sizeof(SOCKADDR_STORAGE) + 16, - (LPSOCKADDR *)&localaddr, &localaddr_len, - (LPSOCKADDR *)&remoteaddr, &remoteaddr_len); - memcpy(&adev->address.type, remoteaddr, remoteaddr_len); - adev->address.length = remoteaddr_len; - nsock->address = adev->address; - nsock->pf = adev->address.type.sa.sa_family; - - socket_log(__LINE__, nsock, &nsock->address, TRACE, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTLOCK, - "internal_accept parent %p", sock); - - result = make_nonblock(adev->newsocket->fd); - INSIST(result == ISC_R_SUCCESS); - - INSIST(setsockopt(nsock->fd, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT, - (char *)&sock->fd, sizeof(sock->fd)) == 0); - - /* - * Hook it up into the manager. - */ - nsock->bound = 1; - nsock->connected = 1; - _set_state(nsock, SOCK_OPEN); - - LOCK(&nsock->manager->lock); - ISC_LIST_APPEND(nsock->manager->socklist, nsock, link); - InterlockedIncrement(&nsock->manager->totalSockets); - UNLOCK(&nsock->manager->lock); - - socket_log(__LINE__, sock, &nsock->address, CREATION, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTEDCXN, - "accepted_connection new_socket %p fd %d", - nsock, nsock->fd); - - adev->result = result; - send_acceptdone_event(sock, &adev); - -done: - CONSISTENT(sock); - UNLOCK(&sock->lock); - - HeapFree(hHeapHandle, 0, lpo->acceptbuffer); - lpo->acceptbuffer = NULL; -} - -/* - * Called when a socket with a pending connect() finishes. - * Note that the socket is locked before entering. - */ -static void -internal_connect(isc_socket_t *sock, IoCompletionInfo *lpo, int connect_errno) { - isc_socket_connev_t *cdev; - char strbuf[ISC_STRERRORSIZE]; - - INSIST(VALID_SOCKET(sock)); - - LOCK(&sock->lock); - - INSIST(sock->pending_iocp > 0); - sock->pending_iocp--; - INSIST(sock->pending_connect == 1); - sock->pending_connect = 0; - - /* - * Has this event been canceled? - */ - cdev = lpo->cdev; - if (!connectdone_is_active(sock, cdev)) { - sock->pending_connect = 0; - if (sock->fd != INVALID_SOCKET) { - closesocket(sock->fd); - sock->fd = INVALID_SOCKET; - _set_state(sock, SOCK_CLOSED); - } - CONSISTENT(sock); - UNLOCK(&sock->lock); - return; - } - - /* - * Check possible Windows network event error status here. - */ - if (connect_errno != 0) { - /* - * If the error is SOFT, just try again on this - * fd and pretend nothing strange happened. - */ - if (SOFT_ERROR(connect_errno) || - connect_errno == WSAEINPROGRESS) { - sock->pending_connect = 1; - CONSISTENT(sock); - UNLOCK(&sock->lock); - return; - } - - /* - * Translate other errors into ISC_R_* flavors. - */ - switch (connect_errno) { -#define ERROR_MATCH(a, b) case a: cdev->result = b; break; - ERROR_MATCH(WSAEACCES, ISC_R_NOPERM); - ERROR_MATCH(WSAEADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL); - ERROR_MATCH(WSAEAFNOSUPPORT, ISC_R_ADDRNOTAVAIL); - ERROR_MATCH(WSAECONNREFUSED, ISC_R_CONNREFUSED); - ERROR_MATCH(WSAEHOSTUNREACH, ISC_R_HOSTUNREACH); - ERROR_MATCH(WSAEHOSTDOWN, ISC_R_HOSTDOWN); - ERROR_MATCH(WSAENETUNREACH, ISC_R_NETUNREACH); - ERROR_MATCH(WSAENETDOWN, ISC_R_NETDOWN); - ERROR_MATCH(WSAENOBUFS, ISC_R_NORESOURCES); - ERROR_MATCH(WSAECONNRESET, ISC_R_CONNECTIONRESET); - ERROR_MATCH(WSAECONNABORTED, ISC_R_CONNECTIONRESET); - ERROR_MATCH(WSAETIMEDOUT, ISC_R_TIMEDOUT); -#undef ERROR_MATCH - default: - cdev->result = ISC_R_UNEXPECTED; - isc__strerror(connect_errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "internal_connect: connect() %s", - strbuf); - } - } else { - INSIST(setsockopt(sock->fd, SOL_SOCKET, - SO_UPDATE_CONNECT_CONTEXT, NULL, 0) == 0); - cdev->result = ISC_R_SUCCESS; - sock->connected = 1; - socket_log(__LINE__, sock, &sock->address, IOEVENT, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTEDCXN, - "internal_connect: success"); - } - - send_connectdone_event(sock, &cdev); - - UNLOCK(&sock->lock); -} - -/* - * Loop through the socket, returning ISC_R_EOF for each done event pending. - */ -static void -send_recvdone_abort(isc_socket_t *sock, isc_result_t result) { - isc_socketevent_t *dev; - - while (!ISC_LIST_EMPTY(sock->recv_list)) { - dev = ISC_LIST_HEAD(sock->recv_list); - dev->result = result; - send_recvdone_event(sock, &dev); - } -} - -/* - * Take the data we received in our private buffer, and if any recv() calls on - * our list are satisfied, send the corresponding done event. - * - * If we need more data (there are still items on the recv_list after we consume all - * our data) then arrange for another system recv() call to fill our buffers. - */ -static void -internal_recv(isc_socket_t *sock, int nbytes) -{ - INSIST(VALID_SOCKET(sock)); - - LOCK(&sock->lock); - CONSISTENT(sock); - - socket_log(__LINE__, sock, NULL, IOEVENT, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALRECV, - "internal_recv: %d bytes received", nbytes); - - /* - * If we got here, the I/O operation succeeded. However, we might still have removed this - * event from our notification list (or never placed it on it due to immediate completion.) - * Handle the reference counting here, and handle the cancellation event just after. - */ - INSIST(sock->pending_iocp > 0); - sock->pending_iocp--; - INSIST(sock->pending_recv > 0); - sock->pending_recv--; - - /* - * The only way we could have gotten here is that our I/O has successfully completed. - * Update our pointers, and move on. The only odd case here is that we might not - * have received enough data on a TCP stream to satisfy the minimum requirements. If - * this is the case, we will re-issue the recv() call for what we need. - * - * We do check for a recv() of 0 bytes on a TCP stream. This means the remote end - * has closed. - */ - if (nbytes == 0 && sock->type == isc_sockettype_tcp) { - send_recvdone_abort(sock, ISC_R_EOF); - maybe_free_socket(&sock, __LINE__); - return; - } - sock->recvbuf.remaining = nbytes; - sock->recvbuf.consume_position = sock->recvbuf.base; - completeio_recv(sock); - - /* - * If there are more receivers waiting for data, queue another receive - * here. - */ - queue_receive_request(sock); - - /* - * Unlock and/or destroy if we are the last thing this socket has left to do. - */ - maybe_free_socket(&sock, __LINE__); -} - -static void -internal_send(isc_socket_t *sock, isc_socketevent_t *dev, - struct msghdr *messagehdr, int nbytes, int send_errno, IoCompletionInfo *lpo) -{ - buflist_t *buffer; - - /* - * Find out what socket this is and lock it. - */ - INSIST(VALID_SOCKET(sock)); - - LOCK(&sock->lock); - CONSISTENT(sock); - - socket_log(__LINE__, sock, NULL, IOEVENT, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALSEND, - "internal_send: task got socket event %p", dev); - - buffer = ISC_LIST_HEAD(lpo->bufferlist); - while (buffer != NULL) { - ISC_LIST_DEQUEUE(lpo->bufferlist, buffer, link); - - socket_log(__LINE__, sock, NULL, TRACE, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTLOCK, - "free_buffer %p %p", buffer, buffer->buf); - - HeapFree(hHeapHandle, 0, buffer->buf); - HeapFree(hHeapHandle, 0, buffer); - buffer = ISC_LIST_HEAD(lpo->bufferlist); - } - - INSIST(sock->pending_iocp > 0); - sock->pending_iocp--; - INSIST(sock->pending_send > 0); - sock->pending_send--; - - /* If the event is no longer in the list we can just return */ - if (!senddone_is_active(sock, dev)) - goto done; - - /* - * Set the error code and send things on its way. - */ - switch (completeio_send(sock, dev, messagehdr, nbytes, send_errno)) { - case DOIO_SOFT: - break; - case DOIO_HARD: - case DOIO_SUCCESS: - send_senddone_event(sock, &dev); - break; - } - - done: - maybe_free_socket(&sock, __LINE__); -} - -/* - * These return if the done event passed in is on the list (or for connect, is - * the one we're waiting for. Using these ensures we will not double-send an - * event. - */ -static isc_boolean_t -senddone_is_active(isc_socket_t *sock, isc_socketevent_t *dev) -{ - isc_socketevent_t *ldev; - - ldev = ISC_LIST_HEAD(sock->send_list); - while (ldev != NULL && ldev != dev) - ldev = ISC_LIST_NEXT(ldev, ev_link); - - return (ldev == NULL ? ISC_FALSE : ISC_TRUE); -} - -static isc_boolean_t -acceptdone_is_active(isc_socket_t *sock, isc_socket_newconnev_t *dev) -{ - isc_socket_newconnev_t *ldev; - - ldev = ISC_LIST_HEAD(sock->accept_list); - while (ldev != NULL && ldev != dev) - ldev = ISC_LIST_NEXT(ldev, ev_link); - - return (ldev == NULL ? ISC_FALSE : ISC_TRUE); -} - -static isc_boolean_t -connectdone_is_active(isc_socket_t *sock, isc_socket_connev_t *dev) -{ - return (sock->connect_ev == dev ? ISC_TRUE : ISC_FALSE); -} - -// -// The Windows network stack seems to have two very distinct paths depending -// on what is installed. Specifically, if something is looking at network -// connections (like an anti-virus or anti-malware application, such as -// McAfee products) Windows may return additional error conditions which -// were not previously returned. -// -// One specific one is when a TCP SYN scan is used. In this situation, -// Windows responds with the SYN-ACK, but the scanner never responds with -// the 3rd packet, the ACK. Windows consiers this a partially open connection. -// Most Unix networking stacks, and Windows without McAfee installed, will -// not return this to the caller. However, with this product installed, -// Windows returns this as a failed status on the Accept() call. Here, we -// will just re-issue the ISCAcceptEx() call as if nothing had happened. -// -// This code should only be called when the listening socket has received -// such an error. Additionally, the "parent" socket must be locked. -// Additionally, the lpo argument is re-used here, and must not be freed -// by the caller. -// -static isc_result_t -restart_accept(isc_socket_t *parent, IoCompletionInfo *lpo) -{ - isc_socket_t *nsock = lpo->adev->newsocket; - SOCKET new_fd; - - /* - * AcceptEx() requires we pass in a socket. Note that we carefully - * do not close the previous socket in case of an error message returned by - * our new socket() call. If we return an error here, our caller will - * clean up. - */ - new_fd = socket(parent->pf, SOCK_STREAM, IPPROTO_TCP); - if (nsock->fd == INVALID_SOCKET) { - return (ISC_R_FAILURE); // parent will ask windows for error message - } - closesocket(nsock->fd); - nsock->fd = new_fd; - - memset(&lpo->overlapped, 0, sizeof(lpo->overlapped)); - - ISCAcceptEx(parent->fd, - nsock->fd, /* Accepted Socket */ - lpo->acceptbuffer, /* Buffer for initial Recv */ - 0, /* Length of Buffer */ - sizeof(SOCKADDR_STORAGE) + 16, /* Local address length + 16 */ - sizeof(SOCKADDR_STORAGE) + 16, /* Remote address lengh + 16 */ - (LPDWORD)&lpo->received_bytes, /* Bytes Recved */ - (LPOVERLAPPED)lpo /* Overlapped structure */ - ); - - InterlockedDecrement(&nsock->manager->iocp_total); - iocompletionport_update(nsock); - - return (ISC_R_SUCCESS); -} - -/* - * This is the I/O Completion Port Worker Function. It loops forever - * waiting for I/O to complete and then forwards them for further - * processing. There are a number of these in separate threads. - */ -static isc_threadresult_t WINAPI -SocketIoThread(LPVOID ThreadContext) { - isc_socketmgr_t *manager = ThreadContext; - BOOL bSuccess = FALSE; - DWORD nbytes; - IoCompletionInfo *lpo = NULL; - isc_socket_t *sock = NULL; - int request; - struct msghdr *messagehdr = NULL; - int errval; - char strbuf[ISC_STRERRORSIZE]; - int errstatus; - - REQUIRE(VALID_MANAGER(manager)); - - /* - * Set the thread priority high enough so I/O will - * preempt normal recv packet processing, but not - * higher than the timer sync thread. - */ - if (!SetThreadPriority(GetCurrentThread(), - THREAD_PRIORITY_ABOVE_NORMAL)) { - errval = GetLastError(); - isc__strerror(errval, strbuf, sizeof(strbuf)); - FATAL_ERROR(__FILE__, __LINE__, - isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_FAILED, - "Can't set thread priority: %s"), - strbuf); - } - - /* - * Loop forever waiting on I/O Completions and then processing them - */ - while (TRUE) { - wait_again: - bSuccess = GetQueuedCompletionStatus(manager->hIoCompletionPort, - &nbytes, (LPDWORD)&sock, - (LPWSAOVERLAPPED *)&lpo, - INFINITE); - if (lpo == NULL) /* Received request to exit */ - break; - - REQUIRE(VALID_SOCKET(sock)); - - request = lpo->request_type; - - errstatus = 0; - if (!bSuccess) { - isc_result_t isc_result; - - /* - * Did the I/O operation complete? - */ - errstatus = GetLastError(); - isc_result = isc__errno2resultx(errstatus, __FILE__, __LINE__); - - LOCK(&sock->lock); - CONSISTENT(sock); - switch (request) { - case SOCKET_RECV: - INSIST(sock->pending_iocp > 0); - sock->pending_iocp--; - INSIST(sock->pending_recv > 0); - sock->pending_recv--; - if (!sock->connected && - ((errstatus == ERROR_HOST_UNREACHABLE) || - (errstatus == WSAENETRESET) || - (errstatus == WSAECONNRESET))) { - /* ignore soft errors */ - queue_receive_request(sock); - break; - } - send_recvdone_abort(sock, isc_result); - if (isc_result == ISC_R_UNEXPECTED) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "SOCKET_RECV: Windows error code: %d, returning ISC error %d", - errstatus, isc_result); - } - break; - - case SOCKET_SEND: - INSIST(sock->pending_iocp > 0); - sock->pending_iocp--; - INSIST(sock->pending_send > 0); - sock->pending_send--; - if (senddone_is_active(sock, lpo->dev)) { - lpo->dev->result = isc_result; - socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0, - "canceled_send"); - send_senddone_event(sock, &lpo->dev); - } - break; - - case SOCKET_ACCEPT: - INSIST(sock->pending_iocp > 0); - INSIST(sock->pending_accept > 0); - - socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0, - "Accept: errstatus=%d isc_result=%d", errstatus, isc_result); - - if (acceptdone_is_active(sock, lpo->adev)) { - if (restart_accept(sock, lpo) == ISC_R_SUCCESS) { - UNLOCK(&sock->lock); - goto wait_again; - } else { - errstatus = GetLastError(); - isc_result = isc__errno2resultx(errstatus, __FILE__, __LINE__); - socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0, - "restart_accept() failed: errstatus=%d isc_result=%d", - errstatus, isc_result); - } - } - - sock->pending_iocp--; - sock->pending_accept--; - if (acceptdone_is_active(sock, lpo->adev)) { - closesocket(lpo->adev->newsocket->fd); - lpo->adev->newsocket->fd = INVALID_SOCKET; - lpo->adev->newsocket->references--; - free_socket(&lpo->adev->newsocket, __LINE__); - lpo->adev->result = isc_result; - socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0, - "canceled_accept"); - send_acceptdone_event(sock, &lpo->adev); - } - break; - - case SOCKET_CONNECT: - INSIST(sock->pending_iocp > 0); - sock->pending_iocp--; - INSIST(sock->pending_connect == 1); - sock->pending_connect = 0; - if (connectdone_is_active(sock, lpo->cdev)) { - lpo->cdev->result = isc_result; - socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0, - "canceled_connect"); - send_connectdone_event(sock, &lpo->cdev); - } - break; - } - maybe_free_socket(&sock, __LINE__); - - if (lpo != NULL) - HeapFree(hHeapHandle, 0, lpo); - continue; - } - - messagehdr = &lpo->messagehdr; - - switch (request) { - case SOCKET_RECV: - internal_recv(sock, nbytes); - break; - case SOCKET_SEND: - internal_send(sock, lpo->dev, messagehdr, nbytes, errstatus, lpo); - break; - case SOCKET_ACCEPT: - internal_accept(sock, lpo, errstatus); - break; - case SOCKET_CONNECT: - internal_connect(sock, lpo, errstatus); - break; - } - - if (lpo != NULL) - HeapFree(hHeapHandle, 0, lpo); - } - - /* - * Exit Completion Port Thread - */ - manager_log(manager, TRACE, - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_EXITING, "SocketIoThread exiting")); - return ((isc_threadresult_t)0); -} - -/* - * Create a new socket manager. - */ -isc_result_t -isc__socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp) { - return (isc_socketmgr_create2(mctx, managerp, 0)); -} - -isc_result_t -isc__socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp, - unsigned int maxsocks) -{ - isc_socketmgr_t *manager; - isc_result_t result; - - REQUIRE(managerp != NULL && *managerp == NULL); - - if (maxsocks != 0) - return (ISC_R_NOTIMPLEMENTED); - - manager = isc_mem_get(mctx, sizeof(*manager)); - if (manager == NULL) - return (ISC_R_NOMEMORY); - - InitSockets(); - - manager->magic = SOCKET_MANAGER_MAGIC; - manager->mctx = NULL; - manager->stats = NULL; - ISC_LIST_INIT(manager->socklist); - result = isc_mutex_init(&manager->lock); - if (result != ISC_R_SUCCESS) { - isc_mem_put(mctx, manager, sizeof(*manager)); - return (result); - } - if (isc_condition_init(&manager->shutdown_ok) != ISC_R_SUCCESS) { - DESTROYLOCK(&manager->lock); - isc_mem_put(mctx, manager, sizeof(*manager)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_condition_init() %s", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed")); - return (ISC_R_UNEXPECTED); - } - - isc_mem_attach(mctx, &manager->mctx); - - iocompletionport_init(manager); /* Create the Completion Ports */ - - manager->bShutdown = ISC_FALSE; - manager->totalSockets = 0; - manager->iocp_total = 0; - - *managerp = manager; - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc__socketmgr_getmaxsockets(isc_socketmgr_t *manager, unsigned int *nsockp) { - REQUIRE(VALID_MANAGER(manager)); - REQUIRE(nsockp != NULL); - - return (ISC_R_NOTIMPLEMENTED); -} - -void -isc__socketmgr_setstats(isc_socketmgr_t *manager, isc_stats_t *stats) { - REQUIRE(VALID_MANAGER(manager)); - REQUIRE(ISC_LIST_EMPTY(manager->socklist)); - REQUIRE(manager->stats == NULL); - REQUIRE(isc_stats_ncounters(stats) == isc_sockstatscounter_max); - - isc_stats_attach(stats, &manager->stats); -} - -void -isc__socketmgr_destroy(isc_socketmgr_t **managerp) { - isc_socketmgr_t *manager; - int i; - isc_mem_t *mctx; - - /* - * Destroy a socket manager. - */ - - REQUIRE(managerp != NULL); - manager = *managerp; - REQUIRE(VALID_MANAGER(manager)); - - LOCK(&manager->lock); - - /* - * Wait for all sockets to be destroyed. - */ - while (!ISC_LIST_EMPTY(manager->socklist)) { - manager_log(manager, CREATION, - isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_SOCKETSREMAIN, - "sockets exist")); - WAIT(&manager->shutdown_ok, &manager->lock); - } - - UNLOCK(&manager->lock); - - /* - * Here, we need to had some wait code for the completion port - * thread. - */ - signal_iocompletionport_exit(manager); - manager->bShutdown = ISC_TRUE; - - /* - * Wait for threads to exit. - */ - for (i = 0; i < manager->maxIOCPThreads; i++) { - if (isc_thread_join((isc_thread_t) manager->hIOCPThreads[i], - NULL) != ISC_R_SUCCESS) - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_thread_join() for Completion Port %s", - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed")); - } - /* - * Clean up. - */ - - CloseHandle(manager->hIoCompletionPort); - - (void)isc_condition_destroy(&manager->shutdown_ok); - - DESTROYLOCK(&manager->lock); - if (manager->stats != NULL) - isc_stats_detach(&manager->stats); - manager->magic = 0; - mctx= manager->mctx; - isc_mem_put(mctx, manager, sizeof(*manager)); - - isc_mem_detach(&mctx); - - *managerp = NULL; -} - -static void -queue_receive_event(isc_socket_t *sock, isc_task_t *task, isc_socketevent_t *dev) -{ - isc_task_t *ntask = NULL; - - isc_task_attach(task, &ntask); - dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED; - - /* - * Enqueue the request. - */ - INSIST(!ISC_LINK_LINKED(dev, ev_link)); - ISC_LIST_ENQUEUE(sock->recv_list, dev, ev_link); - - socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0, - "queue_receive_event: event %p -> task %p", - dev, ntask); -} - -/* - * Check the pending receive queue, and if we have data pending, give it to this - * caller. If we have none, queue an I/O request. If this caller is not the first - * on the list, then we will just queue this event and return. - * - * Caller must have the socket locked. - */ -static isc_result_t -socket_recv(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task, - unsigned int flags) -{ - int cc = 0; - isc_task_t *ntask = NULL; - isc_result_t result = ISC_R_SUCCESS; - int recv_errno = 0; - - dev->ev_sender = task; - - if (sock->fd == INVALID_SOCKET) - return (ISC_R_EOF); - - /* - * Queue our event on the list of things to do. Call our function to - * attempt to fill buffers as much as possible, and return done events. - * We are going to lie about our handling of the ISC_SOCKFLAG_IMMEDIATE - * here and tell our caller that we could not satisfy it immediately. - */ - queue_receive_event(sock, task, dev); - if ((flags & ISC_SOCKFLAG_IMMEDIATE) != 0) - result = ISC_R_INPROGRESS; - - completeio_recv(sock); - - /* - * If there are more receivers waiting for data, queue another receive - * here. If the - */ - queue_receive_request(sock); - - return (result); -} - -isc_result_t -isc__socket_recvv(isc_socket_t *sock, isc_bufferlist_t *buflist, - unsigned int minimum, isc_task_t *task, - isc_taskaction_t action, const void *arg) -{ - isc_socketevent_t *dev; - isc_socketmgr_t *manager; - unsigned int iocount; - isc_buffer_t *buffer; - isc_result_t ret; - - REQUIRE(VALID_SOCKET(sock)); - LOCK(&sock->lock); - CONSISTENT(sock); - - /* - * Make sure that the socket is not closed. XXXMLG change error here? - */ - if (sock->fd == INVALID_SOCKET) { - UNLOCK(&sock->lock); - return (ISC_R_CONNREFUSED); - } - - REQUIRE(buflist != NULL); - REQUIRE(!ISC_LIST_EMPTY(*buflist)); - REQUIRE(task != NULL); - REQUIRE(action != NULL); - - manager = sock->manager; - REQUIRE(VALID_MANAGER(manager)); - - iocount = isc_bufferlist_availablecount(buflist); - REQUIRE(iocount > 0); - - INSIST(sock->bound); - - dev = allocate_socketevent(sock, ISC_SOCKEVENT_RECVDONE, action, arg); - if (dev == NULL) { - UNLOCK(&sock->lock); - return (ISC_R_NOMEMORY); - } - - /* - * UDP sockets are always partial read - */ - if (sock->type == isc_sockettype_udp) - dev->minimum = 1; - else { - if (minimum == 0) - dev->minimum = iocount; - else - dev->minimum = minimum; - } - - /* - * Move each buffer from the passed in list to our internal one. - */ - buffer = ISC_LIST_HEAD(*buflist); - while (buffer != NULL) { - ISC_LIST_DEQUEUE(*buflist, buffer, link); - ISC_LIST_ENQUEUE(dev->bufferlist, buffer, link); - buffer = ISC_LIST_HEAD(*buflist); - } - - ret = socket_recv(sock, dev, task, 0); - - UNLOCK(&sock->lock); - return (ret); -} - -isc_result_t -isc__socket_recv(isc_socket_t *sock, isc_region_t *region, - unsigned int minimum, isc_task_t *task, - isc_taskaction_t action, const void *arg) -{ - isc_socketevent_t *dev; - isc_socketmgr_t *manager; - isc_result_t ret; - - REQUIRE(VALID_SOCKET(sock)); - LOCK(&sock->lock); - CONSISTENT(sock); - - /* - * make sure that the socket's not closed - */ - if (sock->fd == INVALID_SOCKET) { - UNLOCK(&sock->lock); - return (ISC_R_CONNREFUSED); - } - REQUIRE(action != NULL); - - manager = sock->manager; - REQUIRE(VALID_MANAGER(manager)); - - INSIST(sock->bound); - - dev = allocate_socketevent(sock, ISC_SOCKEVENT_RECVDONE, action, arg); - if (dev == NULL) { - UNLOCK(&sock->lock); - return (ISC_R_NOMEMORY); - } - - ret = isc_socket_recv2(sock, region, minimum, task, dev, 0); - UNLOCK(&sock->lock); - return (ret); -} - -isc_result_t -isc__socket_recv2(isc_socket_t *sock, isc_region_t *region, - unsigned int minimum, isc_task_t *task, - isc_socketevent_t *event, unsigned int flags) -{ - isc_result_t ret; - - REQUIRE(VALID_SOCKET(sock)); - LOCK(&sock->lock); - CONSISTENT(sock); - - event->result = ISC_R_UNEXPECTED; - event->ev_sender = sock; - /* - * make sure that the socket's not closed - */ - if (sock->fd == INVALID_SOCKET) { - UNLOCK(&sock->lock); - return (ISC_R_CONNREFUSED); - } - - ISC_LIST_INIT(event->bufferlist); - event->region = *region; - event->n = 0; - event->offset = 0; - event->attributes = 0; - - /* - * UDP sockets are always partial read. - */ - if (sock->type == isc_sockettype_udp) - event->minimum = 1; - else { - if (minimum == 0) - event->minimum = region->length; - else - event->minimum = minimum; - } - - ret = socket_recv(sock, event, task, flags); - UNLOCK(&sock->lock); - return (ret); -} - -/* - * Caller must have the socket locked. - */ -static isc_result_t -socket_send(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task, - isc_sockaddr_t *address, struct in6_pktinfo *pktinfo, - unsigned int flags) -{ - int io_state; - int send_errno = 0; - int cc = 0; - isc_task_t *ntask = NULL; - isc_result_t result = ISC_R_SUCCESS; - - dev->ev_sender = task; - - set_dev_address(address, sock, dev); - if (pktinfo != NULL) { - socket_log(__LINE__, sock, NULL, TRACE, isc_msgcat, ISC_MSGSET_SOCKET, - ISC_MSG_PKTINFOPROVIDED, - "pktinfo structure provided, ifindex %u (set to 0)", - pktinfo->ipi6_ifindex); - - dev->attributes |= ISC_SOCKEVENTATTR_PKTINFO; - dev->pktinfo = *pktinfo; - /* - * Set the pktinfo index to 0 here, to let the kernel decide - * what interface it should send on. - */ - dev->pktinfo.ipi6_ifindex = 0; - } - - io_state = startio_send(sock, dev, &cc, &send_errno); - switch (io_state) { - case DOIO_PENDING: /* I/O started. Nothing more to do */ - case DOIO_SOFT: - /* - * We couldn't send all or part of the request right now, so - * queue it unless ISC_SOCKFLAG_NORETRY is set. - */ - if ((flags & ISC_SOCKFLAG_NORETRY) == 0) { - isc_task_attach(task, &ntask); - dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED; - - /* - * Enqueue the request. - */ - INSIST(!ISC_LINK_LINKED(dev, ev_link)); - ISC_LIST_ENQUEUE(sock->send_list, dev, ev_link); - - socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0, - "socket_send: event %p -> task %p", - dev, ntask); - - if ((flags & ISC_SOCKFLAG_IMMEDIATE) != 0) - result = ISC_R_INPROGRESS; - break; - } - - case DOIO_SUCCESS: - break; - } - - return (result); -} - -isc_result_t -isc__socket_send(isc_socket_t *sock, isc_region_t *region, - isc_task_t *task, isc_taskaction_t action, const void *arg) -{ - /* - * REQUIRE() checking is performed in isc_socket_sendto(). - */ - return (isc_socket_sendto(sock, region, task, action, arg, NULL, - NULL)); -} - -isc_result_t -isc__socket_sendto(isc_socket_t *sock, isc_region_t *region, - isc_task_t *task, isc_taskaction_t action, const void *arg, - isc_sockaddr_t *address, struct in6_pktinfo *pktinfo) -{ - isc_socketevent_t *dev; - isc_socketmgr_t *manager; - isc_result_t ret; - - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(sock->type != isc_sockettype_fdwatch); - - LOCK(&sock->lock); - CONSISTENT(sock); - - /* - * make sure that the socket's not closed - */ - if (sock->fd == INVALID_SOCKET) { - UNLOCK(&sock->lock); - return (ISC_R_CONNREFUSED); - } - REQUIRE(region != NULL); - REQUIRE(task != NULL); - REQUIRE(action != NULL); - - manager = sock->manager; - REQUIRE(VALID_MANAGER(manager)); - - INSIST(sock->bound); - - dev = allocate_socketevent(sock, ISC_SOCKEVENT_SENDDONE, action, arg); - if (dev == NULL) { - UNLOCK(&sock->lock); - return (ISC_R_NOMEMORY); - } - dev->region = *region; - - ret = socket_send(sock, dev, task, address, pktinfo, 0); - UNLOCK(&sock->lock); - return (ret); -} - -isc_result_t -isc__socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, const void *arg) -{ - return (isc_socket_sendtov(sock, buflist, task, action, arg, NULL, - NULL)); -} - -isc_result_t -isc__socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, const void *arg, - isc_sockaddr_t *address, struct in6_pktinfo *pktinfo) -{ - isc_socketevent_t *dev; - isc_socketmgr_t *manager; - unsigned int iocount; - isc_buffer_t *buffer; - isc_result_t ret; - - REQUIRE(VALID_SOCKET(sock)); - - LOCK(&sock->lock); - CONSISTENT(sock); - - /* - * make sure that the socket's not closed - */ - if (sock->fd == INVALID_SOCKET) { - UNLOCK(&sock->lock); - return (ISC_R_CONNREFUSED); - } - REQUIRE(buflist != NULL); - REQUIRE(!ISC_LIST_EMPTY(*buflist)); - REQUIRE(task != NULL); - REQUIRE(action != NULL); - - manager = sock->manager; - REQUIRE(VALID_MANAGER(manager)); - - iocount = isc_bufferlist_usedcount(buflist); - REQUIRE(iocount > 0); - - dev = allocate_socketevent(sock, ISC_SOCKEVENT_SENDDONE, action, arg); - if (dev == NULL) { - UNLOCK(&sock->lock); - return (ISC_R_NOMEMORY); - } - - /* - * Move each buffer from the passed in list to our internal one. - */ - buffer = ISC_LIST_HEAD(*buflist); - while (buffer != NULL) { - ISC_LIST_DEQUEUE(*buflist, buffer, link); - ISC_LIST_ENQUEUE(dev->bufferlist, buffer, link); - buffer = ISC_LIST_HEAD(*buflist); - } - - ret = socket_send(sock, dev, task, address, pktinfo, 0); - UNLOCK(&sock->lock); - return (ret); -} - -isc_result_t -isc__socket_sendto2(isc_socket_t *sock, isc_region_t *region, - isc_task_t *task, - isc_sockaddr_t *address, struct in6_pktinfo *pktinfo, - isc_socketevent_t *event, unsigned int flags) -{ - isc_result_t ret; - - REQUIRE(VALID_SOCKET(sock)); - LOCK(&sock->lock); - CONSISTENT(sock); - - REQUIRE((flags & ~(ISC_SOCKFLAG_IMMEDIATE|ISC_SOCKFLAG_NORETRY)) == 0); - if ((flags & ISC_SOCKFLAG_NORETRY) != 0) - REQUIRE(sock->type == isc_sockettype_udp); - event->ev_sender = sock; - event->result = ISC_R_UNEXPECTED; - /* - * make sure that the socket's not closed - */ - if (sock->fd == INVALID_SOCKET) { - UNLOCK(&sock->lock); - return (ISC_R_CONNREFUSED); - } - ISC_LIST_INIT(event->bufferlist); - event->region = *region; - event->n = 0; - event->offset = 0; - event->attributes = 0; - - ret = socket_send(sock, event, task, address, pktinfo, flags); - UNLOCK(&sock->lock); - return (ret); -} - -isc_result_t -isc__socket_bind(isc_socket_t *sock, isc_sockaddr_t *sockaddr, - unsigned int options) { - int bind_errno; - char strbuf[ISC_STRERRORSIZE]; - int on = 1; - - REQUIRE(VALID_SOCKET(sock)); - LOCK(&sock->lock); - CONSISTENT(sock); - - /* - * make sure that the socket's not closed - */ - if (sock->fd == INVALID_SOCKET) { - UNLOCK(&sock->lock); - return (ISC_R_CONNREFUSED); - } - - INSIST(!sock->bound); - INSIST(!sock->dupped); - - if (sock->pf != sockaddr->type.sa.sa_family) { - UNLOCK(&sock->lock); - return (ISC_R_FAMILYMISMATCH); - } - /* - * Only set SO_REUSEADDR when we want a specific port. - */ - if ((options & ISC_SOCKET_REUSEADDRESS) != 0 && - isc_sockaddr_getport(sockaddr) != (in_port_t)0 && - setsockopt(sock->fd, SOL_SOCKET, SO_REUSEADDR, (char *)&on, - sizeof(on)) < 0) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "setsockopt(%d) %s", sock->fd, - isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, - ISC_MSG_FAILED, "failed")); - /* Press on... */ - } - if (bind(sock->fd, &sockaddr->type.sa, sockaddr->length) < 0) { - bind_errno = WSAGetLastError(); - UNLOCK(&sock->lock); - switch (bind_errno) { - case WSAEACCES: - return (ISC_R_NOPERM); - case WSAEADDRNOTAVAIL: - return (ISC_R_ADDRNOTAVAIL); - case WSAEADDRINUSE: - return (ISC_R_ADDRINUSE); - case WSAEINVAL: - return (ISC_R_BOUND); - default: - isc__strerror(bind_errno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, "bind: %s", - strbuf); - return (ISC_R_UNEXPECTED); - } - } - - socket_log(__LINE__, sock, sockaddr, TRACE, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_BOUND, "bound"); - sock->bound = 1; - - UNLOCK(&sock->lock); - return (ISC_R_SUCCESS); -} - -isc_result_t -isc__socket_filter(isc_socket_t *sock, const char *filter) { - UNUSED(sock); - UNUSED(filter); - - REQUIRE(VALID_SOCKET(sock)); - return (ISC_R_NOTIMPLEMENTED); -} - -/* - * Set up to listen on a given socket. We do this by creating an internal - * event that will be dispatched when the socket has read activity. The - * watcher will send the internal event to the task when there is a new - * connection. - * - * Unlike in read, we don't preallocate a done event here. Every time there - * is a new connection we'll have to allocate a new one anyway, so we might - * as well keep things simple rather than having to track them. - */ -isc_result_t -isc__socket_listen(isc_socket_t *sock, unsigned int backlog) { - char strbuf[ISC_STRERRORSIZE]; - - REQUIRE(VALID_SOCKET(sock)); - - LOCK(&sock->lock); - CONSISTENT(sock); - - /* - * make sure that the socket's not closed - */ - if (sock->fd == INVALID_SOCKET) { - UNLOCK(&sock->lock); - return (ISC_R_CONNREFUSED); - } - - REQUIRE(!sock->listener); - REQUIRE(sock->bound); - REQUIRE(sock->type == isc_sockettype_tcp); - - if (backlog == 0) - backlog = SOMAXCONN; - - if (listen(sock->fd, (int)backlog) < 0) { - UNLOCK(&sock->lock); - isc__strerror(WSAGetLastError(), strbuf, sizeof(strbuf)); - - UNEXPECTED_ERROR(__FILE__, __LINE__, "listen: %s", strbuf); - - return (ISC_R_UNEXPECTED); - } - - socket_log(__LINE__, sock, NULL, TRACE, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_BOUND, "listening"); - sock->listener = 1; - _set_state(sock, SOCK_LISTEN); - - UNLOCK(&sock->lock); - return (ISC_R_SUCCESS); -} - -/* - * This should try to do aggressive accept() XXXMLG - */ -isc_result_t -isc__socket_accept(isc_socket_t *sock, - isc_task_t *task, isc_taskaction_t action, const void *arg) -{ - isc_socket_newconnev_t *adev; - isc_socketmgr_t *manager; - isc_task_t *ntask = NULL; - isc_socket_t *nsock; - isc_result_t result; - IoCompletionInfo *lpo; - - REQUIRE(VALID_SOCKET(sock)); - - manager = sock->manager; - REQUIRE(VALID_MANAGER(manager)); - - LOCK(&sock->lock); - CONSISTENT(sock); - - /* - * make sure that the socket's not closed - */ - if (sock->fd == INVALID_SOCKET) { - UNLOCK(&sock->lock); - return (ISC_R_CONNREFUSED); - } - - REQUIRE(sock->listener); - - /* - * Sender field is overloaded here with the task we will be sending - * this event to. Just before the actual event is delivered the - * actual ev_sender will be touched up to be the socket. - */ - adev = (isc_socket_newconnev_t *) - isc_event_allocate(manager->mctx, task, ISC_SOCKEVENT_NEWCONN, - action, arg, sizeof(*adev)); - if (adev == NULL) { - UNLOCK(&sock->lock); - return (ISC_R_NOMEMORY); - } - ISC_LINK_INIT(adev, ev_link); - - result = allocate_socket(manager, sock->type, &nsock); - if (result != ISC_R_SUCCESS) { - isc_event_free((isc_event_t **)&adev); - UNLOCK(&sock->lock); - return (result); - } - - /* - * AcceptEx() requires we pass in a socket. - */ - nsock->fd = socket(sock->pf, SOCK_STREAM, IPPROTO_TCP); - if (nsock->fd == INVALID_SOCKET) { - free_socket(&nsock, __LINE__); - isc_event_free((isc_event_t **)&adev); - UNLOCK(&sock->lock); - return (ISC_R_FAILURE); // XXXMLG need real error message - } - - /* - * Attach to socket and to task. - */ - isc_task_attach(task, &ntask); - if (isc_task_exiting(ntask)) { - free_socket(&nsock, __LINE__); - isc_task_detach(&ntask); - isc_event_free(ISC_EVENT_PTR(&adev)); - UNLOCK(&sock->lock); - return (ISC_R_SHUTTINGDOWN); - } - nsock->references++; - - adev->ev_sender = ntask; - adev->newsocket = nsock; - _set_state(nsock, SOCK_ACCEPT); - - /* - * Queue io completion for an accept(). - */ - lpo = (IoCompletionInfo *)HeapAlloc(hHeapHandle, - HEAP_ZERO_MEMORY, - sizeof(IoCompletionInfo)); - RUNTIME_CHECK(lpo != NULL); - lpo->acceptbuffer = (void *)HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY, - (sizeof(SOCKADDR_STORAGE) + 16) * 2); - RUNTIME_CHECK(lpo->acceptbuffer != NULL); - - lpo->adev = adev; - lpo->request_type = SOCKET_ACCEPT; - - ISCAcceptEx(sock->fd, - nsock->fd, /* Accepted Socket */ - lpo->acceptbuffer, /* Buffer for initial Recv */ - 0, /* Length of Buffer */ - sizeof(SOCKADDR_STORAGE) + 16, /* Local address length + 16 */ - sizeof(SOCKADDR_STORAGE) + 16, /* Remote address lengh + 16 */ - (LPDWORD)&lpo->received_bytes, /* Bytes Recved */ - (LPOVERLAPPED)lpo /* Overlapped structure */ - ); - iocompletionport_update(nsock); - - socket_log(__LINE__, sock, NULL, TRACE, - isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_BOUND, - "accepting for nsock %p fd %d", nsock, nsock->fd); - - /* - * Enqueue the event - */ - ISC_LIST_ENQUEUE(sock->accept_list, adev, ev_link); - sock->pending_accept++; - sock->pending_iocp++; - - UNLOCK(&sock->lock); - return (ISC_R_SUCCESS); -} - -isc_result_t -isc__socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr, - isc_task_t *task, isc_taskaction_t action, const void *arg) -{ - char strbuf[ISC_STRERRORSIZE]; - isc_socket_connev_t *cdev; - isc_task_t *ntask = NULL; - isc_socketmgr_t *manager; - IoCompletionInfo *lpo; - int bind_errno; - - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(addr != NULL); - REQUIRE(task != NULL); - REQUIRE(action != NULL); - - manager = sock->manager; - REQUIRE(VALID_MANAGER(manager)); - REQUIRE(addr != NULL); - - if (isc_sockaddr_ismulticast(addr)) - return (ISC_R_MULTICAST); - - LOCK(&sock->lock); - CONSISTENT(sock); - - /* - * make sure that the socket's not closed - */ - if (sock->fd == INVALID_SOCKET) { - UNLOCK(&sock->lock); - return (ISC_R_CONNREFUSED); - } - - /* - * Windows sockets won't connect unless the socket is bound. - */ - if (!sock->bound) { - isc_sockaddr_t any; - - isc_sockaddr_anyofpf(&any, isc_sockaddr_pf(addr)); - if (bind(sock->fd, &any.type.sa, any.length) < 0) { - bind_errno = WSAGetLastError(); - UNLOCK(&sock->lock); - switch (bind_errno) { - case WSAEACCES: - return (ISC_R_NOPERM); - case WSAEADDRNOTAVAIL: - return (ISC_R_ADDRNOTAVAIL); - case WSAEADDRINUSE: - return (ISC_R_ADDRINUSE); - case WSAEINVAL: - return (ISC_R_BOUND); - default: - isc__strerror(bind_errno, strbuf, - sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "bind: %s", strbuf); - return (ISC_R_UNEXPECTED); - } - } - sock->bound = 1; - } - - REQUIRE(!sock->pending_connect); - - cdev = (isc_socket_connev_t *)isc_event_allocate(manager->mctx, sock, - ISC_SOCKEVENT_CONNECT, - action, arg, - sizeof(*cdev)); - if (cdev == NULL) { - UNLOCK(&sock->lock); - return (ISC_R_NOMEMORY); - } - ISC_LINK_INIT(cdev, ev_link); - - if (sock->type == isc_sockettype_tcp) { - /* - * Queue io completion for an accept(). - */ - lpo = (IoCompletionInfo *)HeapAlloc(hHeapHandle, - HEAP_ZERO_MEMORY, - sizeof(IoCompletionInfo)); - lpo->cdev = cdev; - lpo->request_type = SOCKET_CONNECT; - - sock->address = *addr; - ISCConnectEx(sock->fd, &addr->type.sa, addr->length, - NULL, 0, NULL, (LPOVERLAPPED)lpo); - - /* - * Attach to task. - */ - isc_task_attach(task, &ntask); - cdev->ev_sender = ntask; - - sock->pending_connect = 1; - _set_state(sock, SOCK_CONNECT); - - /* - * Enqueue the request. - */ - sock->connect_ev = cdev; - sock->pending_iocp++; - } else { - WSAConnect(sock->fd, &addr->type.sa, addr->length, NULL, NULL, NULL, NULL); - cdev->result = ISC_R_SUCCESS; - isc_task_send(task, (isc_event_t **)&cdev); - } - CONSISTENT(sock); - UNLOCK(&sock->lock); - - return (ISC_R_SUCCESS); -} - -isc_result_t -isc__socket_getpeername(isc_socket_t *sock, isc_sockaddr_t *addressp) { - isc_result_t result; - - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(addressp != NULL); - - LOCK(&sock->lock); - CONSISTENT(sock); - - /* - * make sure that the socket's not closed - */ - if (sock->fd == INVALID_SOCKET) { - UNLOCK(&sock->lock); - return (ISC_R_CONNREFUSED); - } - - if (sock->connected) { - *addressp = sock->address; - result = ISC_R_SUCCESS; - } else { - result = ISC_R_NOTCONNECTED; - } - - UNLOCK(&sock->lock); - - return (result); -} - -isc_result_t -isc__socket_getsockname(isc_socket_t *sock, isc_sockaddr_t *addressp) { - ISC_SOCKADDR_LEN_T len; - isc_result_t result; - char strbuf[ISC_STRERRORSIZE]; - - REQUIRE(VALID_SOCKET(sock)); - REQUIRE(addressp != NULL); - - LOCK(&sock->lock); - CONSISTENT(sock); - - /* - * make sure that the socket's not closed - */ - if (sock->fd == INVALID_SOCKET) { - UNLOCK(&sock->lock); - return (ISC_R_CONNREFUSED); - } - - if (!sock->bound) { - result = ISC_R_NOTBOUND; - goto out; - } - - result = ISC_R_SUCCESS; - - len = sizeof(addressp->type); - if (getsockname(sock->fd, &addressp->type.sa, (void *)&len) < 0) { - isc__strerror(WSAGetLastError(), strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, "getsockname: %s", - strbuf); - result = ISC_R_UNEXPECTED; - goto out; - } - addressp->length = (unsigned int)len; - - out: - UNLOCK(&sock->lock); - - return (result); -} - -/* - * Run through the list of events on this socket, and cancel the ones - * queued for task "task" of type "how". "how" is a bitmask. - */ -void -isc__socket_cancel(isc_socket_t *sock, isc_task_t *task, unsigned int how) { - - REQUIRE(VALID_SOCKET(sock)); - - /* - * Quick exit if there is nothing to do. Don't even bother locking - * in this case. - */ - if (how == 0) - return; - - LOCK(&sock->lock); - CONSISTENT(sock); - - /* - * make sure that the socket's not closed - */ - if (sock->fd == INVALID_SOCKET) { - UNLOCK(&sock->lock); - return; - } - - /* - * All of these do the same thing, more or less. - * Each will: - * o If the internal event is marked as "posted" try to - * remove it from the task's queue. If this fails, mark it - * as canceled instead, and let the task clean it up later. - * o For each I/O request for that task of that type, post - * its done event with status of "ISC_R_CANCELED". - * o Reset any state needed. - */ - - if ((how & ISC_SOCKCANCEL_RECV) == ISC_SOCKCANCEL_RECV) { - isc_socketevent_t *dev; - isc_socketevent_t *next; - isc_task_t *current_task; - - dev = ISC_LIST_HEAD(sock->recv_list); - while (dev != NULL) { - current_task = dev->ev_sender; - next = ISC_LIST_NEXT(dev, ev_link); - if ((task == NULL) || (task == current_task)) { - dev->result = ISC_R_CANCELED; - send_recvdone_event(sock, &dev); - } - dev = next; - } - } - how &= ~ISC_SOCKCANCEL_RECV; - - if ((how & ISC_SOCKCANCEL_SEND) == ISC_SOCKCANCEL_SEND) { - isc_socketevent_t *dev; - isc_socketevent_t *next; - isc_task_t *current_task; - - dev = ISC_LIST_HEAD(sock->send_list); - - while (dev != NULL) { - current_task = dev->ev_sender; - next = ISC_LIST_NEXT(dev, ev_link); - if ((task == NULL) || (task == current_task)) { - dev->result = ISC_R_CANCELED; - send_senddone_event(sock, &dev); - } - dev = next; - } - } - how &= ~ISC_SOCKCANCEL_SEND; - - if (((how & ISC_SOCKCANCEL_ACCEPT) == ISC_SOCKCANCEL_ACCEPT) - && !ISC_LIST_EMPTY(sock->accept_list)) { - isc_socket_newconnev_t *dev; - isc_socket_newconnev_t *next; - isc_task_t *current_task; - - dev = ISC_LIST_HEAD(sock->accept_list); - while (dev != NULL) { - current_task = dev->ev_sender; - next = ISC_LIST_NEXT(dev, ev_link); - - if ((task == NULL) || (task == current_task)) { - - dev->newsocket->references--; - closesocket(dev->newsocket->fd); - dev->newsocket->fd = INVALID_SOCKET; - free_socket(&dev->newsocket, __LINE__); - - dev->result = ISC_R_CANCELED; - send_acceptdone_event(sock, &dev); - } - - dev = next; - } - } - how &= ~ISC_SOCKCANCEL_ACCEPT; - - /* - * Connecting is not a list. - */ - if (((how & ISC_SOCKCANCEL_CONNECT) == ISC_SOCKCANCEL_CONNECT) - && sock->connect_ev != NULL) { - isc_socket_connev_t *dev; - isc_task_t *current_task; - - INSIST(sock->pending_connect); - - dev = sock->connect_ev; - current_task = dev->ev_sender; - - if ((task == NULL) || (task == current_task)) { - closesocket(sock->fd); - sock->fd = INVALID_SOCKET; - _set_state(sock, SOCK_CLOSED); - - sock->connect_ev = NULL; - dev->result = ISC_R_CANCELED; - send_connectdone_event(sock, &dev); - } - } - how &= ~ISC_SOCKCANCEL_CONNECT; - - maybe_free_socket(&sock, __LINE__); -} - -isc_sockettype_t -isc__socket_gettype(isc_socket_t *sock) { - isc_sockettype_t type; - - REQUIRE(VALID_SOCKET(sock)); - - LOCK(&sock->lock); - - /* - * make sure that the socket's not closed - */ - if (sock->fd == INVALID_SOCKET) { - UNLOCK(&sock->lock); - return (ISC_R_CONNREFUSED); - } - - type = sock->type; - UNLOCK(&sock->lock); - return (type); -} - -isc_boolean_t -isc__socket_isbound(isc_socket_t *sock) { - isc_boolean_t val; - - REQUIRE(VALID_SOCKET(sock)); - - LOCK(&sock->lock); - CONSISTENT(sock); - - /* - * make sure that the socket's not closed - */ - if (sock->fd == INVALID_SOCKET) { - UNLOCK(&sock->lock); - return (ISC_FALSE); - } - - val = ((sock->bound) ? ISC_TRUE : ISC_FALSE); - UNLOCK(&sock->lock); - - return (val); -} - -void -isc__socket_ipv6only(isc_socket_t *sock, isc_boolean_t yes) { -#if defined(IPV6_V6ONLY) - int onoff = yes ? 1 : 0; -#else - UNUSED(yes); -#endif - - REQUIRE(VALID_SOCKET(sock)); - -#ifdef IPV6_V6ONLY - if (sock->pf == AF_INET6) { - (void)setsockopt(sock->fd, IPPROTO_IPV6, IPV6_V6ONLY, - (char *)&onoff, sizeof(onoff)); - } -#endif -} - -void -isc__socket_cleanunix(isc_sockaddr_t *addr, isc_boolean_t active) { - UNUSED(addr); - UNUSED(active); -} - -isc_result_t -isc__socket_permunix(isc_sockaddr_t *addr, isc_uint32_t perm, - isc_uint32_t owner, isc_uint32_t group) -{ - UNUSED(addr); - UNUSED(perm); - UNUSED(owner); - UNUSED(group); - return (ISC_R_NOTIMPLEMENTED); -} - -void -isc__socket_setname(isc_socket_t *socket, const char *name, void *tag) { - - /* - * Name 'socket'. - */ - - REQUIRE(VALID_SOCKET(socket)); - - LOCK(&socket->lock); - memset(socket->name, 0, sizeof(socket->name)); - strncpy(socket->name, name, sizeof(socket->name) - 1); - socket->tag = tag; - UNLOCK(&socket->lock); -} - -const char * -isc__socket_getname(isc_socket_t *socket) { - return (socket->name); -} - -void * -isc__socket_gettag(isc_socket_t *socket) { - return (socket->tag); -} - -int -isc__socket_getfd(isc_socket_t *socket) { - return ((short) socket->fd); -} - -void -isc__socketmgr_setreserved(isc_socketmgr_t *manager, isc_uint32_t reserved) { - UNUSED(manager); - UNUSED(reserved); -} - -void -isc___socketmgr_maxudp(isc_socketmgr_t *manager, int maxudp) { - - UNUSED(manager); - UNUSED(maxudp); -} - -#ifdef HAVE_LIBXML2 - -static const char * -_socktype(isc_sockettype_t type) -{ - if (type == isc_sockettype_udp) - return ("udp"); - else if (type == isc_sockettype_tcp) - return ("tcp"); - else if (type == isc_sockettype_unix) - return ("unix"); - else if (type == isc_sockettype_fdwatch) - return ("fdwatch"); - else - return ("not-initialized"); -} - -void -isc_socketmgr_renderxml(isc_socketmgr_t *mgr, xmlTextWriterPtr writer) -{ - isc_socket_t *sock; - char peerbuf[ISC_SOCKADDR_FORMATSIZE]; - isc_sockaddr_t addr; - ISC_SOCKADDR_LEN_T len; - - LOCK(&mgr->lock); - -#ifndef ISC_PLATFORM_USETHREADS - xmlTextWriterStartElement(writer, ISC_XMLCHAR "references"); - xmlTextWriterWriteFormatString(writer, "%d", mgr->refs); - xmlTextWriterEndElement(writer); -#endif - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "sockets"); - sock = ISC_LIST_HEAD(mgr->socklist); - while (sock != NULL) { - LOCK(&sock->lock); - xmlTextWriterStartElement(writer, ISC_XMLCHAR "socket"); - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "id"); - xmlTextWriterWriteFormatString(writer, "%p", sock); - xmlTextWriterEndElement(writer); - - if (sock->name[0] != 0) { - xmlTextWriterStartElement(writer, ISC_XMLCHAR "name"); - xmlTextWriterWriteFormatString(writer, "%s", - sock->name); - xmlTextWriterEndElement(writer); /* name */ - } - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "references"); - xmlTextWriterWriteFormatString(writer, "%d", sock->references); - xmlTextWriterEndElement(writer); - - xmlTextWriterWriteElement(writer, ISC_XMLCHAR "type", - ISC_XMLCHAR _socktype(sock->type)); - - if (sock->connected) { - isc_sockaddr_format(&sock->address, peerbuf, - sizeof(peerbuf)); - xmlTextWriterWriteElement(writer, - ISC_XMLCHAR "peer-address", - ISC_XMLCHAR peerbuf); - } - - len = sizeof(addr); - if (getsockname(sock->fd, &addr.type.sa, (void *)&len) == 0) { - isc_sockaddr_format(&addr, peerbuf, sizeof(peerbuf)); - xmlTextWriterWriteElement(writer, - ISC_XMLCHAR "local-address", - ISC_XMLCHAR peerbuf); - } - - xmlTextWriterStartElement(writer, ISC_XMLCHAR "states"); - if (sock->pending_recv) - xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", - ISC_XMLCHAR "pending-receive"); - if (sock->pending_send) - xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", - ISC_XMLCHAR "pending-send"); - if (sock->pending_accept) - xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", - ISC_XMLCHAR "pending_accept"); - if (sock->listener) - xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", - ISC_XMLCHAR "listener"); - if (sock->connected) - xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", - ISC_XMLCHAR "connected"); - if (sock->pending_connect) - xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", - ISC_XMLCHAR "connecting"); - if (sock->bound) - xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", - ISC_XMLCHAR "bound"); - - xmlTextWriterEndElement(writer); /* states */ - - xmlTextWriterEndElement(writer); /* socket */ - - UNLOCK(&sock->lock); - sock = ISC_LIST_NEXT(sock, link); - } - xmlTextWriterEndElement(writer); /* sockets */ - - UNLOCK(&mgr->lock); -} -#endif /* HAVE_LIBXML2 */ diff --git a/lib/isc/win32/stdio.c b/lib/isc/win32/stdio.c deleted file mode 100644 index 427a8e1e1872..000000000000 --- a/lib/isc/win32/stdio.c +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: stdio.c,v 1.6 2007/06/19 23:47:19 tbox Exp $ */ - -#include - -#include -#include - -#include - -#include "errno2result.h" - -isc_result_t -isc_stdio_open(const char *filename, const char *mode, FILE **fp) { - FILE *f; - - f = fopen(filename, mode); - if (f == NULL) - return (isc__errno2result(errno)); - *fp = f; - return (ISC_R_SUCCESS); -} - -isc_result_t -isc_stdio_close(FILE *f) { - int r; - - r = fclose(f); - if (r == 0) - return (ISC_R_SUCCESS); - else - return (isc__errno2result(errno)); -} - -isc_result_t -isc_stdio_seek(FILE *f, long offset, int whence) { - int r; - - r = fseek(f, offset, whence); - if (r == 0) - return (ISC_R_SUCCESS); - else - return (isc__errno2result(errno)); -} - -isc_result_t -isc_stdio_read(void *ptr, size_t size, size_t nmemb, FILE *f, size_t *nret) { - isc_result_t result = ISC_R_SUCCESS; - size_t r; - - clearerr(f); - r = fread(ptr, size, nmemb, f); - if (r != nmemb) { - if (feof(f)) - result = ISC_R_EOF; - else - result = isc__errno2result(errno); - } - if (nret != NULL) - *nret = r; - return (result); -} - -isc_result_t -isc_stdio_write(const void *ptr, size_t size, size_t nmemb, FILE *f, - size_t *nret) -{ - isc_result_t result = ISC_R_SUCCESS; - size_t r; - - clearerr(f); - r = fwrite(ptr, size, nmemb, f); - if (r != nmemb) - result = isc__errno2result(errno); - if (nret != NULL) - *nret = r; - return (result); -} - -isc_result_t -isc_stdio_flush(FILE *f) { - int r; - - r = fflush(f); - if (r == 0) - return (ISC_R_SUCCESS); - else - return (isc__errno2result(errno)); -} - -isc_result_t -isc_stdio_sync(FILE *f) { - int r; - - r = _commit(_fileno(f)); - if (r == 0) - return (ISC_R_SUCCESS); - else - return (isc__errno2result(errno)); -} - diff --git a/lib/isc/win32/syslog.c b/lib/isc/win32/syslog.c deleted file mode 100644 index 375784f47798..000000000000 --- a/lib/isc/win32/syslog.c +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2001-2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: syslog.c,v 1.10 2007/06/19 23:47:19 tbox Exp $ */ - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -static HANDLE hAppLog = NULL; -static FILE *log_stream; -static int debug_level = 0; - -static struct dsn_c_pvt_sfnt { - int val; - const char *strval; -} facilities[] = { - { LOG_KERN, "kern" }, - { LOG_USER, "user" }, - { LOG_MAIL, "mail" }, - { LOG_DAEMON, "daemon" }, - { LOG_AUTH, "auth" }, - { LOG_SYSLOG, "syslog" }, - { LOG_LPR, "lpr" }, -#ifdef LOG_NEWS - { LOG_NEWS, "news" }, -#endif -#ifdef LOG_UUCP - { LOG_UUCP, "uucp" }, -#endif -#ifdef LOG_CRON - { LOG_CRON, "cron" }, -#endif -#ifdef LOG_AUTHPRIV - { LOG_AUTHPRIV, "authpriv" }, -#endif -#ifdef LOG_FTP - { LOG_FTP, "ftp" }, -#endif - { LOG_LOCAL0, "local0"}, - { LOG_LOCAL1, "local1"}, - { LOG_LOCAL2, "local2"}, - { LOG_LOCAL3, "local3"}, - { LOG_LOCAL4, "local4"}, - { LOG_LOCAL5, "local5"}, - { LOG_LOCAL6, "local6"}, - { LOG_LOCAL7, "local7"}, - { 0, NULL } -}; - -isc_result_t -isc_syslog_facilityfromstring(const char *str, int *facilityp) { - int i; - - REQUIRE(str != NULL); - REQUIRE(facilityp != NULL); - - for (i = 0; facilities[i].strval != NULL; i++) { - if (strcasecmp(facilities[i].strval, str) == 0) { - *facilityp = facilities[i].val; - return (ISC_R_SUCCESS); - } - } - return (ISC_R_NOTFOUND); -} - -/* - * Log to the NT Event Log - */ -void -syslog(int level, const char *fmt, ...) { - va_list ap; - char buf[1024]; - char *str[1]; - - str[0] = buf; - - va_start(ap, fmt); - vsprintf(buf, fmt, ap); - va_end(ap); - - /* Make sure that the channel is open to write the event */ - if (hAppLog != NULL) { - switch (level) { - case LOG_INFO: - case LOG_NOTICE: - case LOG_DEBUG: - ReportEvent(hAppLog, EVENTLOG_INFORMATION_TYPE, 0, - BIND_INFO_MSG, NULL, 1, 0, str, NULL); - break; - case LOG_WARNING: - ReportEvent(hAppLog, EVENTLOG_WARNING_TYPE, 0, - BIND_WARN_MSG, NULL, 1, 0, str, NULL); - break; - default: - ReportEvent(hAppLog, EVENTLOG_ERROR_TYPE, 0, - BIND_ERR_MSG, NULL, 1, 0, str, NULL); - break; - } - } -} - -/* - * Initialize event logging - */ -void -openlog(const char *name, int flags, ...) { - /* Get a handle to the Application event log */ - hAppLog = RegisterEventSource(NULL, name); -} - -/* - * Close the Handle to the application Event Log - * We don't care whether or not we succeeded so ignore return values - * In fact if we failed then we would have nowhere to put the message - */ -void -closelog() { - DeregisterEventSource(hAppLog); -} - -/* - * Keep event logging synced with the current debug level - */ -void -ModifyLogLevel(int level) { - debug_level = level; -} - -/* - * Initialize logging for the port section of libbind. - * Piggyback onto stream given. - */ -void -InitNTLogging(FILE *stream, int debug) { - log_stream = stream; - ModifyLogLevel(debug); -} -/* - * This function is for reporting errors to the application - * event log in case the regular syslog is not available - * mainly during startup. It should not be used under normal - * circumstances. - */ -void -NTReportError(const char *name, const char *str) { - HANDLE hNTAppLog = NULL; - const char *buf[1]; - - buf[0] = str; - - hNTAppLog = RegisterEventSource(NULL, name); - - ReportEvent(hNTAppLog, EVENTLOG_ERROR_TYPE, 0, - BIND_ERR_MSG, NULL, 1, 0, buf, NULL); - - DeregisterEventSource(hNTAppLog); -} diff --git a/lib/isc/win32/syslog.h b/lib/isc/win32/syslog.h deleted file mode 100644 index fd4b3a6bf233..000000000000 --- a/lib/isc/win32/syslog.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2001, 2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: syslog.h,v 1.7 2007/06/19 23:47:19 tbox Exp $ */ - -#ifndef _SYSLOG_H -#define _SYSLOG_H - -#include - -/* Constant definitions for openlog() */ -#define LOG_PID 1 -#define LOG_CONS 2 -/* NT event log does not support facility level */ -#define LOG_KERN 0 -#define LOG_USER 0 -#define LOG_MAIL 0 -#define LOG_DAEMON 0 -#define LOG_AUTH 0 -#define LOG_SYSLOG 0 -#define LOG_LPR 0 -#define LOG_LOCAL0 0 -#define LOG_LOCAL1 0 -#define LOG_LOCAL2 0 -#define LOG_LOCAL3 0 -#define LOG_LOCAL4 0 -#define LOG_LOCAL5 0 -#define LOG_LOCAL6 0 -#define LOG_LOCAL7 0 - -#define LOG_EMERG 0 /* system is unusable */ -#define LOG_ALERT 1 /* action must be taken immediately */ -#define LOG_CRIT 2 /* critical conditions */ -#define LOG_ERR 3 /* error conditions */ -#define LOG_WARNING 4 /* warning conditions */ -#define LOG_NOTICE 5 /* normal but signification condition */ -#define LOG_INFO 6 /* informational */ -#define LOG_DEBUG 7 /* debug-level messages */ - -void -syslog(int level, const char *fmt, ...); - -void -openlog(const char *, int, ...); - -void -closelog(void); - -void -ModifyLogLevel(int level); - -void -InitNTLogging(FILE *, int); - -void -NTReportError(const char *, const char *); -/* - * Include the event codes required for logging. - */ -#include - -#endif diff --git a/lib/isc/win32/unistd.h b/lib/isc/win32/unistd.h deleted file mode 100644 index bcb3b256da27..000000000000 --- a/lib/isc/win32/unistd.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2004, 2007-2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2000, 2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: unistd.h,v 1.10 2009/07/17 23:47:41 tbox Exp $ */ - -/* None of these are defined in NT, so define them for our use */ -#define O_NONBLOCK 1 -#define PORT_NONBLOCK O_NONBLOCK - -/* - * fcntl() commands - */ -#define F_SETFL 0 -#define F_GETFL 1 -#define F_SETFD 2 -#define F_GETFD 3 -/* - * Enough problems not having full fcntl() without worrying about this! - */ -#undef F_DUPFD - -int fcntl(int, int, ...); - -/* - * access() related definitions for winXP - */ -#include -#ifndef F_OK -#define F_OK 0 -#endif - -#ifndef X_OK -#define X_OK 1 -#endif - -#ifndef W_OK -#define W_OK 2 -#endif - -#ifndef R_OK -#define R_OK 4 -#endif - -#define access _access - -#include diff --git a/lib/isc/win32/version.c b/lib/isc/win32/version.c deleted file mode 100644 index 6d5c1fd92375..000000000000 --- a/lib/isc/win32/version.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: version.c,v 1.7 2007/06/19 23:47:19 tbox Exp $ */ - -#include - -#include - -LIBISC_EXTERNAL_DATA const char isc_version[] = VERSION; - -LIBISC_EXTERNAL_DATA const unsigned int isc_libinterface = LIBINTERFACE; -LIBISC_EXTERNAL_DATA const unsigned int isc_librevision = LIBREVISION; -LIBISC_EXTERNAL_DATA const unsigned int isc_libage = LIBAGE; diff --git a/lib/isc/x86_32/include/isc/atomic.h b/lib/isc/x86_32/include/isc/atomic.h deleted file mode 100644 index bf2148cb33f5..000000000000 --- a/lib/isc/x86_32/include/isc/atomic.h +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (C) 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: atomic.h,v 1.10 2008/01/24 23:47:00 tbox Exp $ */ - -#ifndef ISC_ATOMIC_H -#define ISC_ATOMIC_H 1 - -#include -#include - -#ifdef ISC_PLATFORM_USEGCCASM -/* - * This routine atomically increments the value stored in 'p' by 'val', and - * returns the previous value. - */ -static __inline__ isc_int32_t -isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) { - isc_int32_t prev = val; - - __asm__ volatile( -#ifdef ISC_PLATFORM_USETHREADS - "lock;" -#endif - "xadd %0, %1" - :"=q"(prev) - :"m"(*p), "0"(prev) - :"memory", "cc"); - - return (prev); -} - -#ifdef ISC_PLATFORM_HAVEXADDQ -static __inline__ isc_int64_t -isc_atomic_xaddq(isc_int64_t *p, isc_int64_t val) { - isc_int64_t prev = val; - - __asm__ volatile( -#ifdef ISC_PLATFORM_USETHREADS - "lock;" -#endif - "xaddq %0, %1" - :"=q"(prev) - :"m"(*p), "0"(prev) - :"memory", "cc"); - - return (prev); -} -#endif /* ISC_PLATFORM_HAVEXADDQ */ - -/* - * This routine atomically stores the value 'val' in 'p'. - */ -static __inline__ void -isc_atomic_store(isc_int32_t *p, isc_int32_t val) { - __asm__ volatile( -#ifdef ISC_PLATFORM_USETHREADS - /* - * xchg should automatically lock memory, but we add it - * explicitly just in case (it at least doesn't harm) - */ - "lock;" -#endif - - "xchgl %1, %0" - : - : "r"(val), "m"(*p) - : "memory"); -} - -/* - * This routine atomically replaces the value in 'p' with 'val', if the - * original value is equal to 'cmpval'. The original value is returned in any - * case. - */ -static __inline__ isc_int32_t -isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) { - __asm__ volatile( -#ifdef ISC_PLATFORM_USETHREADS - "lock;" -#endif - "cmpxchgl %1, %2" - : "=a"(cmpval) - : "r"(val), "m"(*p), "a"(cmpval) - : "memory"); - - return (cmpval); -} - -#elif defined(ISC_PLATFORM_USESTDASM) -/* - * The followings are "generic" assembly code which implements the same - * functionality in case the gcc extension cannot be used. It should be - * better to avoid inlining below, since we directly refer to specific - * positions of the stack frame, which would not actually point to the - * intended address in the embedded mnemonic. - */ -#include /* for 'UNUSED' macro */ - -static isc_int32_t -isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) { - UNUSED(p); - UNUSED(val); - - __asm ( - "movl 8(%ebp), %ecx\n" - "movl 12(%ebp), %edx\n" -#ifdef ISC_PLATFORM_USETHREADS - "lock;" -#endif - "xadd %edx, (%ecx)\n" - - /* - * set the return value directly in the register so that we - * can avoid guessing the correct position in the stack for a - * local variable. - */ - "movl %edx, %eax" - ); -} - -static void -isc_atomic_store(isc_int32_t *p, isc_int32_t val) { - UNUSED(p); - UNUSED(val); - - __asm ( - "movl 8(%ebp), %ecx\n" - "movl 12(%ebp), %edx\n" -#ifdef ISC_PLATFORM_USETHREADS - "lock;" -#endif - "xchgl (%ecx), %edx\n" - ); -} - -static isc_int32_t -isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) { - UNUSED(p); - UNUSED(cmpval); - UNUSED(val); - - __asm ( - "movl 8(%ebp), %ecx\n" - "movl 12(%ebp), %eax\n" /* must be %eax for cmpxchgl */ - "movl 16(%ebp), %edx\n" -#ifdef ISC_PLATFORM_USETHREADS - "lock;" -#endif - - /* - * If (%ecx) == %eax then (%ecx) := %edx. - % %eax is set to old (%ecx), which will be the return value. - */ - "cmpxchgl %edx, (%ecx)" - ); -} -#else /* !ISC_PLATFORM_USEGCCASM && !ISC_PLATFORM_USESTDASM */ - -#error "unsupported compiler. disable atomic ops by --disable-atomic" - -#endif -#endif /* ISC_ATOMIC_H */ diff --git a/lib/isc/x86_64/include/isc/atomic.h b/lib/isc/x86_64/include/isc/atomic.h deleted file mode 100644 index f57bd2a78672..000000000000 --- a/lib/isc/x86_64/include/isc/atomic.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (C) 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: atomic.h,v 1.6 2008/01/24 23:47:00 tbox Exp $ */ - -#ifndef ISC_ATOMIC_H -#define ISC_ATOMIC_H 1 - -#include -#include - -#ifdef ISC_PLATFORM_USEGCCASM - -/* We share the gcc-version with x86_32 */ -#error "impossible case. check build configuration" - -#elif defined(ISC_PLATFORM_USESTDASM) -/* - * The followings are "generic" assembly code which implements the same - * functionality in case the gcc extension cannot be used. It should be - * better to avoid inlining below, since we directly refer to specific - * registers for arguments, which would not actually correspond to the - * intended address or value in the embedded mnemonic. - */ -#include /* for 'UNUSED' macro */ - -static isc_int32_t -isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) { - UNUSED(p); - UNUSED(val); - - __asm ( - "movq %rdi, %rdx\n" - "movl %esi, %eax\n" -#ifdef ISC_PLATFORM_USETHREADS - "lock;" -#endif - "xadd %eax, (%rdx)\n" - /* - * XXX: assume %eax will be used as the return value. - */ - ); -} - -#ifdef ISC_PLATFORM_HAVEXADDQ -static isc_int64_t -isc_atomic_xaddq(isc_int64_t *p, isc_int64_t val) { - UNUSED(p); - UNUSED(val); - - __asm ( - "movq %rdi, %rdx\n" - "movq %rsi, %rax\n" -#ifdef ISC_PLATFORM_USETHREADS - "lock;" -#endif - "xaddq %rax, (%rdx)\n" - /* - * XXX: assume %rax will be used as the return value. - */ - ); -} -#endif - -static void -isc_atomic_store(isc_int32_t *p, isc_int32_t val) { - UNUSED(p); - UNUSED(val); - - __asm ( - "movq %rdi, %rax\n" - "movl %esi, %edx\n" -#ifdef ISC_PLATFORM_USETHREADS - "lock;" -#endif - "xchgl (%rax), %edx\n" - /* - * XXX: assume %rax will be used as the return value. - */ - ); -} - -static isc_int32_t -isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) { - UNUSED(p); - UNUSED(cmpval); - UNUSED(val); - - __asm ( - "movl %edx, %ecx\n" - "movl %esi, %eax\n" - "movq %rdi, %rdx\n" - -#ifdef ISC_PLATFORM_USETHREADS - "lock;" -#endif - /* - * If (%rdi) == %eax then (%rdi) := %edx. - * %eax is set to old (%ecx), which will be the return value. - */ - "cmpxchgl %ecx, (%rdx)" - ); -} - -#else /* !ISC_PLATFORM_USEGCCASM && !ISC_PLATFORM_USESTDASM */ - -#error "unsupported compiler. disable atomic ops by --disable-atomic" - -#endif -#endif /* ISC_ATOMIC_H */ diff --git a/libntp/Makefile.am b/libntp/Makefile.am index ddd1e01dd7ef..99ce273d4cd1 100644 --- a/libntp/Makefile.am +++ b/libntp/Makefile.am @@ -1,46 +1,147 @@ NULL= BUILT_SOURCES = CLEANFILES = +DISTCLEANFILES = noinst_LIBRARIES = libntp.a @MAKE_LIBNTPSIM@ EXTRA_LIBRARIES = libntpsim.a -libisc_SRCS = \ - $(srcdir)/../lib/isc/assertions.c \ - $(srcdir)/../lib/isc/buffer.c \ - $(srcdir)/../lib/isc/backtrace-emptytbl.c \ - $(srcdir)/../lib/isc/backtrace.c \ - $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c \ - $(srcdir)/../lib/isc/unix/dir.c \ - $(srcdir)/../lib/isc/error.c \ - $(srcdir)/../lib/isc/unix/errno2result.c \ - $(srcdir)/../lib/isc/event.c \ - $(srcdir)/../lib/isc/unix/file.c \ - $(srcdir)/../lib/isc/inet_ntop.c \ - $(srcdir)/../lib/isc/inet_pton.c \ - $(srcdir)/../lib/isc/unix/interfaceiter.c \ - $(srcdir)/../lib/isc/lib.c \ - $(srcdir)/../lib/isc/log.c \ - $(srcdir)/../lib/isc/md5.c \ - $(srcdir)/../lib/isc/nls/msgcat.c \ - $(srcdir)/../lib/isc/unix/net.c \ - $(srcdir)/../lib/isc/netaddr.c \ - $(srcdir)/../lib/isc/netscope.c \ - $(srcdir)/../lib/isc/ondestroy.c \ - $(srcdir)/../lib/isc/random.c \ - $(srcdir)/../lib/isc/result.c \ - $(srcdir)/../lib/isc/unix/stdio.c \ - $(srcdir)/../lib/isc/unix/stdtime.c \ - $(srcdir)/../lib/isc/unix/strerror.c \ - $(srcdir)/../lib/isc/task.c \ - $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c \ - $(srcdir)/../lib/isc/unix/time.c \ - $(srcdir)/../lib/isc/sha1.c \ - $(srcdir)/../lib/isc/sockaddr.c \ - $(srcdir)/../lib/isc/tsmemcmp.c \ +noinst_HEADERS = \ + lib/isc/task_p.h \ + lib/isc/include/isc/app.h \ + lib/isc/include/isc/assertions.h \ + lib/isc/include/isc/backtrace.h \ + lib/isc/include/isc/bind9.h \ + lib/isc/include/isc/buffer.h \ + lib/isc/include/isc/boolean.h \ + lib/isc/include/isc/error.h \ + lib/isc/include/isc/event.h \ + lib/isc/include/isc/eventclass.h \ + lib/isc/include/isc/file.h \ + lib/isc/include/isc/formatcheck.h \ + lib/isc/include/isc/hash.h \ + lib/isc/include/isc/interfaceiter.h \ + lib/isc/include/isc/lang.h \ + lib/isc/include/isc/lib.h \ + lib/isc/include/isc/list.h \ + lib/isc/include/isc/log.h \ + lib/isc/include/isc/magic.h \ + lib/isc/include/isc/md5.h \ + lib/isc/include/isc/msgs.h \ + lib/isc/include/isc/msgcat.h \ + lib/isc/include/isc/namespace.h \ + lib/isc/include/isc/netscope.h \ + lib/isc/include/isc/netaddr.h \ + lib/isc/include/isc/ondestroy.h \ + lib/isc/include/isc/platform.h \ + lib/isc/include/isc/print.h \ + lib/isc/include/isc/random.h \ + lib/isc/include/isc/region.h \ + lib/isc/include/isc/result.h \ + lib/isc/include/isc/resultclass.h \ + lib/isc/include/isc/sha1.h \ + lib/isc/include/isc/sockaddr.h \ + lib/isc/include/isc/socket.h \ + lib/isc/include/isc/stdio.h \ + lib/isc/include/isc/string.h \ + lib/isc/include/isc/task.h \ + lib/isc/include/isc/timer.h \ + lib/isc/include/isc/types.h \ + lib/isc/include/isc/util.h \ + lib/isc/include/isc/xml.h \ + lib/isc/unix/errno2result.h \ + lib/isc/unix/include/isc/dir.h \ + lib/isc/unix/include/isc/int.h \ + lib/isc/unix/include/isc/net.h \ + lib/isc/unix/include/isc/offset.h \ + lib/isc/unix/include/isc/stat.h \ + lib/isc/unix/include/isc/stdtime.h \ + lib/isc/unix/include/isc/strerror.h \ + lib/isc/unix/include/isc/time.h \ + lib/isc/win32/include/isc/condition.h \ + lib/isc/win32/include/isc/dir.h \ + lib/isc/win32/include/isc/int.h \ + lib/isc/win32/include/isc/ipv6.h \ + lib/isc/win32/include/isc/mutex.h \ + lib/isc/win32/include/isc/net.h \ + lib/isc/win32/include/isc/offset.h \ + lib/isc/win32/include/isc/once.h \ + lib/isc/win32/include/isc/platform.h \ + lib/isc/win32/include/isc/stat.h \ + lib/isc/win32/include/isc/stdtime.h \ + lib/isc/win32/include/isc/strerror.h \ + lib/isc/win32/include/isc/thread.h \ + lib/isc/win32/include/isc/time.h \ + lib/isc/win32/include/isc/win32os.h \ + $(NULL) + + +# ntp_crypto_rnd.c includes libevent headers for use when +# neither OpenSSL nor arc4random_buf are available. Those +# include event2/event-config.h which is built, so if we +# are building our libevent tearoff, build it before this. + +if BUILD_LIBEVENT +BUILT_SOURCES += libevent_first +CLEANFILES += libevent_first + +libevent_first: + cd $(top_builddir)/sntp/libevent && $(MAKE) $(AM_MAKEFLAGS) + echo stamp > $@ +endif + + +libisc_SRCS = \ + lib/isc/assertions.c \ + lib/isc/buffer.c \ + lib/isc/backtrace-emptytbl.c \ + lib/isc/backtrace.c \ + lib/isc/unix/dir.c \ + lib/isc/error.c \ + lib/isc/unix/errno2result.c \ + lib/isc/event.c \ + lib/isc/unix/file.c \ + lib/isc/inet_ntop.c \ + lib/isc/inet_pton.c \ + lib/isc/unix/interfaceiter.c \ + lib/isc/lib.c \ + lib/isc/log.c \ + lib/isc/md5.c \ + lib/isc/nls/msgcat.c \ + lib/isc/unix/net.c \ + lib/isc/netaddr.c \ + lib/isc/netscope.c \ + lib/isc/ondestroy.c \ + lib/isc/random.c \ + lib/isc/result.c \ + lib/isc/unix/stdio.c \ + lib/isc/unix/stdtime.c \ + lib/isc/unix/strerror.c \ + lib/isc/task.c \ + lib/isc/unix/time.c \ + lib/isc/sha1.c \ + lib/isc/sockaddr.c \ + lib/isc/tsmemcmp.c \ + $(NULL) + +libisc_XTRA = \ + lib/isc/pthreads/condition.c \ + lib/isc/pthreads/mutex.c \ + lib/isc/pthreads/thread.c \ + lib/isc/nothreads/condition.c \ + lib/isc/nothreads/thread.c \ $(NULL) if PTHREADS -libisc_SRCS += $(srcdir)/../lib/isc/pthreads/mutex.c +libisc_SRCS += \ + lib/isc/pthreads/condition.c \ + lib/isc/pthreads/mutex.c \ + lib/isc/pthreads/thread.c \ + $(NULL) +else +libisc_SRCS += \ + lib/isc/nothreads/condition.c \ + lib/isc/nothreads/thread.c \ + $(NULL) endif libntp_a_SRCS = \ @@ -87,6 +188,7 @@ libntp_a_SRCS = \ ntp_libopts.c \ ntp_lineedit.c \ ntp_random.c \ + ntp_realpath.c \ ntp_rfc2553.c \ ntp_worker.c \ numtoa.c \ @@ -120,19 +222,40 @@ libntp_a_SRCS = \ libntp_a_SOURCES = systime.c $(libntp_a_SRCS) libntpsim_a_SOURCES = systime_s.c $(libntp_a_SRCS) -EXTRA_libntp_a_SOURCES = adjtimex.c + +EXTRA_libntp_a_SOURCES = \ + adjtimex.c \ + $(libisc_XTRA) \ + $(NULL) AM_CFLAGS = $(CFLAGS_NTP) AM_CFLAGS += $(NTP_HARD_CFLAGS) AM_CPPFLAGS = $(NTP_INCS) AM_CPPFLAGS += $(LIBOPTS_CFLAGS) +AM_CPPFLAGS += $(CPPFLAGS_LIBEVENT) AM_CPPFLAGS += $(CPPFLAGS_NTP) AM_CPPFLAGS += $(NTP_HARD_CPPFLAGS) AM_LDFLAGS = $(NTP_HARD_LDFLAGS) -EXTRA_DIST = README +EXTRA_DIST = \ + README \ + lib/isc/nothreads/include \ + lib/isc/pthreads/include \ + lib/isc/unix/ifiter_getifaddrs.c \ + lib/isc/unix/ifiter_ioctl.c \ + lib/isc/unix/ifiter_sysctl.c \ + lib/isc/win32/condition.c \ + lib/isc/win32/interfaceiter.c \ + lib/isc/win32/net.c \ + lib/isc/win32/once.c \ + lib/isc/win32/stdtime.c \ + lib/isc/win32/strerror.c \ + lib/isc/win32/thread.c \ + lib/isc/win32/time.c \ + lib/isc/win32/win32os.c \ + $(NULL) include $(top_srcdir)/depsver.mf include $(top_srcdir)/includes.mf diff --git a/libntp/Makefile.in b/libntp/Makefile.in index 32f73f611ed1..439c5a9fe07a 100644 --- a/libntp/Makefile.in +++ b/libntp/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,6 +14,7 @@ @SET_MAKE@ + VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ @@ -88,7 +89,24 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@PTHREADS_TRUE@am__append_1 = $(srcdir)/../lib/isc/pthreads/mutex.c + +# ntp_crypto_rnd.c includes libevent headers for use when +# neither OpenSSL nor arc4random_buf are available. Those +# include event2/event-config.h which is built, so if we +# are building our libevent tearoff, build it before this. +@BUILD_LIBEVENT_TRUE@am__append_1 = libevent_first +@BUILD_LIBEVENT_TRUE@am__append_2 = libevent_first +@PTHREADS_TRUE@am__append_3 = \ +@PTHREADS_TRUE@ lib/isc/pthreads/condition.c \ +@PTHREADS_TRUE@ lib/isc/pthreads/mutex.c \ +@PTHREADS_TRUE@ lib/isc/pthreads/thread.c \ +@PTHREADS_TRUE@ $(NULL) + +@PTHREADS_FALSE@am__append_4 = \ +@PTHREADS_FALSE@ lib/isc/nothreads/condition.c \ +@PTHREADS_FALSE@ lib/isc/nothreads/thread.c \ +@PTHREADS_FALSE@ $(NULL) + subdir = libntp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ @@ -109,7 +127,6 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_debug.m4 \ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \ - $(top_srcdir)/sntp/m4/ntp_googletest.m4 \ $(top_srcdir)/sntp/m4/ntp_harden.m4 \ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \ @@ -129,11 +146,13 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ + $(top_srcdir)/sntp/m4/realpath.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ + $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -155,53 +174,53 @@ am__libntp_a_SOURCES_DIST = systime.c a_md5encrypt.c adjtime.c \ is_ip_address.c lib_strbuf.c libssl_compat.c machines.c \ mktime.c modetoa.c mstolfp.c msyslog.c netof.c ntp_calendar.c \ ntp_calgps.c ntp_crypto_rnd.c ntp_intres.c ntp_libopts.c \ - ntp_lineedit.c ntp_random.c ntp_rfc2553.c ntp_worker.c \ - numtoa.c numtohost.c octtoint.c prettydate.c refidsmear.c \ - recvbuff.c refnumtoa.c snprintf.c socket.c socktoa.c \ - socktohost.c ssl_init.c statestr.c strdup.c strl_obsd.c \ - syssignal.c timespecops.c timetoa.c timevalops.c timexsup.c \ - uglydate.c vint64ops.c work_fork.c work_thread.c xsbprintf.c \ - ymd2yd.c $(srcdir)/../lib/isc/assertions.c \ - $(srcdir)/../lib/isc/buffer.c \ - $(srcdir)/../lib/isc/backtrace-emptytbl.c \ - $(srcdir)/../lib/isc/backtrace.c \ - $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c \ - $(srcdir)/../lib/isc/unix/dir.c $(srcdir)/../lib/isc/error.c \ - $(srcdir)/../lib/isc/unix/errno2result.c \ - $(srcdir)/../lib/isc/event.c $(srcdir)/../lib/isc/unix/file.c \ - $(srcdir)/../lib/isc/inet_ntop.c \ - $(srcdir)/../lib/isc/inet_pton.c \ - $(srcdir)/../lib/isc/unix/interfaceiter.c \ - $(srcdir)/../lib/isc/lib.c $(srcdir)/../lib/isc/log.c \ - $(srcdir)/../lib/isc/md5.c $(srcdir)/../lib/isc/nls/msgcat.c \ - $(srcdir)/../lib/isc/unix/net.c $(srcdir)/../lib/isc/netaddr.c \ - $(srcdir)/../lib/isc/netscope.c \ - $(srcdir)/../lib/isc/ondestroy.c $(srcdir)/../lib/isc/random.c \ - $(srcdir)/../lib/isc/result.c \ - $(srcdir)/../lib/isc/unix/stdio.c \ - $(srcdir)/../lib/isc/unix/stdtime.c \ - $(srcdir)/../lib/isc/unix/strerror.c \ - $(srcdir)/../lib/isc/task.c \ - $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c \ - $(srcdir)/../lib/isc/unix/time.c $(srcdir)/../lib/isc/sha1.c \ - $(srcdir)/../lib/isc/sockaddr.c \ - $(srcdir)/../lib/isc/tsmemcmp.c \ - $(srcdir)/../lib/isc/pthreads/mutex.c + ntp_lineedit.c ntp_random.c ntp_realpath.c ntp_rfc2553.c \ + ntp_worker.c numtoa.c numtohost.c octtoint.c prettydate.c \ + refidsmear.c recvbuff.c refnumtoa.c snprintf.c socket.c \ + socktoa.c socktohost.c ssl_init.c statestr.c strdup.c \ + strl_obsd.c syssignal.c timespecops.c timetoa.c timevalops.c \ + timexsup.c uglydate.c vint64ops.c work_fork.c work_thread.c \ + xsbprintf.c ymd2yd.c lib/isc/assertions.c lib/isc/buffer.c \ + lib/isc/backtrace-emptytbl.c lib/isc/backtrace.c \ + lib/isc/unix/dir.c lib/isc/error.c lib/isc/unix/errno2result.c \ + lib/isc/event.c lib/isc/unix/file.c lib/isc/inet_ntop.c \ + lib/isc/inet_pton.c lib/isc/unix/interfaceiter.c lib/isc/lib.c \ + lib/isc/log.c lib/isc/md5.c lib/isc/nls/msgcat.c \ + lib/isc/unix/net.c lib/isc/netaddr.c lib/isc/netscope.c \ + lib/isc/ondestroy.c lib/isc/random.c lib/isc/result.c \ + lib/isc/unix/stdio.c lib/isc/unix/stdtime.c \ + lib/isc/unix/strerror.c lib/isc/task.c lib/isc/unix/time.c \ + lib/isc/sha1.c lib/isc/sockaddr.c lib/isc/tsmemcmp.c \ + lib/isc/pthreads/condition.c lib/isc/pthreads/mutex.c \ + lib/isc/pthreads/thread.c lib/isc/nothreads/condition.c \ + lib/isc/nothreads/thread.c +am__dirstamp = $(am__leading_dot)dirstamp am__objects_1 = -@PTHREADS_TRUE@am__objects_2 = mutex.$(OBJEXT) -am__objects_3 = assertions.$(OBJEXT) buffer.$(OBJEXT) \ - backtrace-emptytbl.$(OBJEXT) backtrace.$(OBJEXT) \ - condition.$(OBJEXT) dir.$(OBJEXT) error.$(OBJEXT) \ - errno2result.$(OBJEXT) event.$(OBJEXT) file.$(OBJEXT) \ - inet_ntop.$(OBJEXT) inet_pton.$(OBJEXT) \ - interfaceiter.$(OBJEXT) lib.$(OBJEXT) log.$(OBJEXT) \ - md5.$(OBJEXT) msgcat.$(OBJEXT) net.$(OBJEXT) netaddr.$(OBJEXT) \ - netscope.$(OBJEXT) ondestroy.$(OBJEXT) random.$(OBJEXT) \ - result.$(OBJEXT) stdio.$(OBJEXT) stdtime.$(OBJEXT) \ - strerror.$(OBJEXT) task.$(OBJEXT) thread.$(OBJEXT) \ - time.$(OBJEXT) sha1.$(OBJEXT) sockaddr.$(OBJEXT) \ - tsmemcmp.$(OBJEXT) $(am__objects_1) $(am__objects_2) -am__objects_4 = a_md5encrypt.$(OBJEXT) adjtime.$(OBJEXT) \ +@PTHREADS_TRUE@am__objects_2 = lib/isc/pthreads/condition.$(OBJEXT) \ +@PTHREADS_TRUE@ lib/isc/pthreads/mutex.$(OBJEXT) \ +@PTHREADS_TRUE@ lib/isc/pthreads/thread.$(OBJEXT) \ +@PTHREADS_TRUE@ $(am__objects_1) +@PTHREADS_FALSE@am__objects_3 = lib/isc/nothreads/condition.$(OBJEXT) \ +@PTHREADS_FALSE@ lib/isc/nothreads/thread.$(OBJEXT) \ +@PTHREADS_FALSE@ $(am__objects_1) +am__objects_4 = lib/isc/assertions.$(OBJEXT) lib/isc/buffer.$(OBJEXT) \ + lib/isc/backtrace-emptytbl.$(OBJEXT) \ + lib/isc/backtrace.$(OBJEXT) lib/isc/unix/dir.$(OBJEXT) \ + lib/isc/error.$(OBJEXT) lib/isc/unix/errno2result.$(OBJEXT) \ + lib/isc/event.$(OBJEXT) lib/isc/unix/file.$(OBJEXT) \ + lib/isc/inet_ntop.$(OBJEXT) lib/isc/inet_pton.$(OBJEXT) \ + lib/isc/unix/interfaceiter.$(OBJEXT) lib/isc/lib.$(OBJEXT) \ + lib/isc/log.$(OBJEXT) lib/isc/md5.$(OBJEXT) \ + lib/isc/nls/msgcat.$(OBJEXT) lib/isc/unix/net.$(OBJEXT) \ + lib/isc/netaddr.$(OBJEXT) lib/isc/netscope.$(OBJEXT) \ + lib/isc/ondestroy.$(OBJEXT) lib/isc/random.$(OBJEXT) \ + lib/isc/result.$(OBJEXT) lib/isc/unix/stdio.$(OBJEXT) \ + lib/isc/unix/stdtime.$(OBJEXT) lib/isc/unix/strerror.$(OBJEXT) \ + lib/isc/task.$(OBJEXT) lib/isc/unix/time.$(OBJEXT) \ + lib/isc/sha1.$(OBJEXT) lib/isc/sockaddr.$(OBJEXT) \ + lib/isc/tsmemcmp.$(OBJEXT) $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) +am__objects_5 = a_md5encrypt.$(OBJEXT) adjtime.$(OBJEXT) \ atoint.$(OBJEXT) atolfp.$(OBJEXT) atouint.$(OBJEXT) \ audio.$(OBJEXT) authkeys.$(OBJEXT) authreadkeys.$(OBJEXT) \ authusekey.$(OBJEXT) bsd_strerror.$(OBJEXT) \ @@ -217,18 +236,18 @@ am__objects_4 = a_md5encrypt.$(OBJEXT) adjtime.$(OBJEXT) \ netof.$(OBJEXT) ntp_calendar.$(OBJEXT) ntp_calgps.$(OBJEXT) \ ntp_crypto_rnd.$(OBJEXT) ntp_intres.$(OBJEXT) \ ntp_libopts.$(OBJEXT) ntp_lineedit.$(OBJEXT) \ - ntp_random.$(OBJEXT) ntp_rfc2553.$(OBJEXT) \ - ntp_worker.$(OBJEXT) numtoa.$(OBJEXT) numtohost.$(OBJEXT) \ - octtoint.$(OBJEXT) prettydate.$(OBJEXT) refidsmear.$(OBJEXT) \ - recvbuff.$(OBJEXT) refnumtoa.$(OBJEXT) snprintf.$(OBJEXT) \ - socket.$(OBJEXT) socktoa.$(OBJEXT) socktohost.$(OBJEXT) \ - ssl_init.$(OBJEXT) statestr.$(OBJEXT) strdup.$(OBJEXT) \ - strl_obsd.$(OBJEXT) syssignal.$(OBJEXT) timespecops.$(OBJEXT) \ - timetoa.$(OBJEXT) timevalops.$(OBJEXT) timexsup.$(OBJEXT) \ - uglydate.$(OBJEXT) vint64ops.$(OBJEXT) work_fork.$(OBJEXT) \ - work_thread.$(OBJEXT) xsbprintf.$(OBJEXT) ymd2yd.$(OBJEXT) \ - $(am__objects_3) $(am__objects_1) -am_libntp_a_OBJECTS = systime.$(OBJEXT) $(am__objects_4) + ntp_random.$(OBJEXT) ntp_realpath.$(OBJEXT) \ + ntp_rfc2553.$(OBJEXT) ntp_worker.$(OBJEXT) numtoa.$(OBJEXT) \ + numtohost.$(OBJEXT) octtoint.$(OBJEXT) prettydate.$(OBJEXT) \ + refidsmear.$(OBJEXT) recvbuff.$(OBJEXT) refnumtoa.$(OBJEXT) \ + snprintf.$(OBJEXT) socket.$(OBJEXT) socktoa.$(OBJEXT) \ + socktohost.$(OBJEXT) ssl_init.$(OBJEXT) statestr.$(OBJEXT) \ + strdup.$(OBJEXT) strl_obsd.$(OBJEXT) syssignal.$(OBJEXT) \ + timespecops.$(OBJEXT) timetoa.$(OBJEXT) timevalops.$(OBJEXT) \ + timexsup.$(OBJEXT) uglydate.$(OBJEXT) vint64ops.$(OBJEXT) \ + work_fork.$(OBJEXT) work_thread.$(OBJEXT) xsbprintf.$(OBJEXT) \ + ymd2yd.$(OBJEXT) $(am__objects_4) $(am__objects_1) +am_libntp_a_OBJECTS = systime.$(OBJEXT) $(am__objects_5) libntp_a_OBJECTS = $(am_libntp_a_OBJECTS) libntpsim_a_AR = $(AR) $(ARFLAGS) libntpsim_a_LIBADD = @@ -241,39 +260,27 @@ am__libntpsim_a_SOURCES_DIST = systime_s.c a_md5encrypt.c adjtime.c \ is_ip_address.c lib_strbuf.c libssl_compat.c machines.c \ mktime.c modetoa.c mstolfp.c msyslog.c netof.c ntp_calendar.c \ ntp_calgps.c ntp_crypto_rnd.c ntp_intres.c ntp_libopts.c \ - ntp_lineedit.c ntp_random.c ntp_rfc2553.c ntp_worker.c \ - numtoa.c numtohost.c octtoint.c prettydate.c refidsmear.c \ - recvbuff.c refnumtoa.c snprintf.c socket.c socktoa.c \ - socktohost.c ssl_init.c statestr.c strdup.c strl_obsd.c \ - syssignal.c timespecops.c timetoa.c timevalops.c timexsup.c \ - uglydate.c vint64ops.c work_fork.c work_thread.c xsbprintf.c \ - ymd2yd.c $(srcdir)/../lib/isc/assertions.c \ - $(srcdir)/../lib/isc/buffer.c \ - $(srcdir)/../lib/isc/backtrace-emptytbl.c \ - $(srcdir)/../lib/isc/backtrace.c \ - $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c \ - $(srcdir)/../lib/isc/unix/dir.c $(srcdir)/../lib/isc/error.c \ - $(srcdir)/../lib/isc/unix/errno2result.c \ - $(srcdir)/../lib/isc/event.c $(srcdir)/../lib/isc/unix/file.c \ - $(srcdir)/../lib/isc/inet_ntop.c \ - $(srcdir)/../lib/isc/inet_pton.c \ - $(srcdir)/../lib/isc/unix/interfaceiter.c \ - $(srcdir)/../lib/isc/lib.c $(srcdir)/../lib/isc/log.c \ - $(srcdir)/../lib/isc/md5.c $(srcdir)/../lib/isc/nls/msgcat.c \ - $(srcdir)/../lib/isc/unix/net.c $(srcdir)/../lib/isc/netaddr.c \ - $(srcdir)/../lib/isc/netscope.c \ - $(srcdir)/../lib/isc/ondestroy.c $(srcdir)/../lib/isc/random.c \ - $(srcdir)/../lib/isc/result.c \ - $(srcdir)/../lib/isc/unix/stdio.c \ - $(srcdir)/../lib/isc/unix/stdtime.c \ - $(srcdir)/../lib/isc/unix/strerror.c \ - $(srcdir)/../lib/isc/task.c \ - $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c \ - $(srcdir)/../lib/isc/unix/time.c $(srcdir)/../lib/isc/sha1.c \ - $(srcdir)/../lib/isc/sockaddr.c \ - $(srcdir)/../lib/isc/tsmemcmp.c \ - $(srcdir)/../lib/isc/pthreads/mutex.c -am_libntpsim_a_OBJECTS = systime_s.$(OBJEXT) $(am__objects_4) + ntp_lineedit.c ntp_random.c ntp_realpath.c ntp_rfc2553.c \ + ntp_worker.c numtoa.c numtohost.c octtoint.c prettydate.c \ + refidsmear.c recvbuff.c refnumtoa.c snprintf.c socket.c \ + socktoa.c socktohost.c ssl_init.c statestr.c strdup.c \ + strl_obsd.c syssignal.c timespecops.c timetoa.c timevalops.c \ + timexsup.c uglydate.c vint64ops.c work_fork.c work_thread.c \ + xsbprintf.c ymd2yd.c lib/isc/assertions.c lib/isc/buffer.c \ + lib/isc/backtrace-emptytbl.c lib/isc/backtrace.c \ + lib/isc/unix/dir.c lib/isc/error.c lib/isc/unix/errno2result.c \ + lib/isc/event.c lib/isc/unix/file.c lib/isc/inet_ntop.c \ + lib/isc/inet_pton.c lib/isc/unix/interfaceiter.c lib/isc/lib.c \ + lib/isc/log.c lib/isc/md5.c lib/isc/nls/msgcat.c \ + lib/isc/unix/net.c lib/isc/netaddr.c lib/isc/netscope.c \ + lib/isc/ondestroy.c lib/isc/random.c lib/isc/result.c \ + lib/isc/unix/stdio.c lib/isc/unix/stdtime.c \ + lib/isc/unix/strerror.c lib/isc/task.c lib/isc/unix/time.c \ + lib/isc/sha1.c lib/isc/sockaddr.c lib/isc/tsmemcmp.c \ + lib/isc/pthreads/condition.c lib/isc/pthreads/mutex.c \ + lib/isc/pthreads/thread.c lib/isc/nothreads/condition.c \ + lib/isc/nothreads/thread.c +am_libntpsim_a_OBJECTS = systime_s.$(OBJEXT) $(am__objects_5) libntpsim_a_OBJECTS = $(am_libntpsim_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -289,14 +296,77 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/sntp/libevent/build-aux/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/a_md5encrypt.Po \ + ./$(DEPDIR)/adjtime.Po ./$(DEPDIR)/adjtimex.Po \ + ./$(DEPDIR)/atoint.Po ./$(DEPDIR)/atolfp.Po \ + ./$(DEPDIR)/atouint.Po ./$(DEPDIR)/audio.Po \ + ./$(DEPDIR)/authkeys.Po ./$(DEPDIR)/authreadkeys.Po \ + ./$(DEPDIR)/authusekey.Po ./$(DEPDIR)/bsd_strerror.Po \ + ./$(DEPDIR)/buftvtots.Po ./$(DEPDIR)/caljulian.Po \ + ./$(DEPDIR)/caltontp.Po ./$(DEPDIR)/calyearstart.Po \ + ./$(DEPDIR)/clocktime.Po ./$(DEPDIR)/clocktypes.Po \ + ./$(DEPDIR)/decodenetnum.Po ./$(DEPDIR)/dofptoa.Po \ + ./$(DEPDIR)/dolfptoa.Po ./$(DEPDIR)/emalloc.Po \ + ./$(DEPDIR)/findconfig.Po ./$(DEPDIR)/getopt.Po \ + ./$(DEPDIR)/hextoint.Po ./$(DEPDIR)/hextolfp.Po \ + ./$(DEPDIR)/humandate.Po ./$(DEPDIR)/icom.Po \ + ./$(DEPDIR)/iosignal.Po ./$(DEPDIR)/is_ip_address.Po \ + ./$(DEPDIR)/lib_strbuf.Po ./$(DEPDIR)/libssl_compat.Po \ + ./$(DEPDIR)/machines.Po ./$(DEPDIR)/mktime.Po \ + ./$(DEPDIR)/modetoa.Po ./$(DEPDIR)/mstolfp.Po \ + ./$(DEPDIR)/msyslog.Po ./$(DEPDIR)/netof.Po \ + ./$(DEPDIR)/ntp_calendar.Po ./$(DEPDIR)/ntp_calgps.Po \ + ./$(DEPDIR)/ntp_crypto_rnd.Po ./$(DEPDIR)/ntp_intres.Po \ + ./$(DEPDIR)/ntp_libopts.Po ./$(DEPDIR)/ntp_lineedit.Po \ + ./$(DEPDIR)/ntp_random.Po ./$(DEPDIR)/ntp_realpath.Po \ + ./$(DEPDIR)/ntp_rfc2553.Po ./$(DEPDIR)/ntp_worker.Po \ + ./$(DEPDIR)/numtoa.Po ./$(DEPDIR)/numtohost.Po \ + ./$(DEPDIR)/octtoint.Po ./$(DEPDIR)/prettydate.Po \ + ./$(DEPDIR)/recvbuff.Po ./$(DEPDIR)/refidsmear.Po \ + ./$(DEPDIR)/refnumtoa.Po ./$(DEPDIR)/snprintf.Po \ + ./$(DEPDIR)/socket.Po ./$(DEPDIR)/socktoa.Po \ + ./$(DEPDIR)/socktohost.Po ./$(DEPDIR)/ssl_init.Po \ + ./$(DEPDIR)/statestr.Po ./$(DEPDIR)/strdup.Po \ + ./$(DEPDIR)/strl_obsd.Po ./$(DEPDIR)/syssignal.Po \ + ./$(DEPDIR)/systime.Po ./$(DEPDIR)/systime_s.Po \ + ./$(DEPDIR)/timespecops.Po ./$(DEPDIR)/timetoa.Po \ + ./$(DEPDIR)/timevalops.Po ./$(DEPDIR)/timexsup.Po \ + ./$(DEPDIR)/uglydate.Po ./$(DEPDIR)/vint64ops.Po \ + ./$(DEPDIR)/work_fork.Po ./$(DEPDIR)/work_thread.Po \ + ./$(DEPDIR)/xsbprintf.Po ./$(DEPDIR)/ymd2yd.Po \ + lib/isc/$(DEPDIR)/assertions.Po \ + lib/isc/$(DEPDIR)/backtrace-emptytbl.Po \ + lib/isc/$(DEPDIR)/backtrace.Po lib/isc/$(DEPDIR)/buffer.Po \ + lib/isc/$(DEPDIR)/error.Po lib/isc/$(DEPDIR)/event.Po \ + lib/isc/$(DEPDIR)/inet_ntop.Po lib/isc/$(DEPDIR)/inet_pton.Po \ + lib/isc/$(DEPDIR)/lib.Po lib/isc/$(DEPDIR)/log.Po \ + lib/isc/$(DEPDIR)/md5.Po lib/isc/$(DEPDIR)/netaddr.Po \ + lib/isc/$(DEPDIR)/netscope.Po lib/isc/$(DEPDIR)/ondestroy.Po \ + lib/isc/$(DEPDIR)/random.Po lib/isc/$(DEPDIR)/result.Po \ + lib/isc/$(DEPDIR)/sha1.Po lib/isc/$(DEPDIR)/sockaddr.Po \ + lib/isc/$(DEPDIR)/task.Po lib/isc/$(DEPDIR)/tsmemcmp.Po \ + lib/isc/nls/$(DEPDIR)/msgcat.Po \ + lib/isc/nothreads/$(DEPDIR)/condition.Po \ + lib/isc/nothreads/$(DEPDIR)/thread.Po \ + lib/isc/pthreads/$(DEPDIR)/condition.Po \ + lib/isc/pthreads/$(DEPDIR)/mutex.Po \ + lib/isc/pthreads/$(DEPDIR)/thread.Po \ + lib/isc/unix/$(DEPDIR)/dir.Po \ + lib/isc/unix/$(DEPDIR)/errno2result.Po \ + lib/isc/unix/$(DEPDIR)/file.Po \ + lib/isc/unix/$(DEPDIR)/interfaceiter.Po \ + lib/isc/unix/$(DEPDIR)/net.Po lib/isc/unix/$(DEPDIR)/stdio.Po \ + lib/isc/unix/$(DEPDIR)/stdtime.Po \ + lib/isc/unix/$(DEPDIR)/strerror.Po \ + lib/isc/unix/$(DEPDIR)/time.Po am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ @@ -322,6 +392,7 @@ am__can_run_installinfo = \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -339,8 +410,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depsver.mf \ $(top_srcdir)/includes.mf \ $(top_srcdir)/sntp/libevent/build-aux/depcomp README @@ -362,6 +431,7 @@ CALC_TICKADJ_MS = @CALC_TICKADJ_MS@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CC_NOFORMAT = @CC_NOFORMAT@ CFLAGS = @CFLAGS@ CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@ CFLAGS_NTP = @CFLAGS_NTP@ @@ -371,6 +441,8 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ CPPFLAGS_NTP = @CPPFLAGS_NTP@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ DEFS = @DEFS@ @@ -383,14 +455,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EDITLINE_LIBS = @EDITLINE_LIBS@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ -GTEST_CONFIG = @GTEST_CONFIG@ -GTEST_CPPFLAGS = @GTEST_CPPFLAGS@ -GTEST_CXXFLAGS = @GTEST_CXXFLAGS@ -GTEST_LDFLAGS = @GTEST_LDFLAGS@ -GTEST_LIBS = @GTEST_LIBS@ HAVE_INLINE = @HAVE_INLINE@ HAVE_LEAPSMEARINTERVAL = @HAVE_LEAPSMEARINTERVAL@ HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@ @@ -601,6 +669,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -611,35 +680,100 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ NULL = -BUILT_SOURCES = .deps-ver -CLEANFILES = .deps-ver +BUILT_SOURCES = $(am__append_1) .deps-ver +CLEANFILES = $(am__append_2) .deps-ver +DISTCLEANFILES = $(DEPDIR)/deps-ver noinst_LIBRARIES = libntp.a @MAKE_LIBNTPSIM@ EXTRA_LIBRARIES = libntpsim.a -libisc_SRCS = $(srcdir)/../lib/isc/assertions.c \ - $(srcdir)/../lib/isc/buffer.c \ - $(srcdir)/../lib/isc/backtrace-emptytbl.c \ - $(srcdir)/../lib/isc/backtrace.c \ - $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c \ - $(srcdir)/../lib/isc/unix/dir.c $(srcdir)/../lib/isc/error.c \ - $(srcdir)/../lib/isc/unix/errno2result.c \ - $(srcdir)/../lib/isc/event.c $(srcdir)/../lib/isc/unix/file.c \ - $(srcdir)/../lib/isc/inet_ntop.c \ - $(srcdir)/../lib/isc/inet_pton.c \ - $(srcdir)/../lib/isc/unix/interfaceiter.c \ - $(srcdir)/../lib/isc/lib.c $(srcdir)/../lib/isc/log.c \ - $(srcdir)/../lib/isc/md5.c $(srcdir)/../lib/isc/nls/msgcat.c \ - $(srcdir)/../lib/isc/unix/net.c $(srcdir)/../lib/isc/netaddr.c \ - $(srcdir)/../lib/isc/netscope.c \ - $(srcdir)/../lib/isc/ondestroy.c $(srcdir)/../lib/isc/random.c \ - $(srcdir)/../lib/isc/result.c \ - $(srcdir)/../lib/isc/unix/stdio.c \ - $(srcdir)/../lib/isc/unix/stdtime.c \ - $(srcdir)/../lib/isc/unix/strerror.c \ - $(srcdir)/../lib/isc/task.c \ - $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c \ - $(srcdir)/../lib/isc/unix/time.c $(srcdir)/../lib/isc/sha1.c \ - $(srcdir)/../lib/isc/sockaddr.c \ - $(srcdir)/../lib/isc/tsmemcmp.c $(NULL) $(am__append_1) +noinst_HEADERS = \ + lib/isc/task_p.h \ + lib/isc/include/isc/app.h \ + lib/isc/include/isc/assertions.h \ + lib/isc/include/isc/backtrace.h \ + lib/isc/include/isc/bind9.h \ + lib/isc/include/isc/buffer.h \ + lib/isc/include/isc/boolean.h \ + lib/isc/include/isc/error.h \ + lib/isc/include/isc/event.h \ + lib/isc/include/isc/eventclass.h \ + lib/isc/include/isc/file.h \ + lib/isc/include/isc/formatcheck.h \ + lib/isc/include/isc/hash.h \ + lib/isc/include/isc/interfaceiter.h \ + lib/isc/include/isc/lang.h \ + lib/isc/include/isc/lib.h \ + lib/isc/include/isc/list.h \ + lib/isc/include/isc/log.h \ + lib/isc/include/isc/magic.h \ + lib/isc/include/isc/md5.h \ + lib/isc/include/isc/msgs.h \ + lib/isc/include/isc/msgcat.h \ + lib/isc/include/isc/namespace.h \ + lib/isc/include/isc/netscope.h \ + lib/isc/include/isc/netaddr.h \ + lib/isc/include/isc/ondestroy.h \ + lib/isc/include/isc/platform.h \ + lib/isc/include/isc/print.h \ + lib/isc/include/isc/random.h \ + lib/isc/include/isc/region.h \ + lib/isc/include/isc/result.h \ + lib/isc/include/isc/resultclass.h \ + lib/isc/include/isc/sha1.h \ + lib/isc/include/isc/sockaddr.h \ + lib/isc/include/isc/socket.h \ + lib/isc/include/isc/stdio.h \ + lib/isc/include/isc/string.h \ + lib/isc/include/isc/task.h \ + lib/isc/include/isc/timer.h \ + lib/isc/include/isc/types.h \ + lib/isc/include/isc/util.h \ + lib/isc/include/isc/xml.h \ + lib/isc/unix/errno2result.h \ + lib/isc/unix/include/isc/dir.h \ + lib/isc/unix/include/isc/int.h \ + lib/isc/unix/include/isc/net.h \ + lib/isc/unix/include/isc/offset.h \ + lib/isc/unix/include/isc/stat.h \ + lib/isc/unix/include/isc/stdtime.h \ + lib/isc/unix/include/isc/strerror.h \ + lib/isc/unix/include/isc/time.h \ + lib/isc/win32/include/isc/condition.h \ + lib/isc/win32/include/isc/dir.h \ + lib/isc/win32/include/isc/int.h \ + lib/isc/win32/include/isc/ipv6.h \ + lib/isc/win32/include/isc/mutex.h \ + lib/isc/win32/include/isc/net.h \ + lib/isc/win32/include/isc/offset.h \ + lib/isc/win32/include/isc/once.h \ + lib/isc/win32/include/isc/platform.h \ + lib/isc/win32/include/isc/stat.h \ + lib/isc/win32/include/isc/stdtime.h \ + lib/isc/win32/include/isc/strerror.h \ + lib/isc/win32/include/isc/thread.h \ + lib/isc/win32/include/isc/time.h \ + lib/isc/win32/include/isc/win32os.h \ + $(NULL) + +libisc_SRCS = lib/isc/assertions.c lib/isc/buffer.c \ + lib/isc/backtrace-emptytbl.c lib/isc/backtrace.c \ + lib/isc/unix/dir.c lib/isc/error.c lib/isc/unix/errno2result.c \ + lib/isc/event.c lib/isc/unix/file.c lib/isc/inet_ntop.c \ + lib/isc/inet_pton.c lib/isc/unix/interfaceiter.c lib/isc/lib.c \ + lib/isc/log.c lib/isc/md5.c lib/isc/nls/msgcat.c \ + lib/isc/unix/net.c lib/isc/netaddr.c lib/isc/netscope.c \ + lib/isc/ondestroy.c lib/isc/random.c lib/isc/result.c \ + lib/isc/unix/stdio.c lib/isc/unix/stdtime.c \ + lib/isc/unix/strerror.c lib/isc/task.c lib/isc/unix/time.c \ + lib/isc/sha1.c lib/isc/sockaddr.c lib/isc/tsmemcmp.c $(NULL) \ + $(am__append_3) $(am__append_4) +libisc_XTRA = \ + lib/isc/pthreads/condition.c \ + lib/isc/pthreads/mutex.c \ + lib/isc/pthreads/thread.c \ + lib/isc/nothreads/condition.c \ + lib/isc/nothreads/thread.c \ + $(NULL) + libntp_a_SRCS = \ a_md5encrypt.c \ adjtime.c \ @@ -684,6 +818,7 @@ libntp_a_SRCS = \ ntp_libopts.c \ ntp_lineedit.c \ ntp_random.c \ + ntp_realpath.c \ ntp_rfc2553.c \ ntp_worker.c \ numtoa.c \ @@ -717,15 +852,37 @@ libntp_a_SRCS = \ libntp_a_SOURCES = systime.c $(libntp_a_SRCS) libntpsim_a_SOURCES = systime_s.c $(libntp_a_SRCS) -EXTRA_libntp_a_SOURCES = adjtimex.c +EXTRA_libntp_a_SOURCES = \ + adjtimex.c \ + $(libisc_XTRA) \ + $(NULL) + AM_CFLAGS = $(CFLAGS_NTP) $(NTP_HARD_CFLAGS) -AM_CPPFLAGS = $(NTP_INCS) $(LIBOPTS_CFLAGS) $(CPPFLAGS_NTP) \ - $(NTP_HARD_CPPFLAGS) +AM_CPPFLAGS = $(NTP_INCS) $(LIBOPTS_CFLAGS) $(CPPFLAGS_LIBEVENT) \ + $(CPPFLAGS_NTP) $(NTP_HARD_CPPFLAGS) AM_LDFLAGS = $(NTP_HARD_LDFLAGS) -EXTRA_DIST = README -NTP_INCS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ - -I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ - -I$(top_srcdir)/lib/isc/unix/include +EXTRA_DIST = \ + README \ + lib/isc/nothreads/include \ + lib/isc/pthreads/include \ + lib/isc/unix/ifiter_getifaddrs.c \ + lib/isc/unix/ifiter_ioctl.c \ + lib/isc/unix/ifiter_sysctl.c \ + lib/isc/win32/condition.c \ + lib/isc/win32/interfaceiter.c \ + lib/isc/win32/net.c \ + lib/isc/win32/once.c \ + lib/isc/win32/stdtime.c \ + lib/isc/win32/strerror.c \ + lib/isc/win32/thread.c \ + lib/isc/win32/time.c \ + lib/isc/win32/win32os.c \ + $(NULL) + +NTP_INCS = -I$(top_srcdir)/include \ + -I$(top_srcdir)/libntp/lib/isc/include \ + -I$(top_srcdir)/libntp/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ + -I$(top_srcdir)/libntp/lib/isc/unix/include all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am @@ -748,8 +905,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): @@ -764,6 +921,108 @@ $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +lib/isc/$(am__dirstamp): + @$(MKDIR_P) lib/isc + @: > lib/isc/$(am__dirstamp) +lib/isc/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) lib/isc/$(DEPDIR) + @: > lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/assertions.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/buffer.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/backtrace-emptytbl.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/backtrace.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/unix/$(am__dirstamp): + @$(MKDIR_P) lib/isc/unix + @: > lib/isc/unix/$(am__dirstamp) +lib/isc/unix/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) lib/isc/unix/$(DEPDIR) + @: > lib/isc/unix/$(DEPDIR)/$(am__dirstamp) +lib/isc/unix/dir.$(OBJEXT): lib/isc/unix/$(am__dirstamp) \ + lib/isc/unix/$(DEPDIR)/$(am__dirstamp) +lib/isc/error.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/unix/errno2result.$(OBJEXT): lib/isc/unix/$(am__dirstamp) \ + lib/isc/unix/$(DEPDIR)/$(am__dirstamp) +lib/isc/event.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/unix/file.$(OBJEXT): lib/isc/unix/$(am__dirstamp) \ + lib/isc/unix/$(DEPDIR)/$(am__dirstamp) +lib/isc/inet_ntop.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/inet_pton.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/unix/interfaceiter.$(OBJEXT): lib/isc/unix/$(am__dirstamp) \ + lib/isc/unix/$(DEPDIR)/$(am__dirstamp) +lib/isc/lib.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/log.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/md5.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/nls/$(am__dirstamp): + @$(MKDIR_P) lib/isc/nls + @: > lib/isc/nls/$(am__dirstamp) +lib/isc/nls/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) lib/isc/nls/$(DEPDIR) + @: > lib/isc/nls/$(DEPDIR)/$(am__dirstamp) +lib/isc/nls/msgcat.$(OBJEXT): lib/isc/nls/$(am__dirstamp) \ + lib/isc/nls/$(DEPDIR)/$(am__dirstamp) +lib/isc/unix/net.$(OBJEXT): lib/isc/unix/$(am__dirstamp) \ + lib/isc/unix/$(DEPDIR)/$(am__dirstamp) +lib/isc/netaddr.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/netscope.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/ondestroy.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/random.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/result.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/unix/stdio.$(OBJEXT): lib/isc/unix/$(am__dirstamp) \ + lib/isc/unix/$(DEPDIR)/$(am__dirstamp) +lib/isc/unix/stdtime.$(OBJEXT): lib/isc/unix/$(am__dirstamp) \ + lib/isc/unix/$(DEPDIR)/$(am__dirstamp) +lib/isc/unix/strerror.$(OBJEXT): lib/isc/unix/$(am__dirstamp) \ + lib/isc/unix/$(DEPDIR)/$(am__dirstamp) +lib/isc/task.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/unix/time.$(OBJEXT): lib/isc/unix/$(am__dirstamp) \ + lib/isc/unix/$(DEPDIR)/$(am__dirstamp) +lib/isc/sha1.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/sockaddr.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/tsmemcmp.$(OBJEXT): lib/isc/$(am__dirstamp) \ + lib/isc/$(DEPDIR)/$(am__dirstamp) +lib/isc/pthreads/$(am__dirstamp): + @$(MKDIR_P) lib/isc/pthreads + @: > lib/isc/pthreads/$(am__dirstamp) +lib/isc/pthreads/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) lib/isc/pthreads/$(DEPDIR) + @: > lib/isc/pthreads/$(DEPDIR)/$(am__dirstamp) +lib/isc/pthreads/condition.$(OBJEXT): \ + lib/isc/pthreads/$(am__dirstamp) \ + lib/isc/pthreads/$(DEPDIR)/$(am__dirstamp) +lib/isc/pthreads/mutex.$(OBJEXT): lib/isc/pthreads/$(am__dirstamp) \ + lib/isc/pthreads/$(DEPDIR)/$(am__dirstamp) +lib/isc/pthreads/thread.$(OBJEXT): lib/isc/pthreads/$(am__dirstamp) \ + lib/isc/pthreads/$(DEPDIR)/$(am__dirstamp) +lib/isc/nothreads/$(am__dirstamp): + @$(MKDIR_P) lib/isc/nothreads + @: > lib/isc/nothreads/$(am__dirstamp) +lib/isc/nothreads/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) lib/isc/nothreads/$(DEPDIR) + @: > lib/isc/nothreads/$(DEPDIR)/$(am__dirstamp) +lib/isc/nothreads/condition.$(OBJEXT): \ + lib/isc/nothreads/$(am__dirstamp) \ + lib/isc/nothreads/$(DEPDIR)/$(am__dirstamp) +lib/isc/nothreads/thread.$(OBJEXT): lib/isc/nothreads/$(am__dirstamp) \ + lib/isc/nothreads/$(DEPDIR)/$(am__dirstamp) libntp.a: $(libntp_a_OBJECTS) $(libntp_a_DEPENDENCIES) $(EXTRA_libntp_a_DEPENDENCIES) $(AM_V_at)-rm -f libntp.a @@ -777,601 +1036,156 @@ libntpsim.a: $(libntpsim_a_OBJECTS) $(libntpsim_a_DEPENDENCIES) $(EXTRA_libntpsi mostlyclean-compile: -rm -f *.$(OBJEXT) + -rm -f lib/isc/*.$(OBJEXT) + -rm -f lib/isc/nls/*.$(OBJEXT) + -rm -f lib/isc/nothreads/*.$(OBJEXT) + -rm -f lib/isc/pthreads/*.$(OBJEXT) + -rm -f lib/isc/unix/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/a_md5encrypt.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtimex.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/assertions.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atoint.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atolfp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atouint.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authkeys.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authreadkeys.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authusekey.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backtrace-emptytbl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backtrace.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_strerror.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buftvtots.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caljulian.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caltontp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/calyearstart.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clocktime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clocktypes.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/condition.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decodenetnum.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dir.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dofptoa.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dolfptoa.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emalloc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errno2result.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/findconfig.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hextoint.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hextolfp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/humandate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icom.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_ntop.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_pton.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interfaceiter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iosignal.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/is_ip_address.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_strbuf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libssl_compat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/machines.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modetoa.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msgcat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mstolfp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msyslog.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mutex.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netaddr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netof.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netscope.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_calendar.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_calgps.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_crypto_rnd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_intres.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_libopts.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_lineedit.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_random.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_rfc2553.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_worker.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/numtoa.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/numtohost.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/octtoint.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ondestroy.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prettydate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/random.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvbuff.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refidsmear.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refnumtoa.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/result.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockaddr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socket.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socktoa.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socktohost.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_init.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statestr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdtime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strl_obsd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syssignal.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/systime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/systime_s.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/task.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timespecops.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timetoa.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timevalops.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timexsup.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsmemcmp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uglydate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vint64ops.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/work_fork.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/work_thread.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsbprintf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ymd2yd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/a_md5encrypt.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtimex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atoint.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atolfp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atouint.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authkeys.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authreadkeys.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authusekey.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_strerror.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buftvtots.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caljulian.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caltontp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/calyearstart.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clocktime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clocktypes.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decodenetnum.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dofptoa.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dolfptoa.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emalloc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/findconfig.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hextoint.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hextolfp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/humandate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icom.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iosignal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/is_ip_address.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_strbuf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libssl_compat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/machines.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modetoa.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mstolfp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msyslog.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netof.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_calendar.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_calgps.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_crypto_rnd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_intres.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_libopts.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_lineedit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_random.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_realpath.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_rfc2553.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_worker.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/numtoa.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/numtohost.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/octtoint.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prettydate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvbuff.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refidsmear.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refnumtoa.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socket.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socktoa.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socktohost.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_init.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statestr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strl_obsd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syssignal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/systime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/systime_s.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timespecops.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timetoa.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timevalops.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timexsup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uglydate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vint64ops.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/work_fork.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/work_thread.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsbprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ymd2yd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/assertions.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/backtrace-emptytbl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/backtrace.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/buffer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/error.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/event.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/inet_ntop.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/inet_pton.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/lib.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/log.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/md5.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/netaddr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/netscope.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/ondestroy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/random.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/result.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/sha1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/sockaddr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/task.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/$(DEPDIR)/tsmemcmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/nls/$(DEPDIR)/msgcat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/nothreads/$(DEPDIR)/condition.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/nothreads/$(DEPDIR)/thread.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/pthreads/$(DEPDIR)/condition.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/pthreads/$(DEPDIR)/mutex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/pthreads/$(DEPDIR)/thread.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/unix/$(DEPDIR)/dir.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/unix/$(DEPDIR)/errno2result.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/unix/$(DEPDIR)/file.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/unix/$(DEPDIR)/interfaceiter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/unix/$(DEPDIR)/net.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/unix/$(DEPDIR)/stdio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/unix/$(DEPDIR)/stdtime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/unix/$(DEPDIR)/strerror.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/isc/unix/$(DEPDIR)/time.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< -assertions.o: $(srcdir)/../lib/isc/assertions.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT assertions.o -MD -MP -MF $(DEPDIR)/assertions.Tpo -c -o assertions.o `test -f '$(srcdir)/../lib/isc/assertions.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/assertions.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/assertions.Tpo $(DEPDIR)/assertions.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/assertions.c' object='assertions.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o assertions.o `test -f '$(srcdir)/../lib/isc/assertions.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/assertions.c - -assertions.obj: $(srcdir)/../lib/isc/assertions.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT assertions.obj -MD -MP -MF $(DEPDIR)/assertions.Tpo -c -o assertions.obj `if test -f '$(srcdir)/../lib/isc/assertions.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/assertions.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/assertions.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/assertions.Tpo $(DEPDIR)/assertions.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/assertions.c' object='assertions.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o assertions.obj `if test -f '$(srcdir)/../lib/isc/assertions.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/assertions.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/assertions.c'; fi` - -buffer.o: $(srcdir)/../lib/isc/buffer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT buffer.o -MD -MP -MF $(DEPDIR)/buffer.Tpo -c -o buffer.o `test -f '$(srcdir)/../lib/isc/buffer.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/buffer.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/buffer.Tpo $(DEPDIR)/buffer.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/buffer.c' object='buffer.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o buffer.o `test -f '$(srcdir)/../lib/isc/buffer.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/buffer.c - -buffer.obj: $(srcdir)/../lib/isc/buffer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT buffer.obj -MD -MP -MF $(DEPDIR)/buffer.Tpo -c -o buffer.obj `if test -f '$(srcdir)/../lib/isc/buffer.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/buffer.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/buffer.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/buffer.Tpo $(DEPDIR)/buffer.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/buffer.c' object='buffer.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o buffer.obj `if test -f '$(srcdir)/../lib/isc/buffer.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/buffer.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/buffer.c'; fi` - -backtrace-emptytbl.o: $(srcdir)/../lib/isc/backtrace-emptytbl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT backtrace-emptytbl.o -MD -MP -MF $(DEPDIR)/backtrace-emptytbl.Tpo -c -o backtrace-emptytbl.o `test -f '$(srcdir)/../lib/isc/backtrace-emptytbl.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/backtrace-emptytbl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/backtrace-emptytbl.Tpo $(DEPDIR)/backtrace-emptytbl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/backtrace-emptytbl.c' object='backtrace-emptytbl.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o backtrace-emptytbl.o `test -f '$(srcdir)/../lib/isc/backtrace-emptytbl.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/backtrace-emptytbl.c - -backtrace-emptytbl.obj: $(srcdir)/../lib/isc/backtrace-emptytbl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT backtrace-emptytbl.obj -MD -MP -MF $(DEPDIR)/backtrace-emptytbl.Tpo -c -o backtrace-emptytbl.obj `if test -f '$(srcdir)/../lib/isc/backtrace-emptytbl.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/backtrace-emptytbl.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/backtrace-emptytbl.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/backtrace-emptytbl.Tpo $(DEPDIR)/backtrace-emptytbl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/backtrace-emptytbl.c' object='backtrace-emptytbl.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o backtrace-emptytbl.obj `if test -f '$(srcdir)/../lib/isc/backtrace-emptytbl.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/backtrace-emptytbl.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/backtrace-emptytbl.c'; fi` - -backtrace.o: $(srcdir)/../lib/isc/backtrace.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT backtrace.o -MD -MP -MF $(DEPDIR)/backtrace.Tpo -c -o backtrace.o `test -f '$(srcdir)/../lib/isc/backtrace.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/backtrace.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/backtrace.Tpo $(DEPDIR)/backtrace.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/backtrace.c' object='backtrace.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o backtrace.o `test -f '$(srcdir)/../lib/isc/backtrace.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/backtrace.c - -backtrace.obj: $(srcdir)/../lib/isc/backtrace.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT backtrace.obj -MD -MP -MF $(DEPDIR)/backtrace.Tpo -c -o backtrace.obj `if test -f '$(srcdir)/../lib/isc/backtrace.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/backtrace.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/backtrace.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/backtrace.Tpo $(DEPDIR)/backtrace.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/backtrace.c' object='backtrace.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o backtrace.obj `if test -f '$(srcdir)/../lib/isc/backtrace.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/backtrace.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/backtrace.c'; fi` - -condition.o: $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT condition.o -MD -MP -MF $(DEPDIR)/condition.Tpo -c -o condition.o `test -f '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/condition.Tpo $(DEPDIR)/condition.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c' object='condition.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o condition.o `test -f '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c - -condition.obj: $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT condition.obj -MD -MP -MF $(DEPDIR)/condition.Tpo -c -o condition.obj `if test -f '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/condition.Tpo $(DEPDIR)/condition.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c' object='condition.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o condition.obj `if test -f '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c'; fi` - -dir.o: $(srcdir)/../lib/isc/unix/dir.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dir.o -MD -MP -MF $(DEPDIR)/dir.Tpo -c -o dir.o `test -f '$(srcdir)/../lib/isc/unix/dir.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/dir.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dir.Tpo $(DEPDIR)/dir.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/unix/dir.c' object='dir.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dir.o `test -f '$(srcdir)/../lib/isc/unix/dir.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/dir.c - -dir.obj: $(srcdir)/../lib/isc/unix/dir.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dir.obj -MD -MP -MF $(DEPDIR)/dir.Tpo -c -o dir.obj `if test -f '$(srcdir)/../lib/isc/unix/dir.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/dir.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/dir.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dir.Tpo $(DEPDIR)/dir.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/unix/dir.c' object='dir.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dir.obj `if test -f '$(srcdir)/../lib/isc/unix/dir.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/dir.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/dir.c'; fi` - -error.o: $(srcdir)/../lib/isc/error.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT error.o -MD -MP -MF $(DEPDIR)/error.Tpo -c -o error.o `test -f '$(srcdir)/../lib/isc/error.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/error.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/error.Tpo $(DEPDIR)/error.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/error.c' object='error.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o error.o `test -f '$(srcdir)/../lib/isc/error.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/error.c - -error.obj: $(srcdir)/../lib/isc/error.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT error.obj -MD -MP -MF $(DEPDIR)/error.Tpo -c -o error.obj `if test -f '$(srcdir)/../lib/isc/error.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/error.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/error.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/error.Tpo $(DEPDIR)/error.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/error.c' object='error.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o error.obj `if test -f '$(srcdir)/../lib/isc/error.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/error.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/error.c'; fi` - -errno2result.o: $(srcdir)/../lib/isc/unix/errno2result.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT errno2result.o -MD -MP -MF $(DEPDIR)/errno2result.Tpo -c -o errno2result.o `test -f '$(srcdir)/../lib/isc/unix/errno2result.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/errno2result.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/errno2result.Tpo $(DEPDIR)/errno2result.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/unix/errno2result.c' object='errno2result.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o errno2result.o `test -f '$(srcdir)/../lib/isc/unix/errno2result.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/errno2result.c - -errno2result.obj: $(srcdir)/../lib/isc/unix/errno2result.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT errno2result.obj -MD -MP -MF $(DEPDIR)/errno2result.Tpo -c -o errno2result.obj `if test -f '$(srcdir)/../lib/isc/unix/errno2result.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/errno2result.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/errno2result.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/errno2result.Tpo $(DEPDIR)/errno2result.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/unix/errno2result.c' object='errno2result.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o errno2result.obj `if test -f '$(srcdir)/../lib/isc/unix/errno2result.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/errno2result.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/errno2result.c'; fi` - -event.o: $(srcdir)/../lib/isc/event.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT event.o -MD -MP -MF $(DEPDIR)/event.Tpo -c -o event.o `test -f '$(srcdir)/../lib/isc/event.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/event.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/event.Tpo $(DEPDIR)/event.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/event.c' object='event.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o event.o `test -f '$(srcdir)/../lib/isc/event.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/event.c - -event.obj: $(srcdir)/../lib/isc/event.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT event.obj -MD -MP -MF $(DEPDIR)/event.Tpo -c -o event.obj `if test -f '$(srcdir)/../lib/isc/event.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/event.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/event.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/event.Tpo $(DEPDIR)/event.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/event.c' object='event.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o event.obj `if test -f '$(srcdir)/../lib/isc/event.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/event.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/event.c'; fi` - -file.o: $(srcdir)/../lib/isc/unix/file.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT file.o -MD -MP -MF $(DEPDIR)/file.Tpo -c -o file.o `test -f '$(srcdir)/../lib/isc/unix/file.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/file.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/file.Tpo $(DEPDIR)/file.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/unix/file.c' object='file.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o file.o `test -f '$(srcdir)/../lib/isc/unix/file.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/file.c - -file.obj: $(srcdir)/../lib/isc/unix/file.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT file.obj -MD -MP -MF $(DEPDIR)/file.Tpo -c -o file.obj `if test -f '$(srcdir)/../lib/isc/unix/file.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/file.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/file.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/file.Tpo $(DEPDIR)/file.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/unix/file.c' object='file.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o file.obj `if test -f '$(srcdir)/../lib/isc/unix/file.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/file.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/file.c'; fi` - -inet_ntop.o: $(srcdir)/../lib/isc/inet_ntop.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT inet_ntop.o -MD -MP -MF $(DEPDIR)/inet_ntop.Tpo -c -o inet_ntop.o `test -f '$(srcdir)/../lib/isc/inet_ntop.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/inet_ntop.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/inet_ntop.Tpo $(DEPDIR)/inet_ntop.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/inet_ntop.c' object='inet_ntop.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o inet_ntop.o `test -f '$(srcdir)/../lib/isc/inet_ntop.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/inet_ntop.c - -inet_ntop.obj: $(srcdir)/../lib/isc/inet_ntop.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT inet_ntop.obj -MD -MP -MF $(DEPDIR)/inet_ntop.Tpo -c -o inet_ntop.obj `if test -f '$(srcdir)/../lib/isc/inet_ntop.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/inet_ntop.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/inet_ntop.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/inet_ntop.Tpo $(DEPDIR)/inet_ntop.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/inet_ntop.c' object='inet_ntop.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o inet_ntop.obj `if test -f '$(srcdir)/../lib/isc/inet_ntop.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/inet_ntop.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/inet_ntop.c'; fi` - -inet_pton.o: $(srcdir)/../lib/isc/inet_pton.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT inet_pton.o -MD -MP -MF $(DEPDIR)/inet_pton.Tpo -c -o inet_pton.o `test -f '$(srcdir)/../lib/isc/inet_pton.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/inet_pton.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/inet_pton.Tpo $(DEPDIR)/inet_pton.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/inet_pton.c' object='inet_pton.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o inet_pton.o `test -f '$(srcdir)/../lib/isc/inet_pton.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/inet_pton.c - -inet_pton.obj: $(srcdir)/../lib/isc/inet_pton.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT inet_pton.obj -MD -MP -MF $(DEPDIR)/inet_pton.Tpo -c -o inet_pton.obj `if test -f '$(srcdir)/../lib/isc/inet_pton.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/inet_pton.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/inet_pton.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/inet_pton.Tpo $(DEPDIR)/inet_pton.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/inet_pton.c' object='inet_pton.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o inet_pton.obj `if test -f '$(srcdir)/../lib/isc/inet_pton.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/inet_pton.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/inet_pton.c'; fi` - -interfaceiter.o: $(srcdir)/../lib/isc/unix/interfaceiter.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT interfaceiter.o -MD -MP -MF $(DEPDIR)/interfaceiter.Tpo -c -o interfaceiter.o `test -f '$(srcdir)/../lib/isc/unix/interfaceiter.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/interfaceiter.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/interfaceiter.Tpo $(DEPDIR)/interfaceiter.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/unix/interfaceiter.c' object='interfaceiter.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o interfaceiter.o `test -f '$(srcdir)/../lib/isc/unix/interfaceiter.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/interfaceiter.c - -interfaceiter.obj: $(srcdir)/../lib/isc/unix/interfaceiter.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT interfaceiter.obj -MD -MP -MF $(DEPDIR)/interfaceiter.Tpo -c -o interfaceiter.obj `if test -f '$(srcdir)/../lib/isc/unix/interfaceiter.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/interfaceiter.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/interfaceiter.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/interfaceiter.Tpo $(DEPDIR)/interfaceiter.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/unix/interfaceiter.c' object='interfaceiter.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o interfaceiter.obj `if test -f '$(srcdir)/../lib/isc/unix/interfaceiter.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/interfaceiter.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/interfaceiter.c'; fi` - -lib.o: $(srcdir)/../lib/isc/lib.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lib.o -MD -MP -MF $(DEPDIR)/lib.Tpo -c -o lib.o `test -f '$(srcdir)/../lib/isc/lib.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/lib.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lib.Tpo $(DEPDIR)/lib.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/lib.c' object='lib.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lib.o `test -f '$(srcdir)/../lib/isc/lib.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/lib.c - -lib.obj: $(srcdir)/../lib/isc/lib.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lib.obj -MD -MP -MF $(DEPDIR)/lib.Tpo -c -o lib.obj `if test -f '$(srcdir)/../lib/isc/lib.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/lib.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/lib.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lib.Tpo $(DEPDIR)/lib.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/lib.c' object='lib.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lib.obj `if test -f '$(srcdir)/../lib/isc/lib.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/lib.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/lib.c'; fi` - -log.o: $(srcdir)/../lib/isc/log.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT log.o -MD -MP -MF $(DEPDIR)/log.Tpo -c -o log.o `test -f '$(srcdir)/../lib/isc/log.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/log.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/log.Tpo $(DEPDIR)/log.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/log.c' object='log.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o log.o `test -f '$(srcdir)/../lib/isc/log.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/log.c - -log.obj: $(srcdir)/../lib/isc/log.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT log.obj -MD -MP -MF $(DEPDIR)/log.Tpo -c -o log.obj `if test -f '$(srcdir)/../lib/isc/log.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/log.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/log.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/log.Tpo $(DEPDIR)/log.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/log.c' object='log.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o log.obj `if test -f '$(srcdir)/../lib/isc/log.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/log.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/log.c'; fi` - -md5.o: $(srcdir)/../lib/isc/md5.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT md5.o -MD -MP -MF $(DEPDIR)/md5.Tpo -c -o md5.o `test -f '$(srcdir)/../lib/isc/md5.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/md5.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/md5.Tpo $(DEPDIR)/md5.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/md5.c' object='md5.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o md5.o `test -f '$(srcdir)/../lib/isc/md5.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/md5.c - -md5.obj: $(srcdir)/../lib/isc/md5.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT md5.obj -MD -MP -MF $(DEPDIR)/md5.Tpo -c -o md5.obj `if test -f '$(srcdir)/../lib/isc/md5.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/md5.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/md5.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/md5.Tpo $(DEPDIR)/md5.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/md5.c' object='md5.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o md5.obj `if test -f '$(srcdir)/../lib/isc/md5.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/md5.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/md5.c'; fi` - -msgcat.o: $(srcdir)/../lib/isc/nls/msgcat.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT msgcat.o -MD -MP -MF $(DEPDIR)/msgcat.Tpo -c -o msgcat.o `test -f '$(srcdir)/../lib/isc/nls/msgcat.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/nls/msgcat.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/msgcat.Tpo $(DEPDIR)/msgcat.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/nls/msgcat.c' object='msgcat.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o msgcat.o `test -f '$(srcdir)/../lib/isc/nls/msgcat.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/nls/msgcat.c - -msgcat.obj: $(srcdir)/../lib/isc/nls/msgcat.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT msgcat.obj -MD -MP -MF $(DEPDIR)/msgcat.Tpo -c -o msgcat.obj `if test -f '$(srcdir)/../lib/isc/nls/msgcat.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/nls/msgcat.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/nls/msgcat.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/msgcat.Tpo $(DEPDIR)/msgcat.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/nls/msgcat.c' object='msgcat.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o msgcat.obj `if test -f '$(srcdir)/../lib/isc/nls/msgcat.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/nls/msgcat.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/nls/msgcat.c'; fi` - -net.o: $(srcdir)/../lib/isc/unix/net.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT net.o -MD -MP -MF $(DEPDIR)/net.Tpo -c -o net.o `test -f '$(srcdir)/../lib/isc/unix/net.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/net.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/net.Tpo $(DEPDIR)/net.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/unix/net.c' object='net.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o net.o `test -f '$(srcdir)/../lib/isc/unix/net.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/net.c - -net.obj: $(srcdir)/../lib/isc/unix/net.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT net.obj -MD -MP -MF $(DEPDIR)/net.Tpo -c -o net.obj `if test -f '$(srcdir)/../lib/isc/unix/net.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/net.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/net.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/net.Tpo $(DEPDIR)/net.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/unix/net.c' object='net.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o net.obj `if test -f '$(srcdir)/../lib/isc/unix/net.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/net.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/net.c'; fi` - -netaddr.o: $(srcdir)/../lib/isc/netaddr.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netaddr.o -MD -MP -MF $(DEPDIR)/netaddr.Tpo -c -o netaddr.o `test -f '$(srcdir)/../lib/isc/netaddr.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/netaddr.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/netaddr.Tpo $(DEPDIR)/netaddr.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/netaddr.c' object='netaddr.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netaddr.o `test -f '$(srcdir)/../lib/isc/netaddr.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/netaddr.c - -netaddr.obj: $(srcdir)/../lib/isc/netaddr.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netaddr.obj -MD -MP -MF $(DEPDIR)/netaddr.Tpo -c -o netaddr.obj `if test -f '$(srcdir)/../lib/isc/netaddr.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/netaddr.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/netaddr.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/netaddr.Tpo $(DEPDIR)/netaddr.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/netaddr.c' object='netaddr.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netaddr.obj `if test -f '$(srcdir)/../lib/isc/netaddr.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/netaddr.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/netaddr.c'; fi` - -netscope.o: $(srcdir)/../lib/isc/netscope.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netscope.o -MD -MP -MF $(DEPDIR)/netscope.Tpo -c -o netscope.o `test -f '$(srcdir)/../lib/isc/netscope.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/netscope.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/netscope.Tpo $(DEPDIR)/netscope.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/netscope.c' object='netscope.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netscope.o `test -f '$(srcdir)/../lib/isc/netscope.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/netscope.c - -netscope.obj: $(srcdir)/../lib/isc/netscope.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netscope.obj -MD -MP -MF $(DEPDIR)/netscope.Tpo -c -o netscope.obj `if test -f '$(srcdir)/../lib/isc/netscope.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/netscope.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/netscope.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/netscope.Tpo $(DEPDIR)/netscope.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/netscope.c' object='netscope.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netscope.obj `if test -f '$(srcdir)/../lib/isc/netscope.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/netscope.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/netscope.c'; fi` - -ondestroy.o: $(srcdir)/../lib/isc/ondestroy.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ondestroy.o -MD -MP -MF $(DEPDIR)/ondestroy.Tpo -c -o ondestroy.o `test -f '$(srcdir)/../lib/isc/ondestroy.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/ondestroy.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ondestroy.Tpo $(DEPDIR)/ondestroy.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/ondestroy.c' object='ondestroy.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ondestroy.o `test -f '$(srcdir)/../lib/isc/ondestroy.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/ondestroy.c - -ondestroy.obj: $(srcdir)/../lib/isc/ondestroy.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ondestroy.obj -MD -MP -MF $(DEPDIR)/ondestroy.Tpo -c -o ondestroy.obj `if test -f '$(srcdir)/../lib/isc/ondestroy.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/ondestroy.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/ondestroy.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ondestroy.Tpo $(DEPDIR)/ondestroy.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/ondestroy.c' object='ondestroy.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ondestroy.obj `if test -f '$(srcdir)/../lib/isc/ondestroy.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/ondestroy.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/ondestroy.c'; fi` - -random.o: $(srcdir)/../lib/isc/random.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT random.o -MD -MP -MF $(DEPDIR)/random.Tpo -c -o random.o `test -f '$(srcdir)/../lib/isc/random.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/random.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/random.Tpo $(DEPDIR)/random.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/random.c' object='random.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o random.o `test -f '$(srcdir)/../lib/isc/random.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/random.c - -random.obj: $(srcdir)/../lib/isc/random.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT random.obj -MD -MP -MF $(DEPDIR)/random.Tpo -c -o random.obj `if test -f '$(srcdir)/../lib/isc/random.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/random.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/random.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/random.Tpo $(DEPDIR)/random.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/random.c' object='random.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o random.obj `if test -f '$(srcdir)/../lib/isc/random.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/random.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/random.c'; fi` - -result.o: $(srcdir)/../lib/isc/result.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT result.o -MD -MP -MF $(DEPDIR)/result.Tpo -c -o result.o `test -f '$(srcdir)/../lib/isc/result.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/result.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/result.Tpo $(DEPDIR)/result.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/result.c' object='result.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o result.o `test -f '$(srcdir)/../lib/isc/result.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/result.c - -result.obj: $(srcdir)/../lib/isc/result.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT result.obj -MD -MP -MF $(DEPDIR)/result.Tpo -c -o result.obj `if test -f '$(srcdir)/../lib/isc/result.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/result.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/result.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/result.Tpo $(DEPDIR)/result.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/result.c' object='result.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o result.obj `if test -f '$(srcdir)/../lib/isc/result.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/result.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/result.c'; fi` - -stdio.o: $(srcdir)/../lib/isc/unix/stdio.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stdio.o -MD -MP -MF $(DEPDIR)/stdio.Tpo -c -o stdio.o `test -f '$(srcdir)/../lib/isc/unix/stdio.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/stdio.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stdio.Tpo $(DEPDIR)/stdio.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/unix/stdio.c' object='stdio.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stdio.o `test -f '$(srcdir)/../lib/isc/unix/stdio.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/stdio.c - -stdio.obj: $(srcdir)/../lib/isc/unix/stdio.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stdio.obj -MD -MP -MF $(DEPDIR)/stdio.Tpo -c -o stdio.obj `if test -f '$(srcdir)/../lib/isc/unix/stdio.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/stdio.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/stdio.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stdio.Tpo $(DEPDIR)/stdio.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/unix/stdio.c' object='stdio.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stdio.obj `if test -f '$(srcdir)/../lib/isc/unix/stdio.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/stdio.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/stdio.c'; fi` - -stdtime.o: $(srcdir)/../lib/isc/unix/stdtime.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stdtime.o -MD -MP -MF $(DEPDIR)/stdtime.Tpo -c -o stdtime.o `test -f '$(srcdir)/../lib/isc/unix/stdtime.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/stdtime.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stdtime.Tpo $(DEPDIR)/stdtime.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/unix/stdtime.c' object='stdtime.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stdtime.o `test -f '$(srcdir)/../lib/isc/unix/stdtime.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/stdtime.c - -stdtime.obj: $(srcdir)/../lib/isc/unix/stdtime.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stdtime.obj -MD -MP -MF $(DEPDIR)/stdtime.Tpo -c -o stdtime.obj `if test -f '$(srcdir)/../lib/isc/unix/stdtime.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/stdtime.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/stdtime.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stdtime.Tpo $(DEPDIR)/stdtime.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/unix/stdtime.c' object='stdtime.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stdtime.obj `if test -f '$(srcdir)/../lib/isc/unix/stdtime.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/stdtime.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/stdtime.c'; fi` - -strerror.o: $(srcdir)/../lib/isc/unix/strerror.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strerror.o -MD -MP -MF $(DEPDIR)/strerror.Tpo -c -o strerror.o `test -f '$(srcdir)/../lib/isc/unix/strerror.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/strerror.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strerror.Tpo $(DEPDIR)/strerror.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/unix/strerror.c' object='strerror.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strerror.o `test -f '$(srcdir)/../lib/isc/unix/strerror.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/strerror.c - -strerror.obj: $(srcdir)/../lib/isc/unix/strerror.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strerror.obj -MD -MP -MF $(DEPDIR)/strerror.Tpo -c -o strerror.obj `if test -f '$(srcdir)/../lib/isc/unix/strerror.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/strerror.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/strerror.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strerror.Tpo $(DEPDIR)/strerror.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/unix/strerror.c' object='strerror.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strerror.obj `if test -f '$(srcdir)/../lib/isc/unix/strerror.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/strerror.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/strerror.c'; fi` - -task.o: $(srcdir)/../lib/isc/task.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT task.o -MD -MP -MF $(DEPDIR)/task.Tpo -c -o task.o `test -f '$(srcdir)/../lib/isc/task.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/task.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/task.Tpo $(DEPDIR)/task.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/task.c' object='task.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o task.o `test -f '$(srcdir)/../lib/isc/task.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/task.c - -task.obj: $(srcdir)/../lib/isc/task.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT task.obj -MD -MP -MF $(DEPDIR)/task.Tpo -c -o task.obj `if test -f '$(srcdir)/../lib/isc/task.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/task.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/task.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/task.Tpo $(DEPDIR)/task.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/task.c' object='task.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o task.obj `if test -f '$(srcdir)/../lib/isc/task.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/task.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/task.c'; fi` - -thread.o: $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT thread.o -MD -MP -MF $(DEPDIR)/thread.Tpo -c -o thread.o `test -f '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/thread.Tpo $(DEPDIR)/thread.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c' object='thread.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o thread.o `test -f '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c - -thread.obj: $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT thread.obj -MD -MP -MF $(DEPDIR)/thread.Tpo -c -o thread.obj `if test -f '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/thread.Tpo $(DEPDIR)/thread.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c' object='thread.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o thread.obj `if test -f '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c'; fi` - -time.o: $(srcdir)/../lib/isc/unix/time.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT time.o -MD -MP -MF $(DEPDIR)/time.Tpo -c -o time.o `test -f '$(srcdir)/../lib/isc/unix/time.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/time.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/time.Tpo $(DEPDIR)/time.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/unix/time.c' object='time.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o time.o `test -f '$(srcdir)/../lib/isc/unix/time.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/time.c - -time.obj: $(srcdir)/../lib/isc/unix/time.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT time.obj -MD -MP -MF $(DEPDIR)/time.Tpo -c -o time.obj `if test -f '$(srcdir)/../lib/isc/unix/time.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/time.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/time.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/time.Tpo $(DEPDIR)/time.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/unix/time.c' object='time.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o time.obj `if test -f '$(srcdir)/../lib/isc/unix/time.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/time.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/time.c'; fi` - -sha1.o: $(srcdir)/../lib/isc/sha1.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha1.o -MD -MP -MF $(DEPDIR)/sha1.Tpo -c -o sha1.o `test -f '$(srcdir)/../lib/isc/sha1.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/sha1.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sha1.Tpo $(DEPDIR)/sha1.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/sha1.c' object='sha1.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sha1.o `test -f '$(srcdir)/../lib/isc/sha1.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/sha1.c - -sha1.obj: $(srcdir)/../lib/isc/sha1.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha1.obj -MD -MP -MF $(DEPDIR)/sha1.Tpo -c -o sha1.obj `if test -f '$(srcdir)/../lib/isc/sha1.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/sha1.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/sha1.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sha1.Tpo $(DEPDIR)/sha1.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/sha1.c' object='sha1.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sha1.obj `if test -f '$(srcdir)/../lib/isc/sha1.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/sha1.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/sha1.c'; fi` - -sockaddr.o: $(srcdir)/../lib/isc/sockaddr.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sockaddr.o -MD -MP -MF $(DEPDIR)/sockaddr.Tpo -c -o sockaddr.o `test -f '$(srcdir)/../lib/isc/sockaddr.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/sockaddr.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sockaddr.Tpo $(DEPDIR)/sockaddr.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/sockaddr.c' object='sockaddr.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sockaddr.o `test -f '$(srcdir)/../lib/isc/sockaddr.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/sockaddr.c - -sockaddr.obj: $(srcdir)/../lib/isc/sockaddr.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sockaddr.obj -MD -MP -MF $(DEPDIR)/sockaddr.Tpo -c -o sockaddr.obj `if test -f '$(srcdir)/../lib/isc/sockaddr.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/sockaddr.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/sockaddr.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sockaddr.Tpo $(DEPDIR)/sockaddr.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/sockaddr.c' object='sockaddr.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sockaddr.obj `if test -f '$(srcdir)/../lib/isc/sockaddr.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/sockaddr.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/sockaddr.c'; fi` - -tsmemcmp.o: $(srcdir)/../lib/isc/tsmemcmp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tsmemcmp.o -MD -MP -MF $(DEPDIR)/tsmemcmp.Tpo -c -o tsmemcmp.o `test -f '$(srcdir)/../lib/isc/tsmemcmp.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/tsmemcmp.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tsmemcmp.Tpo $(DEPDIR)/tsmemcmp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/tsmemcmp.c' object='tsmemcmp.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tsmemcmp.o `test -f '$(srcdir)/../lib/isc/tsmemcmp.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/tsmemcmp.c - -tsmemcmp.obj: $(srcdir)/../lib/isc/tsmemcmp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tsmemcmp.obj -MD -MP -MF $(DEPDIR)/tsmemcmp.Tpo -c -o tsmemcmp.obj `if test -f '$(srcdir)/../lib/isc/tsmemcmp.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/tsmemcmp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/tsmemcmp.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tsmemcmp.Tpo $(DEPDIR)/tsmemcmp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/tsmemcmp.c' object='tsmemcmp.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tsmemcmp.obj `if test -f '$(srcdir)/../lib/isc/tsmemcmp.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/tsmemcmp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/tsmemcmp.c'; fi` - -mutex.o: $(srcdir)/../lib/isc/pthreads/mutex.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mutex.o -MD -MP -MF $(DEPDIR)/mutex.Tpo -c -o mutex.o `test -f '$(srcdir)/../lib/isc/pthreads/mutex.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/pthreads/mutex.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mutex.Tpo $(DEPDIR)/mutex.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/pthreads/mutex.c' object='mutex.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mutex.o `test -f '$(srcdir)/../lib/isc/pthreads/mutex.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/pthreads/mutex.c - -mutex.obj: $(srcdir)/../lib/isc/pthreads/mutex.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mutex.obj -MD -MP -MF $(DEPDIR)/mutex.Tpo -c -o mutex.obj `if test -f '$(srcdir)/../lib/isc/pthreads/mutex.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/pthreads/mutex.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/pthreads/mutex.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mutex.Tpo $(DEPDIR)/mutex.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../lib/isc/pthreads/mutex.c' object='mutex.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mutex.obj `if test -f '$(srcdir)/../lib/isc/pthreads/mutex.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/pthreads/mutex.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/pthreads/mutex.c'; fi` - mostlyclean-libtool: -rm -f *.lo @@ -1429,8 +1243,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -1463,11 +1279,12 @@ distdir: $(DISTFILES) check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(LIBRARIES) +all-am: Makefile $(LIBRARIES) $(HEADERS) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -1493,6 +1310,17 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f lib/isc/$(DEPDIR)/$(am__dirstamp) + -rm -f lib/isc/$(am__dirstamp) + -rm -f lib/isc/nls/$(DEPDIR)/$(am__dirstamp) + -rm -f lib/isc/nls/$(am__dirstamp) + -rm -f lib/isc/nothreads/$(DEPDIR)/$(am__dirstamp) + -rm -f lib/isc/nothreads/$(am__dirstamp) + -rm -f lib/isc/pthreads/$(DEPDIR)/$(am__dirstamp) + -rm -f lib/isc/pthreads/$(am__dirstamp) + -rm -f lib/isc/unix/$(DEPDIR)/$(am__dirstamp) + -rm -f lib/isc/unix/$(am__dirstamp) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -1504,7 +1332,116 @@ clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/a_md5encrypt.Po + -rm -f ./$(DEPDIR)/adjtime.Po + -rm -f ./$(DEPDIR)/adjtimex.Po + -rm -f ./$(DEPDIR)/atoint.Po + -rm -f ./$(DEPDIR)/atolfp.Po + -rm -f ./$(DEPDIR)/atouint.Po + -rm -f ./$(DEPDIR)/audio.Po + -rm -f ./$(DEPDIR)/authkeys.Po + -rm -f ./$(DEPDIR)/authreadkeys.Po + -rm -f ./$(DEPDIR)/authusekey.Po + -rm -f ./$(DEPDIR)/bsd_strerror.Po + -rm -f ./$(DEPDIR)/buftvtots.Po + -rm -f ./$(DEPDIR)/caljulian.Po + -rm -f ./$(DEPDIR)/caltontp.Po + -rm -f ./$(DEPDIR)/calyearstart.Po + -rm -f ./$(DEPDIR)/clocktime.Po + -rm -f ./$(DEPDIR)/clocktypes.Po + -rm -f ./$(DEPDIR)/decodenetnum.Po + -rm -f ./$(DEPDIR)/dofptoa.Po + -rm -f ./$(DEPDIR)/dolfptoa.Po + -rm -f ./$(DEPDIR)/emalloc.Po + -rm -f ./$(DEPDIR)/findconfig.Po + -rm -f ./$(DEPDIR)/getopt.Po + -rm -f ./$(DEPDIR)/hextoint.Po + -rm -f ./$(DEPDIR)/hextolfp.Po + -rm -f ./$(DEPDIR)/humandate.Po + -rm -f ./$(DEPDIR)/icom.Po + -rm -f ./$(DEPDIR)/iosignal.Po + -rm -f ./$(DEPDIR)/is_ip_address.Po + -rm -f ./$(DEPDIR)/lib_strbuf.Po + -rm -f ./$(DEPDIR)/libssl_compat.Po + -rm -f ./$(DEPDIR)/machines.Po + -rm -f ./$(DEPDIR)/mktime.Po + -rm -f ./$(DEPDIR)/modetoa.Po + -rm -f ./$(DEPDIR)/mstolfp.Po + -rm -f ./$(DEPDIR)/msyslog.Po + -rm -f ./$(DEPDIR)/netof.Po + -rm -f ./$(DEPDIR)/ntp_calendar.Po + -rm -f ./$(DEPDIR)/ntp_calgps.Po + -rm -f ./$(DEPDIR)/ntp_crypto_rnd.Po + -rm -f ./$(DEPDIR)/ntp_intres.Po + -rm -f ./$(DEPDIR)/ntp_libopts.Po + -rm -f ./$(DEPDIR)/ntp_lineedit.Po + -rm -f ./$(DEPDIR)/ntp_random.Po + -rm -f ./$(DEPDIR)/ntp_realpath.Po + -rm -f ./$(DEPDIR)/ntp_rfc2553.Po + -rm -f ./$(DEPDIR)/ntp_worker.Po + -rm -f ./$(DEPDIR)/numtoa.Po + -rm -f ./$(DEPDIR)/numtohost.Po + -rm -f ./$(DEPDIR)/octtoint.Po + -rm -f ./$(DEPDIR)/prettydate.Po + -rm -f ./$(DEPDIR)/recvbuff.Po + -rm -f ./$(DEPDIR)/refidsmear.Po + -rm -f ./$(DEPDIR)/refnumtoa.Po + -rm -f ./$(DEPDIR)/snprintf.Po + -rm -f ./$(DEPDIR)/socket.Po + -rm -f ./$(DEPDIR)/socktoa.Po + -rm -f ./$(DEPDIR)/socktohost.Po + -rm -f ./$(DEPDIR)/ssl_init.Po + -rm -f ./$(DEPDIR)/statestr.Po + -rm -f ./$(DEPDIR)/strdup.Po + -rm -f ./$(DEPDIR)/strl_obsd.Po + -rm -f ./$(DEPDIR)/syssignal.Po + -rm -f ./$(DEPDIR)/systime.Po + -rm -f ./$(DEPDIR)/systime_s.Po + -rm -f ./$(DEPDIR)/timespecops.Po + -rm -f ./$(DEPDIR)/timetoa.Po + -rm -f ./$(DEPDIR)/timevalops.Po + -rm -f ./$(DEPDIR)/timexsup.Po + -rm -f ./$(DEPDIR)/uglydate.Po + -rm -f ./$(DEPDIR)/vint64ops.Po + -rm -f ./$(DEPDIR)/work_fork.Po + -rm -f ./$(DEPDIR)/work_thread.Po + -rm -f ./$(DEPDIR)/xsbprintf.Po + -rm -f ./$(DEPDIR)/ymd2yd.Po + -rm -f lib/isc/$(DEPDIR)/assertions.Po + -rm -f lib/isc/$(DEPDIR)/backtrace-emptytbl.Po + -rm -f lib/isc/$(DEPDIR)/backtrace.Po + -rm -f lib/isc/$(DEPDIR)/buffer.Po + -rm -f lib/isc/$(DEPDIR)/error.Po + -rm -f lib/isc/$(DEPDIR)/event.Po + -rm -f lib/isc/$(DEPDIR)/inet_ntop.Po + -rm -f lib/isc/$(DEPDIR)/inet_pton.Po + -rm -f lib/isc/$(DEPDIR)/lib.Po + -rm -f lib/isc/$(DEPDIR)/log.Po + -rm -f lib/isc/$(DEPDIR)/md5.Po + -rm -f lib/isc/$(DEPDIR)/netaddr.Po + -rm -f lib/isc/$(DEPDIR)/netscope.Po + -rm -f lib/isc/$(DEPDIR)/ondestroy.Po + -rm -f lib/isc/$(DEPDIR)/random.Po + -rm -f lib/isc/$(DEPDIR)/result.Po + -rm -f lib/isc/$(DEPDIR)/sha1.Po + -rm -f lib/isc/$(DEPDIR)/sockaddr.Po + -rm -f lib/isc/$(DEPDIR)/task.Po + -rm -f lib/isc/$(DEPDIR)/tsmemcmp.Po + -rm -f lib/isc/nls/$(DEPDIR)/msgcat.Po + -rm -f lib/isc/nothreads/$(DEPDIR)/condition.Po + -rm -f lib/isc/nothreads/$(DEPDIR)/thread.Po + -rm -f lib/isc/pthreads/$(DEPDIR)/condition.Po + -rm -f lib/isc/pthreads/$(DEPDIR)/mutex.Po + -rm -f lib/isc/pthreads/$(DEPDIR)/thread.Po + -rm -f lib/isc/unix/$(DEPDIR)/dir.Po + -rm -f lib/isc/unix/$(DEPDIR)/errno2result.Po + -rm -f lib/isc/unix/$(DEPDIR)/file.Po + -rm -f lib/isc/unix/$(DEPDIR)/interfaceiter.Po + -rm -f lib/isc/unix/$(DEPDIR)/net.Po + -rm -f lib/isc/unix/$(DEPDIR)/stdio.Po + -rm -f lib/isc/unix/$(DEPDIR)/stdtime.Po + -rm -f lib/isc/unix/$(DEPDIR)/strerror.Po + -rm -f lib/isc/unix/$(DEPDIR)/time.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -1550,7 +1487,116 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/a_md5encrypt.Po + -rm -f ./$(DEPDIR)/adjtime.Po + -rm -f ./$(DEPDIR)/adjtimex.Po + -rm -f ./$(DEPDIR)/atoint.Po + -rm -f ./$(DEPDIR)/atolfp.Po + -rm -f ./$(DEPDIR)/atouint.Po + -rm -f ./$(DEPDIR)/audio.Po + -rm -f ./$(DEPDIR)/authkeys.Po + -rm -f ./$(DEPDIR)/authreadkeys.Po + -rm -f ./$(DEPDIR)/authusekey.Po + -rm -f ./$(DEPDIR)/bsd_strerror.Po + -rm -f ./$(DEPDIR)/buftvtots.Po + -rm -f ./$(DEPDIR)/caljulian.Po + -rm -f ./$(DEPDIR)/caltontp.Po + -rm -f ./$(DEPDIR)/calyearstart.Po + -rm -f ./$(DEPDIR)/clocktime.Po + -rm -f ./$(DEPDIR)/clocktypes.Po + -rm -f ./$(DEPDIR)/decodenetnum.Po + -rm -f ./$(DEPDIR)/dofptoa.Po + -rm -f ./$(DEPDIR)/dolfptoa.Po + -rm -f ./$(DEPDIR)/emalloc.Po + -rm -f ./$(DEPDIR)/findconfig.Po + -rm -f ./$(DEPDIR)/getopt.Po + -rm -f ./$(DEPDIR)/hextoint.Po + -rm -f ./$(DEPDIR)/hextolfp.Po + -rm -f ./$(DEPDIR)/humandate.Po + -rm -f ./$(DEPDIR)/icom.Po + -rm -f ./$(DEPDIR)/iosignal.Po + -rm -f ./$(DEPDIR)/is_ip_address.Po + -rm -f ./$(DEPDIR)/lib_strbuf.Po + -rm -f ./$(DEPDIR)/libssl_compat.Po + -rm -f ./$(DEPDIR)/machines.Po + -rm -f ./$(DEPDIR)/mktime.Po + -rm -f ./$(DEPDIR)/modetoa.Po + -rm -f ./$(DEPDIR)/mstolfp.Po + -rm -f ./$(DEPDIR)/msyslog.Po + -rm -f ./$(DEPDIR)/netof.Po + -rm -f ./$(DEPDIR)/ntp_calendar.Po + -rm -f ./$(DEPDIR)/ntp_calgps.Po + -rm -f ./$(DEPDIR)/ntp_crypto_rnd.Po + -rm -f ./$(DEPDIR)/ntp_intres.Po + -rm -f ./$(DEPDIR)/ntp_libopts.Po + -rm -f ./$(DEPDIR)/ntp_lineedit.Po + -rm -f ./$(DEPDIR)/ntp_random.Po + -rm -f ./$(DEPDIR)/ntp_realpath.Po + -rm -f ./$(DEPDIR)/ntp_rfc2553.Po + -rm -f ./$(DEPDIR)/ntp_worker.Po + -rm -f ./$(DEPDIR)/numtoa.Po + -rm -f ./$(DEPDIR)/numtohost.Po + -rm -f ./$(DEPDIR)/octtoint.Po + -rm -f ./$(DEPDIR)/prettydate.Po + -rm -f ./$(DEPDIR)/recvbuff.Po + -rm -f ./$(DEPDIR)/refidsmear.Po + -rm -f ./$(DEPDIR)/refnumtoa.Po + -rm -f ./$(DEPDIR)/snprintf.Po + -rm -f ./$(DEPDIR)/socket.Po + -rm -f ./$(DEPDIR)/socktoa.Po + -rm -f ./$(DEPDIR)/socktohost.Po + -rm -f ./$(DEPDIR)/ssl_init.Po + -rm -f ./$(DEPDIR)/statestr.Po + -rm -f ./$(DEPDIR)/strdup.Po + -rm -f ./$(DEPDIR)/strl_obsd.Po + -rm -f ./$(DEPDIR)/syssignal.Po + -rm -f ./$(DEPDIR)/systime.Po + -rm -f ./$(DEPDIR)/systime_s.Po + -rm -f ./$(DEPDIR)/timespecops.Po + -rm -f ./$(DEPDIR)/timetoa.Po + -rm -f ./$(DEPDIR)/timevalops.Po + -rm -f ./$(DEPDIR)/timexsup.Po + -rm -f ./$(DEPDIR)/uglydate.Po + -rm -f ./$(DEPDIR)/vint64ops.Po + -rm -f ./$(DEPDIR)/work_fork.Po + -rm -f ./$(DEPDIR)/work_thread.Po + -rm -f ./$(DEPDIR)/xsbprintf.Po + -rm -f ./$(DEPDIR)/ymd2yd.Po + -rm -f lib/isc/$(DEPDIR)/assertions.Po + -rm -f lib/isc/$(DEPDIR)/backtrace-emptytbl.Po + -rm -f lib/isc/$(DEPDIR)/backtrace.Po + -rm -f lib/isc/$(DEPDIR)/buffer.Po + -rm -f lib/isc/$(DEPDIR)/error.Po + -rm -f lib/isc/$(DEPDIR)/event.Po + -rm -f lib/isc/$(DEPDIR)/inet_ntop.Po + -rm -f lib/isc/$(DEPDIR)/inet_pton.Po + -rm -f lib/isc/$(DEPDIR)/lib.Po + -rm -f lib/isc/$(DEPDIR)/log.Po + -rm -f lib/isc/$(DEPDIR)/md5.Po + -rm -f lib/isc/$(DEPDIR)/netaddr.Po + -rm -f lib/isc/$(DEPDIR)/netscope.Po + -rm -f lib/isc/$(DEPDIR)/ondestroy.Po + -rm -f lib/isc/$(DEPDIR)/random.Po + -rm -f lib/isc/$(DEPDIR)/result.Po + -rm -f lib/isc/$(DEPDIR)/sha1.Po + -rm -f lib/isc/$(DEPDIR)/sockaddr.Po + -rm -f lib/isc/$(DEPDIR)/task.Po + -rm -f lib/isc/$(DEPDIR)/tsmemcmp.Po + -rm -f lib/isc/nls/$(DEPDIR)/msgcat.Po + -rm -f lib/isc/nothreads/$(DEPDIR)/condition.Po + -rm -f lib/isc/nothreads/$(DEPDIR)/thread.Po + -rm -f lib/isc/pthreads/$(DEPDIR)/condition.Po + -rm -f lib/isc/pthreads/$(DEPDIR)/mutex.Po + -rm -f lib/isc/pthreads/$(DEPDIR)/thread.Po + -rm -f lib/isc/unix/$(DEPDIR)/dir.Po + -rm -f lib/isc/unix/$(DEPDIR)/errno2result.Po + -rm -f lib/isc/unix/$(DEPDIR)/file.Po + -rm -f lib/isc/unix/$(DEPDIR)/interfaceiter.Po + -rm -f lib/isc/unix/$(DEPDIR)/net.Po + -rm -f lib/isc/unix/$(DEPDIR)/stdio.Po + -rm -f lib/isc/unix/$(DEPDIR)/stdtime.Po + -rm -f lib/isc/unix/$(DEPDIR)/strerror.Po + -rm -f lib/isc/unix/$(DEPDIR)/time.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -1569,31 +1615,35 @@ ps-am: uninstall-am: -.MAKE: all check install install-am install-strip +.MAKE: all check install install-am install-exec install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLIBRARIES cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libtool clean-noinstLIBRARIES \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile + +@BUILD_LIBEVENT_TRUE@libevent_first: +@BUILD_LIBEVENT_TRUE@ cd $(top_builddir)/sntp/libevent && $(MAKE) $(AM_MAKEFLAGS) +@BUILD_LIBEVENT_TRUE@ echo stamp > $@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ - chmod ug+w $@ + chmod u+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ - $(MAKE) $(AM_MAKEFLAGS) clean && \ + $(MAKE) $(AM_MAKEFLAGS) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ @@ -1611,7 +1661,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) - cp $(top_srcdir)/deps-ver $@ + $(AM_V_at)cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/deps-ver @@ -1641,7 +1691,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # -# This comment block follows rather than leads the related code so that +# This comment block follows rather than leads the related rules so that # it stays with it in the generated Makefile.in and Makefile. # diff --git a/libntp/a_md5encrypt.c b/libntp/a_md5encrypt.c index 57100de3a86e..6011af52af6d 100644 --- a/libntp/a_md5encrypt.c +++ b/libntp/a_md5encrypt.c @@ -51,9 +51,9 @@ make_mac( * was created. */ size_t retlen = 0; - + #ifdef OPENSSL - + INIT_SSL(); /* Check if CMAC key type specific code required */ @@ -70,7 +70,7 @@ make_mac( (AES_128_KEY_SIZE - key->len)); keyptr = keybuf; } - + if (NULL == (ctx = CMAC_CTX_new())) { msyslog(LOG_ERR, "MAC encrypt: CMAC %s CTX new failed.", CMAC); goto cmac_fail; @@ -100,13 +100,13 @@ make_mac( { /* generic MAC handling */ EVP_MD_CTX * ctx = EVP_MD_CTX_new(); u_int uilen = 0; - + if ( ! ctx) { msyslog(LOG_ERR, "MAC encrypt: MAC %s Digest CTX new failed.", OBJ_nid2sn(ktype)); goto mac_fail; } - + #ifdef EVP_MD_CTX_FLAG_NON_FIPS_ALLOW /* make sure MD5 is allowd */ EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); @@ -140,13 +140,13 @@ make_mac( } mac_fail: retlen = (size_t)uilen; - + if (ctx) EVP_MD_CTX_free(ctx); } #else /* !OPENSSL follows */ - + if (ktype == NID_md5) { EVP_MD_CTX * ctx = EVP_MD_CTX_new(); @@ -158,8 +158,10 @@ make_mac( else if ( ! ctx) { msyslog(LOG_ERR, "%s", "MAC encrypt: MAC md5 Digest CTX new failed."); } + else if (!EVP_DigestInit(ctx, EVP_get_digestbynid(ktype))) { + msyslog(LOG_ERR, "%s", "MAC encrypt: MAC md5 Digest INIT failed."); + } else { - EVP_DigestInit(ctx, EVP_get_digestbynid(ktype)); EVP_DigestUpdate(ctx, key->buf, key->len); EVP_DigestUpdate(ctx, msg->buf, msg->len); EVP_DigestFinal(ctx, digest->buf, &uilen); @@ -172,7 +174,7 @@ make_mac( { msyslog(LOG_ERR, "MAC encrypt: invalid key type %d" , ktype); } - + #endif /* !OPENSSL */ return retlen; @@ -196,7 +198,7 @@ MD5authencrypt( u_char digest[EVP_MAX_MD_SIZE]; rwbuffT digb = { digest, sizeof(digest) }; robuffT keyb = { key, klen }; - robuffT msgb = { pkt, length }; + robuffT msgb = { pkt, length }; size_t dlen = 0; dlen = make_mac(&digb, type, &keyb, &msgb); @@ -220,23 +222,25 @@ MD5authdecrypt( size_t klen, /* key length */ u_int32 * pkt, /* packet pointer */ size_t length, /* packet length */ - size_t size /* MAC size */ + size_t size, /* MAC size */ + keyid_t keyno /* key id (for err log) */ ) { u_char digest[EVP_MAX_MD_SIZE]; rwbuffT digb = { digest, sizeof(digest) }; robuffT keyb = { key, klen }; - robuffT msgb = { pkt, length }; + robuffT msgb = { pkt, length }; size_t dlen = 0; dlen = make_mac(&digb, type, &keyb, &msgb); - + /* If the MAC is longer than the MAX then truncate it. */ if (dlen > MAX_MDG_LEN) dlen = MAX_MDG_LEN; if (size != (size_t)dlen + KEY_MAC_LEN) { msyslog(LOG_ERR, - "MAC decrypt: MAC length error"); + "MAC decrypt: MAC length error: len=%zu key=%d", + size, keyno); return (0); } return !isc_tsmemcmp(digest, diff --git a/libntp/authkeys.c b/libntp/authkeys.c index 7c1cbb0655ae..4448dadd2b6a 100644 --- a/libntp/authkeys.c +++ b/libntp/authkeys.c @@ -119,7 +119,7 @@ keyacc_new_push( ) { KeyAccT * node = emalloc(sizeof(KeyAccT)); - + memcpy(&node->addr, addr, sizeof(sockaddr_u)); node->subnetbits = subnetbits; node->next = head; @@ -219,7 +219,7 @@ keyacc_amatch( * other checks if we find object identity. But that use case is * too rare to care for it. */ - + /* 2nd check: Address families must be the same. */ if (AF(a1) != AF(a2)) return FALSE; @@ -317,7 +317,7 @@ free_auth_mem(void) cache_keyacclist = NULL; for (alloc = authallocs; alloc != NULL; alloc = next_alloc) { next_alloc = alloc->link; - free(alloc->mem); + free(alloc->mem); } authfreekeys = NULL; authnumfreekeys = 0; @@ -525,7 +525,7 @@ freesymkey( authcache_flush_id(sk->keyid); keyacc_all_free(sk->keyacclist); - + bucket = &key_hash[KEYHASH(sk->keyid)]; if (sk->secret != NULL) { memset(sk->secret, '\0', sk->secretsize); @@ -649,7 +649,7 @@ authtrust( * There are two conditions remaining. Either it does not * exist and is to be trusted or it does exist and is or is * not to be trusted. - */ + */ if (sk != NULL) { /* * Key exists. If it is to be trusted, say so and update @@ -727,9 +727,9 @@ authistrusted( return (KEY_TRUSTED & sk->flags) && keyacc_contains(sk->keyacclist, sau, TRUE); } - + authkeynotfound++; - return FALSE; + return FALSE; } /* Note: There are two locations below where 'strncpy()' is used. While @@ -754,7 +754,7 @@ MD5auth_setkey( { symkey * sk; u_char * secret; - + DEBUG_ENSURE(keytype <= USHRT_MAX); DEBUG_ENSURE(secretsize < 4 * 1024); /* @@ -809,7 +809,7 @@ MD5auth_setkey( printf("%02x", secret[j]); } printf("\n"); - } + } #endif } @@ -925,5 +925,97 @@ authdecrypt( return MD5authdecrypt(cache_type, cache_secret, cache_secretsize, - pkt, length, size); + pkt, length, size, keyno); +} + +/* password decoding helpers */ +static size_t +pwdecode_plain( + u_char * dst, + size_t dstlen, + const char * src + ) +{ + size_t srclen = strlen(src); + if (srclen > dstlen) { + errno = ENOMEM; + return (size_t)-1; + } + memcpy(dst, src, srclen); + return srclen; +} + +static size_t +pwdecode_hex( + u_char * dst, + size_t dstlen, + const char * src + ) +{ + static const char hex[] = "00112233445566778899AaBbCcDdEeFf"; + + size_t srclen = strlen(src); + size_t reslen = (srclen >> 1) + (srclen & 1); + u_char tmp; + char *ptr; + size_t j; + + if (reslen > dstlen) { + errno = ENOMEM; + reslen = (size_t)-1; + } else { + for (j = 0; j < srclen; ++j) { + tmp = *(const unsigned char*)(src + j); + ptr = strchr(hex, tmp); + if (ptr == NULL) { + errno = EINVAL; + reslen = (size_t)-1; + break; + } + tmp = (u_char)((ptr - hex) > 1); + if (j & 1) + dst[j >> 1] |= tmp; + else + dst[j >> 1] = tmp << 4; + } + } + return reslen; +} +/* + * authdecodepw - decode plaintext or hex-encoded password to binary + * secret. Returns size of secret in bytes or -1 on error. + */ +size_t +authdecodepw( + u_char * dst, + size_t dstlen, + const char * src, + enum AuthPwdEnc enc + ) +{ + size_t reslen; + + if ( !(dst && dstlen && src)) { + errno = EINVAL; + reslen = (size_t)-1; + } else { + switch (enc) { + case AUTHPWD_UNSPEC: + if (strlen(src) <= 20) + reslen = pwdecode_plain(dst, dstlen, src); + else + reslen = pwdecode_hex(dst, dstlen, src); + break; + case AUTHPWD_PLAIN: + reslen = pwdecode_plain(dst, dstlen, src); + break; + case AUTHPWD_HEX: + reslen = pwdecode_hex(dst, dstlen, src); + break; + default: + errno = EINVAL; + reslen = (size_t)-1; + } + } + return reslen; } diff --git a/libntp/authreadkeys.c b/libntp/authreadkeys.c index 48c5c4d5ec6e..da91bd0d3443 100644 --- a/libntp/authreadkeys.c +++ b/libntp/authreadkeys.c @@ -38,7 +38,7 @@ nexttok( */ while (*cp == ' ' || *cp == '\t') cp++; - + /* * Save this and space to end of token */ @@ -46,19 +46,19 @@ nexttok( while (*cp != '\0' && *cp != '\n' && *cp != ' ' && *cp != '\t' && *cp != '#') cp++; - + /* * If token length is zero return an error, else set end of * token to zero and return start. */ if (starttok == cp) return NULL; - + if (*cp == ' ' || *cp == '\t') *cp++ = '\0'; else *cp = '\0'; - + *str = cp; return starttok; } @@ -114,7 +114,7 @@ free_keydata( ) { KeyAccT *kap; - + if (node) { while (node->keyacclist) { kap = node->keyacclist; @@ -142,9 +142,8 @@ authreadkeys( keyid_t keyno; int keytype; char buf[512]; /* lots of room for line */ - u_char keystr[32]; /* Bug 2537 */ + u_char keystr[AUTHPWD_MAXSECLEN]; size_t len; - size_t j; u_int nerr; KeyDataT *list = NULL; KeyDataT *next = NULL; @@ -172,7 +171,7 @@ authreadkeys( token = nexttok(&line); if (token == NULL) continue; - + /* * First is key number. See if it is okay. */ @@ -208,10 +207,10 @@ authreadkeys( * have to process the line completely and have to * finally throw away the result... This is a bit more * work, but it also results in better error detection. - */ + */ #ifdef OPENSSL /* - * The key type is the NID used by the message digest + * The key type is the NID used by the message digest * algorithm. There are a number of inconsistencies in * the OpenSSL database. We attempt to discover them * here and prevent use of inconsistent data later. @@ -258,45 +257,33 @@ authreadkeys( continue; } next = NULL; - len = strlen(token); - if (len <= 20) { /* Bug 2537 */ - next = emalloc(sizeof(KeyDataT) + len); - next->keyacclist = NULL; - next->keyid = keyno; - next->keytype = keytype; - next->seclen = len; - memcpy(next->secbuf, token, len); - } else { - static const char hex[] = "0123456789abcdef"; - u_char temp; - char *ptr; - size_t jlim; - - jlim = min(len, 2 * sizeof(keystr)); - for (j = 0; j < jlim; j++) { - ptr = strchr(hex, tolower((unsigned char)token[j])); - if (ptr == NULL) - break; /* abort decoding */ - temp = (u_char)(ptr - hex); - if (j & 1) - keystr[j / 2] |= temp; - else - keystr[j / 2] = temp << 4; - } - if (j < jlim) { + len = authdecodepw(keystr, sizeof(keystr), token, AUTHPWD_UNSPEC); + if (len > sizeof(keystr)) { + switch (errno) { + case ENOMEM: log_maybe(&nerr, - "authreadkeys: invalid hex digit for key %d", + "authreadkeys: passwd too long for key %d", keyno); - continue; + break; + case EINVAL: + log_maybe(&nerr, + "authreadkeys: passwd has bad char for key %d", + keyno); + break; + default: + log_maybe(&nerr, + "authreadkeys: unknown errno %d for key %d", + errno, keyno); + break; } - len = jlim/2; /* hmmmm.... what about odd length?!? */ - next = emalloc(sizeof(KeyDataT) + len); - next->keyacclist = NULL; - next->keyid = keyno; - next->keytype = keytype; - next->seclen = len; - memcpy(next->secbuf, keystr, len); + continue; } + next = emalloc(sizeof(KeyDataT) + len); + next->keyacclist = NULL; + next->keyid = keyno; + next->keytype = keytype; + next->seclen = len; + memcpy(next->secbuf, keystr, len); token = nexttok(&line); if (token != NULL) { /* A comma-separated IP access list */ @@ -369,7 +356,7 @@ authreadkeys( next = NULL; continue; } - + INSIST(NULL != next); next->next = list; list = next; diff --git a/libntp/authusekey.c b/libntp/authusekey.c index ff449d3df6fc..3c8da1d3c7c7 100644 --- a/libntp/authusekey.c +++ b/libntp/authusekey.c @@ -10,11 +10,8 @@ #include "ntp_stdlib.h" /* - * Types of ascii representations for keys. "Standard" means a 64 bit - * hex number in NBS format, i.e. with the low order bit of each byte - * a parity bit. "NTP" means a 64 bit key in NTP format, with the - * high order bit of each byte a parity bit. "Ascii" means a 1-to-8 - * character string whose ascii representation is used as the key. + * Only used by ntp{q,dc} to set the key/algo/secret triple to use. + * Uses the same decoding scheme ntpd uses for keys in the key file. */ int authusekey( @@ -24,11 +21,14 @@ authusekey( ) { size_t len; + u_char buf[AUTHPWD_MAXSECLEN]; - len = strlen((const char *)str); - if (0 == len) + len = authdecodepw(buf, sizeof(buf), (const char*)str, + AUTHPWD_UNSPEC); + if (len < 1 || len > sizeof(buf)) return 0; - MD5auth_setkey(keyno, keytype, str, len, NULL); + MD5auth_setkey(keyno, keytype, buf, len, NULL); + memset(buf, 0, sizeof(buf)); return 1; } diff --git a/libntp/caltontp.c b/libntp/caltontp.c index 808c94c64afd..b0de04b180f4 100644 --- a/libntp/caltontp.c +++ b/libntp/caltontp.c @@ -12,18 +12,18 @@ /* * Juergen Perlinger, 2008-11-12 - * Add support for full calendar calculatios. If the day-of-year is provided + * Add support for full calendar calculations. If the day-of-year is provided * (that is, not zero) it will be used instead of month and day-of-month; * otherwise a full turn through the calendar calculations will be taken. * * I know that Harlan Stenn likes to see assertions in production code, and I - * agree there, but it would be a tricky thing here. The algorithm is quite - * capable of producing sensible answers even to seemingly weird inputs: the - * date -03-00, the 0.th March of the year, will be automtically - * treated as the last day of February, no matter whether the year is a leap - * year or not. So adding constraints is merely for the benefit of the callers, - * because the only thing we can check for consistency is our input, produced - * by somebody else. + * agree in general. But here we set 'errno' and try to do our best instead. + * Also note that the bounds check is a bit sloppy: It permits off-by-one + * on the input quantities. That permits some simple/naive adjustments to + * be made before calling this function. + * + * Apart from that the calendar is perfectly capable of dealing with + * off-scale input values! * * BTW: A total roundtrip using 'caljulian' would be a quite shaky thing: * Because of the truncation of the NTP time stamp to 32 bits and the epoch @@ -40,14 +40,18 @@ caltontp( int32_t eraday; /* CE Rata Die number */ vint64 ntptime;/* resulting NTP time */ - REQUIRE(jt != NULL); + if (NULL == jt) { + errno = EINVAL; + return 0; + } - REQUIRE(jt->month <= 13); /* permit month 0..13! */ - REQUIRE(jt->monthday <= 32); - REQUIRE(jt->yearday <= 366); - REQUIRE(jt->hour <= 24); - REQUIRE(jt->minute <= MINSPERHR); - REQUIRE(jt->second <= SECSPERMIN); + if ( (jt->month > 13) /* permit month 0..13! */ + || (jt->monthday > 32) + || (jt->yearday > 366) + || (jt->hour > 24) + || (jt->minute > MINSPERHR) + || (jt->second > SECSPERMIN)) + errno = ERANGE; /* * First convert the date to he corresponding RataDie diff --git a/lib/isc/assertions.c b/libntp/lib/isc/assertions.c similarity index 100% rename from lib/isc/assertions.c rename to libntp/lib/isc/assertions.c diff --git a/lib/isc/backtrace-emptytbl.c b/libntp/lib/isc/backtrace-emptytbl.c similarity index 100% rename from lib/isc/backtrace-emptytbl.c rename to libntp/lib/isc/backtrace-emptytbl.c diff --git a/lib/isc/backtrace.c b/libntp/lib/isc/backtrace.c similarity index 100% rename from lib/isc/backtrace.c rename to libntp/lib/isc/backtrace.c diff --git a/lib/isc/buffer.c b/libntp/lib/isc/buffer.c similarity index 100% rename from lib/isc/buffer.c rename to libntp/lib/isc/buffer.c diff --git a/lib/isc/error.c b/libntp/lib/isc/error.c similarity index 100% rename from lib/isc/error.c rename to libntp/lib/isc/error.c diff --git a/lib/isc/event.c b/libntp/lib/isc/event.c similarity index 100% rename from lib/isc/event.c rename to libntp/lib/isc/event.c diff --git a/lib/isc/include/isc/app.h b/libntp/lib/isc/include/isc/app.h similarity index 100% rename from lib/isc/include/isc/app.h rename to libntp/lib/isc/include/isc/app.h diff --git a/lib/isc/include/isc/assertions.h b/libntp/lib/isc/include/isc/assertions.h similarity index 100% rename from lib/isc/include/isc/assertions.h rename to libntp/lib/isc/include/isc/assertions.h diff --git a/lib/isc/include/isc/backtrace.h b/libntp/lib/isc/include/isc/backtrace.h similarity index 100% rename from lib/isc/include/isc/backtrace.h rename to libntp/lib/isc/include/isc/backtrace.h diff --git a/lib/isc/include/isc/bind9.h b/libntp/lib/isc/include/isc/bind9.h similarity index 100% rename from lib/isc/include/isc/bind9.h rename to libntp/lib/isc/include/isc/bind9.h diff --git a/lib/isc/include/isc/boolean.h b/libntp/lib/isc/include/isc/boolean.h similarity index 100% rename from lib/isc/include/isc/boolean.h rename to libntp/lib/isc/include/isc/boolean.h diff --git a/lib/isc/include/isc/buffer.h b/libntp/lib/isc/include/isc/buffer.h similarity index 100% rename from lib/isc/include/isc/buffer.h rename to libntp/lib/isc/include/isc/buffer.h diff --git a/lib/isc/include/isc/error.h b/libntp/lib/isc/include/isc/error.h similarity index 100% rename from lib/isc/include/isc/error.h rename to libntp/lib/isc/include/isc/error.h diff --git a/lib/isc/include/isc/event.h b/libntp/lib/isc/include/isc/event.h similarity index 100% rename from lib/isc/include/isc/event.h rename to libntp/lib/isc/include/isc/event.h diff --git a/lib/isc/include/isc/eventclass.h b/libntp/lib/isc/include/isc/eventclass.h similarity index 100% rename from lib/isc/include/isc/eventclass.h rename to libntp/lib/isc/include/isc/eventclass.h diff --git a/lib/isc/include/isc/file.h b/libntp/lib/isc/include/isc/file.h similarity index 100% rename from lib/isc/include/isc/file.h rename to libntp/lib/isc/include/isc/file.h diff --git a/lib/isc/include/isc/formatcheck.h b/libntp/lib/isc/include/isc/formatcheck.h similarity index 100% rename from lib/isc/include/isc/formatcheck.h rename to libntp/lib/isc/include/isc/formatcheck.h diff --git a/lib/isc/include/isc/hash.h b/libntp/lib/isc/include/isc/hash.h similarity index 100% rename from lib/isc/include/isc/hash.h rename to libntp/lib/isc/include/isc/hash.h diff --git a/lib/isc/include/isc/interfaceiter.h b/libntp/lib/isc/include/isc/interfaceiter.h similarity index 100% rename from lib/isc/include/isc/interfaceiter.h rename to libntp/lib/isc/include/isc/interfaceiter.h diff --git a/lib/isc/include/isc/lang.h b/libntp/lib/isc/include/isc/lang.h similarity index 100% rename from lib/isc/include/isc/lang.h rename to libntp/lib/isc/include/isc/lang.h diff --git a/lib/isc/include/isc/lib.h b/libntp/lib/isc/include/isc/lib.h similarity index 100% rename from lib/isc/include/isc/lib.h rename to libntp/lib/isc/include/isc/lib.h diff --git a/lib/isc/include/isc/list.h b/libntp/lib/isc/include/isc/list.h similarity index 100% rename from lib/isc/include/isc/list.h rename to libntp/lib/isc/include/isc/list.h diff --git a/lib/isc/include/isc/log.h b/libntp/lib/isc/include/isc/log.h similarity index 100% rename from lib/isc/include/isc/log.h rename to libntp/lib/isc/include/isc/log.h diff --git a/lib/isc/include/isc/magic.h b/libntp/lib/isc/include/isc/magic.h similarity index 100% rename from lib/isc/include/isc/magic.h rename to libntp/lib/isc/include/isc/magic.h diff --git a/lib/isc/include/isc/md5.h b/libntp/lib/isc/include/isc/md5.h similarity index 100% rename from lib/isc/include/isc/md5.h rename to libntp/lib/isc/include/isc/md5.h diff --git a/lib/isc/include/isc/msgcat.h b/libntp/lib/isc/include/isc/msgcat.h similarity index 100% rename from lib/isc/include/isc/msgcat.h rename to libntp/lib/isc/include/isc/msgcat.h diff --git a/lib/isc/include/isc/msgs.h b/libntp/lib/isc/include/isc/msgs.h similarity index 100% rename from lib/isc/include/isc/msgs.h rename to libntp/lib/isc/include/isc/msgs.h diff --git a/lib/isc/include/isc/namespace.h b/libntp/lib/isc/include/isc/namespace.h similarity index 100% rename from lib/isc/include/isc/namespace.h rename to libntp/lib/isc/include/isc/namespace.h diff --git a/lib/isc/include/isc/netaddr.h b/libntp/lib/isc/include/isc/netaddr.h similarity index 100% rename from lib/isc/include/isc/netaddr.h rename to libntp/lib/isc/include/isc/netaddr.h diff --git a/lib/isc/include/isc/netscope.h b/libntp/lib/isc/include/isc/netscope.h similarity index 100% rename from lib/isc/include/isc/netscope.h rename to libntp/lib/isc/include/isc/netscope.h diff --git a/lib/isc/include/isc/ondestroy.h b/libntp/lib/isc/include/isc/ondestroy.h similarity index 100% rename from lib/isc/include/isc/ondestroy.h rename to libntp/lib/isc/include/isc/ondestroy.h diff --git a/lib/isc/include/isc/platform.h b/libntp/lib/isc/include/isc/platform.h similarity index 100% rename from lib/isc/include/isc/platform.h rename to libntp/lib/isc/include/isc/platform.h diff --git a/lib/isc/include/isc/print.h b/libntp/lib/isc/include/isc/print.h similarity index 100% rename from lib/isc/include/isc/print.h rename to libntp/lib/isc/include/isc/print.h diff --git a/lib/isc/include/isc/random.h b/libntp/lib/isc/include/isc/random.h similarity index 100% rename from lib/isc/include/isc/random.h rename to libntp/lib/isc/include/isc/random.h diff --git a/lib/isc/include/isc/region.h b/libntp/lib/isc/include/isc/region.h similarity index 100% rename from lib/isc/include/isc/region.h rename to libntp/lib/isc/include/isc/region.h diff --git a/lib/isc/include/isc/result.h b/libntp/lib/isc/include/isc/result.h similarity index 100% rename from lib/isc/include/isc/result.h rename to libntp/lib/isc/include/isc/result.h diff --git a/lib/isc/include/isc/resultclass.h b/libntp/lib/isc/include/isc/resultclass.h similarity index 100% rename from lib/isc/include/isc/resultclass.h rename to libntp/lib/isc/include/isc/resultclass.h diff --git a/lib/isc/include/isc/sha1.h b/libntp/lib/isc/include/isc/sha1.h similarity index 100% rename from lib/isc/include/isc/sha1.h rename to libntp/lib/isc/include/isc/sha1.h diff --git a/lib/isc/include/isc/sockaddr.h b/libntp/lib/isc/include/isc/sockaddr.h similarity index 100% rename from lib/isc/include/isc/sockaddr.h rename to libntp/lib/isc/include/isc/sockaddr.h diff --git a/lib/isc/include/isc/socket.h b/libntp/lib/isc/include/isc/socket.h similarity index 100% rename from lib/isc/include/isc/socket.h rename to libntp/lib/isc/include/isc/socket.h diff --git a/lib/isc/include/isc/stdio.h b/libntp/lib/isc/include/isc/stdio.h similarity index 100% rename from lib/isc/include/isc/stdio.h rename to libntp/lib/isc/include/isc/stdio.h diff --git a/lib/isc/include/isc/string.h b/libntp/lib/isc/include/isc/string.h similarity index 100% rename from lib/isc/include/isc/string.h rename to libntp/lib/isc/include/isc/string.h diff --git a/lib/isc/include/isc/task.h b/libntp/lib/isc/include/isc/task.h similarity index 100% rename from lib/isc/include/isc/task.h rename to libntp/lib/isc/include/isc/task.h diff --git a/lib/isc/include/isc/timer.h b/libntp/lib/isc/include/isc/timer.h similarity index 100% rename from lib/isc/include/isc/timer.h rename to libntp/lib/isc/include/isc/timer.h diff --git a/lib/isc/include/isc/types.h b/libntp/lib/isc/include/isc/types.h similarity index 100% rename from lib/isc/include/isc/types.h rename to libntp/lib/isc/include/isc/types.h diff --git a/lib/isc/include/isc/util.h b/libntp/lib/isc/include/isc/util.h similarity index 100% rename from lib/isc/include/isc/util.h rename to libntp/lib/isc/include/isc/util.h diff --git a/lib/isc/include/isc/xml.h b/libntp/lib/isc/include/isc/xml.h similarity index 100% rename from lib/isc/include/isc/xml.h rename to libntp/lib/isc/include/isc/xml.h diff --git a/lib/isc/inet_ntop.c b/libntp/lib/isc/inet_ntop.c similarity index 100% rename from lib/isc/inet_ntop.c rename to libntp/lib/isc/inet_ntop.c diff --git a/lib/isc/inet_pton.c b/libntp/lib/isc/inet_pton.c similarity index 100% rename from lib/isc/inet_pton.c rename to libntp/lib/isc/inet_pton.c diff --git a/lib/isc/lib.c b/libntp/lib/isc/lib.c similarity index 100% rename from lib/isc/lib.c rename to libntp/lib/isc/lib.c diff --git a/lib/isc/log.c b/libntp/lib/isc/log.c similarity index 100% rename from lib/isc/log.c rename to libntp/lib/isc/log.c diff --git a/lib/isc/md5.c b/libntp/lib/isc/md5.c similarity index 100% rename from lib/isc/md5.c rename to libntp/lib/isc/md5.c diff --git a/lib/isc/netaddr.c b/libntp/lib/isc/netaddr.c similarity index 100% rename from lib/isc/netaddr.c rename to libntp/lib/isc/netaddr.c diff --git a/lib/isc/netscope.c b/libntp/lib/isc/netscope.c similarity index 100% rename from lib/isc/netscope.c rename to libntp/lib/isc/netscope.c diff --git a/lib/isc/nls/msgcat.c b/libntp/lib/isc/nls/msgcat.c similarity index 100% rename from lib/isc/nls/msgcat.c rename to libntp/lib/isc/nls/msgcat.c diff --git a/lib/isc/nothreads/condition.c b/libntp/lib/isc/nothreads/condition.c similarity index 100% rename from lib/isc/nothreads/condition.c rename to libntp/lib/isc/nothreads/condition.c diff --git a/lib/isc/nothreads/include/isc/condition.h b/libntp/lib/isc/nothreads/include/isc/condition.h similarity index 100% rename from lib/isc/nothreads/include/isc/condition.h rename to libntp/lib/isc/nothreads/include/isc/condition.h diff --git a/lib/isc/nothreads/include/isc/mutex.h b/libntp/lib/isc/nothreads/include/isc/mutex.h similarity index 100% rename from lib/isc/nothreads/include/isc/mutex.h rename to libntp/lib/isc/nothreads/include/isc/mutex.h diff --git a/lib/isc/nothreads/include/isc/once.h b/libntp/lib/isc/nothreads/include/isc/once.h similarity index 100% rename from lib/isc/nothreads/include/isc/once.h rename to libntp/lib/isc/nothreads/include/isc/once.h diff --git a/lib/isc/nothreads/include/isc/thread.h b/libntp/lib/isc/nothreads/include/isc/thread.h similarity index 100% rename from lib/isc/nothreads/include/isc/thread.h rename to libntp/lib/isc/nothreads/include/isc/thread.h diff --git a/lib/isc/nothreads/thread.c b/libntp/lib/isc/nothreads/thread.c similarity index 100% rename from lib/isc/nothreads/thread.c rename to libntp/lib/isc/nothreads/thread.c diff --git a/lib/isc/ondestroy.c b/libntp/lib/isc/ondestroy.c similarity index 100% rename from lib/isc/ondestroy.c rename to libntp/lib/isc/ondestroy.c diff --git a/lib/isc/pthreads/condition.c b/libntp/lib/isc/pthreads/condition.c similarity index 100% rename from lib/isc/pthreads/condition.c rename to libntp/lib/isc/pthreads/condition.c diff --git a/lib/isc/pthreads/include/isc/condition.h b/libntp/lib/isc/pthreads/include/isc/condition.h similarity index 100% rename from lib/isc/pthreads/include/isc/condition.h rename to libntp/lib/isc/pthreads/include/isc/condition.h diff --git a/lib/isc/pthreads/include/isc/mutex.h b/libntp/lib/isc/pthreads/include/isc/mutex.h similarity index 100% rename from lib/isc/pthreads/include/isc/mutex.h rename to libntp/lib/isc/pthreads/include/isc/mutex.h diff --git a/lib/isc/pthreads/include/isc/once.h b/libntp/lib/isc/pthreads/include/isc/once.h similarity index 100% rename from lib/isc/pthreads/include/isc/once.h rename to libntp/lib/isc/pthreads/include/isc/once.h diff --git a/lib/isc/pthreads/include/isc/thread.h b/libntp/lib/isc/pthreads/include/isc/thread.h similarity index 100% rename from lib/isc/pthreads/include/isc/thread.h rename to libntp/lib/isc/pthreads/include/isc/thread.h diff --git a/lib/isc/pthreads/mutex.c b/libntp/lib/isc/pthreads/mutex.c similarity index 100% rename from lib/isc/pthreads/mutex.c rename to libntp/lib/isc/pthreads/mutex.c diff --git a/lib/isc/pthreads/thread.c b/libntp/lib/isc/pthreads/thread.c similarity index 100% rename from lib/isc/pthreads/thread.c rename to libntp/lib/isc/pthreads/thread.c diff --git a/lib/isc/random.c b/libntp/lib/isc/random.c similarity index 100% rename from lib/isc/random.c rename to libntp/lib/isc/random.c diff --git a/lib/isc/result.c b/libntp/lib/isc/result.c similarity index 100% rename from lib/isc/result.c rename to libntp/lib/isc/result.c diff --git a/lib/isc/sha1.c b/libntp/lib/isc/sha1.c similarity index 100% rename from lib/isc/sha1.c rename to libntp/lib/isc/sha1.c diff --git a/lib/isc/sockaddr.c b/libntp/lib/isc/sockaddr.c similarity index 100% rename from lib/isc/sockaddr.c rename to libntp/lib/isc/sockaddr.c diff --git a/lib/isc/task.c b/libntp/lib/isc/task.c similarity index 100% rename from lib/isc/task.c rename to libntp/lib/isc/task.c diff --git a/lib/isc/task_p.h b/libntp/lib/isc/task_p.h similarity index 100% rename from lib/isc/task_p.h rename to libntp/lib/isc/task_p.h diff --git a/lib/isc/tsmemcmp.c b/libntp/lib/isc/tsmemcmp.c similarity index 100% rename from lib/isc/tsmemcmp.c rename to libntp/lib/isc/tsmemcmp.c diff --git a/lib/isc/unix/dir.c b/libntp/lib/isc/unix/dir.c similarity index 100% rename from lib/isc/unix/dir.c rename to libntp/lib/isc/unix/dir.c diff --git a/lib/isc/unix/errno2result.c b/libntp/lib/isc/unix/errno2result.c similarity index 100% rename from lib/isc/unix/errno2result.c rename to libntp/lib/isc/unix/errno2result.c diff --git a/lib/isc/unix/errno2result.h b/libntp/lib/isc/unix/errno2result.h similarity index 100% rename from lib/isc/unix/errno2result.h rename to libntp/lib/isc/unix/errno2result.h diff --git a/lib/isc/unix/file.c b/libntp/lib/isc/unix/file.c similarity index 100% rename from lib/isc/unix/file.c rename to libntp/lib/isc/unix/file.c diff --git a/lib/isc/unix/ifiter_getifaddrs.c b/libntp/lib/isc/unix/ifiter_getifaddrs.c similarity index 100% rename from lib/isc/unix/ifiter_getifaddrs.c rename to libntp/lib/isc/unix/ifiter_getifaddrs.c diff --git a/lib/isc/unix/ifiter_ioctl.c b/libntp/lib/isc/unix/ifiter_ioctl.c similarity index 100% rename from lib/isc/unix/ifiter_ioctl.c rename to libntp/lib/isc/unix/ifiter_ioctl.c diff --git a/lib/isc/unix/ifiter_sysctl.c b/libntp/lib/isc/unix/ifiter_sysctl.c similarity index 100% rename from lib/isc/unix/ifiter_sysctl.c rename to libntp/lib/isc/unix/ifiter_sysctl.c diff --git a/lib/isc/unix/include/isc/dir.h b/libntp/lib/isc/unix/include/isc/dir.h similarity index 100% rename from lib/isc/unix/include/isc/dir.h rename to libntp/lib/isc/unix/include/isc/dir.h diff --git a/lib/isc/unix/include/isc/int.h b/libntp/lib/isc/unix/include/isc/int.h similarity index 100% rename from lib/isc/unix/include/isc/int.h rename to libntp/lib/isc/unix/include/isc/int.h diff --git a/lib/isc/unix/include/isc/net.h b/libntp/lib/isc/unix/include/isc/net.h similarity index 100% rename from lib/isc/unix/include/isc/net.h rename to libntp/lib/isc/unix/include/isc/net.h diff --git a/lib/isc/unix/include/isc/offset.h b/libntp/lib/isc/unix/include/isc/offset.h similarity index 100% rename from lib/isc/unix/include/isc/offset.h rename to libntp/lib/isc/unix/include/isc/offset.h diff --git a/lib/isc/unix/include/isc/stat.h b/libntp/lib/isc/unix/include/isc/stat.h similarity index 100% rename from lib/isc/unix/include/isc/stat.h rename to libntp/lib/isc/unix/include/isc/stat.h diff --git a/lib/isc/unix/include/isc/stdtime.h b/libntp/lib/isc/unix/include/isc/stdtime.h similarity index 100% rename from lib/isc/unix/include/isc/stdtime.h rename to libntp/lib/isc/unix/include/isc/stdtime.h diff --git a/lib/isc/unix/include/isc/strerror.h b/libntp/lib/isc/unix/include/isc/strerror.h similarity index 100% rename from lib/isc/unix/include/isc/strerror.h rename to libntp/lib/isc/unix/include/isc/strerror.h diff --git a/lib/isc/unix/include/isc/time.h b/libntp/lib/isc/unix/include/isc/time.h similarity index 100% rename from lib/isc/unix/include/isc/time.h rename to libntp/lib/isc/unix/include/isc/time.h diff --git a/lib/isc/unix/interfaceiter.c b/libntp/lib/isc/unix/interfaceiter.c similarity index 100% rename from lib/isc/unix/interfaceiter.c rename to libntp/lib/isc/unix/interfaceiter.c diff --git a/lib/isc/unix/net.c b/libntp/lib/isc/unix/net.c similarity index 100% rename from lib/isc/unix/net.c rename to libntp/lib/isc/unix/net.c diff --git a/lib/isc/unix/stdio.c b/libntp/lib/isc/unix/stdio.c similarity index 100% rename from lib/isc/unix/stdio.c rename to libntp/lib/isc/unix/stdio.c diff --git a/lib/isc/unix/stdtime.c b/libntp/lib/isc/unix/stdtime.c similarity index 100% rename from lib/isc/unix/stdtime.c rename to libntp/lib/isc/unix/stdtime.c diff --git a/lib/isc/unix/strerror.c b/libntp/lib/isc/unix/strerror.c similarity index 100% rename from lib/isc/unix/strerror.c rename to libntp/lib/isc/unix/strerror.c diff --git a/lib/isc/unix/time.c b/libntp/lib/isc/unix/time.c similarity index 100% rename from lib/isc/unix/time.c rename to libntp/lib/isc/unix/time.c diff --git a/lib/isc/win32/condition.c b/libntp/lib/isc/win32/condition.c similarity index 100% rename from lib/isc/win32/condition.c rename to libntp/lib/isc/win32/condition.c diff --git a/lib/isc/win32/include/isc/condition.h b/libntp/lib/isc/win32/include/isc/condition.h similarity index 100% rename from lib/isc/win32/include/isc/condition.h rename to libntp/lib/isc/win32/include/isc/condition.h diff --git a/lib/isc/win32/include/isc/dir.h b/libntp/lib/isc/win32/include/isc/dir.h similarity index 100% rename from lib/isc/win32/include/isc/dir.h rename to libntp/lib/isc/win32/include/isc/dir.h diff --git a/lib/isc/win32/include/isc/int.h b/libntp/lib/isc/win32/include/isc/int.h similarity index 100% rename from lib/isc/win32/include/isc/int.h rename to libntp/lib/isc/win32/include/isc/int.h diff --git a/lib/isc/win32/include/isc/ipv6.h b/libntp/lib/isc/win32/include/isc/ipv6.h similarity index 100% rename from lib/isc/win32/include/isc/ipv6.h rename to libntp/lib/isc/win32/include/isc/ipv6.h diff --git a/lib/isc/win32/include/isc/mutex.h b/libntp/lib/isc/win32/include/isc/mutex.h similarity index 100% rename from lib/isc/win32/include/isc/mutex.h rename to libntp/lib/isc/win32/include/isc/mutex.h diff --git a/lib/isc/win32/include/isc/net.h b/libntp/lib/isc/win32/include/isc/net.h similarity index 100% rename from lib/isc/win32/include/isc/net.h rename to libntp/lib/isc/win32/include/isc/net.h diff --git a/lib/isc/win32/include/isc/offset.h b/libntp/lib/isc/win32/include/isc/offset.h similarity index 100% rename from lib/isc/win32/include/isc/offset.h rename to libntp/lib/isc/win32/include/isc/offset.h diff --git a/lib/isc/win32/include/isc/once.h b/libntp/lib/isc/win32/include/isc/once.h similarity index 100% rename from lib/isc/win32/include/isc/once.h rename to libntp/lib/isc/win32/include/isc/once.h diff --git a/lib/isc/win32/include/isc/platform.h b/libntp/lib/isc/win32/include/isc/platform.h similarity index 100% rename from lib/isc/win32/include/isc/platform.h rename to libntp/lib/isc/win32/include/isc/platform.h diff --git a/lib/isc/win32/include/isc/stat.h b/libntp/lib/isc/win32/include/isc/stat.h similarity index 100% rename from lib/isc/win32/include/isc/stat.h rename to libntp/lib/isc/win32/include/isc/stat.h diff --git a/lib/isc/win32/include/isc/stdtime.h b/libntp/lib/isc/win32/include/isc/stdtime.h similarity index 100% rename from lib/isc/win32/include/isc/stdtime.h rename to libntp/lib/isc/win32/include/isc/stdtime.h diff --git a/lib/isc/win32/include/isc/strerror.h b/libntp/lib/isc/win32/include/isc/strerror.h similarity index 100% rename from lib/isc/win32/include/isc/strerror.h rename to libntp/lib/isc/win32/include/isc/strerror.h diff --git a/lib/isc/win32/include/isc/thread.h b/libntp/lib/isc/win32/include/isc/thread.h similarity index 100% rename from lib/isc/win32/include/isc/thread.h rename to libntp/lib/isc/win32/include/isc/thread.h diff --git a/lib/isc/win32/include/isc/time.h b/libntp/lib/isc/win32/include/isc/time.h similarity index 100% rename from lib/isc/win32/include/isc/time.h rename to libntp/lib/isc/win32/include/isc/time.h diff --git a/lib/isc/win32/include/isc/win32os.h b/libntp/lib/isc/win32/include/isc/win32os.h similarity index 100% rename from lib/isc/win32/include/isc/win32os.h rename to libntp/lib/isc/win32/include/isc/win32os.h diff --git a/lib/isc/win32/interfaceiter.c b/libntp/lib/isc/win32/interfaceiter.c similarity index 100% rename from lib/isc/win32/interfaceiter.c rename to libntp/lib/isc/win32/interfaceiter.c diff --git a/lib/isc/win32/net.c b/libntp/lib/isc/win32/net.c similarity index 100% rename from lib/isc/win32/net.c rename to libntp/lib/isc/win32/net.c diff --git a/lib/isc/win32/once.c b/libntp/lib/isc/win32/once.c similarity index 100% rename from lib/isc/win32/once.c rename to libntp/lib/isc/win32/once.c diff --git a/lib/isc/win32/stdtime.c b/libntp/lib/isc/win32/stdtime.c similarity index 100% rename from lib/isc/win32/stdtime.c rename to libntp/lib/isc/win32/stdtime.c diff --git a/lib/isc/win32/strerror.c b/libntp/lib/isc/win32/strerror.c similarity index 99% rename from lib/isc/win32/strerror.c rename to libntp/lib/isc/win32/strerror.c index 41743328a430..40c5da002f8c 100644 --- a/lib/isc/win32/strerror.c +++ b/libntp/lib/isc/win32/strerror.c @@ -119,7 +119,7 @@ NTstrerror(int err, BOOL *bfreebuf) { *bfreebuf = FALSE; /* Get the Winsock2 error messages */ - if (errval >= WSABASEERR && errval <= (WSABASEERR + 1015)) { + if (errval >= WSABASEERR && errval <= (WSABASEERR + 1999)) { retmsg = GetWSAErrorMessage(errval); if (retmsg != NULL) return (retmsg); diff --git a/lib/isc/win32/thread.c b/libntp/lib/isc/win32/thread.c similarity index 100% rename from lib/isc/win32/thread.c rename to libntp/lib/isc/win32/thread.c diff --git a/lib/isc/win32/time.c b/libntp/lib/isc/win32/time.c similarity index 100% rename from lib/isc/win32/time.c rename to libntp/lib/isc/win32/time.c diff --git a/lib/isc/win32/win32os.c b/libntp/lib/isc/win32/win32os.c similarity index 100% rename from lib/isc/win32/win32os.c rename to libntp/lib/isc/win32/win32os.c diff --git a/libntp/mktime.c b/libntp/mktime.c index 50d2a0810408..74ae85431d2f 100644 --- a/libntp/mktime.c +++ b/libntp/mktime.c @@ -60,7 +60,7 @@ */ #include -#include "ntp_machine.h" +#include "ntp_types.h" #if !defined(HAVE_MKTIME) || ( !defined(HAVE_TIMEGM) && defined(WANT_TIMEGM) ) @@ -259,7 +259,7 @@ time2( return t; } #else -int mktime_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* !HAVE_MKTIME || !HAVE_TIMEGM */ #ifndef HAVE_MKTIME diff --git a/libntp/mstolfp.c b/libntp/mstolfp.c index 3dfc4efd42e8..428f71bdbae9 100644 --- a/libntp/mstolfp.c +++ b/libntp/mstolfp.c @@ -14,86 +14,58 @@ mstolfp( l_fp *lfp ) { - register const char *cp; - register char *bp; - register const char *cpdec; - char buf[100]; + int ch, neg = 0; + u_int32 q, r; /* * We understand numbers of the form: * * [spaces][-|+][digits][.][digits][spaces|\n|\0] * - * This is one enormous hack. Since I didn't feel like - * rewriting the decoding routine for milliseconds, what - * is essentially done here is to make a copy of the string - * with the decimal moved over three places so the seconds - * decoding routine can be used. + * This is kinda hack. We use 'atolfp' to do the basic parsing + * (after some initial checks) and then divide the result by + * 1000. The original implementation avoided that by + * hacking up the input string to move the decimal point, but + * that needed string manipulations prone to buffer overruns. + * To avoid that trouble we do the conversion first and adjust + * the result. */ - bp = buf; - cp = str; - while (isspace((unsigned char)*cp)) - cp++; - if (*cp == '-' || *cp == '+') { - *bp++ = *cp++; - } - - if (*cp != '.' && !isdigit((unsigned char)*cp)) - return 0; - - - /* - * Search forward for the decimal point or the end of the string. - */ - cpdec = cp; - while (isdigit((unsigned char)*cpdec)) - cpdec++; - - /* - * Found something. If we have more than three digits copy the - * excess over, else insert a leading 0. - */ - if ((cpdec - cp) > 3) { - do { - *bp++ = (char)*cp++; - } while ((cpdec - cp) > 3); - } else { - *bp++ = '0'; - } - - /* - * Stick the decimal in. If we've got less than three digits in - * front of the millisecond decimal we insert the appropriate number - * of zeros. - */ - *bp++ = '.'; - if ((cpdec - cp) < 3) { - size_t i = 3 - (cpdec - cp); - do { - *bp++ = '0'; - } while (--i > 0); - } - - /* - * Copy the remainder up to the millisecond decimal. If cpdec - * is pointing at a decimal point, copy in the trailing number too. - */ - while (cp < cpdec) - *bp++ = (char)*cp++; + while (isspace(ch = *(const unsigned char*)str)) + ++str; - if (*cp == '.') { - cp++; - while (isdigit((unsigned char)*cp)) - *bp++ = (char)*cp++; + switch (ch) { + case '-': neg = TRUE; + case '+': ++str; + default : break; } - *bp = '\0'; + + if (!isdigit(ch = *(const unsigned char*)str) && (ch != '.')) + return 0; + if (!atolfp(str, lfp)) + return 0; - /* - * Check to make sure the string is properly terminated. If - * so, give the buffer to the decoding routine. + /* now do a chained/overlapping division by 1000 to get from + * seconds to msec. 1000 is small enough to go with temporary + * 32bit accus for Q and R. */ - if (*cp != '\0' && !isspace((unsigned char)*cp)) - return 0; - return atolfp(buf, lfp); + q = lfp->l_ui / 1000u; + r = lfp->l_ui - (q * 1000u); + lfp->l_ui = q; + + r = (r << 16) | (lfp->l_uf >> 16); + q = r / 1000u; + r = ((r - q * 1000) << 16) | (lfp->l_uf & 0x0FFFFu); + lfp->l_uf = q << 16; + q = r / 1000; + lfp->l_uf |= q; + r -= q * 1000u; + + /* fix sign */ + if (neg) + L_NEG(lfp); + /* round */ + if (r >= 500) + L_ADDF(lfp, (neg ? -1 : 1)); + return 1; } diff --git a/libntp/msyslog.c b/libntp/msyslog.c index 9a18c4d0d7b0..ae950171f468 100644 --- a/libntp/msyslog.c +++ b/libntp/msyslog.c @@ -92,7 +92,7 @@ format_errmsg( * errno_to_str() - a thread-safe strerror() replacement. * Hides the varied signatures of strerror_r(). * For Windows, we have: - * #define errno_to_str isc_strerror + * #define errno_to_str isc__strerror */ #ifndef errno_to_str void diff --git a/libntp/ntp_crypto_rnd.c b/libntp/ntp_crypto_rnd.c index 2a4f91affad5..5fe7382efb79 100644 --- a/libntp/ntp_crypto_rnd.c +++ b/libntp/ntp_crypto_rnd.c @@ -14,7 +14,7 @@ #endif #include -#include +#include #include #include "safecast.h" @@ -23,65 +23,66 @@ #include int crypto_rand_init = 0; -#else - -# ifndef HAVE_ARC4RANDOM_BUF -static void -arc4random_buf(void *buf, size_t nbytes); - -void -evutil_secure_rng_get_bytes(void *buf, size_t nbytes); - -static void -arc4random_buf(void *buf, size_t nbytes) -{ - evutil_secure_rng_get_bytes(buf, nbytes); - return; -} -# endif +#elif !defined(HAVE_ARC4RANDOM_BUF) +#include #endif +int crypto_rand_ok = 0; + /* * As of late 2014, here's how we plan to provide cryptographic-quality * random numbers: - * + * * - If we are building with OpenSSL, use RAND_poll() and RAND_bytes(). * - Otherwise, use arc4random(). - * - * Use of arc4random() can be forced using configure --disable-openssl-random + * + * Use of arc4random() can be forced using configure options + * --disable-openssl-random or --without-crypto. * * We can count on arc4random existing, thru the OS or thru libevent. * The quality of arc4random depends on the implementor. - * + * * RAND_poll() doesn't show up until XXX. If it's not present, we * need to either provide our own or use arc4random(). */ -/* - * ntp_crypto_srandom: - * - * Initialize the random number generator, if needed by the underlying - * crypto random number generation mechanism. - */ + /* + * ntp_crypto_srandom: + * + * Initialize the random number generator, if needed by the underlying + * crypto random number generation mechanism. + */ void ntp_crypto_srandom( void - ) +) { #ifdef USE_OPENSSL_CRYPTO_RAND if (!crypto_rand_init) { - RAND_poll(); + if (RAND_poll()) + crypto_rand_ok = 1; crypto_rand_init = 1; } +#elif HAVE_ARC4RANDOM_BUF + /* + * arc4random_buf has no error return and needs no seeding nor reseeding. + */ + crypto_rand_ok = 1; #else - /* No initialization needed for arc4random() */ + /* + * Explicitly init libevent secure RNG to make sure it seeds. + * This is the only way we can tell if it can successfully get + * entropy from the system. + */ + if (!evutil_secure_rng_init()) + crypto_rand_ok = 1; #endif } /* - * ntp_crypto_random_buf: + * ntp_crypto_random_buf: Used by ntp-keygen * * Returns 0 on success, -1 on error. */ @@ -91,24 +92,24 @@ ntp_crypto_random_buf( size_t nbytes ) { -#ifdef USE_OPENSSL_CRYPTO_RAND - int rc; + if (!crypto_rand_ok) + return -1; - rc = RAND_bytes(buf, size2int_chk(nbytes)); - if (1 != rc) { +#if defined(USE_OPENSSL_CRYPTO_RAND) + if (1 != RAND_bytes(buf, size2int_chk(nbytes))) { unsigned long err; char *err_str; err = ERR_get_error(); err_str = ERR_error_string(err, NULL); - /* XXX: Log the error */ - (void)&err_str; + msyslog(LOG_ERR, "RAND_bytes failed: %s", err_str); return -1; } - return 0; -#else +#elif defined(HAVE_ARC4RANDOM_BUF) arc4random_buf(buf, nbytes); - return 0; +#else + evutil_secure_rng_get_bytes(buf, nbytes); #endif + return 0; } diff --git a/libntp/ntp_random.c b/libntp/ntp_random.c index 0ada44f256b0..83806c420425 100644 --- a/libntp/ntp_random.c +++ b/libntp/ntp_random.c @@ -497,3 +497,18 @@ ntp_random( void ) } return(i); } + +/* + * ntp_uurandom() + * + * Generate a Uniform-distributed Unity based random number. Replaces a + * few locations where the transformation was made in an ad-hoc style + * (and in one instance, wrong...) + * + * returns a number in [0.0 .. 1.0], both ends inclusive + */ +double +ntp_uurandom( void ) +{ + return (double)ntp_random() / 0x7FFFFFFFu; +} diff --git a/libntp/ntp_realpath.c b/libntp/ntp_realpath.c new file mode 100644 index 000000000000..116542945153 --- /dev/null +++ b/libntp/ntp_realpath.c @@ -0,0 +1,279 @@ +/* + * ntp_realpath.c - get real path for a file + * Juergen Perlinger (perlinger@ntp.org) for the NTP project. + * Feb 11, 2014 for the NTP project. + * + * This is a butchered version of FreeBSD's implementation of 'realpath()', + * and the following copyright applies: + *---------------------------------------------------------------------- + */ + +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 2003 Constantin S. Svintsoff + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif +#include "ntp_stdlib.h" + +/* ================================================================== */ +#if defined(SYS_WINNT) +/* ================================================================== */ + +#include + +/* On Windows, we assume 2k for a file path is enough. */ +#define NTP_PATH_MAX 2048 + +static char * +realpath1(const char *path, char *resolved) +{ + /* Items in the device name space get passed back AS IS. Everything + * else is fed through '_fullpath()', which is probably the closest + * counterpart to what 'realpath()' is expected to do on Windows... + */ + char * retval = NULL; + + if (!strncmp(path, "\\\\.\\", 4)) { + if (strlcpy(resolved, path, NTP_PATH_MAX) >= NTP_PATH_MAX) + errno = ENAMETOOLONG; + else + retval = resolved; + } else if ((retval = _fullpath(resolved, path, NTP_PATH_MAX)) == NULL) { + errno = ENAMETOOLONG; + } + return retval; +} + +/* ================================================================== */ +#elif !defined(HAVE_FUNC_POSIX_REALPATH) +/* ================================================================== */ + +#include +#include +#include +#include +#include +#include + +/* The following definitions are to avoid system settings with excessive + * values for maxmimum path length and symlink chains/loops. Adjust with + * care, if that's ever needed: some buffers are on the stack! + */ +#define NTP_PATH_MAX 1024 +#define NTP_MAXSYMLINKS 16 + +/* + * Find the real name of path, by removing all ".", ".." and symlink + * components. Returns (resolved) on success, or (NULL) on failure, + * in which case the path which caused trouble is left in (resolved). + */ +static char * +realpath1(const char *path, char *resolved) +{ + struct stat sb; + char *p, *q; + size_t left_len, resolved_len, next_token_len; + unsigned symlinks; + ssize_t slen; + char left[NTP_PATH_MAX], next_token[NTP_PATH_MAX], symlink[NTP_PATH_MAX]; + + symlinks = 0; + if (path[0] == '/') { + resolved[0] = '/'; + resolved[1] = '\0'; + if (path[1] == '\0') + return (resolved); + resolved_len = 1; + left_len = strlcpy(left, path + 1, sizeof(left)); + } else { + if (getcwd(resolved, NTP_PATH_MAX) == NULL) { + resolved[0] = '.'; + resolved[1] = '\0'; + return (NULL); + } + resolved_len = strlen(resolved); + left_len = strlcpy(left, path, sizeof(left)); + } + if (left_len >= sizeof(left) || resolved_len >= NTP_PATH_MAX) { + errno = ENAMETOOLONG; + return (NULL); + } + + /* + * Iterate over path components in `left'. + */ + while (left_len != 0) { + /* + * Extract the next path component and adjust `left' + * and its length. + */ + p = strchr(left, '/'); + + next_token_len = p != NULL ? (size_t)(p - left) : left_len; + memcpy(next_token, left, next_token_len); + next_token[next_token_len] = '\0'; + + if (p != NULL) { + left_len -= next_token_len + 1; + memmove(left, p + 1, left_len + 1); + } else { + left[0] = '\0'; + left_len = 0; + } + + if (resolved[resolved_len - 1] != '/') { + if (resolved_len + 1 >= NTP_PATH_MAX) { + errno = ENAMETOOLONG; + return (NULL); + } + resolved[resolved_len++] = '/'; + resolved[resolved_len] = '\0'; + } + if (next_token[0] == '\0') { + /* Handle consequential slashes. */ + continue; + } else if (strcmp(next_token, ".") == 0) { + continue; + } else if (strcmp(next_token, "..") == 0) { + /* + * Strip the last path component except when we have + * single "/" + */ + if (resolved_len > 1) { + resolved[resolved_len - 1] = '\0'; + q = strrchr(resolved, '/') + 1; + *q = '\0'; + resolved_len = q - resolved; + } + continue; + } + + /* + * Append the next path component and lstat() it. + */ + resolved_len = strlcat(resolved, next_token, NTP_PATH_MAX); + if (resolved_len >= NTP_PATH_MAX) { + errno = ENAMETOOLONG; + return (NULL); + } + if (lstat(resolved, &sb) != 0) + return (NULL); + if (S_ISLNK(sb.st_mode)) { + if (symlinks++ > NTP_MAXSYMLINKS) { + errno = ELOOP; + return (NULL); + } + slen = readlink(resolved, symlink, sizeof(symlink)); + if (slen <= 0 || slen >= (ssize_t)sizeof(symlink)) { + if (slen < 0) + ; /* keep errno from readlink(2) call */ + else if (slen == 0) + errno = ENOENT; + else + errno = ENAMETOOLONG; + return (NULL); + } + symlink[slen] = '\0'; + if (symlink[0] == '/') { + resolved[1] = 0; + resolved_len = 1; + } else { + /* Strip the last path component. */ + q = strrchr(resolved, '/') + 1; + *q = '\0'; + resolved_len = q - resolved; + } + + /* + * If there are any path components left, then + * append them to symlink. The result is placed + * in `left'. + */ + if (p != NULL) { + if (symlink[slen - 1] != '/') { + if (slen + 1 >= (ssize_t)sizeof(symlink)) { + errno = ENAMETOOLONG; + return (NULL); + } + symlink[slen] = '/'; + symlink[slen + 1] = 0; + } + left_len = strlcat(symlink, left, + sizeof(symlink)); + if (left_len >= sizeof(symlink)) { + errno = ENAMETOOLONG; + return (NULL); + } + } + left_len = strlcpy(left, symlink, sizeof(left)); + } else if (!S_ISDIR(sb.st_mode) && p != NULL) { + errno = ENOTDIR; + return (NULL); + } + } + + /* + * Remove trailing slash except when the resolved pathname + * is a single "/". + */ + if (resolved_len > 1 && resolved[resolved_len - 1] == '/') + resolved[resolved_len - 1] = '\0'; + return (resolved); +} + +/* ================================================================== */ +#endif /* !defined(SYS_WINNT) && !defined(HAVE_POSIX_REALPATH) */ +/* ================================================================== */ + +char * +ntp_realpath(const char * path) +{ +# if defined(HAVE_FUNC_POSIX_REALPATH) + + return realpath(path, NULL); + +# else + + char *res = NULL, *m = NULL; + if (path == NULL) + errno = EINVAL; + else if (path[0] == '\0') + errno = ENOENT; + else if ((m = malloc(NTP_PATH_MAX)) == NULL) + errno = ENOMEM; /* MSVCRT malloc does not set this... */ + else if ((res = realpath1(path, m)) == NULL) + free(m); + else + res = realloc(res, strlen(res) + 1); + return (res); + +# endif +} diff --git a/libntp/numtoa.c b/libntp/numtoa.c index 5efbe942e3b4..51645de01c30 100644 --- a/libntp/numtoa.c +++ b/libntp/numtoa.c @@ -9,6 +9,7 @@ #endif #include +#include #include "ntp_fp.h" #include "lib_strbuf.h" @@ -42,18 +43,33 @@ refid_str( { char * text; size_t tlen; + char * cp; if (stratum > 1) return numtoa(refid); LIB_GETBUF(text); text[0] = '.'; + /* What if any non-NUL char is not printable? */ memcpy(&text[1], &refid, sizeof(refid)); text[1 + sizeof(refid)] = '\0'; tlen = strlen(text); text[tlen] = '.'; text[tlen + 1] = '\0'; + /* + * Now make sure the contents are 'graphic'. + * + * This refid is expected to be up to 4 ascii graphics. + * If any character is not a graphic, replace it with a space. + * This will at least alert the viewer of a problem. + */ + for (cp = text + 1; *cp; ++cp) { + if (!isgraph((int)*cp)) { + *cp = ' '; + } + } + return text; } diff --git a/libntp/recvbuff.c b/libntp/recvbuff.c index 5855ec2147ac..d84a87d68501 100644 --- a/libntp/recvbuff.c +++ b/libntp/recvbuff.c @@ -109,12 +109,13 @@ create_buffers( u_int i; size_t abuf; - if (limit_recvbufs <= total_recvbufs) - return; - + /*[bug 3666]: followup -- reset shortfalls in all cases */ abuf = nbufs + buffer_shortfall; buffer_shortfall = 0; + if (limit_recvbufs <= total_recvbufs) + return; + if (abuf < nbufs || abuf > RECV_BATCH) abuf = RECV_BATCH; /* clamp on overflow */ else @@ -234,7 +235,7 @@ get_free_recv_buffer( recvbuf_t *buffer = NULL; LOCK_F(); - if (free_recvbufs > (urgent ? emerg_recvbufs : 0)) { + if (free_recvbufs > (urgent ? 0 : emerg_recvbufs)) { UNLINK_HEAD_SLIST(buffer, free_recv_list, link); } diff --git a/libntp/refnumtoa.c b/libntp/refnumtoa.c index e6ca55aef868..cfebefe1ed18 100644 --- a/libntp/refnumtoa.c +++ b/libntp/refnumtoa.c @@ -10,7 +10,7 @@ const char * refnumtoa( - sockaddr_u *num + const sockaddr_u *num ) { u_int32 netnum; diff --git a/libntp/socktoa.c b/libntp/socktoa.c index 98abe7c42036..4071b0a45be0 100644 --- a/libntp/socktoa.c +++ b/libntp/socktoa.c @@ -119,7 +119,7 @@ sock_hash( /* * We can't just hash the whole thing because there are hidden * fields in sockaddr_in6 that might be filled in by recvfrom(), - * so just use the family, port and address. + * so just use the family and address. */ pch = (const void *)&AF(addr); hashVal = 37 * hashVal + *pch; diff --git a/libntp/systime.c b/libntp/systime.c index a738c8d924dd..76fba7fe1608 100644 --- a/libntp/systime.c +++ b/libntp/systime.c @@ -235,7 +235,7 @@ get_systime( * must scale up the result by 2.0 to cover the full fractional * range. */ - dfuzz = ntp_random() * 2. / FRAC * sys_fuzz; + dfuzz = ntp_uurandom() * sys_fuzz; DTOLFP(dfuzz, &lfpfuzz); L_ADD(&result, &lfpfuzz); @@ -591,6 +591,8 @@ step_systime( return TRUE; } + +#if SIZEOF_TIME_T > 4 static const char * tv_fmt_libbuf( const struct timeval * ptv @@ -612,6 +614,7 @@ tv_fmt_libbuf( (u_int)ptv->tv_usec); return retv; } +#endif /* SIZEOF_TIME_T > 4 */ int /*BOOL*/ diff --git a/libntp/vint64ops.c b/libntp/vint64ops.c index 5adbebbb51d4..1d5087d95438 100644 --- a/libntp/vint64ops.c +++ b/libntp/vint64ops.c @@ -17,32 +17,13 @@ #include "ntp_fp.h" #include "vint64ops.h" -/* --------------------------------------------------------------------- - * GCC is rather sticky with its 'const' attribute. We have to do it more - * explicit than with a cast if we want to get rid of a CONST qualifier. - * Greetings from the PASCAL world, where casting was only possible via - * untagged unions... - */ -static inline void* -noconst( - const void* ptr - ) -{ - union { - const void * cp; - void * vp; - } tmp; - tmp.cp = ptr; - return tmp.vp; -} - /* -------------------------------------------------------------------------*/ vint64 strtouv64( - const char * begp, - char ** endp, - int base + char const * begp, + char const ** const endp, + int base ) { vint64 res; @@ -116,7 +97,7 @@ strtouv64( if (!num) errno = EINVAL; if (endp) - *endp = (char*)noconst(src); + *endp = (const char *)src; if (sig) M_NEG(res.D_s.hi, res.D_s.lo); return res; diff --git a/libntp/work_thread.c b/libntp/work_thread.c index 03a5647bea36..c1fe5c20c995 100644 --- a/libntp/work_thread.c +++ b/libntp/work_thread.c @@ -41,20 +41,10 @@ #ifndef THREAD_MINSTACKSIZE # define THREAD_MINSTACKSIZE (64U * 1024) #endif -#ifndef __sun -#if defined(PTHREAD_STACK_MIN) && THREAD_MINSTACKSIZE < PTHREAD_STACK_MIN -# undef THREAD_MINSTACKSIZE -# define THREAD_MINSTACKSIZE PTHREAD_STACK_MIN -#endif -#endif #ifndef THREAD_MAXSTACKSIZE # define THREAD_MAXSTACKSIZE (256U * 1024) #endif -#if THREAD_MAXSTACKSIZE < THREAD_MINSTACKSIZE -# undef THREAD_MAXSTACKSIZE -# define THREAD_MAXSTACKSIZE THREAD_MINSTACKSIZE -#endif /* need a good integer to store a pointer... */ #ifndef UINTPTR_T @@ -399,7 +389,7 @@ send_blocking_resp_internal( #ifndef WORK_PIPE /* -------------------------------------------------------------------- - * Check if a (Windows-)hanndle to a semaphore is actually the same we + * Check if a (Windows-)handle to a semaphore is actually the same we * are using inside the sema wrapper. */ static BOOL @@ -594,12 +584,25 @@ start_blocking_thread_internal( "start_blocking_thread: pthread_attr_getstacksize() -> %s", strerror(rc)); } else { - if (ostacksize < THREAD_MINSTACKSIZE) - nstacksize = THREAD_MINSTACKSIZE; - else if (ostacksize > THREAD_MAXSTACKSIZE) + nstacksize = ostacksize; + /* order is important here: first clamp on upper limit, + * and the PTHREAD min stack size is ultimate override! + */ + if (nstacksize > THREAD_MAXSTACKSIZE) nstacksize = THREAD_MAXSTACKSIZE; - else - nstacksize = ostacksize; +# ifdef PTHREAD_STACK_MAX + if (nstacksize > PTHREAD_STACK_MAX) + nstacksize = PTHREAD_STACK_MAX; +# endif + + /* now clamp on lower stack limit. */ + if (nstacksize < THREAD_MINSTACKSIZE) + nstacksize = THREAD_MINSTACKSIZE; +# ifdef PTHREAD_STACK_MIN + if (nstacksize < PTHREAD_STACK_MIN) + nstacksize = PTHREAD_STACK_MIN; +# endif + if (nstacksize != ostacksize) rc = pthread_attr_setstacksize(&thr_attr, nstacksize); if (0 != rc) diff --git a/libntp/xsbprintf.c b/libntp/xsbprintf.c index 4586758bc88a..2f7aa5129845 100644 --- a/libntp/xsbprintf.c +++ b/libntp/xsbprintf.c @@ -42,9 +42,9 @@ xvsbprintf( size_t blen = (size_t)(pend - pbuf); rc = vsnprintf(pbuf, blen, pfmt, va); if (rc > 0) { - if ((size_t)rc >= blen) - rc = 0; - pbuf += rc; + if ((size_t)rc >= blen) + rc = 0; + pbuf += rc; } *pbuf = '\0'; /* fear of bad vsnprintf */ *ppbuf = pbuf; diff --git a/libparse/Makefile.am b/libparse/Makefile.am index 8fb089f7717f..a4a3ed264f2f 100644 --- a/libparse/Makefile.am +++ b/libparse/Makefile.am @@ -1,6 +1,7 @@ NULL= BUILT_SOURCES = $(VPHACK) info_trimble.c $(VPHACK_AFTER) CLEANFILES = +DISTCLEANFILES = noinst_LIBRARIES = @MAKE_LIBPARSE@ @MAKE_LIBPARSE_KERNEL@ EXTRA_LIBRARIES = libparse.a libparse_kernel.a EXTRA_PROGRAMS = parsestreams parsesolaris @@ -27,10 +28,10 @@ VPHACK_AFTER= endif vphack: - test -e info_trimble.c || ln -s $(srcdir)/info_trimble.c . + $(AM_V_at)test -e info_trimble.c || ln -s $(srcdir)/info_trimble.c . vphack_after: - test -L info_trimble.c || ( \ + $(AM_V_at)test -L info_trimble.c || ( \ mv info_trimble.c $(srcdir)/info_trimble.c && \ ln -s $(srcdir)/info_trimble.c . \ ) @@ -174,6 +175,6 @@ sys/systm.h: check-libparse: $(noinst_LIBRARIES) @: do-nothing action to avoid default SCCS get -include $(top_srcdir)/sntp/check-libntp.mf +include $(top_srcdir)/check-libntp.mf include $(top_srcdir)/depsver.mf include $(top_srcdir)/includes.mf diff --git a/libparse/Makefile.in b/libparse/Makefile.in index 3d1686d678ee..07a0204c477b 100644 --- a/libparse/Makefile.in +++ b/libparse/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -110,7 +110,6 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_debug.m4 \ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \ - $(top_srcdir)/sntp/m4/ntp_googletest.m4 \ $(top_srcdir)/sntp/m4/ntp_harden.m4 \ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \ @@ -130,6 +129,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ + $(top_srcdir)/sntp/m4/realpath.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -139,6 +139,7 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) @@ -169,7 +170,6 @@ libparse_kernel_a_DEPENDENCIES = kparse.o kparse_conf.o \ $(am__DEPENDENCIES_1) am_libparse_kernel_a_OBJECTS = libparse_kernel_a_OBJECTS = $(am_libparse_kernel_a_OBJECTS) -PROGRAMS = $(noinst_PROGRAMS) parsesolaris_SOURCES = parsesolaris.c parsesolaris_OBJECTS = parsesolaris.$(OBJEXT) parsesolaris_LDADD = $(LDADD) @@ -194,7 +194,19 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/sntp/libevent/build-aux/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/binio.Po \ + ./$(DEPDIR)/clk_computime.Po ./$(DEPDIR)/clk_dcf7000.Po \ + ./$(DEPDIR)/clk_hopf6021.Po ./$(DEPDIR)/clk_meinberg.Po \ + ./$(DEPDIR)/clk_rawdcf.Po ./$(DEPDIR)/clk_rcc8000.Po \ + ./$(DEPDIR)/clk_schmid.Po ./$(DEPDIR)/clk_sel240x.Po \ + ./$(DEPDIR)/clk_trimtaip.Po ./$(DEPDIR)/clk_trimtsip.Po \ + ./$(DEPDIR)/clk_varitext.Po ./$(DEPDIR)/clk_wharton.Po \ + ./$(DEPDIR)/data_mbg.Po ./$(DEPDIR)/gpstolfp.Po \ + ./$(DEPDIR)/ieee754io.Po ./$(DEPDIR)/info_trimble.Po \ + ./$(DEPDIR)/mfp_mul.Po ./$(DEPDIR)/parse.Po \ + ./$(DEPDIR)/parse_conf.Po ./$(DEPDIR)/parsesolaris.Po \ + ./$(DEPDIR)/parsestreams.Po ./$(DEPDIR)/trim_info.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -240,10 +252,8 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depsver.mf \ - $(top_srcdir)/includes.mf $(top_srcdir)/sntp/check-libntp.mf \ +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/check-libntp.mf \ + $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf \ $(top_srcdir)/sntp/libevent/build-aux/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -263,6 +273,7 @@ CALC_TICKADJ_MS = @CALC_TICKADJ_MS@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CC_NOFORMAT = @CC_NOFORMAT@ CFLAGS = @CFLAGS@ CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@ CFLAGS_NTP = @CFLAGS_NTP@ @@ -272,6 +283,8 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ CPPFLAGS_NTP = @CPPFLAGS_NTP@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ DEFS = @DEFS@ @@ -284,14 +297,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EDITLINE_LIBS = @EDITLINE_LIBS@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ -GTEST_CONFIG = @GTEST_CONFIG@ -GTEST_CPPFLAGS = @GTEST_CPPFLAGS@ -GTEST_CXXFLAGS = @GTEST_CXXFLAGS@ -GTEST_LDFLAGS = @GTEST_LDFLAGS@ -GTEST_LIBS = @GTEST_LIBS@ HAVE_INLINE = @HAVE_INLINE@ HAVE_LEAPSMEARINTERVAL = @HAVE_LEAPSMEARINTERVAL@ HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@ @@ -502,6 +511,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -515,6 +525,7 @@ NULL = BUILT_SOURCES = $(VPHACK) info_trimble.c $(VPHACK_AFTER) check-libntp \ .deps-ver CLEANFILES = check-libntp .deps-ver +DISTCLEANFILES = $(DEPDIR)/deps-ver noinst_LIBRARIES = @MAKE_LIBPARSE@ @MAKE_LIBPARSE_KERNEL@ EXTRA_LIBRARIES = libparse.a libparse_kernel.a noinst_PROGRAMS = @MAKE_PARSEKMODULE@ @@ -583,15 +594,16 @@ AM_CPPFLAGS = $(NTP_INCS) -I$(top_srcdir)/kernel $(CPPFLAGS_NTP) \ $(NTP_HARD_CPPFLAGS) AM_LDFLAGS = $(NTP_HARD_LDFLAGS) EXTRA_DIST = parsesolaris.c parsestreams.c mkinfo_scmd.sed mkinfo_rcmd.sed info_trimble.c -NTP_INCS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ - -I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ - -I$(top_srcdir)/lib/isc/unix/include +NTP_INCS = -I$(top_srcdir)/include \ + -I$(top_srcdir)/libntp/lib/isc/include \ + -I$(top_srcdir)/libntp/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ + -I$(top_srcdir)/libntp/lib/isc/unix/include all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/sntp/check-libntp.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/check-libntp.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -608,10 +620,10 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; -$(top_srcdir)/sntp/check-libntp.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): +$(top_srcdir)/check-libntp.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -622,6 +634,15 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) @@ -635,15 +656,6 @@ libparse_kernel.a: $(libparse_kernel_a_OBJECTS) $(libparse_kernel_a_DEPENDENCIES $(AM_V_AR)$(libparse_kernel_a_AR) libparse_kernel.a $(libparse_kernel_a_OBJECTS) $(libparse_kernel_a_LIBADD) $(AM_V_at)$(RANLIB) libparse_kernel.a -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list - parsesolaris$(EXEEXT): $(parsesolaris_OBJECTS) $(parsesolaris_DEPENDENCIES) $(EXTRA_parsesolaris_DEPENDENCIES) @rm -f parsesolaris$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parsesolaris_OBJECTS) $(parsesolaris_LDADD) $(LIBS) @@ -658,47 +670,56 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_computime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_dcf7000.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_hopf6021.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_meinberg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_rawdcf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_rcc8000.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_schmid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_sel240x.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_trimtaip.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_trimtsip.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_varitext.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_wharton.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data_mbg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpstolfp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ieee754io.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/info_trimble.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mfp_mul.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_conf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsesolaris.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsestreams.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trim_info.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_computime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_dcf7000.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_hopf6021.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_meinberg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_rawdcf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_rcc8000.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_schmid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_sel240x.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_trimtaip.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_trimtsip.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_varitext.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_wharton.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data_mbg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpstolfp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ieee754io.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/info_trimble.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mfp_mul.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_conf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsesolaris.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsestreams.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trim_info.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @@ -760,8 +781,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -794,11 +817,12 @@ distdir: $(DISTFILES) check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(LIBRARIES) $(PROGRAMS) +all-am: Makefile $(PROGRAMS) $(LIBRARIES) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -824,6 +848,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -835,7 +860,29 @@ clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/binio.Po + -rm -f ./$(DEPDIR)/clk_computime.Po + -rm -f ./$(DEPDIR)/clk_dcf7000.Po + -rm -f ./$(DEPDIR)/clk_hopf6021.Po + -rm -f ./$(DEPDIR)/clk_meinberg.Po + -rm -f ./$(DEPDIR)/clk_rawdcf.Po + -rm -f ./$(DEPDIR)/clk_rcc8000.Po + -rm -f ./$(DEPDIR)/clk_schmid.Po + -rm -f ./$(DEPDIR)/clk_sel240x.Po + -rm -f ./$(DEPDIR)/clk_trimtaip.Po + -rm -f ./$(DEPDIR)/clk_trimtsip.Po + -rm -f ./$(DEPDIR)/clk_varitext.Po + -rm -f ./$(DEPDIR)/clk_wharton.Po + -rm -f ./$(DEPDIR)/data_mbg.Po + -rm -f ./$(DEPDIR)/gpstolfp.Po + -rm -f ./$(DEPDIR)/ieee754io.Po + -rm -f ./$(DEPDIR)/info_trimble.Po + -rm -f ./$(DEPDIR)/mfp_mul.Po + -rm -f ./$(DEPDIR)/parse.Po + -rm -f ./$(DEPDIR)/parse_conf.Po + -rm -f ./$(DEPDIR)/parsesolaris.Po + -rm -f ./$(DEPDIR)/parsestreams.Po + -rm -f ./$(DEPDIR)/trim_info.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -881,7 +928,29 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/binio.Po + -rm -f ./$(DEPDIR)/clk_computime.Po + -rm -f ./$(DEPDIR)/clk_dcf7000.Po + -rm -f ./$(DEPDIR)/clk_hopf6021.Po + -rm -f ./$(DEPDIR)/clk_meinberg.Po + -rm -f ./$(DEPDIR)/clk_rawdcf.Po + -rm -f ./$(DEPDIR)/clk_rcc8000.Po + -rm -f ./$(DEPDIR)/clk_schmid.Po + -rm -f ./$(DEPDIR)/clk_sel240x.Po + -rm -f ./$(DEPDIR)/clk_trimtaip.Po + -rm -f ./$(DEPDIR)/clk_trimtsip.Po + -rm -f ./$(DEPDIR)/clk_varitext.Po + -rm -f ./$(DEPDIR)/clk_wharton.Po + -rm -f ./$(DEPDIR)/data_mbg.Po + -rm -f ./$(DEPDIR)/gpstolfp.Po + -rm -f ./$(DEPDIR)/ieee754io.Po + -rm -f ./$(DEPDIR)/info_trimble.Po + -rm -f ./$(DEPDIR)/mfp_mul.Po + -rm -f ./$(DEPDIR)/parse.Po + -rm -f ./$(DEPDIR)/parse_conf.Po + -rm -f ./$(DEPDIR)/parsesolaris.Po + -rm -f ./$(DEPDIR)/parsestreams.Po + -rm -f ./$(DEPDIR)/trim_info.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -900,30 +969,30 @@ ps-am: uninstall-am: -.MAKE: all check install install-am install-strip +.MAKE: all check install install-am install-exec install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLIBRARIES clean-noinstPROGRAMS \ - cscopelist-am ctags ctags-am distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libtool clean-noinstLIBRARIES \ + clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile vphack: - test -e info_trimble.c || ln -s $(srcdir)/info_trimble.c . + $(AM_V_at)test -e info_trimble.c || ln -s $(srcdir)/info_trimble.c . vphack_after: - test -L info_trimble.c || ( \ + $(AM_V_at)test -L info_trimble.c || ( \ mv info_trimble.c $(srcdir)/info_trimble.c && \ ln -s $(srcdir)/info_trimble.c . \ ) @@ -1009,17 +1078,18 @@ sys/systm.h: check-libparse: $(noinst_LIBRARIES) @: do-nothing action to avoid default SCCS get -check-libntp: ../libntp/libntp.a +check-libntp: $(top_builddir)/libntp/libntp.a + @: avoid default SCCS get by some make implementations -../libntp/libntp.a: - cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a +$(top_builddir)/libntp/libntp.a: + cd $(top_builddir)/libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ - chmod ug+w $@ + chmod u+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ - $(MAKE) $(AM_MAKEFLAGS) clean && \ + $(MAKE) $(AM_MAKEFLAGS) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ @@ -1037,7 +1107,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) - cp $(top_srcdir)/deps-ver $@ + $(AM_V_at)cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/deps-ver @@ -1067,7 +1137,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # -# This comment block follows rather than leads the related code so that +# This comment block follows rather than leads the related rules so that # it stays with it in the generated Makefile.in and Makefile. # diff --git a/libparse/clk_wharton.c b/libparse/clk_wharton.c index e9e3d84644ac..371137dc6fe8 100644 --- a/libparse/clk_wharton.c +++ b/libparse/clk_wharton.c @@ -12,13 +12,6 @@ #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_WHARTON_400A) /* * Support for WHARTON 400A Series clock + 404.2 serial interface. - * - * Copyright (C) 1999, 2000 by Philippe De Muyter - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * */ #include "ntp_fp.h" diff --git a/ntpd/Makefile.am b/ntpd/Makefile.am index b977d5e21cb1..103303d3ec22 100644 --- a/ntpd/Makefile.am +++ b/ntpd/Makefile.am @@ -18,7 +18,7 @@ AM_LDFLAGS = $(LDFLAGS_NTP) AM_LDFLAGS += $(NTP_HARD_LDFLAGS) # LDADD might need RESLIB and ADJLIB. -LDADD = version.o libntpd.a $(LIBPARSE) +LDADD = libntpd.a $(LIBPARSE) AM_YFLAGS = -d -t -r all if SAVECONFIG_ENABLED @@ -51,8 +51,8 @@ VPHACK_AFTER= endif vphack: - test -e ntp_parser.c || ln -s $(srcdir)/ntp_parser.c . - test -e ntp_parser.h || ln -s $(srcdir)/ntp_parser.h . + $(AM_V_at)test -e ntp_parser.c || ln -s $(srcdir)/ntp_parser.c . + $(AM_V_at)test -e ntp_parser.h || ln -s $(srcdir)/ntp_parser.h . # # ylwrap script which invokes Bison replaces ntp_parser.h @@ -62,7 +62,7 @@ vphack: # vphack_after: - test -L ntp_parser.h || ( \ + $(AM_V_at)test -L ntp_parser.h || ( \ mv ntp_parser.h $(srcdir)/ntp_parser.h && \ ln -s $(srcdir)/ntp_parser.h . \ ) @@ -87,10 +87,6 @@ man5_MANS= ntp.conf.5 ntp.keys.5 man8_MANS= man_MANS= ntpd.$(NTPD_MS) -# ntpdsim.1 is a remnant along with all the ntpdsim-opts.* files, the -# simulator currently uses ntpd-opts.[ch]. This also means there is no -# longer a reason to have ntpdbase-opts.def split off of ntpd-opts.def. - LDADD_NTPD_COMMON = $(LDADD_LIBNTP) $(LIBOPTS_LDADD) $(PTHREAD_LIBS) LDADD_NTPD_COMMON += $(LIBM) $(LDADD_NTP) $(LSCF) ntpd_LDADD = $(LDADD) ../libntp/libntp.a $(LDADD_NTPD_COMMON) $(LDADD_LIBUTIL) @@ -102,8 +98,6 @@ keyword_gen_LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) DISTCLEANFILES = \ keyword-gen \ - .version \ - version.c \ config.log \ $(man5_MANS) \ $(man_MANS) \ @@ -124,6 +118,10 @@ CLEANFILES = \ psl1save.conf+ \ psl2save.conf \ psl2save.conf+ \ + .version \ + version.c \ + ntpd-version.c \ + sim-version.c \ $(EXTRA_PROGRAMS) \ $(NULL) @@ -192,6 +190,7 @@ noinst_DATA = \ noinst_HEADERS = \ declcond.h \ + ntp_clockdev.h \ ntp_leapsec.h \ $(NULL) @@ -199,6 +198,7 @@ install-data-local: install-html run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \ autogen -L ../sntp/include -L ../sntp/ag-tpl --writable + std_def_list = \ $(top_srcdir)/sntp/include/debug-opt.def \ $(top_srcdir)/sntp/include/autogen-version.def \ @@ -211,7 +211,9 @@ std_def_list = \ check-local: $(MAKE_CHECK_Y2K) $(CHECK_SAVECONFIG) test -z "$(MAKE_CHECK_Y2K)" || ./$(MAKE_CHECK_Y2K) -ntpd_SOURCES = \ +# ntpd_ntpdsim_SRCS use #ifdef SIM and are included in both + +ntpd_ntpdsim_SRCS = \ ntp_config.c \ ntp_keyword.h \ ntp_io.c \ @@ -223,17 +225,30 @@ ntpd_SOURCES = \ ntpd-opts.h \ $(NULL) +ntpd_SOURCES = \ + $(ntpd_ntpdsim_SRCS) \ + $(NULL) + +nodist_ntpd_SOURCES = \ + ntpd-version.c \ + $(NULL) + ntpdsim_SOURCES = \ - $(ntpd_SOURCES) \ + $(ntpd_ntpdsim_SRCS) \ ntp_prio_q.c \ ntpsim.c \ $(NULL) +nodist_ntpdsim_SOURCES = \ + sim-version.c \ + $(NULL) + # libntpd_a_SOURCES do not use #ifdef SIM libntpd_a_SOURCES = \ cmd_args.c \ jupiter.h \ + ntp_clockdev.c \ ntp_control.c \ ntp_crypto.c \ ntp_filegen.c \ @@ -242,6 +257,7 @@ libntpd_a_SOURCES = \ ntp_monitor.c \ ntp_peer.c \ ntp_proto.c \ + ntp_ppsdev.c \ ntp_refclock.c \ ntp_request.c \ ntp_restrict.c \ @@ -295,21 +311,21 @@ libntpd_a_SOURCES = \ $(NULL) k-g-u-submake: keyword-gen - ./keyword-gen $(srcdir)/ntp_parser.h > k-g.out - @grep -v diff_ignore_line < k-g.out > cmp1 - @grep -v diff_ignore_line < $(srcdir)/ntp_keyword.h > cmp2 - @cmp cmp1 cmp2 > /dev/null || \ + $(AM_V_at)./keyword-gen $(srcdir)/ntp_parser.h > k-g.out + $(AM_V_at)grep -v diff_ignore_line < k-g.out > cmp1 + $(AM_V_at)grep -v diff_ignore_line < $(srcdir)/ntp_keyword.h > cmp2 + $(AM_V_at)cmp cmp1 cmp2 > /dev/null || \ { mv -f k-g.out $(srcdir)/ntp_keyword.h && \ echo 'Generated changed ntp_keyword.h.' ;} - @[ ! -f k-g.out ] || \ + $(AM_V_at)[ ! -f k-g.out ] || \ { rm k-g.out && echo 'ntp_keyword.h is up to date.' ;} @rm cmp1 cmp2 @echo 'keyword-gen and ntp_keyword.h are up to date.' > $@ $(srcdir)/keyword-gen-utd: $(srcdir)/keyword-gen.c $(srcdir)/ntp_parser.h - $(MAKE) $(AM_MAKEFLAGS) k-g-u-submake # avoid explicit dependency - grep diff_ignore_line $(srcdir)/ntp_keyword.h > k-g-u - mv -f k-g-u $@ + $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) k-g-u-submake # avoid explicit dependency + $(AM_V_at)grep diff_ignore_line $(srcdir)/ntp_keyword.h > k-g-u + $(AM_V_at)mv -f k-g-u $@ $(srcdir)/ntp_keyword.h: $(srcdir)/keyword-gen-utd @: do-nothing action to avoid default SCCS get @@ -319,12 +335,12 @@ $(srcdir)/ntpd-opts.h: $(srcdir)/ntpd-opts.c @: do-nothing action to avoid default SCCS get, .h built with .c $(srcdir)/ntpd-opts.c: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list) - $(run_ag) ntpd-opts.def + $(AM_V_GEN)$(run_ag) ntpd-opts.def ### $(srcdir)/ntpd.1ntpdman: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1ntpdman -Tagman-cmd.tpl ntpd-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpdman -Tagman-cmd.tpl ntpd-opts.def $(srcdir)/ntpd.man.in: $(srcdir)/ntpd.1ntpdman $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpd.1ntpdman > $(srcdir)/ntpd.man.in+ @@ -333,7 +349,7 @@ $(srcdir)/ntpd.man.in: $(srcdir)/ntpd.1ntpdman $(top_srcdir)/sntp/scripts/mansec ### $(srcdir)/ntpd.1ntpdmdoc: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1ntpdmdoc -Tagmdoc-cmd.tpl ntpd-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpdmdoc -Tagmdoc-cmd.tpl ntpd-opts.def $(srcdir)/ntpd.mdoc.in: $(srcdir)/ntpd.1ntpdmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpd.1ntpdmdoc > $(srcdir)/ntpd.mdoc.in+ @@ -351,13 +367,13 @@ $(srcdir)/invoke-ntp.conf.menu: $(srcdir)/invoke-ntp.conf.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-ntp.conf.texi: $(srcdir)/ntp.conf.def $(std_def_list) - $(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.conf.def + $(AM_V_GEN)$(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.conf.def $(srcdir)/invoke-ntp.keys.menu: $(srcdir)/invoke-ntp.keys.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-ntp.keys.texi: $(srcdir)/ntp.keys.def $(std_def_list) - $(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.keys.def + $(AM_V_GEN)$(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.keys.def $(srcdir)/ntp.conf.html: $(srcdir)/ntp.conf.texi $(srcdir)/invoke-ntp.conf.texi $(top_srcdir)/sntp/include/version.texi cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp.conf.html ntp.conf.texi || true ) @@ -371,7 +387,7 @@ $(srcdir)/ntpd.html: $(srcdir)/ntpd.texi $(srcdir)/invoke-ntpd.texi $(top_srcdir ### $(srcdir)/ntp.conf.5man: $(srcdir)/ntp.conf.def $(std_def_list) - $(run_ag) -DMAN_SECTION=5man -Tagman-cmd.tpl ntp.conf.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=5man -Tagman-cmd.tpl ntp.conf.def $(srcdir)/ntp.conf.man.in: $(srcdir)/ntp.conf.5man $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.conf.5man > $(srcdir)/ntp.conf.man.in+ @@ -380,7 +396,7 @@ $(srcdir)/ntp.conf.man.in: $(srcdir)/ntp.conf.5man $(top_srcdir)/sntp/scripts/ma ### $(srcdir)/ntp.conf.5mdoc: $(srcdir)/ntp.conf.def $(std_def_list) - $(run_ag) -DMAN_SECTION=5mdoc -Tagmdoc-cmd.tpl ntp.conf.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=5mdoc -Tagmdoc-cmd.tpl ntp.conf.def $(srcdir)/ntp.conf.mdoc.in: $(srcdir)/ntp.conf.5mdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.conf.5mdoc > $(srcdir)/ntp.conf.mdoc.in+ @@ -395,7 +411,7 @@ ntp.conf.5: $(srcdir)/ntp.conf.$(MANTAGFMT).in $(top_builddir)/config.status ### $(srcdir)/ntp.keys.5man: $(srcdir)/ntp.keys.def $(std_def_list) - $(run_ag) -DMAN_SECTION=5man -Tagman-file.tpl ntp.keys.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=5man -Tagman-file.tpl ntp.keys.def $(srcdir)/ntp.keys.man.in: $(srcdir)/ntp.keys.5man $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.keys.5man > $(srcdir)/ntp.keys.man.in+ @@ -404,7 +420,7 @@ $(srcdir)/ntp.keys.man.in: $(srcdir)/ntp.keys.5man $(top_srcdir)/sntp/scripts/ma ### $(srcdir)/ntp.keys.5mdoc: $(srcdir)/ntp.keys.def $(std_def_list) - $(run_ag) -DMAN_SECTION=5mdoc -Tagmdoc-file.tpl ntp.keys.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=5mdoc -Tagmdoc-file.tpl ntp.keys.def $(srcdir)/ntp.keys.mdoc.in: $(srcdir)/ntp.keys.5mdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.keys.5mdoc > $(srcdir)/ntp.keys.mdoc.in+ @@ -422,11 +438,9 @@ $(srcdir)/invoke-ntpd.menu: $(srcdir)/invoke-ntpd.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-ntpd.texi: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list) - $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpd-opts.def + $(AM_V_GEN)$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpd-opts.def $(top_srcdir)/scripts/build/check--help $@ -$(PROGRAMS): $(LDADD) - check-saveconfig: complete.conf compsave.conf -diff -u complete.conf compsave.conf cmp complete.conf compsave.conf && echo stamp > $@ @@ -439,27 +453,27 @@ check-pslsaveconfig: check-psl0 check-psl1 check-psl2 echo stamp > $@ check-psl0: psl0.conf psl0save.conf - -diff -u $< psl0save.conf - cmp $< psl0save.conf && echo stamp > $@ + -diff -u $(srcdir)/psl0.conf psl0save.conf + cmp $(srcdir)/psl0.conf psl0save.conf && echo stamp > $@ psl0save.conf: psl0.conf ntpd - ./ntpd --configfile $< --saveconfigquit $@+ + ./ntpd --configfile $(srcdir)/psl0.conf --saveconfigquit $@+ grep -v '^#' $@+ > $@ check-psl1: psl1.conf psl1save.conf - -diff -u $< psl1save.conf - cmp $< psl1save.conf && echo stamp > $@ + -diff -u $(srcdir)/psl1.conf psl1save.conf + cmp $(srcdir)/psl1.conf psl1save.conf && echo stamp > $@ psl1save.conf: psl1.conf ntpd - ./ntpd --configfile $< --saveconfigquit $@+ + ./ntpd --configfile $(srcdir)/psl1.conf --saveconfigquit $@+ grep -v '^#' $@+ > $@ check-psl2: psl2.conf psl2save.conf - -diff -u $< psl2save.conf - cmp $< psl2save.conf && echo stamp > $@ + -diff -u $(srcdir)/psl2.conf psl2save.conf + cmp $(srcdir)/psl2.conf psl2save.conf && echo stamp > $@ psl2save.conf: psl2.conf ntpd - ./ntpd --configfile $< --saveconfigquit $@+ + ./ntpd --configfile $(srcdir)/psl2.conf --saveconfigquit $@+ grep -v '^#' $@+ > $@ ../libntp/libntpsim.a: @@ -468,20 +482,20 @@ psl2save.conf: psl2.conf ntpd ../libparse/libparse.a: cd ../libparse && $(MAKE) $(AM_MAKEFLAGS) check-libparse -$(top_srcdir)/sntp/scm-rev: - cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev +ntpd-version.c: Makefile $(top_srcdir)/sntp/scm-rev + $(AM_V_GEN)env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpd + $(AM_V_at)mv -f version.c $@ -version.c: $(ntpd_OBJECTS) ../libntp/libntp.a @LIBPARSE@ Makefile $(top_srcdir)/sntp/scm-rev - env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpd - -version.o: version.c - env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o +sim-version.c: Makefile $(top_srcdir)/sntp/scm-rev + $(AM_V_GEN)env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpdsim + $(AM_V_at)@mv -f version.c $@ $(srcdir)/Makefile.am: @: do-nothing include $(top_srcdir)/bincheck.mf include $(top_srcdir)/check-libopts.mf -include $(top_srcdir)/sntp/check-libntp.mf +include $(top_srcdir)/check-libntp.mf +include $(top_srcdir)/check-scm-rev.mf include $(top_srcdir)/depsver.mf include $(top_srcdir)/includes.mf diff --git a/ntpd/Makefile.in b/ntpd/Makefile.in index 127a23d5f159..a9a338e11f16 100644 --- a/ntpd/Makefile.in +++ b/ntpd/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -117,7 +117,6 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_debug.m4 \ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \ - $(top_srcdir)/sntp/m4/ntp_googletest.m4 \ $(top_srcdir)/sntp/m4/ntp_harden.m4 \ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \ @@ -137,6 +136,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ + $(top_srcdir)/sntp/m4/realpath.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -147,6 +147,11 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = complete.conf CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \ + "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \ + "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" \ + "$(DESTDIR)$(htmldir)" +PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(sbin_PROGRAMS) LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) @@ -156,10 +161,11 @@ am__v_AR_1 = libntpd_a_AR = $(AR) $(ARFLAGS) libntpd_a_LIBADD = am__objects_1 = -am_libntpd_a_OBJECTS = cmd_args.$(OBJEXT) ntp_control.$(OBJEXT) \ - ntp_crypto.$(OBJEXT) ntp_filegen.$(OBJEXT) \ - ntp_leapsec.$(OBJEXT) ntp_loopfilter.$(OBJEXT) \ - ntp_monitor.$(OBJEXT) ntp_peer.$(OBJEXT) ntp_proto.$(OBJEXT) \ +am_libntpd_a_OBJECTS = cmd_args.$(OBJEXT) ntp_clockdev.$(OBJEXT) \ + ntp_control.$(OBJEXT) ntp_crypto.$(OBJEXT) \ + ntp_filegen.$(OBJEXT) ntp_leapsec.$(OBJEXT) \ + ntp_loopfilter.$(OBJEXT) ntp_monitor.$(OBJEXT) \ + ntp_peer.$(OBJEXT) ntp_proto.$(OBJEXT) ntp_ppsdev.$(OBJEXT) \ ntp_refclock.$(OBJEXT) ntp_request.$(OBJEXT) \ ntp_restrict.$(OBJEXT) ntp_signd.$(OBJEXT) ntp_timer.$(OBJEXT) \ ntp_util.$(OBJEXT) rc_cmdlength.$(OBJEXT) \ @@ -185,15 +191,10 @@ am_libntpd_a_OBJECTS = cmd_args.$(OBJEXT) ntp_control.$(OBJEXT) \ refclock_wwvb.$(OBJEXT) refclock_zyfer.$(OBJEXT) \ refclock_tsyncpci.$(OBJEXT) $(am__objects_1) libntpd_a_OBJECTS = $(am_libntpd_a_OBJECTS) -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \ - "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \ - "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" \ - "$(DESTDIR)$(htmldir)" -PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(sbin_PROGRAMS) check_y2k_SOURCES = check_y2k.c check_y2k_OBJECTS = check_y2k.$(OBJEXT) am__DEPENDENCIES_1 = -am__DEPENDENCIES_2 = version.o libntpd.a $(am__DEPENDENCIES_1) +am__DEPENDENCIES_2 = libntpd.a $(am__DEPENDENCIES_1) check_y2k_DEPENDENCIES = $(am__DEPENDENCIES_2) ../libntp/libntp.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) @@ -205,22 +206,26 @@ keyword_gen_SOURCES = keyword-gen.c keyword_gen_OBJECTS = keyword-gen.$(OBJEXT) keyword_gen_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) -am_ntpd_OBJECTS = ntp_config.$(OBJEXT) ntp_io.$(OBJEXT) \ +am__objects_2 = ntp_config.$(OBJEXT) ntp_io.$(OBJEXT) \ ntp_parser.$(OBJEXT) ntp_scanner.$(OBJEXT) ntpd.$(OBJEXT) \ ntpd-opts.$(OBJEXT) $(am__objects_1) -ntpd_OBJECTS = $(am_ntpd_OBJECTS) +am_ntpd_OBJECTS = $(am__objects_2) $(am__objects_1) +nodist_ntpd_OBJECTS = ntpd-version.$(OBJEXT) $(am__objects_1) +ntpd_OBJECTS = $(am_ntpd_OBJECTS) $(nodist_ntpd_OBJECTS) am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ntpd_DEPENDENCIES = $(am__DEPENDENCIES_2) ../libntp/libntp.a \ $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1) -am__objects_2 = ntpdsim-ntp_config.$(OBJEXT) ntpdsim-ntp_io.$(OBJEXT) \ +am__objects_3 = ntpdsim-ntp_config.$(OBJEXT) ntpdsim-ntp_io.$(OBJEXT) \ ntpdsim-ntp_parser.$(OBJEXT) ntpdsim-ntp_scanner.$(OBJEXT) \ ntpdsim-ntpd.$(OBJEXT) ntpdsim-ntpd-opts.$(OBJEXT) \ $(am__objects_1) -am_ntpdsim_OBJECTS = $(am__objects_2) ntpdsim-ntp_prio_q.$(OBJEXT) \ +am_ntpdsim_OBJECTS = $(am__objects_3) ntpdsim-ntp_prio_q.$(OBJEXT) \ ntpdsim-ntpsim.$(OBJEXT) $(am__objects_1) -ntpdsim_OBJECTS = $(am_ntpdsim_OBJECTS) +nodist_ntpdsim_OBJECTS = ntpdsim-sim-version.$(OBJEXT) \ + $(am__objects_1) +ntpdsim_OBJECTS = $(am_ntpdsim_OBJECTS) $(nodist_ntpdsim_OBJECTS) ntpdsim_DEPENDENCIES = $(am__DEPENDENCIES_2) ../libntp/libntpsim.a \ $(am__DEPENDENCIES_3) AM_V_P = $(am__v_P_@AM_V@) @@ -237,7 +242,50 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/sntp/libevent/build-aux/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/check_y2k.Po ./$(DEPDIR)/cmd_args.Po \ + ./$(DEPDIR)/keyword-gen.Po ./$(DEPDIR)/ntp_clockdev.Po \ + ./$(DEPDIR)/ntp_config.Po ./$(DEPDIR)/ntp_control.Po \ + ./$(DEPDIR)/ntp_crypto.Po ./$(DEPDIR)/ntp_filegen.Po \ + ./$(DEPDIR)/ntp_io.Po ./$(DEPDIR)/ntp_leapsec.Po \ + ./$(DEPDIR)/ntp_loopfilter.Po ./$(DEPDIR)/ntp_monitor.Po \ + ./$(DEPDIR)/ntp_parser.Po ./$(DEPDIR)/ntp_peer.Po \ + ./$(DEPDIR)/ntp_ppsdev.Po ./$(DEPDIR)/ntp_proto.Po \ + ./$(DEPDIR)/ntp_refclock.Po ./$(DEPDIR)/ntp_request.Po \ + ./$(DEPDIR)/ntp_restrict.Po ./$(DEPDIR)/ntp_scanner.Po \ + ./$(DEPDIR)/ntp_signd.Po ./$(DEPDIR)/ntp_timer.Po \ + ./$(DEPDIR)/ntp_util.Po ./$(DEPDIR)/ntpd-opts.Po \ + ./$(DEPDIR)/ntpd-version.Po ./$(DEPDIR)/ntpd.Po \ + ./$(DEPDIR)/ntpdsim-ntp_config.Po \ + ./$(DEPDIR)/ntpdsim-ntp_io.Po \ + ./$(DEPDIR)/ntpdsim-ntp_parser.Po \ + ./$(DEPDIR)/ntpdsim-ntp_prio_q.Po \ + ./$(DEPDIR)/ntpdsim-ntp_scanner.Po \ + ./$(DEPDIR)/ntpdsim-ntpd-opts.Po ./$(DEPDIR)/ntpdsim-ntpd.Po \ + ./$(DEPDIR)/ntpdsim-ntpsim.Po \ + ./$(DEPDIR)/ntpdsim-sim-version.Po ./$(DEPDIR)/rc_cmdlength.Po \ + ./$(DEPDIR)/refclock_acts.Po ./$(DEPDIR)/refclock_arbiter.Po \ + ./$(DEPDIR)/refclock_arc.Po ./$(DEPDIR)/refclock_as2201.Po \ + ./$(DEPDIR)/refclock_atom.Po ./$(DEPDIR)/refclock_bancomm.Po \ + ./$(DEPDIR)/refclock_chronolog.Po ./$(DEPDIR)/refclock_chu.Po \ + ./$(DEPDIR)/refclock_conf.Po ./$(DEPDIR)/refclock_datum.Po \ + ./$(DEPDIR)/refclock_dumbclock.Po ./$(DEPDIR)/refclock_fg.Po \ + ./$(DEPDIR)/refclock_gpsdjson.Po \ + ./$(DEPDIR)/refclock_gpsvme.Po ./$(DEPDIR)/refclock_heath.Po \ + ./$(DEPDIR)/refclock_hopfpci.Po \ + ./$(DEPDIR)/refclock_hopfser.Po ./$(DEPDIR)/refclock_hpgps.Po \ + ./$(DEPDIR)/refclock_irig.Po ./$(DEPDIR)/refclock_jjy.Po \ + ./$(DEPDIR)/refclock_jupiter.Po ./$(DEPDIR)/refclock_leitch.Po \ + ./$(DEPDIR)/refclock_local.Po ./$(DEPDIR)/refclock_mx4200.Po \ + ./$(DEPDIR)/refclock_neoclock4x.Po \ + ./$(DEPDIR)/refclock_nmea.Po ./$(DEPDIR)/refclock_oncore.Po \ + ./$(DEPDIR)/refclock_palisade.Po ./$(DEPDIR)/refclock_parse.Po \ + ./$(DEPDIR)/refclock_pcf.Po ./$(DEPDIR)/refclock_pst.Po \ + ./$(DEPDIR)/refclock_ripencc.Po ./$(DEPDIR)/refclock_shm.Po \ + ./$(DEPDIR)/refclock_tpro.Po ./$(DEPDIR)/refclock_true.Po \ + ./$(DEPDIR)/refclock_tsyncpci.Po ./$(DEPDIR)/refclock_tt560.Po \ + ./$(DEPDIR)/refclock_ulink.Po ./$(DEPDIR)/refclock_wwv.Po \ + ./$(DEPDIR)/refclock_wwvb.Po ./$(DEPDIR)/refclock_zyfer.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -268,7 +316,8 @@ am__v_YACC_0 = @echo " YACC " $@; am__v_YACC_1 = YLWRAP = $(top_srcdir)/sntp/libevent/build-aux/ylwrap SOURCES = $(libntpd_a_SOURCES) check_y2k.c keyword-gen.c \ - $(ntpd_SOURCES) $(ntpdsim_SOURCES) + $(ntpd_SOURCES) $(nodist_ntpd_SOURCES) $(ntpdsim_SOURCES) \ + $(nodist_ntpdsim_SOURCES) DIST_SOURCES = $(libntpd_a_SOURCES) check_y2k.c keyword-gen.c \ $(ntpd_SOURCES) $(ntpdsim_SOURCES) am__can_run_installinfo = \ @@ -327,12 +376,10 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/complete.conf.in \ - $(top_srcdir)/bincheck.mf $(top_srcdir)/check-libopts.mf \ + $(top_srcdir)/bincheck.mf $(top_srcdir)/check-libntp.mf \ + $(top_srcdir)/check-libopts.mf $(top_srcdir)/check-scm-rev.mf \ $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf \ - $(top_srcdir)/sntp/check-libntp.mf \ $(top_srcdir)/sntp/libevent/build-aux/depcomp \ $(top_srcdir)/sntp/libevent/build-aux/ylwrap ntp_parser.c \ ntp_parser.h @@ -354,6 +401,7 @@ CALC_TICKADJ_MS = @CALC_TICKADJ_MS@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CC_NOFORMAT = @CC_NOFORMAT@ CFLAGS = @CFLAGS@ CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@ CFLAGS_NTP = @CFLAGS_NTP@ @@ -363,6 +411,8 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ CPPFLAGS_NTP = @CPPFLAGS_NTP@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ DEFS = @DEFS@ @@ -375,14 +425,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EDITLINE_LIBS = @EDITLINE_LIBS@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ -GTEST_CONFIG = @GTEST_CONFIG@ -GTEST_CPPFLAGS = @GTEST_CPPFLAGS@ -GTEST_CXXFLAGS = @GTEST_CXXFLAGS@ -GTEST_LDFLAGS = @GTEST_LDFLAGS@ -GTEST_LIBS = @GTEST_LIBS@ HAVE_INLINE = @HAVE_INLINE@ HAVE_LEAPSMEARINTERVAL = @HAVE_LEAPSMEARINTERVAL@ HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@ @@ -593,6 +639,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -613,7 +660,7 @@ AM_CPPFLAGS = $(NTP_INCS) $(LIBOPTS_CFLAGS) $(CPPFLAGS_NTP) \ AM_LDFLAGS = $(LDFLAGS_NTP) $(NTP_HARD_LDFLAGS) # LDADD might need RESLIB and ADJLIB. -LDADD = version.o libntpd.a $(LIBPARSE) +LDADD = libntpd.a $(LIBPARSE) AM_YFLAGS = -d -t -r all @NTP_CROSSCOMPILE_FALSE@@SAVECONFIG_ENABLED_TRUE@CHECK_SAVECONFIG = check-saveconfig check-pslsaveconfig @NTP_CROSSCOMPILE_TRUE@@SAVECONFIG_ENABLED_TRUE@CHECK_SAVECONFIG = @@ -647,10 +694,6 @@ man1_MANS = man5_MANS = ntp.conf.5 ntp.keys.5 man8_MANS = man_MANS = ntpd.$(NTPD_MS) - -# ntpdsim.1 is a remnant along with all the ntpdsim-opts.* files, the -# simulator currently uses ntpd-opts.[ch]. This also means there is no -# longer a reason to have ntpdbase-opts.def split off of ntpd-opts.def. LDADD_NTPD_COMMON = $(LDADD_LIBNTP) $(LIBOPTS_LDADD) $(PTHREAD_LIBS) \ $(LIBM) $(LDADD_NTP) $(LSCF) ntpd_LDADD = $(LDADD) ../libntp/libntp.a $(LDADD_NTPD_COMMON) $(LDADD_LIBUTIL) @@ -658,20 +701,14 @@ ntpdsim_LDADD = $(LDADD) ../libntp/libntpsim.a $(LDADD_NTPD_COMMON) ntpdsim_CPPFLAGS = $(AM_CPPFLAGS) -DSIM check_y2k_LDADD = $(LDADD) ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(LDADD_LIBNTP) $(PTHREAD_LIBS) keyword_gen_LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) -DISTCLEANFILES = \ - keyword-gen \ - .version \ - version.c \ - config.log \ - $(man5_MANS) \ - $(man_MANS) \ - $(NULL) - +DISTCLEANFILES = keyword-gen config.log $(man5_MANS) $(man_MANS) \ + $(NULL) $(DEPDIR)/deps-ver CLEANFILES = check-psl0 check-psl1 check-psl2 check-pslsaveconfig \ check-saveconfig compsave.conf compsave.conf+ k-g-u-submake \ psl0save.conf psl0save.conf+ psl1save.conf psl1save.conf+ \ - psl2save.conf psl2save.conf+ $(EXTRA_PROGRAMS) $(NULL) \ - check-libopts check-libntp .deps-ver + psl2save.conf psl2save.conf+ .version version.c ntpd-version.c \ + sim-version.c $(EXTRA_PROGRAMS) $(NULL) check-libopts \ + check-libntp .deps-ver EXTRA_DIST = \ complete.conf.in \ invoke-ntp.conf.menu \ @@ -736,6 +773,7 @@ noinst_DATA = \ noinst_HEADERS = \ declcond.h \ + ntp_clockdev.h \ ntp_leapsec.h \ $(NULL) @@ -751,7 +789,9 @@ std_def_list = \ $(top_srcdir)/sntp/include/version.def \ $(NULL) -ntpd_SOURCES = \ + +# ntpd_ntpdsim_SRCS use #ifdef SIM and are included in both +ntpd_ntpdsim_SRCS = \ ntp_config.c \ ntp_keyword.h \ ntp_io.c \ @@ -763,17 +803,30 @@ ntpd_SOURCES = \ ntpd-opts.h \ $(NULL) +ntpd_SOURCES = \ + $(ntpd_ntpdsim_SRCS) \ + $(NULL) + +nodist_ntpd_SOURCES = \ + ntpd-version.c \ + $(NULL) + ntpdsim_SOURCES = \ - $(ntpd_SOURCES) \ + $(ntpd_ntpdsim_SRCS) \ ntp_prio_q.c \ ntpsim.c \ $(NULL) +nodist_ntpdsim_SOURCES = \ + sim-version.c \ + $(NULL) + # libntpd_a_SOURCES do not use #ifdef SIM libntpd_a_SOURCES = \ cmd_args.c \ jupiter.h \ + ntp_clockdev.c \ ntp_control.c \ ntp_crypto.c \ ntp_filegen.c \ @@ -782,6 +835,7 @@ libntpd_a_SOURCES = \ ntp_monitor.c \ ntp_peer.c \ ntp_proto.c \ + ntp_ppsdev.c \ ntp_refclock.c \ ntp_request.c \ ntp_restrict.c \ @@ -834,15 +888,16 @@ libntpd_a_SOURCES = \ refclock_tsyncpci.c \ $(NULL) -NTP_INCS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ - -I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ - -I$(top_srcdir)/lib/isc/unix/include +NTP_INCS = -I$(top_srcdir)/include \ + -I$(top_srcdir)/libntp/lib/isc/include \ + -I$(top_srcdir)/libntp/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ + -I$(top_srcdir)/libntp/lib/isc/unix/include all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj .y -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/check-libopts.mf $(top_srcdir)/sntp/check-libntp.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/check-libopts.mf $(top_srcdir)/check-libntp.mf $(top_srcdir)/check-scm-rev.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -859,10 +914,10 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; -$(top_srcdir)/bincheck.mf $(top_srcdir)/check-libopts.mf $(top_srcdir)/sntp/check-libntp.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): +$(top_srcdir)/bincheck.mf $(top_srcdir)/check-libopts.mf $(top_srcdir)/check-libntp.mf $(top_srcdir)/check-scm-rev.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -874,14 +929,6 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): complete.conf: $(top_builddir)/config.status $(srcdir)/complete.conf.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -libntpd.a: $(libntpd_a_OBJECTS) $(libntpd_a_DEPENDENCIES) $(EXTRA_libntpd_a_DEPENDENCIES) - $(AM_V_at)-rm -f libntpd.a - $(AM_V_AR)$(libntpd_a_AR) libntpd.a $(libntpd_a_OBJECTS) $(libntpd_a_LIBADD) - $(AM_V_at)$(RANLIB) libntpd.a install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @@ -1039,6 +1086,14 @@ clean-sbinPROGRAMS: echo " rm -f" $$list; \ rm -f $$list +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +libntpd.a: $(libntpd_a_OBJECTS) $(libntpd_a_DEPENDENCIES) $(EXTRA_libntpd_a_DEPENDENCIES) + $(AM_V_at)-rm -f libntpd.a + $(AM_V_AR)$(libntpd_a_AR) libntpd.a $(libntpd_a_OBJECTS) $(libntpd_a_LIBADD) + $(AM_V_at)$(RANLIB) libntpd.a + check_y2k$(EXEEXT): $(check_y2k_OBJECTS) $(check_y2k_DEPENDENCIES) $(EXTRA_check_y2k_DEPENDENCIES) @rm -f check_y2k$(EXEEXT) $(AM_V_CCLD)$(LINK) $(check_y2k_OBJECTS) $(check_y2k_LDADD) $(LIBS) @@ -1064,97 +1119,110 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_y2k.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmd_args.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyword-gen.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_config.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_control.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_crypto.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_filegen.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_io.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_leapsec.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_loopfilter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_monitor.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_parser.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_peer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_proto.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_refclock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_request.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_restrict.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_scanner.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_signd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_timer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_util.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpd-opts.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_config.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_io.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_parser.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_prio_q.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_scanner.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntpd-opts.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntpd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntpsim.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rc_cmdlength.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_acts.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_arbiter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_arc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_as2201.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_atom.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_bancomm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_chronolog.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_chu.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_conf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_datum.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_dumbclock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_fg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_gpsdjson.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_gpsvme.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_heath.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_hopfpci.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_hopfser.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_hpgps.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_irig.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_jjy.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_jupiter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_leitch.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_local.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_mx4200.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_neoclock4x.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_nmea.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_oncore.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_palisade.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_parse.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_pcf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_pst.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_ripencc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_shm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_tpro.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_true.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_tsyncpci.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_tt560.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_ulink.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_wwv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_wwvb.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_zyfer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_y2k.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmd_args.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyword-gen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_clockdev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_config.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_control.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_crypto.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_filegen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_io.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_leapsec.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_loopfilter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_monitor.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_parser.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_peer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_ppsdev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_proto.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_refclock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_request.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_restrict.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_scanner.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_signd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_timer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_util.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpd-opts.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpd-version.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_config.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_io.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_parser.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_prio_q.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_scanner.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntpd-opts.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntpd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntpsim.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-sim-version.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rc_cmdlength.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_acts.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_arbiter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_arc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_as2201.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_atom.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_bancomm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_chronolog.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_chu.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_conf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_datum.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_dumbclock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_fg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_gpsdjson.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_gpsvme.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_heath.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_hopfpci.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_hopfser.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_hpgps.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_irig.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_jjy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_jupiter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_leitch.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_local.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_mx4200.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_neoclock4x.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_nmea.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_oncore.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_palisade.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_parse.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_pcf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_pst.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_ripencc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_shm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_tpro.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_true.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_tsyncpci.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_tt560.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_ulink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_wwv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_wwvb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_zyfer.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @@ -1271,6 +1339,20 @@ ntpdsim-ntpsim.obj: ntpsim.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntpsim.obj `if test -f 'ntpsim.c'; then $(CYGPATH_W) 'ntpsim.c'; else $(CYGPATH_W) '$(srcdir)/ntpsim.c'; fi` +ntpdsim-sim-version.o: sim-version.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntpdsim-sim-version.o -MD -MP -MF $(DEPDIR)/ntpdsim-sim-version.Tpo -c -o ntpdsim-sim-version.o `test -f 'sim-version.c' || echo '$(srcdir)/'`sim-version.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntpdsim-sim-version.Tpo $(DEPDIR)/ntpdsim-sim-version.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sim-version.c' object='ntpdsim-sim-version.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntpdsim-sim-version.o `test -f 'sim-version.c' || echo '$(srcdir)/'`sim-version.c + +ntpdsim-sim-version.obj: sim-version.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntpdsim-sim-version.obj -MD -MP -MF $(DEPDIR)/ntpdsim-sim-version.Tpo -c -o ntpdsim-sim-version.obj `if test -f 'sim-version.c'; then $(CYGPATH_W) 'sim-version.c'; else $(CYGPATH_W) '$(srcdir)/sim-version.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntpdsim-sim-version.Tpo $(DEPDIR)/ntpdsim-sim-version.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sim-version.c' object='ntpdsim-sim-version.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntpdsim-sim-version.obj `if test -f 'sim-version.c'; then $(CYGPATH_W) 'sim-version.c'; else $(CYGPATH_W) '$(srcdir)/sim-version.c'; fi` + .y.c: $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) @@ -1481,8 +1563,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -1517,14 +1601,15 @@ check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) +all-am: Makefile $(PROGRAMS) $(LIBRARIES) $(MANS) $(DATA) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -1565,7 +1650,83 @@ clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/check_y2k.Po + -rm -f ./$(DEPDIR)/cmd_args.Po + -rm -f ./$(DEPDIR)/keyword-gen.Po + -rm -f ./$(DEPDIR)/ntp_clockdev.Po + -rm -f ./$(DEPDIR)/ntp_config.Po + -rm -f ./$(DEPDIR)/ntp_control.Po + -rm -f ./$(DEPDIR)/ntp_crypto.Po + -rm -f ./$(DEPDIR)/ntp_filegen.Po + -rm -f ./$(DEPDIR)/ntp_io.Po + -rm -f ./$(DEPDIR)/ntp_leapsec.Po + -rm -f ./$(DEPDIR)/ntp_loopfilter.Po + -rm -f ./$(DEPDIR)/ntp_monitor.Po + -rm -f ./$(DEPDIR)/ntp_parser.Po + -rm -f ./$(DEPDIR)/ntp_peer.Po + -rm -f ./$(DEPDIR)/ntp_ppsdev.Po + -rm -f ./$(DEPDIR)/ntp_proto.Po + -rm -f ./$(DEPDIR)/ntp_refclock.Po + -rm -f ./$(DEPDIR)/ntp_request.Po + -rm -f ./$(DEPDIR)/ntp_restrict.Po + -rm -f ./$(DEPDIR)/ntp_scanner.Po + -rm -f ./$(DEPDIR)/ntp_signd.Po + -rm -f ./$(DEPDIR)/ntp_timer.Po + -rm -f ./$(DEPDIR)/ntp_util.Po + -rm -f ./$(DEPDIR)/ntpd-opts.Po + -rm -f ./$(DEPDIR)/ntpd-version.Po + -rm -f ./$(DEPDIR)/ntpd.Po + -rm -f ./$(DEPDIR)/ntpdsim-ntp_config.Po + -rm -f ./$(DEPDIR)/ntpdsim-ntp_io.Po + -rm -f ./$(DEPDIR)/ntpdsim-ntp_parser.Po + -rm -f ./$(DEPDIR)/ntpdsim-ntp_prio_q.Po + -rm -f ./$(DEPDIR)/ntpdsim-ntp_scanner.Po + -rm -f ./$(DEPDIR)/ntpdsim-ntpd-opts.Po + -rm -f ./$(DEPDIR)/ntpdsim-ntpd.Po + -rm -f ./$(DEPDIR)/ntpdsim-ntpsim.Po + -rm -f ./$(DEPDIR)/ntpdsim-sim-version.Po + -rm -f ./$(DEPDIR)/rc_cmdlength.Po + -rm -f ./$(DEPDIR)/refclock_acts.Po + -rm -f ./$(DEPDIR)/refclock_arbiter.Po + -rm -f ./$(DEPDIR)/refclock_arc.Po + -rm -f ./$(DEPDIR)/refclock_as2201.Po + -rm -f ./$(DEPDIR)/refclock_atom.Po + -rm -f ./$(DEPDIR)/refclock_bancomm.Po + -rm -f ./$(DEPDIR)/refclock_chronolog.Po + -rm -f ./$(DEPDIR)/refclock_chu.Po + -rm -f ./$(DEPDIR)/refclock_conf.Po + -rm -f ./$(DEPDIR)/refclock_datum.Po + -rm -f ./$(DEPDIR)/refclock_dumbclock.Po + -rm -f ./$(DEPDIR)/refclock_fg.Po + -rm -f ./$(DEPDIR)/refclock_gpsdjson.Po + -rm -f ./$(DEPDIR)/refclock_gpsvme.Po + -rm -f ./$(DEPDIR)/refclock_heath.Po + -rm -f ./$(DEPDIR)/refclock_hopfpci.Po + -rm -f ./$(DEPDIR)/refclock_hopfser.Po + -rm -f ./$(DEPDIR)/refclock_hpgps.Po + -rm -f ./$(DEPDIR)/refclock_irig.Po + -rm -f ./$(DEPDIR)/refclock_jjy.Po + -rm -f ./$(DEPDIR)/refclock_jupiter.Po + -rm -f ./$(DEPDIR)/refclock_leitch.Po + -rm -f ./$(DEPDIR)/refclock_local.Po + -rm -f ./$(DEPDIR)/refclock_mx4200.Po + -rm -f ./$(DEPDIR)/refclock_neoclock4x.Po + -rm -f ./$(DEPDIR)/refclock_nmea.Po + -rm -f ./$(DEPDIR)/refclock_oncore.Po + -rm -f ./$(DEPDIR)/refclock_palisade.Po + -rm -f ./$(DEPDIR)/refclock_parse.Po + -rm -f ./$(DEPDIR)/refclock_pcf.Po + -rm -f ./$(DEPDIR)/refclock_pst.Po + -rm -f ./$(DEPDIR)/refclock_ripencc.Po + -rm -f ./$(DEPDIR)/refclock_shm.Po + -rm -f ./$(DEPDIR)/refclock_tpro.Po + -rm -f ./$(DEPDIR)/refclock_true.Po + -rm -f ./$(DEPDIR)/refclock_tsyncpci.Po + -rm -f ./$(DEPDIR)/refclock_tt560.Po + -rm -f ./$(DEPDIR)/refclock_ulink.Po + -rm -f ./$(DEPDIR)/refclock_wwv.Po + -rm -f ./$(DEPDIR)/refclock_wwvb.Po + -rm -f ./$(DEPDIR)/refclock_zyfer.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -1613,7 +1774,83 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/check_y2k.Po + -rm -f ./$(DEPDIR)/cmd_args.Po + -rm -f ./$(DEPDIR)/keyword-gen.Po + -rm -f ./$(DEPDIR)/ntp_clockdev.Po + -rm -f ./$(DEPDIR)/ntp_config.Po + -rm -f ./$(DEPDIR)/ntp_control.Po + -rm -f ./$(DEPDIR)/ntp_crypto.Po + -rm -f ./$(DEPDIR)/ntp_filegen.Po + -rm -f ./$(DEPDIR)/ntp_io.Po + -rm -f ./$(DEPDIR)/ntp_leapsec.Po + -rm -f ./$(DEPDIR)/ntp_loopfilter.Po + -rm -f ./$(DEPDIR)/ntp_monitor.Po + -rm -f ./$(DEPDIR)/ntp_parser.Po + -rm -f ./$(DEPDIR)/ntp_peer.Po + -rm -f ./$(DEPDIR)/ntp_ppsdev.Po + -rm -f ./$(DEPDIR)/ntp_proto.Po + -rm -f ./$(DEPDIR)/ntp_refclock.Po + -rm -f ./$(DEPDIR)/ntp_request.Po + -rm -f ./$(DEPDIR)/ntp_restrict.Po + -rm -f ./$(DEPDIR)/ntp_scanner.Po + -rm -f ./$(DEPDIR)/ntp_signd.Po + -rm -f ./$(DEPDIR)/ntp_timer.Po + -rm -f ./$(DEPDIR)/ntp_util.Po + -rm -f ./$(DEPDIR)/ntpd-opts.Po + -rm -f ./$(DEPDIR)/ntpd-version.Po + -rm -f ./$(DEPDIR)/ntpd.Po + -rm -f ./$(DEPDIR)/ntpdsim-ntp_config.Po + -rm -f ./$(DEPDIR)/ntpdsim-ntp_io.Po + -rm -f ./$(DEPDIR)/ntpdsim-ntp_parser.Po + -rm -f ./$(DEPDIR)/ntpdsim-ntp_prio_q.Po + -rm -f ./$(DEPDIR)/ntpdsim-ntp_scanner.Po + -rm -f ./$(DEPDIR)/ntpdsim-ntpd-opts.Po + -rm -f ./$(DEPDIR)/ntpdsim-ntpd.Po + -rm -f ./$(DEPDIR)/ntpdsim-ntpsim.Po + -rm -f ./$(DEPDIR)/ntpdsim-sim-version.Po + -rm -f ./$(DEPDIR)/rc_cmdlength.Po + -rm -f ./$(DEPDIR)/refclock_acts.Po + -rm -f ./$(DEPDIR)/refclock_arbiter.Po + -rm -f ./$(DEPDIR)/refclock_arc.Po + -rm -f ./$(DEPDIR)/refclock_as2201.Po + -rm -f ./$(DEPDIR)/refclock_atom.Po + -rm -f ./$(DEPDIR)/refclock_bancomm.Po + -rm -f ./$(DEPDIR)/refclock_chronolog.Po + -rm -f ./$(DEPDIR)/refclock_chu.Po + -rm -f ./$(DEPDIR)/refclock_conf.Po + -rm -f ./$(DEPDIR)/refclock_datum.Po + -rm -f ./$(DEPDIR)/refclock_dumbclock.Po + -rm -f ./$(DEPDIR)/refclock_fg.Po + -rm -f ./$(DEPDIR)/refclock_gpsdjson.Po + -rm -f ./$(DEPDIR)/refclock_gpsvme.Po + -rm -f ./$(DEPDIR)/refclock_heath.Po + -rm -f ./$(DEPDIR)/refclock_hopfpci.Po + -rm -f ./$(DEPDIR)/refclock_hopfser.Po + -rm -f ./$(DEPDIR)/refclock_hpgps.Po + -rm -f ./$(DEPDIR)/refclock_irig.Po + -rm -f ./$(DEPDIR)/refclock_jjy.Po + -rm -f ./$(DEPDIR)/refclock_jupiter.Po + -rm -f ./$(DEPDIR)/refclock_leitch.Po + -rm -f ./$(DEPDIR)/refclock_local.Po + -rm -f ./$(DEPDIR)/refclock_mx4200.Po + -rm -f ./$(DEPDIR)/refclock_neoclock4x.Po + -rm -f ./$(DEPDIR)/refclock_nmea.Po + -rm -f ./$(DEPDIR)/refclock_oncore.Po + -rm -f ./$(DEPDIR)/refclock_palisade.Po + -rm -f ./$(DEPDIR)/refclock_parse.Po + -rm -f ./$(DEPDIR)/refclock_pcf.Po + -rm -f ./$(DEPDIR)/refclock_pst.Po + -rm -f ./$(DEPDIR)/refclock_ripencc.Po + -rm -f ./$(DEPDIR)/refclock_shm.Po + -rm -f ./$(DEPDIR)/refclock_tpro.Po + -rm -f ./$(DEPDIR)/refclock_true.Po + -rm -f ./$(DEPDIR)/refclock_tsyncpci.Po + -rm -f ./$(DEPDIR)/refclock_tt560.Po + -rm -f ./$(DEPDIR)/refclock_ulink.Po + -rm -f ./$(DEPDIR)/refclock_wwv.Po + -rm -f ./$(DEPDIR)/refclock_wwvb.Po + -rm -f ./$(DEPDIR)/refclock_zyfer.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -1635,36 +1872,36 @@ uninstall-am: uninstall-binPROGRAMS uninstall-htmlDATA \ uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 -.MAKE: all check check-am install install-am install-exec-am \ - install-strip +.MAKE: all check check-am install install-am install-exec \ + install-exec-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am check-local clean \ - clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ - clean-libexecPROGRAMS clean-libtool clean-noinstLIBRARIES \ - clean-sbinPROGRAMS cscopelist-am ctags ctags-am distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-binPROGRAMS install-data \ - install-data-am install-data-local install-dvi install-dvi-am \ - install-exec install-exec-am install-exec-hook install-html \ - install-html-am install-htmlDATA install-info install-info-am \ - install-libexecPROGRAMS install-man install-man1 install-man5 \ - install-man8 install-pdf install-pdf-am install-ps \ - install-ps-am install-sbinPROGRAMS install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-htmlDATA uninstall-libexecPROGRAMS uninstall-man \ - uninstall-man1 uninstall-man5 uninstall-man8 \ - uninstall-sbinPROGRAMS +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am \ + check-local clean clean-binPROGRAMS clean-checkPROGRAMS \ + clean-generic clean-libexecPROGRAMS clean-libtool \ + clean-noinstLIBRARIES clean-sbinPROGRAMS cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-data-local install-dvi \ + install-dvi-am install-exec install-exec-am install-exec-hook \ + install-html install-html-am install-htmlDATA install-info \ + install-info-am install-libexecPROGRAMS install-man \ + install-man1 install-man5 install-man8 install-pdf \ + install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-htmlDATA \ + uninstall-libexecPROGRAMS uninstall-man uninstall-man1 \ + uninstall-man5 uninstall-man8 uninstall-sbinPROGRAMS .PRECIOUS: Makefile vphack: - test -e ntp_parser.c || ln -s $(srcdir)/ntp_parser.c . - test -e ntp_parser.h || ln -s $(srcdir)/ntp_parser.h . + $(AM_V_at)test -e ntp_parser.c || ln -s $(srcdir)/ntp_parser.c . + $(AM_V_at)test -e ntp_parser.h || ln -s $(srcdir)/ntp_parser.h . # # ylwrap script which invokes Bison replaces ntp_parser.h @@ -1674,7 +1911,7 @@ vphack: # vphack_after: - test -L ntp_parser.h || ( \ + $(AM_V_at)test -L ntp_parser.h || ( \ mv ntp_parser.h $(srcdir)/ntp_parser.h && \ ln -s $(srcdir)/ntp_parser.h . \ ) @@ -1685,21 +1922,21 @@ check-local: $(MAKE_CHECK_Y2K) $(CHECK_SAVECONFIG) test -z "$(MAKE_CHECK_Y2K)" || ./$(MAKE_CHECK_Y2K) k-g-u-submake: keyword-gen - ./keyword-gen $(srcdir)/ntp_parser.h > k-g.out - @grep -v diff_ignore_line < k-g.out > cmp1 - @grep -v diff_ignore_line < $(srcdir)/ntp_keyword.h > cmp2 - @cmp cmp1 cmp2 > /dev/null || \ + $(AM_V_at)./keyword-gen $(srcdir)/ntp_parser.h > k-g.out + $(AM_V_at)grep -v diff_ignore_line < k-g.out > cmp1 + $(AM_V_at)grep -v diff_ignore_line < $(srcdir)/ntp_keyword.h > cmp2 + $(AM_V_at)cmp cmp1 cmp2 > /dev/null || \ { mv -f k-g.out $(srcdir)/ntp_keyword.h && \ echo 'Generated changed ntp_keyword.h.' ;} - @[ ! -f k-g.out ] || \ + $(AM_V_at)[ ! -f k-g.out ] || \ { rm k-g.out && echo 'ntp_keyword.h is up to date.' ;} @rm cmp1 cmp2 @echo 'keyword-gen and ntp_keyword.h are up to date.' > $@ $(srcdir)/keyword-gen-utd: $(srcdir)/keyword-gen.c $(srcdir)/ntp_parser.h - $(MAKE) $(AM_MAKEFLAGS) k-g-u-submake # avoid explicit dependency - grep diff_ignore_line $(srcdir)/ntp_keyword.h > k-g-u - mv -f k-g-u $@ + $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) k-g-u-submake # avoid explicit dependency + $(AM_V_at)grep diff_ignore_line $(srcdir)/ntp_keyword.h > k-g-u + $(AM_V_at)mv -f k-g-u $@ $(srcdir)/ntp_keyword.h: $(srcdir)/keyword-gen-utd @: do-nothing action to avoid default SCCS get @@ -1709,12 +1946,12 @@ $(srcdir)/ntpd-opts.h: $(srcdir)/ntpd-opts.c @: do-nothing action to avoid default SCCS get, .h built with .c $(srcdir)/ntpd-opts.c: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list) - $(run_ag) ntpd-opts.def + $(AM_V_GEN)$(run_ag) ntpd-opts.def ### $(srcdir)/ntpd.1ntpdman: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1ntpdman -Tagman-cmd.tpl ntpd-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpdman -Tagman-cmd.tpl ntpd-opts.def $(srcdir)/ntpd.man.in: $(srcdir)/ntpd.1ntpdman $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpd.1ntpdman > $(srcdir)/ntpd.man.in+ @@ -1723,7 +1960,7 @@ $(srcdir)/ntpd.man.in: $(srcdir)/ntpd.1ntpdman $(top_srcdir)/sntp/scripts/mansec ### $(srcdir)/ntpd.1ntpdmdoc: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1ntpdmdoc -Tagmdoc-cmd.tpl ntpd-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpdmdoc -Tagmdoc-cmd.tpl ntpd-opts.def $(srcdir)/ntpd.mdoc.in: $(srcdir)/ntpd.1ntpdmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpd.1ntpdmdoc > $(srcdir)/ntpd.mdoc.in+ @@ -1741,13 +1978,13 @@ $(srcdir)/invoke-ntp.conf.menu: $(srcdir)/invoke-ntp.conf.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-ntp.conf.texi: $(srcdir)/ntp.conf.def $(std_def_list) - $(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.conf.def + $(AM_V_GEN)$(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.conf.def $(srcdir)/invoke-ntp.keys.menu: $(srcdir)/invoke-ntp.keys.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-ntp.keys.texi: $(srcdir)/ntp.keys.def $(std_def_list) - $(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.keys.def + $(AM_V_GEN)$(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.keys.def $(srcdir)/ntp.conf.html: $(srcdir)/ntp.conf.texi $(srcdir)/invoke-ntp.conf.texi $(top_srcdir)/sntp/include/version.texi cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp.conf.html ntp.conf.texi || true ) @@ -1761,7 +1998,7 @@ $(srcdir)/ntpd.html: $(srcdir)/ntpd.texi $(srcdir)/invoke-ntpd.texi $(top_srcdir ### $(srcdir)/ntp.conf.5man: $(srcdir)/ntp.conf.def $(std_def_list) - $(run_ag) -DMAN_SECTION=5man -Tagman-cmd.tpl ntp.conf.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=5man -Tagman-cmd.tpl ntp.conf.def $(srcdir)/ntp.conf.man.in: $(srcdir)/ntp.conf.5man $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.conf.5man > $(srcdir)/ntp.conf.man.in+ @@ -1770,7 +2007,7 @@ $(srcdir)/ntp.conf.man.in: $(srcdir)/ntp.conf.5man $(top_srcdir)/sntp/scripts/ma ### $(srcdir)/ntp.conf.5mdoc: $(srcdir)/ntp.conf.def $(std_def_list) - $(run_ag) -DMAN_SECTION=5mdoc -Tagmdoc-cmd.tpl ntp.conf.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=5mdoc -Tagmdoc-cmd.tpl ntp.conf.def $(srcdir)/ntp.conf.mdoc.in: $(srcdir)/ntp.conf.5mdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.conf.5mdoc > $(srcdir)/ntp.conf.mdoc.in+ @@ -1785,7 +2022,7 @@ ntp.conf.5: $(srcdir)/ntp.conf.$(MANTAGFMT).in $(top_builddir)/config.status ### $(srcdir)/ntp.keys.5man: $(srcdir)/ntp.keys.def $(std_def_list) - $(run_ag) -DMAN_SECTION=5man -Tagman-file.tpl ntp.keys.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=5man -Tagman-file.tpl ntp.keys.def $(srcdir)/ntp.keys.man.in: $(srcdir)/ntp.keys.5man $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.keys.5man > $(srcdir)/ntp.keys.man.in+ @@ -1794,7 +2031,7 @@ $(srcdir)/ntp.keys.man.in: $(srcdir)/ntp.keys.5man $(top_srcdir)/sntp/scripts/ma ### $(srcdir)/ntp.keys.5mdoc: $(srcdir)/ntp.keys.def $(std_def_list) - $(run_ag) -DMAN_SECTION=5mdoc -Tagmdoc-file.tpl ntp.keys.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=5mdoc -Tagmdoc-file.tpl ntp.keys.def $(srcdir)/ntp.keys.mdoc.in: $(srcdir)/ntp.keys.5mdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.keys.5mdoc > $(srcdir)/ntp.keys.mdoc.in+ @@ -1812,11 +2049,9 @@ $(srcdir)/invoke-ntpd.menu: $(srcdir)/invoke-ntpd.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-ntpd.texi: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list) - $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpd-opts.def + $(AM_V_GEN)$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpd-opts.def $(top_srcdir)/scripts/build/check--help $@ -$(PROGRAMS): $(LDADD) - check-saveconfig: complete.conf compsave.conf -diff -u complete.conf compsave.conf cmp complete.conf compsave.conf && echo stamp > $@ @@ -1829,27 +2064,27 @@ check-pslsaveconfig: check-psl0 check-psl1 check-psl2 echo stamp > $@ check-psl0: psl0.conf psl0save.conf - -diff -u $< psl0save.conf - cmp $< psl0save.conf && echo stamp > $@ + -diff -u $(srcdir)/psl0.conf psl0save.conf + cmp $(srcdir)/psl0.conf psl0save.conf && echo stamp > $@ psl0save.conf: psl0.conf ntpd - ./ntpd --configfile $< --saveconfigquit $@+ + ./ntpd --configfile $(srcdir)/psl0.conf --saveconfigquit $@+ grep -v '^#' $@+ > $@ check-psl1: psl1.conf psl1save.conf - -diff -u $< psl1save.conf - cmp $< psl1save.conf && echo stamp > $@ + -diff -u $(srcdir)/psl1.conf psl1save.conf + cmp $(srcdir)/psl1.conf psl1save.conf && echo stamp > $@ psl1save.conf: psl1.conf ntpd - ./ntpd --configfile $< --saveconfigquit $@+ + ./ntpd --configfile $(srcdir)/psl1.conf --saveconfigquit $@+ grep -v '^#' $@+ > $@ check-psl2: psl2.conf psl2save.conf - -diff -u $< psl2save.conf - cmp $< psl2save.conf && echo stamp > $@ + -diff -u $(srcdir)/psl2.conf psl2save.conf + cmp $(srcdir)/psl2.conf psl2save.conf && echo stamp > $@ psl2save.conf: psl2.conf ntpd - ./ntpd --configfile $< --saveconfigquit $@+ + ./ntpd --configfile $(srcdir)/psl2.conf --saveconfigquit $@+ grep -v '^#' $@+ > $@ ../libntp/libntpsim.a: @@ -1858,14 +2093,13 @@ psl2save.conf: psl2.conf ntpd ../libparse/libparse.a: cd ../libparse && $(MAKE) $(AM_MAKEFLAGS) check-libparse -$(top_srcdir)/sntp/scm-rev: - cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev +ntpd-version.c: Makefile $(top_srcdir)/sntp/scm-rev + $(AM_V_GEN)env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpd + $(AM_V_at)mv -f version.c $@ -version.c: $(ntpd_OBJECTS) ../libntp/libntp.a @LIBPARSE@ Makefile $(top_srcdir)/sntp/scm-rev - env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpd - -version.o: version.c - env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o +sim-version.c: Makefile $(top_srcdir)/sntp/scm-rev + $(AM_V_GEN)env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpdsim + $(AM_V_at)@mv -f version.c $@ $(srcdir)/Makefile.am: @: do-nothing @@ -1890,17 +2124,25 @@ check-libopts: ../sntp/libopts/libopts.la ../sntp/libopts/libopts.la: -cd ../sntp/libopts && $(MAKE) $(AM_MAKEFLAGS) libopts.la -check-libntp: ../libntp/libntp.a +check-libntp: $(top_builddir)/libntp/libntp.a + @: avoid default SCCS get by some make implementations -../libntp/libntp.a: - cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a +$(top_builddir)/libntp/libntp.a: + cd $(top_builddir)/libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a +$(top_srcdir)/sntp/scm-rev: FRC.scm-rev + $(AM_V_GEN)cd $(top_builddir)/sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev + +FRC.scm-rev: + @: FRC.scm-rev "force" depends on nothing and is not a file, so is \ + always out-of-date causing targets which depend on it to also \ + be outdated so their rules to fire each time they are built. $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ - chmod ug+w $@ + chmod u+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ - $(MAKE) $(AM_MAKEFLAGS) clean && \ + $(MAKE) $(AM_MAKEFLAGS) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ @@ -1918,7 +2160,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) - cp $(top_srcdir)/deps-ver $@ + $(AM_V_at)cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/deps-ver @@ -1948,7 +2190,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # -# This comment block follows rather than leads the related code so that +# This comment block follows rather than leads the related rules so that # it stays with it in the generated Makefile.in and Makefile. # diff --git a/ntpd/cmd_args.c b/ntpd/cmd_args.c index adb4a606bb31..aa461cb4dbe6 100644 --- a/ntpd/cmd_args.c +++ b/ntpd/cmd_args.c @@ -71,7 +71,7 @@ getCmdOpts( } if (HAVE_OPT( DRIFTFILE )) - stats_config(STATS_FREQ_FILE, OPT_ARG( DRIFTFILE ), 0); + stats_config(STATS_FREQ_FILE, OPT_ARG( DRIFTFILE ), 1); if (HAVE_OPT( PANICGATE )) allow_panic = TRUE; @@ -90,7 +90,7 @@ getCmdOpts( getauthkeys(OPT_ARG( KEYFILE )); if (HAVE_OPT( PIDFILE )) - stats_config(STATS_PID_FILE, OPT_ARG( PIDFILE ), 0); + stats_config(STATS_PID_FILE, OPT_ARG( PIDFILE ), 1); if (HAVE_OPT( QUIT )) mode_ntpdate = TRUE; @@ -110,7 +110,7 @@ getCmdOpts( } while (0); if (HAVE_OPT( STATSDIR )) - stats_config(STATS_STATSDIR, OPT_ARG( STATSDIR ), 0); + stats_config(STATS_STATSDIR, OPT_ARG( STATSDIR ), 1); if (HAVE_OPT( TRUSTEDKEY )) { int ct = STACKCT_OPT( TRUSTEDKEY ); diff --git a/ntpd/invoke-ntp.conf.texi b/ntpd/invoke-ntp.conf.texi index b504ce0b047f..ff708155cd4e 100644 --- a/ntpd/invoke-ntp.conf.texi +++ b/ntpd/invoke-ntp.conf.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntp.conf.texi) # -# It has been AutoGen-ed June 23, 2020 at 02:20:31 AM by AutoGen 5.18.5 +# It has been AutoGen-ed May 31, 2023 at 02:49:31 PM by AutoGen 5.18.16 # From the definitions ntp.conf.def # and the template file agtexi-file.tpl @end ignore @@ -1456,17 +1456,27 @@ client abuse. The @code{average} subcommand specifies the minimum average packet -spacing, while the +spacing in log2 seconds, defaulting to 3 (8s), while the @code{minimum} -subcommand specifies the minimum packet spacing. +subcommand specifies the minimum packet spacing +in seconds, defaulting to 2. Packets that violate these minima are discarded and a kiss-o'-death packet returned if enabled. -The default -minimum average and minimum are 5 and 2, respectively. The @code{monitor} -subcommand specifies the probability of discard -for packets that overflow the rate-control window. +subcommand indirectly specifies the probability of +replacing the oldest entry from the monitor (MRU) +list of recent requests used to enforce rate controls, +when that list is at its maximum size. The probability +of replacing the oldest entry is the age of that entry +in seconds divided by the +@code{monitor} +value, default 3000. For example, if the oldest entry +in the MRU list represents a request 300 seconds ago, +by default the probability of replacing it with an +entry representing the client request being processed +now is 10%. Conversely, if the oldest entry is more +than 3000 seconds old, the probability is 100%. @item @code{restrict} @code{address} @code{[@code{mask} @kbd{mask}]} @code{[@code{ippeerlimit} @kbd{int}]} @code{[@kbd{flag} @kbd{...}]} The @kbd{address} @@ -2775,7 +2785,7 @@ For the JJY driver (type 40 mode 100 - 180), the argument is one telephone number used to dial the telephone JJY service. The Hayes command ATDT is normally prepended to the number. The number can contain other modem control codes as well. -@item @code{pollskewlist} @code{[@kbd{poll} @kbd{value} | @kbd{value}]} @kbd{...} @code{[@code{default} @kbd{value} | @kbd{value}]} +@item @code{pollskewlist} @code{[@kbd{poll} @kbd{early} @kbd{late}]} @kbd{...} @code{[@code{default} @kbd{early} @kbd{late}]} Enable skewing of our poll requests to our servers. @kbd{poll} is a number between 3 and 17 inclusive, identifying a specific poll interval. @@ -2786,9 +2796,11 @@ a poll interval of 17 corresponds to 131,072 seconds, or about a day and a half. The next two numbers must be between 0 and one-half of the poll interval, inclusive. -The first number specifies how early the poll may start, +Ar early +specifies how early the poll may start, while -the second number specifies how late the poll may be delayed. +Ar late +specifies how late the poll may be delayed. With no arguments, internally specified default values are chosen. @item @code{reset} @code{[@code{allpeers}]} @code{[@code{auth}]} @code{[@code{ctl}]} @code{[@code{io}]} @code{[@code{mem}]} @code{[@code{sys}]} @code{[@code{timer}]} Reset one or more groups of counters maintained by diff --git a/ntpd/invoke-ntp.keys.texi b/ntpd/invoke-ntp.keys.texi index fcaa19499102..52dee572b434 100644 --- a/ntpd/invoke-ntp.keys.texi +++ b/ntpd/invoke-ntp.keys.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntp.keys.texi) # -# It has been AutoGen-ed June 23, 2020 at 02:20:33 AM by AutoGen 5.18.5 +# It has been AutoGen-ed May 31, 2023 at 02:49:34 PM by AutoGen 5.18.16 # From the definitions ntp.keys.def # and the template file agtexi-file.tpl @end ignore diff --git a/ntpd/invoke-ntpd.texi b/ntpd/invoke-ntpd.texi index 3438285956e5..fbce35dd8d26 100644 --- a/ntpd/invoke-ntpd.texi +++ b/ntpd/invoke-ntpd.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntpd.texi) # -# It has been AutoGen-ed June 23, 2020 at 02:20:35 AM by AutoGen 5.18.5 +# It has been AutoGen-ed May 31, 2023 at 02:49:36 PM by AutoGen 5.18.16 # From the definitions ntpd-opts.def # and the template file agtexi-cmd.tpl @end ignore @@ -142,7 +142,7 @@ with a status code of 0. @exampleindent 0 @example -ntpd - NTP daemon program - Ver. 4.2.8p15 +ntpd - NTP daemon program - Ver. 4.2.8p16 Usage: ntpd [ - [] | --[@{=| @}] ]... \ [ ... ] Flg Arg Option-Name Description @@ -210,7 +210,7 @@ hyphen and the flag character. The following option preset mechanisms are supported: - examining environment variables named NTPD_* -Please send bug reports to: +Please send bug reports to: @end example @exampleindent 4 @@ -685,7 +685,7 @@ The command line options relating to configuration and/or usage help are: Print the program version to standard out, optionally with licensing information, then exit 0. The optional argument specifies how much licensing -detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument. +detail to provide. The default is to print just the version. The licensing information may be selected with an option argument. Only the first letter of the argument is examined: @table @samp diff --git a/ntpd/keyword-gen-utd b/ntpd/keyword-gen-utd index 6a74fdf21983..0eb94005b839 100644 --- a/ntpd/keyword-gen-utd +++ b/ntpd/keyword-gen-utd @@ -1 +1 @@ - * Generated 2020-02-13 08:56:28 UTC diff_ignore_line + * Generated 2022-03-27 14:17:11 UTC diff_ignore_line diff --git a/ntpd/keyword-gen.c b/ntpd/keyword-gen.c index fbc6423d33e3..104d95e8b3e1 100644 --- a/ntpd/keyword-gen.c +++ b/ntpd/keyword-gen.c @@ -45,6 +45,7 @@ struct key_tok ntp_keywords[] = { { "broadcastdelay", T_Broadcastdelay, FOLLBY_TOKEN }, { "checkhash", T_Checkhash, FOLLBY_TOKEN }, { "ctl", T_Ctl, FOLLBY_TOKEN }, +{ "device", T_Device, FOLLBY_STRING }, { "disable", T_Disable, FOLLBY_TOKEN }, { "driftfile", T_Driftfile, FOLLBY_STRING }, { "dscp", T_Dscp, FOLLBY_TOKEN }, @@ -207,6 +208,9 @@ struct key_tok ntp_keywords[] = { { "time1", T_Time1, FOLLBY_TOKEN }, { "time2", T_Time2, FOLLBY_TOKEN }, { "minjitter", T_Minjitter, FOLLBY_TOKEN }, +/* device spec */ +{ "ppsdata", T_PpsData, FOLLBY_STRING }, +{ "timedata", T_TimeData, FOLLBY_STRING }, /* system_option */ { "auth", T_Auth, FOLLBY_TOKEN }, { "bclient", T_Bclient, FOLLBY_TOKEN }, diff --git a/ntpd/ntp.conf.5man b/ntpd/ntp.conf.5man index a3649f052106..80b742f7d624 100644 --- a/ntpd/ntp.conf.5man +++ b/ntpd/ntp.conf.5man @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntp.conf 5man "23 Jun 2020" "4.2.8p15" "File Formats" +.TH ntp.conf 5man "31 May 2023" "4.2.8p16" "File Formats" .\" .\" EDIT THIS FILE WITH CAUTION (in-mem file) .\" -.\" It has been AutoGen-ed June 23, 2020 at 02:20:36 AM by AutoGen 5.18.5 +.\" It has been AutoGen-ed May 31, 2023 at 02:49:38 PM by AutoGen 5.18.16 .\" From the definitions ntp.conf.def .\" and the template file agman-cmd.tpl .SH NAME @@ -1657,17 +1657,27 @@ client abuse. The \f\*[B-Font]average\f[] subcommand specifies the minimum average packet -spacing, while the +spacing in log2 seconds, defaulting to 3 (8s), while the \f\*[B-Font]minimum\f[] -subcommand specifies the minimum packet spacing. +subcommand specifies the minimum packet spacing +in seconds, defaulting to 2. Packets that violate these minima are discarded and a kiss-o'-death packet returned if enabled. -The default -minimum average and minimum are 5 and 2, respectively. The \f\*[B-Font]monitor\f[] -subcommand specifies the probability of discard -for packets that overflow the rate-control window. +subcommand indirectly specifies the probability of +replacing the oldest entry from the monitor (MRU) +list of recent requests used to enforce rate controls, +when that list is at its maximum size. The probability +of replacing the oldest entry is the age of that entry +in seconds divided by the +\f\*[B-Font]monitor\f[] +value, default 3000. For example, if the oldest entry +in the MRU list represents a request 300 seconds ago, +by default the probability of replacing it with an +entry representing the client request being processed +now is 10%. Conversely, if the oldest entry is more +than 3000 seconds old, the probability is 100%. .TP 7 .NOP \f\*[B-Font]restrict\f[] \f\*[B-Font]address\f[] [\f\*[B-Font]mask\f[] \f\*[I-Font]mask\f[]] [\f\*[B-Font]ippeerlimit\f[] \f\*[I-Font]int\f[]] [\f\*[I-Font]flag\f[] \f\*[I-Font]...\f[]] The @@ -3101,7 +3111,7 @@ one telephone number used to dial the telephone JJY service. The Hayes command ATDT is normally prepended to the number. The number can contain other modem control codes as well. .TP 7 -.NOP \f\*[B-Font]pollskewlist\f[] [\f\*[I-Font]poll\f[] \f\*[I-Font]value\f[] | \f\*[I-Font]value\f[]] \f\*[I-Font]...\f[] [\f\*[B-Font]default\f[] \f\*[I-Font]value\f[] | \f\*[I-Font]value\f[]] +.NOP \f\*[B-Font]pollskewlist\f[] [\f\*[I-Font]poll\f[] \f\*[I-Font]early\f[] \f\*[I-Font]late\f[]] \f\*[I-Font]...\f[] [\f\*[B-Font]default\f[] \f\*[I-Font]early\f[] \f\*[I-Font]late\f[]] Enable skewing of our poll requests to our servers. \f\*[I-Font]poll\f[] is a number between 3 and 17 inclusive, identifying a specific poll interval. @@ -3112,9 +3122,11 @@ a poll interval of 17 corresponds to 131,072 seconds, or about a day and a half. The next two numbers must be between 0 and one-half of the poll interval, inclusive. -The first number specifies how early the poll may start, +Ar early +specifies how early the poll may start, while -the second number specifies how late the poll may be delayed. +Ar late +specifies how late the poll may be delayed. With no arguments, internally specified default values are chosen. .TP 7 .NOP \f\*[B-Font]reset\f[] [\f\*[B-Font]allpeers\f[]] [\f\*[B-Font]auth\f[]] [\f\*[B-Font]ctl\f[]] [\f\*[B-Font]io\f[]] [\f\*[B-Font]mem\f[]] [\f\*[B-Font]sys\f[]] [\f\*[B-Font]timer\f[]] @@ -3449,7 +3461,7 @@ RFC5905 .SH "AUTHORS" The University of Delaware and Network Time Foundation .SH "COPYRIGHT" -Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, . .SH BUGS The syntax checking is not picky; some combinations of @@ -3467,7 +3479,7 @@ services when they become universally available. .sp \n(Ppu .ne 2 -Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org +Please send bug reports to: https://bugs.ntp.org, bugs@ntp.org .SH NOTES This document was derived from FreeBSD. .sp \n(Ppu diff --git a/ntpd/ntp.conf.5mdoc b/ntpd/ntp.conf.5mdoc index c833cf008bad..bc6f31c73c24 100644 --- a/ntpd/ntp.conf.5mdoc +++ b/ntpd/ntp.conf.5mdoc @@ -1,9 +1,9 @@ -.Dd June 23 2020 +.Dd May 31 2023 .Dt NTP_CONF 5mdoc File Formats .Os .\" EDIT THIS FILE WITH CAUTION (ntp.mdoc) .\" -.\" It has been AutoGen-ed June 23, 2020 at 02:20:27 AM by AutoGen 5.18.5 +.\" It has been AutoGen-ed May 31, 2023 at 02:49:25 PM by AutoGen 5.18.16 .\" From the definitions ntp.conf.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -1525,17 +1525,27 @@ client abuse. The .Cm average subcommand specifies the minimum average packet -spacing, while the +spacing in log2 seconds, defaulting to 3 (8s), while the .Cm minimum -subcommand specifies the minimum packet spacing. +subcommand specifies the minimum packet spacing +in seconds, defaulting to 2. Packets that violate these minima are discarded and a kiss\-o'\-death packet returned if enabled. -The default -minimum average and minimum are 5 and 2, respectively. The .Ic monitor -subcommand specifies the probability of discard -for packets that overflow the rate\-control window. +subcommand indirectly specifies the probability of +replacing the oldest entry from the monitor (MRU) +list of recent requests used to enforce rate controls, +when that list is at its maximum size. The probability +of replacing the oldest entry is the age of that entry +in seconds divided by the +.Ic monitor +value, default 3000. For example, if the oldest entry +in the MRU list represents a request 300 seconds ago, +by default the probability of replacing it with an +entry representing the client request being processed +now is 10%. Conversely, if the oldest entry is more +than 3000 seconds old, the probability is 100%. .It Xo Ic restrict address .Op Cm mask Ar mask .Op Cm ippeerlimit Ar int @@ -2932,12 +2942,12 @@ The number can contain other modem control codes as well. .It Xo Cm pollskewlist .Oo .Ar poll -.Ar value | value +.Ar early late .Oc .Ar ... .Oo .Cm default -.Ar value | value +.Ar early late .Oc .Xc Enable skewing of our poll requests to our servers. @@ -2950,9 +2960,11 @@ a poll interval of 17 corresponds to 131,072 seconds, or about a day and a half. The next two numbers must be between 0 and one\-half of the poll interval, inclusive. -The first number specifies how early the poll may start, +Ar early +specifies how early the poll may start, while -the second number specifies how late the poll may be delayed. +Ar late +specifies how late the poll may be delayed. With no arguments, internally specified default values are chosen. .It Xo Ic reset .Oo @@ -3290,7 +3302,7 @@ A snapshot of this documentation is available in HTML format in .Sh "AUTHORS" The University of Delaware and Network Time Foundation .Sh "COPYRIGHT" -Copyright (C) 1992\-2020 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992\-2023 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, . .Sh BUGS The syntax checking is not picky; some combinations of @@ -3304,7 +3316,7 @@ certificates. These should be obtained via secure directory services when they become universally available. .Pp -Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org +Please send bug reports to: https://bugs.ntp.org, bugs@ntp.org .Sh NOTES This document was derived from FreeBSD. .Pp diff --git a/ntpd/ntp.conf.def b/ntpd/ntp.conf.def index c1e472276fbe..03dd8b808099 100644 --- a/ntpd/ntp.conf.def +++ b/ntpd/ntp.conf.def @@ -1528,17 +1528,27 @@ client abuse. The .Cm average subcommand specifies the minimum average packet -spacing, while the +spacing in log2 seconds, defaulting to 3 (8s), while the .Cm minimum -subcommand specifies the minimum packet spacing. +subcommand specifies the minimum packet spacing +in seconds, defaulting to 2. Packets that violate these minima are discarded and a kiss-o'-death packet returned if enabled. -The default -minimum average and minimum are 5 and 2, respectively. The .Ic monitor -subcommand specifies the probability of discard -for packets that overflow the rate-control window. +subcommand indirectly specifies the probability of +replacing the oldest entry from the monitor (MRU) +list of recent requests used to enforce rate controls, +when that list is at its maximum size. The probability +of replacing the oldest entry is the age of that entry +in seconds divided by the +.Ic monitor +value, default 3000. For example, if the oldest entry +in the MRU list represents a request 300 seconds ago, +by default the probability of replacing it with an +entry representing the client request being processed +now is 10%. Conversely, if the oldest entry is more +than 3000 seconds old, the probability is 100%. .It Xo Ic restrict address .Op Cm mask Ar mask .Op Cm ippeerlimit Ar int @@ -2935,12 +2945,12 @@ The number can contain other modem control codes as well. .It Xo Cm pollskewlist .Oo .Ar poll -.Ar value | value +.Ar early late .Oc .Ar ... .Oo .Cm default -.Ar value | value +.Ar early late .Oc .Xc Enable skewing of our poll requests to our servers. @@ -2953,9 +2963,11 @@ a poll interval of 17 corresponds to 131,072 seconds, or about a day and a half. The next two numbers must be between 0 and one-half of the poll interval, inclusive. -The first number specifies how early the poll may start, +Ar early +specifies how early the poll may start, while -the second number specifies how late the poll may be delayed. +Ar late +specifies how late the poll may be delayed. With no arguments, internally specified default values are chosen. .It Xo Ic reset .Oo diff --git a/ntpd/ntp.conf.html b/ntpd/ntp.conf.html index 686ec9981104..bda4b750d4f5 100644 --- a/ntpd/ntp.conf.html +++ b/ntpd/ntp.conf.html @@ -1,6 +1,6 @@ - + NTP Configuration File User’s Manual @@ -16,23 +16,14 @@ + NTP Symmetric Key @@ -16,23 +16,14 @@ + ntpd: Network Time Protocol (NTP) Daemon User’s Manual @@ -16,23 +16,14 @@ + ntpdc: NTPD Control User’s Manual @@ -16,23 +16,14 @@ + ntpq: Network Time Protocol Query User’s Manual @@ -16,23 +16,14 @@ + ntpsnmpd: Network Time Protocol SNMP Daemon User’s Manual @@ -16,23 +16,14 @@ + calc_tickadj User’s Manual @@ -16,23 +16,14 @@ + Ntp-wait User’s Manual @@ -16,23 +16,14 @@ + ntpsweep User’s Manual @@ -16,23 +16,14 @@ + Ntptrace User’s Manual @@ -16,23 +16,14 @@ + Plot_summary User’s Manual @@ -16,23 +16,14 @@ + Summary User’s Manual @@ -16,23 +16,14 @@ + update-leap User’s Manual @@ -16,23 +16,14 @@ .<-- did not match\n", stderr ); return 1; } - return 0; }])], + return 0; }] )], [libopts_cv_with_libregex=yes], [libopts_cv_with_libregex=no], - [libopts_cv_with_libregex=no]) # end of AC_RUN_IFELSE + [libopts_cv_with_libregex=no]) # end of AC_RUN_IFELSE ]) # end of AC_CACHE_VAL for libopts_cv_with_libregex fi ## disabled by request AC_MSG_RESULT([${libopts_cv_with_libregex}]) @@ -265,7 +259,7 @@ AC_DEFUN([LIBOPTS_RUN_PATHFIND],[ int main (int argc, char ** argv) { char * pz = pathfind( getenv( "PATH" ), "sh", "x" ); return (pz == 0) ? 1 : 0; -}])], +}] )], [libopts_cv_run_pathfind=yes],[libopts_cv_run_pathfind=no],[libopts_cv_run_pathfind=no] ) # end of RUN_IFELSE ]) # end of AC_CACHE_VAL for libopts_cv_run_pathfind @@ -313,7 +307,7 @@ choke me!! @%:@endif char *pz = realpath(argv@<:@0@:>@, zPath); return (pz == zPath) ? 0 : 1; -}])], +}] )], [libopts_cv_run_realpath=yes],[libopts_cv_run_realpath=no],[libopts_cv_run_realpath=no] ) # end of RUN_IFELSE ]) # end of AC_CACHE_VAL for libopts_cv_run_realpath @@ -346,7 +340,7 @@ int main() { tm.tm_yday = 239; /* days since January 1 @<:@0, 365@:>@ */ tm.tm_isdst = 1; /* flag for daylight savings time */ strftime( t_buf, sizeof( t_buf ), "%A %b %d %j", &tm ); - return (strcmp( t_buf, z ) != 0); }])], + return (strcmp( t_buf, z ) != 0); }] )], [libopts_cv_run_strftime=yes],[libopts_cv_run_strftime=no],[libopts_cv_run_strftime=no] ) # end of RUN_IFELSE ]) # end of AC_CACHE_VAL for libopts_cv_run_strftime @@ -366,7 +360,7 @@ AC_DEFUN([LIBOPTS_RUN_FOPEN_BINARY],[ AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include int main (int argc, char ** argv) { FILE * fp = fopen("conftest.@S|@ac_ext", "rb"); -return (fp == NULL) ? 1 : fclose(fp); }])], +return (fp == NULL) ? 1 : fclose(fp); }] )], [libopts_cv_run_fopen_binary=yes],[libopts_cv_run_fopen_binary=no],[libopts_cv_run_fopen_binary=no] ) # end of RUN_IFELSE ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_binary @@ -389,7 +383,7 @@ AC_DEFUN([LIBOPTS_RUN_FOPEN_TEXT],[ AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include int main (int argc, char ** argv) { FILE * fp = fopen("conftest.@S|@ac_ext", "rt"); -return (fp == NULL) ? 1 : fclose(fp); }])], +return (fp == NULL) ? 1 : fclose(fp); }] )], [libopts_cv_run_fopen_text=yes],[libopts_cv_run_fopen_text=no],[libopts_cv_run_fopen_text=no] ) # end of RUN_IFELSE ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_text @@ -461,7 +455,7 @@ dnl the config tests that the library needs. Invoke the dnl "INVOKE_LIBOPTS_MACROS" macro iff we are building libopts. dnl dnl This file is part of AutoGen. -dnl AutoGen Copyright (C) 1992-2015 by Bruce Korb - all rights reserved +dnl AutoGen Copyright (C) 1992-2018 by Bruce Korb - all rights reserved dnl dnl AutoGen is free software: you can redistribute it and/or modify it dnl under the terms of the GNU General Public License as published by the diff --git a/sntp/libopts/m4/liboptschk.m4 b/sntp/libopts/m4/liboptschk.m4 index 34d5658c2ff1..9d107d696212 100644 --- a/sntp/libopts/m4/liboptschk.m4 +++ b/sntp/libopts/m4/liboptschk.m4 @@ -1,5 +1,5 @@ # liboptschk.m4 serial 2 (autogen - 5.11.4) -dnl Copyright (C) 2005-2015 by Bruce Korb - all rights reserved +dnl Copyright (C) 2005-2018 by Bruce Korb - all rights reserved dnl dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/sntp/libopts/m4/stdnoreturn.m4 b/sntp/libopts/m4/stdnoreturn.m4 index 003941164f11..a7ce376428eb 100644 --- a/sntp/libopts/m4/stdnoreturn.m4 +++ b/sntp/libopts/m4/stdnoreturn.m4 @@ -1,6 +1,6 @@ # Check for stdnoreturn.h that conforms to C11. -dnl Copyright 2012-2015 Free Software Foundation, Inc. +dnl Copyright 2012-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -9,33 +9,43 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_STDNORETURN_H], [ - AC_CACHE_CHECK([for working stdnoreturn.h], - [gl_cv_header_working_stdnoreturn_h], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include - #include - /* Do not check for 'noreturn' after the return type. - C11 allows it, but it's rarely done that way - and circa-2012 bleeding-edge GCC rejects it when given - -Werror=old-style-declaration. */ - noreturn void foo1 (void) { exit (0); } - _Noreturn void foo2 (void) { exit (0); } - int testit (int argc, char **argv) { - if (argc & 1) - return 0; - (argv[0][0] ? foo1 : foo2) (); - } - ]])], - [gl_cv_header_working_stdnoreturn_h=yes], - [gl_cv_header_working_stdnoreturn_h=no])]) - - if test $gl_cv_header_working_stdnoreturn_h = yes; then - STDNORETURN_H='' - else - STDNORETURN_H='stdnoreturn.h' - fi - + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + cygwin*) + dnl Regardless whether a working exists or not, + dnl we need our own , because of the definition + dnl of _Noreturn done by gnulib-common.m4. + STDNORETURN_H='stdnoreturn.h' + ;; + *) + AC_CACHE_CHECK([for working stdnoreturn.h], + [gl_cv_header_working_stdnoreturn_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + /* Do not check for 'noreturn' after the return type. + C11 allows it, but it's rarely done that way + and circa-2012 bleeding-edge GCC rejects it when given + -Werror=old-style-declaration. */ + noreturn void foo1 (void) { exit (0); } + _Noreturn void foo2 (void) { exit (0); } + int testit (int argc, char **argv) + { + if (argc & 1) + return 0; + (argv[0][0] ? foo1 : foo2) (); + } + ]])], + [gl_cv_header_working_stdnoreturn_h=yes], + [gl_cv_header_working_stdnoreturn_h=no])]) + if test $gl_cv_header_working_stdnoreturn_h = yes; then + STDNORETURN_H='' + else + STDNORETURN_H='stdnoreturn.h' + fi + ;; + esac AC_SUBST([STDNORETURN_H]) AM_CONDITIONAL([GL_GENERATE_STDNORETURN_H], [test -n "$STDNORETURN_H"]) ]) diff --git a/sntp/libopts/makeshell.c b/sntp/libopts/makeshell.c index fbe8e171de0d..8541c1ff68d9 100644 --- a/sntp/libopts/makeshell.c +++ b/sntp/libopts/makeshell.c @@ -11,7 +11,7 @@ /* * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control @@ -35,45 +35,7 @@ #define UPPER(_c) (toupper(to_uchar(_c))) #define LOWER(_c) (tolower(to_uchar(_c))) -/* = = = START-STATIC-FORWARD = = = */ -static void -emit_var_text(char const * prog, char const * var, int fdin); - -static void -text_to_var(tOptions * opts, teTextTo which, tOptDesc * od); - -static void -emit_usage(tOptions * opts); - -static void -emit_wrapup(tOptions * opts); - -static void -emit_setup(tOptions * opts); - -static void -emit_action(tOptions * opts, tOptDesc * od); - -static void -emit_inaction(tOptions * opts, tOptDesc * od); - -static void -emit_flag(tOptions * opts); - -static void -emit_match_expr(char const * name, tOptDesc * cod, tOptions * opts); - -static void -emit_long(tOptions * opts); - -static char * -load_old_output(char const * fname, char const * pname); - -static void -open_out(char const * fname, char const * pname); -/* = = = END-STATIC-FORWARD = = = */ - -LOCAL noreturn void +lo_noreturn static void option_exits(int exit_code) { if (print_exit) @@ -81,21 +43,21 @@ option_exits(int exit_code) exit(exit_code); } -LOCAL noreturn void +lo_noreturn static void ao_bug(char const * msg) { fprintf(stderr, zao_bug_msg, msg); option_exits(EX_SOFTWARE); } -LOCAL void +static void fserr_warn(char const * prog, char const * op, char const * fname) { fprintf(stderr, zfserr_fmt, prog, errno, strerror(errno), op, fname); } -LOCAL noreturn void +lo_noreturn static void fserr_exit(char const * prog, char const * op, char const * fname) { fserr_warn(prog, op, fname); @@ -322,11 +284,11 @@ text_to_var(tOptions * opts, teTextTo which, tOptDesc * od) switch (which) { case TT_LONGUSAGE: (*(opts->pUsageProc))(opts, EXIT_SUCCESS); - /* NOTREACHED */ + /* FALLTHROUGH */ /* NOTREACHED */ case TT_USAGE: (*(opts->pUsageProc))(opts, EXIT_FAILURE); - /* NOTREACHED */ + /* FALLTHROUGH */ /* NOTREACHED */ case TT_VERSION: if (od->fOptState & OPTST_ALLOC_ARG) { @@ -335,13 +297,13 @@ text_to_var(tOptions * opts, teTextTo which, tOptDesc * od) } od->optArg.argString = "c"; optionPrintVersion(opts, od); - /* NOTREACHED */ + /* FALLTHROUGH */ /* NOTREACHED */ default: option_exits(EXIT_FAILURE); - /* NOTREACHED */ + /* FALLTHROUGH */ /* NOTREACHED */ } - /* NOTREACHED */ + /* FALLTHROUGH */ /* NOTREACHED */ default: close(fdpair[1]); @@ -401,7 +363,7 @@ emit_usage(tOptions * opts) /* Copy the program name into the time/name buffer */ for (;;) { - if ((*pzPN++ = (char)tolower((unsigned char)*pz++)) == NUL) + if ((*pzPN++ = (char)tolower(*pz++)) == NUL) break; } @@ -671,8 +633,8 @@ emit_match_expr(char const * name, tOptDesc * cod, tOptions * opts) continue; match_ct = 0; - while ( toupper((unsigned char)od->pz_DisableName[match_ct]) - == toupper((unsigned char)name[match_ct])) + while ( toupper(od->pz_DisableName[match_ct]) + == toupper(name[match_ct])) match_ct++; if (match_ct > min_match_ct) min_match_ct = match_ct; @@ -885,13 +847,12 @@ genshelloptUsage(tOptions * opts, int exit_cd) switch (fork()) { case -1: optionUsage(opts, EXIT_FAILURE); - /* NOTREACHED */ + /* FALLTHROUGH */ /* NOTREACHED */ case 0: pagerState = PAGER_STATE_CHILD; optionUsage(opts, EXIT_SUCCESS); - /* NOTREACHED */ - _exit(EXIT_FAILURE); + /* FALLTHROUGH */ /* NOTREACHED */ default: { @@ -930,6 +891,7 @@ genshelloptUsage(tOptions * opts, int exit_cd) /*FALLTHROUGH*/ case -1: optionUsage(optionParseShellOptions, EXIT_FAILURE); + /* FALLTHROUGH */ /* NOTREACHED */ default: { diff --git a/sntp/libopts/nested.c b/sntp/libopts/nested.c index aaf089f543d8..e7604506781b 100644 --- a/sntp/libopts/nested.c +++ b/sntp/libopts/nested.c @@ -12,7 +12,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control @@ -37,7 +37,7 @@ typedef struct { char xml_txt[8]; } xml_xlate_t; -static xml_xlate_t const xml_xlate[] = { + static xml_xlate_t const xml_xlate[] = { { '&', 4, "amp;" }, { '<', 3, "lt;" }, { '>', 3, "gt;" }, @@ -49,48 +49,6 @@ static xml_xlate_t const xml_xlate[] = { #define ENOMSG ENOENT #endif -/* = = = START-STATIC-FORWARD = = = */ -static void -remove_continuation(char * src); - -static char const * -scan_q_str(char const * pzTxt); - -static tOptionValue * -add_string(void ** pp, char const * name, size_t nm_len, - char const * val, size_t d_len); - -static tOptionValue * -add_bool(void ** pp, char const * name, size_t nm_len, - char const * val, size_t d_len); - -static tOptionValue * -add_number(void ** pp, char const * name, size_t nm_len, - char const * val, size_t d_len); - -static tOptionValue * -add_nested(void ** pp, char const * name, size_t nm_len, - char * val, size_t d_len); - -static char const * -scan_name(char const * name, tOptionValue * res); - -static char const * -unnamed_xml(char const * txt); - -static char const * -scan_xml_name(char const * name, size_t * nm_len, tOptionValue * val); - -static char const * -find_end_xml(char const * src, size_t nm_len, char const * val, size_t * len); - -static char const * -scan_xml(char const * xml_name, tOptionValue * res_val); - -static void -sort_list(tArgList * arg_list); -/* = = = END-STATIC-FORWARD = = = */ - /** * Backslashes are used for line continuations. We keep the newline * characters, but trim out the backslash: @@ -638,7 +596,7 @@ scan_xml(char const * xml_name, tOptionValue * res_val) * an internal call, so it is not validated. The caller is responsible for * knowing what they are doing. */ -LOCAL void +static void unload_arg_list(tArgList * arg_list) { int ct = arg_list->useCt; @@ -743,7 +701,7 @@ sort_list(tArgList * arg_list) * @code{ENOMSG} no configuration values were found * @end itemize =*/ -LOCAL tOptionValue * +static tOptionValue * optionLoadNested(char const * text, char const * name, size_t nm_len) { tOptionValue * res_val; @@ -783,12 +741,23 @@ optionLoadNested(char const * text, char const * name, size_t nm_len) text = scan_name(text, res_val); else switch (*text) { - case NUL: goto scan_done; - case '<': text = scan_xml(text, res_val); - if (text == NULL) goto woops; - if (*text == ',') text++; break; - case '#': text = strchr(text, NL); break; - default: goto woops; + case NUL: + goto scan_done; + + case '<': + text = scan_xml(text, res_val); + if (text == NULL) + goto woops; + if (*text == ',') + text++; + break; + + case '#': + text = strchr(text, NL); + break; + + default: + goto woops; } } while (text != NULL); scan_done:; @@ -855,11 +824,10 @@ optionNestedVal(tOptions * opts, tOptDesc * od) /** * get_special_char */ -LOCAL int +static int get_special_char(char const ** ppz, int * ct) { char const * pz = *ppz; - char * rz; if (*ct < 3) return '&'; @@ -873,8 +841,7 @@ get_special_char(char const ** ppz, int * ct) base = 16; pz++; } - retch = (int)strtoul(pz, &rz, base); - pz = rz; + retch = (int)strtoul(pz, (char **)&pz, base); if (*pz != ';') return '&'; base = (int)(++pz - *ppz); @@ -909,7 +876,7 @@ get_special_char(char const ** ppz, int * ct) /** * emit_special_char */ -LOCAL void +static void emit_special_char(FILE * fp, int ch) { int ctr = sizeof(xml_xlate) / sizeof(xml_xlate[0]); diff --git a/sntp/libopts/numeric.c b/sntp/libopts/numeric.c index ab8f3d1958be..bbb43ccdcd1e 100644 --- a/sntp/libopts/numeric.c +++ b/sntp/libopts/numeric.c @@ -10,7 +10,7 @@ /* * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control @@ -124,7 +124,8 @@ optionNumericVal(tOptions * opts, tOptDesc * od) */ if ( (od == NULL) || (od->optArg.argString == NULL) - || ((od->fOptState & OPTST_RESET) != 0)) + || ((od->fOptState & OPTST_RESET) != 0) + || (opts <= OPTPROC_EMIT_LIMIT)) return; errno = 0; @@ -135,14 +136,14 @@ optionNumericVal(tOptions * opts, tOptDesc * od) if ((od->fOptState & OPTST_SCALED_NUM) != 0) switch (*(pz++)) { case NUL: pz--; break; - case 't': val *= 1000; - case 'g': val *= 1000; - case 'm': val *= 1000; + case 't': val *= 1000; /* FALLTHROUGH */ + case 'g': val *= 1000; /* FALLTHROUGH */ + case 'm': val *= 1000; /* FALLTHROUGH */ case 'k': val *= 1000; break; - case 'T': val *= 1024; - case 'G': val *= 1024; - case 'M': val *= 1024; + case 'T': val *= 1024; /* FALLTHROUGH */ + case 'G': val *= 1024; /* FALLTHROUGH */ + case 'M': val *= 1024; /* FALLTHROUGH */ case 'K': val *= 1024; break; default: goto bad_number; diff --git a/sntp/libopts/option-value-type.c b/sntp/libopts/option-value-type.c index 5f676408ae00..2bc8642809c9 100644 --- a/sntp/libopts/option-value-type.c +++ b/sntp/libopts/option-value-type.c @@ -31,7 +31,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "option-value-type.h" -/* ANSI-C code produced by gperf version 3.0.4 */ +/* ANSI-C code produced by gperf version 3.1 */ /* Command-line: gperf option-value-type.gp */ /* Computed positions: -k'1' */ @@ -64,7 +64,7 @@ typedef struct { /* maximum key range = 15, duplicates = 0 */ static unsigned int -option_value_type_hash (register const char *str, register unsigned int len) +option_value_type_hash (register const char *str, register size_t len) { static const unsigned char asso_values[] = { @@ -119,13 +119,13 @@ static const option_value_type_map_t option_value_type_table[] = }; static inline const option_value_type_map_t * -find_option_value_type_name (register const char *str, register unsigned int len) +find_option_value_type_name (register const char *str, register size_t len) { if (len <= 14 && len >= 3) { - register int key = (int)option_value_type_hash (str, len); + register unsigned int key = (int)option_value_type_hash (str, len); - if (key <= 17 && key >= 0) + if (key <= 17) { register const char *s = option_value_type_table[key].vtp_name; diff --git a/sntp/libopts/option-xat-attribute.c b/sntp/libopts/option-xat-attribute.c index be86041fd816..a34ab1b5b2c0 100644 --- a/sntp/libopts/option-xat-attribute.c +++ b/sntp/libopts/option-xat-attribute.c @@ -31,7 +31,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "option-xat-attribute.h" -/* ANSI-C code produced by gperf version 3.0.4 */ +/* ANSI-C code produced by gperf version 3.1 */ /* Command-line: gperf option-xat-attribute.gp */ /* Computed positions: -k'1' */ @@ -64,7 +64,7 @@ typedef struct { /* maximum key range = 6, duplicates = 0 */ static unsigned int -option_xat_attribute_hash (register const char *str, register unsigned int len) +option_xat_attribute_hash (register const char *str, register size_t len) { static const unsigned char asso_values[] = { @@ -111,13 +111,13 @@ static const option_xat_attribute_map_t option_xat_attribute_table[] = }; static inline const option_xat_attribute_map_t * -find_option_xat_attribute_name (register const char *str, register unsigned int len) +find_option_xat_attribute_name (register const char *str, register size_t len) { if (len <= 8 && len >= 4) { - register int key = (int)option_xat_attribute_hash (str, len); + register unsigned int key = (int)option_xat_attribute_hash (str, len); - if (key <= 9 && key >= 0) + if (key <= 9) { register const char *s = option_xat_attribute_table[key].xat_name; diff --git a/sntp/libopts/parse-duration.c b/sntp/libopts/parse-duration.c index 11e3d828d897..0f4a05634b9b 100644 --- a/sntp/libopts/parse-duration.c +++ b/sntp/libopts/parse-duration.c @@ -1,5 +1,5 @@ /* Parse a time duration and return a seconds count - Copyright (C) 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2008-2018 Free Software Foundation, Inc. Written by Bruce Korb , 2008. This program is free software: you can redistribute it and/or modify @@ -13,7 +13,7 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ + along with this program. If not, see . */ #include @@ -60,20 +60,14 @@ typedef enum { static unsigned long str_const_to_ul (cch_t * str, cch_t ** ppz, int base) { - char * pz; - int rv = strtoul (str, &pz, base); - *ppz = pz; - return rv; + return strtoul (str, (char **)ppz, base); } /* Wrapper around strtol that does not require a cast. */ static long str_const_to_l (cch_t * str, cch_t ** ppz, int base) { - char * pz; - int rv = strtol (str, &pz, base); - *ppz = pz; - return rv; + return strtol (str, (char **)ppz, base); } /* Returns BASE + VAL * SCALE, interpreting BASE = BAD_TIME diff --git a/sntp/libopts/parse-duration.h b/sntp/libopts/parse-duration.h index 33ddc3366e9f..9a7bcd5e100f 100644 --- a/sntp/libopts/parse-duration.h +++ b/sntp/libopts/parse-duration.h @@ -1,5 +1,5 @@ /* Parse a time duration and return a seconds count - Copyright (C) 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2008-2018 Free Software Foundation, Inc. Written by Bruce Korb , 2008. This program is free software: you can redistribute it and/or modify @@ -13,7 +13,7 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ + along with this program. If not, see . */ /* @@ -22,7 +22,7 @@ At the time of writing, this worked: - http://en.wikipedia.org/wiki/ISO_8601#Durations + https://en.wikipedia.org/wiki/ISO_8601#Durations The string must start with a 'P', 'T' or a digit. diff --git a/sntp/libopts/pgusage.c b/sntp/libopts/pgusage.c index 3d229c18d058..f895b3bb56d0 100644 --- a/sntp/libopts/pgusage.c +++ b/sntp/libopts/pgusage.c @@ -13,7 +13,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/proto.h b/sntp/libopts/proto.h index a78b794fc6a5..49c75bb5dbbb 100644 --- a/sntp/libopts/proto.h +++ b/sntp/libopts/proto.h @@ -1,19 +1,20 @@ /* -*- buffer-read-only: t -*- vi: set ro: * * Prototypes for autoopts - * Generated Sat Apr 25 09:53:18 PDT 2015 + * Generated Sun Aug 26 10:44:39 PDT 2018 */ #ifndef AUTOOPTS_PROTO_H_GUARD #define AUTOOPTS_PROTO_H_GUARD 1 + /* - * Extracted from alias.c + * Static declarations from alias.c */ static tSuccess too_many_occurrences(tOptions * opts, tOptDesc * od); /* - * Extracted from autoopts.c + * Static declarations from autoopts.c */ static void * ao_malloc(size_t sz); @@ -34,14 +35,53 @@ static tSuccess regular_opts(tOptions * opts); /* - * Extracted from check.c + * Static declarations from check.c */ +static bool +has_conflict(tOptions * pOpts, tOptDesc * od); + +static bool +occurs_enough(tOptions * pOpts, tOptDesc * pOD); + static bool is_consistent(tOptions * pOpts); /* - * Extracted from configfile.c + * Static declarations from configfile.c */ +static void +file_preset(tOptions * opts, char const * fname, int dir); + +static char * +handle_comment(char * txt); + +static char * +handle_cfg(tOptions * opts, tOptState * ost, char * txt, int dir); + +static char * +handle_directive(tOptions * opts, char * txt); + +static char * +aoflags_directive(tOptions * opts, char * txt); + +static char * +program_directive(tOptions * opts, char * txt); + +static char * +handle_section(tOptions * opts, char * txt); + +static int +parse_xml_encoding(char ** ppz); + +static char * +trim_xml_text(char * intxt, char const * pznm, tOptionLoadMode mode); + +static void +cook_xml_text(char * pzData); + +static char * +handle_struct(tOptions * opts, tOptState * ost, char * txt, int dir); + static void intern_file_load(tOptions * opts); @@ -49,24 +89,112 @@ static char const * parse_attrs(tOptions * opts, char const * txt, tOptionLoadMode * pMode, tOptionValue * pType); +static char const * +parse_keyword(tOptions * opts, char const * txt, tOptionValue * typ); + +static char const * +parse_set_mem(tOptions * opts, char const * txt, tOptionValue * typ); + +static char const * +parse_value(char const * txt, tOptionValue * typ); + /* - * Extracted from env.c + * Static declarations from cook.c + */ +static char * +nl_count(char * start, char * end, int * lnct_p); + +static bool +contiguous_quote(char ** pps, char * pq, int * lnct_p); + +/* + * Static declarations from enum.c + */ +static void +enum_err(tOptions * pOpts, tOptDesc * pOD, + char const * const * paz_names, int name_ct); + +static uintptr_t +find_name(char const * name, tOptions * pOpts, tOptDesc * pOD, + char const * const * paz_names, unsigned int name_ct); + +static void +set_memb_shell(tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names, + unsigned int name_ct); + +static void +set_memb_names(tOptions * opts, tOptDesc * od, char const * const * nm_list, + unsigned int nm_ct); + +static uintptr_t +check_membership_start(tOptDesc * od, char const ** argp, bool * invert); + +static uintptr_t +find_member_bit(tOptions * opts, tOptDesc * od, char const * pz, int len, + char const * const * nm_list, unsigned int nm_ct); + +/* + * Static declarations from env.c */ static void doPrognameEnv(tOptions * pOpts, teEnvPresetType type); +static void +do_env_opt(tOptState * os, char * env_name, + tOptions * pOpts, teEnvPresetType type); + static void env_presets(tOptions * pOpts, teEnvPresetType type); /* - * Extracted from find.c + * Static declarations from file.c */ +static void +check_existence(teOptFileType ftype, tOptions * pOpts, tOptDesc * pOD); + +static void +open_file_fd(tOptions * pOpts, tOptDesc * pOD, tuFileMode mode); + +static void +fopen_file_fp(tOptions * pOpts, tOptDesc * pOD, tuFileMode mode); + +/* + * Static declarations from find.c + */ +static int +parse_opt(char const ** nm_pp, char ** arg_pp, char * buf, size_t bufsz); + +static void +opt_ambiguities(tOptions * opts, char const * name, int nm_len); + +static int +opt_match_ct(tOptions * opts, char const * name, int nm_len, + int * ixp, bool * disable); + +static tSuccess +opt_set(tOptions * opts, char * arg, int idx, bool disable, tOptState * st); + +static tSuccess +opt_unknown(tOptions * opts, char const * name, char * arg, tOptState * st); + +static tSuccess +opt_ambiguous(tOptions * opts, char const * name, int match_ct); + static tSuccess opt_find_long(tOptions * opts, char const * opt_name, tOptState * state); static tSuccess opt_find_short(tOptions * pOpts, uint_t optValue, tOptState * pOptState); +static tSuccess +get_opt_arg_must(tOptions * opts, tOptState * o_st); + +static tSuccess +get_opt_arg_may(tOptions * pOpts, tOptState * o_st); + +static tSuccess +get_opt_arg_none(tOptions * pOpts, tOptState * o_st); + static tSuccess get_opt_arg(tOptions * opts, tOptState * o_st); @@ -74,7 +202,7 @@ static tSuccess find_opt(tOptions * opts, tOptState * o_st); /* - * Extracted from init.c + * Static declarations from init.c */ static tSuccess validate_struct(tOptions * opts, char const * pname); @@ -82,40 +210,137 @@ validate_struct(tOptions * opts, char const * pname); static tSuccess immediate_opts(tOptions * opts); +static tSuccess +do_presets(tOptions * opts); + static bool ao_initialize(tOptions * opts, int a_ct, char ** a_v); /* - * Extracted from load.c + * Static declarations from load.c */ +static bool +get_realpath(char * buf, size_t b_sz); + +static bool +add_prog_path(char * buf, int b_sz, char const * fname, char const * prg_path); + +static bool +add_env_val(char * buf, int buf_sz, char const * name); + static void munge_str(char * txt, tOptionLoadMode mode); +static char * +assemble_arg_val(char * txt, tOptionLoadMode mode); + +static char * +trim_quotes(char * arg); + +static bool +direction_ok(opt_state_mask_t f, int dir); + static void load_opt_line(tOptions * opts, tOptState * opt_state, char * line, tDirection direction, tOptionLoadMode load_mode ); /* - * Extracted from makeshell.c + * Static declarations from makeshell.c */ -static noreturn void +lo_noreturn static void option_exits(int exit_code); -static noreturn void +lo_noreturn static void ao_bug(char const * msg); static void fserr_warn(char const * prog, char const * op, char const * fname); -static noreturn void +lo_noreturn static void fserr_exit(char const * prog, char const * op, char const * fname); +static void +emit_var_text(char const * prog, char const * var, int fdin); + +static void +text_to_var(tOptions * opts, teTextTo which, tOptDesc * od); + +static void +emit_usage(tOptions * opts); + +static void +emit_wrapup(tOptions * opts); + +static void +emit_setup(tOptions * opts); + +static void +emit_action(tOptions * opts, tOptDesc * od); + +static void +emit_inaction(tOptions * opts, tOptDesc * od); + +static void +emit_flag(tOptions * opts); + +static void +emit_match_expr(char const * name, tOptDesc * cod, tOptions * opts); + +static void +emit_long(tOptions * opts); + +static char * +load_old_output(char const * fname, char const * pname); + +static void +open_out(char const * fname, char const * pname); + /* - * Extracted from nested.c + * Static declarations from nested.c */ +static void +remove_continuation(char * src); + +static char const * +scan_q_str(char const * pzTxt); + +static tOptionValue * +add_string(void ** pp, char const * name, size_t nm_len, + char const * val, size_t d_len); + +static tOptionValue * +add_bool(void ** pp, char const * name, size_t nm_len, + char const * val, size_t d_len); + +static tOptionValue * +add_number(void ** pp, char const * name, size_t nm_len, + char const * val, size_t d_len); + +static tOptionValue * +add_nested(void ** pp, char const * name, size_t nm_len, + char * val, size_t d_len); + +static char const * +scan_name(char const * name, tOptionValue * res); + +static char const * +unnamed_xml(char const * txt); + +static char const * +scan_xml_name(char const * name, size_t * nm_len, tOptionValue * val); + +static char const * +find_end_xml(char const * src, size_t nm_len, char const * val, size_t * len); + +static char const * +scan_xml(char const * xml_name, tOptionValue * res_val); + static void unload_arg_list(tArgList * arg_list); +static void +sort_list(tArgList * arg_list); + static tOptionValue * optionLoadNested(char const * text, char const * name, size_t nm_len); @@ -126,21 +351,270 @@ static void emit_special_char(FILE * fp, int ch); /* - * Extracted from sort.c + * Static declarations from parse-duration.c */ +static unsigned long +str_const_to_ul (cch_t * str, cch_t ** ppz, int base); + +static long +str_const_to_l (cch_t * str, cch_t ** ppz, int base); + +static time_t +scale_n_add (time_t base, time_t val, int scale); + +static time_t +parse_hr_min_sec (time_t start, cch_t * pz); + +static time_t +parse_scaled_value (time_t base, cch_t ** ppz, cch_t * endp, int scale); + +static time_t +parse_year_month_day (cch_t * pz, cch_t * ps); + +static time_t +parse_yearmonthday (cch_t * in_pz); + +static time_t +parse_YMWD (cch_t * pz); + +static time_t +parse_hour_minute_second (cch_t * pz, cch_t * ps); + +static time_t +parse_hourminutesecond (cch_t * in_pz); + +static time_t +parse_HMS (cch_t * pz); + +static time_t +parse_time (cch_t * pz); + +static char * +trim (char * pz); + +static time_t +parse_period (cch_t * in_pz); + +static time_t +parse_non_iso8601 (cch_t * pz); + +/* + * Static declarations from pgusage.c + */ +static inline FILE * +open_tmp_usage(char ** buf); + +static inline char * +mk_pager_cmd(char const * fname); + +/* + * Static declarations from putshell.c + */ +static size_t +string_size(char const * scan, size_t nl_len); + +static char const * +print_quoted_apostrophes(char const * str); + +static void +print_quot_str(char const * str); + +static void +print_enumeration(tOptions * pOpts, tOptDesc * pOD); + +static void +print_membership(tOptions * pOpts, tOptDesc * pOD); + +static void +print_stacked_arg(tOptions * pOpts, tOptDesc * pOD); + +static void +print_reordering(tOptions * opts); + +/* + * Static declarations from reset.c + */ +static void +optionReset(tOptions * pOpts, tOptDesc * pOD); + +static void +optionResetEverything(tOptions * pOpts); + +/* + * Static declarations from restore.c + */ +static void +fixupSavedOptionArgs(tOptions * pOpts); + +/* + * Static declarations from save.c + */ +static char const * +find_dir_name(tOptions * opts, int * p_free); + +static char const * +find_file_name(tOptions * opts, int * p_free_name); + +static void +prt_entry(FILE * fp, tOptDesc * od, char const * l_arg, save_flags_mask_t save_fl); + +static void +prt_value(FILE * fp, int depth, tOptDesc * od, tOptionValue const * ovp); + +static void +prt_string(FILE * fp, char const * name, char const * pz); + +static void +prt_val_list(FILE * fp, char const * name, tArgList * al); + +static void +prt_nested(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl); + +static void +remove_settings(tOptions * opts, char const * fname); + +static FILE * +open_sv_file(tOptions * opts, save_flags_mask_t save_fl); + +static void +prt_no_arg_opt(FILE * fp, tOptDesc * vod, tOptDesc * pod, save_flags_mask_t save_fl); + +static void +prt_str_arg(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl); + +static void +prt_enum_arg(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl); + +static void +prt_set_arg(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl); + +static void +prt_file_arg(FILE * fp, tOptDesc * od, tOptions * opts, save_flags_mask_t save_fl); + +/* + * Static declarations from sort.c + */ +static tSuccess +must_arg(tOptions * opts, char * arg_txt, tOptState * pOS, + char ** opt_txt, uint32_t * opt_idx); + +static tSuccess +maybe_arg(tOptions * opts, char * arg_txt, tOptState * pOS, + char ** opt_txt, uint32_t * opt_idx); + +static tSuccess +short_opt_ck(tOptions * opts, char * arg_txt, tOptState * pOS, + char ** opt_txt, uint32_t * opt_idx); + static void optionSort(tOptions * opts); /* - * Extracted from stack.c + * Static declarations from stack.c */ static void addArgListEntry(void ** ppAL, void * entry); /* - * Extracted from usage.c + * Static declarations from text_mmap.c */ +static void +load_text_file(tmap_info_t * mapinfo, char const * pzFile); + +static void +validate_mmap(char const * fname, int prot, int flags, tmap_info_t * mapinfo); + +static void +close_mmap_files(tmap_info_t * mi); + +/* + * Static declarations from tokenize.c + */ +static void +copy_cooked(ch_t ** ppDest, char const ** ppSrc); + +static void +copy_raw(ch_t ** ppDest, char const ** ppSrc); + +static token_list_t * +alloc_token_list(char const * str); + +/* + * Static declarations from usage.c + */ +static unsigned int +parse_usage_flags(ao_flag_names_t const * fnt, char const * txt); + static void set_usage_flags(tOptions * opts, char const * flg_txt); +static inline bool +do_gnu_usage(tOptions * pOpts); + +static inline bool +skip_misuse_usage(tOptions * pOpts); + +static void +print_offer_usage(tOptions * opts); + +static void +print_usage_details(tOptions * opts, int exit_code); + +static void +print_one_paragraph(char const * text, bool plain, FILE * fp); + +static void +prt_conflicts(tOptions * opts, tOptDesc * od); + +static void +prt_one_vendor(tOptions * opts, tOptDesc * od, + arg_types_t * argtp, char const * usefmt); + +static void +prt_vendor_opts(tOptions * opts, char const * title); + +static void +prt_extd_usage(tOptions * opts, tOptDesc * od, char const * title); + +static void +prt_ini_list(char const * const * papz, char const * ini_file, + char const * path_nm); + +static void +prt_preamble(tOptions * opts, tOptDesc * od, arg_types_t * at); + +static void +prt_one_usage(tOptions * opts, tOptDesc * od, arg_types_t * at); + +static void +prt_opt_usage(tOptions * opts, int ex_code, char const * title); + +static void +prt_prog_detail(tOptions * opts); + +static int +setGnuOptFmts(tOptions * opts, char const ** ptxt); + +static int +setStdOptFmts(tOptions * opts, char const ** ptxt); + +/* + * Static declarations from version.c + */ +static void +emit_first_line( + FILE * fp, char const * alt1, char const * alt2, char const * alt3); + +static void +emit_simple_ver(tOptions * o, FILE * fp); + +static void +emit_copy_full(tOptions * o, FILE * fp); + +static void +emit_copy_note(tOptions * opts, FILE * fp); + +static void +print_ver(tOptions * opts, tOptDesc * od, FILE * fp, bool call_exit); + #endif /* AUTOOPTS_PROTO_H_GUARD */ diff --git a/sntp/libopts/putshell.c b/sntp/libopts/putshell.c index 9bfa984da67d..84463dd40be4 100644 --- a/sntp/libopts/putshell.c +++ b/sntp/libopts/putshell.c @@ -12,7 +12,7 @@ /* * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control @@ -31,29 +31,6 @@ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd */ -/* = = = START-STATIC-FORWARD = = = */ -static size_t -string_size(char const * scan, size_t nl_len); - -static char const * -print_quoted_apostrophes(char const * str); - -static void -print_quot_str(char const * str); - -static void -print_enumeration(tOptions * pOpts, tOptDesc * pOD); - -static void -print_membership(tOptions * pOpts, tOptDesc * pOD); - -static void -print_stacked_arg(tOptions * pOpts, tOptDesc * pOD); - -static void -print_reordering(tOptions * opts); -/* = = = END-STATIC-FORWARD = = = */ - /** * Count the number of bytes required to represent a string as a * compilable string. @@ -129,8 +106,10 @@ char const * optionQuoteString(char const * text, char const * nl) { size_t nl_len = strlen(nl); + size_t out_sz = string_size(text, nl_len); char * out; - char * res = out = AGALOC(string_size(text, nl_len), "quot str"); + char * res = out = AGALOC(out_sz, "quot str"); + *(out++) = '"'; for (;;) { @@ -179,16 +158,21 @@ optionQuoteString(char const * text, char const * nl) * deallocate the text string. Return the scan resumption point. */ *(out++) = '"'; - *out = NUL; + *(out++) = NUL; +#ifndef NDEBUG + if ((size_t)(out - res) > out_sz) { + fputs(misguess_len, stderr); + option_exits(EXIT_FAILURE); + } +#endif return res; default: /* * sprintf is safe here, because we already computed - * the amount of space we will be using. + * the amount of space we will be using. Assertion is above. */ - sprintf(out, MK_STR_OCT_FMT, ch); - out += 4; + out += sprintf(out, MK_STR_OCT_FMT, ch); } text++; diff --git a/sntp/libopts/reset.c b/sntp/libopts/reset.c index 97ecb52e2425..f7b58e8d1a14 100644 --- a/sntp/libopts/reset.c +++ b/sntp/libopts/reset.c @@ -10,7 +10,7 @@ /* * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control @@ -113,7 +113,7 @@ optionResetOpt(tOptions * pOpts, tOptDesc * pOD) assert(0 == 1); } } else { - succ = opt_find_long(pOpts, pzArg, &opt_state); + succ = opt_find_long(pOpts, (char *)pzArg, &opt_state); if (! SUCCESSFUL(succ)) { fprintf(stderr, zIllOptStr, pOpts->pzProgPath, pzArg); pOpts->pUsageProc(pOpts, EXIT_FAILURE); diff --git a/sntp/libopts/restore.c b/sntp/libopts/restore.c index 02ef14aeba38..36ebbce1a72f 100644 --- a/sntp/libopts/restore.c +++ b/sntp/libopts/restore.c @@ -12,7 +12,7 @@ /* * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/save-flags.c b/sntp/libopts/save-flags.c new file mode 100644 index 000000000000..d295170edbb7 --- /dev/null +++ b/sntp/libopts/save-flags.c @@ -0,0 +1,248 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (save-flags.c) + * + * It has been AutoGen-ed + * From the definitions /tmp/.ag-ufBbQe/save-flags.def + * and the template file str2enum + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name ``Bruce Korb'' nor the name of any other + * contributor may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * str2enum IS PROVIDED BY Bruce Korb ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Bruce Korb OR ANY OTHER CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "save-flags.h" +#include +#ifndef MISSING_INTTYPES_H +# include +#endif + +typedef enum { + SVFL_BNM_DEFAULT = 0, + SVFL_BNM_USAGE = 1, + SVFL_BNM_UPDATE = 2, + SVFL_COUNT_BNM +} save_flags_enum_t; + +static save_flags_enum_t +find_save_flags_bnm(char const * str, size_t len); + + +#include +#include +#ifndef NUL +#define NUL '\0' +#endif + +/* ANSI-C code produced by gperf version 3.1 */ +/* Command-line: gperf save-flags.gp */ +/* Computed positions: -k'' */ + + +# if 0 /* gperf build options: */ +// %struct-type +// %language=ANSI-C +// %includes +// %global-table +// %omit-struct-type +// %readonly-tables +// %compare-strncmp +// +// %define slot-name svfl_name +// %define hash-function-name save_flags_hash +// %define lookup-function-name find_save_flags_name +// %define word-array-name save_flags_table +// %define initializer-suffix ,SVFL_COUNT_BNM +// +# endif + +#include "save-flags.h" +typedef struct { + char const * svfl_name; + save_flags_enum_t svfl_id; +} save_flags_map_t; +#include + +/* maximum key range = 3, duplicates = 0 */ + +static unsigned int +save_flags_hash (register const char *str, register size_t len) +{ + (void)str; + (void)len; + return len; +} + +static const save_flags_map_t save_flags_table[] = + { + {"",SVFL_COUNT_BNM}, {"",SVFL_COUNT_BNM}, + {"",SVFL_COUNT_BNM}, {"",SVFL_COUNT_BNM}, + {"",SVFL_COUNT_BNM}, + {"usage", SVFL_BNM_USAGE}, + {"update", SVFL_BNM_UPDATE}, + {"default", SVFL_BNM_DEFAULT} + }; + +static inline const save_flags_map_t * +find_save_flags_name (register const char *str, register size_t len) +{ + if (len <= 7 && len >= 5) + { + register unsigned int key = (int)save_flags_hash (str, len); + + if (key <= 7) + { + register const char *s = save_flags_table[key].svfl_name; + + if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0') + return &save_flags_table[key]; + } + } + return 0; +} + +/** + * Convert a command (keyword) to a save_flags_enum_t enumeration value. + * + * @param[in] str a string that should start with a known key word. + * @param[in] len the provided length of the keyword at \a str. + * @returns the enumeration value. + * If not found, that value is SVFL_COUNT_BNM. + */ +static save_flags_enum_t +find_save_flags_bnm(char const * str, size_t len) +{ + save_flags_map_t const * map; + + map = find_save_flags_name(str, (unsigned int)len); + if (map != NULL) + return map->svfl_id; + /* Check for a partial match */ + { + /* + * Indexes of valid save_flags_table entries in sorted order: + */ + static unsigned int const ix_map[] = { + 7, 6, 5 }; + save_flags_enum_t res = SVFL_COUNT_BNM; + static int const HI = (sizeof(ix_map) / sizeof(ix_map[0])) - 1; + int lo = 0; + int hi = HI; + int av; + int cmp; + + for (;;) { + av = (hi + lo) / 2; + map = save_flags_table + ix_map[av]; + cmp = strncmp(map->svfl_name, str, len); + if (cmp == 0) break; + if (cmp > 0) + hi = av - 1; + else lo = av + 1; + if (lo > hi) + return SVFL_COUNT_BNM; + } + res = map->svfl_id; + /* + * If we have an exact match, accept it. + */ + if (map->svfl_name[len] == NUL) + return res; + /* + * Check for a duplicate partial match (a partial match + * with a higher or lower index than "av". + */ + if (av < HI) { + map = save_flags_table + ix_map[av + 1]; + if (strncmp(map->svfl_name, str, len) == 0) + return SVFL_COUNT_BNM; + } + if (av > 0) { + map = save_flags_table + ix_map[av - 1]; + if (strncmp(map->svfl_name, str, len) == 0) + return SVFL_COUNT_BNM; + } + return res; + } +} + +/** + * Convert a string to a save_flags_mask_t mask. + * Bit names prefixed with a hyphen have the bit removed from the mask. + * If the string starts with a '-', '+' or '|' character, then + * the old value is used as a base, otherwise the result mask + * is initialized to zero. Separating bit names with '+' or '|' + * characters is optional. By default, the bits are "or"-ed into the + * result. + * + * @param[in] str string with a list of bit names + * @param[in] old previous value, used if \a str starts with a '+' or '-'. + * + * @returns an unsigned integer with the bits set. + */ +save_flags_mask_t +save_flags_str2mask(char const * str, save_flags_mask_t old) +{ + static char const white[] = ", \t\f"; + static char const name_chars[] = + "adefglpstu" + "ADEFGLPSTU"; + + save_flags_mask_t res = 0; + int have_data = 0; + + for (;;) { + save_flags_enum_t val; + unsigned int val_len; + unsigned int invert = 0; + + str += strspn(str, white); + switch (*str) { + case NUL: return res; + case '-': case '~': + invert = 1; + /* FALLTHROUGH */ + + case '+': case '|': + if (have_data == 0) + res = old; + + str += 1 + strspn(str + 1, white); + if (*str == NUL) + return 0; + } + + val_len = strspn(str, name_chars); + if (val_len == 0) + return 0; + val = find_save_flags_bnm(str, val_len); + if (val == SVFL_COUNT_BNM) + return 0; + if (invert) + res &= ~((save_flags_mask_t)1 << val); + else + res |= (save_flags_mask_t)1 << val; + have_data = 1; + str += val_len; + } +} +/* end of save-flags.c */ diff --git a/sntp/libopts/save-flags.h b/sntp/libopts/save-flags.h new file mode 100644 index 000000000000..dcfe0c9ae513 --- /dev/null +++ b/sntp/libopts/save-flags.h @@ -0,0 +1,68 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (save-flags.h) + * + * It has been AutoGen-ed + * From the definitions /tmp/.ag-ufBbQe/save-flags.def + * and the template file str2enum + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name ``Bruce Korb'' nor the name of any other + * contributor may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * str2enum IS PROVIDED BY Bruce Korb ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Bruce Korb OR ANY OTHER CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Command/Keyword Dispatcher + */ +#ifndef STR2ENUM_SAVE_FLAGS_H_GUARD +#define STR2ENUM_SAVE_FLAGS_H_GUARD 1 +#include +#include + +/** integral type for holding save_flags masks */ +typedef uint32_t save_flags_mask_t; + +/** bits defined for save_flags_mask_t */ +/** include default values in commentary */ +#define SVFL_DEFAULT 0x0001U +/** include usage text in commentary */ +#define SVFL_USAGE 0x0002U +/** replace or append state */ +#define SVFL_UPDATE 0x0004U + +/** bits in USAGE_DEFAULT mask: + * usage default */ +#define SVFL_USAGE_DEFAULT_MASK 0x0003U + +/** all bits in save_flags_mask_t masks */ +#define SVFL_MASK_ALL 0x0007U + +/** no bits in save_flags_mask_t */ +#define SVFL_NONE 0x0000U + +/** buffer size needed to hold all bit names for save_flags_mask_t masks */ +#define MAX_SAVE_FLAGS_NAME_SIZE 21 + +extern save_flags_mask_t +save_flags_str2mask(char const * str, save_flags_mask_t old); + +#endif /* STR2ENUM_SAVE_FLAGS_H_GUARD */ +/* end of save-flags.h */ diff --git a/sntp/libopts/save.c b/sntp/libopts/save.c index cdab05f628ec..628c27a460bd 100644 --- a/sntp/libopts/save.c +++ b/sntp/libopts/save.c @@ -12,7 +12,7 @@ /* * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control @@ -30,131 +30,69 @@ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3 * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd */ - -/* = = = START-STATIC-FORWARD = = = */ -static char const * -find_dir_name(tOptions * opts, int * p_free); - -static char const * -find_file_name(tOptions * opts, int * p_free_name); - -static void -prt_entry(FILE * fp, tOptDesc * od, char const * l_arg); - -static void -prt_value(FILE * fp, int depth, tOptDesc * pOD, tOptionValue const * ovp); - -static void -prt_string(FILE * fp, char const * name, char const * pz); - -static void -prt_val_list(FILE * fp, char const * name, tArgList * al); - -static void -prt_nested(FILE * fp, tOptDesc * p); - -static FILE * -open_sv_file(tOptions * opts); - -static void -prt_no_arg_opt(FILE * fp, tOptDesc * p, tOptDesc * pOD); - -static void -prt_str_arg(FILE * fp, tOptDesc * pOD); - -static void -prt_enum_arg(FILE * fp, tOptDesc * od); - -static void -prt_set_arg(FILE * fp, tOptDesc * od); - -static void -prt_file_arg(FILE * fp, tOptDesc * od, tOptions * opts); -/* = = = END-STATIC-FORWARD = = = */ +#include "save-flags.h" /** + * find the config file directory name + * + * @param opts the options descriptor + * @param p_free tell caller if name was allocated or not */ static char const * find_dir_name(tOptions * opts, int * p_free) { - char const * pzDir; + char const * dir; if ( (opts->specOptIdx.save_opts == NO_EQUIVALENT) || (opts->specOptIdx.save_opts == 0)) return NULL; - pzDir = opts->pOptDesc[ opts->specOptIdx.save_opts ].optArg.argString; - if ((pzDir != NULL) && (*pzDir != NUL)) - return pzDir; + dir = opts->pOptDesc[ opts->specOptIdx.save_opts ].optArg.argString; + if ((dir != NULL) && (*dir != NUL)) { + char const * pz = strchr(dir, '>'); + if (pz == NULL) + return dir; + while (*(++pz) == '>') ; + pz += strspn(pz, " \t"); + dir = pz; + if (*dir != NUL) + return dir; + } + + if (opts->papzHomeList == NULL) + return NULL; /* * This function only works if there is a directory where * we can stash the RC (INI) file. */ - { - char const * const * papz = opts->papzHomeList; - if (papz == NULL) - return NULL; + for (int idx = 0;; idx++) { + char f_name[ AG_PATH_MAX+1 ]; - while (papz[1] != NULL) papz++; - pzDir = *papz; - } - - /* - * IF it does not require deciphering an env value, then just copy it - */ - if (*pzDir != '$') - return pzDir; - - { - char const * pzEndDir = strchr(++pzDir, DIRCH); - char * pzFileName; - char * pzEnv; - - if (pzEndDir != NULL) { - char z[ AO_NAME_SIZE ]; - if ((pzEndDir - pzDir) > AO_NAME_LIMIT ) - return NULL; - memcpy(z, pzDir, (size_t)(pzEndDir - pzDir)); - z[pzEndDir - pzDir] = NUL; - pzEnv = getenv(z); - } else { - - /* - * Make sure we can get the env value (after stripping off - * any trailing directory or file names) - */ - pzEnv = getenv(pzDir); - } - - if (pzEnv == NULL) { - fprintf(stderr, zsave_warn, opts->pzProgName); - fprintf(stderr, zNotDef, pzDir); - return NULL; - } - - if (pzEndDir == NULL) - return pzEnv; - - { - size_t sz = strlen(pzEnv) + strlen(pzEndDir) + 2; - pzFileName = (char *)AGALOC(sz, "dir name"); - } - - if (pzFileName == NULL) - return NULL; - - *p_free = 1; - /* - * Glue together the full name into the allocated memory. - * FIXME: We lose track of this memory. - */ - sprintf(pzFileName, "%s/%s", pzEnv, pzEndDir); - return pzFileName; + dir = opts->papzHomeList[idx]; + + switch (*dir) { + case '$': + break; + case NUL: + continue; + default: + return dir; + } + if (optionMakePath(f_name, (int)sizeof(f_name), dir, opts->pzProgPath)) { + *p_free = true; + AGDUPSTR(dir, f_name, "homerc"); + return dir; + } } + return NULL; } /** + * Find the name of the save-the-options file + * + * @param opts the options descriptor + * @param p_free_name tell caller if name was allocated or not */ static char const * find_file_name(tOptions * opts, int * p_free_name) @@ -162,15 +100,15 @@ find_file_name(tOptions * opts, int * p_free_name) struct stat stBuf; int free_dir_name = 0; - char const * pzDir = find_dir_name(opts, &free_dir_name); - if (pzDir == NULL) - return NULL; + char const * res = find_dir_name(opts, &free_dir_name); + if (res == NULL) + return res; /* * See if we can find the specified directory. We use a once-only loop * structure so we can bail out early. */ - if (stat(pzDir, &stBuf) != 0) do { + if (stat(res, &stBuf) != 0) do { char z[AG_PATH_MAX]; char * dirchp; @@ -180,10 +118,10 @@ find_file_name(tOptions * opts, int * p_free_name) */ if (errno != ENOENT) { bogus_name: - fprintf(stderr, zsave_warn, opts->pzProgName); - fprintf(stderr, zNoStat, errno, strerror(errno), pzDir); + fprintf(stderr, zsave_warn, opts->pzProgName, res); + fprintf(stderr, zNoStat, errno, strerror(errno), res); if (free_dir_name) - AGFREE(pzDir); + AGFREE(res); return NULL; } @@ -191,17 +129,17 @@ find_file_name(tOptions * opts, int * p_free_name) * Strip off the last component, stat the remaining string and * that string must name a directory */ - dirchp = strrchr(pzDir, DIRCH); + dirchp = strrchr(res, DIRCH); if (dirchp == NULL) { stBuf.st_mode = S_IFREG; break; /* found directory -- viz., "." */ } - if ((size_t)(dirchp - pzDir) >= sizeof(z)) + if ((size_t)(dirchp - res) >= sizeof(z)) goto bogus_name; - memcpy(z, pzDir, (size_t)(dirchp - pzDir)); - z[dirchp - pzDir] = NUL; + memcpy(z, res, (size_t)(dirchp - res)); + z[dirchp - res] = NUL; if ((stat(z, &stBuf) != 0) || ! S_ISDIR(stBuf.st_mode)) goto bogus_name; @@ -213,18 +151,17 @@ find_file_name(tOptions * opts, int * p_free_name) * THEN tack on the config file name */ if (S_ISDIR(stBuf.st_mode)) { - size_t sz = strlen(pzDir) + strlen(opts->pzRcName) + 2; { + size_t sz = strlen(res) + strlen(opts->pzRcName) + 2; char * pzPath = (char *)AGALOC(sz, "file name"); -#ifdef HAVE_SNPRINTF - snprintf(pzPath, sz, "%s/%s", pzDir, opts->pzRcName); -#else - sprintf(pzPath, "%s/%s", pzDir, opts->pzRcName); -#endif + if ( snprintf(pzPath, sz, "%s/%s", res, opts->pzRcName) + >= (int)sz) + option_exits(EXIT_FAILURE); + if (free_dir_name) - AGFREE(pzDir); - pzDir = pzPath; + AGFREE(res); + res = pzPath; free_dir_name = 1; } @@ -232,12 +169,12 @@ find_file_name(tOptions * opts, int * p_free_name) * IF we cannot stat the object for any reason other than * it does not exist, then we bail out */ - if (stat(pzDir, &stBuf) != 0) { + if (stat(res, &stBuf) != 0) { if (errno != ENOENT) { - fprintf(stderr, zsave_warn, opts->pzProgName); + fprintf(stderr, zsave_warn, opts->pzProgName, res); fprintf(stderr, zNoStat, errno, strerror(errno), - pzDir); - AGFREE(pzDir); + res); + AGFREE(res); return NULL; } @@ -253,32 +190,37 @@ find_file_name(tOptions * opts, int * p_free_name) * or will soon be a file. */ if (! S_ISREG(stBuf.st_mode)) { - fprintf(stderr, zsave_warn, opts->pzProgName, pzDir); + fprintf(stderr, zsave_warn, opts->pzProgName, res); if (free_dir_name) - AGFREE(pzDir); + AGFREE(res); return NULL; } /* * Get rid of the old file */ - unlink(pzDir); *p_free_name = free_dir_name; - return pzDir; + return res; } /** * print one option entry to the save file. * - * @param[in] fp the file pointer for the save file - * @param[in] od the option descriptor to print - * @param[in] l_arg the last argument for the option + * @param[in] fp the file pointer for the save file + * @param[in] od the option descriptor to print + * @param[in] l_arg the last argument for the option + * @param[in] save_fl include usage in comments */ static void -prt_entry(FILE * fp, tOptDesc * od, char const * l_arg) +prt_entry(FILE * fp, tOptDesc * od, char const * l_arg, save_flags_mask_t save_fl) { int space_ct; + if (save_fl & SVFL_USAGE) + fprintf(fp, ao_name_use_fmt, od->pz_Name, od->pzText); + if (UNUSED_OPT(od) && (save_fl & SVFL_DEFAULT)) + fputs(ao_default_use, fp); + /* * There is an argument. Pad the name so values line up. * Not disabled *OR* this got equivalenced to another opt, @@ -287,9 +229,14 @@ prt_entry(FILE * fp, tOptDesc * od, char const * l_arg) */ { char const * pz = - (! DISABLED_OPT(od) || (od->optEquivIndex != NO_EQUIVALENT)) + (od->pz_DisableName == NULL) ? od->pz_Name - : od->pz_DisableName; + : (DISABLED_OPT(od) + ? od->pz_DisableName + : ((od->optEquivIndex == NO_EQUIVALENT) + ? od->pz_Name : od->pz_DisableName) + ); + space_ct = 17 - strlen(pz); fputs(pz, fp); } @@ -338,9 +285,13 @@ prt_entry(FILE * fp, tOptDesc * od, char const * l_arg) } /** + * print an option's value + * + * @param[in] fp the file pointer for the save file + * @param[in] od the option descriptor to print */ static void -prt_value(FILE * fp, int depth, tOptDesc * pOD, tOptionValue const * ovp) +prt_value(FILE * fp, int depth, tOptDesc * od, tOptionValue const * ovp) { while (--depth >= 0) putc(' ', fp), putc(' ', fp); @@ -357,9 +308,9 @@ prt_value(FILE * fp, int depth, tOptDesc * pOD, tOptionValue const * ovp) case OPARG_TYPE_ENUMERATION: case OPARG_TYPE_MEMBERSHIP: - if (pOD != NULL) { - uint32_t opt_state = pOD->fOptState; - uintptr_t val = pOD->optArg.argEnum; + if (od != NULL) { + uint32_t opt_state = od->fOptState; + uintptr_t val = od->optArg.argEnum; char const * typ = (ovp->valType == OPARG_TYPE_ENUMERATION) ? "keyword" : "set-membership"; @@ -369,20 +320,20 @@ prt_value(FILE * fp, int depth, tOptDesc * pOD, tOptionValue const * ovp) * This is a magic incantation that will convert the * bit flag values back into a string suitable for printing. */ - (*(pOD->pOptProc))(OPTPROC_RETURN_VALNAME, pOD ); - if (pOD->optArg.argString != NULL) { - fputs(pOD->optArg.argString, fp); + (*(od->pOptProc))(OPTPROC_RETURN_VALNAME, od ); + if (od->optArg.argString != NULL) { + fputs(od->optArg.argString, fp); if (ovp->valType != OPARG_TYPE_ENUMERATION) { /* * set membership strings get allocated */ - AGFREE(pOD->optArg.argString); + AGFREE(od->optArg.argString); } } - pOD->optArg.argEnum = val; - pOD->fOptState = opt_state; + od->optArg.argEnum = val; + od->fOptState = opt_state; fprintf(fp, END_XML_FMT, ovp->pzName); break; } @@ -404,6 +355,9 @@ prt_value(FILE * fp, int depth, tOptDesc * pOD, tOptionValue const * ovp) } /** + * Print a string value in XML format + * + * @param[in] fp the file pointer for the save file */ static void prt_string(FILE * fp, char const * name, char const * pz) @@ -440,6 +394,9 @@ prt_string(FILE * fp, char const * name, char const * pz) } /** + * Print an option that can have multiple values in XML format + * + * @param[in] fp file pointer */ static void prt_val_list(FILE * fp, char const * name, tArgList * al) @@ -453,7 +410,7 @@ prt_val_list(FILE * fp, char const * name, tArgList * al) if (al == NULL) return; opt_ct = al->useCt; - opt_list = VOIDP(al->apzArgs); + opt_list = (void **)al->apzArgs; if (opt_ct <= 0) { fprintf(fp, OPEN_CLOSE_FMT, name); @@ -476,19 +433,30 @@ prt_val_list(FILE * fp, char const * name, tArgList * al) } /** + * printed a nested/hierarchical value + * + * @param[in] fp file pointer + * @param[in] od option descriptor + * @param[in] save_fl include usage in comments */ static void -prt_nested(FILE * fp, tOptDesc * p) +prt_nested(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl) { int opt_ct; - tArgList * al = p->optCookie; + tArgList * al = od->optCookie; void ** opt_list; - if (al == NULL) + if (save_fl & SVFL_USAGE) + fprintf(fp, ao_name_use_fmt, od->pz_Name, od->pzText); + + /* + * Never show a default value if a hierarchical value is empty. + */ + if (UNUSED_OPT(od) || (al == NULL)) return; opt_ct = al->useCt; - opt_list = VOIDP(al->apzArgs); + opt_list = (void **)al->apzArgs; if (opt_ct <= 0) return; @@ -500,48 +468,152 @@ prt_nested(FILE * fp, tOptDesc * p) if (ovp == NULL) continue; - fprintf(fp, NESTED_OPT_FMT, p->pz_Name); + fprintf(fp, NESTED_OPT_FMT, od->pz_Name); do { - prt_value(fp, 1, p, ovp); + prt_value(fp, 1, od, ovp); } while (ovp = optionNextValue(base, ovp), ovp != NULL); - fprintf(fp, "\n", p->pz_Name); + fprintf(fp, "\n", od->pz_Name); } while (--opt_ct > 0); } +#ifdef _MSC_VER +/** + * truncate() emulation for Microsoft C + * + * @param[in] fname the save file name + * @param[in] newsz new size of fname in octets + */ +static int +truncate(char const* fname, size_t newsz) +{ + int fd; + int err; + + fd = open(fname, O_RDWR); + if (fd < 0) + return fd; + err = _chsize_s(fd, newsz); + close(fd); + if (0 != err) + errno = err; + return err; +} +#endif /* _MSC_VER */ + +/** + * remove the current program settings + * + * @param[in] opts the program options structure + * @param[in] fname the save file name + */ +static void +remove_settings(tOptions * opts, char const * fname) +{ + size_t const name_len = strlen(opts->pzProgName); + tmap_info_t map_info; + char * text = text_mmap(fname, PROT_READ|PROT_WRITE, MAP_PRIVATE, &map_info); + char * scan = text; + + for (;;) { + char * next = scan = strstr(scan, zCfgProg); + if (scan == NULL) + goto leave; + + scan = SPN_WHITESPACE_CHARS(scan + zCfgProg_LEN); + if ( (strneqvcmp(scan, opts->pzProgName, (int)name_len) == 0) + && (IS_END_XML_TOKEN_CHAR(scan[name_len])) ) { + + scan = next; + break; + } + } + + /* + * If not NULL, "scan" points to the "pzProgName); - fprintf(stderr, zNoCreat, errno, strerror(errno), pzFName); + fprintf(stderr, zsave_warn, opts->pzProgName, fname); + fprintf(stderr, zNoCreat, errno, strerror(errno), fname); if (free_name) - AGFREE(pzFName); + AGFREE(fname); return fp; } if (free_name) - AGFREE(pzFName); + AGFREE(fname); } + do { + struct stat sbuf; + if (fstat(fileno(fp), &sbuf) < 0) + break; + + if (sbuf.st_size > zPresetFile_LEN) { + /* non-zero size implies save_fl is non-zero */ + fprintf(fp, zFmtProg, opts->pzProgName); + return fp; + } + } while (false); + + /* + * We have a new file. Insert a header + */ fputs("# ", fp); { char const * e = strchr(opts->pzUsageTitle, NL); @@ -563,40 +635,63 @@ open_sv_file(tOptions * opts) AGFREE(time_str); #endif } - + if (save_fl != 0) + fprintf(fp, zFmtProg, opts->pzProgName); return fp; } /** + * print option without an arg + * + * @param[in] fp file pointer + * @param[in] vod value option descriptor + * @param[in] pod primary option descriptor + * @param[in] save_fl include usage in comments */ static void -prt_no_arg_opt(FILE * fp, tOptDesc * p, tOptDesc * pOD) +prt_no_arg_opt(FILE * fp, tOptDesc * vod, tOptDesc * pod, save_flags_mask_t save_fl) { /* * The aliased to argument indicates whether or not the option * is "disabled". However, the original option has the name - * string, so we get that there, not with "p". + * string, so we get that there, not with "vod". */ char const * pznm = - (DISABLED_OPT(p)) ? pOD->pz_DisableName : pOD->pz_Name; + (DISABLED_OPT(vod)) ? pod->pz_DisableName : pod->pz_Name; /* * If the option was disabled and the disablement name is NULL, * then the disablement was caused by aliasing. * Use the name as the string to emit. */ if (pznm == NULL) - pznm = pOD->pz_Name; + pznm = pod->pz_Name; + + if (save_fl & SVFL_USAGE) + fprintf(fp, ao_name_use_fmt, pod->pz_Name, pod->pzText); + if (UNUSED_OPT(pod) && (save_fl & SVFL_DEFAULT)) + fputs(ao_default_use, fp); fprintf(fp, "%s\n", pznm); } /** + * print the string valued argument(s). + * + * @param[in] fp file pointer + * @param[in] od value option descriptor + * @param[in] save_fl include usage in comments */ static void -prt_str_arg(FILE * fp, tOptDesc * pOD) +prt_str_arg(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl) { - if (pOD->fOptState & OPTST_STACKED) { - tArgList * pAL = (tArgList *)pOD->optCookie; + if (UNUSED_OPT(od) || ((od->fOptState & OPTST_STACKED) == 0)) { + char const * arg = od->optArg.argString; + if (arg == NULL) + arg = "''"; + prt_entry(fp, od, arg, save_fl); + + } else { + tArgList * pAL = (tArgList *)od->optCookie; int uct = pAL->useCt; char const ** ppz = pAL->apzArgs; @@ -604,23 +699,24 @@ prt_str_arg(FILE * fp, tOptDesc * pOD) * un-disable multiple copies of disabled options. */ if (uct > 1) - pOD->fOptState &= ~OPTST_DISABLED; + od->fOptState &= ~OPTST_DISABLED; - while (uct-- > 0) - prt_entry(fp, pOD, *(ppz++)); - } else { - prt_entry(fp, pOD, pOD->optArg.argString); + while (uct-- > 0) { + prt_entry(fp, od, *(ppz++), save_fl); + save_fl &= ~SVFL_USAGE; + } } } /** * print the string value of an enumeration. * - * @param[in] fp the file pointer to write to - * @param[in] od the option descriptor with the enumerated value + * @param[in] fp the file pointer to write to + * @param[in] od the option descriptor with the enumerated value + * @param[in] save_fl include usage in comments */ static void -prt_enum_arg(FILE * fp, tOptDesc * od) +prt_enum_arg(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl) { uintptr_t val = od->optArg.argEnum; @@ -629,29 +725,31 @@ prt_enum_arg(FILE * fp, tOptDesc * od) * bit flag values back into a string suitable for printing. */ (*(od->pOptProc))(OPTPROC_RETURN_VALNAME, od); - prt_entry(fp, od, VOIDP(od->optArg.argString)); + prt_entry(fp, od, VOIDP(od->optArg.argString), save_fl); od->optArg.argEnum = val; } /** * Print the bits set in a bit mask option. + * * We call the option handling function with a magic value for * the options pointer and it allocates and fills in the string. * We print that with a call to prt_entry(). * - * @param[in] fp the file pointer to write to - * @param[in] od the option descriptor with a bit mask value type + * @param[in] fp the file pointer to write to + * @param[in] od the option descriptor with a bit mask value type + * @param[in] save_fl include usage in comments */ static void -prt_set_arg(FILE * fp, tOptDesc * od) +prt_set_arg(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl) { char * list = optionMemberList(od); size_t len = strlen(list); char * buf = (char *)AGALOC(len + 3, "dir name"); *buf= '='; memcpy(buf+1, list, len + 1); - prt_entry(fp, od, buf); + prt_entry(fp, od, buf, save_fl); AGFREE(buf); AGFREE(list); } @@ -660,29 +758,35 @@ prt_set_arg(FILE * fp, tOptDesc * od) * figure out what the option file name argument is. * If one can be found, call prt_entry() to emit it. * - * @param[in] fp the file pointer to write to. - * @param[in] od the option descriptor with a bit mask value type - * @param[in] opts the program options descriptor + * @param[in] fp the file pointer to write to. + * @param[in] od the option descriptor with a bit mask value type + * @param[in] opts the program options descriptor + * @param[in] save_fl include usage in comments */ static void -prt_file_arg(FILE * fp, tOptDesc * od, tOptions * opts) +prt_file_arg(FILE * fp, tOptDesc * od, tOptions * opts, save_flags_mask_t save_fl) { /* * If the cookie is not NULL, then it has the file name, period. * Otherwise, if we have a non-NULL string argument, then.... */ if (od->optCookie != NULL) - prt_entry(fp, od, od->optCookie); + prt_entry(fp, od, od->optCookie, save_fl); else if (HAS_originalOptArgArray(opts)) { char const * orig = opts->originalOptArgArray[od->optIndex].argString; - if (od->optArg.argString == orig) + if (od->optArg.argString == orig) { + if (save_fl) + fprintf(fp, ao_name_use_fmt, od->pz_Name, od->pzText); return; + } - prt_entry(fp, od, od->optArg.argString); - } + prt_entry(fp, od, od->optArg.argString, save_fl); + + } else if (save_fl) + fprintf(fp, ao_name_use_fmt, od->pz_Name, od->pzText); } /*=export_func optionSaveFile @@ -719,8 +823,32 @@ optionSaveFile(tOptions * opts) { tOptDesc * od; int ct; - FILE * fp = open_sv_file(opts); + FILE * fp; + save_flags_mask_t save_flags = SVFL_NONE; + do { + char * temp_str; + char const * dir = opts->pOptDesc[ opts->specOptIdx.save_opts ].optArg.argString; + size_t flen; + + if (dir == NULL) + break; + temp_str = strchr(dir, '>'); + if (temp_str == NULL) + break; + if (temp_str[1] == '>') + save_flags = SVFL_UPDATE; + flen = (temp_str - dir); + if (flen == 0) + break; + temp_str = AGALOC(flen + 1, "flag search str"); + memcpy(temp_str, dir, flen); + temp_str[flen] = NUL; + save_flags |= save_flags_str2mask(temp_str, SVFL_NONE); + AGFREE(temp_str); + } while (false); + + fp = open_sv_file(opts, save_flags & SVFL_UPDATE); if (fp == NULL) return; @@ -730,20 +858,20 @@ optionSaveFile(tOptions * opts) ct = opts->presetOptCt; od = opts->pOptDesc; do { - tOptDesc * p; + tOptDesc * vod; /* - * IF the option has not been defined - * OR it does not take an initialization value - * OR it is equivalenced to another option - * THEN continue (ignore it) - * * Equivalenced options get picked up when the equivalenced-to - * option is processed. + * option is processed. And do not save options with any state + * bits in the DO_NOT_SAVE collection + * + * ** option cannot be preset + * #define OPTST_NO_INIT 0x0000100U + * ** disable from cmd line + * #define OPTST_NO_COMMAND 0x2000000U + * ** alias for other option + * #define OPTST_ALIAS 0x8000000U */ - if (UNUSED_OPT(od)) - continue; - if ((od->fOptState & OPTST_DO_NOT_SAVE_MASK) != 0) continue; @@ -751,45 +879,48 @@ optionSaveFile(tOptions * opts) && (od->optEquivIndex != od->optIndex)) continue; + if (UNUSED_OPT(od) && ((save_flags & SVFL_USAGE_DEFAULT_MASK) == SVFL_NONE)) + continue; + /* * The option argument data are found at the equivalenced-to option, * but the actual option argument type comes from the original * option descriptor. Be careful! */ - p = ((od->fOptState & OPTST_EQUIVALENCE) != 0) - ? (opts->pOptDesc + od->optActualIndex) : od; + vod = ((od->fOptState & OPTST_EQUIVALENCE) != 0) + ? (opts->pOptDesc + od->optActualIndex) : od; switch (OPTST_GET_ARGTYPE(od->fOptState)) { case OPARG_TYPE_NONE: - prt_no_arg_opt(fp, p, od); + prt_no_arg_opt(fp, vod, od, save_flags); break; case OPARG_TYPE_NUMERIC: - prt_entry(fp, p, VOIDP(p->optArg.argInt)); + prt_entry(fp, vod, VOIDP(vod->optArg.argInt), save_flags); break; case OPARG_TYPE_STRING: - prt_str_arg(fp, p); + prt_str_arg(fp, vod, save_flags); break; case OPARG_TYPE_ENUMERATION: - prt_enum_arg(fp, p); + prt_enum_arg(fp, vod, save_flags); break; case OPARG_TYPE_MEMBERSHIP: - prt_set_arg(fp, p); + prt_set_arg(fp, vod, save_flags); break; case OPARG_TYPE_BOOLEAN: - prt_entry(fp, p, p->optArg.argBool ? "true" : "false"); + prt_entry(fp, vod, vod->optArg.argBool ? "true" : "false", save_flags); break; case OPARG_TYPE_HIERARCHY: - prt_nested(fp, p); + prt_nested(fp, vod, save_flags); break; case OPARG_TYPE_FILE: - prt_file_arg(fp, p, opts); + prt_file_arg(fp, vod, opts, save_flags); break; default: diff --git a/sntp/libopts/sort.c b/sntp/libopts/sort.c index da0033431aff..b4bd5cb7e224 100644 --- a/sntp/libopts/sort.c +++ b/sntp/libopts/sort.c @@ -10,7 +10,7 @@ /* * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control @@ -29,20 +29,6 @@ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd */ -/* = = = START-STATIC-FORWARD = = = */ -static tSuccess -must_arg(tOptions * opts, char * arg_txt, tOptState * pOS, - char ** opt_txt, uint32_t * opt_idx); - -static tSuccess -maybe_arg(tOptions * opts, char * arg_txt, tOptState * pOS, - char ** opt_txt, uint32_t * opt_idx); - -static tSuccess -short_opt_ck(tOptions * opts, char * arg_txt, tOptState * pOS, - char ** opt_txt, uint32_t * opt_idx); -/* = = = END-STATIC-FORWARD = = = */ - /* * "must_arg" and "maybe_arg" are really similar. The biggest * difference is that "may" will consume the next argument only if it @@ -178,7 +164,7 @@ short_opt_ck(tOptions * opts, char * arg_txt, tOptState * pOS, * If the program wants sorted options (separated operands and options), * then this routine will to the trick. */ -LOCAL void +static void optionSort(tOptions * opts) { char ** opt_txt; diff --git a/sntp/libopts/stack.c b/sntp/libopts/stack.c index affe6b661fd5..39a328a85bec 100644 --- a/sntp/libopts/stack.c +++ b/sntp/libopts/stack.c @@ -11,7 +11,7 @@ /* * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control @@ -176,7 +176,7 @@ optionUnstackArg(tOptions * opts, tOptDesc * od) * a pointer to the argument list structure. It gets passed around * as an opaque address. */ -LOCAL void +static void addArgListEntry(void ** ppAL, void * entry) { tArgList * pAL = *(void **)ppAL; diff --git a/sntp/libopts/stdnoreturn.in.h b/sntp/libopts/stdnoreturn.in.h index 5b4d11bb3b0a..bf46c0883e87 100644 --- a/sntp/libopts/stdnoreturn.in.h +++ b/sntp/libopts/stdnoreturn.in.h @@ -1,6 +1,6 @@ /* A substitute for ISO C11 . - Copyright 2012-2015 Free Software Foundation, Inc. + Copyright 2012-2018 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -13,7 +13,7 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License - along with this program; if not, see . */ + along with this program; if not, see . */ /* Written by Paul Eggert. */ @@ -28,15 +28,25 @@ /* The definition of _Noreturn is copied here. */ -#if 1200 <= _MSC_VER -/* Standard include files on this platform contain declarations like - "__declspec (noreturn) void abort (void);". "#define noreturn - _Noreturn" would cause this declaration to be rewritten to the - invalid "__declspec (__declspec (noreturn)) void abort (void);". - Instead, define noreturn to empty, so that such declarations are - rewritten to "__declspec () void abort (void);", which is - equivalent to "void abort (void);"; this gives up on noreturn's - advice to the compiler but at least it is valid code. */ +#if 1200 <= _MSC_VER || defined __CYGWIN__ +/* On MSVC, standard include files contain declarations like + __declspec (noreturn) void abort (void); + "#define noreturn _Noreturn" would cause this declaration to be rewritten + to the invalid + __declspec (__declspec (noreturn)) void abort (void); + + Similarly, on Cygwin, standard include files contain declarations like + void __cdecl abort (void) __attribute__ ((noreturn)); + "#define noreturn _Noreturn" would cause this declaration to be rewritten + to the invalid + void __cdecl abort (void) __attribute__ ((__attribute__ ((__noreturn__)))); + + Instead, define noreturn to empty, so that such declarations are rewritten to + __declspec () void abort (void); + or + void __cdecl abort (void) __attribute__ (()); + respectively. This gives up on noreturn's advice to the compiler but at + least it is valid code. */ # define noreturn /*empty*/ #else # define noreturn _Noreturn diff --git a/sntp/libopts/streqvcmp.c b/sntp/libopts/streqvcmp.c index e87a232d199d..53477d65f9d6 100644 --- a/sntp/libopts/streqvcmp.c +++ b/sntp/libopts/streqvcmp.c @@ -15,7 +15,7 @@ /* * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control @@ -37,7 +37,7 @@ * together for a case independent comparison. The mappings are * based upon ascii character sequences. */ -static unsigned char charmap[] = { + static unsigned char charmap[] = { NUL, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, '\a', '\b', '\t', NL, '\v', '\f', '\r', 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, diff --git a/sntp/libopts/text_mmap.c b/sntp/libopts/text_mmap.c index 07c0bf10ebc3..ed5819271125 100644 --- a/sntp/libopts/text_mmap.c +++ b/sntp/libopts/text_mmap.c @@ -9,7 +9,7 @@ /* * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control @@ -185,7 +185,11 @@ validate_mmap(char const * fname, int prot, int flags, tmap_info_t * mapinfo) * then our updates will show in the file, so we must open with * write access. */ - int o_flag = FILE_WRITABLE(prot, flags) ? O_RDWR : O_RDONLY; + int o_flag = +#ifdef _WIN32 + _O_BINARY | +#endif + FILE_WRITABLE(prot, flags) ? O_RDWR : O_RDONLY; /* * If you're not sharing the file and you are writing to it, @@ -349,16 +353,15 @@ text_munmap(tmap_info_t * mi) #ifdef HAVE_MMAP (void)munmap(mi->txt_data, mi->txt_full_size); -#else /* don't HAVE_MMAP */ +#else // don't HAVE_MMAP /* * IF the memory is writable *AND* it is not private (copy-on-write) * *AND* the memory is "sharable" (seen by other processes) * THEN rewrite the data. Emulate mmap visibility. */ - if ( FILE_WRITABLE(mi->txt_prot, mi->txt_flags) - && (lseek(mi->txt_fd, 0, SEEK_SET) >= 0) ) { + if ( FILE_WRITABLE(mi->txt_prot, mi->txt_flags) + && (lseek(mi->txt_fd, 0, SEEK_SET) >= 0) ) write(mi->txt_fd, mi->txt_data, mi->txt_size); - } free(mi->txt_data); #endif /* HAVE_MMAP */ diff --git a/sntp/libopts/time.c b/sntp/libopts/time.c index 62e07541e54a..debaa7aed340 100644 --- a/sntp/libopts/time.c +++ b/sntp/libopts/time.c @@ -8,7 +8,7 @@ /* * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control @@ -90,8 +90,10 @@ optionTimeDate(tOptions * opts, tOptDesc * od) if (envptr == NULL) { static char const fmt[] = "DATEMSK=%s/datemsk"; - envptr = AGALOC(sizeof(fmt) + strlen(opts->pzPkgDataDir), fmt); - sprintf(envptr, fmt, opts->pzPkgDataDir); + size_t sz = sizeof(fmt) + strlen(opts->pzPkgDataDir); + envptr = AGALOC(sz, fmt); + if (snprintf(envptr, sz, fmt, opts->pzPkgDataDir) >= (int)sz) + option_exits(EXIT_FAILURE); putenv(envptr); } diff --git a/sntp/libopts/tokenize.c b/sntp/libopts/tokenize.c index 25550eaafeea..7489e3d526bb 100644 --- a/sntp/libopts/tokenize.c +++ b/sntp/libopts/tokenize.c @@ -9,7 +9,7 @@ * This file defines the string_tokenize interface * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control @@ -28,23 +28,6 @@ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd */ -#include -#include - -#define cc_t const unsigned char -#define ch_t unsigned char - -/* = = = START-STATIC-FORWARD = = = */ -static void -copy_cooked(ch_t ** ppDest, char const ** ppSrc); - -static void -copy_raw(ch_t ** ppDest, char const ** ppSrc); - -static token_list_t * -alloc_token_list(char const * str); -/* = = = END-STATIC-FORWARD = = = */ - static void copy_cooked(ch_t ** ppDest, char const ** ppSrc) { @@ -57,7 +40,7 @@ copy_cooked(ch_t ** ppDest, char const ** ppSrc) case NUL: *ppSrc = NULL; return; case '"': goto done; case '\\': - pSrc += ao_string_cook_escape_char((const char *)pSrc, (char *)&ch, 0x7F); + pSrc += ao_string_cook_escape_char((char *)pSrc, (char *)&ch, 0x7F); if (ch == 0x7F) break; /* FALLTHROUGH */ diff --git a/sntp/libopts/usage.c b/sntp/libopts/usage.c index c652da7f0bce..9775bdb0b282 100644 --- a/sntp/libopts/usage.c +++ b/sntp/libopts/usage.c @@ -18,7 +18,7 @@ /* * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control @@ -37,60 +37,8 @@ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd */ -/* = = = START-STATIC-FORWARD = = = */ -static unsigned int -parse_usage_flags(ao_flag_names_t const * fnt, char const * txt); - -static inline bool -do_gnu_usage(tOptions * pOpts); - -static inline bool -skip_misuse_usage(tOptions * pOpts); - -static void -print_offer_usage(tOptions * opts); - -static void -print_usage_details(tOptions * opts, int exit_code); - -static void -print_one_paragraph(char const * text, bool plain, FILE * fp); - -static void -prt_conflicts(tOptions * opts, tOptDesc * od); - -static void -prt_one_vendor(tOptions * opts, tOptDesc * od, - arg_types_t * argtp, char const * usefmt); - -static void -prt_vendor_opts(tOptions * opts, char const * title); - -static void -prt_extd_usage(tOptions * opts, tOptDesc * od, char const * title); - -static void -prt_ini_list(char const * const * papz, char const * ini_file, - char const * path_nm); - -static void -prt_preamble(tOptions * opts, tOptDesc * od, arg_types_t * at); - -static void -prt_one_usage(tOptions * opts, tOptDesc * od, arg_types_t * at); - -static void -prt_opt_usage(tOptions * opts, int ex_code, char const * title); - -static void -prt_prog_detail(tOptions * opts); - -static int -setGnuOptFmts(tOptions * opts, char const ** ptxt); - -static int -setStdOptFmts(tOptions * opts, char const ** ptxt); -/* = = = END-STATIC-FORWARD = = = */ +#define GRAPH_CH(_ch) \ + ((((unsigned)_ch) <= 0x7E) && (((unsigned)_ch) > ' ')) /** * Parse the option usage flags string. Any parsing problems yield @@ -151,6 +99,7 @@ parse_usage_flags(ao_flag_names_t const * fnt, char const * txt) case ',': txt = SPN_WHITESPACE_CHARS(txt + 1); /* Something must follow the comma */ + /* FALLTHROUGH */ default: continue; @@ -167,7 +116,7 @@ parse_usage_flags(ao_flag_names_t const * fnt, char const * txt) * environment variable is parsed. * @param[in,out] opts the program option descriptor */ -LOCAL void +static void set_usage_flags(tOptions * opts, char const * flg_txt) { # define _aof_(_n, _f) { sizeof(#_n)-1, _f, #_n }, @@ -304,7 +253,7 @@ print_offer_usage(tOptions * opts) help[0] = help[1] = '-'; strncpy(help + 2, od->pz_Name, 20); break; - + case 0: strncpy(help, od->pz_Name, 20); break; @@ -320,7 +269,7 @@ print_offer_usage(tOptions * opts) case (OPTPROC_LONGOPT | OPTPROC_SHORTOPT): strcpy(help, "--help"); break; - + case 0: strcpy(help, "help"); break; @@ -351,8 +300,8 @@ print_usage_details(tOptions * opts, int exit_code) flen = setGnuOptFmts(opts, &pOptTitle); sprintf(line_fmt_buf, zFmtFmt, flen); fputc(NL, option_usage_fp); - } - else { + + } else { flen = setStdOptFmts(opts, &pOptTitle); sprintf(line_fmt_buf, zFmtFmt, flen); @@ -438,7 +387,7 @@ print_one_paragraph(char const * text, bool plain, FILE * fp) AGFREE(t); } } - + /*=export_func optionPrintParagraphs * private: * @@ -565,7 +514,7 @@ optionPrintParagraphs(char const * text, bool plain, FILE * fp) * If "exitCode" is "AO_EXIT_REQ_USAGE" (normally 64), then output will to * to stdout and the actual exit code will be "EXIT_SUCCESS". =*/ -void +lo_noreturn void optionUsage(tOptions * opts, int usage_exit_code) { int exit_code = (usage_exit_code == AO_EXIT_REQ_USAGE) @@ -617,7 +566,7 @@ optionUsage(tOptions * opts, int usage_exit_code) print_usage_details(opts, usage_exit_code); else print_offer_usage(opts); - + flush_and_exit: fflush(option_usage_fp); if (ferror(option_usage_fp) != 0) @@ -777,7 +726,7 @@ prt_vendor_opts(tOptions * opts, char const * title) do { size_t l; if ( ((od->fOptState & not_vended_mask) != 0) - || IS_GRAPHIC_CHAR(od->optValue)) + || GRAPH_CH(od->optValue)) continue; l = strlen(od->pz_Name); @@ -795,7 +744,7 @@ prt_vendor_opts(tOptions * opts, char const * title) do { if ( ((od->fOptState & not_vended_mask) != 0) - || IS_GRAPHIC_CHAR(od->optValue)) + || GRAPH_CH(od->optValue)) continue; prt_one_vendor(opts, od, &argTypes, vfmt); @@ -1005,7 +954,7 @@ prt_preamble(tOptions * opts, tOptDesc * od, arg_types_t * at) if ((opts->fOptSet & OPTPROC_SHORTOPT) == 0) fputs(at->pzSpc, option_usage_fp); - else if (! IS_GRAPHIC_CHAR(od->optValue)) { + else if (! GRAPH_CH(od->optValue)) { if ( (opts->fOptSet & (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT)) == (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT)) fputc(' ', option_usage_fp); @@ -1132,7 +1081,7 @@ prt_opt_usage(tOptions * opts, int ex_code, char const * title) /* Skip name only options when we have a vendor option */ if ( ((opts->fOptSet & OPTPROC_VENDOR_OPT) != 0) - && (! IS_GRAPHIC_CHAR(od->optValue))) + && (! GRAPH_CH(od->optValue))) continue; /* diff --git a/sntp/libopts/version.c b/sntp/libopts/version.c index 8a8de75dbe31..cd46be3a4d85 100644 --- a/sntp/libopts/version.c +++ b/sntp/libopts/version.c @@ -10,7 +10,7 @@ /* * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control @@ -90,7 +90,7 @@ emit_copy_full(tOptions * o, FILE * fp) else emit_first_line(fp, o->pzUsageTitle, NULL, NULL); - + if (HAS_pzPkgDataDir(o) && (o->pzPackager != NULL)) { fputc(NL, fp); fputs(o->pzPackager, fp); @@ -119,7 +119,7 @@ emit_copy_note(tOptions * opts, FILE * fp) fputc(NL, fp); fprintf(fp, zao_ver_fmt, optionVersion()); - + if (HAS_pzPkgDataDir(opts) && (opts->pzPackager != NULL)) { fputc(NL, fp); fputs(opts->pzPackager, fp); @@ -153,7 +153,10 @@ print_ver(tOptions * opts, tOptDesc * od, FILE * fp, bool call_exit) ch = od->optArg.argString[0]; - else { + else if (OPTST_GET_ARGTYPE(od->fOptState) == OPARG_TYPE_STATIC) { + ch = od->optArg.argString[0]; + + } else { set_usage_flags(opts, NULL); ch = (opts->fOptSet & OPTPROC_GNUUSAGE) ? 'c' : 'v'; } diff --git a/sntp/log.c b/sntp/log.c index db6614d02710..6f45c635bf1f 100644 --- a/sntp/log.c +++ b/sntp/log.c @@ -2,7 +2,7 @@ #include "log.h" -const char *progname; /* for msyslog use too */ +extern const char *progname; /* for msyslog use too */ static int counter = 0; diff --git a/sntp/m4/ntp_cacheversion.m4 b/sntp/m4/ntp_cacheversion.m4 index 3619a603f524..0ec1f0d8dbca 100644 --- a/sntp/m4/ntp_cacheversion.m4 +++ b/sntp/m4/ntp_cacheversion.m4 @@ -14,7 +14,7 @@ # while children do not. This comes into play only when introducing # NTP_CACHEVERSION where it had not been previously used: Previous # cached results are presumed incompatible and not used. The reason -# children do not flush the cached is it is shared with the parent and +# children do not flush the cache is it is shared with the parent and # the children can rely on the parent having cleared any cache variables # predating this mechanism. Therefore the child can rely on the # config.cache generated by the parent on the first run despite not @@ -102,12 +102,7 @@ AC_DEFUN_ONCE([NTP_CACHEVERSION], [ for c_varname in $c_varname_list do - dnl AS_UNSET([$c_varname]) - dnl With Autoconf 2.61 and automake 1.10.3, using AS_UNSET - dnl here triggers generation of a syntax error in configure. - dnl Once we require a newer Autoconf we can revert to the - dnl AS_UNSET code. - { eval $c_varname=; unset $c_varname; } + AS_UNSET([$c_varname]) done AC_MSG_NOTICE([[$cache_file saved by another version, ignored.]]) diff --git a/sntp/m4/ntp_compiler.m4 b/sntp/m4/ntp_compiler.m4 index ae897e72a08e..ddce106fe522 100644 --- a/sntp/m4/ntp_compiler.m4 +++ b/sntp/m4/ntp_compiler.m4 @@ -12,10 +12,12 @@ AC_REQUIRE([AC_PROG_CC_STDC]) dnl AC_REQUIRE([AC_PROG_CC_C89]) dnl AC_REQUIRE([AC_PROG_CC_C99]) +CC_NOFORMAT= CFLAGS_NTP= CPPFLAGS_NTP= LDADD_NTP= LDFLAGS_NTP= +AC_SUBST([CC_NOFORMAT]) AC_SUBST([CFLAGS_NTP]) AC_SUBST([CPPFLAGS_NTP]) AC_SUBST([LDADD_NTP]) @@ -75,7 +77,7 @@ AH_VERBATIM( case "$GCC" in yes) SAVED_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Wstrict-overflow" + CFLAGS="$SAVED_CFLAGS -Wstrict-overflow" AC_CACHE_CHECK( [if $CC can handle -Wstrict-overflow], [ntp_cv_gcc_Wstrict_overflow], @@ -101,6 +103,32 @@ case "$GCC" in ) ] ) + # + # libopts specifically builds a string with embedded NULs. + # This causes a bunch of distracting warnings due to -Wformat. + # Let's see if we can figure out how to disable these. + # + CFLAGS="$SAVED_CFLAGS -Wno-format" + AC_CACHE_CHECK( + [if $CC can handle -Wno-format], + [ntp_cv_gcc_Wno_format], + [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], [[]])], + [ntp_cv_gcc_Wno_format=yes], + [ntp_cv_gcc_Wno_format=no] + ) + ] + ) + + case "$ntp_cv_gcc_Wno_format" in + yes) + CC_NOFORMAT="$CC_NOFORMAT -Wno-format" + ;; + no) + ;; + esac + CFLAGS="$SAVED_CFLAGS" AS_UNSET([SAVED_CFLAGS]) # diff --git a/sntp/m4/ntp_crypto_rand.m4 b/sntp/m4/ntp_crypto_rand.m4 index c529f3a51dff..9d554226f44c 100644 --- a/sntp/m4/ntp_crypto_rand.m4 +++ b/sntp/m4/ntp_crypto_rand.m4 @@ -18,6 +18,7 @@ # as-is, without any warranty. AC_DEFUN([NTP_CRYPTO_RAND], [ +AC_REQUIRE([NTP_OPENSSL])dnl dnl check for --disable-openssl-random dnl if that's not specified: @@ -42,8 +43,8 @@ LIBS="$NTPO_SAVED_LIBS $LDADD_NTP" dnl AC_MSG_NOTICE([LIBS is <$LIBS>]) AC_CHECK_FUNCS([RAND_bytes RAND_poll]) LIBS="$NTPO_SAVED_LIBS" -case "$ntp_use_openssl_random$ac_cv_func_RAND_bytes$ac_cv_func_RAND_poll" in - yesyesyes) +case "$ntp_openssl$ntp_use_openssl_random$ac_cv_func_RAND_bytes$ac_cv_func_RAND_poll" in + yesyesyesyes) AC_DEFINE([USE_OPENSSL_CRYPTO_RAND], [1], [Use OpenSSL's crypto random functions]) ;; *) ntp_use_openssl_random=no ;; diff --git a/sntp/m4/ntp_googletest.m4 b/sntp/m4/ntp_googletest.m4 deleted file mode 100644 index 4aa740f13e3c..000000000000 --- a/sntp/m4/ntp_googletest.m4 +++ /dev/null @@ -1,53 +0,0 @@ -dnl ###################################################################### -dnl NTP_GOOGLETEST gtest support shared by top-level and sntp/configure.ac -AC_DEFUN([NTP_GOOGLETEST], [ -gta=false -AC_ARG_WITH( - [gtest], - [AS_HELP_STRING( - [--with-gtest], - [Use the gtest framework (Default: if it's available)] - )], - [try_gtest=$withval], - [try_gtest=yes] -) -case "$try_gtest" in - yes) - AC_PATH_PROG([GTEST_CONFIG], [gtest-config]) - AS_UNSET([ac_cv_path_GTEST_CONFIG]) - case x${GTEST_CONFIG} in - x) ;; - *) - AC_MSG_CHECKING([gtest version]) - gtest_version_test=`$GTEST_CONFIG --min-version=1.5 || echo toolow` - case "$gtest_version_test" in - toolow*) - ;; - *) - GTEST_LDFLAGS=`$GTEST_CONFIG --ldflags` - GTEST_LIBS=`$GTEST_CONFIG --libs` - GTEST_CXXFLAGS=`$GTEST_CONFIG --cxxflags` - GTEST_CPPFLAGS=`$GTEST_CONFIG --cppflags` - AC_SUBST([GTEST_LDFLAGS]) - AC_SUBST([GTEST_LIBS]) - AC_SUBST([GTEST_CXXFLAGS]) - AC_SUBST([GTEST_CPPFLAGS]) - gta=true - ;; - esac - gtest_version=`$GTEST_CONFIG --version` - case "$gta" in - true) - AC_MSG_RESULT([($gtest_version) ok]) - ;; - *) AC_MSG_RESULT([($gtest_version) not ok]) - ;; - esac - AS_UNSET([gtest_version_test]) - AS_UNSET([gtest_version]) - esac -esac -AM_CONDITIONAL([GTEST_AVAILABLE], [$gta]) - -]) -dnl ====================================================================== diff --git a/sntp/m4/realpath.m4 b/sntp/m4/realpath.m4 new file mode 100644 index 000000000000..419d135f2f6c --- /dev/null +++ b/sntp/m4/realpath.m4 @@ -0,0 +1,49 @@ +# +# SYNOPSIS +# +# NTP_FUNC_REALPATH +# +# DESCRIPTION +# +# This macro defines HAVE_FUNC_REALPATH if we have a realpath() +# function that accepts NULL as the 2nd argument. +# +# LICENSE +# +# Copyright (c) 2020 Network Time Foundation +# +# Author: Harlan Stenn +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 1 + +AC_DEFUN([NTP_FUNC_REALPATH], [ + AC_MSG_CHECKING([for a POSIX-2008 compliant realpath()]) + AC_REQUIRE([AC_PROG_CC_C99]) + + AC_LANG_PUSH([C]) + + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ + #include + #include + int main() { return (NULL == realpath(".", NULL)); } + ]])], + ans="yes", + ans="no", + ans="CROSS COMPILE!" + ) + AC_MSG_RESULT([$ans]) + case "$ans" in + yes) + AC_DEFINE([HAVE_FUNC_POSIX_REALPATH], [1], + [Define to 1 if we have realpath() that supports NULL as the 2nd argument]) + ;; + esac + + AC_LANG_POP([C]) + ]); diff --git a/sntp/m4/version.m4 b/sntp/m4/version.m4 index 1b44051c8c0e..aef0b0c5a6fd 100644 --- a/sntp/m4/version.m4 +++ b/sntp/m4/version.m4 @@ -1 +1 @@ -m4_define([VERSION_NUMBER],[4.2.8p15]) +m4_define([VERSION_NUMBER],[4.2.8p16]) diff --git a/sntp/main.c b/sntp/main.c index 8a4a2e562bb4..08064a6c0eaa 100644 --- a/sntp/main.c +++ b/sntp/main.c @@ -20,6 +20,7 @@ #include "log.h" #include "libntp.h" +extern const char *progname; int shutting_down; int time_derived; diff --git a/sntp/scm-rev b/sntp/scm-rev index fe53b4fe5a4d..c2fda3ce6d2e 100644 --- a/sntp/scm-rev +++ b/sntp/scm-rev @@ -1 +1 @@ -1.3728 +1.3996 diff --git a/sntp/scripts/Makefile.in b/sntp/scripts/Makefile.in index 2e8e3df44911..42d86ecb59d3 100644 --- a/sntp/scripts/Makefile.in +++ b/sntp/scripts/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -161,6 +161,7 @@ CALC_TICKADJ_MS = @CALC_TICKADJ_MS@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CC_NOFORMAT = @CC_NOFORMAT@ CFLAGS = @CFLAGS@ CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@ CFLAGS_NTP = @CFLAGS_NTP@ @@ -168,6 +169,8 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ CPPFLAGS_NTP = @CPPFLAGS_NTP@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -179,6 +182,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EDITLINE_LIBS = @EDITLINE_LIBS@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ @@ -364,6 +368,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -401,8 +406,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -425,8 +430,10 @@ ctags CTAGS: cscope cscopelist: +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff --git a/sntp/sntp-opts.c b/sntp/sntp-opts.c index 66d9811f538a..d57f335e976d 100644 --- a/sntp/sntp-opts.c +++ b/sntp/sntp-opts.c @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (sntp-opts.c) * - * It has been AutoGen-ed June 23, 2020 at 02:19:32 AM by AutoGen 5.18.5 + * It has been AutoGen-ed May 31, 2023 at 02:47:47 PM by AutoGen 5.18.16 * From the definitions sntp-opts.def * and the template file options * - * Generated from AutoOpts 41:1:16 templates. + * Generated from AutoOpts 42:1:17 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -18,7 +18,7 @@ * The sntp program is copyrighted and licensed * under the following terms: * - * Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved. + * Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved. * This is free software. It is licensed for use, modification and * redistribution under the terms of the NTP License, copies of which * can be seen at: @@ -40,11 +40,15 @@ #define OPTION_CODE_COMPILE 1 #include "sntp-opts.h" #include +#include +#include +#include #include #include #include -#include +#include +#include #ifdef __cplusplus extern "C" { @@ -69,9 +73,9 @@ extern FILE * option_usage_fp; /** * static const strings for sntp options */ -static char const sntp_opt_strs[2566] = -/* 0 */ "sntp 4.2.8p15\n" - "Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.\n" +static char const sntp_opt_strs[2567] = +/* 0 */ "sntp 4.2.8p16\n" + "Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n" "This is free software. It is licensed for use, modification and\n" "redistribution under the terms of the NTP License, copies of which\n" "can be seen at:\n" @@ -156,15 +160,15 @@ static char const sntp_opt_strs[2566] = /* 2313 */ "LOAD_OPTS\0" /* 2323 */ "no-load-opts\0" /* 2336 */ "SNTP\0" -/* 2341 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p15\n" +/* 2341 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p16\n" "Usage: %s [ - [] | --[{=| }] ]... \\\n" "\t\t[ hostname-or-IP ...]\n\0" /* 2501 */ "$HOME\0" /* 2507 */ ".\0" /* 2509 */ ".ntprc\0" -/* 2516 */ "http://bugs.ntp.org, bugs@ntp.org\0" -/* 2550 */ "\n\0" -/* 2552 */ "sntp 4.2.8p15"; +/* 2516 */ "https://bugs.ntp.org, bugs@ntp.org\0" +/* 2551 */ "\n\0" +/* 2553 */ "sntp 4.2.8p16"; /** * ipv4 option description with @@ -761,12 +765,12 @@ static char const * const apzHomeList[3] = { /** The sntp program bug email address. */ #define zBugsAddr (sntp_opt_strs+2516) /** Clarification/explanation of what sntp does. */ -#define zExplain (sntp_opt_strs+2550) +#define zExplain (sntp_opt_strs+2551) /** Extra detail explaining what sntp does. */ #define zDetail (NULL) /** The full version string for sntp. */ -#define zFullVersion (sntp_opt_strs+2552) -/* extracted from optcode.tlib near line 364 */ +#define zFullVersion (sntp_opt_strs+2553) +/* extracted from optcode.tlib near line 342 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE @@ -798,7 +802,7 @@ doUsageOpt(tOptions * opts, tOptDesc * od) ex_code = SNTP_EXIT_SUCCESS; optionUsage(&sntpOptions, ex_code); /* NOTREACHED */ - exit(1); + exit(SNTP_EXIT_FAILURE); (void)opts; (void)od; } @@ -1165,19 +1169,19 @@ static void bogus_function(void) { extract the correct strings. These strings are actually referenced by a field name in the sntpOptions structure noted in the comments below. The literal text is defined in sntp_opt_strs. - + NOTE: the strings below are segmented with respect to the source string sntp_opt_strs. The strings above are handed off for translation at run time a paragraph at a time. Consequently, they are presented here for translation a paragraph at a time. - + ALSO: often the description for an option will reference another option by name. These are set off with apostrophe quotes (I hope). Do not translate option names. */ /* referenced via sntpOptions.pzCopyright */ - puts(_("sntp 4.2.8p15\n\ -Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.\n\ + puts(_("sntp 4.2.8p16\n\ +Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n\ This is free software. It is licensed for use, modification and\n\ redistribution under the terms of the NTP License, copies of which\n\ can be seen at:\n")); @@ -1266,7 +1270,7 @@ implied warranty.\n")); puts(_("load options from a config file")); /* referenced via sntpOptions.pzUsageTitle */ - puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p15\n\ + puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p16\n\ Usage: %s [ - [] | --[{=| }] ]... \\\n\ \t\t[ hostname-or-IP ...]\n")); @@ -1274,7 +1278,7 @@ Usage: %s [ - [] | --[{=| }] ]... \\\n\ puts(_("\n")); /* referenced via sntpOptions.pzFullVersion */ - puts(_("sntp 4.2.8p15")); + puts(_("sntp 4.2.8p16")); /* referenced via sntpOptions.pzFullUsage */ puts(_("<<>>")); @@ -1284,234 +1288,230 @@ Usage: %s [ - [] | --[{=| }] ]... \\\n\ /* LIBOPTS-MESSAGES: */ #line 67 "../autoopts.c" puts(_("allocation of %d bytes failed\n")); -#line 93 "../autoopts.c" +#line 89 "../autoopts.c" puts(_("allocation of %d bytes failed\n")); -#line 53 "../init.c" +#line 48 "../init.c" puts(_("AutoOpts function called without option descriptor\n")); -#line 86 "../init.c" +#line 81 "../init.c" puts(_("\tThis exceeds the compiled library version: ")); -#line 84 "../init.c" +#line 79 "../init.c" puts(_("Automated Options Processing Error!\n" "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); -#line 80 "../autoopts.c" +#line 78 "../autoopts.c" puts(_("realloc of %d bytes at 0x%p failed\n")); -#line 88 "../init.c" +#line 83 "../init.c" puts(_("\tThis is less than the minimum library version: ")); #line 121 "../version.c" puts(_("Automated Options version %s\n" - "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n")); -#line 87 "../makeshell.c" + "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n")); +#line 49 "../makeshell.c" puts(_("(AutoOpts bug): %s.\n")); #line 90 "../reset.c" puts(_("optionResetOpt() called, but reset-option not configured")); -#line 292 "../usage.c" +#line 241 "../usage.c" puts(_("could not locate the 'help' option")); -#line 336 "../autoopts.c" +#line 330 "../autoopts.c" puts(_("optionProcess() was called with invalid data")); -#line 748 "../usage.c" +#line 697 "../usage.c" puts(_("invalid argument type specified")); -#line 598 "../find.c" +#line 568 "../find.c" puts(_("defaulted to option with optional arg")); #line 76 "../alias.c" puts(_("aliasing option is out of range.")); -#line 234 "../enum.c" +#line 210 "../enum.c" puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); -#line 108 "../find.c" +#line 78 "../find.c" puts(_(" The following options match:\n")); -#line 293 "../find.c" +#line 263 "../find.c" puts(_("%s: ambiguous option name: %s (matches %d options)\n")); #line 161 "../check.c" puts(_("%s: Command line arguments required\n")); #line 43 "../alias.c" puts(_("%d %s%s options allowed\n")); -#line 94 "../makeshell.c" +#line 56 "../makeshell.c" puts(_("%s error %d (%s) calling %s for '%s'\n")); -#line 306 "../makeshell.c" +#line 268 "../makeshell.c" puts(_("interprocess pipe")); -#line 168 "../version.c" +#line 171 "../version.c" puts(_("error: version option argument '%c' invalid. Use:\n" "\t'v' - version only\n" "\t'c' - version and copyright\n" "\t'n' - version and full copyright notice\n")); #line 58 "../check.c" puts(_("%s error: the '%s' and '%s' options conflict\n")); -#line 217 "../find.c" +#line 187 "../find.c" puts(_("%s: The '%s' option has been disabled.")); -#line 430 "../find.c" +#line 400 "../find.c" puts(_("%s: The '%s' option has been disabled.")); #line 38 "../alias.c" puts(_("-equivalence")); -#line 469 "../find.c" +#line 439 "../find.c" puts(_("%s: illegal option -- %c\n")); #line 110 "../reset.c" puts(_("%s: illegal option -- %c\n")); -#line 271 "../find.c" +#line 241 "../find.c" puts(_("%s: illegal option -- %s\n")); -#line 755 "../find.c" +#line 740 "../find.c" puts(_("%s: illegal option -- %s\n")); #line 118 "../reset.c" puts(_("%s: illegal option -- %s\n")); -#line 335 "../find.c" +#line 305 "../find.c" puts(_("%s: unknown vendor extension option -- %s\n")); -#line 159 "../enum.c" +#line 135 "../enum.c" puts(_(" or an integer from %d through %d\n")); -#line 169 "../enum.c" +#line 145 "../enum.c" puts(_(" or an integer from %d through %d\n")); -#line 747 "../usage.c" +#line 696 "../usage.c" puts(_("%s error: invalid option descriptor for %s\n")); -#line 1081 "../usage.c" +#line 1030 "../usage.c" puts(_("%s error: invalid option descriptor for %s\n")); -#line 385 "../find.c" +#line 355 "../find.c" puts(_("%s: invalid option name: %s\n")); -#line 527 "../find.c" +#line 497 "../find.c" puts(_("%s: The '%s' option requires an argument.\n")); -#line 156 "../autoopts.c" +#line 150 "../autoopts.c" puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" "\t'%s' and '%s'.")); #line 94 "../check.c" puts(_("%s error: The %s option is required\n")); -#line 632 "../find.c" +#line 602 "../find.c" puts(_("%s: The '%s' option cannot have an argument.\n")); #line 151 "../check.c" puts(_("%s: Command line arguments are not allowed.\n")); -#line 535 "../save.c" +#line 568 "../save.c" puts(_("error %d (%s) creating %s\n")); -#line 234 "../enum.c" +#line 210 "../enum.c" puts(_("%s error: '%s' does not match any %s keywords.\n")); #line 93 "../reset.c" puts(_("%s error: The '%s' option requires an argument.\n")); -#line 184 "../save.c" +#line 122 "../save.c" puts(_("error %d (%s) stat-ing %s\n")); -#line 238 "../save.c" +#line 175 "../save.c" puts(_("error %d (%s) stat-ing %s\n")); #line 143 "../restore.c" puts(_("%s error: no saved option state\n")); -#line 231 "../autoopts.c" +#line 225 "../autoopts.c" puts(_("'%s' is not a command line option.\n")); -#line 111 "../time.c" +#line 113 "../time.c" puts(_("%s error: '%s' is not a recognizable date/time.\n")); -#line 132 "../save.c" - puts(_("'%s' not defined\n")); #line 50 "../time.c" puts(_("%s error: '%s' is not a recognizable time duration.\n")); #line 92 "../check.c" puts(_("%s error: The %s option must appear %d times.\n")); -#line 164 "../numeric.c" +#line 165 "../numeric.c" puts(_("%s error: '%s' is not a recognizable number.\n")); -#line 200 "../enum.c" +#line 176 "../enum.c" puts(_("%s error: %s exceeds %s keyword count\n")); -#line 330 "../usage.c" +#line 279 "../usage.c" puts(_("Try '%s %s' for more information.\n")); #line 45 "../alias.c" puts(_("one %s%s option allowed\n")); -#line 208 "../makeshell.c" +#line 170 "../makeshell.c" puts(_("standard output")); -#line 943 "../makeshell.c" +#line 905 "../makeshell.c" puts(_("standard output")); -#line 274 "../usage.c" +#line 223 "../usage.c" puts(_("standard output")); -#line 415 "../usage.c" +#line 364 "../usage.c" puts(_("standard output")); -#line 625 "../usage.c" +#line 574 "../usage.c" puts(_("standard output")); -#line 175 "../version.c" +#line 178 "../version.c" puts(_("standard output")); -#line 274 "../usage.c" +#line 223 "../usage.c" puts(_("standard error")); -#line 415 "../usage.c" +#line 364 "../usage.c" puts(_("standard error")); -#line 625 "../usage.c" +#line 574 "../usage.c" puts(_("standard error")); -#line 175 "../version.c" +#line 178 "../version.c" puts(_("standard error")); -#line 208 "../makeshell.c" +#line 170 "../makeshell.c" puts(_("write")); -#line 943 "../makeshell.c" +#line 905 "../makeshell.c" puts(_("write")); -#line 273 "../usage.c" +#line 222 "../usage.c" puts(_("write")); -#line 414 "../usage.c" +#line 363 "../usage.c" puts(_("write")); -#line 624 "../usage.c" +#line 573 "../usage.c" puts(_("write")); -#line 174 "../version.c" +#line 177 "../version.c" puts(_("write")); #line 60 "../numeric.c" puts(_("%s error: %s option value %ld is out of range.\n")); #line 44 "../check.c" puts(_("%s error: %s option requires the %s option\n")); -#line 131 "../save.c" +#line 121 "../save.c" puts(_("%s warning: cannot save options - %s not regular file\n")); -#line 183 "../save.c" +#line 174 "../save.c" puts(_("%s warning: cannot save options - %s not regular file\n")); -#line 237 "../save.c" +#line 193 "../save.c" puts(_("%s warning: cannot save options - %s not regular file\n")); -#line 256 "../save.c" - puts(_("%s warning: cannot save options - %s not regular file\n")); -#line 534 "../save.c" +#line 567 "../save.c" puts(_("%s warning: cannot save options - %s not regular file\n")); /* END-LIBOPTS-MESSAGES */ /* USAGE-TEXT: */ -#line 873 "../usage.c" +#line 822 "../usage.c" puts(_("\t\t\t\t- an alternate for '%s'\n")); -#line 1148 "../usage.c" +#line 1097 "../usage.c" puts(_("Version, usage and configuration options:")); -#line 924 "../usage.c" +#line 873 "../usage.c" puts(_("\t\t\t\t- default option for unnamed options\n")); -#line 837 "../usage.c" +#line 786 "../usage.c" puts(_("\t\t\t\t- disabled as '--%s'\n")); -#line 1117 "../usage.c" +#line 1066 "../usage.c" puts(_(" --- %-14s %s\n")); -#line 1115 "../usage.c" +#line 1064 "../usage.c" puts(_("This option has been disabled")); -#line 864 "../usage.c" +#line 813 "../usage.c" puts(_("\t\t\t\t- enabled by default\n")); #line 40 "../alias.c" puts(_("%s error: only ")); -#line 1194 "../usage.c" +#line 1143 "../usage.c" puts(_(" - examining environment variables named %s_*\n")); #line 168 "../file.c" puts(_("\t\t\t\t- file must not pre-exist\n")); #line 172 "../file.c" puts(_("\t\t\t\t- file must pre-exist\n")); -#line 380 "../usage.c" +#line 329 "../usage.c" puts(_("Options are specified by doubled hyphens and their name or by a single\n" "hyphen and the flag character.\n")); -#line 921 "../makeshell.c" +#line 882 "../makeshell.c" puts(_("\n" "= = = = = = = =\n\n" "This incarnation of genshell will produce\n" "a shell script to parse the options for %s:\n\n")); -#line 166 "../enum.c" +#line 142 "../enum.c" puts(_(" or an integer mask with any of the lower %d bits set\n")); -#line 897 "../usage.c" +#line 846 "../usage.c" puts(_("\t\t\t\t- is a set membership option\n")); -#line 918 "../usage.c" +#line 867 "../usage.c" puts(_("\t\t\t\t- must appear between %d and %d times\n")); -#line 382 "../usage.c" +#line 331 "../usage.c" puts(_("Options are specified by single or double hyphens and their name.\n")); -#line 904 "../usage.c" +#line 853 "../usage.c" puts(_("\t\t\t\t- may appear multiple times\n")); -#line 891 "../usage.c" +#line 840 "../usage.c" puts(_("\t\t\t\t- may not be preset\n")); -#line 1309 "../usage.c" +#line 1258 "../usage.c" puts(_(" Arg Option-Name Description\n")); -#line 1245 "../usage.c" +#line 1194 "../usage.c" puts(_(" Flg Arg Option-Name Description\n")); -#line 1303 "../usage.c" +#line 1252 "../usage.c" puts(_(" Flg Arg Option-Name Description\n")); -#line 1304 "../usage.c" +#line 1253 "../usage.c" puts(_(" %3s %s")); -#line 1310 "../usage.c" +#line 1259 "../usage.c" puts(_(" %3s %s")); -#line 387 "../usage.c" +#line 336 "../usage.c" puts(_("The '-#' option may omit the hash char\n")); -#line 383 "../usage.c" +#line 332 "../usage.c" puts(_("All arguments are named options.\n")); -#line 971 "../usage.c" +#line 920 "../usage.c" puts(_(" - reading file %s")); -#line 409 "../usage.c" +#line 358 "../usage.c" puts(_("\n" "Please send bug reports to: <%s>\n")); #line 100 "../version.c" @@ -1520,17 +1520,17 @@ Usage: %s [ - [] | --[{=| }] ]... \\\n\ #line 129 "../version.c" puts(_("\n" "Please send bug reports to: <%s>\n")); -#line 903 "../usage.c" +#line 852 "../usage.c" puts(_("\t\t\t\t- may NOT appear - preset only\n")); -#line 944 "../usage.c" +#line 893 "../usage.c" puts(_("\n" "The following option preset mechanisms are supported:\n")); -#line 1192 "../usage.c" +#line 1141 "../usage.c" puts(_("\n" "The following option preset mechanisms are supported:\n")); -#line 682 "../usage.c" +#line 631 "../usage.c" puts(_("prohibits these options:\n")); -#line 677 "../usage.c" +#line 626 "../usage.c" puts(_("prohibits the option '%s'\n")); #line 81 "../numeric.c" puts(_("%s%ld to %ld")); @@ -1548,28 +1548,28 @@ Usage: %s [ - [] | --[{=| }] ]... \\\n\ puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); #line 77 "../numeric.c" puts(_("%sless than or equal to %ld")); -#line 390 "../usage.c" +#line 339 "../usage.c" puts(_("Operands and options may be intermixed. They will be reordered.\n")); -#line 652 "../usage.c" +#line 601 "../usage.c" puts(_("requires the option '%s'\n")); -#line 655 "../usage.c" +#line 604 "../usage.c" puts(_("requires these options:\n")); -#line 1321 "../usage.c" +#line 1270 "../usage.c" puts(_(" Arg Option-Name Req? Description\n")); -#line 1315 "../usage.c" +#line 1264 "../usage.c" puts(_(" Flg Arg Option-Name Req? Description\n")); -#line 167 "../enum.c" +#line 143 "../enum.c" puts(_("or you may use a numeric representation. Preceding these with a '!'\n" "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" "will set them all. Multiple entries may be passed as an option\n" "argument list.\n")); -#line 910 "../usage.c" +#line 859 "../usage.c" puts(_("\t\t\t\t- may appear up to %d times\n")); -#line 77 "../enum.c" +#line 52 "../enum.c" puts(_("The valid \"%s\" option keywords are:\n")); -#line 1152 "../usage.c" +#line 1101 "../usage.c" puts(_("The next option supports vendor supported extra options:")); -#line 773 "../usage.c" +#line 722 "../usage.c" puts(_("These additional options are:")); /* END-USAGE-TEXT */ } diff --git a/sntp/sntp-opts.h b/sntp/sntp-opts.h index 338732e6ddf2..e8bee64a9cdd 100644 --- a/sntp/sntp-opts.h +++ b/sntp/sntp-opts.h @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (sntp-opts.h) * - * It has been AutoGen-ed June 23, 2020 at 02:19:32 AM by AutoGen 5.18.5 + * It has been AutoGen-ed May 31, 2023 at 02:47:47 PM by AutoGen 5.18.16 * From the definitions sntp-opts.def * and the template file options * - * Generated from AutoOpts 41:1:16 templates. + * Generated from AutoOpts 42:1:17 templates. * * AutoOpts is a copyrighted work. This header file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -18,7 +18,7 @@ * The sntp program is copyrighted and licensed * under the following terms: * - * Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved. + * Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved. * This is free software. It is licensed for use, modification and * redistribution under the terms of the NTP License, copies of which * can be seen at: @@ -45,6 +45,8 @@ #define AUTOOPTS_SNTP_OPTS_H_GUARD 1 #include "config.h" #include +#include +#include /** * Ensure that the library used for compiling this generated header is at @@ -53,13 +55,19 @@ * tolerable version is at least as old as what was current when the header * template was released. */ -#define AO_TEMPLATE_VERSION 167937 +#define AO_TEMPLATE_VERSION 172033 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header Choke Me. #endif +#if GCC_VERSION > 40400 +#define NOT_REACHED __builtin_unreachable(); +#else +#define NOT_REACHED +#endif + /** * Enumeration of each option type for sntp */ @@ -91,9 +99,9 @@ typedef enum { /** count of all options for sntp */ #define OPTION_CT 23 /** sntp version */ -#define SNTP_VERSION "4.2.8p15" +#define SNTP_VERSION "4.2.8p16" /** Full sntp version text */ -#define SNTP_FULL_VERSION "sntp 4.2.8p15" +#define SNTP_FULL_VERSION "sntp 4.2.8p16" /** * Interface defines for all options. Replace "n" with the UPPER_CASED @@ -362,6 +370,7 @@ static inline char* aoGetsText(char const* pz) { # endif #endif /* ENABLE_NLS */ + #ifdef __cplusplus } #endif diff --git a/sntp/sntp.1sntpman b/sntp/sntp.1sntpman index fd1d906e186a..a1fc294e2dc9 100644 --- a/sntp/sntp.1sntpman +++ b/sntp/sntp.1sntpman @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH sntp 1sntpman "23 Jun 2020" "4.2.8p15" "User Commands" +.TH sntp 1sntpman "31 May 2023" "4.2.8p16" "User Commands" .\" .\" EDIT THIS FILE WITH CAUTION (in-mem file) .\" -.\" It has been AutoGen-ed June 23, 2020 at 02:19:38 AM by AutoGen 5.18.5 +.\" It has been AutoGen-ed May 31, 2023 at 02:48:09 PM by AutoGen 5.18.16 .\" From the definitions sntp-opts.def .\" and the template file agman-cmd.tpl .SH NAME @@ -248,7 +248,7 @@ more than enough for a unicast response. If \fBsntp\fP is only waiting for a broadcast response a longer timeout is likely needed. .TP -.NOP \f\*[B-Font]\-\-wait\f[], \f\*[B-Font]\- Fl \-no\-wait\f[] +.NOP \f\*[B-Font]\-\-wait\f[], \f\*[B-Font]\-\-no\-wait\f[] Wait for pending replies (if not setting the time). The \fIno\-wait\fP form will disable the option. This option is enabled by default. @@ -353,10 +353,10 @@ it to autogen-users@lists.sourceforge.net. Thank you. .NOP "Dave Hart" .br .SH "COPYRIGHT" -Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, . .SH "BUGS" -Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org +Please send bug reports to: https://bugs.ntp.org, bugs@ntp.org .SH "NOTES" This manual page was \fIAutoGen\fP-erated from the \fBsntp\fP option definitions. diff --git a/sntp/sntp.1sntpmdoc b/sntp/sntp.1sntpmdoc index af0d1d3b3dd2..0c9753955405 100644 --- a/sntp/sntp.1sntpmdoc +++ b/sntp/sntp.1sntpmdoc @@ -1,9 +1,9 @@ -.Dd June 23 2020 +.Dd May 31 2023 .Dt SNTP 1sntpmdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc) .\" -.\" It has been AutoGen-ed June 23, 2020 at 02:19:35 AM by AutoGen 5.18.5 +.\" It has been AutoGen-ed May 31, 2023 at 02:48:05 PM by AutoGen 5.18.16 .\" From the definitions sntp-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -216,7 +216,7 @@ of seconds specified before giving up. The default should be more than enough for a unicast response. If \fBsntp\fP is only waiting for a broadcast response a longer timeout is likely needed. -.It Fl \-wait , " Fl \-no\-wait" +.It Fl \-wait , Fl \-no\-wait Wait for pending replies (if not setting the time). The \fIno\-wait\fP form will disable the option. This option is enabled by default. @@ -308,10 +308,10 @@ it to autogen\-users@lists.sourceforge.net. Thank you. .An "Harlan Stenn" .An "Dave Hart" .Sh "COPYRIGHT" -Copyright (C) 1992\-2020 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992\-2023 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, . .Sh "BUGS" -Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org +Please send bug reports to: https://bugs.ntp.org, bugs@ntp.org .Sh "NOTES" This manual page was \fIAutoGen\fP\-erated from the \fBsntp\fP option definitions. diff --git a/sntp/sntp.c b/sntp/sntp.c index 2e3bfecb3376..c83e05af86ec 100644 --- a/sntp/sntp.c +++ b/sntp/sntp.c @@ -2,6 +2,8 @@ #include "main.h" +const char * progname; + int main ( int argc, diff --git a/sntp/sntp.html b/sntp/sntp.html index 7a1e582d04ce..bfa3aa6ace98 100644 --- a/sntp/sntp.html +++ b/sntp/sntp.html @@ -1,6 +1,6 @@ - + Sntp User’s Manual @@ -16,23 +16,14 @@ '%s'\n", nam, abs); + */ + TEST_ASSERT_TRUE_MESSAGE(isValidAbsPath(abs), errMsg("could not validate '%s'", abs)); + } + closedir(dfs); +# endif +} diff --git a/tests/libntp/run-a_md5encrypt.c b/tests/libntp/run-a_md5encrypt.c index 2d9c08669900..06dda63f07ba 100644 --- a/tests/libntp/run-a_md5encrypt.c +++ b/tests/libntp/run-a_md5encrypt.c @@ -62,11 +62,11 @@ int main(int argc, char *argv[]) progname = argv[0]; suite_setup(); UnityBegin("a_md5encrypt.c"); - RUN_TEST(test_Encrypt, 40); - RUN_TEST(test_DecryptValid, 41); - RUN_TEST(test_DecryptInvalid, 42); - RUN_TEST(test_IPv4AddressToRefId, 43); - RUN_TEST(test_IPv6AddressToRefId, 44); + RUN_TEST(test_Encrypt, 41); + RUN_TEST(test_DecryptValid, 42); + RUN_TEST(test_DecryptInvalid, 43); + RUN_TEST(test_IPv4AddressToRefId, 44); + RUN_TEST(test_IPv6AddressToRefId, 45); return (UnityEnd()); } diff --git a/tests/libntp/run-caljulian.c b/tests/libntp/run-caljulian.c index 51d5470c15f7..fff7c0b87939 100644 --- a/tests/libntp/run-caljulian.c +++ b/tests/libntp/run-caljulian.c @@ -25,6 +25,7 @@ #include "config.h" #include "ntp_calendar.h" #include "ntp_stdlib.h" +#include "lib_strbuf.h" #include "test-libntp.h" #include @@ -63,10 +64,10 @@ int main(int argc, char *argv[]) progname = argv[0]; suite_setup(); UnityBegin("caljulian.c"); - RUN_TEST(test_RegularTime, 16); - RUN_TEST(test_LeapYear, 17); - RUN_TEST(test_uLongBoundary, 18); - RUN_TEST(test_uLongWrapped, 19); + RUN_TEST(test_RegularTime, 15); + RUN_TEST(test_LeapYear, 16); + RUN_TEST(test_uLongBoundary, 17); + RUN_TEST(test_uLongWrapped, 18); return (UnityEnd()); } diff --git a/tests/libntp/run-realpath.c b/tests/libntp/run-realpath.c new file mode 100644 index 000000000000..ebabdabc36cc --- /dev/null +++ b/tests/libntp/run-realpath.c @@ -0,0 +1,70 @@ +/* AUTOGENERATED FILE. DO NOT EDIT. */ + +//=======Test Runner Used To Run Each Test Below===== +#define RUN_TEST(TestFunc, TestLineNum) \ +{ \ + Unity.CurrentTestName = #TestFunc; \ + Unity.CurrentTestLineNumber = TestLineNum; \ + Unity.NumberOfTests++; \ + if (TEST_PROTECT()) \ + { \ + setUp(); \ + TestFunc(); \ + } \ + if (TEST_PROTECT() && !TEST_IS_IGNORED) \ + { \ + tearDown(); \ + } \ + UnityConcludeTest(); \ +} + +//=======Automagically Detected Files To Include===== +#include "unity.h" +#include +#include +#include "config.h" +#include "ntp_stdlib.h" +#include +#include +#include +#include +#include + +//=======External Functions This Runner Calls===== +extern void setUp(void); +extern void tearDown(void); +extern void test_CurrentWorkingDir(void); +extern void test_DevLinks(void); + + +//=======Suite Setup===== +static void suite_setup(void) +{ +extern int change_iobufs(int); +extern int change_logfile(const char*, int); +change_iobufs(1); +change_logfile("stderr", 0); +} + +//=======Test Reset Option===== +void resetTest(void); +void resetTest(void) +{ + tearDown(); + setUp(); +} + +char const *progname; + + +//=======MAIN===== +int main(int argc, char *argv[]) +{ + progname = argv[0]; + suite_setup(); + UnityBegin("realpath.c"); + RUN_TEST(test_CurrentWorkingDir, 48); + RUN_TEST(test_DevLinks, 59); + + return (UnityEnd()); +} diff --git a/tests/libntp/socktoa.c b/tests/libntp/socktoa.c index c8a9157d9bfa..72de4e9cdcd4 100644 --- a/tests/libntp/socktoa.c +++ b/tests/libntp/socktoa.c @@ -38,20 +38,20 @@ test_IPv6AddressWithPort(void) { #if defined(ISC_PLATFORM_HAVEIPV6) && defined(WANT_IPV6) - const struct in6_addr address = { + const struct in6_addr address = { { { 0x20, 0x01, 0x0d, 0xb8, - 0x85, 0xa3, 0x08, 0xd3, + 0x85, 0xa3, 0x08, 0xd3, 0x13, 0x19, 0x8a, 0x2e, 0x03, 0x70, 0x73, 0x34 - }; + } } }; const char* expected = "2001:db8:85a3:8d3:1319:8a2e:370:7334"; const char* expected_port = "[2001:db8:85a3:8d3:1319:8a2e:370:7334]:123"; - sockaddr_u input; - memset(&input, 0, sizeof(input)); + + ZERO(input); AF(&input) = AF_INET6; SET_ADDR6N(&input, address); SET_PORT(&input, 123); @@ -71,7 +71,7 @@ void test_ScopedIPv6AddressWithPort(void) { #if defined(ISC_PLATFORM_HAVESCOPEID) && defined(WANT_IPV6) - + const struct in6_addr address = { { { 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -83,9 +83,9 @@ test_ScopedIPv6AddressWithPort(void) "fe80::212:3fff:fe29:fffa%5"; const char* expected_port = "[fe80::212:3fff:fe29:fffa%5]:123"; - sockaddr_u input; - memset(&input, 0, sizeof(input)); + + ZERO(input); AF(&input) = AF_INET6; SET_ADDR6N(&input, address); SET_PORT(&input, 123); @@ -129,12 +129,12 @@ test_IgnoreIPv6Fields(void) { #if defined(ISC_PLATFORM_HAVEIPV6) && defined(WANT_IPV6) - const struct in6_addr address = { - 0x20, 0x01, 0x0d, 0xb8, - 0x85, 0xa3, 0x08, 0xd3, - 0x13, 0x19, 0x8a, 0x2e, - 0x03, 0x70, 0x73, 0x34 - }; + const struct in6_addr address = { { { + 0xfe, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x02, 0x12, 0x3f, 0xff, + 0xfe, 0x29, 0xff, 0xfa + } } }; sockaddr_u input1, input2; diff --git a/tests/libntp/strtolfp.c b/tests/libntp/strtolfp.c index 6855d9ba3a8a..9090159a69ab 100644 --- a/tests/libntp/strtolfp.c +++ b/tests/libntp/strtolfp.c @@ -26,6 +26,13 @@ setUp(void) return; } +static const char* fmtLFP(const l_fp *e, const l_fp *a) +{ + static char buf[100]; + snprintf(buf, sizeof(buf), "e=$%08x.%08x, a=$%08x.%08x", + e->l_ui, e->l_uf, a->l_ui, a->l_uf); + return buf; +} void test_PositiveInteger(void) { const char *str = "500"; @@ -37,8 +44,8 @@ void test_PositiveInteger(void) { TEST_ASSERT_TRUE(atolfp(str, &actual)); TEST_ASSERT_TRUE(mstolfp(str_ms, &actual_ms)); - TEST_ASSERT_TRUE(IsEqual(expected, actual)); - TEST_ASSERT_TRUE(IsEqual(expected, actual_ms)); + TEST_ASSERT_TRUE_MESSAGE(IsEqual(expected, actual), fmtLFP(&expected, &actual)); + TEST_ASSERT_TRUE_MESSAGE(IsEqual(expected, actual_ms), fmtLFP(&expected, &actual_ms)); } void test_NegativeInteger(void) { @@ -54,8 +61,8 @@ void test_NegativeInteger(void) { TEST_ASSERT_TRUE(atolfp(str, &actual)); TEST_ASSERT_TRUE(mstolfp(str_ms, &actual_ms)); - TEST_ASSERT_TRUE(IsEqual(expected, actual)); - TEST_ASSERT_TRUE(IsEqual(expected, actual_ms)); + TEST_ASSERT_TRUE_MESSAGE(IsEqual(expected, actual), fmtLFP(&expected, &actual)); + TEST_ASSERT_TRUE_MESSAGE(IsEqual(expected, actual_ms), fmtLFP(&expected, &actual_ms)); } void test_PositiveFraction(void) { @@ -68,8 +75,8 @@ void test_PositiveFraction(void) { TEST_ASSERT_TRUE(atolfp(str, &actual)); TEST_ASSERT_TRUE(mstolfp(str_ms, &actual_ms)); - TEST_ASSERT_TRUE(IsEqual(expected, actual)); - TEST_ASSERT_TRUE(IsEqual(expected, actual_ms)); + TEST_ASSERT_TRUE_MESSAGE(IsEqual(expected, actual), fmtLFP(&expected, &actual)); + TEST_ASSERT_TRUE_MESSAGE(IsEqual(expected, actual_ms), fmtLFP(&expected, &actual_ms)); } void test_NegativeFraction(void) { @@ -85,8 +92,8 @@ void test_NegativeFraction(void) { TEST_ASSERT_TRUE(atolfp(str, &actual)); TEST_ASSERT_TRUE(mstolfp(str_ms, &actual_ms)); - TEST_ASSERT_TRUE(IsEqual(expected, actual)); - TEST_ASSERT_TRUE(IsEqual(expected, actual_ms)); + TEST_ASSERT_TRUE_MESSAGE(IsEqual(expected, actual), fmtLFP(&expected, &actual)); + TEST_ASSERT_TRUE_MESSAGE(IsEqual(expected, actual_ms), fmtLFP(&expected, &actual_ms)); } void test_PositiveMsFraction(void) { @@ -100,9 +107,8 @@ void test_PositiveMsFraction(void) { TEST_ASSERT_TRUE(atolfp(str, &actual)); TEST_ASSERT_TRUE(mstolfp(str_ms, &actual_ms)); - TEST_ASSERT_TRUE(IsEqual(expected, actual)); - TEST_ASSERT_TRUE(IsEqual(expected, actual_ms)); - + TEST_ASSERT_TRUE_MESSAGE(IsEqual(expected, actual), fmtLFP(&expected, &actual)); + TEST_ASSERT_TRUE_MESSAGE(IsEqual(expected, actual_ms), fmtLFP(&expected, &actual_ms)); } void test_NegativeMsFraction(void) { @@ -118,9 +124,8 @@ void test_NegativeMsFraction(void) { TEST_ASSERT_TRUE(atolfp(str, &actual)); TEST_ASSERT_TRUE(mstolfp(str_ms, &actual_ms)); - TEST_ASSERT_TRUE(IsEqual(expected, actual)); - TEST_ASSERT_TRUE(IsEqual(expected, actual_ms)); - + TEST_ASSERT_TRUE_MESSAGE(IsEqual(expected, actual), fmtLFP(&expected, &actual)); + TEST_ASSERT_TRUE_MESSAGE(IsEqual(expected, actual_ms), fmtLFP(&expected, &actual_ms)); } void test_InvalidChars(void) { diff --git a/tests/libntp/test-libntp.h b/tests/libntp/test-libntp.h index 93050b32a1e2..176838b1e04a 100644 --- a/tests/libntp/test-libntp.h +++ b/tests/libntp/test-libntp.h @@ -1,3 +1,6 @@ +#ifndef TEST_LIBNTP_H +#define TEST_LIBNTP_H + #include "config.h" #include "ntp_stdlib.h" @@ -5,4 +8,5 @@ time_t timefunc(time_t *ptr); void settime(int y, int m, int d, int H, int M, int S); -time_t nowtime; +extern time_t nowtime; +#endif diff --git a/tests/libntp/vi64ops.c b/tests/libntp/vi64ops.c index 843c0a334b73..0891299e52fd 100644 --- a/tests/libntp/vi64ops.c +++ b/tests/libntp/vi64ops.c @@ -39,7 +39,7 @@ void test_ParseVUI64_pos(void) { vint64 act, exp; const char *sp; - char *ep; + char const *ep; sp = "1234x"; exp.D_s.hi = 0; @@ -55,7 +55,7 @@ void test_ParseVUI64_neg(void) { vint64 act, exp; const char *sp; - char *ep; + char const *ep; sp = "-1234x"; exp.D_s.hi = ~0; @@ -69,7 +69,7 @@ void test_ParseVUI64_case(void) { vint64 act, exp; const char *sp; - char *ep; + char const *ep; sp = "0123456789AbCdEf"; exp.D_s.hi = 0x01234567; diff --git a/tests/ntpd/Makefile.am b/tests/ntpd/Makefile.am index 35ebcde334e8..24830f917cb3 100644 --- a/tests/ntpd/Makefile.am +++ b/tests/ntpd/Makefile.am @@ -1,6 +1,7 @@ NULL = BUILT_SOURCES = CLEANFILES = +DISTCLEANFILES = std_unity_list = \ $(abs_top_srcdir)/sntp/unity/auto/generate_test_runner.rb \ @@ -89,7 +90,7 @@ test_leapsec_LDADD = \ test_leapsec_SOURCES = \ leapsec.c \ run-leapsec.c \ - $(srcdir)/../libntp/test-libntp.c \ + test-libntp.c \ $(NULL) $(srcdir)/run-leapsec.c: $(srcdir)/leapsec.c $(std_unity_list) @@ -109,12 +110,14 @@ test_ntp_prio_q_LDADD = \ test_ntp_prio_q_SOURCES = \ ntp_prio_q.c \ run-ntp_prio_q.c \ - $(srcdir)/../libntp/test-libntp.c \ + test-libntp.c \ $(NULL) $(srcdir)/run-ntp_prio_q.c: $(srcdir)/ntp_prio_q.c $(std_unity_list) $(run_unity) $< $@ +../../ntpd/ntpdsim-ntp_prio_q.o: + cd ../../ntpd && $(MAKE) $(AM_MAKEFLAGS) ntpdsim-ntp_prio_q.o ### test_ntp_restrict_CFLAGS = \ @@ -129,7 +132,7 @@ test_ntp_restrict_LDADD = \ test_ntp_restrict_SOURCES = \ ntp_restrict.c \ run-ntp_restrict.c \ - $(srcdir)/../libntp/test-libntp.c \ + test-libntp.c \ $(NULL) $(srcdir)/run-ntp_restrict.c: $(srcdir)/ntp_restrict.c $(std_unity_list) @@ -150,7 +153,7 @@ test_rc_cmdlength_LDADD = \ test_rc_cmdlength_SOURCES = \ rc_cmdlength.c \ run-rc_cmdlength.c \ - $(srcdir)/../libntp/test-libntp.c \ + test-libntp.c \ $(NULL) $(srcdir)/run-rc_cmdlength.c: $(srcdir)/rc_cmdlength.c $(std_unity_list) @@ -167,7 +170,7 @@ test_ntp_signd_LDADD = \ test_ntp_signd_SOURCES = \ t-ntp_signd.c \ run-t-ntp_signd.c \ - $(srcdir)/../libntp/test-libntp.c \ + test-libntp.c \ $(NULL) $(srcdir)/run-t-ntp_signd.c: $(srcdir)/t-ntp_signd.c $(std_unity_list) @@ -189,7 +192,7 @@ test_ntp_scanner_LDADD = \ test_ntp_scanner_SOURCES = \ t-ntp_scanner.c \ run-t-ntp_scanner.c \ - $(srcdir)/../libntp/test-libntp.c \ + test-libntp.c \ $(NULL) $(srcdir)/run-t-ntp_scanner.c: $(srcdir)/t-ntp_scanner.c $(std_unity_list) @@ -202,34 +205,8 @@ if !NTP_CROSSCOMPILE TESTS += $(check_PROGRAMS) endif -## check-libntp.mf - automake fragment -## slightly adapted for deeper directory - -BUILT_SOURCES += check-libntpd check-libntp check-libunity -CLEANFILES += check-libntpd check-libntp check-libunity - -check-libntpd: ../../ntpd/libntpd.a - @echo stamp > $@ - -../../ntpd/libntpd.a: - cd ../../ntpd && $(MAKE) $(AM_MAKEFLAGS) libntpd.a - - -check-libntp: ../../libntp/libntp.a - @echo stamp > $@ - -../../libntp/libntp.a: - cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a - - -check-libunity: ../../sntp/unity/libunity.a - @echo stamp > $@ - -../../sntp/unity/libunity.a: - cd ../../sntp/unity && $(MAKE) $(AM_MAKEFLAGS) libunity.a - -$(top_builddir)/ntpd/ntpdsim-ntp_prio_q.o: - cd ../../ntpd/ && $(MAKE) $(AM_MAKEFLAGS) ntpdsim-ntp_prio_q.o - +include $(top_srcdir)/check-libntp.mf +include $(top_srcdir)/check-libntpd.mf +include $(top_srcdir)/check-libunity.mf include $(top_srcdir)/depsver.mf include $(top_srcdir)/includes.mf diff --git a/tests/ntpd/Makefile.in b/tests/ntpd/Makefile.in index fd52fa5d0c96..fb0b08a2b548 100644 --- a/tests/ntpd/Makefile.in +++ b/tests/ntpd/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -116,7 +116,6 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_debug.m4 \ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \ - $(top_srcdir)/sntp/m4/ntp_googletest.m4 \ $(top_srcdir)/sntp/m4/ntp_harden.m4 \ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \ @@ -136,6 +135,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ + $(top_srcdir)/sntp/m4/realpath.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -238,7 +238,24 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/sntp/libevent/build-aux/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/run-t-ntp_signd.Po \ + ./$(DEPDIR)/t-ntp_signd.Po ./$(DEPDIR)/test-libntp.Po \ + ./$(DEPDIR)/test_leapsec-leapsec.Po \ + ./$(DEPDIR)/test_leapsec-run-leapsec.Po \ + ./$(DEPDIR)/test_leapsec-test-libntp.Po \ + ./$(DEPDIR)/test_ntp_prio_q-ntp_prio_q.Po \ + ./$(DEPDIR)/test_ntp_prio_q-run-ntp_prio_q.Po \ + ./$(DEPDIR)/test_ntp_prio_q-test-libntp.Po \ + ./$(DEPDIR)/test_ntp_restrict-ntp_restrict.Po \ + ./$(DEPDIR)/test_ntp_restrict-run-ntp_restrict.Po \ + ./$(DEPDIR)/test_ntp_restrict-test-libntp.Po \ + ./$(DEPDIR)/test_ntp_scanner-run-t-ntp_scanner.Po \ + ./$(DEPDIR)/test_ntp_scanner-t-ntp_scanner.Po \ + ./$(DEPDIR)/test_ntp_scanner-test-libntp.Po \ + ./$(DEPDIR)/test_rc_cmdlength-rc_cmdlength.Po \ + ./$(DEPDIR)/test_rc_cmdlength-run-rc_cmdlength.Po \ + ./$(DEPDIR)/test_rc_cmdlength-test-libntp.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -286,8 +303,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no @@ -470,6 +485,7 @@ am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log @@ -494,8 +510,9 @@ TEST_LOG_DRIVER = $(SHELL) \ $(top_srcdir)/sntp/libevent/build-aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depsver.mf \ - $(top_srcdir)/includes.mf \ +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/check-libntp.mf \ + $(top_srcdir)/check-libntpd.mf $(top_srcdir)/check-libunity.mf \ + $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf \ $(top_srcdir)/sntp/libevent/build-aux/depcomp \ $(top_srcdir)/sntp/libevent/build-aux/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -516,6 +533,7 @@ CALC_TICKADJ_MS = @CALC_TICKADJ_MS@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CC_NOFORMAT = @CC_NOFORMAT@ CFLAGS = @CFLAGS@ CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@ CFLAGS_NTP = @CFLAGS_NTP@ @@ -525,6 +543,8 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ CPPFLAGS_NTP = @CPPFLAGS_NTP@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ DEFS = @DEFS@ @@ -537,14 +557,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EDITLINE_LIBS = @EDITLINE_LIBS@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ -GTEST_CONFIG = @GTEST_CONFIG@ -GTEST_CPPFLAGS = @GTEST_CPPFLAGS@ -GTEST_CXXFLAGS = @GTEST_CXXFLAGS@ -GTEST_LDFLAGS = @GTEST_LDFLAGS@ -GTEST_LIBS = @GTEST_LIBS@ HAVE_INLINE = @HAVE_INLINE@ HAVE_LEAPSMEARINTERVAL = @HAVE_LEAPSMEARINTERVAL@ HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@ @@ -755,6 +771,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -767,9 +784,15 @@ top_srcdir = @top_srcdir@ NULL = BUILT_SOURCES = $(srcdir)/run-leapsec.c $(srcdir)/run-ntp_prio_q.c \ $(srcdir)/run-ntp_restrict.c $(srcdir)/run-rc_cmdlength.c \ - $(srcdir)/run-t-ntp_signd.c $(NULL) check-libntpd check-libntp \ + $(srcdir)/run-t-ntp_signd.c $(NULL) check-libntp check-libntpd \ check-libunity .deps-ver -CLEANFILES = check-libntpd check-libntp check-libunity .deps-ver + +# CLEANFILES addition below won't be needed after a while. +# Leave it in for now for folks tracking the source repo +# who have the file from a former version of the rule. +# DLH Jan 2023 +CLEANFILES = check-libntp check-libntpd .deps-ver +DISTCLEANFILES = $(DEPDIR)/deps-ver std_unity_list = \ $(abs_top_srcdir)/sntp/unity/auto/generate_test_runner.rb \ $(abs_srcdir)/testconf.yml \ @@ -816,7 +839,7 @@ test_leapsec_LDADD = \ test_leapsec_SOURCES = \ leapsec.c \ run-leapsec.c \ - $(srcdir)/../libntp/test-libntp.c \ + test-libntp.c \ $(NULL) @@ -834,7 +857,7 @@ test_ntp_prio_q_LDADD = \ test_ntp_prio_q_SOURCES = \ ntp_prio_q.c \ run-ntp_prio_q.c \ - $(srcdir)/../libntp/test-libntp.c \ + test-libntp.c \ $(NULL) @@ -851,7 +874,7 @@ test_ntp_restrict_LDADD = \ test_ntp_restrict_SOURCES = \ ntp_restrict.c \ run-ntp_restrict.c \ - $(srcdir)/../libntp/test-libntp.c \ + test-libntp.c \ $(NULL) @@ -868,7 +891,7 @@ test_rc_cmdlength_LDADD = \ test_rc_cmdlength_SOURCES = \ rc_cmdlength.c \ run-rc_cmdlength.c \ - $(srcdir)/../libntp/test-libntp.c \ + test-libntp.c \ $(NULL) @@ -882,7 +905,7 @@ test_ntp_signd_LDADD = \ test_ntp_signd_SOURCES = \ t-ntp_signd.c \ run-t-ntp_signd.c \ - $(srcdir)/../libntp/test-libntp.c \ + test-libntp.c \ $(NULL) @@ -902,19 +925,20 @@ test_ntp_scanner_LDADD = \ test_ntp_scanner_SOURCES = \ t-ntp_scanner.c \ run-t-ntp_scanner.c \ - $(srcdir)/../libntp/test-libntp.c \ + test-libntp.c \ $(NULL) TESTS = $(am__append_4) -NTP_INCS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ - -I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ - -I$(top_srcdir)/lib/isc/unix/include +NTP_INCS = -I$(top_srcdir)/include \ + -I$(top_srcdir)/libntp/lib/isc/include \ + -I$(top_srcdir)/libntp/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ + -I$(top_srcdir)/libntp/lib/isc/unix/include all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/check-libntp.mf $(top_srcdir)/check-libntpd.mf $(top_srcdir)/check-libunity.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -931,10 +955,10 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; -$(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): +$(top_srcdir)/check-libntp.mf $(top_srcdir)/check-libntpd.mf $(top_srcdir)/check-libunity.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -984,42 +1008,51 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-t-ntp_signd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-ntp_signd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-libntp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_leapsec-leapsec.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_leapsec-run-leapsec.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_leapsec-test-libntp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_prio_q-ntp_prio_q.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_prio_q-run-ntp_prio_q.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_prio_q-test-libntp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_restrict-ntp_restrict.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_restrict-run-ntp_restrict.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_restrict-test-libntp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_scanner-run-t-ntp_scanner.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_scanner-t-ntp_scanner.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_scanner-test-libntp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_rc_cmdlength-rc_cmdlength.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_rc_cmdlength-run-rc_cmdlength.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_rc_cmdlength-test-libntp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-t-ntp_signd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-ntp_signd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-libntp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_leapsec-leapsec.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_leapsec-run-leapsec.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_leapsec-test-libntp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_prio_q-ntp_prio_q.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_prio_q-run-ntp_prio_q.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_prio_q-test-libntp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_restrict-ntp_restrict.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_restrict-run-ntp_restrict.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_restrict-test-libntp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_scanner-run-t-ntp_scanner.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_scanner-t-ntp_scanner.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_scanner-test-libntp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_rc_cmdlength-rc_cmdlength.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_rc_cmdlength-run-rc_cmdlength.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_rc_cmdlength-test-libntp.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @@ -1052,19 +1085,19 @@ test_leapsec-run-leapsec.obj: run-leapsec.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -c -o test_leapsec-run-leapsec.obj `if test -f 'run-leapsec.c'; then $(CYGPATH_W) 'run-leapsec.c'; else $(CYGPATH_W) '$(srcdir)/run-leapsec.c'; fi` -test_leapsec-test-libntp.o: $(srcdir)/../libntp/test-libntp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -MT test_leapsec-test-libntp.o -MD -MP -MF $(DEPDIR)/test_leapsec-test-libntp.Tpo -c -o test_leapsec-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c +test_leapsec-test-libntp.o: test-libntp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -MT test_leapsec-test-libntp.o -MD -MP -MF $(DEPDIR)/test_leapsec-test-libntp.Tpo -c -o test_leapsec-test-libntp.o `test -f 'test-libntp.c' || echo '$(srcdir)/'`test-libntp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_leapsec-test-libntp.Tpo $(DEPDIR)/test_leapsec-test-libntp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_leapsec-test-libntp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-libntp.c' object='test_leapsec-test-libntp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -c -o test_leapsec-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -c -o test_leapsec-test-libntp.o `test -f 'test-libntp.c' || echo '$(srcdir)/'`test-libntp.c -test_leapsec-test-libntp.obj: $(srcdir)/../libntp/test-libntp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -MT test_leapsec-test-libntp.obj -MD -MP -MF $(DEPDIR)/test_leapsec-test-libntp.Tpo -c -o test_leapsec-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi` +test_leapsec-test-libntp.obj: test-libntp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -MT test_leapsec-test-libntp.obj -MD -MP -MF $(DEPDIR)/test_leapsec-test-libntp.Tpo -c -o test_leapsec-test-libntp.obj `if test -f 'test-libntp.c'; then $(CYGPATH_W) 'test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/test-libntp.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_leapsec-test-libntp.Tpo $(DEPDIR)/test_leapsec-test-libntp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_leapsec-test-libntp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-libntp.c' object='test_leapsec-test-libntp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -c -o test_leapsec-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -c -o test_leapsec-test-libntp.obj `if test -f 'test-libntp.c'; then $(CYGPATH_W) 'test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/test-libntp.c'; fi` test_ntp_prio_q-ntp_prio_q.o: ntp_prio_q.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -MT test_ntp_prio_q-ntp_prio_q.o -MD -MP -MF $(DEPDIR)/test_ntp_prio_q-ntp_prio_q.Tpo -c -o test_ntp_prio_q-ntp_prio_q.o `test -f 'ntp_prio_q.c' || echo '$(srcdir)/'`ntp_prio_q.c @@ -1094,19 +1127,19 @@ test_ntp_prio_q-run-ntp_prio_q.obj: run-ntp_prio_q.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -c -o test_ntp_prio_q-run-ntp_prio_q.obj `if test -f 'run-ntp_prio_q.c'; then $(CYGPATH_W) 'run-ntp_prio_q.c'; else $(CYGPATH_W) '$(srcdir)/run-ntp_prio_q.c'; fi` -test_ntp_prio_q-test-libntp.o: $(srcdir)/../libntp/test-libntp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -MT test_ntp_prio_q-test-libntp.o -MD -MP -MF $(DEPDIR)/test_ntp_prio_q-test-libntp.Tpo -c -o test_ntp_prio_q-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c +test_ntp_prio_q-test-libntp.o: test-libntp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -MT test_ntp_prio_q-test-libntp.o -MD -MP -MF $(DEPDIR)/test_ntp_prio_q-test-libntp.Tpo -c -o test_ntp_prio_q-test-libntp.o `test -f 'test-libntp.c' || echo '$(srcdir)/'`test-libntp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_prio_q-test-libntp.Tpo $(DEPDIR)/test_ntp_prio_q-test-libntp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_ntp_prio_q-test-libntp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-libntp.c' object='test_ntp_prio_q-test-libntp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -c -o test_ntp_prio_q-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -c -o test_ntp_prio_q-test-libntp.o `test -f 'test-libntp.c' || echo '$(srcdir)/'`test-libntp.c -test_ntp_prio_q-test-libntp.obj: $(srcdir)/../libntp/test-libntp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -MT test_ntp_prio_q-test-libntp.obj -MD -MP -MF $(DEPDIR)/test_ntp_prio_q-test-libntp.Tpo -c -o test_ntp_prio_q-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi` +test_ntp_prio_q-test-libntp.obj: test-libntp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -MT test_ntp_prio_q-test-libntp.obj -MD -MP -MF $(DEPDIR)/test_ntp_prio_q-test-libntp.Tpo -c -o test_ntp_prio_q-test-libntp.obj `if test -f 'test-libntp.c'; then $(CYGPATH_W) 'test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/test-libntp.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_prio_q-test-libntp.Tpo $(DEPDIR)/test_ntp_prio_q-test-libntp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_ntp_prio_q-test-libntp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-libntp.c' object='test_ntp_prio_q-test-libntp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -c -o test_ntp_prio_q-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -c -o test_ntp_prio_q-test-libntp.obj `if test -f 'test-libntp.c'; then $(CYGPATH_W) 'test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/test-libntp.c'; fi` test_ntp_restrict-ntp_restrict.o: ntp_restrict.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -MT test_ntp_restrict-ntp_restrict.o -MD -MP -MF $(DEPDIR)/test_ntp_restrict-ntp_restrict.Tpo -c -o test_ntp_restrict-ntp_restrict.o `test -f 'ntp_restrict.c' || echo '$(srcdir)/'`ntp_restrict.c @@ -1136,19 +1169,19 @@ test_ntp_restrict-run-ntp_restrict.obj: run-ntp_restrict.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -c -o test_ntp_restrict-run-ntp_restrict.obj `if test -f 'run-ntp_restrict.c'; then $(CYGPATH_W) 'run-ntp_restrict.c'; else $(CYGPATH_W) '$(srcdir)/run-ntp_restrict.c'; fi` -test_ntp_restrict-test-libntp.o: $(srcdir)/../libntp/test-libntp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -MT test_ntp_restrict-test-libntp.o -MD -MP -MF $(DEPDIR)/test_ntp_restrict-test-libntp.Tpo -c -o test_ntp_restrict-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c +test_ntp_restrict-test-libntp.o: test-libntp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -MT test_ntp_restrict-test-libntp.o -MD -MP -MF $(DEPDIR)/test_ntp_restrict-test-libntp.Tpo -c -o test_ntp_restrict-test-libntp.o `test -f 'test-libntp.c' || echo '$(srcdir)/'`test-libntp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_restrict-test-libntp.Tpo $(DEPDIR)/test_ntp_restrict-test-libntp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_ntp_restrict-test-libntp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-libntp.c' object='test_ntp_restrict-test-libntp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -c -o test_ntp_restrict-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -c -o test_ntp_restrict-test-libntp.o `test -f 'test-libntp.c' || echo '$(srcdir)/'`test-libntp.c -test_ntp_restrict-test-libntp.obj: $(srcdir)/../libntp/test-libntp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -MT test_ntp_restrict-test-libntp.obj -MD -MP -MF $(DEPDIR)/test_ntp_restrict-test-libntp.Tpo -c -o test_ntp_restrict-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi` +test_ntp_restrict-test-libntp.obj: test-libntp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -MT test_ntp_restrict-test-libntp.obj -MD -MP -MF $(DEPDIR)/test_ntp_restrict-test-libntp.Tpo -c -o test_ntp_restrict-test-libntp.obj `if test -f 'test-libntp.c'; then $(CYGPATH_W) 'test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/test-libntp.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_restrict-test-libntp.Tpo $(DEPDIR)/test_ntp_restrict-test-libntp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_ntp_restrict-test-libntp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-libntp.c' object='test_ntp_restrict-test-libntp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -c -o test_ntp_restrict-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -c -o test_ntp_restrict-test-libntp.obj `if test -f 'test-libntp.c'; then $(CYGPATH_W) 'test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/test-libntp.c'; fi` test_ntp_scanner-t-ntp_scanner.o: t-ntp_scanner.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -MT test_ntp_scanner-t-ntp_scanner.o -MD -MP -MF $(DEPDIR)/test_ntp_scanner-t-ntp_scanner.Tpo -c -o test_ntp_scanner-t-ntp_scanner.o `test -f 't-ntp_scanner.c' || echo '$(srcdir)/'`t-ntp_scanner.c @@ -1178,33 +1211,19 @@ test_ntp_scanner-run-t-ntp_scanner.obj: run-t-ntp_scanner.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -c -o test_ntp_scanner-run-t-ntp_scanner.obj `if test -f 'run-t-ntp_scanner.c'; then $(CYGPATH_W) 'run-t-ntp_scanner.c'; else $(CYGPATH_W) '$(srcdir)/run-t-ntp_scanner.c'; fi` -test_ntp_scanner-test-libntp.o: $(srcdir)/../libntp/test-libntp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -MT test_ntp_scanner-test-libntp.o -MD -MP -MF $(DEPDIR)/test_ntp_scanner-test-libntp.Tpo -c -o test_ntp_scanner-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c +test_ntp_scanner-test-libntp.o: test-libntp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -MT test_ntp_scanner-test-libntp.o -MD -MP -MF $(DEPDIR)/test_ntp_scanner-test-libntp.Tpo -c -o test_ntp_scanner-test-libntp.o `test -f 'test-libntp.c' || echo '$(srcdir)/'`test-libntp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_scanner-test-libntp.Tpo $(DEPDIR)/test_ntp_scanner-test-libntp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_ntp_scanner-test-libntp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-libntp.c' object='test_ntp_scanner-test-libntp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -c -o test_ntp_scanner-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -c -o test_ntp_scanner-test-libntp.o `test -f 'test-libntp.c' || echo '$(srcdir)/'`test-libntp.c -test_ntp_scanner-test-libntp.obj: $(srcdir)/../libntp/test-libntp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -MT test_ntp_scanner-test-libntp.obj -MD -MP -MF $(DEPDIR)/test_ntp_scanner-test-libntp.Tpo -c -o test_ntp_scanner-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi` +test_ntp_scanner-test-libntp.obj: test-libntp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -MT test_ntp_scanner-test-libntp.obj -MD -MP -MF $(DEPDIR)/test_ntp_scanner-test-libntp.Tpo -c -o test_ntp_scanner-test-libntp.obj `if test -f 'test-libntp.c'; then $(CYGPATH_W) 'test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/test-libntp.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_scanner-test-libntp.Tpo $(DEPDIR)/test_ntp_scanner-test-libntp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_ntp_scanner-test-libntp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-libntp.c' object='test_ntp_scanner-test-libntp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -c -o test_ntp_scanner-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi` - -test-libntp.o: $(srcdir)/../libntp/test-libntp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test-libntp.o -MD -MP -MF $(DEPDIR)/test-libntp.Tpo -c -o test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-libntp.Tpo $(DEPDIR)/test-libntp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test-libntp.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c - -test-libntp.obj: $(srcdir)/../libntp/test-libntp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test-libntp.obj -MD -MP -MF $(DEPDIR)/test-libntp.Tpo -c -o test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-libntp.Tpo $(DEPDIR)/test-libntp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test-libntp.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -c -o test_ntp_scanner-test-libntp.obj `if test -f 'test-libntp.c'; then $(CYGPATH_W) 'test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/test-libntp.c'; fi` test_rc_cmdlength-rc_cmdlength.o: rc_cmdlength.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -MT test_rc_cmdlength-rc_cmdlength.o -MD -MP -MF $(DEPDIR)/test_rc_cmdlength-rc_cmdlength.Tpo -c -o test_rc_cmdlength-rc_cmdlength.o `test -f 'rc_cmdlength.c' || echo '$(srcdir)/'`rc_cmdlength.c @@ -1234,19 +1253,19 @@ test_rc_cmdlength-run-rc_cmdlength.obj: run-rc_cmdlength.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -c -o test_rc_cmdlength-run-rc_cmdlength.obj `if test -f 'run-rc_cmdlength.c'; then $(CYGPATH_W) 'run-rc_cmdlength.c'; else $(CYGPATH_W) '$(srcdir)/run-rc_cmdlength.c'; fi` -test_rc_cmdlength-test-libntp.o: $(srcdir)/../libntp/test-libntp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -MT test_rc_cmdlength-test-libntp.o -MD -MP -MF $(DEPDIR)/test_rc_cmdlength-test-libntp.Tpo -c -o test_rc_cmdlength-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c +test_rc_cmdlength-test-libntp.o: test-libntp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -MT test_rc_cmdlength-test-libntp.o -MD -MP -MF $(DEPDIR)/test_rc_cmdlength-test-libntp.Tpo -c -o test_rc_cmdlength-test-libntp.o `test -f 'test-libntp.c' || echo '$(srcdir)/'`test-libntp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_rc_cmdlength-test-libntp.Tpo $(DEPDIR)/test_rc_cmdlength-test-libntp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_rc_cmdlength-test-libntp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-libntp.c' object='test_rc_cmdlength-test-libntp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -c -o test_rc_cmdlength-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -c -o test_rc_cmdlength-test-libntp.o `test -f 'test-libntp.c' || echo '$(srcdir)/'`test-libntp.c -test_rc_cmdlength-test-libntp.obj: $(srcdir)/../libntp/test-libntp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -MT test_rc_cmdlength-test-libntp.obj -MD -MP -MF $(DEPDIR)/test_rc_cmdlength-test-libntp.Tpo -c -o test_rc_cmdlength-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi` +test_rc_cmdlength-test-libntp.obj: test-libntp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -MT test_rc_cmdlength-test-libntp.obj -MD -MP -MF $(DEPDIR)/test_rc_cmdlength-test-libntp.Tpo -c -o test_rc_cmdlength-test-libntp.obj `if test -f 'test-libntp.c'; then $(CYGPATH_W) 'test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/test-libntp.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_rc_cmdlength-test-libntp.Tpo $(DEPDIR)/test_rc_cmdlength-test-libntp.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_rc_cmdlength-test-libntp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-libntp.c' object='test_rc_cmdlength-test-libntp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -c -o test_rc_cmdlength-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -c -o test_rc_cmdlength-test-libntp.obj `if test -f 'test-libntp.c'; then $(CYGPATH_W) 'test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/test-libntp.c'; fi` mostlyclean-libtool: -rm -f *.lo @@ -1413,7 +1432,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ - echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ @@ -1426,7 +1445,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) fi; \ $$success || exit 1 -check-TESTS: +check-TESTS: $(check_PROGRAMS) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @@ -1503,8 +1522,10 @@ test-rc_cmdlength.log: test-rc_cmdlength$(EXEEXT) @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -1543,7 +1564,8 @@ all-am: Makefile installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -1572,6 +1594,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -1583,7 +1606,24 @@ clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/run-t-ntp_signd.Po + -rm -f ./$(DEPDIR)/t-ntp_signd.Po + -rm -f ./$(DEPDIR)/test-libntp.Po + -rm -f ./$(DEPDIR)/test_leapsec-leapsec.Po + -rm -f ./$(DEPDIR)/test_leapsec-run-leapsec.Po + -rm -f ./$(DEPDIR)/test_leapsec-test-libntp.Po + -rm -f ./$(DEPDIR)/test_ntp_prio_q-ntp_prio_q.Po + -rm -f ./$(DEPDIR)/test_ntp_prio_q-run-ntp_prio_q.Po + -rm -f ./$(DEPDIR)/test_ntp_prio_q-test-libntp.Po + -rm -f ./$(DEPDIR)/test_ntp_restrict-ntp_restrict.Po + -rm -f ./$(DEPDIR)/test_ntp_restrict-run-ntp_restrict.Po + -rm -f ./$(DEPDIR)/test_ntp_restrict-test-libntp.Po + -rm -f ./$(DEPDIR)/test_ntp_scanner-run-t-ntp_scanner.Po + -rm -f ./$(DEPDIR)/test_ntp_scanner-t-ntp_scanner.Po + -rm -f ./$(DEPDIR)/test_ntp_scanner-test-libntp.Po + -rm -f ./$(DEPDIR)/test_rc_cmdlength-rc_cmdlength.Po + -rm -f ./$(DEPDIR)/test_rc_cmdlength-run-rc_cmdlength.Po + -rm -f ./$(DEPDIR)/test_rc_cmdlength-test-libntp.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -1629,7 +1669,24 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/run-t-ntp_signd.Po + -rm -f ./$(DEPDIR)/t-ntp_signd.Po + -rm -f ./$(DEPDIR)/test-libntp.Po + -rm -f ./$(DEPDIR)/test_leapsec-leapsec.Po + -rm -f ./$(DEPDIR)/test_leapsec-run-leapsec.Po + -rm -f ./$(DEPDIR)/test_leapsec-test-libntp.Po + -rm -f ./$(DEPDIR)/test_ntp_prio_q-ntp_prio_q.Po + -rm -f ./$(DEPDIR)/test_ntp_prio_q-run-ntp_prio_q.Po + -rm -f ./$(DEPDIR)/test_ntp_prio_q-test-libntp.Po + -rm -f ./$(DEPDIR)/test_ntp_restrict-ntp_restrict.Po + -rm -f ./$(DEPDIR)/test_ntp_restrict-run-ntp_restrict.Po + -rm -f ./$(DEPDIR)/test_ntp_restrict-test-libntp.Po + -rm -f ./$(DEPDIR)/test_ntp_scanner-run-t-ntp_scanner.Po + -rm -f ./$(DEPDIR)/test_ntp_scanner-t-ntp_scanner.Po + -rm -f ./$(DEPDIR)/test_ntp_scanner-test-libntp.Po + -rm -f ./$(DEPDIR)/test_rc_cmdlength-rc_cmdlength.Po + -rm -f ./$(DEPDIR)/test_rc_cmdlength-run-rc_cmdlength.Po + -rm -f ./$(DEPDIR)/test_rc_cmdlength-test-libntp.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -1648,18 +1705,19 @@ ps-am: uninstall-am: -.MAKE: all check check-am install install-am install-strip +.MAKE: all check check-am install install-am install-exec \ + install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ - clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am @@ -1673,6 +1731,9 @@ $(srcdir)/run-leapsec.c: $(srcdir)/leapsec.c $(std_unity_list) $(srcdir)/run-ntp_prio_q.c: $(srcdir)/ntp_prio_q.c $(std_unity_list) $(run_unity) $< $@ +../../ntpd/ntpdsim-ntp_prio_q.o: + cd ../../ntpd && $(MAKE) $(AM_MAKEFLAGS) ntpdsim-ntp_prio_q.o + $(srcdir)/run-ntp_restrict.c: $(srcdir)/ntp_restrict.c $(std_unity_list) $(run_unity) $< $@ @@ -1685,33 +1746,30 @@ $(srcdir)/run-t-ntp_signd.c: $(srcdir)/t-ntp_signd.c $(std_unity_list) $(srcdir)/run-t-ntp_scanner.c: $(srcdir)/t-ntp_scanner.c $(std_unity_list) $(run_unity) $< $@ -check-libntpd: ../../ntpd/libntpd.a - @echo stamp > $@ +check-libntp: $(top_builddir)/libntp/libntp.a + @: avoid default SCCS get by some make implementations -../../ntpd/libntpd.a: - cd ../../ntpd && $(MAKE) $(AM_MAKEFLAGS) libntpd.a +$(top_builddir)/libntp/libntp.a: + cd $(top_builddir)/libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a -check-libntp: ../../libntp/libntp.a - @echo stamp > $@ +check-libntpd: $(top_builddir)/ntpd/libntpd.a + @: avoid default SCCS get by some make implementations -../../libntp/libntp.a: - cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a +$(top_builddir)/ntpd/libntpd.a: + cd $(top_builddir)/ntpd && $(MAKE) $(AM_MAKEFLAGS) libntpd.a -check-libunity: ../../sntp/unity/libunity.a - @echo stamp > $@ +check-libunity: $(top_builddir)/sntp/unity/libunity.a + @: avoid default SCCS get by some make implementations -../../sntp/unity/libunity.a: - cd ../../sntp/unity && $(MAKE) $(AM_MAKEFLAGS) libunity.a - -$(top_builddir)/ntpd/ntpdsim-ntp_prio_q.o: - cd ../../ntpd/ && $(MAKE) $(AM_MAKEFLAGS) ntpdsim-ntp_prio_q.o +$(top_builddir)/sntp/unity/libunity.a: + cd $(top_builddir)/sntp/unity && $(MAKE) $(AM_MAKEFLAGS) libunity.a $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ - chmod ug+w $@ + chmod u+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ - $(MAKE) $(AM_MAKEFLAGS) clean && \ + $(MAKE) $(AM_MAKEFLAGS) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ @@ -1729,7 +1787,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) - cp $(top_srcdir)/deps-ver $@ + $(AM_V_at)cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/deps-ver @@ -1759,7 +1817,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # -# This comment block follows rather than leads the related code so that +# This comment block follows rather than leads the related rules so that # it stays with it in the generated Makefile.in and Makefile. # diff --git a/tests/ntpd/test-libntp.c b/tests/ntpd/test-libntp.c new file mode 100644 index 000000000000..91d4b3af4a1f --- /dev/null +++ b/tests/ntpd/test-libntp.c @@ -0,0 +1,2 @@ +#include "../libntp/test-libntp.c" + diff --git a/tests/ntpq/Makefile.am b/tests/ntpq/Makefile.am index 23ca1814b897..9d244258e8bf 100644 --- a/tests/ntpq/Makefile.am +++ b/tests/ntpq/Makefile.am @@ -1,6 +1,7 @@ NULL = BUILT_SOURCES = CLEANFILES = +DISTCLEANFILES = std_unity_list = \ $(abs_top_srcdir)/sntp/unity/auto/generate_test_runner.rb \ @@ -19,7 +20,6 @@ check_PROGRAMS = \ LDADD = \ $(top_builddir)/ntpq/libntpq.a \ - $(top_builddir)/ntpd/libntpd.a \ $(top_builddir)/libntp/libntp.a \ $(LDADD_LIBNTP) \ $(PTHREAD_LIBS) \ @@ -74,32 +74,7 @@ if !NTP_CROSSCOMPILE TESTS += $(check_PROGRAMS) endif -## check-libntp.mf - automake fragment -## slightly adapted for deeper directory - -BUILT_SOURCES += check-libntpd check-libntp check-libunity -CLEANFILES += check-libntpd check-libntp check-libunity - -check-libntpd: ../../ntpd/libntpd.a - @echo stamp > $@ - -../../ntpd/libntpd.a: - cd ../../ntpd && $(MAKE) $(AM_MAKEFLAGS) libntpd.a - - -check-libntp: ../../libntp/libntp.a - @echo stamp > $@ - -../../libntp/libntp.a: - cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a - - -check-libunity: ../../sntp/unity/libunity.a - @echo stamp > $@ - -../../sntp/unity/libunity.a: - cd ../../sntp/unity && $(MAKE) $(AM_MAKEFLAGS) libunity.a - - +include $(top_srcdir)/check-libntp.mf +include $(top_srcdir)/check-libunity.mf include $(top_srcdir)/depsver.mf include $(top_srcdir)/includes.mf diff --git a/tests/ntpq/Makefile.in b/tests/ntpq/Makefile.in index 1d35e3de7c55..7678393037aa 100644 --- a/tests/ntpq/Makefile.in +++ b/tests/ntpq/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -110,7 +110,6 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_debug.m4 \ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \ - $(top_srcdir)/sntp/m4/ntp_googletest.m4 \ $(top_srcdir)/sntp/m4/ntp_harden.m4 \ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \ @@ -130,6 +129,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ + $(top_srcdir)/sntp/m4/realpath.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -147,9 +147,9 @@ am_test_ntpq_OBJECTS = t-ntpq.$(OBJEXT) run-t-ntpq.$(OBJEXT) \ test_ntpq_OBJECTS = $(am_test_ntpq_OBJECTS) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = $(top_builddir)/ntpq/libntpq.a \ - $(top_builddir)/ntpd/libntpd.a $(top_builddir)/libntp/libntp.a \ + $(top_builddir)/libntp/libntp.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2) \ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) @@ -172,7 +172,8 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/sntp/libevent/build-aux/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/run-t-ntpq.Po ./$(DEPDIR)/t-ntpq.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -217,8 +218,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no @@ -401,6 +400,7 @@ am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log @@ -425,7 +425,8 @@ TEST_LOG_DRIVER = $(SHELL) \ $(top_srcdir)/sntp/libevent/build-aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depsver.mf \ +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/check-libntp.mf \ + $(top_srcdir)/check-libunity.mf $(top_srcdir)/depsver.mf \ $(top_srcdir)/includes.mf \ $(top_srcdir)/sntp/libevent/build-aux/depcomp \ $(top_srcdir)/sntp/libevent/build-aux/test-driver @@ -447,6 +448,7 @@ CALC_TICKADJ_MS = @CALC_TICKADJ_MS@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CC_NOFORMAT = @CC_NOFORMAT@ CFLAGS = @CFLAGS@ CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@ CFLAGS_NTP = @CFLAGS_NTP@ @@ -456,6 +458,8 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ CPPFLAGS_NTP = @CPPFLAGS_NTP@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ DEFS = @DEFS@ @@ -468,14 +472,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EDITLINE_LIBS = @EDITLINE_LIBS@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ -GTEST_CONFIG = @GTEST_CONFIG@ -GTEST_CPPFLAGS = @GTEST_CPPFLAGS@ -GTEST_CXXFLAGS = @GTEST_CXXFLAGS@ -GTEST_LDFLAGS = @GTEST_LDFLAGS@ -GTEST_LIBS = @GTEST_LIBS@ HAVE_INLINE = @HAVE_INLINE@ HAVE_LEAPSMEARINTERVAL = @HAVE_LEAPSMEARINTERVAL@ HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@ @@ -686,6 +686,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -696,9 +697,10 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ NULL = -BUILT_SOURCES = $(srcdir)/run-t-ntpq.c $(NULL) check-libntpd \ - check-libntp check-libunity .deps-ver -CLEANFILES = check-libntpd check-libntp check-libunity .deps-ver +BUILT_SOURCES = $(srcdir)/run-t-ntpq.c $(NULL) check-libntp \ + check-libunity .deps-ver +CLEANFILES = check-libntp .deps-ver +DISTCLEANFILES = $(DEPDIR)/deps-ver std_unity_list = \ $(abs_top_srcdir)/sntp/unity/auto/generate_test_runner.rb \ $(abs_srcdir)/testconf.yml \ @@ -711,7 +713,6 @@ EXTRA_DIST = \ LDADD = \ $(top_builddir)/ntpq/libntpq.a \ - $(top_builddir)/ntpd/libntpd.a \ $(top_builddir)/libntp/libntp.a \ $(LDADD_LIBNTP) \ $(PTHREAD_LIBS) \ @@ -744,15 +745,16 @@ test_ntpq_SOURCES = \ $(NULL) TESTS = $(am__append_1) -NTP_INCS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ - -I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ - -I$(top_srcdir)/lib/isc/unix/include +NTP_INCS = -I$(top_srcdir)/include \ + -I$(top_srcdir)/libntp/lib/isc/include \ + -I$(top_srcdir)/libntp/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ + -I$(top_srcdir)/libntp/lib/isc/unix/include all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/check-libntp.mf $(top_srcdir)/check-libunity.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -769,10 +771,10 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; -$(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): +$(top_srcdir)/check-libntp.mf $(top_srcdir)/check-libunity.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -802,26 +804,35 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-t-ntpq.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-ntpq.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-t-ntpq.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-ntpq.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @@ -991,7 +1002,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ - echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ @@ -1004,7 +1015,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) fi; \ $$success || exit 1 -check-TESTS: +check-TESTS: $(check_PROGRAMS) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @@ -1046,8 +1057,10 @@ test-ntpq.log: test-ntpq$(EXEEXT) @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -1086,7 +1099,8 @@ all-am: Makefile $(HEADERS) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -1115,6 +1129,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -1126,7 +1141,8 @@ clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/run-t-ntpq.Po + -rm -f ./$(DEPDIR)/t-ntpq.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -1172,7 +1188,8 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/run-t-ntpq.Po + -rm -f ./$(DEPDIR)/t-ntpq.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -1191,18 +1208,19 @@ ps-am: uninstall-am: -.MAKE: all check check-am install install-am install-strip +.MAKE: all check check-am install install-am install-exec \ + install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ - clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am @@ -1213,30 +1231,24 @@ uninstall-am: $(srcdir)/run-t-ntpq.c: $(srcdir)/t-ntpq.c $(std_unity_list) $(run_unity) $< $@ -check-libntpd: ../../ntpd/libntpd.a - @echo stamp > $@ +check-libntp: $(top_builddir)/libntp/libntp.a + @: avoid default SCCS get by some make implementations -../../ntpd/libntpd.a: - cd ../../ntpd && $(MAKE) $(AM_MAKEFLAGS) libntpd.a +$(top_builddir)/libntp/libntp.a: + cd $(top_builddir)/libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a -check-libntp: ../../libntp/libntp.a - @echo stamp > $@ +check-libunity: $(top_builddir)/sntp/unity/libunity.a + @: avoid default SCCS get by some make implementations -../../libntp/libntp.a: - cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a - -check-libunity: ../../sntp/unity/libunity.a - @echo stamp > $@ - -../../sntp/unity/libunity.a: - cd ../../sntp/unity && $(MAKE) $(AM_MAKEFLAGS) libunity.a +$(top_builddir)/sntp/unity/libunity.a: + cd $(top_builddir)/sntp/unity && $(MAKE) $(AM_MAKEFLAGS) libunity.a $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ - chmod ug+w $@ + chmod u+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ - $(MAKE) $(AM_MAKEFLAGS) clean && \ + $(MAKE) $(AM_MAKEFLAGS) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ @@ -1254,7 +1266,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) - cp $(top_srcdir)/deps-ver $@ + $(AM_V_at)cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/deps-ver @@ -1284,7 +1296,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # -# This comment block follows rather than leads the related code so that +# This comment block follows rather than leads the related rules so that # it stays with it in the generated Makefile.in and Makefile. # diff --git a/tests/sandbox/Makefile.am b/tests/sandbox/Makefile.am index f89c85868bde..31745fe4ad5f 100644 --- a/tests/sandbox/Makefile.am +++ b/tests/sandbox/Makefile.am @@ -1,8 +1,7 @@ -#AUTOMAKE_OPTIONS = foreign 2.9 subdir-objects - NULL = BUILT_SOURCES = CLEANFILES = +DISTCLEANFILES = std_unity_list = \ $(abs_top_srcdir)/sntp/unity/auto/generate_test_runner.rb \ @@ -85,23 +84,7 @@ if !NTP_CROSSCOMPILE TESTS += $(check_PROGRAMS) endif -## check-libntp.mf - automake fragment -## slightly adapted for deeper directory - -BUILT_SOURCES += check-libntp check-libunity -CLEANFILES += check-libntp check-libunity - -check-libntp: ../../libntp/libntp.a - @echo stamp > $@ - -../../libntp/libntp.a: - cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a - -check-libunity: ../../sntp/unity/libunity.a - @echo stamp > $@ - -../../sntp/unity/libunity.a: - cd ../../libunity && $(MAKE) $(AM_MAKEFLAGS) libunity.a - +include $(top_srcdir)/check-libntp.mf +include $(top_srcdir)/check-libunity.mf include $(top_srcdir)/depsver.mf include $(top_srcdir)/includes.mf diff --git a/tests/sandbox/Makefile.in b/tests/sandbox/Makefile.in index f51b97302ee5..5d1376c573a6 100644 --- a/tests/sandbox/Makefile.in +++ b/tests/sandbox/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -13,8 +13,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - -#AUTOMAKE_OPTIONS = foreign 2.9 subdir-objects VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ @@ -114,7 +112,6 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_debug.m4 \ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \ - $(top_srcdir)/sntp/m4/ntp_googletest.m4 \ $(top_srcdir)/sntp/m4/ntp_harden.m4 \ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \ @@ -134,6 +131,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ + $(top_srcdir)/sntp/m4/realpath.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -195,7 +193,11 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/sntp/libevent/build-aux/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/bug-2803.Po ./$(DEPDIR)/modetoa.Po \ + ./$(DEPDIR)/run-modetoa.Po ./$(DEPDIR)/run-uglydate.Po \ + ./$(DEPDIR)/run-ut-2803.Po ./$(DEPDIR)/smeartest.Po \ + ./$(DEPDIR)/uglydate.Po ./$(DEPDIR)/ut-2803.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -241,8 +243,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no @@ -425,6 +425,7 @@ am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log @@ -449,7 +450,8 @@ TEST_LOG_DRIVER = $(SHELL) \ $(top_srcdir)/sntp/libevent/build-aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depsver.mf \ +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/check-libntp.mf \ + $(top_srcdir)/check-libunity.mf $(top_srcdir)/depsver.mf \ $(top_srcdir)/includes.mf \ $(top_srcdir)/sntp/libevent/build-aux/depcomp \ $(top_srcdir)/sntp/libevent/build-aux/test-driver @@ -471,6 +473,7 @@ CALC_TICKADJ_MS = @CALC_TICKADJ_MS@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CC_NOFORMAT = @CC_NOFORMAT@ CFLAGS = @CFLAGS@ CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@ CFLAGS_NTP = @CFLAGS_NTP@ @@ -480,6 +483,8 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ CPPFLAGS_NTP = @CPPFLAGS_NTP@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ DEFS = @DEFS@ @@ -492,14 +497,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EDITLINE_LIBS = @EDITLINE_LIBS@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ -GTEST_CONFIG = @GTEST_CONFIG@ -GTEST_CPPFLAGS = @GTEST_CPPFLAGS@ -GTEST_CXXFLAGS = @GTEST_CXXFLAGS@ -GTEST_LDFLAGS = @GTEST_LDFLAGS@ -GTEST_LIBS = @GTEST_LIBS@ HAVE_INLINE = @HAVE_INLINE@ HAVE_LEAPSMEARINTERVAL = @HAVE_LEAPSMEARINTERVAL@ HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@ @@ -710,6 +711,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -722,7 +724,8 @@ top_srcdir = @top_srcdir@ NULL = BUILT_SOURCES = run-ut-2803.c run-uglydate.c run-modetoa.c \ check-libntp check-libunity .deps-ver -CLEANFILES = check-libntp check-libunity .deps-ver +CLEANFILES = check-libntp .deps-ver +DISTCLEANFILES = $(DEPDIR)/deps-ver std_unity_list = \ $(abs_top_srcdir)/sntp/unity/auto/generate_test_runner.rb \ $(abs_srcdir)/testconf.yml \ @@ -769,15 +772,16 @@ second_test_SOURCES = \ $(NULL) TESTS = $(am__append_1) -NTP_INCS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ - -I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ - -I$(top_srcdir)/lib/isc/unix/include +NTP_INCS = -I$(top_srcdir)/include \ + -I$(top_srcdir)/libntp/lib/isc/include \ + -I$(top_srcdir)/libntp/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ + -I$(top_srcdir)/libntp/lib/isc/unix/include all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/check-libntp.mf $(top_srcdir)/check-libunity.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -794,10 +798,10 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; -$(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): +$(top_srcdir)/check-libntp.mf $(top_srcdir)/check-libunity.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -839,32 +843,41 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bug-2803.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modetoa.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-modetoa.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-uglydate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-ut-2803.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smeartest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uglydate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ut-2803.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bug-2803.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modetoa.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-modetoa.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-uglydate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-ut-2803.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smeartest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uglydate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ut-2803.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @@ -1034,7 +1047,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ - echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ @@ -1047,7 +1060,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) fi; \ $$success || exit 1 -check-TESTS: +check-TESTS: $(check_PROGRAMS) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @@ -1096,8 +1109,10 @@ smeartest.log: smeartest$(EXEEXT) @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -1136,7 +1151,8 @@ all-am: Makefile installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -1165,6 +1181,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -1176,7 +1193,14 @@ clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/bug-2803.Po + -rm -f ./$(DEPDIR)/modetoa.Po + -rm -f ./$(DEPDIR)/run-modetoa.Po + -rm -f ./$(DEPDIR)/run-uglydate.Po + -rm -f ./$(DEPDIR)/run-ut-2803.Po + -rm -f ./$(DEPDIR)/smeartest.Po + -rm -f ./$(DEPDIR)/uglydate.Po + -rm -f ./$(DEPDIR)/ut-2803.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -1222,7 +1246,14 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/bug-2803.Po + -rm -f ./$(DEPDIR)/modetoa.Po + -rm -f ./$(DEPDIR)/run-modetoa.Po + -rm -f ./$(DEPDIR)/run-uglydate.Po + -rm -f ./$(DEPDIR)/run-ut-2803.Po + -rm -f ./$(DEPDIR)/smeartest.Po + -rm -f ./$(DEPDIR)/uglydate.Po + -rm -f ./$(DEPDIR)/ut-2803.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -1241,18 +1272,19 @@ ps-am: uninstall-am: -.MAKE: all check check-am install install-am install-strip +.MAKE: all check check-am install install-am install-exec \ + install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ - clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am @@ -1269,24 +1301,24 @@ $(srcdir)/run-uglydate.c: $(srcdir)/uglydate.c $(std_unity_list) $(srcdir)/run-modetoa.c: $(srcdir)/modetoa.c $(std_unity_list) $(run_unity) $< $@ -check-libntp: ../../libntp/libntp.a - @echo stamp > $@ +check-libntp: $(top_builddir)/libntp/libntp.a + @: avoid default SCCS get by some make implementations -../../libntp/libntp.a: - cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a +$(top_builddir)/libntp/libntp.a: + cd $(top_builddir)/libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a -check-libunity: ../../sntp/unity/libunity.a - @echo stamp > $@ +check-libunity: $(top_builddir)/sntp/unity/libunity.a + @: avoid default SCCS get by some make implementations -../../sntp/unity/libunity.a: - cd ../../libunity && $(MAKE) $(AM_MAKEFLAGS) libunity.a +$(top_builddir)/sntp/unity/libunity.a: + cd $(top_builddir)/sntp/unity && $(MAKE) $(AM_MAKEFLAGS) libunity.a $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ - chmod ug+w $@ + chmod u+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ - $(MAKE) $(AM_MAKEFLAGS) clean && \ + $(MAKE) $(AM_MAKEFLAGS) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ @@ -1304,7 +1336,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) - cp $(top_srcdir)/deps-ver $@ + $(AM_V_at)cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/deps-ver @@ -1334,7 +1366,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # -# This comment block follows rather than leads the related code so that +# This comment block follows rather than leads the related rules so that # it stays with it in the generated Makefile.in and Makefile. # diff --git a/tests/sandbox/smeartest.c b/tests/sandbox/smeartest.c index cc4e50304dbd..7b11d11edea4 100644 --- a/tests/sandbox/smeartest.c +++ b/tests/sandbox/smeartest.c @@ -127,7 +127,7 @@ ltor(l_fp l) int -main() +main(void) { l_fp l; int rc; diff --git a/tests/sec-2853/Makefile.am b/tests/sec-2853/Makefile.am index 4078cf40b8ed..4406baa1b349 100644 --- a/tests/sec-2853/Makefile.am +++ b/tests/sec-2853/Makefile.am @@ -2,6 +2,7 @@ NULL = BUILT_SOURCES = CLEANFILES = +DISTCLEANFILES = std_unity_list = \ $(abs_top_srcdir)/sntp/unity/auto/generate_test_runner.rb \ @@ -18,9 +19,9 @@ check_PROGRAMS = sec-2853 # HMS: we may not need some of these: LDADD = \ - $(top_builddir)/ntpd/rc_cmdlength.o \ $(top_builddir)/sntp/unity/libunity.a \ $(top_builddir)/libntp/libntp.a \ + $(top_builddir)/ntpd/libntpd.a \ $(LDADD_LIBNTP) \ $(PTHREAD_LIBS) \ $(LDADD_NTP) \ @@ -62,29 +63,8 @@ if !NTP_CROSSCOMPILE TESTS += $(check_PROGRAMS) endif -## check-libntp.mf - automake fragment -## slightly adapted for deeper directory - -BUILT_SOURCES += check-libntp check-libunity check-rc-cmdlength -CLEANFILES += check-libntp check-libunity check-rc-cmdlength - -check-libntp: ../../libntp/libntp.a - @echo stamp > $@ - -../../libntp/libntp.a: - cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a - -check-libunity: ../../sntp/unity/libunity.a - @echo stamp > $@ - -../../sntp/unity/libunity.a: - cd ../../libunity && $(MAKE) $(AM_MAKEFLAGS) libunity.a - -check-rc-cmdlength: ../../ntpd/rc_cmdlength.o - @echo stamp > $@ - -../../ntpd/rc_cmdlength.o: - cd ../../ntpd && $(MAKE) $(AM_MAKEFLAGS) rc_cmdlength.o - +include $(top_srcdir)/check-libntp.mf +include $(top_srcdir)/check-libntpd.mf +include $(top_srcdir)/check-libunity.mf include $(top_srcdir)/depsver.mf include $(top_srcdir)/includes.mf diff --git a/tests/sec-2853/Makefile.in b/tests/sec-2853/Makefile.in index a0409403c01c..a5615919f718 100644 --- a/tests/sec-2853/Makefile.in +++ b/tests/sec-2853/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -109,7 +109,6 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_debug.m4 \ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \ - $(top_srcdir)/sntp/m4/ntp_googletest.m4 \ $(top_srcdir)/sntp/m4/ntp_harden.m4 \ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \ @@ -129,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ + $(top_srcdir)/sntp/m4/realpath.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -144,11 +144,11 @@ am_sec_2853_OBJECTS = run-sec-2853.$(OBJEXT) sec-2853.$(OBJEXT) \ sec_2853_OBJECTS = $(am_sec_2853_OBJECTS) sec_2853_LDADD = $(LDADD) am__DEPENDENCIES_1 = -sec_2853_DEPENDENCIES = $(top_builddir)/ntpd/rc_cmdlength.o \ - $(top_builddir)/sntp/unity/libunity.a \ - $(top_builddir)/libntp/libntp.a $(am__DEPENDENCIES_1) \ +sec_2853_DEPENDENCIES = $(top_builddir)/sntp/unity/libunity.a \ + $(top_builddir)/libntp/libntp.a $(top_builddir)/ntpd/libntpd.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -167,7 +167,9 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/sntp/libevent/build-aux/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/run-sec-2853.Po \ + ./$(DEPDIR)/sec-2853.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -211,8 +213,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no @@ -395,6 +395,7 @@ am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log @@ -419,8 +420,9 @@ TEST_LOG_DRIVER = $(SHELL) \ $(top_srcdir)/sntp/libevent/build-aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depsver.mf \ - $(top_srcdir)/includes.mf \ +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/check-libntp.mf \ + $(top_srcdir)/check-libntpd.mf $(top_srcdir)/check-libunity.mf \ + $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf \ $(top_srcdir)/sntp/libevent/build-aux/depcomp \ $(top_srcdir)/sntp/libevent/build-aux/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -441,6 +443,7 @@ CALC_TICKADJ_MS = @CALC_TICKADJ_MS@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CC_NOFORMAT = @CC_NOFORMAT@ CFLAGS = @CFLAGS@ CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@ CFLAGS_NTP = @CFLAGS_NTP@ @@ -450,6 +453,8 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ CPPFLAGS_NTP = @CPPFLAGS_NTP@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ DEFS = @DEFS@ @@ -462,14 +467,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EDITLINE_LIBS = @EDITLINE_LIBS@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ -GTEST_CONFIG = @GTEST_CONFIG@ -GTEST_CPPFLAGS = @GTEST_CPPFLAGS@ -GTEST_CXXFLAGS = @GTEST_CXXFLAGS@ -GTEST_LDFLAGS = @GTEST_LDFLAGS@ -GTEST_LIBS = @GTEST_LIBS@ HAVE_INLINE = @HAVE_INLINE@ HAVE_LEAPSMEARINTERVAL = @HAVE_LEAPSMEARINTERVAL@ HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@ @@ -680,6 +681,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -692,9 +694,15 @@ top_srcdir = @top_srcdir@ #AUTOMAKE_OPTIONS = foreign 1.9 subdir-objects NULL = -BUILT_SOURCES = $(srcdir)/run-sec-2853.c check-libntp check-libunity \ - check-rc-cmdlength .deps-ver -CLEANFILES = check-libntp check-libunity check-rc-cmdlength .deps-ver +BUILT_SOURCES = $(srcdir)/run-sec-2853.c check-libntp check-libntpd \ + check-libunity .deps-ver + +# CLEANFILES addition below won't be needed after a while. +# Leave it in for now for folks tracking the source repo +# who have the file from a former version of the rule. +# DLH Jan 2023 +CLEANFILES = check-libntp check-libntpd .deps-ver +DISTCLEANFILES = $(DEPDIR)/deps-ver std_unity_list = \ $(abs_top_srcdir)/sntp/unity/auto/generate_test_runner.rb \ $(abs_srcdir)/testconf.yml \ @@ -708,9 +716,9 @@ EXTRA_DIST = \ # HMS: we may not need some of these: LDADD = \ - $(top_builddir)/ntpd/rc_cmdlength.o \ $(top_builddir)/sntp/unity/libunity.a \ $(top_builddir)/libntp/libntp.a \ + $(top_builddir)/ntpd/libntpd.a \ $(LDADD_LIBNTP) \ $(PTHREAD_LIBS) \ $(LDADD_NTP) \ @@ -735,15 +743,16 @@ sec_2853_SOURCES = \ #noinst_HEADERS = ntpdtest.h \ # $(NULL) TESTS = $(am__append_1) -NTP_INCS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ - -I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ - -I$(top_srcdir)/lib/isc/unix/include +NTP_INCS = -I$(top_srcdir)/include \ + -I$(top_srcdir)/libntp/lib/isc/include \ + -I$(top_srcdir)/libntp/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ + -I$(top_srcdir)/libntp/lib/isc/unix/include all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/check-libntp.mf $(top_srcdir)/check-libntpd.mf $(top_srcdir)/check-libunity.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -760,10 +769,10 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; -$(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): +$(top_srcdir)/check-libntp.mf $(top_srcdir)/check-libntpd.mf $(top_srcdir)/check-libunity.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -793,26 +802,35 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-sec-2853.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sec-2853.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-sec-2853.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sec-2853.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @@ -982,7 +1000,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ - echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ @@ -995,7 +1013,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) fi; \ $$success || exit 1 -check-TESTS: +check-TESTS: $(check_PROGRAMS) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @@ -1037,8 +1055,10 @@ sec-2853.log: sec-2853$(EXEEXT) @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -1077,7 +1097,8 @@ all-am: Makefile installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -1106,6 +1127,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -1117,7 +1139,8 @@ clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/run-sec-2853.Po + -rm -f ./$(DEPDIR)/sec-2853.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -1163,7 +1186,8 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/run-sec-2853.Po + -rm -f ./$(DEPDIR)/sec-2853.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -1182,18 +1206,19 @@ ps-am: uninstall-am: -.MAKE: all check check-am install install-am install-strip +.MAKE: all check check-am install install-am install-exec \ + install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ - clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am @@ -1204,30 +1229,30 @@ uninstall-am: $(srcdir)/run-sec-2853.c: $(srcdir)/sec-2853.c $(std_unity_list) $(run_unity) $< $@ -check-libntp: ../../libntp/libntp.a - @echo stamp > $@ +check-libntp: $(top_builddir)/libntp/libntp.a + @: avoid default SCCS get by some make implementations -../../libntp/libntp.a: - cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a +$(top_builddir)/libntp/libntp.a: + cd $(top_builddir)/libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a -check-libunity: ../../sntp/unity/libunity.a - @echo stamp > $@ +check-libntpd: $(top_builddir)/ntpd/libntpd.a + @: avoid default SCCS get by some make implementations -../../sntp/unity/libunity.a: - cd ../../libunity && $(MAKE) $(AM_MAKEFLAGS) libunity.a +$(top_builddir)/ntpd/libntpd.a: + cd $(top_builddir)/ntpd && $(MAKE) $(AM_MAKEFLAGS) libntpd.a -check-rc-cmdlength: ../../ntpd/rc_cmdlength.o - @echo stamp > $@ +check-libunity: $(top_builddir)/sntp/unity/libunity.a + @: avoid default SCCS get by some make implementations -../../ntpd/rc_cmdlength.o: - cd ../../ntpd && $(MAKE) $(AM_MAKEFLAGS) rc_cmdlength.o +$(top_builddir)/sntp/unity/libunity.a: + cd $(top_builddir)/sntp/unity && $(MAKE) $(AM_MAKEFLAGS) libunity.a $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ - chmod ug+w $@ + chmod u+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ - $(MAKE) $(AM_MAKEFLAGS) clean && \ + $(MAKE) $(AM_MAKEFLAGS) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ @@ -1245,7 +1270,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) - cp $(top_srcdir)/deps-ver $@ + $(AM_V_at)cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/deps-ver @@ -1275,7 +1300,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # -# This comment block follows rather than leads the related code so that +# This comment block follows rather than leads the related rules so that # it stays with it in the generated Makefile.in and Makefile. # diff --git a/util/Makefile.am b/util/Makefile.am index 8d8067d39d7a..cef623c592d0 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -21,10 +21,11 @@ AM_LDFLAGS += $(NTP_HARD_LDFLAGS) # LDADD might need RESLIB and ADJLIB LDADD= ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) tg2_LDADD= ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) -ntp_keygen_LDADD = version.o $(LIBOPTS_LDADD) ../libntp/libntp.a +ntp_keygen_LDADD = $(LIBOPTS_LDADD) ../libntp/libntp.a ntp_keygen_LDADD += $(LDADD_LIBEVENT) ntp_keygen_LDADD += $(LDADD_LIBNTP) $(PTHREAD_LIBS) $(LDADD_NTP) $(LIBM) ntp_keygen_SOURCES = ntp-keygen.c ntp-keygen-opts.c ntp-keygen-opts.h +nodist_ntp_keygen_SOURCES = version.c tickadj_LDADD= ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) $(LDADD_NLIST) @@ -42,8 +43,8 @@ EXTRA_DIST= \ $(NULL) BUILT_SOURCES= ntp-keygen-opts.c ntp-keygen-opts.h -CLEANFILES= -DISTCLEANFILES= .version version.c config.log $(man_MANS) +CLEANFILES = .version version.c +DISTCLEANFILES= config.log $(man_MANS) html_DATA= \ $(srcdir)/ntp-keygen.html \ @@ -111,7 +112,7 @@ $(srcdir)/invoke-ntp-keygen.texi: $(srcdir)/ntp-keygen-opts.def $(std_def_list) $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntp-keygen-opts.def $(top_srcdir)/scripts/build/check--help $@ -$(srcdir)/ntp-keygen.html: $(srcdir)/ntp-keygen.texi $(top_srcdir)/sntp/include/version.texi +$(srcdir)/ntp-keygen.html: $(srcdir)/invoke-ntp-keygen.texi $(srcdir)/ntp-keygen.texi $(top_srcdir)/sntp/include/version.texi cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp-keygen.html ntp-keygen.texi || true ) @@ -121,19 +122,12 @@ jitter_LDADD= kern.o: kern.c $(COMPILE) -DHAVE_TIMEX_H -c kern.c -$(PROGRAMS): version.o - -$(top_srcdir)/sntp/scm-rev: - cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev - -version.c: $(ntp_keygen_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev - env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntp-keygen - -version.o: version.c - env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o +version.c: Makefile $(top_srcdir)/sntp/scm-rev + $(AM_V_GEN)env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntp-keygen include $(top_srcdir)/bincheck.mf -include $(top_srcdir)/sntp/check-libntp.mf +include $(top_srcdir)/check-libntp.mf include $(top_srcdir)/check-libopts.mf +include $(top_srcdir)/check-scm-rev.mf include $(top_srcdir)/depsver.mf include $(top_srcdir)/includes.mf diff --git a/util/Makefile.in b/util/Makefile.in index 099e27015b22..bfc308c6cc5f 100644 --- a/util/Makefile.in +++ b/util/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -118,7 +118,6 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/ntp_debug.m4 \ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \ - $(top_srcdir)/sntp/m4/ntp_googletest.m4 \ $(top_srcdir)/sntp/m4/ntp_harden.m4 \ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \ @@ -138,6 +137,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ $(top_srcdir)/sntp/m4/openldap.m4 \ $(top_srcdir)/sntp/m4/os_cflags.m4 \ + $(top_srcdir)/sntp/m4/realpath.m4 \ $(top_srcdir)/sntp/m4/snprintf.m4 \ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -185,9 +185,11 @@ longsize_LDADD = $(LDADD) longsize_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_ntp_keygen_OBJECTS = ntp-keygen.$(OBJEXT) ntp-keygen-opts.$(OBJEXT) -ntp_keygen_OBJECTS = $(am_ntp_keygen_OBJECTS) -ntp_keygen_DEPENDENCIES = version.o $(am__DEPENDENCIES_1) \ - ../libntp/libntp.a $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ +nodist_ntp_keygen_OBJECTS = version.$(OBJEXT) +ntp_keygen_OBJECTS = $(am_ntp_keygen_OBJECTS) \ + $(nodist_ntp_keygen_OBJECTS) +ntp_keygen_DEPENDENCIES = $(am__DEPENDENCIES_1) ../libntp/libntp.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) ntptime_SOURCES = ntptime.c @@ -248,7 +250,16 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/sntp/libevent/build-aux/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/audio-pcm.Po \ + ./$(DEPDIR)/byteorder.Po ./$(DEPDIR)/hist.Po \ + ./$(DEPDIR)/jitter.Po ./$(DEPDIR)/kern.Po \ + ./$(DEPDIR)/longsize.Po ./$(DEPDIR)/ntp-keygen-opts.Po \ + ./$(DEPDIR)/ntp-keygen.Po ./$(DEPDIR)/ntptime.Po \ + ./$(DEPDIR)/pps-api.Po ./$(DEPDIR)/precision.Po \ + ./$(DEPDIR)/sht.Po ./$(DEPDIR)/testrs6000.Po ./$(DEPDIR)/tg.Po \ + ./$(DEPDIR)/tg2.Po ./$(DEPDIR)/tickadj.Po \ + ./$(DEPDIR)/timetrim.Po ./$(DEPDIR)/version.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -269,8 +280,9 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = audio-pcm.c byteorder.c hist.c $(jitter_SOURCES) kern.c \ - longsize.c $(ntp_keygen_SOURCES) ntptime.c pps-api.c \ - precision.c sht.c testrs6000.c tg.c tg2.c tickadj.c timetrim.c + longsize.c $(ntp_keygen_SOURCES) $(nodist_ntp_keygen_SOURCES) \ + ntptime.c pps-api.c precision.c sht.c testrs6000.c tg.c tg2.c \ + tickadj.c timetrim.c DIST_SOURCES = audio-pcm.c byteorder.c hist.c $(jitter_SOURCES) kern.c \ longsize.c $(ntp_keygen_SOURCES) ntptime.c pps-api.c \ precision.c sht.c testrs6000.c tg.c tg2.c tickadj.c timetrim.c @@ -328,11 +340,10 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/bincheck.mf \ - $(top_srcdir)/check-libopts.mf $(top_srcdir)/depsver.mf \ - $(top_srcdir)/includes.mf $(top_srcdir)/sntp/check-libntp.mf \ + $(top_srcdir)/check-libntp.mf $(top_srcdir)/check-libopts.mf \ + $(top_srcdir)/check-scm-rev.mf $(top_srcdir)/depsver.mf \ + $(top_srcdir)/includes.mf \ $(top_srcdir)/sntp/libevent/build-aux/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -352,6 +363,7 @@ CALC_TICKADJ_MS = @CALC_TICKADJ_MS@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CC_NOFORMAT = @CC_NOFORMAT@ CFLAGS = @CFLAGS@ CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@ CFLAGS_NTP = @CFLAGS_NTP@ @@ -361,6 +373,8 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ CPPFLAGS_NTP = @CPPFLAGS_NTP@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ DEFS = @DEFS@ @@ -373,14 +387,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EDITLINE_LIBS = @EDITLINE_LIBS@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ -GTEST_CONFIG = @GTEST_CONFIG@ -GTEST_CPPFLAGS = @GTEST_CPPFLAGS@ -GTEST_CXXFLAGS = @GTEST_CXXFLAGS@ -GTEST_LDFLAGS = @GTEST_LDFLAGS@ -GTEST_LIBS = @GTEST_LIBS@ HAVE_INLINE = @HAVE_INLINE@ HAVE_LEAPSMEARINTERVAL = @HAVE_LEAPSMEARINTERVAL@ HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@ @@ -591,6 +601,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -612,10 +623,11 @@ AM_LDFLAGS = $(LDFLAGS_NTP) $(NTP_HARD_LDFLAGS) # LDADD might need RESLIB and ADJLIB LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) tg2_LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) -ntp_keygen_LDADD = version.o $(LIBOPTS_LDADD) ../libntp/libntp.a \ +ntp_keygen_LDADD = $(LIBOPTS_LDADD) ../libntp/libntp.a \ $(LDADD_LIBEVENT) $(LDADD_LIBNTP) $(PTHREAD_LIBS) $(LDADD_NTP) \ $(LIBM) ntp_keygen_SOURCES = ntp-keygen.c ntp-keygen-opts.c ntp-keygen-opts.h +nodist_ntp_keygen_SOURCES = version.c tickadj_LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) $(LDADD_NLIST) EXTRA_DIST = \ invoke-ntp-keygen.menu \ @@ -632,8 +644,8 @@ EXTRA_DIST = \ BUILT_SOURCES = ntp-keygen-opts.c ntp-keygen-opts.h check-libntp \ check-libopts .deps-ver -CLEANFILES = check-libntp check-libopts .deps-ver -DISTCLEANFILES = .version version.c config.log $(man_MANS) +CLEANFILES = .version version.c check-libntp check-libopts .deps-ver +DISTCLEANFILES = config.log $(man_MANS) $(DEPDIR)/deps-ver html_DATA = \ $(srcdir)/ntp-keygen.html \ $(NULL) @@ -663,15 +675,16 @@ std_def_list = \ jitter_SOURCES = jitter.c jitter_LDADD = -NTP_INCS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ - -I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ - -I$(top_srcdir)/lib/isc/unix/include +NTP_INCS = -I$(top_srcdir)/include \ + -I$(top_srcdir)/libntp/lib/isc/include \ + -I$(top_srcdir)/libntp/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ + -I$(top_srcdir)/libntp/lib/isc/unix/include all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/sntp/check-libntp.mf $(top_srcdir)/check-libopts.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/check-libntp.mf $(top_srcdir)/check-libopts.mf $(top_srcdir)/check-scm-rev.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -688,10 +701,10 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; -$(top_srcdir)/bincheck.mf $(top_srcdir)/sntp/check-libntp.mf $(top_srcdir)/check-libopts.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): +$(top_srcdir)/bincheck.mf $(top_srcdir)/check-libntp.mf $(top_srcdir)/check-libopts.mf $(top_srcdir)/check-scm-rev.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -919,41 +932,51 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio-pcm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/byteorder.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hist.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jitter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kern.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/longsize.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp-keygen-opts.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp-keygen.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntptime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pps-api.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/precision.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sht.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testrs6000.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tg2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tickadj.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timetrim.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio-pcm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/byteorder.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hist.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jitter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kern.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/longsize.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp-keygen-opts.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp-keygen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntptime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pps-api.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/precision.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sht.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testrs6000.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tg2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tickadj.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timetrim.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @@ -1122,8 +1145,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -1163,7 +1188,8 @@ installdirs: done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -1201,7 +1227,24 @@ clean-am: clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \ clean-libtool clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/audio-pcm.Po + -rm -f ./$(DEPDIR)/byteorder.Po + -rm -f ./$(DEPDIR)/hist.Po + -rm -f ./$(DEPDIR)/jitter.Po + -rm -f ./$(DEPDIR)/kern.Po + -rm -f ./$(DEPDIR)/longsize.Po + -rm -f ./$(DEPDIR)/ntp-keygen-opts.Po + -rm -f ./$(DEPDIR)/ntp-keygen.Po + -rm -f ./$(DEPDIR)/ntptime.Po + -rm -f ./$(DEPDIR)/pps-api.Po + -rm -f ./$(DEPDIR)/precision.Po + -rm -f ./$(DEPDIR)/sht.Po + -rm -f ./$(DEPDIR)/testrs6000.Po + -rm -f ./$(DEPDIR)/tg.Po + -rm -f ./$(DEPDIR)/tg2.Po + -rm -f ./$(DEPDIR)/tickadj.Po + -rm -f ./$(DEPDIR)/timetrim.Po + -rm -f ./$(DEPDIR)/version.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -1249,7 +1292,24 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/audio-pcm.Po + -rm -f ./$(DEPDIR)/byteorder.Po + -rm -f ./$(DEPDIR)/hist.Po + -rm -f ./$(DEPDIR)/jitter.Po + -rm -f ./$(DEPDIR)/kern.Po + -rm -f ./$(DEPDIR)/longsize.Po + -rm -f ./$(DEPDIR)/ntp-keygen-opts.Po + -rm -f ./$(DEPDIR)/ntp-keygen.Po + -rm -f ./$(DEPDIR)/ntptime.Po + -rm -f ./$(DEPDIR)/pps-api.Po + -rm -f ./$(DEPDIR)/precision.Po + -rm -f ./$(DEPDIR)/sht.Po + -rm -f ./$(DEPDIR)/testrs6000.Po + -rm -f ./$(DEPDIR)/tg.Po + -rm -f ./$(DEPDIR)/tg2.Po + -rm -f ./$(DEPDIR)/tickadj.Po + -rm -f ./$(DEPDIR)/timetrim.Po + -rm -f ./$(DEPDIR)/version.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -1271,9 +1331,10 @@ uninstall-am: uninstall-binPROGRAMS uninstall-htmlDATA \ uninstall-man: uninstall-man1 uninstall-man8 -.MAKE: all check install install-am install-exec-am install-strip +.MAKE: all check install install-am install-exec install-exec-am \ + install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \ clean-libtool clean-sbinPROGRAMS cscopelist-am ctags ctags-am \ distclean distclean-compile distclean-generic \ @@ -1334,22 +1395,14 @@ $(srcdir)/invoke-ntp-keygen.texi: $(srcdir)/ntp-keygen-opts.def $(std_def_list) $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntp-keygen-opts.def $(top_srcdir)/scripts/build/check--help $@ -$(srcdir)/ntp-keygen.html: $(srcdir)/ntp-keygen.texi $(top_srcdir)/sntp/include/version.texi +$(srcdir)/ntp-keygen.html: $(srcdir)/invoke-ntp-keygen.texi $(srcdir)/ntp-keygen.texi $(top_srcdir)/sntp/include/version.texi cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp-keygen.html ntp-keygen.texi || true ) kern.o: kern.c $(COMPILE) -DHAVE_TIMEX_H -c kern.c -$(PROGRAMS): version.o - -$(top_srcdir)/sntp/scm-rev: - cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev - -version.c: $(ntp_keygen_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev - env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntp-keygen - -version.o: version.c - env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o +version.c: Makefile $(top_srcdir)/sntp/scm-rev + $(AM_V_GEN)env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntp-keygen install-exec-hook: @test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \ @@ -1365,23 +1418,31 @@ install-exec-hook: # -check-libntp: ../libntp/libntp.a +check-libntp: $(top_builddir)/libntp/libntp.a + @: avoid default SCCS get by some make implementations -../libntp/libntp.a: - cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a +$(top_builddir)/libntp/libntp.a: + cd $(top_builddir)/libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a check-libopts: ../sntp/libopts/libopts.la @echo stamp > $@ ../sntp/libopts/libopts.la: -cd ../sntp/libopts && $(MAKE) $(AM_MAKEFLAGS) libopts.la +$(top_srcdir)/sntp/scm-rev: FRC.scm-rev + $(AM_V_GEN)cd $(top_builddir)/sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev + +FRC.scm-rev: + @: FRC.scm-rev "force" depends on nothing and is not a file, so is \ + always out-of-date causing targets which depend on it to also \ + be outdated so their rules to fire each time they are built. $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ - chmod ug+w $@ + chmod u+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ - $(MAKE) $(AM_MAKEFLAGS) clean && \ + $(MAKE) $(AM_MAKEFLAGS) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ @@ -1399,7 +1460,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) - cp $(top_srcdir)/deps-ver $@ + $(AM_V_at)cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/deps-ver @@ -1429,7 +1490,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # -# This comment block follows rather than leads the related code so that +# This comment block follows rather than leads the related rules so that # it stays with it in the generated Makefile.in and Makefile. # diff --git a/util/invoke-ntp-keygen.texi b/util/invoke-ntp-keygen.texi index 868ca818dec0..da9f2695f921 100644 --- a/util/invoke-ntp-keygen.texi +++ b/util/invoke-ntp-keygen.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntp-keygen.texi) # -# It has been AutoGen-ed June 23, 2020 at 02:21:07 AM by AutoGen 5.18.5 +# It has been AutoGen-ed May 31, 2023 at 08:03:04 PM by AutoGen 5.18.16 # From the definitions ntp-keygen-opts.def # and the template file agtexi-cmd.tpl @end ignore @@ -1056,7 +1056,7 @@ with a status code of 0. @exampleindent 0 @example -ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p15 +ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p16 Usage: ntp-keygen [ - [] | --[@{=| @}] ]... Flg Arg Option-Name Description -b Num imbits identity modulus bits @@ -1103,7 +1103,7 @@ The following option preset mechanisms are supported: - reading file ./.ntprc - examining environment variables named NTP_KEYGEN_* -Please send bug reports to: +Please send bug reports to: @end example @exampleindent 4 @@ -1121,7 +1121,7 @@ This option has some usage constraints. It: must be compiled in by defining @code{AUTOKEY} during the compilation. @end itemize -The number of bits in the identity modulus. The default is 256. +The number of bits in the identity modulus. The default is 512. @node ntp-keygen certificate @subsection certificate option (-c) @cindex ntp-keygen-certificate @@ -1490,7 +1490,7 @@ The command line options relating to configuration and/or usage help are: Print the program version to standard out, optionally with licensing information, then exit 0. The optional argument specifies how much licensing -detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument. +detail to provide. The default is to print just the version. The licensing information may be selected with an option argument. Only the first letter of the argument is examined: @table @samp diff --git a/util/ntp-keygen-opts.c b/util/ntp-keygen-opts.c index 2dbd4cc16275..47d03516a713 100644 --- a/util/ntp-keygen-opts.c +++ b/util/ntp-keygen-opts.c @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.c) * - * It has been AutoGen-ed June 23, 2020 at 02:21:03 AM by AutoGen 5.18.5 + * It has been AutoGen-ed May 31, 2023 at 08:03:01 PM by AutoGen 5.18.16 * From the definitions ntp-keygen-opts.def * and the template file options * - * Generated from AutoOpts 41:1:16 templates. + * Generated from AutoOpts 42:1:17 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -18,7 +18,7 @@ * The ntp-keygen program is copyrighted and licensed * under the following terms: * - * Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved. + * Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved. * This is free software. It is licensed for use, modification and * redistribution under the terms of the NTP License, copies of which * can be seen at: @@ -40,11 +40,15 @@ #define OPTION_CODE_COMPILE 1 #include "ntp-keygen-opts.h" #include +#include +#include +#include #include #include #include -#include +#include +#include #ifdef __cplusplus extern "C" { @@ -71,9 +75,9 @@ extern FILE * option_usage_fp; /** * static const strings for ntp-keygen options */ -static char const ntp_keygen_opt_strs[2442] = -/* 0 */ "ntp-keygen (ntp) 4.2.8p15\n" - "Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.\n" +static char const ntp_keygen_opt_strs[2443] = +/* 0 */ "ntp-keygen (ntp) 4.2.8p16\n" + "Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n" "This is free software. It is licensed for use, modification and\n" "redistribution under the terms of the NTP License, copies of which\n" "can be seen at:\n" @@ -165,14 +169,14 @@ static char const ntp_keygen_opt_strs[2442] = /* 2223 */ "no-load-opts\0" /* 2236 */ "no\0" /* 2239 */ "NTP_KEYGEN\0" -/* 2250 */ "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p15\n" +/* 2250 */ "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p16\n" "Usage: %s [ - [] | --[{=| }] ]...\n\0" /* 2365 */ "$HOME\0" /* 2371 */ ".\0" /* 2373 */ ".ntprc\0" -/* 2380 */ "http://bugs.ntp.org, bugs@ntp.org\0" -/* 2414 */ "\n\0" -/* 2416 */ "ntp-keygen (ntp) 4.2.8p15"; +/* 2380 */ "https://bugs.ntp.org, bugs@ntp.org\0" +/* 2415 */ "\n\0" +/* 2417 */ "ntp-keygen (ntp) 4.2.8p16"; /** * imbits option description: @@ -974,12 +978,12 @@ static char const * const apzHomeList[3] = { /** The ntp-keygen program bug email address. */ #define zBugsAddr (ntp_keygen_opt_strs+2380) /** Clarification/explanation of what ntp-keygen does. */ -#define zExplain (ntp_keygen_opt_strs+2414) +#define zExplain (ntp_keygen_opt_strs+2415) /** Extra detail explaining what ntp-keygen does. */ #define zDetail (NULL) /** The full version string for ntp-keygen. */ -#define zFullVersion (ntp_keygen_opt_strs+2416) -/* extracted from optcode.tlib near line 364 */ +#define zFullVersion (ntp_keygen_opt_strs+2417) +/* extracted from optcode.tlib near line 342 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE @@ -1011,7 +1015,7 @@ doUsageOpt(tOptions * opts, tOptDesc * od) ex_code = NTP_KEYGEN_EXIT_SUCCESS; optionUsage(&ntp_keygenOptions, ex_code); /* NOTREACHED */ - exit(1); + exit(NTP_KEYGEN_EXIT_FAILURE); (void)opts; (void)od; } @@ -1019,7 +1023,7 @@ doUsageOpt(tOptions * opts, tOptDesc * od) /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /** * Code to handle the imbits option, when AUTOKEY is #define-d. - * The number of bits in the identity modulus. The default is 256. + * The number of bits in the identity modulus. The default is 512. * @param[in] pOptions the ntp-keygen options data structure * @param[in,out] pOptDesc the option descriptor for this option. */ @@ -1299,19 +1303,19 @@ static void bogus_function(void) { extract the correct strings. These strings are actually referenced by a field name in the ntp_keygenOptions structure noted in the comments below. The literal text is defined in ntp_keygen_opt_strs. - + NOTE: the strings below are segmented with respect to the source string ntp_keygen_opt_strs. The strings above are handed off for translation at run time a paragraph at a time. Consequently, they are presented here for translation a paragraph at a time. - + ALSO: often the description for an option will reference another option by name. These are set off with apostrophe quotes (I hope). Do not translate option names. */ /* referenced via ntp_keygenOptions.pzCopyright */ - puts(_("ntp-keygen (ntp) 4.2.8p15\n\ -Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.\n\ + puts(_("ntp-keygen (ntp) 4.2.8p16\n\ +Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n\ This is free software. It is licensed for use, modification and\n\ redistribution under the terms of the NTP License, copies of which\n\ can be seen at:\n")); @@ -1409,14 +1413,14 @@ implied warranty.\n")); puts(_("load options from a config file")); /* referenced via ntp_keygenOptions.pzUsageTitle */ - puts(_("ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p15\n\ + puts(_("ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p16\n\ Usage: %s [ - [] | --[{=| }] ]...\n")); /* referenced via ntp_keygenOptions.pzExplain */ puts(_("\n")); /* referenced via ntp_keygenOptions.pzFullVersion */ - puts(_("ntp-keygen (ntp) 4.2.8p15")); + puts(_("ntp-keygen (ntp) 4.2.8p16")); /* referenced via ntp_keygenOptions.pzFullUsage */ puts(_("<<>>")); @@ -1426,234 +1430,230 @@ Usage: %s [ - [] | --[{=| }] ]...\n")); /* LIBOPTS-MESSAGES: */ #line 67 "../autoopts.c" puts(_("allocation of %d bytes failed\n")); -#line 93 "../autoopts.c" +#line 89 "../autoopts.c" puts(_("allocation of %d bytes failed\n")); -#line 53 "../init.c" +#line 48 "../init.c" puts(_("AutoOpts function called without option descriptor\n")); -#line 86 "../init.c" +#line 81 "../init.c" puts(_("\tThis exceeds the compiled library version: ")); -#line 84 "../init.c" +#line 79 "../init.c" puts(_("Automated Options Processing Error!\n" "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); -#line 80 "../autoopts.c" +#line 78 "../autoopts.c" puts(_("realloc of %d bytes at 0x%p failed\n")); -#line 88 "../init.c" +#line 83 "../init.c" puts(_("\tThis is less than the minimum library version: ")); #line 121 "../version.c" puts(_("Automated Options version %s\n" - "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n")); -#line 87 "../makeshell.c" + "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n")); +#line 49 "../makeshell.c" puts(_("(AutoOpts bug): %s.\n")); #line 90 "../reset.c" puts(_("optionResetOpt() called, but reset-option not configured")); -#line 292 "../usage.c" +#line 241 "../usage.c" puts(_("could not locate the 'help' option")); -#line 336 "../autoopts.c" +#line 330 "../autoopts.c" puts(_("optionProcess() was called with invalid data")); -#line 748 "../usage.c" +#line 697 "../usage.c" puts(_("invalid argument type specified")); -#line 598 "../find.c" +#line 568 "../find.c" puts(_("defaulted to option with optional arg")); #line 76 "../alias.c" puts(_("aliasing option is out of range.")); -#line 234 "../enum.c" +#line 210 "../enum.c" puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); -#line 108 "../find.c" +#line 78 "../find.c" puts(_(" The following options match:\n")); -#line 293 "../find.c" +#line 263 "../find.c" puts(_("%s: ambiguous option name: %s (matches %d options)\n")); #line 161 "../check.c" puts(_("%s: Command line arguments required\n")); #line 43 "../alias.c" puts(_("%d %s%s options allowed\n")); -#line 94 "../makeshell.c" +#line 56 "../makeshell.c" puts(_("%s error %d (%s) calling %s for '%s'\n")); -#line 306 "../makeshell.c" +#line 268 "../makeshell.c" puts(_("interprocess pipe")); -#line 168 "../version.c" +#line 171 "../version.c" puts(_("error: version option argument '%c' invalid. Use:\n" "\t'v' - version only\n" "\t'c' - version and copyright\n" "\t'n' - version and full copyright notice\n")); #line 58 "../check.c" puts(_("%s error: the '%s' and '%s' options conflict\n")); -#line 217 "../find.c" +#line 187 "../find.c" puts(_("%s: The '%s' option has been disabled.")); -#line 430 "../find.c" +#line 400 "../find.c" puts(_("%s: The '%s' option has been disabled.")); #line 38 "../alias.c" puts(_("-equivalence")); -#line 469 "../find.c" +#line 439 "../find.c" puts(_("%s: illegal option -- %c\n")); #line 110 "../reset.c" puts(_("%s: illegal option -- %c\n")); -#line 271 "../find.c" +#line 241 "../find.c" puts(_("%s: illegal option -- %s\n")); -#line 755 "../find.c" +#line 740 "../find.c" puts(_("%s: illegal option -- %s\n")); #line 118 "../reset.c" puts(_("%s: illegal option -- %s\n")); -#line 335 "../find.c" +#line 305 "../find.c" puts(_("%s: unknown vendor extension option -- %s\n")); -#line 159 "../enum.c" +#line 135 "../enum.c" puts(_(" or an integer from %d through %d\n")); -#line 169 "../enum.c" +#line 145 "../enum.c" puts(_(" or an integer from %d through %d\n")); -#line 747 "../usage.c" +#line 696 "../usage.c" puts(_("%s error: invalid option descriptor for %s\n")); -#line 1081 "../usage.c" +#line 1030 "../usage.c" puts(_("%s error: invalid option descriptor for %s\n")); -#line 385 "../find.c" +#line 355 "../find.c" puts(_("%s: invalid option name: %s\n")); -#line 527 "../find.c" +#line 497 "../find.c" puts(_("%s: The '%s' option requires an argument.\n")); -#line 156 "../autoopts.c" +#line 150 "../autoopts.c" puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" "\t'%s' and '%s'.")); #line 94 "../check.c" puts(_("%s error: The %s option is required\n")); -#line 632 "../find.c" +#line 602 "../find.c" puts(_("%s: The '%s' option cannot have an argument.\n")); #line 151 "../check.c" puts(_("%s: Command line arguments are not allowed.\n")); -#line 535 "../save.c" +#line 568 "../save.c" puts(_("error %d (%s) creating %s\n")); -#line 234 "../enum.c" +#line 210 "../enum.c" puts(_("%s error: '%s' does not match any %s keywords.\n")); #line 93 "../reset.c" puts(_("%s error: The '%s' option requires an argument.\n")); -#line 184 "../save.c" +#line 122 "../save.c" puts(_("error %d (%s) stat-ing %s\n")); -#line 238 "../save.c" +#line 175 "../save.c" puts(_("error %d (%s) stat-ing %s\n")); #line 143 "../restore.c" puts(_("%s error: no saved option state\n")); -#line 231 "../autoopts.c" +#line 225 "../autoopts.c" puts(_("'%s' is not a command line option.\n")); -#line 111 "../time.c" +#line 113 "../time.c" puts(_("%s error: '%s' is not a recognizable date/time.\n")); -#line 132 "../save.c" - puts(_("'%s' not defined\n")); #line 50 "../time.c" puts(_("%s error: '%s' is not a recognizable time duration.\n")); #line 92 "../check.c" puts(_("%s error: The %s option must appear %d times.\n")); -#line 164 "../numeric.c" +#line 165 "../numeric.c" puts(_("%s error: '%s' is not a recognizable number.\n")); -#line 200 "../enum.c" +#line 176 "../enum.c" puts(_("%s error: %s exceeds %s keyword count\n")); -#line 330 "../usage.c" +#line 279 "../usage.c" puts(_("Try '%s %s' for more information.\n")); #line 45 "../alias.c" puts(_("one %s%s option allowed\n")); -#line 208 "../makeshell.c" +#line 170 "../makeshell.c" puts(_("standard output")); -#line 943 "../makeshell.c" +#line 905 "../makeshell.c" puts(_("standard output")); -#line 274 "../usage.c" +#line 223 "../usage.c" puts(_("standard output")); -#line 415 "../usage.c" +#line 364 "../usage.c" puts(_("standard output")); -#line 625 "../usage.c" +#line 574 "../usage.c" puts(_("standard output")); -#line 175 "../version.c" +#line 178 "../version.c" puts(_("standard output")); -#line 274 "../usage.c" +#line 223 "../usage.c" puts(_("standard error")); -#line 415 "../usage.c" +#line 364 "../usage.c" puts(_("standard error")); -#line 625 "../usage.c" +#line 574 "../usage.c" puts(_("standard error")); -#line 175 "../version.c" +#line 178 "../version.c" puts(_("standard error")); -#line 208 "../makeshell.c" +#line 170 "../makeshell.c" puts(_("write")); -#line 943 "../makeshell.c" +#line 905 "../makeshell.c" puts(_("write")); -#line 273 "../usage.c" +#line 222 "../usage.c" puts(_("write")); -#line 414 "../usage.c" +#line 363 "../usage.c" puts(_("write")); -#line 624 "../usage.c" +#line 573 "../usage.c" puts(_("write")); -#line 174 "../version.c" +#line 177 "../version.c" puts(_("write")); #line 60 "../numeric.c" puts(_("%s error: %s option value %ld is out of range.\n")); #line 44 "../check.c" puts(_("%s error: %s option requires the %s option\n")); -#line 131 "../save.c" +#line 121 "../save.c" puts(_("%s warning: cannot save options - %s not regular file\n")); -#line 183 "../save.c" +#line 174 "../save.c" puts(_("%s warning: cannot save options - %s not regular file\n")); -#line 237 "../save.c" +#line 193 "../save.c" puts(_("%s warning: cannot save options - %s not regular file\n")); -#line 256 "../save.c" - puts(_("%s warning: cannot save options - %s not regular file\n")); -#line 534 "../save.c" +#line 567 "../save.c" puts(_("%s warning: cannot save options - %s not regular file\n")); /* END-LIBOPTS-MESSAGES */ /* USAGE-TEXT: */ -#line 873 "../usage.c" +#line 822 "../usage.c" puts(_("\t\t\t\t- an alternate for '%s'\n")); -#line 1148 "../usage.c" +#line 1097 "../usage.c" puts(_("Version, usage and configuration options:")); -#line 924 "../usage.c" +#line 873 "../usage.c" puts(_("\t\t\t\t- default option for unnamed options\n")); -#line 837 "../usage.c" +#line 786 "../usage.c" puts(_("\t\t\t\t- disabled as '--%s'\n")); -#line 1117 "../usage.c" +#line 1066 "../usage.c" puts(_(" --- %-14s %s\n")); -#line 1115 "../usage.c" +#line 1064 "../usage.c" puts(_("This option has been disabled")); -#line 864 "../usage.c" +#line 813 "../usage.c" puts(_("\t\t\t\t- enabled by default\n")); #line 40 "../alias.c" puts(_("%s error: only ")); -#line 1194 "../usage.c" +#line 1143 "../usage.c" puts(_(" - examining environment variables named %s_*\n")); #line 168 "../file.c" puts(_("\t\t\t\t- file must not pre-exist\n")); #line 172 "../file.c" puts(_("\t\t\t\t- file must pre-exist\n")); -#line 380 "../usage.c" +#line 329 "../usage.c" puts(_("Options are specified by doubled hyphens and their name or by a single\n" "hyphen and the flag character.\n")); -#line 921 "../makeshell.c" +#line 882 "../makeshell.c" puts(_("\n" "= = = = = = = =\n\n" "This incarnation of genshell will produce\n" "a shell script to parse the options for %s:\n\n")); -#line 166 "../enum.c" +#line 142 "../enum.c" puts(_(" or an integer mask with any of the lower %d bits set\n")); -#line 897 "../usage.c" +#line 846 "../usage.c" puts(_("\t\t\t\t- is a set membership option\n")); -#line 918 "../usage.c" +#line 867 "../usage.c" puts(_("\t\t\t\t- must appear between %d and %d times\n")); -#line 382 "../usage.c" +#line 331 "../usage.c" puts(_("Options are specified by single or double hyphens and their name.\n")); -#line 904 "../usage.c" +#line 853 "../usage.c" puts(_("\t\t\t\t- may appear multiple times\n")); -#line 891 "../usage.c" +#line 840 "../usage.c" puts(_("\t\t\t\t- may not be preset\n")); -#line 1309 "../usage.c" +#line 1258 "../usage.c" puts(_(" Arg Option-Name Description\n")); -#line 1245 "../usage.c" +#line 1194 "../usage.c" puts(_(" Flg Arg Option-Name Description\n")); -#line 1303 "../usage.c" +#line 1252 "../usage.c" puts(_(" Flg Arg Option-Name Description\n")); -#line 1304 "../usage.c" +#line 1253 "../usage.c" puts(_(" %3s %s")); -#line 1310 "../usage.c" +#line 1259 "../usage.c" puts(_(" %3s %s")); -#line 387 "../usage.c" +#line 336 "../usage.c" puts(_("The '-#' option may omit the hash char\n")); -#line 383 "../usage.c" +#line 332 "../usage.c" puts(_("All arguments are named options.\n")); -#line 971 "../usage.c" +#line 920 "../usage.c" puts(_(" - reading file %s")); -#line 409 "../usage.c" +#line 358 "../usage.c" puts(_("\n" "Please send bug reports to: <%s>\n")); #line 100 "../version.c" @@ -1662,17 +1662,17 @@ Usage: %s [ - [] | --[{=| }] ]...\n")); #line 129 "../version.c" puts(_("\n" "Please send bug reports to: <%s>\n")); -#line 903 "../usage.c" +#line 852 "../usage.c" puts(_("\t\t\t\t- may NOT appear - preset only\n")); -#line 944 "../usage.c" +#line 893 "../usage.c" puts(_("\n" "The following option preset mechanisms are supported:\n")); -#line 1192 "../usage.c" +#line 1141 "../usage.c" puts(_("\n" "The following option preset mechanisms are supported:\n")); -#line 682 "../usage.c" +#line 631 "../usage.c" puts(_("prohibits these options:\n")); -#line 677 "../usage.c" +#line 626 "../usage.c" puts(_("prohibits the option '%s'\n")); #line 81 "../numeric.c" puts(_("%s%ld to %ld")); @@ -1690,28 +1690,28 @@ Usage: %s [ - [] | --[{=| }] ]...\n")); puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); #line 77 "../numeric.c" puts(_("%sless than or equal to %ld")); -#line 390 "../usage.c" +#line 339 "../usage.c" puts(_("Operands and options may be intermixed. They will be reordered.\n")); -#line 652 "../usage.c" +#line 601 "../usage.c" puts(_("requires the option '%s'\n")); -#line 655 "../usage.c" +#line 604 "../usage.c" puts(_("requires these options:\n")); -#line 1321 "../usage.c" +#line 1270 "../usage.c" puts(_(" Arg Option-Name Req? Description\n")); -#line 1315 "../usage.c" +#line 1264 "../usage.c" puts(_(" Flg Arg Option-Name Req? Description\n")); -#line 167 "../enum.c" +#line 143 "../enum.c" puts(_("or you may use a numeric representation. Preceding these with a '!'\n" "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" "will set them all. Multiple entries may be passed as an option\n" "argument list.\n")); -#line 910 "../usage.c" +#line 859 "../usage.c" puts(_("\t\t\t\t- may appear up to %d times\n")); -#line 77 "../enum.c" +#line 52 "../enum.c" puts(_("The valid \"%s\" option keywords are:\n")); -#line 1152 "../usage.c" +#line 1101 "../usage.c" puts(_("The next option supports vendor supported extra options:")); -#line 773 "../usage.c" +#line 722 "../usage.c" puts(_("These additional options are:")); /* END-USAGE-TEXT */ } diff --git a/util/ntp-keygen-opts.def b/util/ntp-keygen-opts.def index f89ee334484f..632dbbec778d 100644 --- a/util/ntp-keygen-opts.def +++ b/util/ntp-keygen-opts.def @@ -22,7 +22,7 @@ flag = { ifdef = AUTOKEY; descrip = "identity modulus bits"; doc = <<- _EndOfDoc_ - The number of bits in the identity modulus. The default is 256. + The number of bits in the identity modulus. The default is 512. _EndOfDoc_; }; diff --git a/util/ntp-keygen-opts.h b/util/ntp-keygen-opts.h index e17412417f92..8bbd22dcd932 100644 --- a/util/ntp-keygen-opts.h +++ b/util/ntp-keygen-opts.h @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.h) * - * It has been AutoGen-ed June 23, 2020 at 02:21:03 AM by AutoGen 5.18.5 + * It has been AutoGen-ed May 31, 2023 at 08:03:00 PM by AutoGen 5.18.16 * From the definitions ntp-keygen-opts.def * and the template file options * - * Generated from AutoOpts 41:1:16 templates. + * Generated from AutoOpts 42:1:17 templates. * * AutoOpts is a copyrighted work. This header file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -18,7 +18,7 @@ * The ntp-keygen program is copyrighted and licensed * under the following terms: * - * Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved. + * Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved. * This is free software. It is licensed for use, modification and * redistribution under the terms of the NTP License, copies of which * can be seen at: @@ -45,6 +45,8 @@ #define AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD 1 #include "config.h" #include +#include +#include /** * Ensure that the library used for compiling this generated header is at @@ -53,13 +55,19 @@ * tolerable version is at least as old as what was current when the header * template was released. */ -#define AO_TEMPLATE_VERSION 167937 +#define AO_TEMPLATE_VERSION 172033 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header Choke Me. #endif +#if GCC_VERSION > 40400 +#define NOT_REACHED __builtin_unreachable(); +#else +#define NOT_REACHED +#endif + /** * Enumeration of each option type for ntp-keygen */ @@ -94,9 +102,9 @@ typedef enum { /** count of all options for ntp-keygen */ #define OPTION_CT 26 /** ntp-keygen version */ -#define NTP_KEYGEN_VERSION "4.2.8p15" +#define NTP_KEYGEN_VERSION "4.2.8p16" /** Full ntp-keygen version text */ -#define NTP_KEYGEN_FULL_VERSION "ntp-keygen (ntp) 4.2.8p15" +#define NTP_KEYGEN_FULL_VERSION "ntp-keygen (ntp) 4.2.8p16" /** * Interface defines for all options. Replace "n" with the UPPER_CASED @@ -378,6 +386,7 @@ static inline char* aoGetsText(char const* pz) { # endif #endif /* ENABLE_NLS */ + #ifdef __cplusplus } #endif diff --git a/util/ntp-keygen.1ntp-keygenman b/util/ntp-keygen.1ntp-keygenman index 8ed9a945b540..235e0b903d81 100644 --- a/util/ntp-keygen.1ntp-keygenman +++ b/util/ntp-keygen.1ntp-keygenman @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntp-keygen 1ntp-keygenman "23 Jun 2020" "ntp (4.2.8p15)" "User Commands" +.TH ntp-keygen 1ntp-keygenman "31 May 2023" "ntp (4.2.8p16)" "User Commands" .\" .\" EDIT THIS FILE WITH CAUTION (in-mem file) .\" -.\" It has been AutoGen-ed June 23, 2020 at 02:21:08 AM by AutoGen 5.18.5 +.\" It has been AutoGen-ed May 31, 2023 at 07:44:05 PM by AutoGen 5.18.16 .\" From the definitions ntp-keygen-opts.def .\" and the template file agman-cmd.tpl .SH NAME @@ -1132,7 +1132,7 @@ in the range 256 through 2048 .fi .in -4 .sp -The number of bits in the identity modulus. The default is 256. +The number of bits in the identity modulus. The default is 512. .TP .NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]scheme\f[], \f\*[B-Font]\-\-certificate\f[]=\f\*[I-Font]scheme\f[] certificate scheme. @@ -1351,7 +1351,7 @@ it to autogen-users@lists.sourceforge.net. Thank you. .SH "AUTHORS" The University of Delaware and Network Time Foundation .SH "COPYRIGHT" -Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, . .SH BUGS It can take quite a while to generate some cryptographic values. @@ -1362,7 +1362,7 @@ Please report bugs to http://bugs.ntp.org . .sp \n(Ppu .ne 2 -Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org +Please send bug reports to: https://bugs.ntp.org, bugs@ntp.org .SH NOTES Portions of this document came from FreeBSD. .sp \n(Ppu diff --git a/util/ntp-keygen.1ntp-keygenmdoc b/util/ntp-keygen.1ntp-keygenmdoc index 0faf3187b2c5..87ef82e6bb62 100644 --- a/util/ntp-keygen.1ntp-keygenmdoc +++ b/util/ntp-keygen.1ntp-keygenmdoc @@ -1,9 +1,9 @@ -.Dd June 23 2020 +.Dd May 31 2023 .Dt NTP_KEYGEN 1ntp-keygenmdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.mdoc) .\" -.\" It has been AutoGen-ed June 23, 2020 at 02:21:05 AM by AutoGen 5.18.5 +.\" It has been AutoGen-ed May 31, 2023 at 07:44:01 PM by AutoGen 5.18.16 .\" From the definitions ntp-keygen-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -1017,7 +1017,7 @@ in the range 256 through 2048 .fi .in -4 .sp -The number of bits in the identity modulus. The default is 256. +The number of bits in the identity modulus. The default is 512. .It Fl c Ar scheme , Fl \-certificate Ns = Ns Ar scheme certificate scheme. .sp @@ -1208,14 +1208,14 @@ it to autogen\-users@lists.sourceforge.net. Thank you. .Sh "AUTHORS" The University of Delaware and Network Time Foundation .Sh "COPYRIGHT" -Copyright (C) 1992\-2020 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992\-2023 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, . .Sh BUGS It can take quite a while to generate some cryptographic values. .Pp Please report bugs to http://bugs.ntp.org . .Pp -Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org +Please send bug reports to: https://bugs.ntp.org, bugs@ntp.org .Sh NOTES Portions of this document came from FreeBSD. .Pp diff --git a/util/ntp-keygen.c b/util/ntp-keygen.c index eb2cb34f7ed7..ff9d6cad8980 100644 --- a/util/ntp-keygen.c +++ b/util/ntp-keygen.c @@ -121,7 +121,7 @@ #define MD5SIZE 20 /* maximum key size */ #ifdef AUTOKEY #define PLEN 512 /* default prime modulus size (bits) */ -#define ILEN 256 /* default identity modulus size (bits) */ +#define ILEN 512 /* default identity modulus size (bits) */ #define MVMAX 100 /* max MV parameters */ /* @@ -266,7 +266,7 @@ InitWin32Sockets() { /* * followlink() - replace filename with its target if symlink. * - * Some readlink() implementations do not null-terminate the result. + * readlink() does not null-terminate the result. */ void followlink( @@ -274,18 +274,22 @@ followlink( size_t bufsiz ) { - int len; + ssize_t len; + char * target; - REQUIRE(bufsiz > 0); + REQUIRE(bufsiz > 0 && bufsiz <= SSIZE_MAX); - len = readlink(fname, fname, (int)bufsiz); - if (len < 0 ) { + target = emalloc(bufsiz); + len = readlink(fname, target, bufsiz); + if (len < 0) { fname[0] = '\0'; return; } - if (len > (int)bufsiz - 1) - len = (int)bufsiz - 1; + if ((size_t)len > bufsiz - 1) + len = bufsiz - 1; + memcpy(fname, target, len); fname[len] = '\0'; + free(target); } diff --git a/util/ntp-keygen.html b/util/ntp-keygen.html index 47daf5e0dfa0..53aabf6c9fb1 100644 --- a/util/ntp-keygen.html +++ b/util/ntp-keygen.html @@ -1,6 +1,6 @@ - + Ntp-keygen User’s Manual @@ -16,23 +16,14 @@