mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-14 17:11:06 +00:00
Updated to fedora-glibc-20060106T2148
This commit is contained in:
parent
dd486f53ee
commit
8c45a85e61
77
ChangeLog
77
ChangeLog
@ -1,3 +1,79 @@
|
||||
2006-01-06 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
[BZ #2114]
|
||||
* ncsd/aicache.c: Don't use sendfile for records on the stack.
|
||||
* nscd/grpcache.c: Likewise.
|
||||
* nscd/hstcache.c: Likewise.
|
||||
* nscd/initgrcache.c: Likewise.
|
||||
* nscd/pwdcache.c: Likewise.
|
||||
Patch by dmueller@suse.com.
|
||||
|
||||
* sysdeps/unix/sysv/linux/alpha/bits/mman.h: Define MADV_REMOVE.
|
||||
* sysdeps/unix/sysv/linux/i386/bits/mman.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/ia64/bits/mman.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/powerpc/bits/mman.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/s390/bits/mman.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sh/bits/mman.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sparc/bits/mman.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/bits/mman.h: Likewise.
|
||||
|
||||
2006-01-06 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* Makeconfig (+gnu-stabs): Remove ancient cruft.
|
||||
|
||||
[BZ #2103]
|
||||
* sysdeps/unix/sysv/linux/net/if_arp.h (ARPHRD_HWX25): Corrected macro
|
||||
name (was typo ARPHDR_HWX25).
|
||||
(ARPHRD_IEEE80211_PRISM, ARPHRD_IEEE80211_RADIOTAP): New macros.
|
||||
(ARPHRD_VOID, ARPHRD_NONE): New macros.
|
||||
|
||||
* sysdeps/wordsize-32/divdi3.c (__moddi3): Add a cast.
|
||||
|
||||
* io/fcntl.h [__USE_ATFILE] (AT_EACCESS): New macro.
|
||||
* posix/unistd.h [__USE_ATFILE]: Declare faccessat.
|
||||
* io/faccessat.c: New file.
|
||||
* sysdeps/unix/sysv/linux/faccessat.c: New file.
|
||||
* io/Makefile (routines): Add faccessat.
|
||||
* io/Versions (libc: GLIBC_2.4): Likewise.
|
||||
* io/tst-faccessat.c: New file.
|
||||
* io/Makefile (tests): Add it.
|
||||
|
||||
* scripts/check-local-headers.sh: Revert last change.
|
||||
|
||||
* io/euidaccess.c: Add eaccess as an alias.
|
||||
* sysdeps/mach/hurd/euidaccess.c: Likewise.
|
||||
* sysdeps/posix/euidaccess.c: Likewise.
|
||||
* posix/unistd.h [__USE_GNU]: Declare eaccess.
|
||||
* io/Versions (libc: GLIBC_2.4): Add eaccess.
|
||||
|
||||
2005-12-04 Joseph S. Myers <joseph@codesourcery.com>
|
||||
|
||||
* soft-fp/Makefile (gcc-single-routines): Add unordsf2,
|
||||
floatunsisf, floatundisf.
|
||||
(gcc-double-routines): Add unorddf2, floatunsidf, floatundidf.
|
||||
(gcc-quad-routines): Add unordtf2, floatunsitf, floatunditf.
|
||||
* soft-fp/op-common.h (_FP_CMP_UNORD): Define.
|
||||
* soft-fp/single.h (FP_CMP_UNORD_S): Define.
|
||||
* soft-fp/double.h (FP_CMP_UNORD_D): Define.
|
||||
* soft-fp/quad.h (FP_CMP_UNORD_Q): Define.
|
||||
* soft-fp/extended.h (FP_CMP_UNORD_E): Define.
|
||||
* soft-fp/unordsf2.c: New file.
|
||||
* soft-fp/unorddf2.c: New file.
|
||||
* soft-fp/unordtf2.c: New file.
|
||||
* soft-fp/floatunsisf.c: New file.
|
||||
* soft-fp/floatundisf.c: New file.
|
||||
* soft-fp/floatunsidf.c: New file.
|
||||
* soft-fp/floatundidf.c: New file.
|
||||
* soft-fp/floatunsitf.c: New file.
|
||||
* soft-fp/floatunditf.c: New file.
|
||||
|
||||
* soft-fp/op-common.h (__FP_CLZ): Define using __builtin_clz,
|
||||
__builtin_clzl and __builtin_clzll.
|
||||
|
||||
2006-01-05 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* include/alloca.h (extend_alloca): Fix typoed name 'extern_alloca'.
|
||||
|
||||
2006-01-05 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_WAITID_SYSCALL):
|
||||
@ -29,6 +105,7 @@
|
||||
* libio/stdio.h: Likewise.
|
||||
* posix/unistd.h: Likewise.
|
||||
* time/sys/time.h: Likewise.
|
||||
* io/sys/stat.h: Likewise.
|
||||
|
||||
* io/sys/stat.h [__USE_GNU]: Declare fchmodat.
|
||||
* io/fchmodat.c: New file.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991-2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991-2003,2004,2005,2006 Free Software Foundation, Inc.
|
||||
# This file is part of the GNU C Library.
|
||||
|
||||
# The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -742,8 +742,6 @@ endif
|
||||
endif
|
||||
ASFLAGS += $(ASFLAGS-config)
|
||||
|
||||
+gnu-stabs = $(shell echo>&2 '*** BARF ON ME')
|
||||
|
||||
ifndef BUILD_CC
|
||||
BUILD_CC = $(CC)
|
||||
endif
|
||||
|
@ -3,5 +3,5 @@ glibc-branch := fedora
|
||||
glibc-base := HEAD
|
||||
DIST_BRANCH := devel
|
||||
COLLECTION := dist-fc4
|
||||
fedora-sync-date := 2006-01-06 09:16 UTC
|
||||
fedora-sync-tag := fedora-glibc-20060106T0916
|
||||
fedora-sync-date := 2006-01-06 21:48 UTC
|
||||
fedora-sync-tag := fedora-glibc-20060106T2148
|
||||
|
@ -1,4 +1,4 @@
|
||||
%define glibcrelease 28
|
||||
%define glibcrelease 29
|
||||
%define auxarches i586 i686 athlon sparcv9 alphaev6
|
||||
%define prelinkarches noarch
|
||||
%define xenarches i686 athlon
|
||||
@ -1128,6 +1128,11 @@ rm -f *.filelist*
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Fri Jan 6 2006 Jakub Jelinek <jakub@redhat.com> 2.3.90-29
|
||||
- update from CVS
|
||||
- make pthread_mutex_t an unnamed union again, as it affects
|
||||
libstdc++ ABI mangling
|
||||
|
||||
* Fri Jan 6 2006 Jakub Jelinek <jakub@redhat.com> 2.3.90-28
|
||||
- update from CVS
|
||||
- make aio_suspend interruptible by signals (#171968)
|
||||
|
@ -42,7 +42,7 @@ extern int __libc_alloca_cutoff (size_t size) __attribute__ ((const));
|
||||
len = __newlen; \
|
||||
__newbuf; })
|
||||
#else
|
||||
# define extern_alloca(buf, len, newlen) \
|
||||
# define extend_alloca(buf, len, newlen) \
|
||||
__alloca (((len) = (newlen)))
|
||||
#endif
|
||||
|
||||
|
@ -35,10 +35,10 @@ routines := \
|
||||
fxstatat fxstatat64 \
|
||||
statfs fstatfs statfs64 fstatfs64 \
|
||||
statvfs fstatvfs statvfs64 fstatvfs64 \
|
||||
umask chmod fchmod lchmod fchmodat \
|
||||
umask chmod fchmod lchmod fchmodat \
|
||||
mkdir mkdirat \
|
||||
open open64 openat openat64 close \
|
||||
read write lseek lseek64 access euidaccess \
|
||||
read write lseek lseek64 access euidaccess faccessat \
|
||||
fcntl flock lockf lockf64 \
|
||||
dup dup2 pipe \
|
||||
creat creat64 \
|
||||
@ -64,7 +64,7 @@ test-srcs := ftwtest
|
||||
tests := test-utime test-stat test-stat2 test-lfs tst-getcwd \
|
||||
tst-fcntl bug-ftw1 bug-ftw2 bug-ftw3 bug-ftw4 tst-statvfs \
|
||||
tst-openat tst-unlinkat tst-fstatat tst-futimesat \
|
||||
tst-renameat tst-fchownat tst-fchmodat
|
||||
tst-renameat tst-fchownat tst-fchmodat tst-faccessat
|
||||
|
||||
distribute := ftwtest-sh
|
||||
|
||||
|
@ -98,6 +98,9 @@ libc {
|
||||
nftw; nftw64;
|
||||
}
|
||||
GLIBC_2.4 {
|
||||
eaccess;
|
||||
|
||||
faccessat;
|
||||
fchmodat;
|
||||
fchownat;
|
||||
__fxstatat; __fxstatat64;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Test for access to FILE using effective UID and GID. Stub version.
|
||||
Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1991,1995,1996,1997,2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -36,5 +36,7 @@ __euidaccess (file, type)
|
||||
return -1;
|
||||
}
|
||||
weak_alias (__euidaccess, euidaccess)
|
||||
weak_alias (__euidaccess, eaccess)
|
||||
stub_warning (euidaccess)
|
||||
stub_warning (eaccess)
|
||||
#include <stub-tag.h>
|
||||
|
51
io/faccessat.c
Normal file
51
io/faccessat.c
Normal file
@ -0,0 +1,51 @@
|
||||
/* Test for access to file, relative to open directory. Stub version.
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stddef.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
int
|
||||
faccessat (fd, file, type, flag)
|
||||
int fd;
|
||||
const char *file;
|
||||
int type;
|
||||
int flag;
|
||||
{
|
||||
if (file == NULL || (flag & ~(AT_SYMLINK_NOFOLLOW | AT_EACCESS)) != 0
|
||||
|| (type & ~(R_OK|W_OK|X_OK|F_OK)) != 0)
|
||||
{
|
||||
__set_errno (EINVAL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (fd < 0 && fd != AT_FDCWD)
|
||||
{
|
||||
__set_errno (EBADF);
|
||||
return -1;
|
||||
}
|
||||
|
||||
__set_errno (ENOSYS);
|
||||
return -1;
|
||||
}
|
||||
stub_warning (faccessat)
|
||||
|
||||
#include <stub-tag.h>
|
@ -63,6 +63,8 @@ __BEGIN_DECLS
|
||||
# define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */
|
||||
# define AT_REMOVEDIR 0x200 /* Remove directory instead of
|
||||
unlinking file. */
|
||||
# define AT_EACCESS 0x200 /* Test access permitted for
|
||||
effective IDs, not real IDs. */
|
||||
#endif
|
||||
|
||||
/* Do the file control operation described by CMD on FD.
|
||||
|
@ -228,7 +228,7 @@ extern int stat64 (__const char *__restrict __file,
|
||||
extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
#ifdef __USE_ATFILE
|
||||
/* Similar to stat, get the attributes for FILE and put them in BUF.
|
||||
Relative path names are interpreted relative to FD unless FD is
|
||||
AT_FDCWD. */
|
||||
@ -293,12 +293,12 @@ extern int lchmod (__const char *__file, __mode_t __mode)
|
||||
extern int fchmod (int __fd, __mode_t __mode) __THROW;
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
#ifdef __USE_ATFILE
|
||||
/* Set file access permissions of FILE relative to
|
||||
the directory FD is open on. */
|
||||
extern int fchmodat (int __fd, __const char *__file, __mode_t mode, int __flag)
|
||||
__THROW __nonnull ((2)) __wur;
|
||||
#endif /* Use GNU. */
|
||||
#endif /* Use ATFILE. */
|
||||
|
||||
|
||||
|
||||
@ -316,7 +316,7 @@ extern __mode_t getumask (void) __THROW;
|
||||
extern int mkdir (__const char *__path, __mode_t __mode)
|
||||
__THROW __nonnull ((1));
|
||||
|
||||
#ifdef __USE_GNU
|
||||
#ifdef __USE_ATFILE
|
||||
/* Like mkdir, create a new directory with permission bits MODE. But
|
||||
interpret relative PATH names relative to the directory associated
|
||||
with FD. */
|
||||
@ -332,7 +332,7 @@ extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev)
|
||||
__THROW __nonnull ((1));
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
#ifdef __USE_ATFILE
|
||||
/* Like mknod, create a new device file with permission bits MODE and
|
||||
device number DEV. But interpret relative PATH names relative to
|
||||
the directory associated with FD. */
|
||||
@ -345,7 +345,7 @@ extern int mknodat (int __fd, __const char *__path, __mode_t __mode,
|
||||
extern int mkfifo (__const char *__path, __mode_t __mode)
|
||||
__THROW __nonnull ((1));
|
||||
|
||||
#ifdef __USE_GNU
|
||||
#ifdef __USE_ATFILE
|
||||
/* Like mkfifo, create a new FIFO with permission bits MODE. But
|
||||
interpret relative PATH names relative to the directory associated
|
||||
with FD. */
|
||||
@ -450,7 +450,7 @@ __NTH (fstat (int __fd, struct stat *__statbuf))
|
||||
return __fxstat (_STAT_VER, __fd, __statbuf);
|
||||
}
|
||||
|
||||
# ifdef __USE_GNU
|
||||
# ifdef __USE_ATFILE
|
||||
extern __inline__ int
|
||||
__NTH (fstatat (int __fd, __const char *__filename, struct stat *__statbuf,
|
||||
int __flag))
|
||||
@ -467,7 +467,7 @@ __NTH (mknod (__const char *__path, __mode_t __mode, __dev_t __dev))
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef __USE_GNU
|
||||
# ifdef __USE_ATFILE
|
||||
extern __inline__ int
|
||||
__NTH (mknodat (int __fd, __const char *__path, __mode_t __mode,
|
||||
__dev_t __dev))
|
||||
|
153
io/tst-faccessat.c
Normal file
153
io/tst-faccessat.c
Normal file
@ -0,0 +1,153 @@
|
||||
/* Test for faccessat function. */
|
||||
|
||||
#include <dirent.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
static void prepare (void);
|
||||
#define PREPARE(argc, argv) prepare ()
|
||||
|
||||
static int do_test (void);
|
||||
#define TEST_FUNCTION do_test ()
|
||||
|
||||
#include "../test-skeleton.c"
|
||||
|
||||
static int dir_fd;
|
||||
|
||||
static void
|
||||
prepare (void)
|
||||
{
|
||||
size_t test_dir_len = strlen (test_dir);
|
||||
static const char dir_name[] = "/tst-faccessat.XXXXXX";
|
||||
|
||||
size_t dirbuflen = test_dir_len + sizeof (dir_name);
|
||||
char *dirbuf = malloc (dirbuflen);
|
||||
if (dirbuf == NULL)
|
||||
{
|
||||
puts ("out of memory");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
snprintf (dirbuf, dirbuflen, "%s%s", test_dir, dir_name);
|
||||
if (mkdtemp (dirbuf) == NULL)
|
||||
{
|
||||
puts ("cannot create temporary directory");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
add_temp_file (dirbuf);
|
||||
|
||||
dir_fd = open (dirbuf, O_RDONLY | O_DIRECTORY);
|
||||
if (dir_fd == -1)
|
||||
{
|
||||
puts ("cannot open directory");
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
do_test (void)
|
||||
{
|
||||
/* fdopendir takes over the descriptor, make a copy. */
|
||||
int dupfd = dup (dir_fd);
|
||||
if (dupfd == -1)
|
||||
{
|
||||
puts ("dup failed");
|
||||
return 1;
|
||||
}
|
||||
if (lseek (dupfd, 0, SEEK_SET) != 0)
|
||||
{
|
||||
puts ("1st lseek failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* The directory should be empty save the . and .. files. */
|
||||
DIR *dir = fdopendir (dupfd);
|
||||
if (dir == NULL)
|
||||
{
|
||||
puts ("fdopendir failed");
|
||||
return 1;
|
||||
}
|
||||
struct dirent64 *d;
|
||||
while ((d = readdir64 (dir)) != NULL)
|
||||
if (strcmp (d->d_name, ".") != 0 && strcmp (d->d_name, "..") != 0)
|
||||
{
|
||||
printf ("temp directory contains file \"%s\"\n", d->d_name);
|
||||
return 1;
|
||||
}
|
||||
closedir (dir);
|
||||
|
||||
/* Try to create a file. */
|
||||
int fd = openat (dir_fd, "some-file", O_CREAT|O_RDWR|O_EXCL, 0666);
|
||||
if (fd == -1)
|
||||
{
|
||||
if (errno == ENOSYS)
|
||||
{
|
||||
puts ("*at functions not supported");
|
||||
return 0;
|
||||
}
|
||||
|
||||
puts ("file creation failed");
|
||||
return 1;
|
||||
}
|
||||
write (fd, "hello", 5);
|
||||
puts ("file created");
|
||||
|
||||
close (fd);
|
||||
|
||||
int result = 0;
|
||||
|
||||
if (faccessat (dir_fd, "some-file", F_OK, AT_EACCESS))
|
||||
{
|
||||
printf ("faccessat F_OK: %m\n");
|
||||
result = 1;
|
||||
}
|
||||
if (faccessat (dir_fd, "some-file", W_OK, AT_EACCESS))
|
||||
{
|
||||
printf ("faccessat W_OK: %m\n");
|
||||
result = 1;
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
if (faccessat (dir_fd, "some-file", X_OK, AT_EACCESS) == 0
|
||||
|| errno != EACCES)
|
||||
{
|
||||
printf ("faccessat X_OK on nonexecutable: %m\n");
|
||||
result = 1;
|
||||
}
|
||||
|
||||
if (fchmodat (dir_fd, "some-file", 0400, 0) != 0)
|
||||
{
|
||||
printf ("fchownat failed: %m\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (faccessat (dir_fd, "some-file", R_OK, AT_EACCESS))
|
||||
{
|
||||
printf ("faccessat R_OK: %m\n");
|
||||
result = 1;
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
if (faccessat (dir_fd, "some-file", W_OK, AT_EACCESS) == 0
|
||||
|| errno != EACCES)
|
||||
{
|
||||
printf ("faccessat W_OK on unwritable file: %m\n");
|
||||
result = 1;
|
||||
}
|
||||
|
||||
if (unlinkat (dir_fd, "some-file", 0) != 0)
|
||||
{
|
||||
puts ("unlinkat failed");
|
||||
result = 1;
|
||||
}
|
||||
|
||||
close (dir_fd);
|
||||
|
||||
return result;
|
||||
}
|
@ -1,3 +1,19 @@
|
||||
2006-01-06 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* sysdeps/ia64/tls.h (tcbhead_t): Rename private membe to __private.
|
||||
* sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
|
||||
rename in tcbhead_t.
|
||||
|
||||
* sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
|
||||
Don't give the union a name because it changes the mangled name.
|
||||
Instead name the struct for __data.
|
||||
* sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
|
||||
* pthread_create.c (start_thread): Adjust robust mutex free loop.
|
||||
* descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
|
||||
|
||||
2006-01-05 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
|
||||
|
26
nptl/descr.h
26
nptl/descr.h
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@ -135,15 +135,15 @@ struct pthread
|
||||
pid_t pid;
|
||||
|
||||
/* List of robust mutexes the thread is holding. */
|
||||
pthread_mutex_t *robust_list;
|
||||
struct __pthread_mutex_s *robust_list;
|
||||
|
||||
#ifdef __PTHREAD_MUTEX_HAVE_PREV
|
||||
# define ENQUEUE_MUTEX(mutex) \
|
||||
do { \
|
||||
mutex->__data.__next = THREAD_GETMEM (THREAD_SELF, robust_list); \
|
||||
THREAD_SETMEM (THREAD_SELF, robust_list, mutex); \
|
||||
THREAD_SETMEM (THREAD_SELF, robust_list, &mutex->__data); \
|
||||
if (mutex->__data.__next != NULL) \
|
||||
mutex->__data.__next->__data.__prev = mutex; \
|
||||
mutex->__data.__next->__prev = &mutex->__data; \
|
||||
mutex->__data.__prev = NULL; \
|
||||
} while (0)
|
||||
# define DEQUEUE_MUTEX(mutex) \
|
||||
@ -151,9 +151,9 @@ struct pthread
|
||||
if (mutex->__data.__prev == NULL) \
|
||||
THREAD_SETMEM (THREAD_SELF, robust_list, mutex->__data.__next); \
|
||||
else \
|
||||
mutex->__data.__prev->__data.__next = mutex->__data.__next; \
|
||||
mutex->__data.__prev->__next = mutex->__data.__next; \
|
||||
if (mutex->__data.__next != NULL) \
|
||||
mutex->__data.__next->__data.__prev = mutex->__data.__prev; \
|
||||
mutex->__data.__next->__prev = mutex->__data.__prev; \
|
||||
mutex->__data.__prev = NULL; \
|
||||
mutex->__data.__next = NULL; \
|
||||
} while (0)
|
||||
@ -161,19 +161,19 @@ struct pthread
|
||||
# define ENQUEUE_MUTEX(mutex) \
|
||||
do { \
|
||||
mutex->__data.__next = THREAD_GETMEM (THREAD_SELF, robust_list); \
|
||||
THREAD_SETMEM (THREAD_SELF, robust_list, mutex); \
|
||||
THREAD_SETMEM (THREAD_SELF, robust_list, &mutex->__data); \
|
||||
} while (0)
|
||||
# define DEQUEUE_MUTEX(mutex) \
|
||||
do { \
|
||||
pthread_mutex_t *runp = THREAD_GETMEM (THREAD_SELF, robust_list); \
|
||||
if (runp == mutex) \
|
||||
THREAD_SETMEM (THREAD_SELF, robust_list, runp->__data.__next); \
|
||||
struct pthread_mutex_s *runp = THREAD_GETMEM (THREAD_SELF, robust_list); \
|
||||
if (runp == &mutex->__data) \
|
||||
THREAD_SETMEM (THREAD_SELF, robust_list, runp->__next); \
|
||||
else \
|
||||
{ \
|
||||
while (runp->__data.__next != mutex) \
|
||||
runp = runp->__data.__next; \
|
||||
while (runp->__next != &mutex->__data) \
|
||||
runp = runp->__next; \
|
||||
\
|
||||
runp->__data.__next = runp->__data.__next->__data.__next; \
|
||||
runp->__next = runp->__next->__next; \
|
||||
mutex->__data.__next = NULL; \
|
||||
} \
|
||||
} while (0)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@ -311,25 +311,25 @@ start_thread (void *arg)
|
||||
atomic_bit_set (&pd->cancelhandling, EXITING_BIT);
|
||||
|
||||
/* If this thread has any robust mutexes locked, handle them now. */
|
||||
pthread_mutex_t *robust = THREAD_GETMEM (pd, robust_list);
|
||||
struct __pthread_mutex_s *robust = THREAD_GETMEM (pd, robust_list);
|
||||
if (__builtin_expect (robust != NULL, 0))
|
||||
{
|
||||
do
|
||||
{
|
||||
pthread_mutex_t *this = robust;
|
||||
robust = robust->__data.__next;
|
||||
struct __pthread_mutex_s *this = robust;
|
||||
robust = robust->__next;
|
||||
|
||||
assert (lll_mutex_islocked (this->__data.__lock));
|
||||
this->__data.__count = 0;
|
||||
--this->__data.__nusers;
|
||||
assert (this->__data.__owner != PTHREAD_MUTEX_NOTRECOVERABLE);
|
||||
this->__data.__owner = PTHREAD_MUTEX_OWNERDEAD;
|
||||
this->__data.__next = NULL;
|
||||
assert (lll_mutex_islocked (this->__lock));
|
||||
this->__count = 0;
|
||||
--this->__nusers;
|
||||
assert (this->__owner != PTHREAD_MUTEX_NOTRECOVERABLE);
|
||||
this->__owner = PTHREAD_MUTEX_OWNERDEAD;
|
||||
this->__next = NULL;
|
||||
#ifdef __PTHREAD_MUTEX_HAVE_PREV
|
||||
this->__data.__prev = NULL;
|
||||
this->__prev = NULL;
|
||||
#endif
|
||||
|
||||
lll_mutex_unlock (this->__data.__lock);
|
||||
lll_mutex_unlock (this->__lock);
|
||||
}
|
||||
while (robust != NULL);
|
||||
|
||||
|
@ -4,4 +4,4 @@
|
||||
PID offsetof (struct pthread, pid) - TLS_PRE_TCB_SIZE
|
||||
TID offsetof (struct pthread, tid) - TLS_PRE_TCB_SIZE
|
||||
MULTIPLE_THREADS_OFFSET offsetof (struct pthread, header.multiple_threads) - TLS_PRE_TCB_SIZE
|
||||
SYSINFO_OFFSET offsetof (tcbhead_t, private)
|
||||
SYSINFO_OFFSET offsetof (tcbhead_t, __private)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Definition for thread-local data handling. nptl/IA-64 version.
|
||||
Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -44,7 +44,7 @@ typedef union dtv
|
||||
typedef struct
|
||||
{
|
||||
dtv_t *dtv;
|
||||
void *private;
|
||||
void *__private;
|
||||
} tcbhead_t;
|
||||
|
||||
register struct pthread *__thread_self __asm__("r13");
|
||||
@ -113,9 +113,9 @@ register struct pthread *__thread_self __asm__("r13");
|
||||
# define GET_DTV(descr) \
|
||||
(((tcbhead_t *) (descr))->dtv)
|
||||
|
||||
#define THREAD_SELF_SYSINFO (((tcbhead_t *) __thread_self)->private)
|
||||
#define THREAD_SELF_SYSINFO (((tcbhead_t *) __thread_self)->__private)
|
||||
#define THREAD_SYSINFO(pd) \
|
||||
(((tcbhead_t *) ((char *) (pd) + TLS_PRE_TCB_SIZE))->private)
|
||||
(((tcbhead_t *) ((char *) (pd) + TLS_PRE_TCB_SIZE))->__private)
|
||||
|
||||
#if defined NEED_DL_SYSINFO
|
||||
# define INIT_SYSINFO THREAD_SELF_SYSINFO = (void *) GLRO(dl_sysinfo)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -45,9 +45,9 @@ typedef union
|
||||
|
||||
/* Data structures for mutex handling. The structure of the attribute
|
||||
type is not exposed on purpose. */
|
||||
typedef union __pthread_mutex_u
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
struct __pthread_mutex_s
|
||||
{
|
||||
int __lock;
|
||||
unsigned int __count;
|
||||
@ -59,7 +59,7 @@ typedef union __pthread_mutex_u
|
||||
union
|
||||
{
|
||||
int __spins;
|
||||
union __pthread_mutex_u *__next;
|
||||
struct __pthread_mutex_s *__next;
|
||||
};
|
||||
} __data;
|
||||
char __size[__SIZEOF_PTHREAD_MUTEX_T];
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
|
||||
|
||||
@ -45,9 +45,9 @@ typedef union
|
||||
|
||||
/* Data structures for mutex handling. The structure of the attribute
|
||||
type is not exposed on purpose. */
|
||||
typedef union __pthread_mutex_u
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
struct __pthread_mutex_s
|
||||
{
|
||||
int __lock;
|
||||
unsigned int __count;
|
||||
@ -57,8 +57,8 @@ typedef union __pthread_mutex_u
|
||||
binary compatibility. */
|
||||
int __kind;
|
||||
int __spins;
|
||||
union __pthread_mutex_u *__next;
|
||||
union __pthread_mutex_u *__prev;
|
||||
struct __pthread_mutex_s *__next;
|
||||
struct __pthread_mutex_s *__prev;
|
||||
#define __PTHREAD_MUTEX_HAVE_PREV 1
|
||||
} __data;
|
||||
char __size[__SIZEOF_PTHREAD_MUTEX_T];
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Machine-specific pthread type layouts. PowerPC version.
|
||||
Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
|
||||
|
||||
@ -60,9 +60,9 @@ typedef union
|
||||
|
||||
/* Data structures for mutex handling. The structure of the attribute
|
||||
type is deliberately not exposed. */
|
||||
typedef union __pthread_mutex_u
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
struct __pthread_mutex_s
|
||||
{
|
||||
int __lock;
|
||||
unsigned int __count;
|
||||
@ -75,15 +75,15 @@ typedef union __pthread_mutex_u
|
||||
int __kind;
|
||||
#if __WORDSIZE == 64
|
||||
int __spins;
|
||||
union __pthread_mutex_u *__next;
|
||||
union __pthread_mutex_u *__prev;
|
||||
struct __pthread_mutex_s *__next;
|
||||
struct __pthread_mutex_s *__prev;
|
||||
# define __PTHREAD_MUTEX_HAVE_PREV 1
|
||||
#else
|
||||
unsigned int __nusers;
|
||||
union
|
||||
{
|
||||
int __spins;
|
||||
union __pthread_mutex_u *__next;
|
||||
struct __pthread_mutex_s *__next;
|
||||
};
|
||||
#endif
|
||||
} __data;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
|
||||
|
||||
@ -59,9 +59,9 @@ typedef union
|
||||
|
||||
/* Data structures for mutex handling. The structure of the attribute
|
||||
type is not exposed on purpose. */
|
||||
typedef union __pthread_mutex_u
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
struct __pthread_mutex_s
|
||||
{
|
||||
int __lock;
|
||||
unsigned int __count;
|
||||
@ -74,15 +74,15 @@ typedef union __pthread_mutex_u
|
||||
int __kind;
|
||||
#if __WORDSIZE == 64
|
||||
int __spins;
|
||||
union __pthread_mutex_u *__next;
|
||||
union __pthread_mutex_u *__prev;
|
||||
struct __pthread_mutex_s *__next;
|
||||
struct __pthread_mutex_s *__prev;
|
||||
# define __PTHREAD_MUTEX_HAVE_PREV 1
|
||||
#else
|
||||
unsigned int __nusers;
|
||||
union
|
||||
{
|
||||
int __spins;
|
||||
union __pthread_mutex_u *__next;
|
||||
struct __pthread_mutex_s *__next;
|
||||
};
|
||||
#endif
|
||||
} __data;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@ -59,9 +59,9 @@ typedef union
|
||||
|
||||
/* Data structures for mutex handling. The structure of the attribute
|
||||
type is not exposed on purpose. */
|
||||
typedef union __pthread_mutex_u
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
struct __pthread_mutex_s
|
||||
{
|
||||
int __lock;
|
||||
unsigned int __count;
|
||||
@ -74,15 +74,15 @@ typedef union __pthread_mutex_u
|
||||
int __kind;
|
||||
#if __WORDSIZE == 64
|
||||
int __spins;
|
||||
union __pthread_mutex_u *__next;
|
||||
union __pthread_mutex_u *__prev;
|
||||
struct __pthread_mutex_s *__next;
|
||||
struct __pthread_mutex_s *__prev;
|
||||
# define __PTHREAD_MUTEX_HAVE_PREV 1
|
||||
#else
|
||||
unsigned int __nusers;
|
||||
union
|
||||
{
|
||||
int __spins;
|
||||
union __pthread_mutex_u *__next;
|
||||
struct __pthread_mutex_s *__next;
|
||||
};
|
||||
#endif
|
||||
} __data;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Cache handling for host lookup.
|
||||
Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
|
||||
|
||||
@ -368,7 +368,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
|
||||
assert (fd != -1);
|
||||
|
||||
#ifdef HAVE_SENDFILE
|
||||
if (__builtin_expect (db->mmap_used, 1))
|
||||
if (__builtin_expect (db->mmap_used, 1) && !alloca_used)
|
||||
{
|
||||
assert (db->wr_fd != -1);
|
||||
assert ((char *) &dataset->resp > (char *) db->data);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Cache handling for group lookup.
|
||||
Copyright (C) 1998-2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998-2005, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
|
||||
|
||||
@ -296,7 +296,7 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
|
||||
assert (fd != -1);
|
||||
|
||||
#ifdef HAVE_SENDFILE
|
||||
if (__builtin_expect (db->mmap_used, 1))
|
||||
if (__builtin_expect (db->mmap_used, 1) && !alloca_used)
|
||||
{
|
||||
assert (db->wr_fd != -1);
|
||||
assert ((char *) &dataset->resp > (char *) db->data);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Cache handling for host lookup.
|
||||
Copyright (C) 1998-2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998-2005, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
|
||||
|
||||
@ -330,7 +330,7 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
|
||||
assert (fd != -1);
|
||||
|
||||
#ifdef HAVE_SENDFILE
|
||||
if (__builtin_expect (db->mmap_used, 1))
|
||||
if (__builtin_expect (db->mmap_used, 1) && !alloca_used)
|
||||
{
|
||||
assert (db->wr_fd != -1);
|
||||
assert ((char *) &dataset->resp > (char *) db->data);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Cache handling for host lookup.
|
||||
Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
|
||||
|
||||
@ -347,7 +347,7 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
|
||||
assert (fd != -1);
|
||||
|
||||
#ifdef HAVE_SENDFILE
|
||||
if (__builtin_expect (db->mmap_used, 1))
|
||||
if (__builtin_expect (db->mmap_used, 1) && !alloca_used)
|
||||
{
|
||||
assert (db->wr_fd != -1);
|
||||
assert ((char *) &dataset->resp > (char *) db->data);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Cache handling for passwd lookup.
|
||||
Copyright (C) 1998-2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998-2005, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
|
||||
|
||||
@ -291,7 +291,7 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
|
||||
assert (fd != -1);
|
||||
|
||||
#ifdef HAVE_SENDFILE
|
||||
if (__builtin_expect (db->mmap_used, 1))
|
||||
if (__builtin_expect (db->mmap_used, 1) && !alloca_used)
|
||||
{
|
||||
assert (db->wr_fd != -1);
|
||||
assert ((char *) &dataset->resp > (char *) db->data);
|
||||
|
@ -260,8 +260,20 @@ extern int access (__const char *__name, int __type) __THROW __nonnull ((1));
|
||||
(as normal file operations use). */
|
||||
extern int euidaccess (__const char *__name, int __type)
|
||||
__THROW __nonnull ((1));
|
||||
|
||||
/* An alias for `euidaccess', used by some other systems. */
|
||||
extern int eaccess (__const char *__name, int __type)
|
||||
__THROW __nonnull ((1));
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ATFILE
|
||||
/* Test for access to FILE relative to the directory FD is open on.
|
||||
If AT_EACCESS is set in FLAG, then use effective IDs like `eaccess',
|
||||
otherwise use real IDs like `access'. */
|
||||
extern int faccessat (int __fd, __const char *__file, int __type, int __flag)
|
||||
__THROW __nonnull ((2)) __wur;
|
||||
#endif /* Use GNU. */
|
||||
|
||||
|
||||
/* Values for the WHENCE argument to lseek. */
|
||||
#ifndef _STDIO_H /* <stdio.h> has the same definitions. */
|
||||
|
@ -30,8 +30,7 @@ if fgrep "$includedir" */*.d |
|
||||
fgrep -v "$includedir/asm" |
|
||||
fgrep -v "$includedir/linux" |
|
||||
fgrep -v "$includedir/selinux" |
|
||||
fgrep -v "$includedir/gd" |
|
||||
fgrep -v "$includedir/c++"; then
|
||||
fgrep -v "$includedir/gd"; then
|
||||
# If we found a match something is wrong.
|
||||
exit 1
|
||||
fi
|
||||
|
@ -23,17 +23,18 @@
|
||||
subdir := soft-fp
|
||||
|
||||
gcc-single-routines := negsf2 addsf3 subsf3 mulsf3 divsf3 eqsf2 \
|
||||
lesf2 gesf2 fixsfsi fixunssfsi floatsisf fixsfdi \
|
||||
fixunssfdi floatdisf sqrtsf2
|
||||
lesf2 gesf2 unordsf2 fixsfsi fixunssfsi floatsisf fixsfdi \
|
||||
fixunssfdi floatdisf sqrtsf2 floatunsisf floatundisf
|
||||
|
||||
gcc-double-routines := negdf2 adddf3 subdf3 muldf3 divdf3 eqdf2 \
|
||||
ledf2 gedf2 fixdfsi fixunsdfsi floatsidf fixdfdi \
|
||||
fixunsdfdi floatdidf extendsfdf2 truncdfsf2 sqrtdf2
|
||||
ledf2 gedf2 unorddf2 fixdfsi fixunsdfsi floatsidf fixdfdi \
|
||||
fixunsdfdi floatdidf extendsfdf2 truncdfsf2 sqrtdf2 floatunsidf \
|
||||
floatundidf
|
||||
|
||||
gcc-quad-routines := negtf2 addtf3 subtf3 multf3 divtf3 eqtf2 \
|
||||
letf2 getf2 fixtfsi fixunstfsi floatsitf fixtfdi \
|
||||
letf2 getf2 unordtf2 fixtfsi fixunstfsi floatsitf fixtfdi \
|
||||
fixunstfdi floatditf extendsftf2 trunctfsf2 extenddftf2 \
|
||||
trunctfdf2 sqrttf2
|
||||
trunctfdf2 sqrttf2 floatunsitf floatunditf
|
||||
|
||||
distribute := double.h op-1.h op-2.h op-4.h op-common.h quad.h \
|
||||
single.h soft-fp.h extended.h Banner op-8.h testit.c \
|
||||
|
@ -113,6 +113,7 @@ union _FP_UNION_D
|
||||
|
||||
#define FP_CMP_D(r,X,Y,un) _FP_CMP(D,2,r,X,Y,un)
|
||||
#define FP_CMP_EQ_D(r,X,Y) _FP_CMP_EQ(D,2,r,X,Y)
|
||||
#define FP_CMP_UNORD_D(r,X,Y) _FP_CMP_UNORD(D,2,r,X,Y)
|
||||
|
||||
#define FP_TO_INT_D(r,X,rsz,rsg) _FP_TO_INT(D,2,r,X,rsz,rsg)
|
||||
#define FP_FROM_INT_D(X,r,rs,rt) _FP_FROM_INT(D,2,X,r,rs,rt)
|
||||
|
@ -224,6 +224,7 @@ union _FP_UNION_E
|
||||
|
||||
#define FP_CMP_E(r,X,Y,un) _FP_CMP(E,4,r,X,Y,un)
|
||||
#define FP_CMP_EQ_E(r,X,Y) _FP_CMP_EQ(E,4,r,X,Y)
|
||||
#define FP_CMP_UNORD_E(r,X,Y) _FP_CMP_UNORD(E,4,r,X,Y)
|
||||
|
||||
#define FP_TO_INT_E(r,X,rsz,rsg) _FP_TO_INT(E,4,r,X,rsz,rsg)
|
||||
#define FP_FROM_INT_E(X,r,rs,rt) _FP_FROM_INT(E,4,X,r,rs,rt)
|
||||
|
38
soft-fp/floatundidf.c
Normal file
38
soft-fp/floatundidf.c
Normal file
@ -0,0 +1,38 @@
|
||||
/* Software floating-point emulation.
|
||||
Convert a 64bit unsigned integer to IEEE double
|
||||
Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Richard Henderson (rth@cygnus.com) and
|
||||
Jakub Jelinek (jj@ultra.linux.cz).
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include "soft-fp.h"
|
||||
#include "double.h"
|
||||
|
||||
double
|
||||
__floatundidf(UDItype i)
|
||||
{
|
||||
FP_DECL_EX;
|
||||
FP_DECL_D(A);
|
||||
double a;
|
||||
|
||||
FP_FROM_INT_D(A, i, 64, long long);
|
||||
FP_PACK_D(a, A);
|
||||
FP_HANDLE_EXCEPTIONS;
|
||||
|
||||
return a;
|
||||
}
|
38
soft-fp/floatundisf.c
Normal file
38
soft-fp/floatundisf.c
Normal file
@ -0,0 +1,38 @@
|
||||
/* Software floating-point emulation.
|
||||
Convert a 64bit unsigned integer to IEEE single
|
||||
Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Richard Henderson (rth@cygnus.com) and
|
||||
Jakub Jelinek (jj@ultra.linux.cz).
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include "soft-fp.h"
|
||||
#include "single.h"
|
||||
|
||||
float
|
||||
__floatundisf(UDItype i)
|
||||
{
|
||||
FP_DECL_EX;
|
||||
FP_DECL_S(A);
|
||||
float a;
|
||||
|
||||
FP_FROM_INT_S(A, i, 64, long long);
|
||||
FP_PACK_S(a, A);
|
||||
FP_HANDLE_EXCEPTIONS;
|
||||
|
||||
return a;
|
||||
}
|
38
soft-fp/floatunditf.c
Normal file
38
soft-fp/floatunditf.c
Normal file
@ -0,0 +1,38 @@
|
||||
/* Software floating-point emulation.
|
||||
Convert a 64bit unsigned integer to IEEE quad
|
||||
Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Richard Henderson (rth@cygnus.com) and
|
||||
Jakub Jelinek (jj@ultra.linux.cz).
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include "soft-fp.h"
|
||||
#include "quad.h"
|
||||
|
||||
long double
|
||||
__floatunditf(UDItype i)
|
||||
{
|
||||
FP_DECL_EX;
|
||||
FP_DECL_Q(A);
|
||||
long double a;
|
||||
|
||||
FP_FROM_INT_Q(A, i, 64, long long);
|
||||
FP_PACK_Q(a, A);
|
||||
FP_HANDLE_EXCEPTIONS;
|
||||
|
||||
return a;
|
||||
}
|
38
soft-fp/floatunsidf.c
Normal file
38
soft-fp/floatunsidf.c
Normal file
@ -0,0 +1,38 @@
|
||||
/* Software floating-point emulation.
|
||||
Convert a 32bit unsigned integer to IEEE double
|
||||
Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Richard Henderson (rth@cygnus.com) and
|
||||
Jakub Jelinek (jj@ultra.linux.cz).
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include "soft-fp.h"
|
||||
#include "double.h"
|
||||
|
||||
double
|
||||
__floatunsidf(USItype i)
|
||||
{
|
||||
FP_DECL_EX;
|
||||
FP_DECL_D(A);
|
||||
double a;
|
||||
|
||||
FP_FROM_INT_D(A, i, 32, int);
|
||||
FP_PACK_D(a, A);
|
||||
FP_HANDLE_EXCEPTIONS;
|
||||
|
||||
return a;
|
||||
}
|
38
soft-fp/floatunsisf.c
Normal file
38
soft-fp/floatunsisf.c
Normal file
@ -0,0 +1,38 @@
|
||||
/* Software floating-point emulation.
|
||||
Convert a 32bit unsigned integer to IEEE single
|
||||
Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Richard Henderson (rth@cygnus.com) and
|
||||
Jakub Jelinek (jj@ultra.linux.cz).
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include "soft-fp.h"
|
||||
#include "single.h"
|
||||
|
||||
float
|
||||
__floatunsisf(USItype i)
|
||||
{
|
||||
FP_DECL_EX;
|
||||
FP_DECL_S(A);
|
||||
float a;
|
||||
|
||||
FP_FROM_INT_S(A, i, 32, int);
|
||||
FP_PACK_S(a, A);
|
||||
FP_HANDLE_EXCEPTIONS;
|
||||
|
||||
return a;
|
||||
}
|
38
soft-fp/floatunsitf.c
Normal file
38
soft-fp/floatunsitf.c
Normal file
@ -0,0 +1,38 @@
|
||||
/* Software floating-point emulation.
|
||||
Convert a 32bit unsigned integer to IEEE quad
|
||||
Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Richard Henderson (rth@cygnus.com) and
|
||||
Jakub Jelinek (jj@ultra.linux.cz).
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include "soft-fp.h"
|
||||
#include "quad.h"
|
||||
|
||||
long double
|
||||
__floatunsitf(USItype i)
|
||||
{
|
||||
FP_DECL_EX;
|
||||
FP_DECL_Q(A);
|
||||
long double a;
|
||||
|
||||
FP_FROM_INT_Q(A, i, 32, int);
|
||||
FP_PACK_Q(a, A);
|
||||
FP_HANDLE_EXCEPTIONS;
|
||||
|
||||
return a;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/* Software floating-point emulation. Common operations.
|
||||
Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Richard Henderson (rth@cygnus.com),
|
||||
Jakub Jelinek (jj@ultra.linux.cz),
|
||||
@ -553,6 +553,14 @@ do { \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* Version to test unordered. */
|
||||
|
||||
#define _FP_CMP_UNORD(fs, wc, ret, X, Y) \
|
||||
do { \
|
||||
ret = ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X)) \
|
||||
|| (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y))); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* Main square root routine. The input value should be cooked.
|
||||
*/
|
||||
@ -725,40 +733,18 @@ do { \
|
||||
/* Count leading zeros in a word. */
|
||||
|
||||
#ifndef __FP_CLZ
|
||||
#if _FP_W_TYPE_SIZE < 64
|
||||
/* this is just to shut the compiler up about shifts > word length -- PMM 02/1998 */
|
||||
#define __FP_CLZ(r, x) \
|
||||
do { \
|
||||
_FP_W_TYPE _t = (x); \
|
||||
r = _FP_W_TYPE_SIZE - 1; \
|
||||
if (_t > 0xffff) r -= 16; \
|
||||
if (_t > 0xffff) _t >>= 16; \
|
||||
if (_t > 0xff) r -= 8; \
|
||||
if (_t > 0xff) _t >>= 8; \
|
||||
if (_t & 0xf0) r -= 4; \
|
||||
if (_t & 0xf0) _t >>= 4; \
|
||||
if (_t & 0xc) r -= 2; \
|
||||
if (_t & 0xc) _t >>= 2; \
|
||||
if (_t & 0x2) r -= 1; \
|
||||
/* GCC 3.4 and later provide the builtins for us. */
|
||||
#define __FP_CLZ(r, x) \
|
||||
do { \
|
||||
if (sizeof (_FP_W_TYPE) == sizeof (unsigned int)) \
|
||||
r = __builtin_clz (x); \
|
||||
else if (sizeof (_FP_W_TYPE) == sizeof (unsigned long)) \
|
||||
r = __builtin_clzl (x); \
|
||||
else if (sizeof (_FP_W_TYPE) == sizeof (unsigned long long)) \
|
||||
r = __builtin_clzll (x); \
|
||||
else \
|
||||
abort (); \
|
||||
} while (0)
|
||||
#else /* not _FP_W_TYPE_SIZE < 64 */
|
||||
#define __FP_CLZ(r, x) \
|
||||
do { \
|
||||
_FP_W_TYPE _t = (x); \
|
||||
r = _FP_W_TYPE_SIZE - 1; \
|
||||
if (_t > 0xffffffff) r -= 32; \
|
||||
if (_t > 0xffffffff) _t >>= 32; \
|
||||
if (_t > 0xffff) r -= 16; \
|
||||
if (_t > 0xffff) _t >>= 16; \
|
||||
if (_t > 0xff) r -= 8; \
|
||||
if (_t > 0xff) _t >>= 8; \
|
||||
if (_t & 0xf0) r -= 4; \
|
||||
if (_t & 0xf0) _t >>= 4; \
|
||||
if (_t & 0xc) r -= 2; \
|
||||
if (_t & 0xc) _t >>= 2; \
|
||||
if (_t & 0x2) r -= 1; \
|
||||
} while (0)
|
||||
#endif /* not _FP_W_TYPE_SIZE < 64 */
|
||||
#endif /* ndef __FP_CLZ */
|
||||
|
||||
#define _FP_DIV_HELP_imm(q, r, n, d) \
|
||||
|
@ -119,6 +119,7 @@ union _FP_UNION_Q
|
||||
|
||||
#define FP_CMP_Q(r,X,Y,un) _FP_CMP(Q,4,r,X,Y,un)
|
||||
#define FP_CMP_EQ_Q(r,X,Y) _FP_CMP_EQ(Q,4,r,X,Y)
|
||||
#define FP_CMP_UNORD_Q(r,X,Y) _FP_CMP_UNORD(Q,4,r,X,Y)
|
||||
|
||||
#define FP_TO_INT_Q(r,X,rsz,rsg) _FP_TO_INT(Q,4,r,X,rsz,rsg)
|
||||
#define FP_FROM_INT_Q(X,r,rs,rt) _FP_FROM_INT(Q,4,X,r,rs,rt)
|
||||
|
@ -102,6 +102,7 @@ union _FP_UNION_S
|
||||
|
||||
#define FP_CMP_S(r,X,Y,un) _FP_CMP(S,1,r,X,Y,un)
|
||||
#define FP_CMP_EQ_S(r,X,Y) _FP_CMP_EQ(S,1,r,X,Y)
|
||||
#define FP_CMP_UNORD_S(r,X,Y) _FP_CMP_UNORD(S,1,r,X,Y)
|
||||
|
||||
#define FP_TO_INT_S(r,X,rsz,rsg) _FP_TO_INT(S,1,r,X,rsz,rsg)
|
||||
#define FP_FROM_INT_S(X,r,rs,rt) _FP_FROM_INT(S,1,X,r,rs,rt)
|
||||
|
36
soft-fp/unorddf2.c
Normal file
36
soft-fp/unorddf2.c
Normal file
@ -0,0 +1,36 @@
|
||||
/* Software floating-point emulation.
|
||||
Return 1 iff a or b is a NaN, 0 otherwise.
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Joseph Myers (joseph@codesourcery.com).
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include "soft-fp.h"
|
||||
#include "double.h"
|
||||
|
||||
int
|
||||
__unorddf2(double a, double b)
|
||||
{
|
||||
FP_DECL_D(A); FP_DECL_D(B);
|
||||
int r;
|
||||
|
||||
FP_UNPACK_RAW_D(A, a);
|
||||
FP_UNPACK_RAW_D(B, b);
|
||||
FP_CMP_UNORD_D(r, A, B);
|
||||
|
||||
return r;
|
||||
}
|
37
soft-fp/unordsf2.c
Normal file
37
soft-fp/unordsf2.c
Normal file
@ -0,0 +1,37 @@
|
||||
/* Software floating-point emulation.
|
||||
Return 1 iff a or b is a NaN, 0 otherwise.
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Joseph Myers (joseph@codesourcery.com).
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include "soft-fp.h"
|
||||
#include "single.h"
|
||||
|
||||
int
|
||||
__unordsf2(float a, float b)
|
||||
{
|
||||
FP_DECL_S(A);
|
||||
FP_DECL_S(B);
|
||||
int r;
|
||||
|
||||
FP_UNPACK_RAW_S(A, a);
|
||||
FP_UNPACK_RAW_S(B, b);
|
||||
FP_CMP_UNORD_S(r, A, B);
|
||||
|
||||
return r;
|
||||
}
|
37
soft-fp/unordtf2.c
Normal file
37
soft-fp/unordtf2.c
Normal file
@ -0,0 +1,37 @@
|
||||
/* Software floating-point emulation.
|
||||
Return 1 iff a or b is a NaN, 0 otherwise.
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Joseph Myers (joseph@codesourcery.com).
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include "soft-fp.h"
|
||||
#include "quad.h"
|
||||
|
||||
int
|
||||
__unordtf2(long double a, long double b)
|
||||
{
|
||||
FP_DECL_Q(A);
|
||||
FP_DECL_Q(B);
|
||||
int r;
|
||||
|
||||
FP_UNPACK_RAW_Q(A, a);
|
||||
FP_UNPACK_RAW_Q(B, b);
|
||||
FP_CMP_UNORD_Q(r, A, B);
|
||||
|
||||
return r;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/* Test for access to FILE using effective UID and GID. Hurd version.
|
||||
Copyright (C) 1991, 1995, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1991, 1995, 1997, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -57,3 +57,4 @@ __euidaccess (file, type)
|
||||
return 0;
|
||||
}
|
||||
weak_alias (__euidaccess, euidaccess)
|
||||
weak_alias (__euidaccess, eaccess)
|
||||
|
@ -183,8 +183,10 @@ euidaccess (path, mode)
|
||||
return -1;
|
||||
}
|
||||
#undef euidaccess
|
||||
#undef eaccess
|
||||
#ifdef weak_alias
|
||||
weak_alias (__euidaccess, euidaccess)
|
||||
weak_alias (__euidaccess, eaccess)
|
||||
#endif
|
||||
|
||||
#ifdef TEST
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Definitions for POSIX memory map interface. Linux/Alpha version.
|
||||
Copyright (C) 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1998, 2000, 2003, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -96,6 +96,7 @@
|
||||
# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
|
||||
# define MADV_WILLNEED 3 /* Will need these pages. */
|
||||
# define MADV_DONTNEED 6 /* Don't need these pages. */
|
||||
# define MADV_REMOVE 7 /* Remove these pages and resources. */
|
||||
#endif
|
||||
|
||||
/* The POSIX people had to invent similar names for the same things. */
|
||||
|
123
sysdeps/unix/sysv/linux/faccessat.c
Normal file
123
sysdeps/unix/sysv/linux/faccessat.c
Normal file
@ -0,0 +1,123 @@
|
||||
/* Test for access to file, relative to open directory. Linux version.
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <alloca.h>
|
||||
#include <sysdep.h>
|
||||
|
||||
int
|
||||
faccessat (fd, file, mode, flag)
|
||||
int fd;
|
||||
const char *file;
|
||||
int mode;
|
||||
int flag;
|
||||
{
|
||||
if (flag & ~(AT_SYMLINK_NOFOLLOW | AT_EACCESS))
|
||||
{
|
||||
__set_errno (EINVAL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
char *buf = NULL;
|
||||
|
||||
if (fd != AT_FDCWD && file[0] != '/')
|
||||
{
|
||||
size_t filelen = strlen (file);
|
||||
static const char procfd[] = "/proc/self/fd/%d/%s";
|
||||
/* Buffer for the path name we are going to use. It consists of
|
||||
- the string /proc/self/fd/
|
||||
- the file descriptor number
|
||||
- the file name provided.
|
||||
The final NUL is included in the sizeof. A bit of overhead
|
||||
due to the format elements compensates for possible negative
|
||||
numbers. */
|
||||
size_t buflen = sizeof (procfd) + sizeof (int) * 3 + filelen;
|
||||
buf = alloca (buflen);
|
||||
|
||||
__snprintf (buf, buflen, procfd, fd, file);
|
||||
file = buf;
|
||||
}
|
||||
|
||||
if ((!(flag & AT_EACCESS) || ! __libc_enable_secure)
|
||||
#ifndef __NR_laccess /* Linux so far has no laccess syscall. */
|
||||
&& !(flag & AT_SYMLINK_NOFOLLOW)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
/* If we are not set-uid or set-gid, access does the same. */
|
||||
|
||||
int result;
|
||||
INTERNAL_SYSCALL_DECL (err);
|
||||
|
||||
#ifdef __NR_laccess
|
||||
if (flag & AT_SYMLINK_NOFOLLOW)
|
||||
result = INTERNAL_SYSCALL (laccess, err, 2, file, mode);
|
||||
else
|
||||
#endif
|
||||
result = INTERNAL_SYSCALL (access, err, 2, file, mode);
|
||||
|
||||
if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
|
||||
{
|
||||
__atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
|
||||
result = -1;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
struct stat64 stats;
|
||||
if (fstatat64 (fd, file, &stats, flag & AT_SYMLINK_NOFOLLOW))
|
||||
return -1;
|
||||
|
||||
mode &= (X_OK | W_OK | R_OK); /* Clear any bogus bits. */
|
||||
#if R_OK != S_IROTH || W_OK != S_IWOTH || X_OK != S_IXOTH
|
||||
# error Oops, portability assumptions incorrect.
|
||||
#endif
|
||||
|
||||
if (mode == F_OK)
|
||||
return 0; /* The file exists. */
|
||||
|
||||
uid_t uid = (flag & AT_EACCESS) ? __geteuid () : __getuid ();
|
||||
|
||||
/* The super-user can read and write any file, and execute any file
|
||||
that anyone can execute. */
|
||||
if (uid == 0 && ((mode & X_OK) == 0
|
||||
|| (stats.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))))
|
||||
return 0;
|
||||
|
||||
int granted = (uid == stats.st_uid
|
||||
? (unsigned int) (stats.st_mode & (mode << 6)) >> 6
|
||||
: (stats.st_gid == ((flag & AT_EACCESS)
|
||||
? __getegid () : __getgid ())
|
||||
|| __group_member (stats.st_gid))
|
||||
? (unsigned int) (stats.st_mode & (mode << 3)) >> 3
|
||||
: (stats.st_mode & mode));
|
||||
|
||||
if (granted == mode)
|
||||
return 0;
|
||||
|
||||
__set_errno (EACCES);
|
||||
return -1;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/* Definitions for POSIX memory map interface. Linux/i386 version.
|
||||
Copyright (C) 1997, 2000, 2003, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 2000, 2003, 2005, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -88,6 +88,7 @@
|
||||
# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
|
||||
# define MADV_WILLNEED 3 /* Will need these pages. */
|
||||
# define MADV_DONTNEED 4 /* Don't need these pages. */
|
||||
# define MADV_REMOVE 5 /* Remove these pages and resources. */
|
||||
#endif
|
||||
|
||||
/* The POSIX people had to invent similar names for the same things. */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Definitions for POSIX memory map interface. Linux/ia64 version.
|
||||
Copyright (C) 1997, 1998, 2000, 2003, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997,1998,2000,2003,2005,2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -89,6 +89,7 @@
|
||||
# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
|
||||
# define MADV_WILLNEED 3 /* Will need these pages. */
|
||||
# define MADV_DONTNEED 4 /* Don't need these pages. */
|
||||
# define MADV_REMOVE 5 /* Remove these pages and resources. */
|
||||
#endif
|
||||
|
||||
/* The POSIX people had to invent similar names for the same things. */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Definitions for Address Resolution Protocol.
|
||||
Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997,1999,2001,2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
@ -96,7 +96,7 @@ struct arphdr
|
||||
#define ARPHRD_ADAPT 264
|
||||
#define ARPHRD_ROSE 270
|
||||
#define ARPHRD_X25 271 /* CCITT X.25. */
|
||||
#define ARPHDR_HWX25 272 /* Boards with X.25 in firmware. */
|
||||
#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware. */
|
||||
#define ARPHRD_PPP 512
|
||||
#define ARPHRD_CISCO 513 /* Cisco HDLC. */
|
||||
#define ARPHRD_HDLC ARPHRD_CISCO
|
||||
@ -126,6 +126,12 @@ struct arphdr
|
||||
#define ARPHRD_FCFABRIC 787 /* Fibrechanel fabric. */
|
||||
#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR. */
|
||||
#define ARPHRD_IEEE80211 801 /* IEEE 802.11. */
|
||||
#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header. */
|
||||
#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header. */
|
||||
|
||||
#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known. */
|
||||
#define ARPHRD_NONE 0xFFFE /* Zero header length. */
|
||||
|
||||
|
||||
/* ARP ioctl request. */
|
||||
struct arpreq
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Definitions for POSIX memory map interface. Linux/PowerPC version.
|
||||
Copyright (C) 1997, 2000, 2003, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 2000, 2003, 2005, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -89,6 +89,7 @@
|
||||
# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
|
||||
# define MADV_WILLNEED 3 /* Will need these pages. */
|
||||
# define MADV_DONTNEED 4 /* Don't need these pages. */
|
||||
# define MADV_REMOVE 5 /* Remove these pages and resources. */
|
||||
#endif
|
||||
|
||||
/* The POSIX people had to invent similar names for the same things. */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Definitions for POSIX memory map interface. Linux/s390 version.
|
||||
Copyright (C) 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000,2001,2002,2003,2005,2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -89,6 +89,7 @@
|
||||
# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
|
||||
# define MADV_WILLNEED 3 /* Will need these pages. */
|
||||
# define MADV_DONTNEED 4 /* Don't need these pages. */
|
||||
# define MADV_REMOVE 5 /* Remove these pages and resources. */
|
||||
#endif
|
||||
|
||||
/* The POSIX people had to invent similar names for the same things. */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Definitions for POSIX memory map interface. Linux/SH version.
|
||||
Copyright (C) 1997, 1999, 2000, 2003, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997,1999,2000,2003,2005,2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -88,6 +88,7 @@
|
||||
# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
|
||||
# define MADV_WILLNEED 3 /* Will need these pages. */
|
||||
# define MADV_DONTNEED 4 /* Don't need these pages. */
|
||||
# define MADV_REMOVE 5 /* Remove these pages and resources. */
|
||||
#endif
|
||||
|
||||
/* The POSIX people had to invent similar names for the same things. */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Definitions for POSIX memory map interface. Linux/SPARC version.
|
||||
Copyright (C) 1997, 1999, 2000, 2003, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997,1999,2000,2003,2005,2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -90,6 +90,8 @@
|
||||
# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
|
||||
# define MADV_WILLNEED 3 /* Will need these pages. */
|
||||
# define MADV_DONTNEED 4 /* Don't need these pages. */
|
||||
# define MADV_FREE 5 /* Content can be freed (Solaris). */
|
||||
# define MADV_REMOVE 6 /* Remove these pages and resources. */
|
||||
#endif
|
||||
|
||||
/* The POSIX people had to invent similar names for the same things. */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Definitions for POSIX memory map interface. Linux/x86_64 version.
|
||||
Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 2001, 2003, 2005, 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -89,6 +89,7 @@
|
||||
# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
|
||||
# define MADV_WILLNEED 3 /* Will need these pages. */
|
||||
# define MADV_DONTNEED 4 /* Don't need these pages. */
|
||||
# define MADV_REMOVE 5 /* Remove these pages and resources. */
|
||||
#endif
|
||||
|
||||
/* The POSIX people had to invent similar names for the same things. */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* 64-bit multiplication and division
|
||||
Copyright (C) 1989, 1992-1999, 2000, 2001, 2002, 2003, 2004
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1989, 1992-1999,2000,2001,2002,2003,2004,2005
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -309,7 +309,7 @@ __moddi3 (DWtype u, DWtype v)
|
||||
}
|
||||
if (v < 0)
|
||||
v = -v;
|
||||
__udivmoddi4 (u, v, &w);
|
||||
__udivmoddi4 (u, v, (UDWtype *) &w);
|
||||
if (c)
|
||||
w = -w;
|
||||
return w;
|
||||
|
Loading…
Reference in New Issue
Block a user