mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
* 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. * include/sys/mman.h (__mremap): Add ellipsis. * malloc/memusage.c: Adjust mremap wrapper for optional additional parameter.
This commit is contained in:
10
ChangeLog
10
ChangeLog
@ -1,5 +1,12 @@
|
|||||||
2005-10-14 Ulrich Drepper <drepper@redhat.com>
|
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/Makefile (tests): Add tst-ucontext-off.
|
||||||
* stdlib/tst-ucontext-off.c: New file.
|
* stdlib/tst-ucontext-off.c: New file.
|
||||||
* sysdeps/unix/sysv/linux/x86_64/ucontext_i.h (TEST): Define.
|
* sysdeps/unix/sysv/linux/x86_64/ucontext_i.h (TEST): Define.
|
||||||
@ -36,6 +43,9 @@
|
|||||||
adjust leading comment.
|
adjust leading comment.
|
||||||
* sysdeps/unix/sysv/linux/syscalls.list: Add pointer parameter to
|
* sysdeps/unix/sysv/linux/syscalls.list: Add pointer parameter to
|
||||||
mremap syscall.
|
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>
|
2005-10-13 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
@ -24,5 +24,6 @@ extern int __alphasort64 (const void *a, const void *b)
|
|||||||
__attribute_pure__;
|
__attribute_pure__;
|
||||||
extern int __versionsort64 (const void *a, const void *b)
|
extern int __versionsort64 (const void *a, const void *b)
|
||||||
__attribute_pure__;
|
__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
|
#endif
|
||||||
|
@ -11,5 +11,5 @@ extern int __mprotect (void *__addr, size_t __len, int __prot);
|
|||||||
|
|
||||||
/* This one is Linux specific. */
|
/* This one is Linux specific. */
|
||||||
extern void *__mremap (void *__addr, size_t __old_len,
|
extern void *__mremap (void *__addr, size_t __old_len,
|
||||||
size_t __new_len, int __may_move);
|
size_t __new_len, int __flags, ...);
|
||||||
#endif
|
#endif
|
||||||
|
@ -453,6 +453,33 @@ END LC_COLLATE
|
|||||||
|
|
||||||
LC_CTYPE
|
LC_CTYPE
|
||||||
copy "i18n"
|
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
|
END LC_CTYPE
|
||||||
|
|
||||||
LC_MESSAGES
|
LC_MESSAGES
|
||||||
@ -526,6 +553,7 @@ am_pm "";""
|
|||||||
t_fmt_ampm "<U0025><U0048><U002E><U0025><U004D><U002E><U0025><U0053>"
|
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>/
|
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>"
|
<U0020><U0025><U0041><U002C><U0020><U0025><U0048><U002E><U0025><U004D><U002E><U0025><U0053><U0020><U0025><U005A>"
|
||||||
|
week 7;19971201;4
|
||||||
END LC_TIME
|
END LC_TIME
|
||||||
|
|
||||||
LC_PAPER
|
LC_PAPER
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
#include <stdarg.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -44,7 +45,7 @@ static void (*freep) (void *);
|
|||||||
static void *(*mmapp) (void *, size_t, int, int, int, off_t);
|
static void *(*mmapp) (void *, size_t, int, int, int, off_t);
|
||||||
static void *(*mmap64p) (void *, size_t, int, int, int, off64_t);
|
static void *(*mmap64p) (void *, size_t, int, int, int, off64_t);
|
||||||
static int (*munmapp) (void *, size_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
|
enum
|
||||||
{
|
{
|
||||||
@ -226,8 +227,8 @@ me (void)
|
|||||||
mmap64p =
|
mmap64p =
|
||||||
(void *(*) (void *, size_t, int, int, int, off64_t)) dlsym (RTLD_NEXT,
|
(void *(*) (void *, size_t, int, int, int, off64_t)) dlsym (RTLD_NEXT,
|
||||||
"mmap64");
|
"mmap64");
|
||||||
mremapp = (void *(*) (void *, size_t, size_t, int)) dlsym (RTLD_NEXT,
|
mremapp = (void *(*) (void *, size_t, size_t, int, void *)) dlsym (RTLD_NEXT,
|
||||||
"mremap");
|
"mremap");
|
||||||
munmapp = (int (*) (void *, size_t)) dlsym (RTLD_NEXT, "munmap");
|
munmapp = (int (*) (void *, size_t)) dlsym (RTLD_NEXT, "munmap");
|
||||||
initialized = 1;
|
initialized = 1;
|
||||||
|
|
||||||
@ -649,9 +650,14 @@ mmap64 (void *start, size_t len, int prot, int flags, int fd, off64_t offset)
|
|||||||
/* `mmap' replacement. We do not have to keep track of the sizesince
|
/* `mmap' replacement. We do not have to keep track of the sizesince
|
||||||
`munmap' will get it as a parameter. */
|
`munmap' will get it as a parameter. */
|
||||||
void *
|
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;
|
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. */
|
/* Determine real implementation if not already happened. */
|
||||||
if (__builtin_expect (initialized <= 0, 0))
|
if (__builtin_expect (initialized <= 0, 0))
|
||||||
@ -662,7 +668,7 @@ mremap (void *start, size_t old_len, size_t len, int flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Always get a block. We don't need extra memory. */
|
/* 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)
|
if (!not_me && trace_mmap)
|
||||||
{
|
{
|
||||||
|
@ -29,14 +29,12 @@ fdopendir (int fd)
|
|||||||
struct stat64 statbuf;
|
struct stat64 statbuf;
|
||||||
|
|
||||||
if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &statbuf), 0) < 0)
|
if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &statbuf), 0) < 0)
|
||||||
goto out;
|
return NULL;
|
||||||
if (__builtin_expect (! S_ISDIR (statbuf.st_mode), 0))
|
if (__builtin_expect (! S_ISDIR (statbuf.st_mode), 0))
|
||||||
{
|
{
|
||||||
__set_errno (ENOTDIR);
|
__set_errno (ENOTDIR);
|
||||||
out:
|
|
||||||
close_not_cancel_no_status (fd);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return __alloc_dir (fd, &statbuf);
|
return __alloc_dir (fd, false, &statbuf);
|
||||||
}
|
}
|
||||||
|
@ -132,14 +132,14 @@ __opendir (const char *name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return __alloc_dir (fd, &statbuf);
|
return __alloc_dir (fd, true, &statbuf);
|
||||||
}
|
}
|
||||||
weak_alias (__opendir, opendir)
|
weak_alias (__opendir, opendir)
|
||||||
|
|
||||||
|
|
||||||
DIR *
|
DIR *
|
||||||
internal_function
|
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)
|
if (__builtin_expect (__fcntl (fd, F_SETFD, FD_CLOEXEC), 0) < 0)
|
||||||
goto lose;
|
goto lose;
|
||||||
@ -160,9 +160,12 @@ __alloc_dir (int fd, struct stat64 *statp)
|
|||||||
if (dirp == NULL)
|
if (dirp == NULL)
|
||||||
lose:
|
lose:
|
||||||
{
|
{
|
||||||
int save_errno = errno;
|
if (close_fd)
|
||||||
close_not_cancel_no_status (fd);
|
{
|
||||||
__set_errno (save_errno);
|
int save_errno = errno;
|
||||||
|
close_not_cancel_no_status (fd);
|
||||||
|
__set_errno (save_errno);
|
||||||
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
memset (dirp, '\0', sizeof (DIR));
|
memset (dirp, '\0', sizeof (DIR));
|
||||||
|
Reference in New Issue
Block a user