diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-02-27 01:59:46 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-02-27 01:59:46 +0000 |
commit | 46c3f8cdb451e022418f765d1b3cfe0c533d9e1b (patch) | |
tree | ec963e772ac89d3fa7b427946255a2758fd4361e /misc/mkstemp.c | |
parent | 08b3d7ad6880ad50e9055220aa96c2d620deed15 (diff) | |
download | glibc-46c3f8cdb451e022418f765d1b3cfe0c533d9e1b.tar glibc-46c3f8cdb451e022418f765d1b3cfe0c533d9e1b.tar.gz glibc-46c3f8cdb451e022418f765d1b3cfe0c533d9e1b.tar.bz2 glibc-46c3f8cdb451e022418f765d1b3cfe0c533d9e1b.zip |
Update.
2001-02-26 Paul Eggert <eggert@twinsun.com>
Modify mkstemp.c and tempname.c so that they can be used by
GNU applications on non-glibc platforms.
* misc/mkstemp.c (__GT_FILE): Define to zero if not defined.
* sysdeps/posix/tempname.c: Include <config.h> if HAVE_CONFIG_H.
Include <stddef.h>, <stdint.h>, <string.h> only if
STDC_HEADERS || _LIBC.
Include <fcntl.h> only if HAVE_FCNTL_H || _LIBC.
Include <unistd.h> only if HAVE_UNISTD_H || _LIBC.
Include <sys/time.h> only if HAVE_SYS_TIME_H || _LIBC.
(__set_errno): Define this macro if <errno.h> doesn't.
(P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
Define these macros if <stdio.h> doesn't.
(S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
Define these macros if <sys/stat.h> doesn't.
Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
(stat64, __getpid, __gettimeofday, __mkdir, __open, __open64,
lxstat64, __xstat64): Define if not _LIBC.
(struct_stat64): New macro.
(direxists, __gen_tempname): Use it, to avoid a
portability problem with Solaris 8.
(__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
(__gen_tempname): Invoke gettimeofday only if
HAVE_GETTIMEOFDAY || _LIBC; otherwise, fall back on plain "time".
Use portable macros like S_IRUSR | S_IWUSR rather than nonportable
octal values like 0600.
Diffstat (limited to 'misc/mkstemp.c')
-rw-r--r-- | misc/mkstemp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/misc/mkstemp.c b/misc/mkstemp.c index 8441c8ee2a..380b989842 100644 --- a/misc/mkstemp.c +++ b/misc/mkstemp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1998, 1999, 2001 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 @@ -19,6 +19,10 @@ #include <stdio.h> #include <stdlib.h> +#ifndef __GT_FILE +# define __GT_FILE 0 +#endif + /* Generate a unique temporary file name from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; they are replaced with a string that makes the filename unique. |