Sync upstream-openbsd.
(cherry picked from commit 4f0b67a8db
)
Change-Id: I8753959853312ab978bc4eb1bbbcdc7d1b007b95
This commit is contained in:
@@ -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.
|
||||
|
@@ -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 *
|
||||
|
@@ -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,
|
||||
|
@@ -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.
|
||||
|
@@ -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,
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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.
|
||||
|
Reference in New Issue
Block a user