diff options
author | Mike Frysinger <vapier@gentoo.org> | 2012-11-14 00:30:54 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2012-11-14 00:31:15 -0500 |
commit | 42d1b23fc0f3748b8bf474e456d6c44aa7e563fd (patch) | |
tree | 2e159926ea9cbe018bf2ddaade8e7c0eff90d3c8 /include/stdlib.h | |
parent | dbaa240832c159e395e8b3104ecdb551c8f96b5d (diff) |
libc/stdlib: add mkostemp helpers
Some projects (like udev) are starting to use this.
Imported from glibc.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'include/stdlib.h')
-rw-r--r-- | include/stdlib.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/stdlib.h b/include/stdlib.h index 354fc6672..79ccc55ab 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -652,6 +652,29 @@ extern int mkstemp64 (char *__template) __nonnull ((1)) __wur; extern char *mkdtemp (char *__template) __THROW __nonnull ((1)) __wur; #endif +#ifdef __USE_GNU +/* Generate a unique temporary file name from TEMPLATE similar to + mkstemp. But allow the caller to pass additional flags which are + used in the open call to create the file.. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +# ifndef __USE_FILE_OFFSET64 +extern int mkostemp (char *__template, int __flags) __nonnull ((1)) __wur; +# else +# ifdef __REDIRECT +extern int __REDIRECT (mkostemp, (char *__template, int __flags), mkostemp64) + __nonnull ((1)) __wur; +# else +# define mkostemp mkostemp64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int mkostemp64 (char *__template, int __flags) __nonnull ((1)) __wur; +# endif + +#endif + __BEGIN_NAMESPACE_STD /* Execute the given line as a shell command. |