summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2005-05-11 18:39:19 +0000
committerespie <espie@openbsd.org>2005-05-11 18:39:19 +0000
commit57bf79d243bf313e943427a2d0928512d49e1178 (patch)
tree3dd847a14ca5658bacb58de4506ea4fead5b7573 /lib/libc
parentuse the ctype stuff in libc instead of re-rolling our own. (diff)
downloadwireguard-openbsd-57bf79d243bf313e943427a2d0928512d49e1178.tar.xz
wireguard-openbsd-57bf79d243bf313e943427a2d0928512d49e1178.zip
let vfscanf be a real function. Use a weak_alias on systems where this
is feasible. Okay millert@ There's a major libc bump coming that is going to cover this as well...
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdio/Makefile.inc4
-rw-r--r--lib/libc/stdio/__svfscanf.c26
-rw-r--r--lib/libc/stdio/scanf.c4
-rw-r--r--lib/libc/stdio/sscanf.c4
-rw-r--r--lib/libc/stdio/vfscanf.c8
-rw-r--r--lib/libc/stdio/vscanf.c4
-rw-r--r--lib/libc/stdio/vsscanf.c4
7 files changed, 42 insertions, 12 deletions
diff --git a/lib/libc/stdio/Makefile.inc b/lib/libc/stdio/Makefile.inc
index 44f673a3973..1c2639bd036 100644
--- a/lib/libc/stdio/Makefile.inc
+++ b/lib/libc/stdio/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.11 2000/03/28 22:42:03 deraadt Exp $
+# $OpenBSD: Makefile.inc,v 1.12 2005/05/11 18:39:19 espie Exp $
# stdio sources
.PATH: ${LIBCSRCDIR}/stdio
@@ -14,7 +14,7 @@ SRCS+= asprintf.c clrerr.c fclose.c fdopen.c feof.c ferror.c fflush.c fgetc.c \
scanf.c setbuf.c setbuffer.c setvbuf.c snprintf.c sprintf.c sscanf.c \
stdio.c tempnam.c tmpfile.c tmpnam.c ungetc.c vasprintf.c vfprintf.c \
vfscanf.c vprintf.c vscanf.c vsnprintf.c vsprintf.c vsscanf.c \
- wbuf.c wsetup.c flockfile.c
+ wbuf.c wsetup.c flockfile.c __svfscanf.c
MAN+= fclose.3 ferror.3 fflush.3 fgetln.3 fgets.3 fopen.3 fputs.3 \
fread.3 fseek.3 funopen.3 getc.3 mktemp.3 perror.3 printf.3 putc.3 \
diff --git a/lib/libc/stdio/__svfscanf.c b/lib/libc/stdio/__svfscanf.c
new file mode 100644
index 00000000000..3040fba4c72
--- /dev/null
+++ b/lib/libc/stdio/__svfscanf.c
@@ -0,0 +1,26 @@
+/* $OpenBSD: __svfscanf.c,v 1.1 2005/05/11 18:39:19 espie Exp $ */
+
+/*
+ * Copyright (c) 2005 Marc Espie <espie@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
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <sys/cdefs.h>
+
+#ifdef __indr_reference
+__indr_reference(vfscanf, __svfscanf);
+#else
+# define VFSCANF __svfscanf
+# include "vfscanf.c"
+#endif
diff --git a/lib/libc/stdio/scanf.c b/lib/libc/stdio/scanf.c
index 05393c172c1..061ad3489ad 100644
--- a/lib/libc/stdio/scanf.c
+++ b/lib/libc/stdio/scanf.c
@@ -31,7 +31,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: scanf.c,v 1.7 2005/03/31 18:36:29 pat Exp $";
+static char rcsid[] = "$OpenBSD: scanf.c,v 1.8 2005/05/11 18:39:19 espie Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -44,7 +44,7 @@ scanf(const char *fmt, ...)
va_list ap;
va_start(ap, fmt);
- ret = __svfscanf(stdin, fmt, ap);
+ ret = vfscanf(stdin, fmt, ap);
va_end(ap);
return (ret);
}
diff --git a/lib/libc/stdio/sscanf.c b/lib/libc/stdio/sscanf.c
index 0104e941e03..e8fea3ee68c 100644
--- a/lib/libc/stdio/sscanf.c
+++ b/lib/libc/stdio/sscanf.c
@@ -31,7 +31,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: sscanf.c,v 1.9 2005/04/30 09:25:17 espie Exp $";
+static char rcsid[] = "$OpenBSD: sscanf.c,v 1.10 2005/05/11 18:39:19 espie Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -63,7 +63,7 @@ sscanf(const char *str, const char *fmt, ...)
_UB(&f)._base = NULL;
f._lb._base = NULL;
va_start(ap, fmt);
- ret = __svfscanf(&f, fmt, ap);
+ ret = vfscanf(&f, fmt, ap);
va_end(ap);
return (ret);
}
diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c
index 27e8b575bca..2c0fc98ad6c 100644
--- a/lib/libc/stdio/vfscanf.c
+++ b/lib/libc/stdio/vfscanf.c
@@ -31,7 +31,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: vfscanf.c,v 1.11 2005/03/31 18:36:29 pat Exp $";
+static char rcsid[] = "$OpenBSD: vfscanf.c,v 1.12 2005/05/11 18:39:19 espie Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -85,11 +85,15 @@ static char rcsid[] = "$OpenBSD: vfscanf.c,v 1.11 2005/03/31 18:36:29 pat Exp $"
static u_char *__sccl(char *, u_char *);
+#if !defined(VFSCANF)
+#define VFSCANF vfscanf
+#endif
+
/*
* vfscanf
*/
int
-__svfscanf(FILE *fp, const char *fmt0, _BSD_VA_LIST_ ap)
+VFSCANF(FILE *fp, const char *fmt0, _BSD_VA_LIST_ ap)
{
u_char *fmt = (u_char *)fmt0;
int c; /* character from format, or conversion */
diff --git a/lib/libc/stdio/vscanf.c b/lib/libc/stdio/vscanf.c
index 5c8b5379cbe..898acc339d0 100644
--- a/lib/libc/stdio/vscanf.c
+++ b/lib/libc/stdio/vscanf.c
@@ -31,7 +31,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: vscanf.c,v 1.5 2004/09/28 18:12:44 otto Exp $";
+static char rcsid[] = "$OpenBSD: vscanf.c,v 1.6 2005/05/11 18:39:19 espie Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -40,5 +40,5 @@ int
vscanf(const char *fmt, _BSD_VA_LIST_ ap)
{
- return (__svfscanf(stdin, fmt, ap));
+ return (vfscanf(stdin, fmt, ap));
}
diff --git a/lib/libc/stdio/vsscanf.c b/lib/libc/stdio/vsscanf.c
index 34b54cb7dea..a1585c622a0 100644
--- a/lib/libc/stdio/vsscanf.c
+++ b/lib/libc/stdio/vsscanf.c
@@ -31,7 +31,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: vsscanf.c,v 1.7 2005/04/30 09:25:17 espie Exp $";
+static char rcsid[] = "$OpenBSD: vsscanf.c,v 1.8 2005/05/11 18:39:19 espie Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -59,5 +59,5 @@ vsscanf(const char *str, const char *fmt, _BSD_VA_LIST_ ap)
f._read = eofread;
_UB(&f)._base = NULL;
f._lb._base = NULL;
- return (__svfscanf(&f, fmt, ap));
+ return (vfscanf(&f, fmt, ap));
}