8b8da0870d
* [Sec 2956] small-step/big-step. Close the panic gate earlier. HStenn. * CID 1339955: Free allocated memory in caljulian test. HStenn. * CID 1339962: Explicitly initialize variable in caljulian test. HStenn. * CID 1341527: Quiet a CHECKED_RETURN in sntp/tests/t-log.c. HStenn. * CID 1341533: Missing assertion in sntp/tests/t-log.c. HStenn. * CID 1341534: Resource leak in tests/ntpd/t-ntp_signd.c. HStenn. * CID 1341535: Resource leak in tests/ntpd/t-ntp_signd.c. HStenn. * CID 1341536: Resource leak in tests/ntpd/t-ntp_signd.c. HStenn. * CID 1341537: Resource leak in tests/ntpd/t-ntp_signd.c. HStenn. * CID 1341538: Memory leak in tests/ntpd/ntp_prio_q.c:262. HStenn. * CID 1341677: Nits in sntp/tests/keyFile.c. HStenn. * CID 1341678: Nits in sntp/tests/keyFile.c. HStenn. * CID 1341679: Nits in sntp/tests/keyFile.c. HStenn. * CID 1341680: Nits in sntp/tests/keyFile.c. HStenn. * CID 1341681: Nits in sntp/tests/keyFile.c. HStenn. * CID 1341682: Nit in libntp/authreadkeys.c. HStenn. * CID 1341684: Nit in tests/ntpd/t-ntp_signd.c. HStenn. * [Bug 2829] Look at pipe_fds in ntpd.c (did so. perlinger@ntp.org) * [Bug 2887] stratum -1 config results as showing value 99 - fudge stratum should only accept values [0..16]. perlinger@ntp.org * [Bug 2932] Update leapsecond file info in miscopt.html. CWoodbury, HStenn. * [Bug 2934] tests/ntpd/t-ntp_scanner.c has a magic constant wired in. HMurray * [Bug 2944] errno is not preserved properly in ntpdate after sendto call. - applied patch by Christos Zoulas. perlinger@ntp.org * [Bug 2952] Symmetric active/passive mode is broken. HStenn. * [Bug 2954] Version 4.2.8p4 crashes on startup with sig fault - fixed data race conditions in threaded DNS worker. perlinger@ntp.org - limit threading warm-up to linux; FreeBSD bombs on it. perlinger@ntp.org * [Bug 2957] 'unsigned int' vs 'size_t' format clash. perlinger@ntp.org - accept key file only if there are no parsing errors - fixed size_t/u_int format clash - fixed wrong use of 'strlcpy' * [Bug 2958] ntpq: fatal error messages need a final newline. Craig Leres. * [Bug 2962] truncation of size_t/ptrdiff_t on 64bit targets. perlinger@ntp.org - fixed several other warnings (cast-alignment, missing const, missing prototypes) - promote use of 'size_t' for values that express a size - use ptr-to-const for read-only arguments - make sure SOCKET values are not truncated (win32-specific) - format string fixes * [Bug 2965] Local clock didn't work since 4.2.8p4. Martin Burnicki. * [Bug 2967] ntpdate command suffers an assertion failure - fixed ntp_rfc2553.c to return proper address length. perlinger@ntp.org * [Bug 2969] Seg fault from ntpq/mrulist when looking at server with lots of clients. perlinger@ntp.org * [Bug 2971] ntpq bails on ^C: select fails: Interrupted system call - changed stacked/nested handling of CTRL-C. perlinger@ntp.org * Unity cleanup for FreeBSD-6.4. Harlan Stenn. * Unity test cleanup. Harlan Stenn. * Libevent autoconf pthread fixes for FreeBSD-10. Harlan Stenn. * Header cleanup in tests/sandbox/uglydate.c. Harlan Stenn. * Header cleanup in tests/libntp/sfptostr.c. Harlan Stenn. * Quiet a warning from clang. Harlan Stenn. * Update the NEWS file. Harlan Stenn. * Update scripts/calc_tickadj/Makefile.am. Harlan Stenn.
227 lines
4.7 KiB
C
227 lines
4.7 KiB
C
/* $NetBSD: l_stdlib.h,v 1.4 2016/01/08 21:35:35 christos Exp $ */
|
|
|
|
/*
|
|
* Proto types for machines that are not ANSI and POSIX compliant.
|
|
* This is optional
|
|
*/
|
|
|
|
#ifndef L_STDLIB_H
|
|
#define L_STDLIB_H
|
|
|
|
#ifdef HAVE_STDLIB_H
|
|
# include <stdlib.h>
|
|
#endif
|
|
|
|
#include <stdarg.h>
|
|
#include <sys/types.h>
|
|
|
|
/* Needed for speed_t. */
|
|
#ifdef HAVE_TERMIOS_H
|
|
# include <termios.h>
|
|
#endif
|
|
|
|
#ifdef HAVE_ERRNO_H
|
|
# include <errno.h>
|
|
#endif
|
|
|
|
#include "ntp_types.h"
|
|
#include "ntp_proto.h"
|
|
|
|
/* Let's try to keep this more or less alphabetized... */
|
|
|
|
#ifdef DECL_ADJTIME_0
|
|
struct timeval;
|
|
extern int adjtime (struct timeval *, struct timeval *);
|
|
#endif
|
|
|
|
#ifdef DECL_BCOPY_0
|
|
#ifndef bcopy
|
|
extern void bcopy (const char *, char *, int);
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef DECL_BZERO_0
|
|
#ifndef bzero
|
|
extern void bzero (char *, int);
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef DECL_CFSETISPEED_0
|
|
struct termios;
|
|
extern int cfsetispeed (struct termios *, speed_t);
|
|
extern int cfsetospeed (struct termios *, speed_t);
|
|
#endif
|
|
|
|
extern char * getpass (const char *);
|
|
|
|
#ifdef DECL_HSTRERROR_0
|
|
extern const char * hstrerror (int);
|
|
#endif
|
|
|
|
#ifdef DECL_INET_NTOA_0
|
|
struct in_addr;
|
|
extern char * inet_ntoa (struct in_addr);
|
|
#endif
|
|
|
|
#ifdef DECL_IOCTL_0
|
|
extern int ioctl (int, u_long, char *);
|
|
#endif
|
|
|
|
#ifdef DECL_IPC_0
|
|
struct sockaddr;
|
|
extern int bind (int, struct sockaddr *, int);
|
|
extern int connect (int, struct sockaddr *, int);
|
|
extern int recv (int, char *, int, int);
|
|
extern int recvfrom (int, char *, int, int, struct sockaddr *, int *);
|
|
extern int send (int, char *, int, int);
|
|
extern int sendto (int, char *, int, int, struct sockaddr *, int);
|
|
extern int setsockopt (int, int, int, char *, int);
|
|
extern int socket (int, int, int);
|
|
#endif
|
|
|
|
#ifdef DECL_MEMMOVE_0
|
|
extern void * memmove (void *, const void *, size_t);
|
|
#endif
|
|
|
|
#ifdef DECL_MEMSET_0
|
|
extern char * memset (char *, int, int);
|
|
#endif
|
|
|
|
#ifdef DECL_MKSTEMP_0
|
|
extern int mkstemp (char *);
|
|
#endif
|
|
|
|
#ifdef DECL_MKTEMP_0
|
|
extern char *mktemp (char *);
|
|
#endif
|
|
|
|
#ifdef DECL_NLIST_0
|
|
struct nlist;
|
|
extern int nlist (const char *, struct nlist *);
|
|
#endif
|
|
|
|
#ifdef DECL_PLOCK_0
|
|
extern int plock (int);
|
|
#endif
|
|
|
|
#ifdef DECL_RENAME_0
|
|
extern int rename (const char *, const char *);
|
|
#endif
|
|
|
|
#ifdef DECL_SELECT_0
|
|
#ifdef NTP_SELECT_H
|
|
extern int select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef DECL_SETITIMER_0
|
|
struct itimerval;
|
|
extern int setitimer (int , struct itimerval *, struct itimerval *);
|
|
#endif
|
|
|
|
#ifdef PRIO_PROCESS
|
|
#ifdef DECL_SETPRIORITY_0
|
|
extern int setpriority (int, int, int);
|
|
#endif
|
|
#ifdef DECL_SETPRIORITY_1
|
|
extern int setpriority (int, id_t, int);
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef DECL_SIGVEC_0
|
|
struct sigvec;
|
|
extern int sigvec (int, struct sigvec *, struct sigvec *);
|
|
#endif
|
|
|
|
#ifdef DECL_STDIO_0
|
|
#if defined(FILE) || defined(BUFSIZ)
|
|
extern int _flsbuf (int, FILE *);
|
|
extern int _filbuf (FILE *);
|
|
extern int fclose (FILE *);
|
|
extern int fflush (FILE *);
|
|
extern int fprintf (FILE *, const char *, ...);
|
|
extern int fscanf (FILE *, const char *, ...);
|
|
extern int fputs (const char *, FILE *);
|
|
extern int fputc (int, FILE *);
|
|
extern int fread (char *, int, int, FILE *);
|
|
extern void perror (const char *);
|
|
extern int printf (const char *, ...);
|
|
extern int setbuf (FILE *, char *);
|
|
# ifdef HAVE_SETLINEBUF
|
|
extern int setlinebuf (FILE *);
|
|
# endif
|
|
extern int setvbuf (FILE *, char *, int, int);
|
|
extern int scanf (const char *, ...);
|
|
extern int sscanf (const char *, const char *, ...);
|
|
extern int vfprintf (FILE *, const char *, ...);
|
|
extern int vsprintf (char *, const char *, ...);
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef DECL_STIME_0
|
|
extern int stime (const time_t *);
|
|
#endif
|
|
|
|
#ifdef DECL_STIME_1
|
|
extern int stime (long *);
|
|
#endif
|
|
|
|
#ifdef DECL_STRERROR_0
|
|
extern char * strerror (int errnum);
|
|
#endif
|
|
|
|
#ifdef DECL_STRTOL_0
|
|
extern long strtol (const char *, char **, int);
|
|
#endif
|
|
|
|
#ifdef DECL_SYSCALL
|
|
extern int syscall (int, ...);
|
|
#endif
|
|
|
|
#ifdef DECL_SYSLOG_0
|
|
extern void closelog (void);
|
|
#ifndef LOG_DAEMON
|
|
extern void openlog (const char *, int);
|
|
#else
|
|
extern void openlog (const char *, int, int);
|
|
#endif
|
|
extern int setlogmask (int);
|
|
extern void syslog (int, const char *, ...);
|
|
#endif
|
|
|
|
#ifdef DECL_TIME_0
|
|
extern time_t time (time_t *);
|
|
#endif
|
|
|
|
#ifdef DECL_TIMEOFDAY_0
|
|
#ifdef SYSV_TIMEOFDAY
|
|
extern int gettimeofday (struct timeval *);
|
|
extern int settimeofday (struct timeval *);
|
|
#else /* not SYSV_TIMEOFDAY */
|
|
struct timezone;
|
|
extern int gettimeofday (struct timeval *, struct timezone *);
|
|
extern int settimeofday (struct timeval *, void *);
|
|
#endif /* not SYSV_TIMEOFDAY */
|
|
#endif
|
|
|
|
#ifdef DECL_TOLOWER_0
|
|
extern int tolower (int);
|
|
#endif
|
|
|
|
#ifdef DECL_TOUPPER_0
|
|
extern int toupper (int);
|
|
#endif
|
|
|
|
/*
|
|
* Necessary variable declarations.
|
|
*/
|
|
#ifdef DECL_ERRNO
|
|
extern int errno;
|
|
#endif
|
|
|
|
#if defined(DECL_H_ERRNO) && !defined(h_errno)
|
|
extern int h_errno;
|
|
#endif
|
|
|
|
#endif /* L_STDLIB_H */
|