NetBSD re-synchronization of the source tree

This brings our tree to NetBSD 7.0, as found on -current on the
10-10-2015.

This updates:
 - LLVM to 3.6.1
 - GCC to GCC 5.1
 - Replace minix/commands/zdump with usr.bin/zdump
 - external/bsd/libelf has moved to /external/bsd/elftoolchain/
 - Import ctwm
 - Drop sprintf from libminc

Change-Id: I149836ac18e9326be9353958bab9b266efb056f0
This commit is contained in:
2015-10-15 17:01:16 +02:00
parent 8933525b85
commit 0a6a1f1d05
32425 changed files with 2998623 additions and 1342348 deletions

View File

@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.139 2012/02/11 23:31:24 martin Exp $
# $NetBSD: Makefile,v 1.141 2015/07/29 00:10:26 christos Exp $
# @(#)Makefile 8.2 (Berkeley) 1/4/94
# Doing a make includes builds /usr/include
@@ -8,7 +8,7 @@ NOOBJ= # defined
# Missing: mp.h
INCS= a.out.h aio.h ar.h assert.h atomic.h \
bitstring.h bm.h cdbr.h cdbw.h complex.h cpio.h ctype.h \
bitstring.h bm.h cdbw.h complex.h cpio.h ctype.h \
db.h dirent.h disktab.h dlfcn.h err.h errno.h fenv.h fmtmsg.h fnmatch.h \
fstab.h fts.h ftw.h getopt.h glob.h grp.h ifaddrs.h iconv.h \
inttypes.h iso646.h kvm.h langinfo.h libgen.h \
@@ -18,7 +18,7 @@ INCS= a.out.h aio.h ar.h assert.h atomic.h \
ndbm.h netconfig.h netdb.h netgroup.h nlist.h nl_types.h nsswitch.h \
paths.h pwd.h quota.h randomid.h ranlib.h re_comp.h regex.h regexp.h \
resolv.h res_update.h rmt.h sched.h search.h semaphore.h setjmp.h \
string.h sgtty.h signal.h spawn.h stab.h stdbool.h stddef.h stdio.h \
string.h sgtty.h signal.h spawn.h stab.h stddef.h stdio.h \
stdlib.h strings.h stringlist.h struct.h sysexits.h tar.h time.h \
ttyent.h tzfile.h ucontext.h ulimit.h unistd.h util.h utime.h utmp.h \
utmpx.h uuid.h vis.h wchar.h wctype.h wordexp.h

View File

@@ -1,4 +1,4 @@
/* $NetBSD: nameser_compat.h,v 1.5 2009/04/12 17:07:34 christos Exp $ */
/* $NetBSD: nameser_compat.h,v 1.6 2015/02/24 17:57:08 christos Exp $ */
/* Copyright (c) 1983, 1989
* The Regents of the University of California. All rights reserved.
@@ -11,11 +11,7 @@
* 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
* 3. 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.
*

View File

@@ -1,56 +0,0 @@
/* $NetBSD: cdbr.h,v 1.1 2010/04/25 00:54:45 joerg Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Joerg Sonnenberger.
*
* 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 COPYRIGHT HOLDERS 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
* COPYRIGHT HOLDERS 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.
*/
#ifndef _CDBR_H
#define _CDBR_H
#include <sys/cdefs.h>
#include <inttypes.h>
#include <stddef.h>
#define CDBR_DEFAULT 0
struct cdbr;
__BEGIN_DECLS
struct cdbr *cdbr_open(const char *, int);
uint32_t cdbr_entries(struct cdbr *);
int cdbr_get(struct cdbr *, uint32_t, const void **, size_t *);
int cdbr_find(struct cdbr *, const void *, size_t,
const void **, size_t *);
void cdbr_close(struct cdbr *);
__END_DECLS
#endif /* _CDBR_H */

View File

@@ -1,4 +1,4 @@
/* $NetBSD: err.h,v 1.16 2011/07/17 20:54:34 joerg Exp $ */
/* $NetBSD: err.h,v 1.17 2014/01/16 17:22:06 christos Exp $ */
/*-
* Copyright (c) 1993
@@ -46,6 +46,10 @@ __dead void errx(int, const char *, ...)
__printflike(2, 3) __dead;
__dead void verrx(int, const char *, va_list)
__printflike(2, 0) __dead;
__dead void errc(int, int, const char *, ...)
__printflike(3, 4) __dead;
__dead void verrc(int, int, const char *, va_list)
__printflike(3, 0) __dead;
void warn(const char *, ...)
__printflike(1, 2);
void vwarn(const char *, va_list)
@@ -54,6 +58,10 @@ void warnx(const char *, ...)
__printflike(1, 2);
void vwarnx(const char *, va_list)
__printflike(1, 0);
void warnc(int, const char *, ...)
__printflike(2, 3);
void vwarnc(int, const char *, va_list)
__printflike(2, 0);
__END_DECLS
#endif /* !_ERR_H_ */

View File

@@ -1,4 +1,4 @@
/* $NetBSD: fenv.h,v 1.9 2013/04/28 21:07:36 matt Exp $ */
/* $NetBSD: fenv.h,v 1.13 2014/12/27 16:54:02 martin Exp $ */
/*
* Copyright (c) 2010 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -25,8 +25,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#if !defined(__arm__) && !defined(__i386__) \
&& !defined(__sparc__) && !defined(__x86_64__)
#if !defined(__aarch64__) && !defined(__arm__) && !defined(__i386__) \
&& !defined(__hppa__) \
&& !defined(__or1k__) && !defined(__riscv__) && !defined(__sparc__) \
&& !defined(__x86_64__)
#error "fenv.h is currently not supported for this architecture"
#endif

View File

@@ -1,4 +1,4 @@
/* $NetBSD: inttypes.h,v 1.10 2013/04/27 21:24:27 joerg Exp $ */
/* $NetBSD: inttypes.h,v 1.11 2015/01/16 18:35:59 christos Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -75,6 +75,21 @@ intmax_t wcstoimax_l(const wchar_t * __restrict,
uintmax_t wcstoumax_l(const wchar_t * __restrict,
wchar_t ** __restrict, int, locale_t);
#endif
#if defined(_NETBSD_SOURCE)
intmax_t strtoi(const char * __restrict, char ** __restrict, int,
intmax_t, intmax_t, int *);
uintmax_t strtou(const char * __restrict, char ** __restrict, int,
uintmax_t, uintmax_t, int *);
/* i18n variations */
intmax_t strtoi_l(const char * __restrict, char ** __restrict, int,
intmax_t, intmax_t, int *, locale_t);
uintmax_t strtou_l(const char * __restrict, char ** __restrict, int,
uintmax_t, uintmax_t, int *, locale_t);
#endif /* defined(_NETBSD_SOURCE) */
__END_DECLS
#endif /* !_INTTYPES_H_ */

View File

@@ -1,4 +1,4 @@
/* $NetBSD: limits.h,v 1.33 2012/11/18 17:41:53 manu Exp $ */
/* $NetBSD: limits.h,v 1.34 2015/05/29 07:37:31 manu Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -75,18 +75,20 @@
*/
/*
* The following 3 are not part of the standard
* but left here for compatibility
* The following 3 are defined in
* Open Group Base Specifications Issue 7
*/
#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
#define _POSIX_THREAD_KEYS_MAX 256
#define _POSIX_THREAD_KEYS_MAX 128
#define _POSIX_THREAD_THREADS_MAX 64
/*
* These are the correct names, defined in terms of the above
* except for PTHREAD_KEYS_MAX which is bigger than standard
* mandated minimum value _POSIX_THREAD_KEYS_MAX.
*/
#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
#define PTHREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX
#define PTHREAD_KEYS_MAX 256
/* Not yet: PTHREAD_STACK_MIN */
#define PTHREAD_THREADS_MAX _POSIX_THREAD_THREADS_MAX

View File

@@ -1,4 +1,4 @@
/* $NetBSD: lwp.h,v 1.11 2009/01/11 03:04:12 christos Exp $ */
/* $NetBSD: lwp.h,v 1.12 2014/01/31 20:44:17 christos Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -54,8 +54,8 @@ void _lwp_setprivate(void *);
int _lwp_kill(lwpid_t, int);
int _lwp_detach(lwpid_t);
#ifndef __LIBC12_SOURCE__
int _lwp_park(const struct timespec *, lwpid_t, const void *, const void *)
__RENAME(___lwp_park50);
int _lwp_park(clockid_t, int, const struct timespec *, lwpid_t,
const void *, const void *) __RENAME(___lwp_park60);
#endif
int _lwp_unpark(lwpid_t, const void *);
ssize_t _lwp_unpark_all(const lwpid_t *, size_t, const void *);

View File

@@ -1,4 +1,4 @@
/* $NetBSD: paths.h,v 1.41 2012/06/03 21:42:46 joerg Exp $ */
/* $NetBSD: paths.h,v 1.42 2015/05/06 23:06:26 pgoyette Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -99,6 +99,7 @@
#define _PATH_URANDOM "/dev/urandom"
#define _PATH_VIDEO "/dev/video"
#define _PATH_VIDEO0 "/dev/video0"
#define _PATH_WATCHDOG "/dev/watchdog"
/*
* Provide trailing slash, since mostly used for building pathnames.

View File

@@ -1,4 +1,4 @@
/* $NetBSD: clnt.h,v 1.21 2011/08/30 17:06:20 plunky Exp $ */
/* $NetBSD: clnt.h,v 1.22 2014/06/06 14:31:24 christos Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -451,14 +451,10 @@ struct rpc_createerr {
struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
};
#ifdef _REENTRANT
__BEGIN_DECLS
extern struct rpc_createerr *__rpc_createerr(void);
__END_DECLS
#define rpc_createerr (*(__rpc_createerr()))
#else
extern struct rpc_createerr rpc_createerr;
#endif /* _REENTRANT */
/*
* The simplified interface:

View File

@@ -1,4 +1,4 @@
/* $NetBSD: search.h,v 1.20 2013/04/27 21:35:25 joerg Exp $ */
/* $NetBSD: search.h,v 1.22 2014/07/20 20:17:21 christos Exp $ */
/*
* Written by J.T. Conklin <jtc@NetBSD.org>
@@ -62,8 +62,10 @@ void hdestroy(void);
ENTRY *hsearch(ENTRY, ACTION);
#ifdef _NETBSD_SOURCE
void hdestroy1(void (*)(void *), void (*)(void *));
int hcreate_r(size_t, struct hsearch_data *);
void hdestroy_r(struct hsearch_data *);
void hdestroy1_r(struct hsearch_data *, void (*)(void *), void (*)(void *));
int hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *);
#endif /* _NETBSD_SOURCE */

View File

@@ -1,4 +1,4 @@
/* $NetBSD: signal.h,v 1.54 2010/08/27 08:40:38 christos Exp $ */
/* $NetBSD: signal.h,v 1.55 2015/07/31 12:51:32 kamil Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -199,7 +199,7 @@ int sigwaitinfo(const sigset_t * __restrict, siginfo_t * __restrict);
void psiginfo(const siginfo_t *, const char *);
#ifndef __LIBC12_SOURCE__
struct timespec;
#include <sys/timespec.h>
int sigtimedwait(const sigset_t * __restrict,
siginfo_t * __restrict, const struct timespec * __restrict)
__RENAME(__sigtimedwait50);

View File

@@ -1,4 +1,4 @@
/* $NetBSD: ssp.h,v 1.10 2012/08/08 20:23:32 joerg Exp $ */
/* $NetBSD: ssp.h,v 1.13 2015/09/03 20:43:47 plunky Exp $ */
/*-
* Copyright (c) 2006, 2011 The NetBSD Foundation, Inc.
@@ -64,18 +64,22 @@
#define __ssp_check(buf, len, bos) \
if (bos(buf) != (size_t)-1 && len > bos(buf)) \
__chk_fail()
#define __ssp_redirect_raw(rtype, fun, symbol, args, call, bos) \
#define __ssp_redirect_raw(rtype, fun, symbol, args, call, cond, bos) \
rtype __ssp_real_(fun) args __RENAME(symbol); \
__ssp_inline rtype fun args __RENAME(__ssp_protected_ ## fun); \
__ssp_inline rtype fun args { \
__ssp_check(__buf, __len, bos); \
if (cond) \
__ssp_check(__buf, __len, bos); \
return __ssp_real_(fun) call; \
}
#define __ssp_redirect(rtype, fun, args, call) \
__ssp_redirect_raw(rtype, fun, fun, args, call, __ssp_bos)
__ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos)
#define __ssp_redirect0(rtype, fun, args, call) \
__ssp_redirect_raw(rtype, fun, fun, args, call, __ssp_bos0)
__ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos0)
#define __ssp_overlap(a, b, l) \
(((a) <= (b) && (b) < (a) + (l)) || ((b) <= (a) && (a) < (b) + (l)))
__BEGIN_DECLS
void __stack_chk_fail(void) __dead;

View File

@@ -1,4 +1,4 @@
/* $NetBSD: string.h,v 1.9 2013/11/07 02:00:54 christos Exp $ */
/* $NetBSD: string.h,v 1.13 2014/11/29 13:23:48 pooka Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -31,6 +31,7 @@
#ifndef _SSP_STRING_H_
#define _SSP_STRING_H_
#include <sys/cdefs.h>
#include <ssp/ssp.h>
__BEGIN_DECLS
@@ -82,6 +83,9 @@ __ssp_bos_icheck3_restrict(memcpy, void *, const void *)
__ssp_bos_icheck3(memmove, void *, const void *)
__ssp_bos_icheck3(memset, void *, int)
__ssp_bos_icheck2_restrict(stpcpy, char *, const char *)
#if __GNUC_PREREQ__(4,8) || defined(__clang__)
__ssp_bos_icheck3_restrict(stpncpy, char *, const char *)
#endif
__ssp_bos_icheck2_restrict(strcpy, char *, const char *)
__ssp_bos_icheck2_restrict(strcat, char *, const char *)
__ssp_bos_icheck3_restrict(strncpy, char *, const char *)
@@ -92,6 +96,9 @@ __END_DECLS
#define memmove(dst, src, len) __ssp_bos_check3(memmove, dst, src, len)
#define memset(dst, val, len) __ssp_bos_check3(memset, dst, val, len)
#define stpcpy(dst, src) __ssp_bos_check2(stpcpy, dst, src)
#if __GNUC_PREREQ__(4,8) || defined(__clang__)
#define stpncpy(dst, src, len) __ssp_bos_check3(stpncpy, dst, src, len)
#endif
#define strcpy(dst, src) __ssp_bos_check2(strcpy, dst, src)
#define strcat(dst, src) __ssp_bos_check2(strcat, dst, src)
#define strncpy(dst, src, len) __ssp_bos_check3(strncpy, dst, src, len)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: unistd.h,v 1.6 2011/01/26 18:07:44 christos Exp $ */
/* $NetBSD: unistd.h,v 1.7 2015/06/25 18:41:03 joerg Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -42,7 +42,8 @@ __ssp_redirect0(ssize_t, read, (int __fd, void *__buf, size_t __len), \
__ssp_redirect(ssize_t, readlink, (const char *__restrict __path, \
char *__restrict __buf, size_t __len), (__path, __buf, __len));
__ssp_redirect(char *, getcwd, (char *__buf, size_t __len), (__buf, __len));
__ssp_redirect_raw(char *, getcwd, getcwd, (char *__buf, size_t __len),
(__buf, __len), __buf != 0, __ssp_bos);
__END_DECLS

View File

@@ -1,45 +0,0 @@
/* $NetBSD: stdbool.h,v 1.5 2013/04/26 17:41:34 joerg Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe of Wasabi Systems, Inc.
*
* 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
*/
#ifndef _STDBOOL_H_
#define _STDBOOL_H_
#ifndef __cplusplus
#define bool _Bool
#define true 1
#define false 0
#endif /* __cplusplus */
#define __bool_true_false_are_defined 1
#endif /* _STDBOOL_H_ */

View File

@@ -1,4 +1,4 @@
/* $NetBSD: stddef.h,v 1.16 2009/11/15 22:21:03 christos Exp $ */
/* $NetBSD: stddef.h,v 1.17 2013/12/12 17:53:03 matt Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -38,7 +38,10 @@
#include <sys/featuretest.h>
#include <machine/ansi.h>
#ifdef _BSD_PTRDIFF_T_
typedef _BSD_PTRDIFF_T_ ptrdiff_t;
#undef _BSD_PTRDIFF_T_
#endif
#ifdef _BSD_SIZE_T_
typedef _BSD_SIZE_T_ size_t;

View File

@@ -1,4 +1,4 @@
/* $NetBSD: stdio.h,v 1.88 2013/05/04 18:30:14 christos Exp $ */
/* $NetBSD: stdio.h,v 1.96 2015/03/24 07:44:52 wiz Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -242,9 +242,6 @@ long ftell(FILE *);
size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict);
int getc(FILE *);
int getchar(void);
ssize_t getdelim(char ** __restrict, size_t * __restrict, int,
FILE * __restrict);
ssize_t getline(char ** __restrict, size_t * __restrict, FILE * __restrict);
void perror(const char *);
int printf(const char * __restrict, ...)
__printflike(1, 2);
@@ -333,6 +330,11 @@ int pclose(FILE *);
FILE *popen(const char *, const char *);
__END_DECLS
#endif
#ifdef _NETBSD_SOURCE
__BEGIN_DECLS
FILE *popenve(const char *, char *const *, char *const *, const char *);
__END_DECLS
#endif
/*
* Functions defined in ISO XPG4.2, ISO C99, POSIX 1003.1-2001 or later.
@@ -368,7 +370,7 @@ __END_DECLS
/*
* X/Open CAE Specification Issue 5 Version 2
*/
#if (_XOPEN_SOURCE - 0) >= 500 || defined(_LARGEFILE_SOURCE) || \
#if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 500 || \
defined(_NETBSD_SOURCE)
#ifndef off_t
typedef __off_t off_t;
@@ -379,7 +381,7 @@ __BEGIN_DECLS
int fseeko(FILE *, off_t, int);
off_t ftello(FILE *);
__END_DECLS
#endif /* _XOPEN_SOURCE >= 500 || _LARGEFILE_SOURCE || _NETBSD_SOURCE */
#endif /* (_POSIX_C_SOURCE - 0) >= 200112L || _XOPEN_SOURCE >= 500 || ... */
/*
* Functions defined in ISO C99. Still put under _NETBSD_SOURCE due to
@@ -461,9 +463,9 @@ __END_DECLS
#if defined(__GNUC__) && defined(__STDC__)
static __inline int __sputc(int _c, FILE *_p) {
if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
return (*_p->_p++ = _c);
return *_p->_p++ = (unsigned char)_c;
else
return (__swbuf(_c, _p));
return __swbuf(_c, _p);
}
#else
/*
@@ -508,10 +510,12 @@ static __inline int __sputc(int _c, FILE *_p) {
#endif /* !_ANSI_SOURCE && !__cplusplus*/
#if (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE)
__BEGIN_DECLS
int vdprintf(int, const char * __restrict, __va_list)
__printflike(2, 0);
int dprintf(int, const char * __restrict, ...)
__printflike(2, 3);
__END_DECLS
#endif /* (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE) */
#if (_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
@@ -525,7 +529,13 @@ int dprintf(int, const char * __restrict, ...)
#if (_POSIX_C_SOURCE - 0) >= 200809L || (_XOPEN_SOURCE - 0) >= 700 || \
defined(_NETBSD_SOURCE)
__BEGIN_DECLS
FILE *fmemopen(void * __restrict, size_t, const char * __restrict);
FILE *open_memstream(char **, size_t *);
ssize_t getdelim(char ** __restrict, size_t * __restrict, int,
FILE * __restrict);
ssize_t getline(char ** __restrict, size_t * __restrict, FILE * __restrict);
__END_DECLS
#endif
#if (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE)
@@ -570,8 +580,6 @@ int sscanf_l(const char * __restrict, locale_t,
const char * __restrict, ...) __scanflike(3, 4);
int vscanf_l(locale_t, const char * __restrict, __va_list)
__scanflike(2, 0);
int vscanf_l(locale_t, const char * __restrict, __va_list)
__scanflike(2, 0);
int vfscanf_l(FILE * __restrict, locale_t, const char * __restrict,
__va_list) __scanflike(3, 0);
int vsscanf_l(const char * __restrict, locale_t, const char * __restrict,

View File

@@ -1,4 +1,4 @@
/* $NetBSD: stdlib.h,v 1.106 2013/04/26 18:07:43 christos Exp $ */
/* $NetBSD: stdlib.h,v 1.115 2015/02/17 20:33:40 joerg Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -123,6 +123,10 @@ double strtod(const char * __restrict, char ** __restrict);
long strtol(const char * __restrict, char ** __restrict, int);
unsigned long
strtoul(const char * __restrict, char ** __restrict, int);
#ifdef _OPENBSD_SOURCE
long long strtonum(const char *, long long, long long, const char **);
void *reallocarray(void *, size_t, size_t);
#endif
int system(const char *);
/* These are currently just stubs. */
@@ -174,12 +178,16 @@ int putenv(char *) __RENAME(__putenv50);
long a64l(const char *);
char *l64a(long);
char *initstate(unsigned long, char *, size_t);
long random(void);
char *setstate(char *);
void srandom(unsigned long);
#ifndef __LIBC12_SOURCE__
char *initstate(unsigned int, char *, size_t) __RENAME(__initstate60);
void srandom(unsigned int) __RENAME(__srandom60);
#endif
#ifdef _NETBSD_SOURCE
#define RANDOM_MAX 0x7fffffff /* (((long)1 << 31) - 1) */
int mkostemp(char *, int);
int mkostemps(char *, int, int);
#endif
char *mkdtemp(char *);
@@ -304,6 +312,7 @@ void cfree(void *);
int heapsort(void *, size_t, size_t, int (*)(const void *, const void *));
int mergesort(void *, size_t, size_t,
int (*)(const void *, const void *));
int ptsname_r(int, char *, size_t);
int radixsort(const unsigned char **, int, const unsigned char *,
unsigned);
int sradixsort(const unsigned char **, int, const unsigned char *,
@@ -331,6 +340,8 @@ int l64a_r(long, char *, int);
size_t shquote(const char *, char *, size_t);
size_t shquotev(int, char * const *, char *, size_t);
int reallocarr(void *, size_t, size_t);
#endif /* _NETBSD_SOURCE */
#endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || _NETBSD_SOURCE */

View File

@@ -1,4 +1,4 @@
/* $NetBSD: string.h,v 1.48 2013/08/28 17:47:07 riastradh Exp $ */
/* $NetBSD: string.h,v 1.49 2014/09/24 18:16:36 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -102,6 +102,7 @@ size_t strlcpy(char *, const char *, size_t);
char *strsep(char **, const char *);
char *stresep(char **, const char *, int);
char *strndup(const char *, size_t);
char *strnstr(const char *, const char *, size_t);
void *memrchr(const void *, int, size_t);
void *explicit_memset(void *, int, size_t);
int consttime_memequal(const void *, const void *, size_t);

View File

@@ -1,4 +1,4 @@
/* $NetBSD: time.h,v 1.43 2013/04/21 17:54:56 joerg Exp $ */
/* $NetBSD: time.h,v 1.44 2014/10/07 21:50:36 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -198,22 +198,25 @@ struct tm *offtime(const time_t *, long) __RENAME(__offtime50);
void tzsetwall(void) __RENAME(__tzsetwall50);
struct tm *offtime_r(const time_t *, long, struct tm *) __RENAME(__offtime_r50);
struct tm *localtime_rz(const timezone_t, const time_t * __restrict,
struct tm *localtime_rz(timezone_t __restrict, const time_t * __restrict,
struct tm * __restrict) __RENAME(__localtime_rz50);
char *ctime_rz(const timezone_t, const time_t *, char *) __RENAME(__ctime_rz50);
time_t mktime_z(const timezone_t, struct tm *) __RENAME(__mktime_z50);
time_t timelocal_z(const timezone_t, struct tm *) __RENAME(__timelocal_z50);
time_t time2posix_z(const timezone_t, time_t) __RENAME(__time2posix_z50);
time_t posix2time_z(const timezone_t, time_t) __RENAME(__posix2time_z50);
char *ctime_rz(timezone_t __restrict, const time_t *, char *)
__RENAME(__ctime_rz50);
time_t mktime_z(timezone_t __restrict, struct tm * __restrict)
__RENAME(__mktime_z50);
time_t timelocal_z(timezone_t __restrict, struct tm *)
__RENAME(__timelocal_z50);
time_t time2posix_z(timezone_t __restrict, time_t) __RENAME(__time2posix_z50);
time_t posix2time_z(timezone_t __restrict, time_t) __RENAME(__posix2time_z50);
timezone_t tzalloc(const char *) __RENAME(__tzalloc50);
void tzfree(const timezone_t) __RENAME(__tzfree50);
const char *tzgetname(const timezone_t, int) __RENAME(__tzgetname50);
void tzfree(timezone_t __restrict) __RENAME(__tzfree50);
const char *tzgetname(timezone_t __restrict, int) __RENAME(__tzgetname50);
#endif
size_t strftime_lz(const timezone_t, char * __restrict, size_t,
size_t strftime_lz(timezone_t __restrict, char * __restrict, size_t,
const char * __restrict, const struct tm * __restrict, locale_t)
__attribute__((__format__(__strftime__, 4, 0)));
size_t strftime_z(const timezone_t, char * __restrict, size_t,
size_t strftime_z(timezone_t __restrict, char * __restrict, size_t,
const char * __restrict, const struct tm * __restrict)
__attribute__((__format__(__strftime__, 4, 0)));
char *strptime_l(const char * __restrict, const char * __restrict,

View File

@@ -1,59 +1,47 @@
/* $NetBSD: tzfile.h,v 1.7 2003/08/07 09:44:11 agc Exp $ */
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Arthur David Olson of the National Cancer Institute.
*
* 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 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.
*
* @(#)tzfile.h 8.1 (Berkeley) 6/2/93
*/
/* $NetBSD: tzfile.h,v 1.8 2015/07/11 16:40:53 christos Exp $ */
#ifndef _TZFILE_H_
#define _TZFILE_H_
#define _TZFILE_H_
/*
* Information about time zone files.
*/
/* Time zone object file directory */
** This file is in the public domain, so clarified as of
** 1996-06-05 by Arthur David Olson.
*/
/*
** This header is for use ONLY with the time conversion code.
** There is no guarantee that it will remain unchanged,
** or that it will remain at all.
** Do NOT copy it to any system include directory.
** Thank you!
*/
/*
** Information about time zone files.
*/
#ifndef TZDIR /* Time zone object file directory */
#define TZDIR "/usr/share/zoneinfo"
#endif /* !defined TZDIR */
#ifndef TZDEFAULT
#define TZDEFAULT "/etc/localtime"
#endif /* !defined TZDEFAULT */
#ifndef TZDEFRULES
#define TZDEFRULES "posixrules"
#endif /* !defined TZDEFRULES */
/*
** Each file begins with. . .
*/
#define TZ_MAGIC "TZif"
#define TZ_MAGIC "TZif"
struct tzhead {
char tzh_magic[4]; /* TZ_MAGIC */
char tzh_reserved[16]; /* reserved for future use */
char tzh_version[1]; /* '\0' or '2' or '3' as of 2013 */
char tzh_reserved[15]; /* reserved; must be zero */
char tzh_ttisgmtcnt[4]; /* coded number of trans. time flags */
char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
char tzh_leapcnt[4]; /* coded number of leap seconds */
@@ -68,49 +56,64 @@ struct tzhead {
** tzh_timecnt (char [4])s coded transition times a la time(2)
** tzh_timecnt (unsigned char)s types of local time starting at above
** tzh_typecnt repetitions of
** one (char [4]) coded UTC offset in seconds
** one (char [4]) coded UT offset in seconds
** one (unsigned char) used to set tm_isdst
** one (unsigned char) that's an abbreviation list index
** tzh_charcnt (char)s '\0'-terminated zone abbreviations
** tzh_leapcnt repetitions of
** one (char [4]) coded leap second transition times
** one (char [4]) total correction after above
** tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition
** time is standard time, if FALSE,
** tzh_ttisstdcnt (char)s indexed by type; if 1, transition
** time is standard time, if 0,
** transition time is wall clock time
** if absent, transition times are
** assumed to be wall clock time
** tzh_ttisgmtcnt (char)s indexed by type; if TRUE, transition
** time is UTC, if FALSE,
** transition time is wall clock time
** tzh_ttisgmtcnt (char)s indexed by type; if 1, transition
** time is UT, if 0,
** transition time is local time
** if absent, transition times are
** assumed to be local time
*/
/*
** If tzh_version is '2' or greater, the above is followed by a second instance
** of tzhead and a second instance of the data in which each coded transition
** time uses 8 rather than 4 chars,
** then a POSIX-TZ-environment-variable-style string for use in handling
** instants after the last transition time stored in the file
** (with nothing between the newlines if there is no POSIX representation for
** such instants).
**
** If tz_version is '3' or greater, the above is extended as follows.
** First, the POSIX TZ string's hour offset may range from -167
** through 167 as compared to the POSIX-required 0 through 24.
** Second, its DST start time may be January 1 at 00:00 and its stop
** time December 31 at 24:00 plus the difference between DST and
** standard time, indicating DST all year.
*/
/*
** In the current implementation, "tzset()" refuses to deal with files that
** exceed any of the limits below.
*/
/*
** The TZ_MAX_TIMES value below is enough to handle a bit more than a
** year's worth of solar time (corrected daily to the nearest second) or
** 138 years of Pacific Presidential Election time
** (where there are three time zone transitions every fourth year).
*/
#define TZ_MAX_TIMES 370
#ifndef TZ_MAX_TIMES
#define TZ_MAX_TIMES 2000
#endif /* !defined TZ_MAX_TIMES */
#define NOSOLAR /* 4BSD doesn't currently handle solar time */
#ifndef NOSOLAR
#define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */
#else
#define TZ_MAX_TYPES 10 /* Maximum number of local time types */
#endif
#ifndef TZ_MAX_TYPES
/* This must be at least 17 for Europe/Samara and Europe/Vilnius. */
#define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */
#endif /* !defined TZ_MAX_TYPES */
#ifndef TZ_MAX_CHARS
#define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */
/* (limited by what unsigned chars can hold) */
#endif /* !defined TZ_MAX_CHARS */
#define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */
#ifndef TZ_MAX_LEAPS
#define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */
#endif /* !defined TZ_MAX_LEAPS */
#define SECSPERMIN 60
#define MINSPERHOUR 60
@@ -119,7 +122,7 @@ struct tzhead {
#define DAYSPERNYEAR 365
#define DAYSPERLYEAR 366
#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR)
#define SECSPERDAY ((long) SECSPERHOUR * HOURSPERDAY)
#define SECSPERDAY ((int_fast32_t) SECSPERHOUR * HOURSPERDAY)
#define MONSPERYEAR 12
#define TM_SUNDAY 0
@@ -148,11 +151,20 @@ struct tzhead {
#define EPOCH_YEAR 1970
#define EPOCH_WDAY TM_THURSDAY
#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
/*
** Accurate only for the past couple of centuries;
** that will probably do.
** Since everything in isleap is modulo 400 (or a factor of 400), we know that
** isleap(y) == isleap(y % 400)
** and so
** isleap(a + b) == isleap((a + b) % 400)
** or
** isleap(a + b) == isleap(a % 400 + b % 400)
** This is true even if % means modulo rather than Fortran remainder
** (which is allowed by C89 but not C99).
** We use this to avoid addition overflow problems.
*/
#define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
#define isleap_sum(a, b) isleap((a) % 400 + (b) % 400)
#endif /* !_TZFILE_H_ */
#endif /* !defined _TZFILE_H_ */

View File

@@ -1,4 +1,4 @@
/* $NetBSD: unistd.h,v 1.139 2013/10/09 09:38:21 njoly Exp $ */
/* $NetBSD: unistd.h,v 1.145 2015/03/24 07:44:52 wiz Exp $ */
/*-
* Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -158,11 +158,24 @@ extern int optind;
extern int optopt;
#endif
/*
* The Open Group Base Specifications, Issue 5; IEEE Std 1003.1-2001 (POSIX)
*/
#if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 500 || \
defined(_NETBSD_SOURCE)
#if __SSP_FORTIFY_LEVEL == 0
ssize_t readlink(const char * __restrict, char * __restrict, size_t);
#endif
#endif
/*
* The Open Group Base Specifications, Issue 6; IEEE Std 1003.1-2001 (POSIX)
*/
#if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 600 || \
defined(_NETBSD_SOURCE)
#if !defined(__minix)
int posix_fallocate(int, off_t, off_t);
#endif /* !defined(__minix) */
int setegid(gid_t);
int seteuid(uid_t);
#endif
@@ -268,9 +281,9 @@ int lockf(int, int, off_t);
ssize_t readlink(const char * __restrict, char * __restrict, size_t);
#endif
void *sbrk(intptr_t);
#if !defined(__minix)
/* XXX prototype wrong! */
int setpgrp(pid_t, pid_t); /* obsoleted by setpgid() */
#if !defined(__minix)
int setregid(gid_t, gid_t);
int setreuid(uid_t, uid_t);
#endif /* !defined(__minix) */
@@ -292,10 +305,11 @@ char *getwd(char *); /* obsoleted by getcwd() */
/*
* X/Open CAE Specification Issue 5 Version 2
*/
#if (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
#if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 500 || \
defined(_NETBSD_SOURCE)
ssize_t pread(int, void *, size_t, off_t);
ssize_t pwrite(int, const void *, size_t, off_t);
#endif
#endif /* (_POSIX_C_SOURCE - 0) >= 200112L || ... */
/*
* X/Open Extended API set 2 (a.k.a. C063)
@@ -306,7 +320,7 @@ int linkat(int, const char *, int, const char *, int);
int renameat(int, const char *, int, const char *);
int faccessat(int, const char *, int, int);
int fchownat(int, const char *, uid_t, gid_t, int);
int readlinkat(int, const char *, char *, size_t);
ssize_t readlinkat(int, const char *, char *, size_t);
int symlinkat(const char *, int, const char *);
int unlinkat(int, const char *, int);
#endif
@@ -328,7 +342,12 @@ int des_setkey(const char *);
int dup3(int, int, int);
void endusershell(void);
int exect(const char *, char * const *, char * const *);
int execvpe(const char *, char * const *, char * const *);
int execlpe(const char *, const char *, ...);
int fchroot(int);
#if !defined(__minix)
int fdiscard(int, off_t, off_t);
#endif /* !defined(__minix) */
int fsync_range(int, int, off_t, off_t);
int getdomainname(char *, size_t);
int getgrouplist(const char *, gid_t, gid_t *, int *);
@@ -354,6 +373,7 @@ __aconst char *getusershell(void);
int initgroups(const char *, gid_t);
int iruserok(uint32_t, int, const char *, const char *);
int issetugid(void);
int mkstemps(char *, int);
int nfssvc(int, void *);
int pipe2(int *, int);
#if !defined(__minix)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: util.h,v 1.65 2013/05/02 07:17:35 matt Exp $ */
/* $NetBSD: util.h,v 1.68 2015/09/24 14:39:37 christos Exp $ */
/*-
* Copyright (c) 1995
@@ -83,6 +83,7 @@ const char *getdiskrawname(char *, size_t, const char *);
const char *getdiskcookedname(char *, size_t, const char *);
const char *getfstypename(int);
const char *getfsspecname(char *, size_t, const char *);
struct kinfo_vmentry *kinfo_getvmmap(pid_t, size_t *);
#ifndef __LIBC12_SOURCE__
void login(const struct utmp *) __RENAME(__login50);
void loginx(const struct utmpx *) __RENAME(__loginx50);
@@ -147,9 +148,12 @@ size_t estrlcpy(char *, const char *, size_t);
size_t estrlcat(char *, const char *, size_t);
char *estrdup(const char *);
char *estrndup(const char *, size_t);
intmax_t estrtoi(const char *, int, intmax_t, intmax_t);
uintmax_t estrtou(const char *, int, uintmax_t, uintmax_t);
void *ecalloc(size_t, size_t);
void *emalloc(size_t);
void *erealloc(void *, size_t);
void ereallocarr(void *, size_t, size_t);
struct __sFILE *efopen(const char *, const char *);
int easprintf(char ** __restrict, const char * __restrict, ...)
__printflike(2, 3);

View File

@@ -1,4 +1,4 @@
/* $NetBSD: vis.h,v 1.21 2013/02/20 17:01:15 christos Exp $ */
/* $NetBSD: vis.h,v 1.23 2015/05/23 11:48:31 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -63,6 +63,9 @@
#define VIS_NOESCAPE 0x0400 /* don't decode `\' */
#define _VIS_END 0x0800 /* for unvis */
#define VIS_GLOB 0x1000 /* encode glob(3) magic characters */
#define VIS_SHELL 0x2000 /* encode shell special characters [not glob] */
#define VIS_META (VIS_WHITE | VIS_GLOB | VIS_SHELL)
#define VIS_NOLOCALE 0x4000 /* encode using the C locale */
/*
* unvis return codes

View File

@@ -1,4 +1,4 @@
/* $NetBSD: wchar.h,v 1.40 2013/11/21 09:09:52 degroote Exp $ */
/* $NetBSD: wchar.h,v 1.41 2014/10/13 00:47:03 christos Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@@ -158,6 +158,11 @@ unsigned long long int wcstoull(const wchar_t * __restrict,
wchar_t ** __restrict, int);
#endif
#if (_POSIX_C_SOURCE - 0) >= 200809L || (_XOPEN_SOURCE - 0) >= 700 || \
defined(_NETBSD_SOURCE)
FILE *open_wmemstream(wchar_t **, size_t *);
#endif
wint_t ungetwc(wint_t, FILE *);
wint_t fgetwc(FILE *);
wchar_t *fgetws(wchar_t * __restrict, int, FILE * __restrict);