summaryrefslogtreecommitdiffstats
path: root/libc/upstream-openbsd
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-07-14 11:22:59 -0700
committerElliott Hughes <enh@google.com>2014-07-14 11:22:59 -0700
commit4f0b67a8dbf0e1d8b1dae42358553fb8d14456d4 (patch)
tree3c6403a39b402071fe1757014b57a7d898012450 /libc/upstream-openbsd
parent83ce99d8b7e2b15b2169e6e6e18e871ad35abb6c (diff)
downloadbionic-4f0b67a8dbf0e1d8b1dae42358553fb8d14456d4.tar.gz
bionic-4f0b67a8dbf0e1d8b1dae42358553fb8d14456d4.tar.bz2
bionic-4f0b67a8dbf0e1d8b1dae42358553fb8d14456d4.zip
Sync upstream-openbsd.
Change-Id: I5b9961a57e2ff05f63bd218c130bf8347850b9be
Diffstat (limited to 'libc/upstream-openbsd')
-rw-r--r--libc/upstream-openbsd/lib/libc/stdlib/exit.c10
-rw-r--r--libc/upstream-openbsd/lib/libc/string/stpcpy.c4
-rw-r--r--libc/upstream-openbsd/lib/libc/string/strcat.c6
-rw-r--r--libc/upstream-openbsd/lib/libc/string/strcmp.c6
-rw-r--r--libc/upstream-openbsd/lib/libc/string/strcpy.c6
-rw-r--r--libc/upstream-openbsd/lib/libc/string/strlen.c6
-rw-r--r--libc/upstream-openbsd/lib/libc/string/strncmp.c6
-rw-r--r--libc/upstream-openbsd/lib/libc/string/strncpy.c6
8 files changed, 18 insertions, 32 deletions
diff --git a/libc/upstream-openbsd/lib/libc/stdlib/exit.c b/libc/upstream-openbsd/lib/libc/stdlib/exit.c
index ef8b335c8..83fe3d2de 100644
--- a/libc/upstream-openbsd/lib/libc/stdlib/exit.c
+++ b/libc/upstream-openbsd/lib/libc/stdlib/exit.c
@@ -33,6 +33,16 @@
#include <stdlib.h>
#include <unistd.h>
#include "atexit.h"
+#include "thread_private.h"
+
+/*
+ * This variable is zero until a process has created a thread.
+ * It is used to avoid calling locking functions in libc when they
+ * are not required. By default, libc is intended to be(come)
+ * thread-safe, but without a (significant) penalty to non-threaded
+ * processes.
+ */
+int __isthreaded = 0;
/*
* Exit, flushing stdio buffers if necessary.
diff --git a/libc/upstream-openbsd/lib/libc/string/stpcpy.c b/libc/upstream-openbsd/lib/libc/string/stpcpy.c
index d3d61e0f1..d88afac34 100644
--- a/libc/upstream-openbsd/lib/libc/string/stpcpy.c
+++ b/libc/upstream-openbsd/lib/libc/string/stpcpy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: stpcpy.c,v 1.1 2012/01/17 02:48:01 guenther Exp $ */
+/* $OpenBSD: stpcpy.c,v 1.2 2014/07/09 17:08:21 naddy Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
@@ -33,7 +33,7 @@
#if defined(APIWARN)
__warn_references(stpcpy,
- "warning: stpcpy() is dangerous GNU crap; don't use it");
+ "warning: stpcpy() is dangerous; do not use it");
#endif
char *
diff --git a/libc/upstream-openbsd/lib/libc/string/strcat.c b/libc/upstream-openbsd/lib/libc/string/strcat.c
index 7cea5229f..646c9c209 100644
--- a/libc/upstream-openbsd/lib/libc/string/strcat.c
+++ b/libc/upstream-openbsd/lib/libc/string/strcat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strcat.c,v 1.8 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strcat.c,v 1.9 2014/06/10 04:17:37 deraadt Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
@@ -29,11 +29,7 @@
* SUCH DAMAGE.
*/
-#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
-#else
-#include <lib/libkern/libkern.h>
-#endif
#if defined(APIWARN)
__warn_references(strcat,
diff --git a/libc/upstream-openbsd/lib/libc/string/strcmp.c b/libc/upstream-openbsd/lib/libc/string/strcmp.c
index 816fd111a..d1b6c50d7 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.7 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strcmp.c,v 1.8 2014/06/10 04:17:37 deraadt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -32,11 +32,7 @@
* SUCH DAMAGE.
*/
-#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
-#else
-#include <lib/libkern/libkern.h>
-#endif
/*
* Compare strings.
diff --git a/libc/upstream-openbsd/lib/libc/string/strcpy.c b/libc/upstream-openbsd/lib/libc/string/strcpy.c
index 71d90d410..5a9001e43 100644
--- a/libc/upstream-openbsd/lib/libc/string/strcpy.c
+++ b/libc/upstream-openbsd/lib/libc/string/strcpy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strcpy.c,v 1.8 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strcpy.c,v 1.9 2014/06/10 04:17:37 deraadt Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
@@ -29,11 +29,7 @@
* SUCH DAMAGE.
*/
-#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
-#else
-#include <lib/libkern/libkern.h>
-#endif
#if defined(APIWARN)
__warn_references(strcpy,
diff --git a/libc/upstream-openbsd/lib/libc/string/strlen.c b/libc/upstream-openbsd/lib/libc/string/strlen.c
index 12d9ec4da..7e0e27b1d 100644
--- a/libc/upstream-openbsd/lib/libc/string/strlen.c
+++ b/libc/upstream-openbsd/lib/libc/string/strlen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strlen.c,v 1.7 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strlen.c,v 1.8 2014/06/10 04:17:37 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -29,11 +29,7 @@
* SUCH DAMAGE.
*/
-#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
-#else
-#include <lib/libkern/libkern.h>
-#endif
size_t
strlen(const char *str)
diff --git a/libc/upstream-openbsd/lib/libc/string/strncmp.c b/libc/upstream-openbsd/lib/libc/string/strncmp.c
index 0aea80d7d..0a4ddc1d9 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.7 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strncmp.c,v 1.8 2014/06/10 04:17:37 deraadt Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -29,11 +29,7 @@
* SUCH DAMAGE.
*/
-#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
-#else
-#include <lib/libkern/libkern.h>
-#endif
int
strncmp(const char *s1, const char *s2, size_t n)
diff --git a/libc/upstream-openbsd/lib/libc/string/strncpy.c b/libc/upstream-openbsd/lib/libc/string/strncpy.c
index 4426cbe2e..5003a199a 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.6 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strncpy.c,v 1.7 2014/06/10 04:17:37 deraadt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -32,11 +32,7 @@
* SUCH DAMAGE.
*/
-#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
-#else
-#include <lib/libkern/libkern.h>
-#endif
/*
* Copy src to dst, truncating or null-padding to always copy n bytes.