1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

Implement mkstemps and mkstemps64.

This commit is contained in:
Ulrich Drepper
2009-10-30 00:11:07 -07:00
parent 471d4931f8
commit 7f3146e789
21 changed files with 173 additions and 38 deletions

View File

@ -50,7 +50,7 @@ __BEGIN_DECLS
# if defined __GNUC__ && !defined __cplusplus
# define __WAIT_INT(status) \
(__extension__ (((union { __typeof(status) __in; int __i; }) \
{ .__in = (status) }).__i))
{ .__in = (status) }).__i))
# else
# define __WAIT_INT(status) (*(int *) &(status))
# endif
@ -609,7 +609,7 @@ extern char *mktemp (char *__template) __THROW __nonnull ((1)) __wur;
Returns a file descriptor open on the file for reading and writing,
or -1 if it cannot create a uniquely-named file.
This function is a possible cancellation points and therefore not
This function is a possible cancellation point and therefore not
marked with __THROW. */
# ifndef __USE_FILE_OFFSET64
extern int mkstemp (char *__template) __nonnull ((1)) __wur;
@ -626,6 +626,29 @@ extern int mkstemp64 (char *__template) __nonnull ((1)) __wur;
# endif
#endif
#ifdef __USE_MISC
/* Similar to mkstemp, but the template can have a suffix after the
XXXXXX. The length of the suffix is specified in the second
parameter.
This function is a possible cancellation point and therefore not
marked with __THROW. */
# ifndef __USE_FILE_OFFSET64
extern int mkstemps (char *__template, int __suffixlen) __nonnull ((1)) __wur;
# else
# ifdef __REDIRECT
extern int __REDIRECT (mkstemps, (char *__template, int __suffixlen),
mkstemps64) __nonnull ((1)) __wur;
# else
# define mkstemps mkstemps64
# endif
# endif
# ifdef __USE_LARGEFILE64
extern int mkstemps64 (char *__template, int __suffixlen)
__nonnull ((1)) __wur;
# endif
#endif
#if defined __USE_BSD || defined __USE_XOPEN2K8
/* Create a unique temporary directory from TEMPLATE.
The last six characters of TEMPLATE must be "XXXXXX";