1 From 42a84250fc78bae3e885ecd1379e713663fe6487 Mon Sep 17 00:00:00 2001
2 From: Romain Naour <romain.naour@openwide.fr>
3 Date: Sun, 6 Apr 2014 12:12:41 +0200
4 Subject: [PATCH 1/1] c.h: define mkostemp for older version of uClibc
6 Signed-off-by: Romain Naour <romain.naour@openwide.fr>
9 include/c.h | 14 ++++++++++++++
10 2 files changed, 16 insertions(+)
12 diff --git a/configure.ac b/configure.ac
13 index 35a1f26..a9b8d34 100644
16 @@ -321,6 +321,8 @@ AC_CHECK_FUNCS([ \
20 +AC_CHECK_FUNCS([mkostemp])
22 AC_CHECK_FUNCS([openat fstatat unlinkat], [have_openat=yes], [have_openat=no])
23 AC_CHECK_FUNCS([ioperm iopl], [have_io=yes])
25 diff --git a/include/c.h b/include/c.h
26 index 4a9bf3d..1b880ed 100644
29 @@ -300,4 +300,18 @@ static inline int usleep(useconds_t usec)
34 + * mkostemp() may be missing with older version of uClibc
36 +#ifndef HAVE_MKOSTEMP
37 +static inline int mkostemp(char *template, int flags)
40 + fd = mkstemp(template);
41 + if (flags & O_CLOEXEC && fd >= 0)
42 + fcntl(fd, F_SETFD, FD_CLOEXEC);
47 #endif /* UTIL_LINUX_C_H */