__alloc_dir.
(__alloc_dir): Only close descriptor on error if new parameter is true.
* sysdeps/unix/fdopendir.c (fdopendir): Pass extra argument to
__alloc_dir. Don't close fd on error.
* include/dirent.h (__alloc_dir): Adjust prototype.
* include/sys/mman.h (__mremap): Add ellipsis.
* malloc/memusage.c: Adjust mremap wrapper for optional additional
parameter.
2005-10-14 Ulrich Drepper <drepper@redhat.com>
+ * sysdeps/unix/opendir.c (__opendir): Pass extra argument to
+ __alloc_dir.
+ (__alloc_dir): Only close descriptor on error if new parameter is true.
+ * sysdeps/unix/fdopendir.c (fdopendir): Pass extra argument to
+ __alloc_dir. Don't close fd on error.
+ * include/dirent.h (__alloc_dir): Adjust prototype.
+
* stdlib/Makefile (tests): Add tst-ucontext-off.
* stdlib/tst-ucontext-off.c: New file.
* sysdeps/unix/sysv/linux/x86_64/ucontext_i.h (TEST): Define.
adjust leading comment.
* sysdeps/unix/sysv/linux/syscalls.list: Add pointer parameter to
mremap syscall.
+ * include/sys/mman.h (__mremap): Add ellipsis.
+ * malloc/memusage.c: Adjust mremap wrapper for optional additional
+ parameter.
2005-10-13 Ulrich Drepper <drepper@redhat.com>
__attribute_pure__;
extern int __versionsort64 (const void *a, const void *b)
__attribute_pure__;
-extern DIR *__alloc_dir (int fd, struct stat64 *statp) internal_function;
+extern DIR *__alloc_dir (int fd, bool close_fd, struct stat64 *statp)
+ internal_function;
#endif
/* This one is Linux specific. */
extern void *__mremap (void *__addr, size_t __old_len,
- size_t __new_len, int __may_move);
+ size_t __new_len, int __flags, ...);
#endif
LC_CTYPE
copy "i18n"
+
+translit_start
+
+include "translit_combining";""
+
+<U00C1> "<U0041><U0301>";"<U0041><U00B4>";"<U0041><U0027>"
+<U00C9> "<U0045><U0301>";"<U0045><U00B4>";"<U0045><U0027>"
+<U00CD> "<U0049><U0301>";"<U0049><U00B4>";"<U0049><U0027>"
+<U00D3> "<U004F><U0301>";"<U004F><U00B4>";"<U004F><U0027>"
+<U00D6> "<U004F><U0308>";"<U004F><U00A8>";"<U004F><U003A>"
+<U0150> "<U004F><U030B>";"<U004F><U02DD>";"<U004F><U0022>"
+<U00DA> "<U0055><U0301>";"<U0055><U00B4>";"<U0055><U0027>"
+<U00DC> "<U0055><U0308>";"<U0055><U00A8>";"<U0055><U003A>"
+<U0170> "<U0055><U030B>";"<U0055><U02DD>";"<U0055><U0022>"
+
+<U00E1> "<U0061><U0301>";"<U0061><U00B4>";"<U0061><U0027>"
+<U00E9> "<U0065><U0301>";"<U0065><U00B4>";"<U0065><U0027>"
+<U00ED> "<U0069><U0301>";"<U0069><U00B4>";"<U0069><U0027>"
+<U00F3> "<U006F><U0301>";"<U006F><U00B4>";"<U006F><U0027>"
+<U00F6> "<U006F><U0308>";"<U006F><U00A8>";"<U006F><U003A>"
+<U0151> "<U006F><U030B>";"<U006F><U02DD>";"<U006F><U0022>"
+<U00FA> "<U0075><U0301>";"<U0075><U00B4>";"<U0075><U0027>"
+<U00FC> "<U0075><U0308>";"<U0075><U00A8>";"<U0075><U003A>"
+<U0171> "<U0075><U030B>";"<U0075><U02DD>";"<U0075><U0022>"
+
+translit_end
+
END LC_CTYPE
LC_MESSAGES
t_fmt_ampm "<U0025><U0048><U002E><U0025><U004D><U002E><U0025><U0053>"
date_fmt "<U0025><U0059><U002E><U0020><U0025><U0062><U002E><U0020><U0025><U0065><U002E><U002C>/
<U0020><U0025><U0041><U002C><U0020><U0025><U0048><U002E><U0025><U004D><U002E><U0025><U0053><U0020><U0025><U005A>"
+week 7;19971201;4
END LC_TIME
LC_PAPER
#include <fcntl.h>
#include <inttypes.h>
#include <signal.h>
+#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
static void *(*mmapp) (void *, size_t, int, int, int, off_t);
static void *(*mmap64p) (void *, size_t, int, int, int, off64_t);
static int (*munmapp) (void *, size_t);
-static void *(*mremapp) (void *, size_t, size_t, int);
+static void *(*mremapp) (void *, size_t, size_t, int, void *);
enum
{
mmap64p =
(void *(*) (void *, size_t, int, int, int, off64_t)) dlsym (RTLD_NEXT,
"mmap64");
- mremapp = (void *(*) (void *, size_t, size_t, int)) dlsym (RTLD_NEXT,
- "mremap");
+ mremapp = (void *(*) (void *, size_t, size_t, int, void *)) dlsym (RTLD_NEXT,
+ "mremap");
munmapp = (int (*) (void *, size_t)) dlsym (RTLD_NEXT, "munmap");
initialized = 1;
/* `mmap' replacement. We do not have to keep track of the sizesince
`munmap' will get it as a parameter. */
void *
-mremap (void *start, size_t old_len, size_t len, int flags)
+mremap (void *start, size_t old_len, size_t len, int flags, ...)
{
void *result = NULL;
+ va_list ap;
+
+ va_start (ap, flags);
+ void *newaddr = (flags & MREMAP_FIXED) ? va_arg (ap, void *) : NULL;
+ va_end (ap);
/* Determine real implementation if not already happened. */
if (__builtin_expect (initialized <= 0, 0))
}
/* Always get a block. We don't need extra memory. */
- result = (*mremapp) (start, old_len, len, flags);
+ result = (*mremapp) (start, old_len, len, flags, newaddr);
if (!not_me && trace_mmap)
{
struct stat64 statbuf;
if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &statbuf), 0) < 0)
- goto out;
+ return NULL;
if (__builtin_expect (! S_ISDIR (statbuf.st_mode), 0))
{
__set_errno (ENOTDIR);
- out:
- close_not_cancel_no_status (fd);
return NULL;
}
- return __alloc_dir (fd, &statbuf);
+ return __alloc_dir (fd, false, &statbuf);
}
}
}
- return __alloc_dir (fd, &statbuf);
+ return __alloc_dir (fd, true, &statbuf);
}
weak_alias (__opendir, opendir)
DIR *
internal_function
-__alloc_dir (int fd, struct stat64 *statp)
+__alloc_dir (int fd, bool close_fd, struct stat64 *statp)
{
if (__builtin_expect (__fcntl (fd, F_SETFD, FD_CLOEXEC), 0) < 0)
goto lose;
if (dirp == NULL)
lose:
{
- int save_errno = errno;
- close_not_cancel_no_status (fd);
- __set_errno (save_errno);
+ if (close_fd)
+ {
+ int save_errno = errno;
+ close_not_cancel_no_status (fd);
+ __set_errno (save_errno);
+ }
return NULL;
}
memset (dirp, '\0', sizeof (DIR));