This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, 1.0 has been updated
via cb62dc41759f526e0ea8ed7c7ad8050a093ff827 (commit)
from f52fb21a7af0aa4e983b3e6c2ddd1b6a526b5169 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit cb62dc41759f526e0ea8ed7c7ad8050a093ff827
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Wed Aug 19 02:19:02 2015 +0200
Revert "ldso: install backward compatibility symlink by default"
This reverts commit f52fb21a7af0aa4e983b3e6c2ddd1b6a526b5169.
Totally wrong patch.
-----------------------------------------------------------------------
Summary of changes:
ldso/ldso/Makefile.in | 2 --
1 file changed, 2 deletions(-)
diff --git a/ldso/ldso/Makefile.in b/ldso/ldso/Makefile.in
index 21e0dbc..424131c 100644
--- a/ldso/ldso/Makefile.in
+++ b/ldso/ldso/Makefile.in
@@ -74,8 +74,6 @@ $(ldso): $(ldso:.$(ABI_VERSION)=)
$(ldso:.$(ABI_VERSION)=): | $(top_builddir)lib
$(ldso:.$(ABI_VERSION)=): $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a
$(call link.so,$(ldso_FULL_NAME),$(ABI_VERSION))
- # link for backward compatibility
- $(call link.so,$(ldso_FULL_NAME),0)
$($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a: $(ldso-y)
$(Q)$(RM) $@
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via 58eeb61bd059255436972c0039bcd4b68ef47247 (commit)
from 9b9abfbd25d5f95010241bdd72941dafecd56b0e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 58eeb61bd059255436972c0039bcd4b68ef47247
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Wed Aug 19 02:18:24 2015 +0200
Revert "ldso: install backward compatibility symlink by default"
This reverts commit 9b9abfbd25d5f95010241bdd72941dafecd56b0e.
Totally wrong patch. sorry.
-----------------------------------------------------------------------
Summary of changes:
ldso/ldso/Makefile.in | 2 --
1 file changed, 2 deletions(-)
diff --git a/ldso/ldso/Makefile.in b/ldso/ldso/Makefile.in
index 21e0dbc..424131c 100644
--- a/ldso/ldso/Makefile.in
+++ b/ldso/ldso/Makefile.in
@@ -74,8 +74,6 @@ $(ldso): $(ldso:.$(ABI_VERSION)=)
$(ldso:.$(ABI_VERSION)=): | $(top_builddir)lib
$(ldso:.$(ABI_VERSION)=): $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a
$(call link.so,$(ldso_FULL_NAME),$(ABI_VERSION))
- # link for backward compatibility
- $(call link.so,$(ldso_FULL_NAME),0)
$($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a: $(ldso-y)
$(Q)$(RM) $@
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
Change __gen_tempname() prototype in order to pass the additional
suffix lenght. In __gen_tempname() add a new check for suffixlen.
Update some comments in the code.
Signed-off-by: Romain Naour <romain.naour(a)openwide.fr>
Cc: Waldemar Brodkorb <mail(a)waldemar-brodkorb.de>
---
include/stdlib.h | 49 +++++++++++++++++++++++++++++++
libc/misc/internals/tempname.c | 16 +++++-----
libc/misc/internals/tempname.h | 3 +-
libc/stdio/tempnam.c | 2 +-
libc/stdio/tmpfile.c | 2 +-
libc/stdio/tmpnam.c | 2 +-
libc/stdio/tmpnam_r.c | 2 +-
libc/stdlib/Makefile.in | 6 ++--
libc/stdlib/mkdtemp.c | 2 +-
libc/stdlib/mkostemp.c | 2 +-
libc/stdlib/mkostemp64.c | 3 +-
libc/stdlib/{mkostemp.c => mkostemps.c} | 14 +++++----
libc/stdlib/{mkostemp.c => mkostemps64.c} | 12 ++++----
libc/stdlib/mkstemp.c | 2 +-
libc/stdlib/mkstemp64.c | 2 +-
libc/stdlib/{mkostemp.c => mkstemps.c} | 15 +++++-----
libc/stdlib/{mkostemp.c => mkstemps64.c} | 15 +++++-----
libc/stdlib/mktemp.c | 2 +-
libpthread/nptl/sem_open.c | 2 +-
19 files changed, 107 insertions(+), 46 deletions(-)
copy libc/stdlib/{mkostemp.c => mkostemps.c} (71%)
copy libc/stdlib/{mkostemp.c => mkostemps64.c} (71%)
copy libc/stdlib/{mkostemp.c => mkstemps.c} (69%)
copy libc/stdlib/{mkostemp.c => mkstemps64.c} (68%)
diff --git a/include/stdlib.h b/include/stdlib.h
index 809256d..ba8849e 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -644,6 +644,35 @@ extern int mkstemp64 (char *__template) __nonnull ((1)) __wur;
# endif
#endif
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+# if defined __UCLIBC_SUSV3_LEGACY__
+extern char *mktemps (char *__template, int __suffixlen) __THROW __nonnull ((1)) __wur;
+# endif
+
+/* The mkstemps() function is like mkstemp(), except that the string in
+ template contains a suffix of suffixlen characters. Thus, template is
+ of the form prefixXXXXXXsuffix, and the string XXXXXX is modified as
+ for mkstemp().
+ 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 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";
@@ -673,7 +702,27 @@ extern int __REDIRECT (mkostemp, (char *__template, int __flags), mkostemp64)
# ifdef __USE_LARGEFILE64
extern int mkostemp64 (char *__template, int __flags) __nonnull ((1)) __wur;
# endif
+#endif
+#ifdef __USE_GNU
+/* Generate a unique temporary file name from TEMPLATE similar to
+ mkostemp. But allow the caller to pass additional file name suffix.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+# ifndef __USE_FILE_OFFSET64
+extern int mkostemps (char *__template, int __suffixlen, int __flags) __nonnull ((1)) __wur;
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (mkostemps, (char *__template, int __suffixlen, int __flags), mkostemps64)
+ __nonnull ((1)) __wur;
+# else
+# define mkostemps mkostemps64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int mkostemps64 (char *__template, int __suffixlen, int __flags) __nonnull ((1)) __wur;
+# endif
#endif
diff --git a/libc/misc/internals/tempname.c b/libc/misc/internals/tempname.c
index edcc31c..7654eb4 100644
--- a/libc/misc/internals/tempname.c
+++ b/libc/misc/internals/tempname.c
@@ -163,10 +163,10 @@ static void brain_damaged_fillrand(unsigned char *buf, unsigned int len)
}
}
-/* Generate a temporary file name based on TMPL. TMPL must match the
- rules for mk[s]temp (i.e. end in "XXXXXX"). The name constructed
- does not exist at the time of the call to __gen_tempname. TMPL is
- overwritten with the result.
+/* Generate a temporary file name based on TMPL. TMPL must match the
+ rules for mk[s]temp[s] (i.e. end in "prefixXXXXXXsuffix"). The name
+ constructed does not exist at the time of the call to __gen_tempname.
+ TMPL is overwritten with the result.
KIND may be one of:
__GT_NOCREATE: simply verify that the name does not exist
@@ -177,7 +177,8 @@ static void brain_damaged_fillrand(unsigned char *buf, unsigned int len)
__GT_DIR: create a directory with given mode.
*/
-int attribute_hidden __gen_tempname (char *tmpl, int kind, int flags, mode_t mode)
+int attribute_hidden __gen_tempname (char *tmpl, int kind, int flags,
+ int suffixlen, mode_t mode)
{
char *XXXXXX;
unsigned int i;
@@ -187,8 +188,9 @@ int attribute_hidden __gen_tempname (char *tmpl, int kind, int flags, mode_t mod
len = strlen (tmpl);
/* This is where the Xs start. */
- XXXXXX = tmpl + len - 6;
- if (len < 6 || strcmp (XXXXXX, "XXXXXX"))
+ XXXXXX = tmpl + len - 6 - suffixlen;
+ if (len < 6 || suffixlen < 0 || suffixlen > len - 6
+ || strncmp (XXXXXX, "XXXXXX", 6))
{
__set_errno (EINVAL);
return -1;
diff --git a/libc/misc/internals/tempname.h b/libc/misc/internals/tempname.h
index edfe26d..cc20f75 100644
--- a/libc/misc/internals/tempname.h
+++ b/libc/misc/internals/tempname.h
@@ -10,7 +10,8 @@ extern int ___path_search (char *tmpl, size_t tmpl_len, const char *dir,
const char *pfx /*, int try_tmpdir */) attribute_hidden;
#define __path_search(tmpl, tmpl_len, dir, pfx, try_tmpdir) ___path_search(tmpl, tmpl_len, dir, pfx)
-extern int __gen_tempname (char *__tmpl, int __kind, int flags, mode_t mode) attribute_hidden;
+extern int __gen_tempname (char *__tmpl, int __kind, int flags,
+ int suffixlen, mode_t mode) attribute_hidden;
/* The __kind argument to __gen_tempname may be one of: */
#define __GT_FILE 0 /* create a file */
diff --git a/libc/stdio/tempnam.c b/libc/stdio/tempnam.c
index 5ef199e..46c9210 100644
--- a/libc/stdio/tempnam.c
+++ b/libc/stdio/tempnam.c
@@ -35,7 +35,7 @@ tempnam (const char *dir, const char *pfx)
if (__path_search (buf, FILENAME_MAX, dir, pfx, 1))
return NULL;
- if (__gen_tempname (buf, __GT_NOCREATE, 0, 0))
+ if (__gen_tempname (buf, __GT_NOCREATE, 0, 0, 0))
return NULL;
return strdup (buf);
diff --git a/libc/stdio/tmpfile.c b/libc/stdio/tmpfile.c
index 83c85b5..3654f9e 100644
--- a/libc/stdio/tmpfile.c
+++ b/libc/stdio/tmpfile.c
@@ -35,7 +35,7 @@ FILE * tmpfile (void)
if (__path_search (buf, FILENAME_MAX, NULL, "tmpf", 0))
return NULL;
- fd = __gen_tempname (buf, __GT_FILE, 0, S_IRUSR | S_IWUSR);
+ fd = __gen_tempname (buf, __GT_FILE, 0, 0, S_IRUSR | S_IWUSR);
if (fd < 0)
return NULL;
diff --git a/libc/stdio/tmpnam.c b/libc/stdio/tmpnam.c
index 52997d3..a9f6796 100644
--- a/libc/stdio/tmpnam.c
+++ b/libc/stdio/tmpnam.c
@@ -40,7 +40,7 @@ tmpnam (char *s)
0))
return NULL;
- if (__builtin_expect (__gen_tempname (tmpbuf, __GT_NOCREATE, 0, 0), 0))
+ if (__builtin_expect (__gen_tempname (tmpbuf, __GT_NOCREATE, 0, 0, 0), 0))
return NULL;
if (s == NULL)
diff --git a/libc/stdio/tmpnam_r.c b/libc/stdio/tmpnam_r.c
index 3cc48b0..2e70c2d 100644
--- a/libc/stdio/tmpnam_r.c
+++ b/libc/stdio/tmpnam_r.c
@@ -27,7 +27,7 @@ char * tmpnam_r (char *s)
if (__path_search (s, L_tmpnam, NULL, NULL, 0))
return NULL;
- if (__gen_tempname (s, __GT_NOCREATE, 0, 0))
+ if (__gen_tempname (s, __GT_NOCREATE, 0, 0, 0))
return NULL;
return s;
diff --git a/libc/stdlib/Makefile.in b/libc/stdlib/Makefile.in
index 071f911..ae74995 100644
--- a/libc/stdlib/Makefile.in
+++ b/libc/stdlib/Makefile.in
@@ -13,8 +13,8 @@ include $(top_srcdir)libc/stdlib/malloc-standard/Makefile.in
CSRC-y := \
abort.c getenv.c mkdtemp.c realpath.c canonicalize.c mkstemp.c mkostemp.c \
- rand.c random.c random_r.c setenv.c div.c ldiv.c lldiv.c \
- getpt.c drand48-iter.c jrand48.c \
+ mkstemps.c mkostemps.c rand.c random.c random_r.c setenv.c div.c ldiv.c \
+ lldiv.c getpt.c drand48-iter.c jrand48.c \
jrand48_r.c lcong48.c lrand48.c lrand48_r.c mrand48.c mrand48_r.c nrand48.c \
nrand48_r.c rand_r.c srand48.c srand48_r.c seed48.c seed48_r.c \
a64l.c l64a.c __uc_malloc.c
@@ -22,7 +22,7 @@ CSRC-$(UCLIBC_SUSV2_LEGACY) += valloc.c
CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_memalign.c
CSRC-$(UCLIBC_HAS_PTY) += grantpt.c unlockpt.c ptsname.c
CSRC-$(UCLIBC_HAS_ARC4RANDOM) += arc4random.c
-CSRC-$(UCLIBC_HAS_LFS) += mkstemp64.c mkostemp64.c
+CSRC-$(UCLIBC_HAS_LFS) += mkstemp64.c mkostemp64.c mkstemps64.c mkostemps64.c
CSRC-$(UCLIBC_HAS_FLOATS) += drand48.c drand48_r.c erand48.c erand48_r.c
CSRC-$(if $(findstring yy,$(UCLIBC_HAS_FLOATS)$(UCLIBC_SUSV3_LEGACY)),y) += \
gcvt.c
diff --git a/libc/stdlib/mkdtemp.c b/libc/stdlib/mkdtemp.c
index e6d4a36..185e206 100644
--- a/libc/stdlib/mkdtemp.c
+++ b/libc/stdlib/mkdtemp.c
@@ -29,7 +29,7 @@
(This function comes from OpenBSD.) */
char * mkdtemp (char *template)
{
- if (__gen_tempname (template, __GT_DIR, 0, S_IRUSR | S_IWUSR | S_IXUSR))
+ if (__gen_tempname (template, __GT_DIR, 0, 0, S_IRUSR | S_IWUSR | S_IXUSR))
return NULL;
else
return template;
diff --git a/libc/stdlib/mkostemp.c b/libc/stdlib/mkostemp.c
index 912be30..4eab079 100644
--- a/libc/stdlib/mkostemp.c
+++ b/libc/stdlib/mkostemp.c
@@ -28,5 +28,5 @@ int
mkostemp (char *template, int flags)
{
flags -= flags & O_ACCMODE; /* Remove O_RDONLY, O_WRONLY, and O_RDWR. */
- return __gen_tempname (template, __GT_FILE, flags, S_IRUSR | S_IWUSR);
+ return __gen_tempname (template, __GT_FILE, flags, 0, S_IRUSR | S_IWUSR);
}
diff --git a/libc/stdlib/mkostemp64.c b/libc/stdlib/mkostemp64.c
index c6d6d84..25595ad 100644
--- a/libc/stdlib/mkostemp64.c
+++ b/libc/stdlib/mkostemp64.c
@@ -27,5 +27,6 @@
int
mkostemp64 (char *template, int flags)
{
- return __gen_tempname (template, __GT_BIGFILE, flags | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IXUSR);
+ return __gen_tempname (template, __GT_BIGFILE, flags | O_LARGEFILE, 0,
+ S_IRUSR | S_IWUSR | S_IXUSR);
}
diff --git a/libc/stdlib/mkostemp.c b/libc/stdlib/mkostemps.c
similarity index 71%
copy from libc/stdlib/mkostemp.c
copy to libc/stdlib/mkostemps.c
index 912be30..13a5171 100644
--- a/libc/stdlib/mkostemp.c
+++ b/libc/stdlib/mkostemps.c
@@ -21,12 +21,16 @@
#include "../misc/internals/tempname.h"
/* 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.
+ The TEMPLATE is of the form "XXXXXXsuffix" where six characters
+ after the TEMPLATE must be "XXXXXX" followed by the suffix.
+ The suffix length must be specified with suffixlen.
+ "XXXXXX" are replaced with a string that makes the filename unique.
Then open the file and return a fd. */
-int
-mkostemp (char *template, int flags)
+int mkostemps (char *template, int suffixlen, int flags)
{
flags -= flags & O_ACCMODE; /* Remove O_RDONLY, O_WRONLY, and O_RDWR. */
- return __gen_tempname (template, __GT_FILE, flags, S_IRUSR | S_IWUSR);
+ return __gen_tempname (template, __GT_FILE, flags, suffixlen,
+ S_IRUSR | S_IWUSR);
}
+
+
diff --git a/libc/stdlib/mkostemp.c b/libc/stdlib/mkostemps64.c
similarity index 71%
copy from libc/stdlib/mkostemp.c
copy to libc/stdlib/mkostemps64.c
index 912be30..0436fcf 100644
--- a/libc/stdlib/mkostemp.c
+++ b/libc/stdlib/mkostemps64.c
@@ -21,12 +21,14 @@
#include "../misc/internals/tempname.h"
/* 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.
+ The TEMPLATE is of the form "XXXXXXsuffix" where six characters
+ after the TEMPLATE must be "XXXXXX" followed by the suffix.
+ The suffix length must be specified with suffixlen.
+ "XXXXXX" are replaced with a string that makes the filename unique.
Then open the file and return a fd. */
-int
-mkostemp (char *template, int flags)
+int mkostemps64 (char *template, int suffixlen, int flags)
{
flags -= flags & O_ACCMODE; /* Remove O_RDONLY, O_WRONLY, and O_RDWR. */
- return __gen_tempname (template, __GT_FILE, flags, S_IRUSR | S_IWUSR);
+ return __gen_tempname (template, __GT_FILE, flags, suffixlen,
+ S_IRUSR | S_IWUSR);
}
diff --git a/libc/stdlib/mkstemp.c b/libc/stdlib/mkstemp.c
index a3a1595..abcc93e 100644
--- a/libc/stdlib/mkstemp.c
+++ b/libc/stdlib/mkstemp.c
@@ -26,5 +26,5 @@
Then open the file and return a fd. */
int mkstemp (char *template)
{
- return __gen_tempname (template, __GT_FILE, 0, S_IRUSR | S_IWUSR);
+ return __gen_tempname (template, __GT_FILE, 0, 0, S_IRUSR | S_IWUSR);
}
diff --git a/libc/stdlib/mkstemp64.c b/libc/stdlib/mkstemp64.c
index 6f2ee3e..82c6da5 100644
--- a/libc/stdlib/mkstemp64.c
+++ b/libc/stdlib/mkstemp64.c
@@ -26,5 +26,5 @@
Then open the file and return a fd. */
int mkstemp64 (char *template)
{
- return __gen_tempname (template, __GT_BIGFILE, 0, S_IRUSR | S_IWUSR);
+ return __gen_tempname (template, __GT_BIGFILE, 0, 0, S_IRUSR | S_IWUSR);
}
diff --git a/libc/stdlib/mkostemp.c b/libc/stdlib/mkstemps.c
similarity index 69%
copy from libc/stdlib/mkostemp.c
copy to libc/stdlib/mkstemps.c
index 912be30..22aebf4 100644
--- a/libc/stdlib/mkostemp.c
+++ b/libc/stdlib/mkstemps.c
@@ -17,16 +17,17 @@
#include <stdio.h>
#include <stdlib.h>
-#include <fcntl.h>
+#include <sys/stat.h>
#include "../misc/internals/tempname.h"
/* 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.
+ The TEMPLATE is of the form "XXXXXXsuffix" where six characters
+ after the TEMPLATE must be "XXXXXX" followed by the suffix.
+ The suffix length must be specified with suffixlen.
+ "XXXXXX" are replaced with a string that makes the filename unique.
Then open the file and return a fd. */
-int
-mkostemp (char *template, int flags)
+int mkstemps (char *template, int suffixlen)
{
- flags -= flags & O_ACCMODE; /* Remove O_RDONLY, O_WRONLY, and O_RDWR. */
- return __gen_tempname (template, __GT_FILE, flags, S_IRUSR | S_IWUSR);
+ return __gen_tempname (template, __GT_FILE, 0, suffixlen,
+ S_IRUSR | S_IWUSR);
}
diff --git a/libc/stdlib/mkostemp.c b/libc/stdlib/mkstemps64.c
similarity index 68%
copy from libc/stdlib/mkostemp.c
copy to libc/stdlib/mkstemps64.c
index 912be30..19fb4c8 100644
--- a/libc/stdlib/mkostemp.c
+++ b/libc/stdlib/mkstemps64.c
@@ -17,16 +17,17 @@
#include <stdio.h>
#include <stdlib.h>
-#include <fcntl.h>
+#include <sys/stat.h>
#include "../misc/internals/tempname.h"
/* 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.
+ The TEMPLATE is of the form "XXXXXXsuffix" where six characters
+ after the TEMPLATE must be "XXXXXX" followed by the suffix.
+ The suffix length must be specified with suffixlen.
+ "XXXXXX" are replaced with a string that makes the filename unique.
Then open the file and return a fd. */
-int
-mkostemp (char *template, int flags)
+int mkstemps64 (char *template, int suffixlen)
{
- flags -= flags & O_ACCMODE; /* Remove O_RDONLY, O_WRONLY, and O_RDWR. */
- return __gen_tempname (template, __GT_FILE, flags, S_IRUSR | S_IWUSR);
+ return __gen_tempname (template, __GT_BIGFILE, 0, suffixlen,
+ S_IRUSR | S_IWUSR);
}
diff --git a/libc/stdlib/mktemp.c b/libc/stdlib/mktemp.c
index 4035966..be88153 100644
--- a/libc/stdlib/mktemp.c
+++ b/libc/stdlib/mktemp.c
@@ -24,7 +24,7 @@
* they are replaced with a string that makes the filename unique. */
char *mktemp(char *template)
{
- if (__gen_tempname (template, __GT_NOCREATE, 0, 0) < 0)
+ if (__gen_tempname (template, __GT_NOCREATE, 0,0, 0) < 0)
/* We return the null string if we can't find a unique file name. */
template[0] = '\0';
diff --git a/libpthread/nptl/sem_open.c b/libpthread/nptl/sem_open.c
index 3a72079..5584557 100644
--- a/libpthread/nptl/sem_open.c
+++ b/libpthread/nptl/sem_open.c
@@ -336,7 +336,7 @@ sem_open (const char *name, int oflag, ...)
mempcpy (mempcpy (tmpfname, mountpoint.dir, mountpoint.dirlen),
"XXXXXX", 7);
- fd = __gen_tempname (tmpfname, __GT_FILE, 0, mode);
+ fd = __gen_tempname (tmpfname, __GT_FILE, 0, 0, mode);
if (fd == -1)
return SEM_FAILED;
--
2.4.3
Hi Waldemar,
I started to play more with uClibc-ng and in particular tried to integrate it in OpenWRT build system.
And even thought I got all built from the first attempt on boot kernel reported init failure.
Basically it was because missing ld-uClibc.so.0 against which all dynamically linked apps were built.
I noticed in Buildroot we cure that manually this way
http://git.buildroot.net/buildroot/commit/package/uclibc/uclibc.mk?id=1deb4…
But problem with that approach is each and every build system/script will need to care about creation of those
links, which is a bit inconvenient. People don't expect that kind of a problem so it will make witch
from vanilla uClibc to uClibc-ng not completely painless.
So I'm wondering if in uClibc-ng itself we may have creation of corresponding links and later installation
of them on target?
-Alexey
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via 9b9abfbd25d5f95010241bdd72941dafecd56b0e (commit)
from c524cff4ee8ea4b22caa031e44de1bee3bae5ed6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9b9abfbd25d5f95010241bdd72941dafecd56b0e
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sat Aug 15 00:23:19 2015 +0200
ldso: install backward compatibility symlink by default
Simplify the switch from uClibc to uClibc-ng suggested
by Alexey Brodkin <Alexey.Brodkin(a)synopsys.com>.
Gcc always uses .0 ld.so link, so install it by default.
-----------------------------------------------------------------------
Summary of changes:
ldso/ldso/Makefile.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ldso/ldso/Makefile.in b/ldso/ldso/Makefile.in
index 424131c..21e0dbc 100644
--- a/ldso/ldso/Makefile.in
+++ b/ldso/ldso/Makefile.in
@@ -74,6 +74,8 @@ $(ldso): $(ldso:.$(ABI_VERSION)=)
$(ldso:.$(ABI_VERSION)=): | $(top_builddir)lib
$(ldso:.$(ABI_VERSION)=): $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a
$(call link.so,$(ldso_FULL_NAME),$(ABI_VERSION))
+ # link for backward compatibility
+ $(call link.so,$(ldso_FULL_NAME),0)
$($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a: $(ldso-y)
$(Q)$(RM) $@
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, 1.0 has been updated
via f52fb21a7af0aa4e983b3e6c2ddd1b6a526b5169 (commit)
from 25d02e00d0b9c3c981e18babd9d6dbc19f0a2787 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f52fb21a7af0aa4e983b3e6c2ddd1b6a526b5169
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sat Aug 15 00:23:01 2015 +0200
ldso: install backward compatibility symlink by default
Simplify the switch from uClibc to uClibc-ng suggested
by Alexey Brodkin <Alexey.Brodkin(a)synopsys.com>.
Gcc always uses .0 ld.so link, so install it by default.
-----------------------------------------------------------------------
Summary of changes:
ldso/ldso/Makefile.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ldso/ldso/Makefile.in b/ldso/ldso/Makefile.in
index 424131c..21e0dbc 100644
--- a/ldso/ldso/Makefile.in
+++ b/ldso/ldso/Makefile.in
@@ -74,6 +74,8 @@ $(ldso): $(ldso:.$(ABI_VERSION)=)
$(ldso:.$(ABI_VERSION)=): | $(top_builddir)lib
$(ldso:.$(ABI_VERSION)=): $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a
$(call link.so,$(ldso_FULL_NAME),$(ABI_VERSION))
+ # link for backward compatibility
+ $(call link.so,$(ldso_FULL_NAME),0)
$($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a: $(ldso-y)
$(Q)$(RM) $@
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via c524cff4ee8ea4b22caa031e44de1bee3bae5ed6 (commit)
from 4ff3a6c8eb91db71d6dc3d2932b66e848bd20ac3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c524cff4ee8ea4b22caa031e44de1bee3bae5ed6
Author: Romain Naour <romain.naour(a)openwide.fr>
Date: Sat Aug 1 18:31:06 2015 +0200
add mkstemps, mkstemps64 and mkostemps, mkostemps64 functions
Change __gen_tempname() prototype in order to pass the additional
suffix lenght. In __gen_tempname() add a new check for suffixlen.
Update some comments in the code.
Signed-off-by: Romain Naour <romain.naour(a)openwide.fr>
Signed-off-by: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
-----------------------------------------------------------------------
Summary of changes:
include/stdlib.h | 49 +++++++++++++++++++++++++++++
libc/misc/internals/tempname.c | 16 +++++-----
libc/misc/internals/tempname.h | 3 +-
libc/stdio/tempnam.c | 2 +-
libc/stdio/tmpfile.c | 2 +-
libc/stdio/tmpnam.c | 2 +-
libc/stdio/tmpnam_r.c | 2 +-
libc/stdlib/Makefile.in | 6 ++--
libc/stdlib/mkdtemp.c | 2 +-
libc/stdlib/mkostemp.c | 2 +-
libc/stdlib/mkostemp64.c | 3 +-
libc/stdlib/{mkostemp.c => mkostemps.c} | 14 ++++++---
libc/stdlib/{mkostemp.c => mkostemps64.c} | 12 ++++---
libc/stdlib/mkstemp.c | 2 +-
libc/stdlib/mkstemp64.c | 2 +-
libc/stdlib/{mkostemp.c => mkstemps.c} | 15 ++++-----
libc/stdlib/{mkostemp.c => mkstemps64.c} | 15 ++++-----
libc/stdlib/mktemp.c | 2 +-
libpthread/nptl/sem_open.c | 2 +-
19 files changed, 107 insertions(+), 46 deletions(-)
copy libc/stdlib/{mkostemp.c => mkostemps.c} (71%)
copy libc/stdlib/{mkostemp.c => mkostemps64.c} (71%)
copy libc/stdlib/{mkostemp.c => mkstemps.c} (69%)
copy libc/stdlib/{mkostemp.c => mkstemps64.c} (68%)
diff --git a/include/stdlib.h b/include/stdlib.h
index 809256d..ba8849e 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -644,6 +644,35 @@ extern int mkstemp64 (char *__template) __nonnull ((1)) __wur;
# endif
#endif
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+# if defined __UCLIBC_SUSV3_LEGACY__
+extern char *mktemps (char *__template, int __suffixlen) __THROW __nonnull ((1)) __wur;
+# endif
+
+/* The mkstemps() function is like mkstemp(), except that the string in
+ template contains a suffix of suffixlen characters. Thus, template is
+ of the form prefixXXXXXXsuffix, and the string XXXXXX is modified as
+ for mkstemp().
+ 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 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";
@@ -673,7 +702,27 @@ extern int __REDIRECT (mkostemp, (char *__template, int __flags), mkostemp64)
# ifdef __USE_LARGEFILE64
extern int mkostemp64 (char *__template, int __flags) __nonnull ((1)) __wur;
# endif
+#endif
+#ifdef __USE_GNU
+/* Generate a unique temporary file name from TEMPLATE similar to
+ mkostemp. But allow the caller to pass additional file name suffix.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+# ifndef __USE_FILE_OFFSET64
+extern int mkostemps (char *__template, int __suffixlen, int __flags) __nonnull ((1)) __wur;
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (mkostemps, (char *__template, int __suffixlen, int __flags), mkostemps64)
+ __nonnull ((1)) __wur;
+# else
+# define mkostemps mkostemps64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int mkostemps64 (char *__template, int __suffixlen, int __flags) __nonnull ((1)) __wur;
+# endif
#endif
diff --git a/libc/misc/internals/tempname.c b/libc/misc/internals/tempname.c
index edcc31c..7654eb4 100644
--- a/libc/misc/internals/tempname.c
+++ b/libc/misc/internals/tempname.c
@@ -163,10 +163,10 @@ static void brain_damaged_fillrand(unsigned char *buf, unsigned int len)
}
}
-/* Generate a temporary file name based on TMPL. TMPL must match the
- rules for mk[s]temp (i.e. end in "XXXXXX"). The name constructed
- does not exist at the time of the call to __gen_tempname. TMPL is
- overwritten with the result.
+/* Generate a temporary file name based on TMPL. TMPL must match the
+ rules for mk[s]temp[s] (i.e. end in "prefixXXXXXXsuffix"). The name
+ constructed does not exist at the time of the call to __gen_tempname.
+ TMPL is overwritten with the result.
KIND may be one of:
__GT_NOCREATE: simply verify that the name does not exist
@@ -177,7 +177,8 @@ static void brain_damaged_fillrand(unsigned char *buf, unsigned int len)
__GT_DIR: create a directory with given mode.
*/
-int attribute_hidden __gen_tempname (char *tmpl, int kind, int flags, mode_t mode)
+int attribute_hidden __gen_tempname (char *tmpl, int kind, int flags,
+ int suffixlen, mode_t mode)
{
char *XXXXXX;
unsigned int i;
@@ -187,8 +188,9 @@ int attribute_hidden __gen_tempname (char *tmpl, int kind, int flags, mode_t mod
len = strlen (tmpl);
/* This is where the Xs start. */
- XXXXXX = tmpl + len - 6;
- if (len < 6 || strcmp (XXXXXX, "XXXXXX"))
+ XXXXXX = tmpl + len - 6 - suffixlen;
+ if (len < 6 || suffixlen < 0 || suffixlen > len - 6
+ || strncmp (XXXXXX, "XXXXXX", 6))
{
__set_errno (EINVAL);
return -1;
diff --git a/libc/misc/internals/tempname.h b/libc/misc/internals/tempname.h
index edfe26d..cc20f75 100644
--- a/libc/misc/internals/tempname.h
+++ b/libc/misc/internals/tempname.h
@@ -10,7 +10,8 @@ extern int ___path_search (char *tmpl, size_t tmpl_len, const char *dir,
const char *pfx /*, int try_tmpdir */) attribute_hidden;
#define __path_search(tmpl, tmpl_len, dir, pfx, try_tmpdir) ___path_search(tmpl, tmpl_len, dir, pfx)
-extern int __gen_tempname (char *__tmpl, int __kind, int flags, mode_t mode) attribute_hidden;
+extern int __gen_tempname (char *__tmpl, int __kind, int flags,
+ int suffixlen, mode_t mode) attribute_hidden;
/* The __kind argument to __gen_tempname may be one of: */
#define __GT_FILE 0 /* create a file */
diff --git a/libc/stdio/tempnam.c b/libc/stdio/tempnam.c
index 5ef199e..46c9210 100644
--- a/libc/stdio/tempnam.c
+++ b/libc/stdio/tempnam.c
@@ -35,7 +35,7 @@ tempnam (const char *dir, const char *pfx)
if (__path_search (buf, FILENAME_MAX, dir, pfx, 1))
return NULL;
- if (__gen_tempname (buf, __GT_NOCREATE, 0, 0))
+ if (__gen_tempname (buf, __GT_NOCREATE, 0, 0, 0))
return NULL;
return strdup (buf);
diff --git a/libc/stdio/tmpfile.c b/libc/stdio/tmpfile.c
index 83c85b5..3654f9e 100644
--- a/libc/stdio/tmpfile.c
+++ b/libc/stdio/tmpfile.c
@@ -35,7 +35,7 @@ FILE * tmpfile (void)
if (__path_search (buf, FILENAME_MAX, NULL, "tmpf", 0))
return NULL;
- fd = __gen_tempname (buf, __GT_FILE, 0, S_IRUSR | S_IWUSR);
+ fd = __gen_tempname (buf, __GT_FILE, 0, 0, S_IRUSR | S_IWUSR);
if (fd < 0)
return NULL;
diff --git a/libc/stdio/tmpnam.c b/libc/stdio/tmpnam.c
index 52997d3..a9f6796 100644
--- a/libc/stdio/tmpnam.c
+++ b/libc/stdio/tmpnam.c
@@ -40,7 +40,7 @@ tmpnam (char *s)
0))
return NULL;
- if (__builtin_expect (__gen_tempname (tmpbuf, __GT_NOCREATE, 0, 0), 0))
+ if (__builtin_expect (__gen_tempname (tmpbuf, __GT_NOCREATE, 0, 0, 0), 0))
return NULL;
if (s == NULL)
diff --git a/libc/stdio/tmpnam_r.c b/libc/stdio/tmpnam_r.c
index 3cc48b0..2e70c2d 100644
--- a/libc/stdio/tmpnam_r.c
+++ b/libc/stdio/tmpnam_r.c
@@ -27,7 +27,7 @@ char * tmpnam_r (char *s)
if (__path_search (s, L_tmpnam, NULL, NULL, 0))
return NULL;
- if (__gen_tempname (s, __GT_NOCREATE, 0, 0))
+ if (__gen_tempname (s, __GT_NOCREATE, 0, 0, 0))
return NULL;
return s;
diff --git a/libc/stdlib/Makefile.in b/libc/stdlib/Makefile.in
index f106da7..3b2c66f 100644
--- a/libc/stdlib/Makefile.in
+++ b/libc/stdlib/Makefile.in
@@ -11,8 +11,8 @@ include $(top_srcdir)libc/stdlib/malloc/Makefile.in
CSRC-y := \
abort.c getenv.c mkdtemp.c realpath.c canonicalize.c mkstemp.c mkostemp.c \
- rand.c random.c random_r.c setenv.c div.c ldiv.c lldiv.c \
- getpt.c drand48-iter.c jrand48.c \
+ mkstemps.c mkostemps.c rand.c random.c random_r.c setenv.c div.c ldiv.c \
+ lldiv.c getpt.c drand48-iter.c jrand48.c \
jrand48_r.c lcong48.c lrand48.c lrand48_r.c mrand48.c mrand48_r.c nrand48.c \
nrand48_r.c rand_r.c srand48.c srand48_r.c seed48.c seed48_r.c \
a64l.c l64a.c __uc_malloc.c
@@ -20,7 +20,7 @@ CSRC-$(UCLIBC_SUSV2_LEGACY) += valloc.c
CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_memalign.c
CSRC-$(UCLIBC_HAS_PTY) += grantpt.c unlockpt.c ptsname.c
CSRC-$(UCLIBC_HAS_ARC4RANDOM) += arc4random.c
-CSRC-$(UCLIBC_HAS_LFS) += mkstemp64.c mkostemp64.c
+CSRC-$(UCLIBC_HAS_LFS) += mkstemp64.c mkostemp64.c mkstemps64.c mkostemps64.c
CSRC-$(UCLIBC_HAS_FLOATS) += drand48.c drand48_r.c erand48.c erand48_r.c
CSRC-$(if $(findstring yy,$(UCLIBC_HAS_FLOATS)$(UCLIBC_SUSV3_LEGACY)),y) += \
gcvt.c
diff --git a/libc/stdlib/mkdtemp.c b/libc/stdlib/mkdtemp.c
index e6d4a36..185e206 100644
--- a/libc/stdlib/mkdtemp.c
+++ b/libc/stdlib/mkdtemp.c
@@ -29,7 +29,7 @@
(This function comes from OpenBSD.) */
char * mkdtemp (char *template)
{
- if (__gen_tempname (template, __GT_DIR, 0, S_IRUSR | S_IWUSR | S_IXUSR))
+ if (__gen_tempname (template, __GT_DIR, 0, 0, S_IRUSR | S_IWUSR | S_IXUSR))
return NULL;
else
return template;
diff --git a/libc/stdlib/mkostemp.c b/libc/stdlib/mkostemp.c
index 912be30..4eab079 100644
--- a/libc/stdlib/mkostemp.c
+++ b/libc/stdlib/mkostemp.c
@@ -28,5 +28,5 @@ int
mkostemp (char *template, int flags)
{
flags -= flags & O_ACCMODE; /* Remove O_RDONLY, O_WRONLY, and O_RDWR. */
- return __gen_tempname (template, __GT_FILE, flags, S_IRUSR | S_IWUSR);
+ return __gen_tempname (template, __GT_FILE, flags, 0, S_IRUSR | S_IWUSR);
}
diff --git a/libc/stdlib/mkostemp64.c b/libc/stdlib/mkostemp64.c
index c6d6d84..25595ad 100644
--- a/libc/stdlib/mkostemp64.c
+++ b/libc/stdlib/mkostemp64.c
@@ -27,5 +27,6 @@
int
mkostemp64 (char *template, int flags)
{
- return __gen_tempname (template, __GT_BIGFILE, flags | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IXUSR);
+ return __gen_tempname (template, __GT_BIGFILE, flags | O_LARGEFILE, 0,
+ S_IRUSR | S_IWUSR | S_IXUSR);
}
diff --git a/libc/stdlib/mkostemp.c b/libc/stdlib/mkostemps.c
similarity index 71%
copy from libc/stdlib/mkostemp.c
copy to libc/stdlib/mkostemps.c
index 912be30..13a5171 100644
--- a/libc/stdlib/mkostemp.c
+++ b/libc/stdlib/mkostemps.c
@@ -21,12 +21,16 @@
#include "../misc/internals/tempname.h"
/* 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.
+ The TEMPLATE is of the form "XXXXXXsuffix" where six characters
+ after the TEMPLATE must be "XXXXXX" followed by the suffix.
+ The suffix length must be specified with suffixlen.
+ "XXXXXX" are replaced with a string that makes the filename unique.
Then open the file and return a fd. */
-int
-mkostemp (char *template, int flags)
+int mkostemps (char *template, int suffixlen, int flags)
{
flags -= flags & O_ACCMODE; /* Remove O_RDONLY, O_WRONLY, and O_RDWR. */
- return __gen_tempname (template, __GT_FILE, flags, S_IRUSR | S_IWUSR);
+ return __gen_tempname (template, __GT_FILE, flags, suffixlen,
+ S_IRUSR | S_IWUSR);
}
+
+
diff --git a/libc/stdlib/mkostemp.c b/libc/stdlib/mkostemps64.c
similarity index 71%
copy from libc/stdlib/mkostemp.c
copy to libc/stdlib/mkostemps64.c
index 912be30..0436fcf 100644
--- a/libc/stdlib/mkostemp.c
+++ b/libc/stdlib/mkostemps64.c
@@ -21,12 +21,14 @@
#include "../misc/internals/tempname.h"
/* 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.
+ The TEMPLATE is of the form "XXXXXXsuffix" where six characters
+ after the TEMPLATE must be "XXXXXX" followed by the suffix.
+ The suffix length must be specified with suffixlen.
+ "XXXXXX" are replaced with a string that makes the filename unique.
Then open the file and return a fd. */
-int
-mkostemp (char *template, int flags)
+int mkostemps64 (char *template, int suffixlen, int flags)
{
flags -= flags & O_ACCMODE; /* Remove O_RDONLY, O_WRONLY, and O_RDWR. */
- return __gen_tempname (template, __GT_FILE, flags, S_IRUSR | S_IWUSR);
+ return __gen_tempname (template, __GT_FILE, flags, suffixlen,
+ S_IRUSR | S_IWUSR);
}
diff --git a/libc/stdlib/mkstemp.c b/libc/stdlib/mkstemp.c
index a3a1595..abcc93e 100644
--- a/libc/stdlib/mkstemp.c
+++ b/libc/stdlib/mkstemp.c
@@ -26,5 +26,5 @@
Then open the file and return a fd. */
int mkstemp (char *template)
{
- return __gen_tempname (template, __GT_FILE, 0, S_IRUSR | S_IWUSR);
+ return __gen_tempname (template, __GT_FILE, 0, 0, S_IRUSR | S_IWUSR);
}
diff --git a/libc/stdlib/mkstemp64.c b/libc/stdlib/mkstemp64.c
index 6f2ee3e..82c6da5 100644
--- a/libc/stdlib/mkstemp64.c
+++ b/libc/stdlib/mkstemp64.c
@@ -26,5 +26,5 @@
Then open the file and return a fd. */
int mkstemp64 (char *template)
{
- return __gen_tempname (template, __GT_BIGFILE, 0, S_IRUSR | S_IWUSR);
+ return __gen_tempname (template, __GT_BIGFILE, 0, 0, S_IRUSR | S_IWUSR);
}
diff --git a/libc/stdlib/mkostemp.c b/libc/stdlib/mkstemps.c
similarity index 69%
copy from libc/stdlib/mkostemp.c
copy to libc/stdlib/mkstemps.c
index 912be30..22aebf4 100644
--- a/libc/stdlib/mkostemp.c
+++ b/libc/stdlib/mkstemps.c
@@ -17,16 +17,17 @@
#include <stdio.h>
#include <stdlib.h>
-#include <fcntl.h>
+#include <sys/stat.h>
#include "../misc/internals/tempname.h"
/* 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.
+ The TEMPLATE is of the form "XXXXXXsuffix" where six characters
+ after the TEMPLATE must be "XXXXXX" followed by the suffix.
+ The suffix length must be specified with suffixlen.
+ "XXXXXX" are replaced with a string that makes the filename unique.
Then open the file and return a fd. */
-int
-mkostemp (char *template, int flags)
+int mkstemps (char *template, int suffixlen)
{
- flags -= flags & O_ACCMODE; /* Remove O_RDONLY, O_WRONLY, and O_RDWR. */
- return __gen_tempname (template, __GT_FILE, flags, S_IRUSR | S_IWUSR);
+ return __gen_tempname (template, __GT_FILE, 0, suffixlen,
+ S_IRUSR | S_IWUSR);
}
diff --git a/libc/stdlib/mkostemp.c b/libc/stdlib/mkstemps64.c
similarity index 68%
copy from libc/stdlib/mkostemp.c
copy to libc/stdlib/mkstemps64.c
index 912be30..19fb4c8 100644
--- a/libc/stdlib/mkostemp.c
+++ b/libc/stdlib/mkstemps64.c
@@ -17,16 +17,17 @@
#include <stdio.h>
#include <stdlib.h>
-#include <fcntl.h>
+#include <sys/stat.h>
#include "../misc/internals/tempname.h"
/* 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.
+ The TEMPLATE is of the form "XXXXXXsuffix" where six characters
+ after the TEMPLATE must be "XXXXXX" followed by the suffix.
+ The suffix length must be specified with suffixlen.
+ "XXXXXX" are replaced with a string that makes the filename unique.
Then open the file and return a fd. */
-int
-mkostemp (char *template, int flags)
+int mkstemps64 (char *template, int suffixlen)
{
- flags -= flags & O_ACCMODE; /* Remove O_RDONLY, O_WRONLY, and O_RDWR. */
- return __gen_tempname (template, __GT_FILE, flags, S_IRUSR | S_IWUSR);
+ return __gen_tempname (template, __GT_BIGFILE, 0, suffixlen,
+ S_IRUSR | S_IWUSR);
}
diff --git a/libc/stdlib/mktemp.c b/libc/stdlib/mktemp.c
index 4035966..be88153 100644
--- a/libc/stdlib/mktemp.c
+++ b/libc/stdlib/mktemp.c
@@ -24,7 +24,7 @@
* they are replaced with a string that makes the filename unique. */
char *mktemp(char *template)
{
- if (__gen_tempname (template, __GT_NOCREATE, 0, 0) < 0)
+ if (__gen_tempname (template, __GT_NOCREATE, 0,0, 0) < 0)
/* We return the null string if we can't find a unique file name. */
template[0] = '\0';
diff --git a/libpthread/nptl/sem_open.c b/libpthread/nptl/sem_open.c
index 3a72079..5584557 100644
--- a/libpthread/nptl/sem_open.c
+++ b/libpthread/nptl/sem_open.c
@@ -336,7 +336,7 @@ sem_open (const char *name, int oflag, ...)
mempcpy (mempcpy (tmpfname, mountpoint.dir, mountpoint.dirlen),
"XXXXXX", 7);
- fd = __gen_tempname (tmpfname, __GT_FILE, 0, mode);
+ fd = __gen_tempname (tmpfname, __GT_FILE, 0, 0, mode);
if (fd == -1)
return SEM_FAILED;
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, 1.0 has been updated
via 25d02e00d0b9c3c981e18babd9d6dbc19f0a2787 (commit)
via 4a05ed87ceb946608100642121c32e642b58cd0d (commit)
via 414ce5018d2cdf0dc8ebe880dc5350f3513420ec (commit)
from 6cf35f84045f38f067365623886fecff16ca92f9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 25d02e00d0b9c3c981e18babd9d6dbc19f0a2787
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Sat Jun 13 13:08:11 2015 -0500
fix some type differences to linux-next for h8/300
commit 4a05ed87ceb946608100642121c32e642b58cd0d
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Mon Aug 10 21:41:27 2015 +0200
glibc compat: bump glibc minor version
See this discussion:
http://lists.busybox.net/pipermail/buildroot/2015-August/137229.html
Should help to fix compile issues with boost for ARC.
commit 414ce5018d2cdf0dc8ebe880dc5350f3513420ec
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Mon Aug 10 21:39:01 2015 +0200
getenv: allow overwriting of function
This fixes static compile issues of sudo, because sudo
uses it's own getenv implementation.
-----------------------------------------------------------------------
Summary of changes:
include/features.h | 2 +-
libc/stdlib/getenv.c | 2 +-
libc/sysdeps/linux/h8300/bits/kernel_types.h | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/features.h b/include/features.h
index dcf1348..f6fbbf4 100644
--- a/include/features.h
+++ b/include/features.h
@@ -393,7 +393,7 @@ uClibc was built without large file support enabled.
these macros to test for features in specific releases. */
/* Don't do it, if you want to keep uClibc happy. */
#define __GLIBC__ 2
-#define __GLIBC_MINOR__ 2
+#define __GLIBC_MINOR__ 10
#endif
#define __GLIBC_PREREQ(maj, min) \
diff --git a/libc/stdlib/getenv.c b/libc/stdlib/getenv.c
index d5db178..9b04d0f 100644
--- a/libc/stdlib/getenv.c
+++ b/libc/stdlib/getenv.c
@@ -27,4 +27,4 @@ char *getenv(const char *var)
}
return NULL;
}
-libc_hidden_def(getenv)
+libc_hidden_weak(getenv)
diff --git a/libc/sysdeps/linux/h8300/bits/kernel_types.h b/libc/sysdeps/linux/h8300/bits/kernel_types.h
index 7e76891..198c034 100644
--- a/libc/sysdeps/linux/h8300/bits/kernel_types.h
+++ b/libc/sysdeps/linux/h8300/bits/kernel_types.h
@@ -16,9 +16,9 @@ typedef int __kernel_pid_t;
typedef unsigned short __kernel_ipc_pid_t;
typedef unsigned short __kernel_uid_t;
typedef unsigned short __kernel_gid_t;
-typedef unsigned int __kernel_size_t;
-typedef int __kernel_ssize_t;
-typedef int __kernel_ptrdiff_t;
+typedef unsigned long __kernel_size_t;
+typedef long __kernel_ssize_t;
+typedef long __kernel_ptrdiff_t;
typedef long __kernel_time_t;
typedef long __kernel_suseconds_t;
typedef long __kernel_clock_t;
hooks/post-receive
--
uClibc-ng - small C library for embedded systems