aboutsummaryrefslogtreecommitdiff
path: root/stdio-common
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common')
-rw-r--r--stdio-common/Makefile2
-rw-r--r--stdio-common/fprintf.c7
-rw-r--r--stdio-common/printf_fp.c4
-rw-r--r--stdio-common/tempnam.c2
-rw-r--r--stdio-common/tmpfile.c4
-rw-r--r--stdio-common/tmpfile64.c48
-rw-r--r--stdio-common/tmpnam.c2
-rw-r--r--stdio-common/tmpnam_r.c2
-rw-r--r--stdio-common/vfprintf.c9
9 files changed, 71 insertions, 9 deletions
diff --git a/stdio-common/Makefile b/stdio-common/Makefile
index 95a606230a..362c77c24f 100644
--- a/stdio-common/Makefile
+++ b/stdio-common/Makefile
@@ -30,7 +30,7 @@ routines := \
vfscanf \
fscanf scanf sscanf \
perror psignal \
- tmpfile tmpnam tmpnam_r tempnam tempname \
+ tmpfile tmpfile64 tmpnam tmpnam_r tempnam tempname \
getline getw putw \
remove rename \
lockfile
diff --git a/stdio-common/fprintf.c b/stdio-common/fprintf.c
index 969f338f48..fd6d20d11c 100644
--- a/stdio-common/fprintf.c
+++ b/stdio-common/fprintf.c
@@ -34,3 +34,10 @@ fprintf (FILE *stream, const char *format, ...)
return done;
}
+
+#ifdef USE_IN_LIBIO
+/* We define the function with the real name here. But deep down in
+ libio the original function _IO_fprintf is also needed. So make
+ an alias. */
+weak_alias (fprintf, _IO_fprintf)
+#endif
diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c
index 85286bec15..33bc25bfd2 100644
--- a/stdio-common/printf_fp.c
+++ b/stdio-common/printf_fp.c
@@ -125,7 +125,8 @@ extern unsigned int __guess_grouping (unsigned int intdig_max,
static char *group_number (char *buf, char *bufend, unsigned int intdig_no,
- const char *grouping, wchar_t thousands_sep);
+ const char *grouping, wchar_t thousands_sep)
+ internal_function;
int
@@ -1016,6 +1017,7 @@ __guess_grouping (unsigned int intdig_max, const char *grouping,
Return the new end of buffer. */
static char *
+internal_function
group_number (char *buf, char *bufend, unsigned int intdig_no,
const char *grouping, wchar_t thousands_sep)
{
diff --git a/stdio-common/tempnam.c b/stdio-common/tempnam.c
index 5f8635cfb8..987fbbbabe 100644
--- a/stdio-common/tempnam.c
+++ b/stdio-common/tempnam.c
@@ -37,7 +37,7 @@ tempnam (const char *dir, const char *pfx)
size_t len;
char *s;
char *t = __stdio_gen_tempname (buf, sizeof (buf), dir, pfx, 1,
- &len, (FILE **) NULL);
+ &len, (FILE **) NULL, 0);
if (t == NULL)
return NULL;
diff --git a/stdio-common/tmpfile.c b/stdio-common/tmpfile.c
index 2cc03d6b89..c3afd3f78b 100644
--- a/stdio-common/tmpfile.c
+++ b/stdio-common/tmpfile.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1993, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +31,7 @@ tmpfile ()
FILE *f;
filename = __stdio_gen_tempname (buf, sizeof (buf), (char *) NULL, "tmpf", 0,
- (size_t *) NULL, &f);
+ (size_t *) NULL, &f, 0);
if (filename == NULL)
return NULL;
diff --git a/stdio-common/tmpfile64.c b/stdio-common/tmpfile64.c
new file mode 100644
index 0000000000..67d4bd8291
--- /dev/null
+++ b/stdio-common/tmpfile64.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 1991, 1993, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <stdio.h>
+
+
+/* This returns a new stream opened on a temporary file (generated
+ by tmpnam) The file is opened with mode "w+b" (binary read/write).
+ If we couldn't generate a unique filename or the file couldn't
+ be opened, NULL is returned. */
+FILE *
+tmpfile64 ()
+{
+#ifdef _G_OPEN64
+ char buf[FILENAME_MAX];
+ char *filename;
+ FILE *f;
+
+ filename = __stdio_gen_tempname (buf, sizeof (buf), (char *) NULL, "tmpf", 0,
+ (size_t *) NULL, &f, 1);
+ if (filename == NULL)
+ return NULL;
+
+ /* Note that this relies on the Unix semantics that
+ a file is not really removed until it is closed. */
+ (void) remove (filename);
+
+ return f;
+#else
+ __set_errno (ENOSYS);
+ return NULL;
+#endif
+}
diff --git a/stdio-common/tmpnam.c b/stdio-common/tmpnam.c
index 6e6dd510ea..3389ff57b4 100644
--- a/stdio-common/tmpnam.c
+++ b/stdio-common/tmpnam.c
@@ -37,7 +37,7 @@ tmpnam (char *s)
to FILENAME_MAX characters in any case. */
result = __stdio_gen_tempname (s ?: tmpbuf, L_tmpnam, (const char *) NULL,
(const char *) NULL, 0,
- (size_t *) NULL, (FILE **) NULL);
+ (size_t *) NULL, (FILE **) NULL, 0);
if (result != NULL && s == NULL)
{
diff --git a/stdio-common/tmpnam_r.c b/stdio-common/tmpnam_r.c
index a509a071d6..5e67cc6845 100644
--- a/stdio-common/tmpnam_r.c
+++ b/stdio-common/tmpnam_r.c
@@ -33,5 +33,5 @@ tmpnam_r (char *s)
to L_tmpnam characters in any case. */
return __stdio_gen_tempname (s, L_tmpnam, (const char *) NULL,
(const char *) NULL, 0,
- (size_t *) NULL, (FILE **) NULL);
+ (size_t *) NULL, (FILE **) NULL, 0);
}
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index 1cd8d2178a..ef9e62ffcc 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -176,14 +176,16 @@ static const char null[] = "(null)";
/* Helper function to provide temporary buffering for unbuffered streams. */
-static int buffered_vfprintf __P ((FILE *stream, const CHAR_T *fmt, va_list));
+static int buffered_vfprintf __P ((FILE *stream, const CHAR_T *fmt, va_list))
+ internal_function;
/* Handle unknown format specifier. */
static int printf_unknown __P ((FILE *, const struct printf_info *,
const void *const *));
/* Group digits of number string. */
-static char *group_number __P ((CHAR_T *, CHAR_T *, const CHAR_T *, wchar_t));
+static char *group_number __P ((CHAR_T *, CHAR_T *, const CHAR_T *, wchar_t))
+ internal_function;
/* The function itself. */
@@ -1480,6 +1482,7 @@ printf_unknown (FILE *s, const struct printf_info *info,
/* Group the digits according to the grouping rules of the current locale.
The interpretation of GROUPING is as in `struct lconv' from <locale.h>. */
static char *
+internal_function
group_number (CHAR_T *w, CHAR_T *rear_ptr, const CHAR_T *grouping,
wchar_t thousands_sep)
{
@@ -1579,6 +1582,7 @@ static const struct _IO_jump_t _IO_helper_jumps =
};
static int
+internal_function
buffered_vfprintf (register _IO_FILE *s, const CHAR_T *format,
_IO_va_list args)
{
@@ -1615,6 +1619,7 @@ buffered_vfprintf (register _IO_FILE *s, const CHAR_T *format,
#else /* !USE_IN_LIBIO */
static int
+internal_function
buffered_vfprintf (register FILE *s, const CHAR_T *format, va_list args)
{
char buf[BUFSIZ];