From 7f3146e7895f248dd2f655e9e5895abebb2bf506 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 30 Oct 2009 00:11:07 -0700 Subject: Implement mkstemps and mkstemps64. --- stdlib/stdlib.h | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'stdlib') diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h index 1b88ce6a52..6fe6a03bf3 100644 --- a/stdlib/stdlib.h +++ b/stdlib/stdlib.h @@ -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"; -- cgit 1.4.1