summaryrefslogtreecommitdiff
path: root/sysdeps/posix/tempname.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix/tempname.c')
-rw-r--r--sysdeps/posix/tempname.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sysdeps/posix/tempname.c b/sysdeps/posix/tempname.c
index 3b82d3d366..291817c9ef 100644
--- a/sysdeps/posix/tempname.c
+++ b/sysdeps/posix/tempname.c
@@ -83,7 +83,7 @@ static const char letters[] =
char *
__stdio_gen_tempname (char *buf, size_t bufsize, const char *dir,
const char *pfx, int dir_search, size_t *lenptr,
- FILE **streamptr)
+ FILE **streamptr, int large_file)
{
int saverrno = errno;
static const char tmpdir[] = P_tmpdir;
@@ -186,7 +186,13 @@ __stdio_gen_tempname (char *buf, size_t bufsize, const char *dir,
if (streamptr != NULL)
{
/* Try to create the file atomically. */
+#ifdef _G_OPEN64
+ int fd = (large_file
+ ? __open (buf, O_RDWR|O_CREAT|O_EXCL, 0666)
+ : _G_OPEN64 (buf, O_RDWR|O_CREAT|O_EXCL, 0666));
+#else
int fd = __open (buf, O_RDWR|O_CREAT|O_EXCL, 0666);
+#endif
if (fd >= 0)
{
/* We got a new file that did not previously exist.