summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-01-16 16:48:51 +0000
committerderaadt <deraadt@openbsd.org>2015-01-16 16:48:51 +0000
commitaea60bee5e9bad0aab62f480f19c2fb34c068de4 (patch)
tree1e7befbc10e28796528939427d4fdbd94b60d9af /lib/libc
parentMore evil bootstrap code. #ifndef ALIGNBYTES #define ALIGNBYTES 3. (diff)
downloadwireguard-openbsd-aea60bee5e9bad0aab62f480f19c2fb34c068de4.tar.xz
wireguard-openbsd-aea60bee5e9bad0aab62f480f19c2fb34c068de4.zip
Move to the <limits.h> universe.
review by millert, binary checking process with doug, concept with guenther
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/asr/asr.c3
-rw-r--r--lib/libc/asr/gethostnamadr.c3
-rw-r--r--lib/libc/asr/gethostnamadr_async.c4
-rw-r--r--lib/libc/asr/getnetnamadr.c3
-rw-r--r--lib/libc/citrus/citrus_utf8.c7
-rw-r--r--lib/libc/compat-43/sigcompat.c1
-rw-r--r--lib/libc/crypt/arc4random.c3
-rw-r--r--lib/libc/crypt/crypt.c3
-rw-r--r--lib/libc/db/btree/bt_close.c4
-rw-r--r--lib/libc/db/btree/bt_conv.c4
-rw-r--r--lib/libc/db/btree/bt_debug.c4
-rw-r--r--lib/libc/db/btree/bt_overflow.c10
-rw-r--r--lib/libc/db/btree/bt_utils.c10
-rw-r--r--lib/libc/db/hash/hash.c9
-rw-r--r--lib/libc/db/hash/hash_bigkey.c12
-rw-r--r--lib/libc/db/hash/hash_buf.c8
-rw-r--r--lib/libc/db/mpool/mpool.c3
-rw-r--r--lib/libc/db/recno/rec_utils.c4
-rw-r--r--lib/libc/gen/clock.c3
-rw-r--r--lib/libc/gen/disklabel.c3
-rw-r--r--lib/libc/gen/elf_hash.c3
-rw-r--r--lib/libc/gen/fts.c8
-rw-r--r--lib/libc/gen/getgrent.c4
-rw-r--r--lib/libc/gen/getloadavg.c7
-rw-r--r--lib/libc/gen/getmntinfo.c4
-rw-r--r--lib/libc/gen/getpwent.c10
-rw-r--r--lib/libc/gen/initgroups.c9
-rw-r--r--lib/libc/gen/nlist.c8
-rw-r--r--lib/libc/gen/popen.c3
-rw-r--r--lib/libc/gen/scandir.c8
-rw-r--r--lib/libc/gen/setdomainname.c4
-rw-r--r--lib/libc/gen/sethostname.c4
-rw-r--r--lib/libc/gen/setproctitle.c3
-rw-r--r--lib/libc/gen/statvfs.c4
-rw-r--r--lib/libc/gen/sysconf.c6
-rw-r--r--lib/libc/gen/sysctl.c4
-rw-r--r--lib/libc/gen/times.c3
-rw-r--r--lib/libc/gen/uname.c4
-rw-r--r--lib/libc/gmon/gmon.c3
-rw-r--r--lib/libc/gmon/mcount.c4
-rw-r--r--lib/libc/hash/helper.c8
-rw-r--r--lib/libc/hash/sha1.c4
-rw-r--r--lib/libc/hash/siphash.c4
-rw-r--r--lib/libc/net/base64.c3
-rw-r--r--lib/libc/net/ethers.c8
-rw-r--r--lib/libc/net/getifaddrs.c4
-rw-r--r--lib/libc/net/getnetent.c12
-rw-r--r--lib/libc/net/herror.c3
-rw-r--r--lib/libc/net/inet_addr.c3
-rw-r--r--lib/libc/net/inet_lnaof.c3
-rw-r--r--lib/libc/net/inet_makeaddr.c3
-rw-r--r--lib/libc/net/inet_netof.c3
-rw-r--r--lib/libc/net/inet_ntop.c3
-rw-r--r--lib/libc/net/inet_pton.c3
-rw-r--r--lib/libc/net/ip6opt.c3
-rw-r--r--lib/libc/net/rcmd.c4
-rw-r--r--lib/libc/net/res_comp.c8
-rw-r--r--lib/libc/net/res_data.c3
-rw-r--r--lib/libc/net/rresvport.c3
-rw-r--r--lib/libc/net/rthdr.c3
-rw-r--r--lib/libc/net/ruserok.c4
-rw-r--r--lib/libc/nls/catopen.c3
-rw-r--r--lib/libc/rpc/clnt_simple.c8
-rw-r--r--lib/libc/rpc/rpc_callmsg.c3
-rw-r--r--lib/libc/rpc/rpc_prot.c4
-rw-r--r--lib/libc/rpc/xdr_float.c3
-rw-r--r--lib/libc/stdio/findfp.c4
-rw-r--r--lib/libc/stdio/open_memstream.c8
-rw-r--r--lib/libc/stdio/open_wmemstream.c8
-rw-r--r--lib/libc/stdlib/malloc.c4
-rw-r--r--lib/libc/stdlib/random.c5
-rw-r--r--lib/libc/stdlib/realpath.c6
-rw-r--r--lib/libc/sys/stack_protector.c3
-rw-r--r--lib/libc/yp/_yp_check.c4
-rw-r--r--lib/libc/yp/xdr_domainname.c3
-rw-r--r--lib/libc/yp/xdr_keydat.c3
-rw-r--r--lib/libc/yp/xdr_mapname.c3
-rw-r--r--lib/libc/yp/xdr_peername.c3
-rw-r--r--lib/libc/yp/xdr_valdat.c3
-rw-r--r--lib/libc/yp/xdr_ypbind_binding.c3
-rw-r--r--lib/libc/yp/xdr_ypbind_resp.c3
-rw-r--r--lib/libc/yp/xdr_ypbind_resptype.c3
-rw-r--r--lib/libc/yp/xdr_ypbind_setdom.c3
-rw-r--r--lib/libc/yp/xdr_ypmaplist.c3
-rw-r--r--lib/libc/yp/xdr_ypreq_key.c3
-rw-r--r--lib/libc/yp/xdr_ypreq_nokey.c3
-rw-r--r--lib/libc/yp/xdr_ypresp_all.c3
-rw-r--r--lib/libc/yp/xdr_ypresp_key_val.c3
-rw-r--r--lib/libc/yp/xdr_ypresp_maplist.c3
-rw-r--r--lib/libc/yp/xdr_ypresp_master.c3
-rw-r--r--lib/libc/yp/xdr_ypresp_order.c3
-rw-r--r--lib/libc/yp/xdr_ypresp_val.c3
-rw-r--r--lib/libc/yp/xdr_ypstat.c3
-rw-r--r--lib/libc/yp/yp_all.c4
-rw-r--r--lib/libc/yp/yp_bind.c4
-rw-r--r--lib/libc/yp/yp_first.c4
-rw-r--r--lib/libc/yp/yp_get_default_domain.c4
-rw-r--r--lib/libc/yp/yp_maplist.c4
-rw-r--r--lib/libc/yp/yp_master.c4
-rw-r--r--lib/libc/yp/yp_order.c4
-rw-r--r--lib/libc/yp/yperr_string.c3
-rw-r--r--lib/libc/yp/ypmatch_cache.c4
-rw-r--r--lib/libc/yp/ypprot_err.c3
103 files changed, 205 insertions, 249 deletions
diff --git a/lib/libc/asr/asr.c b/lib/libc/asr/asr.c
index 0498d26d3a4..65ad511c975 100644
--- a/lib/libc/asr/asr.c
+++ b/lib/libc/asr/asr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asr.c,v 1.34 2014/09/15 06:15:48 guenther Exp $ */
+/* $OpenBSD: asr.c,v 1.35 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 2010-2012 Eric Faurot <eric@openbsd.org>
*
@@ -33,6 +33,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include "asr_private.h"
diff --git a/lib/libc/asr/gethostnamadr.c b/lib/libc/asr/gethostnamadr.c
index e07abadb443..a0aba01d3de 100644
--- a/lib/libc/asr/gethostnamadr.c
+++ b/lib/libc/asr/gethostnamadr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gethostnamadr.c,v 1.11 2014/03/26 18:13:15 eric Exp $ */
+/* $OpenBSD: gethostnamadr.c,v 1.12 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 2012,2013 Eric Faurot <eric@openbsd.org>
*
@@ -15,6 +15,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <sys/param.h> /* ALIGN */
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
diff --git a/lib/libc/asr/gethostnamadr_async.c b/lib/libc/asr/gethostnamadr_async.c
index c2870f91db5..83acf61120f 100644
--- a/lib/libc/asr/gethostnamadr_async.c
+++ b/lib/libc/asr/gethostnamadr_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gethostnamadr_async.c,v 1.33 2015/01/14 23:36:15 deraadt Exp $ */
+/* $OpenBSD: gethostnamadr_async.c,v 1.34 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -656,7 +656,7 @@ _yp_gethostnamadr(int type, const void *data)
static char *domain = NULL;
struct hostent_ext *h = NULL;
const char *name;
- char buf[MAXHOSTNAMELEN];
+ char buf[HOST_NAME_MAX+1];
char *res = NULL;
int r, len;
diff --git a/lib/libc/asr/getnetnamadr.c b/lib/libc/asr/getnetnamadr.c
index f3b552ab059..141b4a9ab8f 100644
--- a/lib/libc/asr/getnetnamadr.c
+++ b/lib/libc/asr/getnetnamadr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getnetnamadr.c,v 1.8 2014/03/26 18:13:15 eric Exp $ */
+/* $OpenBSD: getnetnamadr.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -15,6 +15,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <sys/param.h> /* ALIGN */
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
diff --git a/lib/libc/citrus/citrus_utf8.c b/lib/libc/citrus/citrus_utf8.c
index df0f19c88c6..72abf0ce5b9 100644
--- a/lib/libc/citrus/citrus_utf8.c
+++ b/lib/libc/citrus/citrus_utf8.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: citrus_utf8.c,v 1.7 2014/05/03 14:10:20 stsp Exp $ */
+/* $OpenBSD: citrus_utf8.c,v 1.8 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 2002-2004 Tim J. Robbins
@@ -27,7 +27,6 @@
*/
#include <sys/errno.h>
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/limits.h>
@@ -41,6 +40,8 @@
#include "citrus_ctype.h"
#include "citrus_utf8.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
_CITRUS_CTYPE_DEF_OPS(utf8);
struct _utf8_state {
@@ -135,7 +136,7 @@ _citrus_utf8_ctype_mbrtowc(wchar_t * __restrict pwc,
wch = (unsigned char)*s++ & mask;
else
wch = us->ch;
- for (i = (us->want == 0) ? 1 : 0; i < MIN(want, n); i++) {
+ for (i = (us->want == 0) ? 1 : 0; i < MINIMUM(want, n); i++) {
if ((*s & 0xc0) != 0x80) {
/*
* Malformed input; bad characters in the middle
diff --git a/lib/libc/compat-43/sigcompat.c b/lib/libc/compat-43/sigcompat.c
index aa31ca294a2..2698dcadd87 100644
--- a/lib/libc/compat-43/sigcompat.c
+++ b/lib/libc/compat-43/sigcompat.c
@@ -27,7 +27,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <signal.h>
int
diff --git a/lib/libc/crypt/arc4random.c b/lib/libc/crypt/arc4random.c
index 1106f067076..75cdff3bc4b 100644
--- a/lib/libc/crypt/arc4random.c
+++ b/lib/libc/crypt/arc4random.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arc4random.c,v 1.51 2015/01/15 06:57:18 deraadt Exp $ */
+/* $OpenBSD: arc4random.c,v 1.52 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1996, David Mazieres <dm@uun.org>
@@ -31,7 +31,6 @@
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/time.h>
#define KEYSTREAM_ONLY
diff --git a/lib/libc/crypt/crypt.c b/lib/libc/crypt/crypt.c
index c7ff5d970b3..7d21d4fbc37 100644
--- a/lib/libc/crypt/crypt.c
+++ b/lib/libc/crypt/crypt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crypt.c,v 1.25 2014/12/08 20:36:18 tedu Exp $ */
+/* $OpenBSD: crypt.c,v 1.26 2015/01/16 16:48:51 deraadt Exp $ */
/*
* FreeSec: libcrypt
@@ -47,7 +47,6 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <pwd.h>
#include <unistd.h>
#include <string.h>
diff --git a/lib/libc/db/btree/bt_close.c b/lib/libc/db/btree/bt_close.c
index 688c03f06e9..31cbec35fc8 100644
--- a/lib/libc/db/btree/bt_close.c
+++ b/lib/libc/db/btree/bt_close.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bt_close.c,v 1.9 2005/08/05 13:02:59 espie Exp $ */
+/* $OpenBSD: bt_close.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -32,8 +32,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
-
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/lib/libc/db/btree/bt_conv.c b/lib/libc/db/btree/bt_conv.c
index a15b1daccab..03f5c9c8d4b 100644
--- a/lib/libc/db/btree/bt_conv.c
+++ b/lib/libc/db/btree/bt_conv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bt_conv.c,v 1.9 2005/08/05 13:02:59 espie Exp $ */
+/* $OpenBSD: bt_conv.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -32,8 +32,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
-
#include <stdio.h>
#include <db.h>
diff --git a/lib/libc/db/btree/bt_debug.c b/lib/libc/db/btree/bt_debug.c
index e3d740aa7e4..386fdb112bc 100644
--- a/lib/libc/db/btree/bt_debug.c
+++ b/lib/libc/db/btree/bt_debug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bt_debug.c,v 1.9 2005/08/08 08:05:33 espie Exp $ */
+/* $OpenBSD: bt_debug.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -32,8 +32,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/lib/libc/db/btree/bt_overflow.c b/lib/libc/db/btree/bt_overflow.c
index c9c411f97cf..2a92b075854 100644
--- a/lib/libc/db/btree/bt_overflow.c
+++ b/lib/libc/db/btree/bt_overflow.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bt_overflow.c,v 1.10 2007/08/08 23:57:19 ray Exp $ */
+/* $OpenBSD: bt_overflow.c,v 1.11 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -32,8 +32,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -41,6 +39,8 @@
#include <db.h>
#include "btree.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
/*
* Big key/data code.
*
@@ -105,7 +105,7 @@ __ovfl_get(BTREE *t, void *p, size_t *ssz, void **buf, size_t *bufsz)
if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
return (RET_ERROR);
- nb = MIN(sz, plen);
+ nb = MINIMUM(sz, plen);
memmove(p, (char *)h + BTDATAOFF, nb);
mpool_put(t->bt_mp, h, 0);
@@ -150,7 +150,7 @@ __ovfl_put(BTREE *t, const DBT *dbt, pgno_t *pg)
h->flags = P_OVERFLOW;
h->lower = h->upper = 0;
- nb = MIN(sz, plen);
+ nb = MINIMUM(sz, plen);
memmove((char *)h + BTDATAOFF, p, nb);
if (last) {
diff --git a/lib/libc/db/btree/bt_utils.c b/lib/libc/db/btree/bt_utils.c
index 19a63db3441..f442ff0ba4e 100644
--- a/lib/libc/db/btree/bt_utils.c
+++ b/lib/libc/db/btree/bt_utils.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bt_utils.c,v 1.10 2007/08/08 23:57:19 ray Exp $ */
+/* $OpenBSD: bt_utils.c,v 1.11 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -32,8 +32,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -41,6 +39,8 @@
#include <db.h>
#include "btree.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
/*
* __bt_ret --
* Build return key/data pair.
@@ -208,7 +208,7 @@ __bt_defcmp(const DBT *a, const DBT *b)
* What we need is a integral type which is guaranteed to be
* larger than a size_t, and there is no such thing.
*/
- len = MIN(a->size, b->size);
+ len = MINIMUM(a->size, b->size);
for (p1 = a->data, p2 = b->data; len--; ++p1, ++p2)
if (*p1 != *p2)
return ((int)*p1 - (int)*p2);
@@ -233,7 +233,7 @@ __bt_defpfx(a, b)
size_t cnt, len;
cnt = 1;
- len = MIN(a->size, b->size);
+ len = MINIMUM(a->size, b->size);
for (p1 = a->data, p2 = b->data; len--; ++p1, ++p2, ++cnt)
if (*p1 != *p2)
return (cnt);
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c
index 389afb5f8a3..42d7ee99e47 100644
--- a/lib/libc/db/hash/hash.c
+++ b/lib/libc/db/hash/hash.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hash.c,v 1.25 2014/08/15 03:51:40 guenther Exp $ */
+/* $OpenBSD: hash.c,v 1.26 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -32,7 +32,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/stat.h>
#include <errno.h>
@@ -50,6 +49,8 @@
#include "page.h"
#include "extern.h"
+#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b))
+
static int alloc_segs(HTAB *, int);
static int flush_meta(HTAB *);
static int hash_access(HTAB *, ACTION, DBT *, DBT *);
@@ -338,7 +339,7 @@ init_htab(HTAB *hashp, int nelem)
*/
nelem = (nelem - 1) / hashp->FFACTOR + 1;
- l2 = __log2(MAX(nelem, 2));
+ l2 = __log2(MAXIMUM(nelem, 2));
nbuckets = 1 << l2;
hashp->SPARES[l2] = l2 + 1;
@@ -352,7 +353,7 @@ init_htab(HTAB *hashp, int nelem)
hashp->MAX_BUCKET = hashp->LOW_MASK = nbuckets - 1;
hashp->HIGH_MASK = (nbuckets << 1) - 1;
- hashp->HDRPAGES = ((MAX(sizeof(HASHHDR), MINHDRSIZE) - 1) >>
+ hashp->HDRPAGES = ((MAXIMUM(sizeof(HASHHDR), MINHDRSIZE) - 1) >>
hashp->BSHIFT) + 1;
nsegs = (nbuckets - 1) / hashp->SGSIZE + 1;
diff --git a/lib/libc/db/hash/hash_bigkey.c b/lib/libc/db/hash/hash_bigkey.c
index 01115b1b53a..18682cc1b28 100644
--- a/lib/libc/db/hash/hash_bigkey.c
+++ b/lib/libc/db/hash/hash_bigkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hash_bigkey.c,v 1.17 2006/04/03 19:56:47 deraadt Exp $ */
+/* $OpenBSD: hash_bigkey.c,v 1.18 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -50,8 +50,6 @@
* collect_data
*/
-#include <sys/param.h>
-
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -66,6 +64,8 @@
#include "page.h"
#include "extern.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
static int collect_key(HTAB *, BUFHEAD *, int, DBT *, int);
static int collect_data(HTAB *, BUFHEAD *, int, int);
@@ -97,7 +97,7 @@ __big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val)
/* First move the Key */
for (space = FREESPACE(p) - BIGOVERHEAD; key_size;
space = FREESPACE(p) - BIGOVERHEAD) {
- move_bytes = MIN(space, key_size);
+ move_bytes = MINIMUM(space, key_size);
off = OFFSET(p) - move_bytes;
memmove(cp + off, key_data, move_bytes);
key_size -= move_bytes;
@@ -115,7 +115,7 @@ __big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val)
if (!key_size) {
space = FREESPACE(p);
if (space) {
- move_bytes = MIN(space, val_size);
+ move_bytes = MINIMUM(space, val_size);
/*
* If the data would fit exactly in the
* remaining space, we must overflow it to the
@@ -146,7 +146,7 @@ __big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val)
/* Now move the data */
for (space = FREESPACE(p) - BIGOVERHEAD; val_size;
space = FREESPACE(p) - BIGOVERHEAD) {
- move_bytes = MIN(space, val_size);
+ move_bytes = MINIMUM(space, val_size);
/*
* Here's the hack to make sure that if the data ends on the
* same page as the key ends, FREESPACE is at least one.
diff --git a/lib/libc/db/hash/hash_buf.c b/lib/libc/db/hash/hash_buf.c
index 9e857f540bc..9645826d8a0 100644
--- a/lib/libc/db/hash/hash_buf.c
+++ b/lib/libc/db/hash/hash_buf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hash_buf.c,v 1.18 2008/10/01 20:22:47 millert Exp $ */
+/* $OpenBSD: hash_buf.c,v 1.19 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -48,8 +48,6 @@
* newbuf
*/
-#include <sys/param.h>
-
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
@@ -65,6 +63,8 @@
#include "page.h"
#include "extern.h"
+#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b))
+
static BUFHEAD *newbuf(HTAB *, u_int32_t, BUFHEAD *);
/* Unlink B from its place in the lru */
@@ -300,7 +300,7 @@ __buf_init(HTAB *hashp, int nbytes)
bfp = &(hashp->bufhead);
npages = (nbytes + hashp->BSIZE - 1) >> hashp->BSHIFT;
- npages = MAX(npages, MIN_BUFFERS);
+ npages = MAXIMUM(npages, MIN_BUFFERS);
hashp->nbufs = npages;
bfp->next = bfp;
diff --git a/lib/libc/db/mpool/mpool.c b/lib/libc/db/mpool/mpool.c
index 263c93b5ebc..772ded17dce 100644
--- a/lib/libc/db/mpool/mpool.c
+++ b/lib/libc/db/mpool/mpool.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpool.c,v 1.19 2013/12/02 02:28:21 krw Exp $ */
+/* $OpenBSD: mpool.c,v 1.20 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/queue.h>
#include <sys/stat.h>
diff --git a/lib/libc/db/recno/rec_utils.c b/lib/libc/db/recno/rec_utils.c
index 488531ea49f..ccdd251933c 100644
--- a/lib/libc/db/recno/rec_utils.c
+++ b/lib/libc/db/recno/rec_utils.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rec_utils.c,v 1.8 2007/08/07 05:40:34 ray Exp $ */
+/* $OpenBSD: rec_utils.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
* The Regents of the University of California. All rights reserved.
@@ -28,8 +28,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/lib/libc/gen/clock.c b/lib/libc/gen/clock.c
index 9279457a29a..ad29073144f 100644
--- a/lib/libc/gen/clock.c
+++ b/lib/libc/gen/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.5 2005/08/08 08:05:33 espie Exp $ */
+/* $OpenBSD: clock.c,v 1.6 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -28,7 +28,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/resource.h>
diff --git a/lib/libc/gen/disklabel.c b/lib/libc/gen/disklabel.c
index 0b9a97ba6af..9f56ba8d215 100644
--- a/lib/libc/gen/disklabel.c
+++ b/lib/libc/gen/disklabel.c
@@ -27,7 +27,8 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* MAXFRAG DEV_BSIZE */
+#include <sys/types.h>
#define DKTYPENAMES
#include <sys/disklabel.h>
#include <ufs/ffs/fs.h>
diff --git a/lib/libc/gen/elf_hash.c b/lib/libc/gen/elf_hash.c
index 5feb9c58a2e..5fdc2815457 100644
--- a/lib/libc/gen/elf_hash.c
+++ b/lib/libc/gen/elf_hash.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: elf_hash.c,v 1.8 2005/08/08 08:05:33 espie Exp $ */
+/* $OpenBSD: elf_hash.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1995, 1996 Erik Theisen
* All rights reserved.
@@ -27,7 +27,6 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/file.h>
diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c
index e5cf06f14b5..0aa86572576 100644
--- a/lib/libc/gen/fts.c
+++ b/lib/libc/gen/fts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fts.c,v 1.49 2014/11/23 00:14:22 guenther Exp $ */
+/* $OpenBSD: fts.c,v 1.50 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -29,7 +29,7 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* ALIGN */
#include <sys/stat.h>
#include <dirent.h>
@@ -41,6 +41,8 @@
#include <string.h>
#include <unistd.h>
+#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b))
+
static FTSENT *fts_alloc(FTS *, char *, size_t);
static FTSENT *fts_build(FTS *, int);
static void fts_lfree(FTSENT *);
@@ -95,7 +97,7 @@ fts_open(char * const *argv, int options,
* Start out with 1K of path space, and enough, in any case,
* to hold the user's paths.
*/
- if (fts_palloc(sp, MAX(fts_maxarglen(argv), PATH_MAX)))
+ if (fts_palloc(sp, MAXIMUM(fts_maxarglen(argv), PATH_MAX)))
goto mem1;
/* Allocate/initialize root's parent. */
diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c
index 638d693404d..c9c7953606c 100644
--- a/lib/libc/gen/getgrent.c
+++ b/lib/libc/gen/getgrent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getgrent.c,v 1.41 2014/09/15 06:15:48 guenther Exp $ */
+/* $OpenBSD: getgrent.c,v 1.42 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,10 +30,10 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include <grp.h>
#include <errno.h>
#ifdef YP
diff --git a/lib/libc/gen/getloadavg.c b/lib/libc/gen/getloadavg.c
index 0b38042fec7..3ab72b09b47 100644
--- a/lib/libc/gen/getloadavg.c
+++ b/lib/libc/gen/getloadavg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getloadavg.c,v 1.6 2005/08/08 08:05:34 espie Exp $ */
+/* $OpenBSD: getloadavg.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -28,13 +28,14 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/sysctl.h>
#include <stdlib.h>
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
/*
* getloadavg() -- Get system load averages.
*
@@ -54,7 +55,7 @@ getloadavg(double loadavg[], int nelem)
if (sysctl(mib, 2, &loadinfo, &size, NULL, 0) < 0)
return (-1);
- nelem = MIN(nelem, sizeof(loadinfo.ldavg) / sizeof(fixpt_t));
+ nelem = MINIMUM(nelem, sizeof(loadinfo.ldavg) / sizeof(fixpt_t));
for (i = 0; i < nelem; i++)
loadavg[i] = (double) loadinfo.ldavg[i] / loadinfo.fscale;
return (nelem);
diff --git a/lib/libc/gen/getmntinfo.c b/lib/libc/gen/getmntinfo.c
index 323c4cb2db3..6e9dd857cd7 100644
--- a/lib/libc/gen/getmntinfo.c
+++ b/lib/libc/gen/getmntinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getmntinfo.c,v 1.7 2005/08/08 08:05:34 espie Exp $ */
+/* $OpenBSD: getmntinfo.c,v 1.8 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -28,7 +28,7 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/mount.h>
#include <stdlib.h>
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c
index 732cf884997..45f64fdf873 100644
--- a/lib/libc/gen/getpwent.c
+++ b/lib/libc/gen/getpwent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getpwent.c,v 1.52 2014/03/12 10:54:36 schwarze Exp $ */
+/* $OpenBSD: getpwent.c,v 1.53 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 2008 Theo de Raadt
* Copyright (c) 1988, 1993
@@ -30,7 +30,7 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* ALIGN */
#include <fcntl.h>
#include <db.h>
#include <syslog.h>
@@ -51,6 +51,8 @@
#endif
#include "thread_private.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
_THREAD_PRIVATE_KEY(pw);
static DB *_pw_db; /* password database */
@@ -675,9 +677,9 @@ _pwhashbyname(const char *name, char *buf, size_t buflen, struct passwd *pw,
if (len > _PW_NAME_LEN)
return (NULL);
bf[0] = _PW_KEYBYNAME;
- bcopy(name, &bf[1], MIN(len, _PW_NAME_LEN));
+ bcopy(name, &bf[1], MINIMUM(len, _PW_NAME_LEN));
key.data = (u_char *)bf;
- key.size = 1 + MIN(len, _PW_NAME_LEN);
+ key.size = 1 + MINIMUM(len, _PW_NAME_LEN);
r = __hashpw(&key, buf, buflen, pw, flagsp);
if (r)
return (pw);
diff --git a/lib/libc/gen/initgroups.c b/lib/libc/gen/initgroups.c
index c7a717a1410..9d7727a9c2b 100644
--- a/lib/libc/gen/initgroups.c
+++ b/lib/libc/gen/initgroups.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: initgroups.c,v 1.8 2005/08/08 08:05:34 espie Exp $ */
+/* $OpenBSD: initgroups.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -28,19 +28,18 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
-
#include <err.h>
#include <stdio.h>
#include <unistd.h>
+#include <limits.h>
int
initgroups(const char *uname, gid_t agroup)
{
- gid_t groups[NGROUPS];
+ gid_t groups[NGROUPS_MAX];
int ngroups;
- ngroups = NGROUPS;
+ ngroups = NGROUPS_MAX;
(void) getgrouplist(uname, agroup, groups, &ngroups);
if (setgroups(ngroups, groups) < 0)
return (-1);
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c
index 9235b6b76f2..73ac65b52e7 100644
--- a/lib/libc/gen/nlist.c
+++ b/lib/libc/gen/nlist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nlist.c,v 1.57 2014/01/19 20:48:57 deraadt Exp $ */
+/* $OpenBSD: nlist.c,v 1.58 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -29,7 +29,6 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/mman.h>
#include <sys/stat.h>
@@ -39,12 +38,15 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include <a.out.h> /* pulls in nlist.h */
#ifdef _NLIST_DO_ELF
#include <elf_abi.h>
#endif
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
int __fdnlist(int, struct nlist *);
#ifdef _NLIST_DO_ELF
int __elf_is_okay__(Elf_Ehdr *ehdr);
@@ -200,7 +202,7 @@ __fdnlist(int fd, struct nlist *list)
goto elf_done;
while (symsize > 0) {
- cc = MIN(symsize, sizeof(sbuf));
+ cc = MINIMUM(symsize, sizeof(sbuf));
if (pread(fd, sbuf, cc, (off_t)symoff) != cc)
break;
symsize -= cc;
diff --git a/lib/libc/gen/popen.c b/lib/libc/gen/popen.c
index 973291d2dc8..3b07f473982 100644
--- a/lib/libc/gen/popen.c
+++ b/lib/libc/gen/popen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: popen.c,v 1.19 2014/08/31 02:21:18 guenther Exp $ */
+/* $OpenBSD: popen.c,v 1.20 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
@@ -31,7 +31,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/wait.h>
#include <signal.h>
diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c
index 2973613efa5..0708bffc49c 100644
--- a/lib/libc/gen/scandir.c
+++ b/lib/libc/gen/scandir.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scandir.c,v 1.17 2014/10/08 05:34:59 deraadt Exp $ */
+/* $OpenBSD: scandir.c,v 1.18 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +35,7 @@
* struct dirent (through namelist). Returns -1 if there were any errors.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <errno.h>
@@ -44,6 +44,8 @@
#include <string.h>
#include "telldir.h"
+#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b))
+
/*
* The DIRSIZ macro is the minimum record length which will hold the directory
* entry. This requires the amount of space in struct dirent without the
@@ -75,7 +77,7 @@ scandir(const char *dirname, struct dirent ***namelist,
* estimate the array size by taking the size of the directory file
* and dividing it by a multiple of the minimum size entry.
*/
- arraysz = MAX(stb.st_size / 24, 16);
+ arraysz = MAXIMUM(stb.st_size / 24, 16);
if (arraysz > SIZE_MAX / sizeof(struct dirent *)) {
errno = ENOMEM;
goto fail;
diff --git a/lib/libc/gen/setdomainname.c b/lib/libc/gen/setdomainname.c
index 0261397fe11..6e4a1c9ec56 100644
--- a/lib/libc/gen/setdomainname.c
+++ b/lib/libc/gen/setdomainname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: setdomainname.c,v 1.8 2005/08/08 08:05:34 espie Exp $ */
+/* $OpenBSD: setdomainname.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -28,7 +28,7 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/sysctl.h>
#include <unistd.h>
diff --git a/lib/libc/gen/sethostname.c b/lib/libc/gen/sethostname.c
index 90ee4a2ef77..571db3969ee 100644
--- a/lib/libc/gen/sethostname.c
+++ b/lib/libc/gen/sethostname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sethostname.c,v 1.8 2005/08/08 08:05:34 espie Exp $ */
+/* $OpenBSD: sethostname.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -28,7 +28,7 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/sysctl.h>
#include <unistd.h>
diff --git a/lib/libc/gen/setproctitle.c b/lib/libc/gen/setproctitle.c
index 259c31d3507..96a80e17482 100644
--- a/lib/libc/gen/setproctitle.c
+++ b/lib/libc/gen/setproctitle.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: setproctitle.c,v 1.12 2011/05/30 18:48:33 martynas Exp $ */
+/* $OpenBSD: setproctitle.c,v 1.13 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1994, 1995 Christopher G. Demetriou
* All rights reserved.
@@ -30,7 +30,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/exec.h>
#include <sys/sysctl.h>
diff --git a/lib/libc/gen/statvfs.c b/lib/libc/gen/statvfs.c
index f4f7807b3cf..a17fd6e1fe8 100644
--- a/lib/libc/gen/statvfs.c
+++ b/lib/libc/gen/statvfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: statvfs.c,v 1.1 2008/03/22 19:18:42 otto Exp $ */
+/* $OpenBSD: statvfs.c,v 1.2 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
@@ -16,7 +16,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/mount.h>
#include <sys/statvfs.h>
diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c
index 2c6e6a49bf1..ef67c24e0dc 100644
--- a/lib/libc/gen/sysconf.c
+++ b/lib/libc/gen/sysconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysconf.c,v 1.20 2014/07/08 17:19:21 deraadt Exp $ */
+/* $OpenBSD: sysconf.c,v 1.21 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/sem.h>
#include <sys/sysctl.h>
#include <sys/time.h>
@@ -203,7 +203,7 @@ sysconf(int name)
/* Unsorted */
case _SC_HOST_NAME_MAX:
- return (MAXHOSTNAMELEN - 1); /* does not include \0 */
+ return (HOST_NAME_MAX+1 - 1); /* does not include \0 */
case _SC_MONOTONIC_CLOCK:
return (_POSIX_MONOTONIC_CLOCK);
case _SC_2_PBS:
diff --git a/lib/libc/gen/sysctl.c b/lib/libc/gen/sysctl.c
index b0eea554bcb..116294ef2b9 100644
--- a/lib/libc/gen/sysctl.c
+++ b/lib/libc/gen/sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.c,v 1.9 2013/06/09 13:10:17 miod Exp $ */
+/* $OpenBSD: sysctl.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
@@ -28,7 +28,7 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/sysctl.h>
int __sysctl(const int *, u_int, void *, size_t *, void *, size_t);
diff --git a/lib/libc/gen/times.c b/lib/libc/gen/times.c
index 86cf53eca0b..942f459388c 100644
--- a/lib/libc/gen/times.c
+++ b/lib/libc/gen/times.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: times.c,v 1.5 2005/08/08 08:05:34 espie Exp $ */
+/* $OpenBSD: times.c,v 1.6 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -28,7 +28,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/times.h>
#include <sys/resource.h>
diff --git a/lib/libc/gen/uname.c b/lib/libc/gen/uname.c
index 09bc682fa5c..ac40802713e 100644
--- a/lib/libc/gen/uname.c
+++ b/lib/libc/gen/uname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uname.c,v 1.9 2013/04/05 12:59:54 kurt Exp $ */
+/* $OpenBSD: uname.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
@@ -28,7 +28,7 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/sysctl.h>
#include <sys/utsname.h>
diff --git a/lib/libc/gmon/gmon.c b/lib/libc/gmon/gmon.c
index 240c53c2570..89cfdc2a14f 100644
--- a/lib/libc/gmon/gmon.c
+++ b/lib/libc/gmon/gmon.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gmon.c,v 1.22 2013/02/12 08:06:22 mpi Exp $ */
+/* $OpenBSD: gmon.c,v 1.23 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1983, 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -28,7 +28,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/gmon.h>
#include <sys/mman.h>
diff --git a/lib/libc/gmon/mcount.c b/lib/libc/gmon/mcount.c
index 942d8c1887f..f0ce70dd6ae 100644
--- a/lib/libc/gmon/mcount.c
+++ b/lib/libc/gmon/mcount.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mcount.c,v 1.14 2013/03/12 09:37:16 mpi Exp $ */
+/* $OpenBSD: mcount.c,v 1.15 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1983, 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -28,7 +28,7 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/gmon.h>
/*
diff --git a/lib/libc/hash/helper.c b/lib/libc/hash/helper.c
index c13ce461c62..ee174176894 100644
--- a/lib/libc/hash/helper.c
+++ b/lib/libc/hash/helper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: helper.c,v 1.12 2015/01/15 13:05:59 millert Exp $ */
+/* $OpenBSD: helper.c,v 1.13 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 2000 Poul-Henning Kamp <phk@FreeBSD.org>
@@ -21,7 +21,7 @@
* can buy me a beer in return. Poul-Henning Kamp
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
@@ -33,6 +33,8 @@
#include <hashinc>
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
/* ARGSUSED */
char *
HASHEnd(HASH_CTX *ctx, char *buf)
@@ -79,7 +81,7 @@ HASHFileChunk(const char *filename, char *buf, off_t off, off_t len)
return (NULL);
}
- while ((nr = read(fd, buffer, MIN(sizeof(buffer), len))) > 0) {
+ while ((nr = read(fd, buffer, MINIMUM(sizeof(buffer), len))) > 0) {
HASHUpdate(&ctx, buffer, (size_t)nr);
if (len > 0 && (len -= nr) == 0)
break;
diff --git a/lib/libc/hash/sha1.c b/lib/libc/hash/sha1.c
index d4843450ce1..fbaab9bafe8 100644
--- a/lib/libc/hash/sha1.c
+++ b/lib/libc/hash/sha1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sha1.c,v 1.24 2015/01/15 13:05:59 millert Exp $ */
+/* $OpenBSD: sha1.c,v 1.25 2015/01/16 16:48:51 deraadt Exp $ */
/*
* SHA-1 in C
@@ -14,7 +14,7 @@
* 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <string.h>
#include <sha1.h>
diff --git a/lib/libc/hash/siphash.c b/lib/libc/hash/siphash.c
index 81b4b81865d..dcc746a9515 100644
--- a/lib/libc/hash/siphash.c
+++ b/lib/libc/hash/siphash.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: siphash.c,v 1.1 2014/12/08 20:37:11 tedu Exp $ */
+/* $OpenBSD: siphash.c,v 1.2 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 2013 Andre Oppermann <andre@FreeBSD.org>
@@ -43,7 +43,7 @@
* https://131002.net/siphash/
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/endian.h>
#include <string.h>
diff --git a/lib/libc/net/base64.c b/lib/libc/net/base64.c
index 7c3d1d319f6..e90696df673 100644
--- a/lib/libc/net/base64.c
+++ b/lib/libc/net/base64.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: base64.c,v 1.7 2013/12/31 02:32:56 tedu Exp $ */
+/* $OpenBSD: base64.c,v 1.8 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1996 by Internet Software Consortium.
@@ -43,7 +43,6 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/lib/libc/net/ethers.c b/lib/libc/net/ethers.c
index 07f1da33066..a89f0c217bf 100644
--- a/lib/libc/net/ethers.c
+++ b/lib/libc/net/ethers.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ethers.c,v 1.22 2014/09/15 06:15:48 guenther Exp $ */
+/* $OpenBSD: ethers.c,v 1.23 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -27,13 +27,13 @@
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
-#include <sys/param.h>
#include <paths.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#include <limits.h>
#ifdef YP
#include <rpcsvc/ypclnt.h>
#endif
@@ -159,7 +159,7 @@ ether_hostton(const char *hostname, struct ether_addr *e)
{
FILE *f;
char buf[BUFSIZ+1], *p;
- char try[MAXHOSTNAMELEN];
+ char try[HOST_NAME_MAX+1];
size_t len;
#ifdef YP
int hostlen = strlen(hostname);
@@ -223,7 +223,7 @@ ether_line(const char *line, struct ether_addr *e, char *hostname)
if (*p == '\0')
goto bad;
n = strcspn(p, " \t\n");
- if (n >= MAXHOSTNAMELEN)
+ if (n >= HOST_NAME_MAX+1)
goto bad;
strlcpy(hostname, p, n + 1);
return (0);
diff --git a/lib/libc/net/getifaddrs.c b/lib/libc/net/getifaddrs.c
index da42a23783e..51dbbab8717 100644
--- a/lib/libc/net/getifaddrs.c
+++ b/lib/libc/net/getifaddrs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getifaddrs.c,v 1.11 2013/03/20 14:15:56 deraadt Exp $ */
+/* $OpenBSD: getifaddrs.c,v 1.12 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1995, 1999
@@ -25,11 +25,11 @@
* BSDI getifaddrs.c,v 2.12 2000/02/23 14:51:59 dab Exp
*/
+#include <sys/param.h> /* ALIGN */
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
-#include <sys/param.h>
#include <net/route.h>
#include <sys/sysctl.h>
#include <net/if_dl.h>
diff --git a/lib/libc/net/getnetent.c b/lib/libc/net/getnetent.c
index 14c39f1482f..7cda141fc0e 100644
--- a/lib/libc/net/getnetent.c
+++ b/lib/libc/net/getnetent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getnetent.c,v 1.14 2014/09/15 06:15:48 guenther Exp $ */
+/* $OpenBSD: getnetent.c,v 1.15 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -28,13 +28,13 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
#include <string.h>
+#include <limits.h>
#define MAXALIASES 35
@@ -86,8 +86,8 @@ again:
if ((cp = strchr(p, '#')) != NULL)
*cp = '\0';
net.n_name = p;
- if (strlen(net.n_name) >= MAXHOSTNAMELEN-1)
- net.n_name[MAXHOSTNAMELEN-1] = '\0';
+ if (strlen(net.n_name) >= HOST_NAME_MAX+1-1)
+ net.n_name[HOST_NAME_MAX+1-1] = '\0';
cp = strpbrk(p, " \t");
if (cp == NULL)
goto again;
@@ -108,8 +108,8 @@ again:
}
if (q < &net_aliases[MAXALIASES - 1]) {
*q++ = cp;
- if (strlen(cp) >= MAXHOSTNAMELEN-1)
- cp[MAXHOSTNAMELEN-1] = '\0';
+ if (strlen(cp) >= HOST_NAME_MAX+1-1)
+ cp[HOST_NAME_MAX+1-1] = '\0';
}
cp = strpbrk(cp, " \t");
if (cp != NULL)
diff --git a/lib/libc/net/herror.c b/lib/libc/net/herror.c
index 7787115a9da..8dee0cc382e 100644
--- a/lib/libc/net/herror.c
+++ b/lib/libc/net/herror.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: herror.c,v 1.8 2005/08/06 20:30:03 espie Exp $ */
+/* $OpenBSD: herror.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */
/*
* ++Copyright++ 1987, 1993
@@ -52,7 +52,6 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/uio.h>
#include <netdb.h>
#include <unistd.h>
diff --git a/lib/libc/net/inet_addr.c b/lib/libc/net/inet_addr.c
index 18762ab5223..2c9aa3051b6 100644
--- a/lib/libc/net/inet_addr.c
+++ b/lib/libc/net/inet_addr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet_addr.c,v 1.10 2013/11/24 23:51:28 deraadt Exp $ */
+/* $OpenBSD: inet_addr.c,v 1.11 2015/01/16 16:48:51 deraadt Exp $ */
/*
* ++Copyright++ 1983, 1990, 1993
@@ -52,7 +52,6 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <ctype.h>
diff --git a/lib/libc/net/inet_lnaof.c b/lib/libc/net/inet_lnaof.c
index b1a58cd2c19..92845387d37 100644
--- a/lib/libc/net/inet_lnaof.c
+++ b/lib/libc/net/inet_lnaof.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet_lnaof.c,v 1.6 2005/08/06 20:30:03 espie Exp $ */
+/* $OpenBSD: inet_lnaof.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -28,7 +28,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/lib/libc/net/inet_makeaddr.c b/lib/libc/net/inet_makeaddr.c
index 87d9325231d..88ddd2850ec 100644
--- a/lib/libc/net/inet_makeaddr.c
+++ b/lib/libc/net/inet_makeaddr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet_makeaddr.c,v 1.6 2005/08/06 20:30:03 espie Exp $ */
+/* $OpenBSD: inet_makeaddr.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -28,7 +28,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/lib/libc/net/inet_netof.c b/lib/libc/net/inet_netof.c
index 2f468c3aca5..4efceede132 100644
--- a/lib/libc/net/inet_netof.c
+++ b/lib/libc/net/inet_netof.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet_netof.c,v 1.6 2005/08/06 20:30:03 espie Exp $ */
+/* $OpenBSD: inet_netof.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -28,7 +28,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/lib/libc/net/inet_ntop.c b/lib/libc/net/inet_ntop.c
index f991a071bab..722761e2ed9 100644
--- a/lib/libc/net/inet_ntop.c
+++ b/lib/libc/net/inet_ntop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet_ntop.c,v 1.10 2014/05/17 18:16:14 tedu Exp $ */
+/* $OpenBSD: inet_ntop.c,v 1.11 2015/01/16 16:48:51 deraadt Exp $ */
/* Copyright (c) 1996 by Internet Software Consortium.
*
@@ -16,7 +16,6 @@
* SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
diff --git a/lib/libc/net/inet_pton.c b/lib/libc/net/inet_pton.c
index 7e521c32867..f8e299b7b8a 100644
--- a/lib/libc/net/inet_pton.c
+++ b/lib/libc/net/inet_pton.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet_pton.c,v 1.8 2010/05/06 15:47:14 claudio Exp $ */
+/* $OpenBSD: inet_pton.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */
/* Copyright (c) 1996 by Internet Software Consortium.
*
@@ -16,7 +16,6 @@
* SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
diff --git a/lib/libc/net/ip6opt.c b/lib/libc/net/ip6opt.c
index d98e300cb62..71dfe558031 100644
--- a/lib/libc/net/ip6opt.c
+++ b/lib/libc/net/ip6opt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6opt.c,v 1.7 2014/06/13 15:41:06 chrisz Exp $ */
+/* $OpenBSD: ip6opt.c,v 1.8 2015/01/16 16:48:51 deraadt Exp $ */
/* $KAME: ip6opt.c,v 1.18 2005/06/15 07:11:35 keiichi Exp $ */
/*
@@ -30,7 +30,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c
index 617fe440aa0..afa59dde973 100644
--- a/lib/libc/net/rcmd.c
+++ b/lib/libc/net/rcmd.c
@@ -28,7 +28,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/socket.h>
#include <sys/stat.h>
@@ -39,6 +38,7 @@
#include <fcntl.h>
#include <netdb.h>
#include <unistd.h>
+#include <limits.h>
#include <pwd.h>
#include <errno.h>
#include <stdio.h>
@@ -59,7 +59,7 @@ int
rcmd_af(char **ahost, int porta, const char *locuser, const char *remuser,
const char *cmd, int *fd2p, int af)
{
- static char hbuf[MAXHOSTNAMELEN];
+ static char hbuf[HOST_NAME_MAX+1];
char pbuf[NI_MAXSERV];
struct addrinfo hints, *res, *r;
int error;
diff --git a/lib/libc/net/res_comp.c b/lib/libc/net/res_comp.c
index 69a6ce0abbb..37c8f23dc2b 100644
--- a/lib/libc/net/res_comp.c
+++ b/lib/libc/net/res_comp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_comp.c,v 1.14 2008/04/16 22:35:23 deraadt Exp $ */
+/* $OpenBSD: res_comp.c,v 1.15 2015/01/16 16:48:51 deraadt Exp $ */
/*
* ++Copyright++ 1985, 1993
@@ -52,7 +52,6 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
@@ -61,6 +60,7 @@
#include <ctype.h>
#include <unistd.h>
+#include <limits.h>
#include <string.h>
static int dn_find(u_char *, u_char *, u_char **, u_char **);
@@ -84,8 +84,8 @@ dn_expand(const u_char *msg, const u_char *eomorig, const u_char *comp_dn,
dn = exp_dn;
cp = comp_dn;
- if (length > MAXHOSTNAMELEN-1)
- length = MAXHOSTNAMELEN-1;
+ if (length > HOST_NAME_MAX+1-1)
+ length = HOST_NAME_MAX+1-1;
eom = exp_dn + length;
/*
* fetch next label in domain name
diff --git a/lib/libc/net/res_data.c b/lib/libc/net/res_data.c
index a5f6b03a7f7..6e81b584a9f 100644
--- a/lib/libc/net/res_data.c
+++ b/lib/libc/net/res_data.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_data.c,v 1.3 2005/08/06 20:30:03 espie Exp $ */
+/* $OpenBSD: res_data.c,v 1.4 2015/01/16 16:48:51 deraadt Exp $ */
/*
* ++Copyright++ 1995
@@ -52,7 +52,6 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
diff --git a/lib/libc/net/rresvport.c b/lib/libc/net/rresvport.c
index ccc411500b8..2ecbc0a67d6 100644
--- a/lib/libc/net/rresvport.c
+++ b/lib/libc/net/rresvport.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rresvport.c,v 1.9 2005/11/10 10:00:17 espie Exp $ */
+/* $OpenBSD: rresvport.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1995, 1996, 1998 Theo de Raadt. All rights reserved.
* Copyright (c) 1983, 1993, 1994
@@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/socket.h>
#include <sys/stat.h>
diff --git a/lib/libc/net/rthdr.c b/lib/libc/net/rthdr.c
index 9e917f1009a..92a1f75a769 100644
--- a/lib/libc/net/rthdr.c
+++ b/lib/libc/net/rthdr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rthdr.c,v 1.9 2014/06/13 15:41:06 chrisz Exp $ */
+/* $OpenBSD: rthdr.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */
/* $KAME: rthdr.c,v 1.22 2006/02/09 08:18:58 keiichi Exp $ */
/*
@@ -30,7 +30,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/lib/libc/net/ruserok.c b/lib/libc/net/ruserok.c
index 4d0adfbe4ef..fed55e031d0 100644
--- a/lib/libc/net/ruserok.c
+++ b/lib/libc/net/ruserok.c
@@ -204,7 +204,7 @@ __ivaliduser_sa(FILE *hostf, struct sockaddr *raddr, socklen_t salen,
const char *auser, *ahost;
int hostok, userok;
char *rhost = (char *)-1;
- char domain[MAXHOSTNAMELEN];
+ char domain[HOST_NAME_MAX+1];
size_t buflen;
getdomainname(domain, sizeof(domain));
@@ -245,7 +245,7 @@ __ivaliduser_sa(FILE *hostf, struct sockaddr *raddr, socklen_t salen,
auser = *user ? user : luser;
ahost = buf;
- if (strlen(ahost) >= MAXHOSTNAMELEN)
+ if (strlen(ahost) >= HOST_NAME_MAX+1)
continue;
/*
diff --git a/lib/libc/nls/catopen.c b/lib/libc/nls/catopen.c
index 37f8ee20f35..cd1c70047b1 100644
--- a/lib/libc/nls/catopen.c
+++ b/lib/libc/nls/catopen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: catopen.c,v 1.15 2013/06/01 21:26:17 stsp Exp $ */
+/* $OpenBSD: catopen.c,v 1.16 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -34,7 +34,6 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <unistd.h>
diff --git a/lib/libc/rpc/clnt_simple.c b/lib/libc/rpc/clnt_simple.c
index 7da3edd1085..2873befc48e 100644
--- a/lib/libc/rpc/clnt_simple.c
+++ b/lib/libc/rpc/clnt_simple.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clnt_simple.c,v 1.16 2014/11/11 04:51:49 guenther Exp $ */
+/* $OpenBSD: clnt_simple.c,v 1.17 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 2010, Oracle America, Inc.
@@ -36,13 +36,13 @@
* Simplified front end to rpc.
*/
-#include <sys/param.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include <rpc/rpc.h>
static struct callrpc_private {
@@ -70,7 +70,7 @@ callrpc(char *host, int prognum, int versnum, int procnum, xdrproc_t inproc,
callrpc_private = crp;
}
if (crp->oldhost == NULL) {
- crp->oldhost = malloc(MAXHOSTNAMELEN);
+ crp->oldhost = malloc(HOST_NAME_MAX+1);
if (crp->oldhost == NULL) {
free(crp);
callrpc_private = save_callrpc_private;
@@ -108,7 +108,7 @@ callrpc(char *host, int prognum, int versnum, int procnum, xdrproc_t inproc,
crp->valid = 1;
crp->oldprognum = prognum;
crp->oldversnum = versnum;
- strlcpy(crp->oldhost, host, MAXHOSTNAMELEN);
+ strlcpy(crp->oldhost, host, HOST_NAME_MAX+1);
}
tottimeout.tv_sec = 25;
tottimeout.tv_usec = 0;
diff --git a/lib/libc/rpc/rpc_callmsg.c b/lib/libc/rpc/rpc_callmsg.c
index fc217b24274..a6b47bb8003 100644
--- a/lib/libc/rpc/rpc_callmsg.c
+++ b/lib/libc/rpc/rpc_callmsg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rpc_callmsg.c,v 1.10 2010/09/01 14:43:34 millert Exp $ */
+/* $OpenBSD: rpc_callmsg.c,v 1.11 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 2010, Oracle America, Inc.
@@ -33,7 +33,6 @@
#include <stdlib.h>
#include <string.h>
-#include <sys/param.h>
#include <rpc/rpc.h>
diff --git a/lib/libc/rpc/rpc_prot.c b/lib/libc/rpc/rpc_prot.c
index 4725384a9ea..ac2bc90a05a 100644
--- a/lib/libc/rpc/rpc_prot.c
+++ b/lib/libc/rpc/rpc_prot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rpc_prot.c,v 1.11 2010/09/01 14:43:34 millert Exp $ */
+/* $OpenBSD: rpc_prot.c,v 1.12 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 2010, Oracle America, Inc.
@@ -42,8 +42,6 @@
* routines are also in this program.
*/
-#include <sys/param.h>
-
#include <rpc/rpc.h>
/* * * * * * * * * * * * * * XDR Authentication * * * * * * * * * * * */
diff --git a/lib/libc/rpc/xdr_float.c b/lib/libc/rpc/xdr_float.c
index 4ff14885a35..d82e9899fb2 100644
--- a/lib/libc/rpc/xdr_float.c
+++ b/lib/libc/rpc/xdr_float.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_float.c,v 1.21 2014/07/21 01:51:11 guenther Exp $ */
+/* $OpenBSD: xdr_float.c,v 1.22 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 2010, Oracle America, Inc.
@@ -41,7 +41,6 @@
#include <stdio.h>
#include <sys/types.h>
-#include <sys/param.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/stdio/findfp.c b/lib/libc/stdio/findfp.c
index 3e5b387bbb2..ee866fa26ce 100644
--- a/lib/libc/stdio/findfp.c
+++ b/lib/libc/stdio/findfp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: findfp.c,v 1.16 2014/11/19 04:19:56 guenther Exp $ */
+/* $OpenBSD: findfp.c,v 1.17 2015/01/16 16:48:51 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* ALIGN */
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
diff --git a/lib/libc/stdio/open_memstream.c b/lib/libc/stdio/open_memstream.c
index 46105358d33..4ab9bc51e1d 100644
--- a/lib/libc/stdio/open_memstream.c
+++ b/lib/libc/stdio/open_memstream.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: open_memstream.c,v 1.3 2013/04/03 03:11:53 guenther Exp $ */
+/* $OpenBSD: open_memstream.c,v 1.4 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org>
@@ -16,8 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
-
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
@@ -26,6 +24,8 @@
#include <string.h>
#include "local.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
struct state {
char *string; /* actual stream */
char **pbuf; /* point to the stream */
@@ -95,7 +95,7 @@ memstream_seek(void *v, fpos_t off, int whence)
}
st->pos = base + off;
- *st->psize = MIN(st->pos, st->len);
+ *st->psize = MINIMUM(st->pos, st->len);
return (st->pos);
}
diff --git a/lib/libc/stdio/open_wmemstream.c b/lib/libc/stdio/open_wmemstream.c
index 391a944456f..0e7fc013348 100644
--- a/lib/libc/stdio/open_wmemstream.c
+++ b/lib/libc/stdio/open_wmemstream.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: open_wmemstream.c,v 1.4 2014/10/08 05:28:19 deraadt Exp $ */
+/* $OpenBSD: open_wmemstream.c,v 1.5 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org>
@@ -16,8 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
-
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
@@ -27,6 +25,8 @@
#include <wchar.h>
#include "local.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
struct state {
wchar_t *string; /* actual stream */
wchar_t **pbuf; /* point to the stream */
@@ -105,7 +105,7 @@ wmemstream_seek(void *v, fpos_t off, int whence)
bzero(&st->mbs, sizeof(st->mbs));
st->pos = base + off;
- *st->psize = MIN(st->pos, st->len);
+ *st->psize = MINIMUM(st->pos, st->len);
return (st->pos);
}
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index 57d35b80b6e..69ae877abac 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: malloc.c,v 1.172 2015/01/05 21:04:04 tedu Exp $ */
+/* $OpenBSD: malloc.c,v 1.173 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 2008, 2010, 2011 Otto Moerbeek <otto@drijf.net>
* Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org>
@@ -26,7 +26,7 @@
/* #define MALLOC_STATS */
#include <sys/types.h>
-#include <sys/param.h>
+#include <sys/param.h> /* PAGE_SHIFT ALIGN */
#include <sys/queue.h>
#include <sys/mman.h>
#include <sys/uio.h>
diff --git a/lib/libc/stdlib/random.c b/lib/libc/stdlib/random.c
index 96cced9a204..e293648ecd3 100644
--- a/lib/libc/stdlib/random.c
+++ b/lib/libc/stdlib/random.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: random.c,v 1.28 2014/12/16 20:51:32 sthen Exp $ */
+/* $OpenBSD: random.c,v 1.29 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved.
@@ -28,9 +28,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
-#include <sys/sysctl.h>
-#include <sys/time.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c
index e06db59088f..7b70b9ddfb3 100644
--- a/lib/libc/stdlib/realpath.c
+++ b/lib/libc/stdlib/realpath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: realpath.c,v 1.18 2014/10/19 03:56:28 doug Exp $ */
+/* $OpenBSD: realpath.c,v 1.19 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 2003 Constantin S. Svintsoff <kostik@iclub.nsu.ru>
*
@@ -27,13 +27,13 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/stat.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
/* A slightly modified copy of this file exists in libexec/ld.so */
@@ -156,7 +156,7 @@ realpath(const char *path, char *resolved)
goto err;
}
if (S_ISLNK(sb.st_mode)) {
- if (symlinks++ > MAXSYMLINKS) {
+ if (symlinks++ > SYMLOOP_MAX) {
errno = ELOOP;
goto err;
}
diff --git a/lib/libc/sys/stack_protector.c b/lib/libc/sys/stack_protector.c
index 5cdb06d282a..0e757841dc9 100644
--- a/lib/libc/sys/stack_protector.c
+++ b/lib/libc/sys/stack_protector.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: stack_protector.c,v 1.15 2013/12/28 18:42:42 deraadt Exp $ */
+/* $OpenBSD: stack_protector.c,v 1.16 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 2002 Hiroaki Etoh, Federico G. Schwindt, and Miodrag Vallat.
@@ -27,7 +27,6 @@
*
*/
-#include <sys/param.h>
#include <signal.h>
#include <string.h>
#include <syslog.h>
diff --git a/lib/libc/yp/_yp_check.c b/lib/libc/yp/_yp_check.c
index f7576afc653..18b3a949808 100644
--- a/lib/libc/yp/_yp_check.c
+++ b/lib/libc/yp/_yp_check.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: _yp_check.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: _yp_check.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,8 +25,8 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
+#include <limits.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
#include <rpcsvc/yp.h>
diff --git a/lib/libc/yp/xdr_domainname.c b/lib/libc/yp/xdr_domainname.c
index 74838bdd18e..5dcc4d1140e 100644
--- a/lib/libc/yp/xdr_domainname.c
+++ b/lib/libc/yp/xdr_domainname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_domainname.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: xdr_domainname.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/yp/xdr_keydat.c b/lib/libc/yp/xdr_keydat.c
index 21c5768b0f0..6f774afec3f 100644
--- a/lib/libc/yp/xdr_keydat.c
+++ b/lib/libc/yp/xdr_keydat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_keydat.c,v 1.7 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: xdr_keydat.c,v 1.8 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/yp/xdr_mapname.c b/lib/libc/yp/xdr_mapname.c
index 68e7302530d..c2a98bac0f2 100644
--- a/lib/libc/yp/xdr_mapname.c
+++ b/lib/libc/yp/xdr_mapname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_mapname.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: xdr_mapname.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/yp/xdr_peername.c b/lib/libc/yp/xdr_peername.c
index 332ce89d66a..b5e7bd1461c 100644
--- a/lib/libc/yp/xdr_peername.c
+++ b/lib/libc/yp/xdr_peername.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_peername.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: xdr_peername.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/yp/xdr_valdat.c b/lib/libc/yp/xdr_valdat.c
index f3d81e193cf..1d5a2eaab69 100644
--- a/lib/libc/yp/xdr_valdat.c
+++ b/lib/libc/yp/xdr_valdat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_valdat.c,v 1.7 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: xdr_valdat.c,v 1.8 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/yp/xdr_ypbind_binding.c b/lib/libc/yp/xdr_ypbind_binding.c
index 5d80f19f8db..6ece28bfdec 100644
--- a/lib/libc/yp/xdr_ypbind_binding.c
+++ b/lib/libc/yp/xdr_ypbind_binding.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_ypbind_binding.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: xdr_ypbind_binding.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/yp/xdr_ypbind_resp.c b/lib/libc/yp/xdr_ypbind_resp.c
index 51821f7131c..d1493f2a0b6 100644
--- a/lib/libc/yp/xdr_ypbind_resp.c
+++ b/lib/libc/yp/xdr_ypbind_resp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_ypbind_resp.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: xdr_ypbind_resp.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/yp/xdr_ypbind_resptype.c b/lib/libc/yp/xdr_ypbind_resptype.c
index 43f996caeb3..8bf7e47d312 100644
--- a/lib/libc/yp/xdr_ypbind_resptype.c
+++ b/lib/libc/yp/xdr_ypbind_resptype.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_ypbind_resptype.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: xdr_ypbind_resptype.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/yp/xdr_ypbind_setdom.c b/lib/libc/yp/xdr_ypbind_setdom.c
index 1f8a3dacda4..40e33cd7803 100644
--- a/lib/libc/yp/xdr_ypbind_setdom.c
+++ b/lib/libc/yp/xdr_ypbind_setdom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_ypbind_setdom.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: xdr_ypbind_setdom.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/yp/xdr_ypmaplist.c b/lib/libc/yp/xdr_ypmaplist.c
index 998d0291851..4db0bda2e1f 100644
--- a/lib/libc/yp/xdr_ypmaplist.c
+++ b/lib/libc/yp/xdr_ypmaplist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_ypmaplist.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: xdr_ypmaplist.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/yp/xdr_ypreq_key.c b/lib/libc/yp/xdr_ypreq_key.c
index 5b3c6c25907..b4dcddece30 100644
--- a/lib/libc/yp/xdr_ypreq_key.c
+++ b/lib/libc/yp/xdr_ypreq_key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_ypreq_key.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: xdr_ypreq_key.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/yp/xdr_ypreq_nokey.c b/lib/libc/yp/xdr_ypreq_nokey.c
index 7a920592e1a..a6e4b4b528f 100644
--- a/lib/libc/yp/xdr_ypreq_nokey.c
+++ b/lib/libc/yp/xdr_ypreq_nokey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_ypreq_nokey.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: xdr_ypreq_nokey.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/yp/xdr_ypresp_all.c b/lib/libc/yp/xdr_ypresp_all.c
index 11a1c5b220b..d25c0186c47 100644
--- a/lib/libc/yp/xdr_ypresp_all.c
+++ b/lib/libc/yp/xdr_ypresp_all.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_ypresp_all.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: xdr_ypresp_all.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/yp/xdr_ypresp_key_val.c b/lib/libc/yp/xdr_ypresp_key_val.c
index d6567d73303..4e285be6d36 100644
--- a/lib/libc/yp/xdr_ypresp_key_val.c
+++ b/lib/libc/yp/xdr_ypresp_key_val.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_ypresp_key_val.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: xdr_ypresp_key_val.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/yp/xdr_ypresp_maplist.c b/lib/libc/yp/xdr_ypresp_maplist.c
index edea438bf0c..434276effe0 100644
--- a/lib/libc/yp/xdr_ypresp_maplist.c
+++ b/lib/libc/yp/xdr_ypresp_maplist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_ypresp_maplist.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: xdr_ypresp_maplist.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/yp/xdr_ypresp_master.c b/lib/libc/yp/xdr_ypresp_master.c
index 77564692a19..ac4edfc3a5a 100644
--- a/lib/libc/yp/xdr_ypresp_master.c
+++ b/lib/libc/yp/xdr_ypresp_master.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_ypresp_master.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: xdr_ypresp_master.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/yp/xdr_ypresp_order.c b/lib/libc/yp/xdr_ypresp_order.c
index 5d2d3bcf5eb..39bbc15a710 100644
--- a/lib/libc/yp/xdr_ypresp_order.c
+++ b/lib/libc/yp/xdr_ypresp_order.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_ypresp_order.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: xdr_ypresp_order.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/yp/xdr_ypresp_val.c b/lib/libc/yp/xdr_ypresp_val.c
index 056fa8d8003..b1c81e2e467 100644
--- a/lib/libc/yp/xdr_ypresp_val.c
+++ b/lib/libc/yp/xdr_ypresp_val.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_ypresp_val.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: xdr_ypresp_val.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/yp/xdr_ypstat.c b/lib/libc/yp/xdr_ypstat.c
index 5a045eba536..bb41cba7bcd 100644
--- a/lib/libc/yp/xdr_ypstat.c
+++ b/lib/libc/yp/xdr_ypstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_ypstat.c,v 1.7 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: xdr_ypstat.c,v 1.8 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
diff --git a/lib/libc/yp/yp_all.c b/lib/libc/yp/yp_all.c
index 50c9d5f68b1..35398acafdc 100644
--- a/lib/libc/yp/yp_all.c
+++ b/lib/libc/yp/yp_all.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yp_all.c,v 1.10 2010/04/02 17:35:03 schwarze Exp $ */
+/* $OpenBSD: yp_all.c,v 1.11 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,11 +25,11 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
#include <rpcsvc/yp.h>
diff --git a/lib/libc/yp/yp_bind.c b/lib/libc/yp/yp_bind.c
index c292686839d..73cbd3888b2 100644
--- a/lib/libc/yp/yp_bind.c
+++ b/lib/libc/yp/yp_bind.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yp_bind.c,v 1.21 2015/01/14 23:36:16 deraadt Exp $ */
+/* $OpenBSD: yp_bind.c,v 1.22 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993, 1996 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
@@ -35,6 +34,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
#include <rpcsvc/yp.h>
diff --git a/lib/libc/yp/yp_first.c b/lib/libc/yp/yp_first.c
index 3e24f39ef95..e631cc2e81f 100644
--- a/lib/libc/yp/yp_first.c
+++ b/lib/libc/yp/yp_first.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yp_first.c,v 1.9 2009/06/07 03:33:36 schwarze Exp $ */
+/* $OpenBSD: yp_first.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,8 +25,8 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
+#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <rpc/rpc.h>
diff --git a/lib/libc/yp/yp_get_default_domain.c b/lib/libc/yp/yp_get_default_domain.c
index d48e3d1eddf..2d72429fbcb 100644
--- a/lib/libc/yp/yp_get_default_domain.c
+++ b/lib/libc/yp/yp_get_default_domain.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yp_get_default_domain.c,v 1.7 2009/06/05 16:39:39 schwarze Exp $ */
+/* $OpenBSD: yp_get_default_domain.c,v 1.8 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,9 +25,9 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <unistd.h>
+#include <limits.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
#include <rpcsvc/yp.h>
diff --git a/lib/libc/yp/yp_maplist.c b/lib/libc/yp/yp_maplist.c
index b8785527c51..17bdefe103f 100644
--- a/lib/libc/yp/yp_maplist.c
+++ b/lib/libc/yp/yp_maplist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yp_maplist.c,v 1.8 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: yp_maplist.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,9 +25,9 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <string.h>
+#include <limits.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
#include <rpcsvc/yp.h>
diff --git a/lib/libc/yp/yp_master.c b/lib/libc/yp/yp_master.c
index eb1597495d9..0d8f6787ccc 100644
--- a/lib/libc/yp/yp_master.c
+++ b/lib/libc/yp/yp_master.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yp_master.c,v 1.8 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: yp_master.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,9 +25,9 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <string.h>
+#include <limits.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
#include <rpcsvc/yp.h>
diff --git a/lib/libc/yp/yp_order.c b/lib/libc/yp/yp_order.c
index fbea4f334c8..696137ae0f4 100644
--- a/lib/libc/yp/yp_order.c
+++ b/lib/libc/yp/yp_order.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yp_order.c,v 1.9 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: yp_order.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,9 +25,9 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <string.h>
+#include <limits.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
#include <rpcsvc/yp.h>
diff --git a/lib/libc/yp/yperr_string.c b/lib/libc/yp/yperr_string.c
index cb959f8120b..56dbc1df81c 100644
--- a/lib/libc/yp/yperr_string.c
+++ b/lib/libc/yp/yperr_string.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yperr_string.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: yperr_string.c,v 1.7 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <stdio.h>
#include <rpc/rpc.h>
diff --git a/lib/libc/yp/ypmatch_cache.c b/lib/libc/yp/ypmatch_cache.c
index 2f8d508c459..8d2c65c5b49 100644
--- a/lib/libc/yp/ypmatch_cache.c
+++ b/lib/libc/yp/ypmatch_cache.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypmatch_cache.c,v 1.15 2009/11/01 00:08:54 schwarze Exp $ */
+/* $OpenBSD: ypmatch_cache.c,v 1.16 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,10 +25,10 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
#include <rpcsvc/yp.h>
diff --git a/lib/libc/yp/ypprot_err.c b/lib/libc/yp/ypprot_err.c
index d5a7f63ca2f..618d508b502 100644
--- a/lib/libc/yp/ypprot_err.c
+++ b/lib/libc/yp/ypprot_err.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypprot_err.c,v 1.7 2005/08/05 13:02:16 espie Exp $ */
+/* $OpenBSD: ypprot_err.c,v 1.8 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>