Sync with upstream OpenBSD: trivial stuff.
No active ingredient to any of these changes.
Bug: N/A
Test: builds
Change-Id: Ib1191a5c2826da024245d03dfc57557c8903a6cc
diff --git a/libc/upstream-openbsd/android/include/openbsd-compat.h b/libc/upstream-openbsd/android/include/openbsd-compat.h
index bec860b..9b16da7 100644
--- a/libc/upstream-openbsd/android/include/openbsd-compat.h
+++ b/libc/upstream-openbsd/android/include/openbsd-compat.h
@@ -22,6 +22,11 @@
#include <sys/cdefs.h>
#include <stddef.h> // For size_t.
+#define __BEGIN_HIDDEN_DECLS _Pragma("GCC visibility push(hidden)")
+#define __END_HIDDEN_DECLS _Pragma("GCC visibility pop")
+
+extern const char* __progname;
+
/* Redirect internal C library calls to the public function. */
#define _err err
#define _errx errx
diff --git a/libc/upstream-openbsd/lib/libc/crypt/arc4random.c b/libc/upstream-openbsd/lib/libc/crypt/arc4random.c
index 64248b6..8a4ecc9 100644
--- a/libc/upstream-openbsd/lib/libc/crypt/arc4random.c
+++ b/libc/upstream-openbsd/lib/libc/crypt/arc4random.c
@@ -1,9 +1,10 @@
-/* $OpenBSD: arc4random.c,v 1.50 2014/07/21 18:13:12 deraadt Exp $ */
+/* $OpenBSD: arc4random.c,v 1.54 2015/09/13 08:31:47 guenther Exp $ */
/*
* Copyright (c) 1996, David Mazieres <dm@uun.org>
* Copyright (c) 2008, Damien Miller <djm@openbsd.org>
* Copyright (c) 2013, Markus Friedl <markus@openbsd.org>
+ * Copyright (c) 2014, Theo de Raadt <deraadt@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -30,18 +31,18 @@
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/time.h>
#define KEYSTREAM_ONLY
#include "chacha_private.h"
-#define min(a, b) ((a) < (b) ? (a) : (b))
-#ifdef __GNUC__
+#define minimum(a, b) ((a) < (b) ? (a) : (b))
+
+#if defined(__GNUC__) || defined(_MSC_VER)
#define inline __inline
-#else /* !__GNUC__ */
+#else /* __GNUC__ || _MSC_VER */
#define inline
-#endif /* !__GNUC__ */
+#endif /* !__GNUC__ && !_MSC_VER */
#define KEYSZ 32
#define IVSZ 8
@@ -127,7 +128,7 @@
if (dat) {
size_t i, m;
- m = min(datlen, KEYSZ + IVSZ);
+ m = minimum(datlen, KEYSZ + IVSZ);
for (i = 0; i < m; i++)
rsx->rs_buf[i] ^= dat[i];
}
@@ -147,7 +148,7 @@
_rs_stir_if_needed(n);
while (n > 0) {
if (rs->rs_have > 0) {
- m = min(n, rs->rs_have);
+ m = minimum(n, rs->rs_have);
keystream = rsx->rs_buf + sizeof(rsx->rs_buf)
- rs->rs_have;
memcpy(buf, keystream, m);
@@ -185,6 +186,7 @@
_ARC4_UNLOCK();
return val;
}
+DEF_WEAK(arc4random);
void
arc4random_buf(void *buf, size_t n)
@@ -193,3 +195,4 @@
_rs_random_buf(buf, n);
_ARC4_UNLOCK();
}
+DEF_WEAK(arc4random_buf);
diff --git a/libc/upstream-openbsd/lib/libc/crypt/arc4random_uniform.c b/libc/upstream-openbsd/lib/libc/crypt/arc4random_uniform.c
index 1aa9a62..23a15e3 100644
--- a/libc/upstream-openbsd/lib/libc/crypt/arc4random_uniform.c
+++ b/libc/upstream-openbsd/lib/libc/crypt/arc4random_uniform.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arc4random_uniform.c,v 1.1 2014/07/12 13:24:54 deraadt Exp $ */
+/* $OpenBSD: arc4random_uniform.c,v 1.2 2015/09/13 08:31:47 guenther Exp $ */
/*
* Copyright (c) 2008, Damien Miller <djm@openbsd.org>
@@ -54,3 +54,4 @@
return r % upper_bound;
}
+DEF_WEAK(arc4random_uniform);
diff --git a/libc/upstream-openbsd/lib/libc/gdtoa/dmisc.c b/libc/upstream-openbsd/lib/libc/gdtoa/dmisc.c
index a5795cf..f3d8ea7 100644
--- a/libc/upstream-openbsd/lib/libc/gdtoa/dmisc.c
+++ b/libc/upstream-openbsd/lib/libc/gdtoa/dmisc.c
@@ -104,6 +104,7 @@
dtoa_result = 0;
#endif
}
+DEF_STRONG(freedtoa);
int
quorem
diff --git a/libc/upstream-openbsd/lib/libc/gdtoa/dtoa.c b/libc/upstream-openbsd/lib/libc/gdtoa/dtoa.c
index 668f7b5..c1c8724 100644
--- a/libc/upstream-openbsd/lib/libc/gdtoa/dtoa.c
+++ b/libc/upstream-openbsd/lib/libc/gdtoa/dtoa.c
@@ -837,3 +837,4 @@
*rve = s;
return s0;
}
+DEF_STRONG(dtoa);
diff --git a/libc/upstream-openbsd/lib/libc/gdtoa/gdtoa.c b/libc/upstream-openbsd/lib/libc/gdtoa/gdtoa.c
index fd11de5..feae5af 100644
--- a/libc/upstream-openbsd/lib/libc/gdtoa/gdtoa.c
+++ b/libc/upstream-openbsd/lib/libc/gdtoa/gdtoa.c
@@ -827,3 +827,4 @@
*kindp |= inex;
return s0;
}
+DEF_STRONG(gdtoa);
diff --git a/libc/upstream-openbsd/lib/libc/gdtoa/gdtoaimp.h b/libc/upstream-openbsd/lib/libc/gdtoa/gdtoaimp.h
index 7a36967..0f3de12 100644
--- a/libc/upstream-openbsd/lib/libc/gdtoa/gdtoaimp.h
+++ b/libc/upstream-openbsd/lib/libc/gdtoa/gdtoaimp.h
@@ -590,7 +590,7 @@
int *decpt, int *sign, char **rve));
extern char *g__fmt ANSI((char*, char*, char*, int, ULong, size_t));
extern int gethex ANSI((CONST char**, FPI*, Long*, Bigint**, int));
- extern void hexdig_init_D2A(Void);
+ extern void __hexdig_init_D2A(Void);
extern int hexnan ANSI((CONST char**, FPI*, ULong*));
extern int hi0bits_D2A ANSI((ULong));
extern Bigint *i2b ANSI((int));
diff --git a/libc/upstream-openbsd/lib/libc/gdtoa/gethex.c b/libc/upstream-openbsd/lib/libc/gdtoa/gethex.c
index 7ace0fa..f521f15 100644
--- a/libc/upstream-openbsd/lib/libc/gdtoa/gethex.c
+++ b/libc/upstream-openbsd/lib/libc/gdtoa/gethex.c
@@ -67,7 +67,7 @@
#endif
if (!hexdig['0'])
- hexdig_init_D2A();
+ __hexdig_init_D2A();
*bp = 0;
havedig = 0;
s0 = *(CONST unsigned char **)sp + 2;
diff --git a/libc/upstream-openbsd/lib/libc/gdtoa/hd_init.c b/libc/upstream-openbsd/lib/libc/gdtoa/hd_init.c
index fa6e18d..2227640 100644
--- a/libc/upstream-openbsd/lib/libc/gdtoa/hd_init.c
+++ b/libc/upstream-openbsd/lib/libc/gdtoa/hd_init.c
@@ -46,7 +46,7 @@
}
void
-hexdig_init_D2A(Void)
+__hexdig_init_D2A(Void)
{
#define USC (unsigned char *)
htinit(hexdig, USC "0123456789", 0x10);
diff --git a/libc/upstream-openbsd/lib/libc/gdtoa/hdtoa.c b/libc/upstream-openbsd/lib/libc/gdtoa/hdtoa.c
index c62f6d5..45caef4 100644
--- a/libc/upstream-openbsd/lib/libc/gdtoa/hdtoa.c
+++ b/libc/upstream-openbsd/lib/libc/gdtoa/hdtoa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hdtoa.c,v 1.2 2009/10/16 12:15:03 martynas Exp $ */
+/* $OpenBSD: hdtoa.c,v 1.3 2015/09/14 12:49:33 guenther Exp $ */
/*-
* Copyright (c) 2004, 2005 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
@@ -210,6 +210,7 @@
return (s0);
}
+DEF_STRONG(__hdtoa);
#if (LDBL_MANT_DIG > DBL_MANT_DIG)
@@ -319,6 +320,7 @@
return (s0);
}
+DEF_STRONG(__hldtoa);
#else /* (LDBL_MANT_DIG == DBL_MANT_DIG) */
@@ -328,5 +330,6 @@
{
return (__hdtoa((double)e, xdigs, ndigits, decpt, sign, rve));
}
+DEF_STRONG(__hldtoa);
#endif /* (LDBL_MANT_DIG == DBL_MANT_DIG) */
diff --git a/libc/upstream-openbsd/lib/libc/gdtoa/hexnan.c b/libc/upstream-openbsd/lib/libc/gdtoa/hexnan.c
index a443721..b47d499 100644
--- a/libc/upstream-openbsd/lib/libc/gdtoa/hexnan.c
+++ b/libc/upstream-openbsd/lib/libc/gdtoa/hexnan.c
@@ -62,7 +62,7 @@
int havedig, hd0, i, nbits;
if (!hexdig['0'])
- hexdig_init_D2A();
+ __hexdig_init_D2A();
nbits = fpi->nbits;
x = x0 + (nbits >> kshift);
if (nbits & kmask)
diff --git a/libc/upstream-openbsd/lib/libc/gdtoa/ldtoa.c b/libc/upstream-openbsd/lib/libc/gdtoa/ldtoa.c
index 16f6f9c..7282e7a 100644
--- a/libc/upstream-openbsd/lib/libc/gdtoa/ldtoa.c
+++ b/libc/upstream-openbsd/lib/libc/gdtoa/ldtoa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldtoa.c,v 1.2 2014/08/10 02:15:18 guenther Exp $ */
+/* $OpenBSD: ldtoa.c,v 1.4 2016/03/09 16:28:47 deraadt Exp $ */
/*-
* Copyright (c) 2003 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
@@ -26,9 +26,7 @@
*/
#include <sys/types.h>
-#ifndef __vax__
#include <machine/ieee.h>
-#endif /* !__vax__ */
#include <float.h>
#include <stdint.h>
#include <limits.h>
@@ -106,6 +104,7 @@
*decpt = INT_MAX;
return ret;
}
+DEF_STRONG(__ldtoa);
#else /* (LDBL_MANT_DIG == DBL_MANT_DIG) */
@@ -120,5 +119,6 @@
*decpt = INT_MAX;
return ret;
}
+DEF_STRONG(__ldtoa);
#endif /* (LDBL_MANT_DIG == DBL_MANT_DIG) */
diff --git a/libc/upstream-openbsd/lib/libc/gdtoa/misc.c b/libc/upstream-openbsd/lib/libc/gdtoa/misc.c
index 6ad706b..b149f07 100644
--- a/libc/upstream-openbsd/lib/libc/gdtoa/misc.c
+++ b/libc/upstream-openbsd/lib/libc/gdtoa/misc.c
@@ -98,9 +98,9 @@
if (v) {
if (v->k > Kmax)
#ifdef FREE
- FREE((void*)v);
+ FREE(v);
#else
- free((void*)v);
+ free(v);
#endif
else {
ACQUIRE_DTOA_LOCK(0);
@@ -876,6 +876,8 @@
#endif
};
+#ifdef NO_STRING_H
+
char *
#ifdef KR_headers
strcp_D2A(a, b) char *a; char *b;
@@ -888,8 +890,6 @@
return a;
}
-#ifdef NO_STRING_H
-
Char *
#ifdef KR_headers
memcpy_D2A(a, b, len) Char *a; Char *b; size_t len;
diff --git a/libc/upstream-openbsd/lib/libc/gdtoa/strtod.c b/libc/upstream-openbsd/lib/libc/gdtoa/strtod.c
index ded47d8..ac2283c 100644
--- a/libc/upstream-openbsd/lib/libc/gdtoa/strtod.c
+++ b/libc/upstream-openbsd/lib/libc/gdtoa/strtod.c
@@ -1102,4 +1102,4 @@
*se = (char *)s;
return sign ? -dval(&rv) : dval(&rv);
}
-
+DEF_STRONG(strtod);
diff --git a/libc/upstream-openbsd/lib/libc/gdtoa/strtof.c b/libc/upstream-openbsd/lib/libc/gdtoa/strtof.c
index 224491b..914e218 100644
--- a/libc/upstream-openbsd/lib/libc/gdtoa/strtof.c
+++ b/libc/upstream-openbsd/lib/libc/gdtoa/strtof.c
@@ -79,3 +79,4 @@
u.L[0] |= 0x80000000L;
return u.f;
}
+DEF_STRONG(strtof);
diff --git a/libc/upstream-openbsd/lib/libc/gen/alarm.c b/libc/upstream-openbsd/lib/libc/gen/alarm.c
index 2af847a..8bca23a 100644
--- a/libc/upstream-openbsd/lib/libc/gen/alarm.c
+++ b/libc/upstream-openbsd/lib/libc/gen/alarm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: alarm.c,v 1.7 2005/08/08 08:05:33 espie Exp $ */
+/* $OpenBSD: alarm.c,v 1.8 2016/01/28 16:40:54 schwarze Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -28,9 +28,6 @@
* SUCH DAMAGE.
*/
-/*
- * Backwards compatible alarm.
- */
#include <sys/time.h>
#include <unistd.h>
diff --git a/libc/upstream-openbsd/lib/libc/gen/ctype_.c b/libc/upstream-openbsd/lib/libc/gen/ctype_.c
index 89c8257..8972244 100644
--- a/libc/upstream-openbsd/lib/libc/gen/ctype_.c
+++ b/libc/upstream-openbsd/lib/libc/gen/ctype_.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ctype_.c,v 1.10 2011/09/22 09:06:10 stsp Exp $ */
+/* $OpenBSD: ctype_.c,v 1.12 2015/09/19 04:02:21 guenther Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
* All rights reserved.
@@ -74,3 +74,6 @@
};
const char *_ctype_ = _C_ctype_;
+#if 0
+DEF_STRONG(_ctype_);
+#endif
diff --git a/libc/upstream-openbsd/lib/libc/gen/ftok.c b/libc/upstream-openbsd/lib/libc/gen/ftok.c
index f9d6621..387b80f 100644
--- a/libc/upstream-openbsd/lib/libc/gen/ftok.c
+++ b/libc/upstream-openbsd/lib/libc/gen/ftok.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftok.c,v 1.7 2005/08/08 08:05:34 espie Exp $ */
+/* $OpenBSD: ftok.c,v 1.8 2014/11/15 22:38:47 guenther Exp $ */
/*
* Copyright (c) 1994 SigmaSoft, Th. Lockert <tholo@sigmasoft.com>
* All rights reserved.
@@ -26,7 +26,6 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ipc.h>
diff --git a/libc/upstream-openbsd/lib/libc/gen/getprogname.c b/libc/upstream-openbsd/lib/libc/gen/getprogname.c
index 17046ab..a020830 100644
--- a/libc/upstream-openbsd/lib/libc/gen/getprogname.c
+++ b/libc/upstream-openbsd/lib/libc/gen/getprogname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getprogname.c,v 1.3 2013/11/12 06:09:48 deraadt Exp $ */
+/* $OpenBSD: getprogname.c,v 1.4 2016/03/13 18:34:20 guenther Exp $ */
/*
* Copyright (c) 2013 Antoine Jacoutot <ajacoutot@openbsd.org>
*
@@ -17,8 +17,6 @@
#include <stdlib.h>
-extern const char *__progname;
-
const char *
getprogname(void)
{
diff --git a/libc/upstream-openbsd/lib/libc/gen/isctype.c b/libc/upstream-openbsd/lib/libc/gen/isctype.c
index 970b5e2..a4e944c 100644
--- a/libc/upstream-openbsd/lib/libc/gen/isctype.c
+++ b/libc/upstream-openbsd/lib/libc/gen/isctype.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isctype.c,v 1.11 2005/08/08 08:05:34 espie Exp $ */
+/* $OpenBSD: isctype.c,v 1.12 2015/09/13 11:38:08 guenther Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
* All rights reserved.
@@ -43,6 +43,7 @@
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_U|_L|_N)));
}
+DEF_STRONG(isalnum);
#undef isalpha
int
@@ -50,6 +51,7 @@
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_U|_L)));
}
+DEF_STRONG(isalpha);
#undef isblank
int
@@ -57,6 +59,7 @@
{
return (c == ' ' || c == '\t');
}
+DEF_STRONG(isblank);
#undef iscntrl
int
@@ -64,6 +67,7 @@
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _C));
}
+DEF_STRONG(iscntrl);
#undef isdigit
int
@@ -71,6 +75,7 @@
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _N));
}
+DEF_STRONG(isdigit);
#undef isgraph
int
@@ -78,6 +83,7 @@
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_P|_U|_L|_N)));
}
+DEF_STRONG(isgraph);
#undef islower
int
@@ -85,6 +91,7 @@
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _L));
}
+DEF_STRONG(islower);
#undef isprint
int
@@ -92,6 +99,7 @@
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_P|_U|_L|_N|_B)));
}
+DEF_STRONG(isprint);
#undef ispunct
int
@@ -99,6 +107,7 @@
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _P));
}
+DEF_STRONG(ispunct);
#undef isspace
int
@@ -106,6 +115,7 @@
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _S));
}
+DEF_STRONG(isspace);
#undef isupper
int
@@ -113,6 +123,7 @@
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _U));
}
+DEF_STRONG(isupper);
#undef isxdigit
int
@@ -120,6 +131,7 @@
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_N|_X)));
}
+DEF_STRONG(isxdigit);
#undef isascii
int
@@ -127,6 +139,7 @@
{
return ((unsigned int)c <= 0177);
}
+DEF_WEAK(isascii);
#undef toascii
int
diff --git a/libc/upstream-openbsd/lib/libc/gen/setprogname.c b/libc/upstream-openbsd/lib/libc/gen/setprogname.c
index 089a15a..ec3189f 100644
--- a/libc/upstream-openbsd/lib/libc/gen/setprogname.c
+++ b/libc/upstream-openbsd/lib/libc/gen/setprogname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: setprogname.c,v 1.4 2013/11/12 06:09:48 deraadt Exp $ */
+/* $OpenBSD: setprogname.c,v 1.5 2016/03/13 18:34:20 guenther Exp $ */
/*
* Copyright (c) 2013 Antoine Jacoutot <ajacoutot@openbsd.org>
*
@@ -18,8 +18,6 @@
#include <string.h>
#include <stdlib.h>
-extern const char *__progname;
-
void
setprogname(const char *progname)
{
diff --git a/libc/upstream-openbsd/lib/libc/gen/tolower_.c b/libc/upstream-openbsd/lib/libc/gen/tolower_.c
index 50dcc7b..2402c42 100644
--- a/libc/upstream-openbsd/lib/libc/gen/tolower_.c
+++ b/libc/upstream-openbsd/lib/libc/gen/tolower_.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tolower_.c,v 1.9 2005/08/08 08:05:34 espie Exp $ */
+/* $OpenBSD: tolower_.c,v 1.11 2015/09/19 04:02:21 guenther Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
@@ -46,6 +46,9 @@
};
const short *_tolower_tab_ = _C_tolower_;
+#if 0
+DEF_STRONG(_tolower_tab_);
+#endif
#undef tolower
int
@@ -55,3 +58,4 @@
return(c);
return((_tolower_tab_ + 1)[c]);
}
+DEF_STRONG(tolower);
diff --git a/libc/upstream-openbsd/lib/libc/gen/toupper_.c b/libc/upstream-openbsd/lib/libc/gen/toupper_.c
index 4093199..8408f9e 100644
--- a/libc/upstream-openbsd/lib/libc/gen/toupper_.c
+++ b/libc/upstream-openbsd/lib/libc/gen/toupper_.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: toupper_.c,v 1.10 2005/08/09 08:36:48 kevlo Exp $ */
+/* $OpenBSD: toupper_.c,v 1.12 2015/09/19 04:02:21 guenther Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
@@ -47,6 +47,9 @@
};
const short *_toupper_tab_ = _C_toupper_;
+#if 0
+DEF_STRONG(_toupper_tab_);
+#endif
#undef toupper
int
@@ -56,3 +59,4 @@
return(c);
return((_toupper_tab_ + 1)[c]);
}
+DEF_STRONG(toupper);
diff --git a/libc/upstream-openbsd/lib/libc/gen/verr.c b/libc/upstream-openbsd/lib/libc/gen/verr.c
index 8f4722b..b27b9ca 100644
--- a/libc/upstream-openbsd/lib/libc/gen/verr.c
+++ b/libc/upstream-openbsd/lib/libc/gen/verr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: verr.c,v 1.10 2015/08/31 02:53:57 guenther Exp $ */
+/* $OpenBSD: verr.c,v 1.11 2016/03/13 18:34:20 guenther Exp $ */
/*-
* Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
@@ -35,8 +35,6 @@
#include <string.h>
#include <stdarg.h>
-extern char *__progname; /* Program name, from crt0. */
-
__dead void
verr(int eval, const char *fmt, va_list ap)
{
diff --git a/libc/upstream-openbsd/lib/libc/gen/verrx.c b/libc/upstream-openbsd/lib/libc/gen/verrx.c
index f0186b6..0c9308f 100644
--- a/libc/upstream-openbsd/lib/libc/gen/verrx.c
+++ b/libc/upstream-openbsd/lib/libc/gen/verrx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: verrx.c,v 1.10 2015/08/31 02:53:57 guenther Exp $ */
+/* $OpenBSD: verrx.c,v 1.11 2016/03/13 18:34:20 guenther Exp $ */
/*-
* Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
@@ -33,8 +33,6 @@
#include <stdlib.h>
#include <stdarg.h>
-extern char *__progname; /* Program name, from crt0. */
-
__dead void
verrx(int eval, const char *fmt, va_list ap)
{
diff --git a/libc/upstream-openbsd/lib/libc/gen/vwarn.c b/libc/upstream-openbsd/lib/libc/gen/vwarn.c
index 44d8be4..457d619 100644
--- a/libc/upstream-openbsd/lib/libc/gen/vwarn.c
+++ b/libc/upstream-openbsd/lib/libc/gen/vwarn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vwarn.c,v 1.10 2015/08/31 02:53:57 guenther Exp $ */
+/* $OpenBSD: vwarn.c,v 1.11 2016/03/13 18:34:20 guenther Exp $ */
/*-
* Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
@@ -31,11 +31,10 @@
#include <err.h>
#include <errno.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
-extern char *__progname; /* Program name, from crt0. */
-
void
vwarn(const char *fmt, va_list ap)
{
diff --git a/libc/upstream-openbsd/lib/libc/gen/vwarnx.c b/libc/upstream-openbsd/lib/libc/gen/vwarnx.c
index 67d8f5b..146e267 100644
--- a/libc/upstream-openbsd/lib/libc/gen/vwarnx.c
+++ b/libc/upstream-openbsd/lib/libc/gen/vwarnx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vwarnx.c,v 1.10 2015/08/31 02:53:57 guenther Exp $ */
+/* $OpenBSD: vwarnx.c,v 1.11 2016/03/13 18:34:20 guenther Exp $ */
/*-
* Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
@@ -30,10 +30,9 @@
#include <err.h>
#include <stdio.h>
+#include <stdlib.h>
#include <stdarg.h>
-extern char *__progname; /* Program name, from crt0. */
-
void
vwarnx(const char *fmt, va_list ap)
{
diff --git a/libc/upstream-openbsd/lib/libc/include/ctype_private.h b/libc/upstream-openbsd/lib/libc/include/ctype_private.h
index 39cc792..cbe1b20 100644
--- a/libc/upstream-openbsd/lib/libc/include/ctype_private.h
+++ b/libc/upstream-openbsd/lib/libc/include/ctype_private.h
@@ -1,7 +1,9 @@
-/* $OpenBSD: ctype_private.h,v 1.1 2005/08/08 05:53:00 espie Exp $ */
+/* $OpenBSD: ctype_private.h,v 1.2 2015/08/27 04:37:09 guenther Exp $ */
/* Written by Marc Espie, public domain */
#define CTYPE_NUM_CHARS 256
+
+__BEGIN_HIDDEN_DECLS
extern const char _C_ctype_[];
extern const short _C_toupper_[];
extern const short _C_tolower_[];
-
+__END_HIDDEN_DECLS
diff --git a/libc/upstream-openbsd/lib/libc/locale/_wcstol.h b/libc/upstream-openbsd/lib/libc/locale/_wcstol.h
index 7b49bbf..1b60a3a 100644
--- a/libc/upstream-openbsd/lib/libc/locale/_wcstol.h
+++ b/libc/upstream-openbsd/lib/libc/locale/_wcstol.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: _wcstol.h,v 1.1 2005/07/01 08:59:27 espie Exp $ */
+/* $OpenBSD: _wcstol.h,v 1.3 2015/10/01 02:32:07 guenther Exp $ */
/* $NetBSD: _wcstol.h,v 1.2 2003/08/07 16:43:03 agc Exp $ */
/*-
@@ -130,7 +130,7 @@
}
}
if (endptr != 0)
- /* LINTED interface specification */
*endptr = (wchar_t *)(any ? s - 1 : nptr);
return (acc);
}
+DEF_STRONG(FUNCNAME);
diff --git a/libc/upstream-openbsd/lib/libc/locale/_wcstoul.h b/libc/upstream-openbsd/lib/libc/locale/_wcstoul.h
index 736b38f..159b22b 100644
--- a/libc/upstream-openbsd/lib/libc/locale/_wcstoul.h
+++ b/libc/upstream-openbsd/lib/libc/locale/_wcstoul.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: _wcstoul.h,v 1.1 2005/07/01 08:59:27 espie Exp $ */
+/* $OpenBSD: _wcstoul.h,v 1.3 2015/10/01 02:32:07 guenther Exp $ */
/* $NetBSD: _wcstoul.h,v 1.2 2003/08/07 16:43:03 agc Exp $ */
/*
@@ -110,7 +110,7 @@
if (neg && any > 0)
acc = -acc;
if (endptr != 0)
- /* LINTED interface specification */
*endptr = (wchar_t *)(any ? s - 1 : nptr);
return (acc);
}
+DEF_STRONG(FUNCNAME);
diff --git a/libc/upstream-openbsd/lib/libc/locale/btowc.c b/libc/upstream-openbsd/lib/libc/locale/btowc.c
index 9627340..455b346 100644
--- a/libc/upstream-openbsd/lib/libc/locale/btowc.c
+++ b/libc/upstream-openbsd/lib/libc/locale/btowc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: btowc.c,v 1.2 2012/12/05 23:20:00 deraadt Exp $ */
+/* $OpenBSD: btowc.c,v 1.3 2015/09/12 16:23:14 guenther Exp $ */
/*-
* Copyright (c) 2002, 2003 Tim J. Robbins.
@@ -50,3 +50,4 @@
return (WEOF);
return (wc);
}
+DEF_STRONG(btowc);
diff --git a/libc/upstream-openbsd/lib/libc/locale/mbrlen.c b/libc/upstream-openbsd/lib/libc/locale/mbrlen.c
index 0f05bd0..52df61a 100644
--- a/libc/upstream-openbsd/lib/libc/locale/mbrlen.c
+++ b/libc/upstream-openbsd/lib/libc/locale/mbrlen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mbrlen.c,v 1.2 2012/12/05 23:20:00 deraadt Exp $ */
+/* $OpenBSD: mbrlen.c,v 1.3 2015/09/12 16:23:14 guenther Exp $ */
/*-
* Copyright (c) 2002-2004 Tim J. Robbins.
@@ -37,3 +37,4 @@
ps = &mbs;
return (mbrtowc(NULL, s, n, ps));
}
+DEF_STRONG(mbrlen);
diff --git a/libc/upstream-openbsd/lib/libc/locale/wctob.c b/libc/upstream-openbsd/lib/libc/locale/wctob.c
index ea1f40c..51ac355 100644
--- a/libc/upstream-openbsd/lib/libc/locale/wctob.c
+++ b/libc/upstream-openbsd/lib/libc/locale/wctob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wctob.c,v 1.2 2012/12/05 23:20:00 deraadt Exp $ */
+/* $OpenBSD: wctob.c,v 1.3 2015/09/12 16:23:14 guenther Exp $ */
/*-
* Copyright (c) 2002-2004 Tim J. Robbins.
* All rights reserved.
@@ -41,3 +41,4 @@
return (EOF);
return ((unsigned char)*buf);
}
+DEF_STRONG(wctob);
diff --git a/libc/upstream-openbsd/lib/libc/locale/wctoint.h b/libc/upstream-openbsd/lib/libc/locale/wctoint.h
index c9bf084..ea50c5a 100644
--- a/libc/upstream-openbsd/lib/libc/locale/wctoint.h
+++ b/libc/upstream-openbsd/lib/libc/locale/wctoint.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wctoint.h,v 1.1 2005/07/01 08:59:27 espie Exp $ */
+/* $OpenBSD: wctoint.h,v 1.2 2015/09/13 11:38:08 guenther Exp $ */
/* $NetBSD: __wctoint.h,v 1.1 2001/09/28 11:25:37 yamt Exp $ */
/*-
@@ -30,7 +30,7 @@
*/
-__inline static int
+inline static int
wctoint(wchar_t wc)
{
int n;
diff --git a/libc/upstream-openbsd/lib/libc/net/inet_lnaof.c b/libc/upstream-openbsd/lib/libc/net/inet_lnaof.c
index b1a58cd..9284538 100644
--- a/libc/upstream-openbsd/lib/libc/net/inet_lnaof.c
+++ b/libc/upstream-openbsd/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/libc/upstream-openbsd/lib/libc/net/inet_makeaddr.c b/libc/upstream-openbsd/lib/libc/net/inet_makeaddr.c
index 87d9325..88ddd28 100644
--- a/libc/upstream-openbsd/lib/libc/net/inet_makeaddr.c
+++ b/libc/upstream-openbsd/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/libc/upstream-openbsd/lib/libc/net/inet_netof.c b/libc/upstream-openbsd/lib/libc/net/inet_netof.c
index 2f468c3..4efceed 100644
--- a/libc/upstream-openbsd/lib/libc/net/inet_netof.c
+++ b/libc/upstream-openbsd/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/libc/upstream-openbsd/lib/libc/net/inet_ntop.c b/libc/upstream-openbsd/lib/libc/net/inet_ntop.c
index f991a07..2bb11c2 100644
--- a/libc/upstream-openbsd/lib/libc/net/inet_ntop.c
+++ b/libc/upstream-openbsd/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.13 2016/09/21 04:38:56 guenther 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>
@@ -47,15 +46,16 @@
{
switch (af) {
case AF_INET:
- return (inet_ntop4(src, dst, (size_t)size));
+ return (inet_ntop4(src, dst, size));
case AF_INET6:
- return (inet_ntop6(src, dst, (size_t)size));
+ return (inet_ntop6(src, dst, size));
default:
errno = EAFNOSUPPORT;
return (NULL);
}
/* NOTREACHED */
}
+DEF_WEAK(inet_ntop);
/* const char *
* inet_ntop4(src, dst, size)
@@ -167,7 +167,7 @@
/* Is this address an encapsulated IPv4? */
if (i == 6 && best.base == 0 &&
(best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
- if (!inet_ntop4(src+12, tp, (size_t)(ep - tp)))
+ if (!inet_ntop4(src+12, tp, ep - tp))
return (NULL);
tp += strlen(tp);
break;
diff --git a/libc/upstream-openbsd/lib/libc/net/inet_pton.c b/libc/upstream-openbsd/lib/libc/net/inet_pton.c
index 7e521c3..5d7148e 100644
--- a/libc/upstream-openbsd/lib/libc/net/inet_pton.c
+++ b/libc/upstream-openbsd/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.10 2015/09/13 21:36:08 guenther 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>
@@ -58,6 +57,7 @@
}
/* NOTREACHED */
}
+DEF_WEAK(inet_pton);
/* int
* inet_pton4(src, dst)
diff --git a/libc/upstream-openbsd/lib/libc/stdio/fflush.c b/libc/upstream-openbsd/lib/libc/stdio/fflush.c
index 3e30f10..fd1a4b3 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/fflush.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/fflush.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fflush.c,v 1.8 2009/11/09 00:18:27 kurt Exp $ */
+/* $OpenBSD: fflush.c,v 1.9 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -52,6 +52,7 @@
FUNLOCKFILE(fp);
return (r);
}
+DEF_STRONG(fflush);
int
__sflush(FILE *fp)
diff --git a/libc/upstream-openbsd/lib/libc/stdio/fgets.c b/libc/upstream-openbsd/lib/libc/stdio/fgets.c
index 345884a..3cea8f7 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/fgets.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/fgets.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fgets.c,v 1.14 2009/11/09 00:18:27 kurt Exp $ */
+/* $OpenBSD: fgets.c,v 1.16 2016/09/21 04:38:56 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -83,19 +83,19 @@
*/
if (len > n)
len = n;
- t = memchr((void *)p, '\n', len);
+ t = memchr(p, '\n', len);
if (t != NULL) {
len = ++t - p;
fp->_r -= len;
fp->_p = t;
- (void)memcpy((void *)s, (void *)p, len);
+ (void)memcpy(s, p, len);
s[len] = '\0';
FUNLOCKFILE(fp);
return (buf);
}
fp->_r -= len;
fp->_p += len;
- (void)memcpy((void *)s, (void *)p, len);
+ (void)memcpy(s, p, len);
s += len;
n -= len;
}
@@ -103,3 +103,4 @@
FUNLOCKFILE(fp);
return (buf);
}
+DEF_STRONG(fgets);
diff --git a/libc/upstream-openbsd/lib/libc/stdio/fmemopen.c b/libc/upstream-openbsd/lib/libc/stdio/fmemopen.c
index 8cda047..00c2764 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/fmemopen.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/fmemopen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fmemopen.c,v 1.2 2013/03/27 15:06:25 mpi Exp $ */
+/* $OpenBSD: fmemopen.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org>
@@ -181,3 +181,4 @@
return (fp);
}
+DEF_WEAK(fmemopen);
diff --git a/libc/upstream-openbsd/lib/libc/stdio/fpurge.c b/libc/upstream-openbsd/lib/libc/stdio/fpurge.c
index 65bd749..8dd8a91 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/fpurge.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/fpurge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fpurge.c,v 1.9 2009/11/09 00:18:27 kurt Exp $ */
+/* $OpenBSD: fpurge.c,v 1.10 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -59,3 +59,4 @@
FUNLOCKFILE(fp);
return (0);
}
+DEF_WEAK(fpurge);
diff --git a/libc/upstream-openbsd/lib/libc/stdio/fputs.c b/libc/upstream-openbsd/lib/libc/stdio/fputs.c
index ea8556a..05ead5c 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/fputs.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/fputs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fputs.c,v 1.10 2009/11/09 00:18:27 kurt Exp $ */
+/* $OpenBSD: fputs.c,v 1.11 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -56,3 +56,4 @@
FUNLOCKFILE(fp);
return (ret);
}
+DEF_STRONG(fputs);
diff --git a/libc/upstream-openbsd/lib/libc/stdio/fputws.c b/libc/upstream-openbsd/lib/libc/stdio/fputws.c
index 108846e..8961571 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/fputws.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/fputws.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fputws.c,v 1.7 2013/11/12 07:04:35 deraadt Exp $ */
+/* $OpenBSD: fputws.c,v 1.8 2015/08/31 02:53:57 guenther Exp $ */
/* $NetBSD: fputws.c,v 1.1 2003/03/07 07:11:37 tshiozak Exp $ */
/*-
@@ -55,3 +55,4 @@
return (0);
}
+DEF_STRONG(fputws);
diff --git a/libc/upstream-openbsd/lib/libc/stdio/fvwrite.h b/libc/upstream-openbsd/lib/libc/stdio/fvwrite.h
index d3a309b..f04565b 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/fvwrite.h
+++ b/libc/upstream-openbsd/lib/libc/stdio/fvwrite.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: fvwrite.h,v 1.6 2013/11/12 07:04:35 deraadt Exp $ */
+/* $OpenBSD: fvwrite.h,v 1.7 2015/08/27 04:37:09 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -45,5 +45,7 @@
int uio_resid;
};
+__BEGIN_HIDDEN_DECLS
extern int __sfvwrite(FILE *, struct __suio *);
wint_t __fputwc_unlock(wchar_t wc, FILE *fp);
+__END_HIDDEN_DECLS
diff --git a/libc/upstream-openbsd/lib/libc/stdio/fwalk.c b/libc/upstream-openbsd/lib/libc/stdio/fwalk.c
index 8ac6628..4b1aa43 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/fwalk.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/fwalk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fwalk.c,v 1.10 2009/11/09 00:18:27 kurt Exp $ */
+/* $OpenBSD: fwalk.c,v 1.12 2016/05/23 00:21:48 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/libc/upstream-openbsd/lib/libc/stdio/fwide.c b/libc/upstream-openbsd/lib/libc/stdio/fwide.c
index 93cddc6..27ca0f8 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/fwide.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/fwide.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fwide.c,v 1.4 2009/11/09 00:18:27 kurt Exp $ */
+/* $OpenBSD: fwide.c,v 1.5 2015/08/31 02:53:57 guenther Exp $ */
/* $NetBSD: fwide.c,v 1.2 2003/01/18 11:29:54 thorpej Exp $ */
/*-
@@ -62,3 +62,4 @@
return mode;
}
+DEF_STRONG(fwide);
diff --git a/libc/upstream-openbsd/lib/libc/stdio/fwrite.c b/libc/upstream-openbsd/lib/libc/stdio/fwrite.c
index c72d968..f829398 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/fwrite.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/fwrite.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fwrite.c,v 1.11 2014/05/01 16:40:36 deraadt Exp $ */
+/* $OpenBSD: fwrite.c,v 1.12 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -86,3 +86,4 @@
return (count);
return ((n - uio.uio_resid) / size);
}
+DEF_STRONG(fwrite);
diff --git a/libc/upstream-openbsd/lib/libc/stdio/mktemp.c b/libc/upstream-openbsd/lib/libc/stdio/mktemp.c
index 956608c..4b81d5d 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/mktemp.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/mktemp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mktemp.c,v 1.35 2014/10/31 15:54:14 millert Exp $ */
+/* $OpenBSD: mktemp.c,v 1.38 2015/09/13 08:31:47 guenther Exp $ */
/*
* Copyright (c) 1996-1998, 2008 Theo de Raadt
* Copyright (c) 1997, 2008-2009 Todd C. Miller
@@ -110,8 +110,6 @@
return(-1);
}
-char *_mktemp(char *);
-
char *
_mktemp(char *path)
{
@@ -140,12 +138,14 @@
{
return(mktemp_internal(path, 0, MKTEMP_FILE, 0));
}
+DEF_WEAK(mkstemp);
int
mkostemp(char *path, int flags)
{
return(mktemp_internal(path, 0, MKTEMP_FILE, flags));
}
+DEF_WEAK(mkostemp);
int
mkstemps(char *path, int slen)
diff --git a/libc/upstream-openbsd/lib/libc/stdio/perror.c b/libc/upstream-openbsd/lib/libc/stdio/perror.c
index 8728718..fdd6120 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/perror.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/perror.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: perror.c,v 1.8 2005/08/08 08:05:36 espie Exp $ */
+/* $OpenBSD: perror.c,v 1.9 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
@@ -60,3 +60,4 @@
v->iov_len = 1;
(void)writev(STDERR_FILENO, iov, (v - iov) + 1);
}
+DEF_STRONG(perror);
diff --git a/libc/upstream-openbsd/lib/libc/stdio/puts.c b/libc/upstream-openbsd/lib/libc/stdio/puts.c
index 655aed7..57d4b78 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/puts.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/puts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: puts.c,v 1.11 2009/11/21 09:53:44 guenther Exp $ */
+/* $OpenBSD: puts.c,v 1.12 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -60,3 +60,4 @@
FUNLOCKFILE(stdout);
return (ret ? EOF : '\n');
}
+DEF_STRONG(puts);
diff --git a/libc/upstream-openbsd/lib/libc/stdio/rget.c b/libc/upstream-openbsd/lib/libc/stdio/rget.c
index 4cd97cb..368815b 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/rget.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/rget.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rget.c,v 1.7 2005/08/08 08:05:36 espie Exp $ */
+/* $OpenBSD: rget.c,v 1.8 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -49,3 +49,4 @@
}
return (EOF);
}
+DEF_STRONG(__srget);
diff --git a/libc/upstream-openbsd/lib/libc/stdio/setvbuf.c b/libc/upstream-openbsd/lib/libc/stdio/setvbuf.c
index 9b2ab57..da68b90 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/setvbuf.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/setvbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: setvbuf.c,v 1.12 2015/01/13 07:18:21 guenther Exp $ */
+/* $OpenBSD: setvbuf.c,v 1.14 2016/09/21 04:38:56 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -70,7 +70,7 @@
fp->_r = fp->_lbfsize = 0;
flags = fp->_flags;
if (flags & __SMBF)
- free((void *)fp->_bf._base);
+ free(fp->_bf._base);
flags &= ~(__SLBF | __SNBF | __SMBF | __SOPT | __SNPT | __SEOF);
/* If setting unbuffered mode, skip all the hard work. */
@@ -157,3 +157,4 @@
return (ret);
}
+DEF_STRONG(setvbuf);
diff --git a/libc/upstream-openbsd/lib/libc/stdio/tmpnam.c b/libc/upstream-openbsd/lib/libc/stdio/tmpnam.c
index 32e0a22..d6dc10e 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/tmpnam.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/tmpnam.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmpnam.c,v 1.10 2005/08/08 08:05:36 espie Exp $ */
+/* $OpenBSD: tmpnam.c,v 1.11 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
* The Regents of the University of California. All rights reserved.
@@ -39,8 +39,6 @@
__warn_references(tmpnam,
"warning: tmpnam() possibly used unsafely; consider using mkstemp()");
-extern char *_mktemp(char *);
-
char *
tmpnam(char *s)
{
diff --git a/libc/upstream-openbsd/lib/libc/stdio/ungetc.c b/libc/upstream-openbsd/lib/libc/stdio/ungetc.c
index ec98f26..4cd638b 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/ungetc.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/ungetc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ungetc.c,v 1.13 2014/10/11 04:05:10 deraadt Exp $ */
+/* $OpenBSD: ungetc.c,v 1.15 2016/09/21 04:38:56 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -53,7 +53,7 @@
/*
* Get a new buffer (rather than expanding the old one).
*/
- if ((p = malloc((size_t)BUFSIZ)) == NULL)
+ if ((p = malloc(BUFSIZ)) == NULL)
return (EOF);
_UB(fp)._base = p;
_UB(fp)._size = BUFSIZ;
@@ -68,7 +68,7 @@
if (p == NULL)
return (EOF);
/* no overlap (hence can use memcpy) because we doubled the size */
- (void)memcpy((void *)(p + i), (void *)p, (size_t)i);
+ (void)memcpy(p + i, p, i);
fp->_p = p + i;
_UB(fp)._base = p;
_UB(fp)._size = i * 2;
@@ -143,3 +143,4 @@
FUNLOCKFILE(fp);
return (c);
}
+DEF_STRONG(ungetc);
diff --git a/libc/upstream-openbsd/lib/libc/stdio/ungetwc.c b/libc/upstream-openbsd/lib/libc/stdio/ungetwc.c
index c0321e9..9b312df 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/ungetwc.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/ungetwc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ungetwc.c,v 1.5 2011/10/16 13:20:51 stsp Exp $ */
+/* $OpenBSD: ungetwc.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/* $NetBSD: ungetwc.c,v 1.2 2003/01/18 11:29:59 thorpej Exp $ */
/*-
@@ -75,3 +75,4 @@
FUNLOCKFILE(fp);
return (r);
}
+DEF_STRONG(ungetwc);
diff --git a/libc/upstream-openbsd/lib/libc/stdio/vdprintf.c b/libc/upstream-openbsd/lib/libc/stdio/vdprintf.c
index 49c1969..e76fcd4 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/vdprintf.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/vdprintf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vdprintf.c,v 1.1 2013/01/30 00:08:13 brad Exp $ */
+/* $OpenBSD: vdprintf.c,v 1.2 2015/08/31 02:53:57 guenther Exp $ */
/* $FreeBSD: src/lib/libc/stdio/vdprintf.c,v 1.4 2012/11/17 01:49:40 svnexp Exp $ */
/*-
@@ -71,3 +71,4 @@
return fflush(&f) ? EOF : ret;
}
+DEF_WEAK(vdprintf);
diff --git a/libc/upstream-openbsd/lib/libc/stdio/vsscanf.c b/libc/upstream-openbsd/lib/libc/stdio/vsscanf.c
index 71eb752..86e0b4c 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/vsscanf.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/vsscanf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vsscanf.c,v 1.12 2011/11/08 18:30:42 guenther Exp $ */
+/* $OpenBSD: vsscanf.c,v 1.13 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +35,6 @@
#include <string.h>
#include "local.h"
-/* ARGSUSED */
static int
eofread(void *cookie, char *buf, int len)
{
@@ -57,3 +56,4 @@
f._lb._base = NULL;
return (__svfscanf(&f, fmt, ap));
}
+DEF_STRONG(vsscanf);
diff --git a/libc/upstream-openbsd/lib/libc/stdio/vswscanf.c b/libc/upstream-openbsd/lib/libc/stdio/vswscanf.c
index cbaa250..e87dfeb 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/vswscanf.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/vswscanf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vswscanf.c,v 1.2 2012/12/05 23:20:01 deraadt Exp $ */
+/* $OpenBSD: vswscanf.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -86,3 +86,4 @@
return (r);
}
+DEF_STRONG(vswscanf);
diff --git a/libc/upstream-openbsd/lib/libc/stdio/wbuf.c b/libc/upstream-openbsd/lib/libc/stdio/wbuf.c
index 6aa00e1..2d07750 100644
--- a/libc/upstream-openbsd/lib/libc/stdio/wbuf.c
+++ b/libc/upstream-openbsd/lib/libc/stdio/wbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wbuf.c,v 1.12 2009/11/09 00:18:28 kurt Exp $ */
+/* $OpenBSD: wbuf.c,v 1.13 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -82,3 +82,4 @@
return (EOF);
return (c);
}
+DEF_STRONG(__swbuf);
diff --git a/libc/upstream-openbsd/lib/libc/stdlib/abs.c b/libc/upstream-openbsd/lib/libc/stdlib/abs.c
index 5d2fbae..0e39cc5 100644
--- a/libc/upstream-openbsd/lib/libc/stdlib/abs.c
+++ b/libc/upstream-openbsd/lib/libc/stdlib/abs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: abs.c,v 1.5 2005/08/08 08:05:36 espie Exp $ */
+/* $OpenBSD: abs.c,v 1.6 2015/09/13 08:31:47 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -35,3 +35,4 @@
{
return(j < 0 ? -j : j);
}
+DEF_STRONG(abs);
diff --git a/libc/upstream-openbsd/lib/libc/stdlib/atoi.c b/libc/upstream-openbsd/lib/libc/stdlib/atoi.c
index b084267..7c9eb13 100644
--- a/libc/upstream-openbsd/lib/libc/stdlib/atoi.c
+++ b/libc/upstream-openbsd/lib/libc/stdlib/atoi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atoi.c,v 1.5 2005/08/08 08:05:36 espie Exp $ */
+/* $OpenBSD: atoi.c,v 1.6 2015/09/13 08:31:47 guenther Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
@@ -35,3 +35,4 @@
{
return((int)strtol(str, (char **)NULL, 10));
}
+DEF_STRONG(atoi);
diff --git a/libc/upstream-openbsd/lib/libc/stdlib/tfind.c b/libc/upstream-openbsd/lib/libc/stdlib/tfind.c
index 0d1d519..49f9dbc 100644
--- a/libc/upstream-openbsd/lib/libc/stdlib/tfind.c
+++ b/libc/upstream-openbsd/lib/libc/stdlib/tfind.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tfind.c,v 1.6 2014/03/16 18:38:30 guenther Exp $ */
+/* $OpenBSD: tfind.c,v 1.7 2015/09/26 16:03:48 guenther Exp $ */
/*
* Tree search generalized from Knuth (6.2.2) Algorithm T just like
@@ -10,7 +10,6 @@
*
* Totally public domain.
*/
-/*LINTLIBRARY*/
#include <search.h>
typedef struct node_t
diff --git a/libc/upstream-openbsd/lib/libc/stdlib/tsearch.c b/libc/upstream-openbsd/lib/libc/stdlib/tsearch.c
index a141085..1dd3145 100644
--- a/libc/upstream-openbsd/lib/libc/stdlib/tsearch.c
+++ b/libc/upstream-openbsd/lib/libc/stdlib/tsearch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tsearch.c,v 1.8 2014/03/16 18:38:30 guenther Exp $ */
+/* $OpenBSD: tsearch.c,v 1.10 2015/09/26 16:03:48 guenther Exp $ */
/*
* Tree search generalized from Knuth (6.2.2) Algorithm T just like
@@ -10,7 +10,6 @@
*
* Totally public domain.
*/
-/*LINTLIBRARY*/
#include <search.h>
#include <stdlib.h>
@@ -40,7 +39,7 @@
&(*rootp)->left : /* T3: follow left branch */
&(*rootp)->right; /* T4: follow right branch */
}
- q = (node *) malloc(sizeof(node)); /* T5: key not found */
+ q = malloc(sizeof(node)); /* T5: key not found */
if (q != (struct node_t *)0) { /* make new node */
*rootp = q; /* link new node to old */
q->key = key; /* initialize new node */
diff --git a/libc/upstream-openbsd/lib/libc/string/memchr.c b/libc/upstream-openbsd/lib/libc/string/memchr.c
index 05a1197..976ed21 100644
--- a/libc/upstream-openbsd/lib/libc/string/memchr.c
+++ b/libc/upstream-openbsd/lib/libc/string/memchr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memchr.c,v 1.7 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: memchr.c,v 1.8 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -34,7 +34,8 @@
#include <string.h>
void *
-memchr(const void *s, int c, size_t n) __overloadable {
+memchr(const void *s, int c, size_t n) __overloadable
+{
if (n != 0) {
const unsigned char *p = s;
@@ -45,3 +46,4 @@
}
return (NULL);
}
+DEF_STRONG(memchr);
diff --git a/libc/upstream-openbsd/lib/libc/string/memmove.c b/libc/upstream-openbsd/lib/libc/string/memmove.c
index 910f48c..6b5db47 100644
--- a/libc/upstream-openbsd/lib/libc/string/memmove.c
+++ b/libc/upstream-openbsd/lib/libc/string/memmove.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memmove.c,v 1.1 2014/11/30 19:43:56 deraadt Exp $ */
+/* $OpenBSD: memmove.c,v 1.2 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -110,3 +110,4 @@
done:
return (dst0);
}
+DEF_STRONG(memmove);
diff --git a/libc/upstream-openbsd/lib/libc/string/memrchr.c b/libc/upstream-openbsd/lib/libc/string/memrchr.c
index 1cce809..4b67503 100644
--- a/libc/upstream-openbsd/lib/libc/string/memrchr.c
+++ b/libc/upstream-openbsd/lib/libc/string/memrchr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memrchr.c,v 1.2 2007/11/27 16:22:12 martynas Exp $ */
+/* $OpenBSD: memrchr.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 2007 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -36,3 +36,4 @@
}
return(NULL);
}
+DEF_WEAK(memrchr);
diff --git a/libc/upstream-openbsd/lib/libc/string/stpncpy.c b/libc/upstream-openbsd/lib/libc/string/stpncpy.c
index 661a4fd..f30bf15 100644
--- a/libc/upstream-openbsd/lib/libc/string/stpncpy.c
+++ b/libc/upstream-openbsd/lib/libc/string/stpncpy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: stpncpy.c,v 1.2 2012/07/11 10:44:59 naddy Exp $ */
+/* $OpenBSD: stpncpy.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -54,3 +54,4 @@
}
return (dst);
}
+DEF_WEAK(stpncpy);
diff --git a/libc/upstream-openbsd/lib/libc/string/strcasecmp.c b/libc/upstream-openbsd/lib/libc/string/strcasecmp.c
index 2be0913..edbd638 100644
--- a/libc/upstream-openbsd/lib/libc/string/strcasecmp.c
+++ b/libc/upstream-openbsd/lib/libc/string/strcasecmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strcasecmp.c,v 1.6 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strcasecmp.c,v 1.7 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -85,6 +85,7 @@
return (0);
return (cm[*us1] - cm[*--us2]);
}
+DEF_WEAK(strcasecmp);
int
strncasecmp(const char *s1, const char *s2, size_t n)
@@ -103,3 +104,4 @@
}
return (0);
}
+DEF_WEAK(strncasecmp);
diff --git a/libc/upstream-openbsd/lib/libc/string/strcmp.c b/libc/upstream-openbsd/lib/libc/string/strcmp.c
index d1b6c50..be17556 100644
--- a/libc/upstream-openbsd/lib/libc/string/strcmp.c
+++ b/libc/upstream-openbsd/lib/libc/string/strcmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strcmp.c,v 1.8 2014/06/10 04:17:37 deraadt Exp $ */
+/* $OpenBSD: strcmp.c,v 1.9 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -45,3 +45,4 @@
return (0);
return (*(unsigned char *)s1 - *(unsigned char *)--s2);
}
+DEF_STRONG(strcmp);
diff --git a/libc/upstream-openbsd/lib/libc/string/strcspn.c b/libc/upstream-openbsd/lib/libc/string/strcspn.c
index 1eb2336..3c1f5a4 100644
--- a/libc/upstream-openbsd/lib/libc/string/strcspn.c
+++ b/libc/upstream-openbsd/lib/libc/string/strcspn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strcspn.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strcspn.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -56,3 +56,4 @@
}
/* NOTREACHED */
}
+DEF_STRONG(strcspn);
diff --git a/libc/upstream-openbsd/lib/libc/string/strdup.c b/libc/upstream-openbsd/lib/libc/string/strdup.c
index a6aa1e0..9aebf39 100644
--- a/libc/upstream-openbsd/lib/libc/string/strdup.c
+++ b/libc/upstream-openbsd/lib/libc/string/strdup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strdup.c,v 1.6 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strdup.c,v 1.7 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -47,3 +47,4 @@
(void)memcpy(copy, str, siz);
return(copy);
}
+DEF_WEAK(strdup);
diff --git a/libc/upstream-openbsd/lib/libc/string/strlcat.c b/libc/upstream-openbsd/lib/libc/string/strlcat.c
index 7bf98aa..8a950f5 100644
--- a/libc/upstream-openbsd/lib/libc/string/strlcat.c
+++ b/libc/upstream-openbsd/lib/libc/string/strlcat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strlcat.c,v 1.16 2015/08/31 02:53:57 guenther Exp $ */
+/* $OpenBSD: strlcat.c,v 1.18 2016/10/16 17:37:39 dtucker Exp $ */
/*
* Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com>
diff --git a/libc/upstream-openbsd/lib/libc/string/strlcpy.c b/libc/upstream-openbsd/lib/libc/string/strlcpy.c
index a5343b8..647b18b 100644
--- a/libc/upstream-openbsd/lib/libc/string/strlcpy.c
+++ b/libc/upstream-openbsd/lib/libc/string/strlcpy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strlcpy.c,v 1.13 2015/08/31 02:53:57 guenther Exp $ */
+/* $OpenBSD: strlcpy.c,v 1.15 2016/10/16 17:37:39 dtucker Exp $ */
/*
* Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com>
diff --git a/libc/upstream-openbsd/lib/libc/string/strncat.c b/libc/upstream-openbsd/lib/libc/string/strncat.c
index 32334b3..5b07749 100644
--- a/libc/upstream-openbsd/lib/libc/string/strncat.c
+++ b/libc/upstream-openbsd/lib/libc/string/strncat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strncat.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strncat.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -55,3 +55,4 @@
}
return (dst);
}
+DEF_STRONG(strncat);
diff --git a/libc/upstream-openbsd/lib/libc/string/strncmp.c b/libc/upstream-openbsd/lib/libc/string/strncmp.c
index 0a4ddc1..535d2a6 100644
--- a/libc/upstream-openbsd/lib/libc/string/strncmp.c
+++ b/libc/upstream-openbsd/lib/libc/string/strncmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strncmp.c,v 1.8 2014/06/10 04:17:37 deraadt Exp $ */
+/* $OpenBSD: strncmp.c,v 1.9 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -45,3 +45,4 @@
} while (--n != 0);
return (0);
}
+DEF_STRONG(strncmp);
diff --git a/libc/upstream-openbsd/lib/libc/string/strncpy.c b/libc/upstream-openbsd/lib/libc/string/strncpy.c
index e83c7e5..ad9dc84 100644
--- a/libc/upstream-openbsd/lib/libc/string/strncpy.c
+++ b/libc/upstream-openbsd/lib/libc/string/strncpy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strncpy.c,v 1.7 2014/06/10 04:17:37 deraadt Exp $ */
+/* $OpenBSD: strncpy.c,v 1.8 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -56,3 +56,4 @@
}
return (dst);
}
+DEF_STRONG(strncpy);
diff --git a/libc/upstream-openbsd/lib/libc/string/strndup.c b/libc/upstream-openbsd/lib/libc/string/strndup.c
index 27701ac..a6e5bff 100644
--- a/libc/upstream-openbsd/lib/libc/string/strndup.c
+++ b/libc/upstream-openbsd/lib/libc/string/strndup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strndup.c,v 1.1 2010/05/18 22:24:55 tedu Exp $ */
+/* $OpenBSD: strndup.c,v 1.2 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 2010 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -37,3 +37,4 @@
return copy;
}
+DEF_WEAK(strndup);
diff --git a/libc/upstream-openbsd/lib/libc/string/strpbrk.c b/libc/upstream-openbsd/lib/libc/string/strpbrk.c
index cd3b71c..336c22d 100644
--- a/libc/upstream-openbsd/lib/libc/string/strpbrk.c
+++ b/libc/upstream-openbsd/lib/libc/string/strpbrk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strpbrk.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strpbrk.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 1985 Regents of the University of California.
* All rights reserved.
@@ -46,3 +46,4 @@
}
return (NULL);
}
+DEF_STRONG(strpbrk);
diff --git a/libc/upstream-openbsd/lib/libc/string/strsep.c b/libc/upstream-openbsd/lib/libc/string/strsep.c
index 2ffc4b4..97c3cbf 100644
--- a/libc/upstream-openbsd/lib/libc/string/strsep.c
+++ b/libc/upstream-openbsd/lib/libc/string/strsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strsep.c,v 1.7 2014/02/05 20:42:32 stsp Exp $ */
+/* $OpenBSD: strsep.c,v 1.8 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -68,3 +68,4 @@
}
/* NOTREACHED */
}
+DEF_WEAK(strsep);
diff --git a/libc/upstream-openbsd/lib/libc/string/strspn.c b/libc/upstream-openbsd/lib/libc/string/strspn.c
index 385649c..0ce41cb 100644
--- a/libc/upstream-openbsd/lib/libc/string/strspn.c
+++ b/libc/upstream-openbsd/lib/libc/string/strspn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strspn.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strspn.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
* All rights reserved.
@@ -49,3 +49,4 @@
goto cont;
return (p - 1 - s1);
}
+DEF_STRONG(strspn);
diff --git a/libc/upstream-openbsd/lib/libc/string/wcsstr.c b/libc/upstream-openbsd/lib/libc/string/wcsstr.c
index 669e340..6a7b0da 100644
--- a/libc/upstream-openbsd/lib/libc/string/wcsstr.c
+++ b/libc/upstream-openbsd/lib/libc/string/wcsstr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcsstr.c,v 1.3 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: wcsstr.c,v 1.5 2015/10/01 02:32:07 guenther Exp $ */
/* $NetBSD: wcsstr.c,v 1.3 2003/03/05 20:18:17 tshiozak Exp $ */
/*-
@@ -43,7 +43,6 @@
const wchar_t *r;
if (!*little) {
- /* LINTED interface specification */
return (wchar_t *)big;
}
if (wcslen(big) < wcslen(little))
@@ -61,10 +60,12 @@
r++;
}
if (!*q) {
- /* LINTED interface specification */
return (wchar_t *)p;
}
p++;
}
return NULL;
}
+#ifndef WCSWCS
+DEF_STRONG(wcsstr);
+#endif
diff --git a/libc/upstream-openbsd/lib/libc/string/wcswidth.c b/libc/upstream-openbsd/lib/libc/string/wcswidth.c
index 8ea1bdf..9f003f9 100644
--- a/libc/upstream-openbsd/lib/libc/string/wcswidth.c
+++ b/libc/upstream-openbsd/lib/libc/string/wcswidth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcswidth.c,v 1.4 2011/04/04 18:16:24 stsp Exp $ */
+/* $OpenBSD: wcswidth.c,v 1.5 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wcswidth.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
@@ -48,3 +48,4 @@
return w;
}
+DEF_WEAK(wcswidth);
diff --git a/libc/upstream-openbsd/lib/libc/string/wmemcpy.c b/libc/upstream-openbsd/lib/libc/string/wmemcpy.c
index 9bbd836..cf02ab9 100644
--- a/libc/upstream-openbsd/lib/libc/string/wmemcpy.c
+++ b/libc/upstream-openbsd/lib/libc/string/wmemcpy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wmemcpy.c,v 1.3 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: wmemcpy.c,v 1.4 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wmemcpy.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
@@ -38,3 +38,4 @@
return (wchar_t *)memcpy(d, s, n * sizeof(wchar_t));
}
+DEF_STRONG(wmemcpy);