+2006-01-05 Jakub Jelinek <jakub@redhat.com>
+
+ * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_WAITID_SYSCALL):
+ Only define for 2.6.12+ on s390{,x}.
+ (__ASSUME_GETDENTS32_D_TYPE): Only define for 2.6.8+ on most arches
+ and only for 2.6.11+ on s390{,x}.
+
+2006-01-05 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/pthread/aio_misc.h [!DONT_USE_BOOTSTRAP_MAP]
+ (struct waitlist): Don't add cond.
+ * sysdeps/pthread/aio_notify.c [!DONT_USE_BOOTSTRAP_MAP]
+ (__aio_notify): Use AIO_MISC_NOTIFY instead of pthread_cond_signal.
+ * sysdeps/pthread/aio_suspend.c [!DONT_USE_BOOTSTRAP_MAP]: Don't
+ use condvar, use AIO_MISC_WAIT.
+ * sysdeps/pthread/lio_listio.c: Likewise.
+ * rt/Makefile (tests): Add tst-aio9 and tst-aio10.
+ * rt/tst-aio9.c: New file.
+ * rt/tst-aio10.c: New file.
+
+ * rt/tst-aio3.c: The thread is now supposed to be created.
+
+2006-01-05 Roland McGrath <roland@redhat.com>
+
+ * include/features.h: Grok _ATFILE_SOURCE and define __USE_ATFILE when
+ it or _GNU_SOURCE is defined.
+ * io/fcntl.h: Protect *at and AT_* with [__USE_ATFILE] instead of
+ [__USE_GNU].
+ * libio/stdio.h: Likewise.
+ * posix/unistd.h: Likewise.
+ * time/sys/time.h: Likewise.
+
+ * io/sys/stat.h [__USE_GNU]: Declare fchmodat.
+ * io/fchmodat.c: New file.
+ * io/Makefile (routines): Add fchmodat.
+ * io/Versions (libc: GLIBC_2.4): Likewise.
+ * sysdeps/unix/sysv/linux/fchmodat.c: New file.
+ * io/tst-fchmodat.c: New file.
+ * io/Makefile (tests): Add it.
+
+2006-01-03 Steven Munroe <sjmunroe@us.ibm.com>
+
+ * sysdeps/powerpc/powerpc32/sysdep.h (ENTRY, EALIGN): Add cfi_startproc
+ directive to ENTRY macros.
+ (END): Add cfi_endproc directive to END macro.
+ * sysdeps/powerpc/powerpc64/sysdep.h (ENTRY, EALIGN): Add cfi_startproc
+ directive to ENTRY macros.
+ (END, END_GEN_TB): Add cfi_endproc directive to END macros.
+ * sysdeps/powerpc/powerpc32/dl-start.S: Remove ENTRY()s for
+ _dl_start_user and _dl_main_dispatch.
+ * sysdeps/powerpc/powerpc32/fpu/fprrest.S: Use END macro.
+ * sysdeps/powerpc/powerpc32/fpu/fprsave.S: Use Likewise.
+ * sysdeps/powerpc/powerpc32/gprrest0.S: Likewise.
+ * sysdeps/powerpc/powerpc32/gprrest1.S: Likewise.
+ * sysdeps/powerpc/powerpc32/gprsave0.S: Likewise.
+ * sysdeps/powerpc/powerpc32/gprsave1.S: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S: Remove redundant
+ cfi_startproc and cfi_endproc.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S: Likewise.
+
+2006-01-04 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/pthread/aio_misc.h (struct waitlist): Add result member.
+ * sysdeps/pthread/aio_notify.c (__aio_notify): For synchronous waiters,
+ failed I/O, and a result pointer, set value to -1.
+ * sysdeps/pthread/aio_suspend.c: Initialize result pointer to NULL.
+ * sysdeps/pthread/lio_listio.c: For LIO_WAIT, point result pointer in
+ wait list to local variable result. If nonzero afterwards, set errno
+ to EIO. For LIO_NOWAIT set result to NULL.
+ * rt/Makefile (tests): Add tst-aio8.
+ * rt/tst-aio8.c: New file.
+
+2005-12-25 Kristian Van Der Vliet <vanders@liqwyd.com>
+
+ * abi-tags (*-.*-syllable.*): New match, with ABI value 5.
+ * elf/cache.c (print_entry): Match the Syllable ABI tag.
+
+2006-01-04 Ulrich Drepper <drepper@redhat.com>
+
+ * include/stdlib.h: Make even more C++ compliant.
+
2006-01-04 Joseph S. Myers <joseph@codesourcery.com>
* sysdeps/unix/sysv/linux/mips/brk.c (__brk): Use
.*-.*-knetbsd.*-gnu.* 4 1.6.0 # earliest compatible kernel version
+.*-.*-syllable.* 5 2.0.0 # just an arbitrary value
+
# There is no catch-all default here because every supported OS that uses
# ELF must have its own unique ABI tag.
[2] = "Solaris",
[3] = "FreeBSD",
[4] = "kNetBSD",
- [5] = N_("Unknown OS")
+ [5] = "Syllable",
+ [6] = N_("Unknown OS")
};
#define MAXTAG (sizeof abi_tag_os / sizeof abi_tag_os[0] - 1)
unsigned int os = osversion >> 24;
glibc-base := HEAD
DIST_BRANCH := devel
COLLECTION := dist-fc4
-fedora-sync-date := 2006-01-04 07:54 UTC
-fedora-sync-tag := fedora-glibc-20060104T0754
+fedora-sync-date := 2006-01-06 09:16 UTC
+fedora-sync-tag := fedora-glibc-20060106T0916
-%define glibcrelease 26
+%define glibcrelease 28
%define auxarches i586 i686 athlon sparcv9 alphaev6
%define prelinkarches noarch
%define xenarches i686 athlon
%endif
# Hack till glibc-kernheaders get updated, argh
-mkdir asm
-cat > asm/unistd.h <<EOF
+mkdir -p override_headers/linux
+cat > override_headers/linux/version.h <<EOF
+#define UTS_RELEASE "2.6.9"
+#define LINUX_VERSION_CODE 132617
+#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+EOF
+mkdir -p override_headers/asm
+cat > override_headers/asm/unistd.h <<EOF
#ifndef _HACK_ASM_UNISTD_H
#include_next <asm/unistd.h>
%ifarch alpha
%endif
#endif
EOF
-cat > asm/errno.h <<EOF
+cat > override_headers/asm/errno.h <<EOF
#ifndef _HACK_ASM_ERRNO_H
#include_next <asm/errno.h>
%ifarch alpha
build_CFLAGS="$BuildFlags -g -O3 $*"
CC="$GCC" CXX="$GXX" CFLAGS="$build_CFLAGS" ../configure --prefix=%{_prefix} \
--enable-add-ons=nptl$AddOns --without-cvs $EnableKernel \
- --with-headers=%{_prefix}/include --enable-bind-now \
+ --with-headers=`cd ..; pwd`/override_headers:%{_prefix}/include --enable-bind-now \
--with-tls --with-__thread --build %{nptl_target_cpu}-redhat-linux \
--host %{nptl_target_cpu}-redhat-linux \
--disable-profile
%endif
%changelog
+* Fri Jan 6 2006 Jakub Jelinek <jakub@redhat.com> 2.3.90-28
+- update from CVS
+ - make aio_suspend interruptible by signals (#171968)
+
+* Fri Jan 6 2006 Jakub Jelinek <jakub@redhat.com> 2.3.90-27
+- only rely on d_type in 32-bit getdents on s390 for 2.6.11+
+
* Wed Jan 4 2006 Jakub Jelinek <jakub@redhat.com> 2.3.90-26
- update from CVS
- for newly linked lio_listio* callers, send per request
-/* Copyright (C) 1991-1993,1995-2003,2004,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1993,1995,1996,1997,1998,1999,2000,2001,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
_FILE_OFFSET_BITS=N Select default filesystem interface.
_BSD_SOURCE ISO C, POSIX, and 4.3BSD things.
_SVID_SOURCE ISO C, POSIX, and SVID things.
+ _ATFILE_SOURCE Additional *at interfaces.
_GNU_SOURCE All of the above, plus GNU extensions.
_REENTRANT Select additionally reentrant object.
_THREAD_SAFE Same as _REENTRANT, often used by other systems.
__USE_BSD Define 4.3BSD things.
__USE_SVID Define SVID things.
__USE_MISC Define things common to BSD and System V Unix.
+ __USE_ATFILE Define *at interfaces and AT_* constants for them.
__USE_GNU Define GNU extensions.
__USE_REENTRANT Define reentrant/thread-safe *_r functions.
__USE_FORTIFY_LEVEL Additional security measures used, according to level.
#undef __USE_BSD
#undef __USE_SVID
#undef __USE_MISC
+#undef __USE_ATFILE
#undef __USE_GNU
#undef __USE_REENTRANT
#undef __USE_FORTIFY_LEVEL
# define _BSD_SOURCE 1
# undef _SVID_SOURCE
# define _SVID_SOURCE 1
+# undef _ATFILE_SOURCE
+# define _ATFILE_SOURCE 1
#endif
/* If nothing (other than _GNU_SOURCE) is defined,
# define __USE_SVID 1
#endif
+#ifdef _ATFILE_SOURCE
+# define __USE_ATFILE 1
+#endif
+
#ifdef _GNU_SOURCE
# define __USE_GNU 1
#endif
libc_hidden_proto (____strtoull_l_internal)
extern __inline double
-__strtod_l (__const char *__restrict __nptr, char **__restrict __endptr,
- __locale_t __loc)
+__NTH (__strtod_l (__const char *__restrict __nptr, char **__restrict __endptr,
+ __locale_t __loc))
{
return ____strtod_l_internal (__nptr, __endptr, 0, __loc);
}
extern __inline long int
-__strtol_l (__const char *__restrict __nptr, char **__restrict __endptr,
- int __base, __locale_t __loc)
+__NTH (__strtol_l (__const char *__restrict __nptr, char **__restrict __endptr,
+ int __base, __locale_t __loc))
{
return ____strtol_l_internal (__nptr, __endptr, __base, 0, __loc);
}
extern __inline unsigned long int
-__strtoul_l (__const char *__restrict __nptr, char **__restrict __endptr,
- int __base, __locale_t __loc)
+__NTH (__strtoul_l (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base, __locale_t __loc))
{
return ____strtoul_l_internal (__nptr, __endptr, __base, 0, __loc);
}
extern __inline float
-__strtof_l (__const char *__restrict __nptr, char **__restrict __endptr,
- __locale_t __loc)
+__NTH (__strtof_l (__const char *__restrict __nptr, char **__restrict __endptr,
+ __locale_t __loc))
{
return ____strtof_l_internal (__nptr, __endptr, 0, __loc);
}
extern __inline long double
-__strtold_l (__const char *__restrict __nptr, char **__restrict __endptr,
- __locale_t __loc)
+__NTH (__strtold_l (__const char *__restrict __nptr,
+ char **__restrict __endptr, __locale_t __loc))
{
return ____strtold_l_internal (__nptr, __endptr, 0, __loc);
}
__extension__ extern __inline long long int
-__strtoll_l (__const char *__restrict __nptr, char **__restrict __endptr,
- int __base, __locale_t __loc)
+__NTH (__strtoll_l (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base, __locale_t __loc))
{
return ____strtoll_l_internal (__nptr, __endptr, __base, 0, __loc);
}
__extension__ extern __inline unsigned long long int
-__strtoull_l (__const char * __restrict __nptr, char **__restrict __endptr,
- int __base, __locale_t __loc)
+__NTH (__strtoull_l (__const char * __restrict __nptr,
+ char **__restrict __endptr, int __base, __locale_t __loc))
{
return ____strtoull_l_internal (__nptr, __endptr, __base, 0, __loc);
}
#endif
-extern void * __default_morecore (ptrdiff_t);
+extern void *__default_morecore (ptrdiff_t) __THROW;
libc_hidden_proto (__default_morecore)
__END_DECLS
-# Copyright (C) 1992-2002, 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 1992-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
fxstatat fxstatat64 \
statfs fstatfs statfs64 fstatfs64 \
statvfs fstatvfs statvfs64 fstatvfs64 \
- umask chmod fchmod lchmod mkdir mkdirat \
+ umask chmod fchmod lchmod fchmodat \
+ mkdir mkdirat \
open open64 openat openat64 close \
read write lseek lseek64 access euidaccess \
fcntl flock lockf lockf64 \
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-renameat tst-fchownat tst-fchmodat
distribute := ftwtest-sh
nftw; nftw64;
}
GLIBC_2.4 {
+ fchmodat;
fchownat;
__fxstatat; __fxstatat64;
linkat;
--- /dev/null
+/* Change the protections of 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
+fchmodat (fd, file, mode, flag)
+ int fd;
+ const char *file;
+ mode_t mode;
+ int flag;
+{
+ if (file == NULL || (flag & ~AT_SYMLINK_NOFOLLOW) != 0)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ if (fd < 0 && fd != AT_FDCWD)
+ {
+ __set_errno (EBADF);
+ return -1;
+ }
+
+ __set_errno (ENOSYS);
+ return -1;
+}
+stub_warning (fchownat)
+
+#include <stub-tag.h>
-/* Copyright (C) 1991,1992,1994-2001,2003,2004,2005
- Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1994-2001,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
# define SEEK_END 2 /* Seek from end of file. */
#endif /* XPG */
-#ifdef __USE_GNU
+#ifdef __USE_ATFILE
# define AT_FDCWD -100 /* Special value used to indicate
openat should use the current
working directory. */
extern int open64 (__const char *__file, int __oflag, ...) __nonnull ((1));
#endif
-#ifdef __USE_GNU
-/* Similar to OPEN but a relative path name is interpreted relative to
+#ifdef __USE_ATFILE
+/* Similar to `open' but a relative path name is interpreted relative to
the directory for which FD is a descriptor.
- NOTE: some other OPENAT implementation support additional functionality
+ NOTE: some other `openat' implementation support additional functionality
through this interface, especially using the O_XATTR flag. This is not
yet supported here.
-/* Copyright (C) 1991,1992,1995-2004,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1995-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
extern int fchmod (int __fd, __mode_t __mode) __THROW;
#endif
+#ifdef __USE_GNU
+/* 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. */
+
+
/* Set the file creation mask of the current process to MASK,
and return the old creation mask. */
--- /dev/null
+/* Test for fchmodat 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-fchmodat.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);
+
+ umask (022);
+
+ /* 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");
+
+ struct stat64 st1;
+ if (fstat64 (fd, &st1) != 0)
+ {
+ puts ("fstat64 failed");
+ return 1;
+ }
+
+ close (fd);
+
+ if ((st1.st_mode & 0777) != 0644)
+ {
+ printf ("openat created mode %04o, not 0644\n", (st1.st_mode & 0777));
+ return 1;
+ }
+
+ if (fchmodat (dir_fd, "some-file", 0400, 0) != 0)
+ {
+ puts ("fchownat failed");
+ return 1;
+ }
+
+ struct stat64 st2;
+ if (fstatat64 (dir_fd, "some-file", &st2, 0) != 0)
+ {
+ puts ("fstatat64 failed");
+ return 1;
+ }
+
+ if ((st2.st_mode & 0777) != 0400)
+ {
+ puts ("mode change failed");
+ return 1;
+ }
+
+ if (unlinkat (dir_fd, "some-file", 0) != 0)
+ {
+ puts ("unlinkat failed");
+ return 1;
+ }
+
+ close (dir_fd);
+
+ return 0;
+}
/* Define ISO C stdio on top of C++ iostreams.
- Copyright (C) 1991,1994-2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1991,1994-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
extern int rename (__const char *__old, __const char *__new) __THROW;
__END_NAMESPACE_STD
-#ifdef __USE_GNU
+#ifdef __USE_ATFILE
/* Rename file OLD relative to OLDFD to NEW relative to NEWFD. */
extern int renameat (int __oldfd, __const char *__old, int __newfd,
__const char *__new) __THROW;
+2005-12-27 Roland McGrath <roland@redhat.com>
+
+ * tst-ctype.c (main): Add some casts.
+
+ * tst-mbswcs1.c (main): Make BUF const. Add casts in mbrtowc calls.
+
2006-01-02 Andreas Jaeger <aj@suse.de>
* locales/fi_FI: Fix date_fmt.
-/* Copyright (C) 2000,02 Free Software Foundation, Inc.
+/* Copyright (C) 2000,02, 05 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.org>, 2000.
|| getline (&resline, &reslinelen, stdin) <= 0)
break;
- inp = strchr (inpline, '\n');
+ inp = (unsigned char *) strchr (inpline, '\n');
if (inp != NULL)
*inp = '\0';
- resp = strchr (resline, '\n');
+ resp = (unsigned char *) strchr (resline, '\n');
if (resp != NULL)
*resp = '\0';
- inp = inpline;
+ inp = (unsigned char *) inpline;
while (*inp != ' ' && *inp != '\t' && *inp && *inp != '\n'
&& *inp != '\0')
++inp;
if (strcmp (inpline, classes[n].name) == 0)
break;
- resp = resline;
+ resp = (unsigned char *) resline;
while (*resp == ' ' || *resp == '\t')
++resp;
- if (strlen (inp) != strlen (resp))
+ if (strlen ((char *) inp) != strlen ((char *) resp))
{
printf ("lines \"%.20s\"... and \"%.20s\" have not the same length\n",
inp, resp);
if (n < nclasses)
{
- if (strspn (resp, "01") != strlen (resp))
+ if (strspn ((char *) resp, "01") != strlen ((char *) resp))
{
printf ("result string \"%s\" malformed\n", resp);
continue;
/* Test restarting behaviour of mbrtowc.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Bruno Haible <haible@ilog.fr>.
int
main (void)
{
- unsigned char buf[6] = { 0x25, 0xe2, 0x82, 0xac, 0xce, 0xbb };
+ const unsigned char buf[6] = { 0x25, 0xe2, 0x82, 0xac, 0xce, 0xbb };
mbstate_t state;
wchar_t wc = 42;
size_t n;
memset (&state, '\0', sizeof (state));
- show (mbrtowc (&wc, buf + 0, 1, &state), 1, 37);
- show (mbrtowc (&wc, buf + 1, 1, &state), -2, 37);
- show (mbrtowc (&wc, buf + 2, 3, &state), 2, 8364);
- show (mbrtowc (&wc, buf + 4, 1, &state), -2, 8364);
- show (mbrtowc (&wc, buf + 5, 1, &state), 1, 955);
- show (mbrtowc (&wc, buf + 5, 1, &state), -1, 955);
+ show (mbrtowc (&wc, (const char *) buf + 0, 1, &state), 1, 37);
+ show (mbrtowc (&wc, (const char *) buf + 1, 1, &state), -2, 37);
+ show (mbrtowc (&wc, (const char *) buf + 2, 3, &state), 2, 8364);
+ show (mbrtowc (&wc, (const char *) buf + 4, 1, &state), -2, 8364);
+ show (mbrtowc (&wc, (const char *) buf + 5, 1, &state), 1, 955);
+ show (mbrtowc (&wc, (const char *) buf + 5, 1, &state), -1, 955);
return result;
}
+2006-01-05 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
+ Return status.
+ (lll_futex_timed_wait): Define.
+ * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
+ * sysdeps/pthread/aio_misc.h: New file.
+
+2006-01-03 Joseph S. Myers <joseph@codesourcery.com>
+
+ * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
+
+2006-01-03 Steven Munroe <sjmunroe@us.ibm.com>
+
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
+ (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
+
+2006-01-04 Ulrich Drepper <drepper@redhat.com>
+
+ * tst-cancel24.cc: Use C headers instead of C++ headers.
+
2006-01-03 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
crtn-objs += $(multidir)/crtn.o
omit-deps += $(multidir)/crti $(multidir)/crtn
$(objpfx)$(multidir):
- mkdir $@
+ mkdir -p $@
endif
extra-objs += $(crti-objs) $(crtn-objs)
omit-deps += crti crtn
--- /dev/null
+/* 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. */
+
+/* We define a special synchronization primitive for AIO. POSIX
+ conditional variables would be ideal but the pthread_cond_*wait
+ operations do not return on EINTR. This is a requirement for
+ correct aio_suspend and lio_listio implementations. */
+
+#include <assert.h>
+#include <pthreadP.h>
+#include <lowlevellock.h>
+
+#define DONT_NEED_AIO_MISC_COND 1
+
+#define AIO_MISC_NOTIFY(waitlist) \
+ do { \
+ if (--*waitlist->counterp == 0) \
+ lll_futex_wake (waitlist->counterp, 1); \
+ } while (0)
+
+#define AIO_MISC_WAIT(result, futex, timeout, cancel) \
+ do { \
+ int oldval = futex; \
+ \
+ if (oldval != 0) \
+ { \
+ pthread_mutex_unlock (&__aio_requests_mutex); \
+ \
+ int oldtype; \
+ if (cancel) \
+ oldtype = LIBC_CANCEL_ASYNC (); \
+ \
+ int status; \
+ do \
+ { \
+ status = lll_futex_timed_wait (&futex, oldval, timeout); \
+ if (status != -EWOULDBLOCK) \
+ break; \
+ \
+ oldval = futex; \
+ } \
+ while (oldval != 0); \
+ \
+ if (cancel) \
+ LIBC_CANCEL_RESET (oldtype); \
+ \
+ if (status == -EINTR) \
+ result = EINTR; \
+ else if (status == -ETIMEDOUT) \
+ result = EAGAIN; \
+ else \
+ assert (status == 0 || status == -EWOULDBLOCK); \
+ \
+ pthread_mutex_lock (&__aio_requests_mutex); \
+ } \
+ } while (0)
+
+#include_next <aio_misc.h>
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
#define lll_futex_wait(futex, val) \
- do { \
- int __ignore; \
+ ({ \
+ int __status; \
register __typeof (val) _val asm ("edx") = (val); \
__asm __volatile (LLL_EBX_LOAD \
LLL_ENTER_KERNEL \
LLL_EBX_LOAD \
- : "=a" (__ignore) \
+ : "=a" (__status) \
: "0" (SYS_futex), LLL_EBX_REG (futex), "S" (0), \
"c" (FUTEX_WAIT), "d" (_val), \
"i" (offsetof (tcbhead_t, sysinfo))); \
- } while (0)
+ __status; \
+ })
+
+
+#define lll_futex_timed_wait(futex, val, timeout) \
+ ({ \
+ int __status; \
+ register __typeof (val) _val asm ("edx") = (val); \
+ __asm __volatile (LLL_EBX_LOAD \
+ LLL_ENTER_KERNEL \
+ LLL_EBX_LOAD \
+ : "=a" (__status) \
+ : "0" (SYS_futex), LLL_EBX_REG (futex), "S" (timeout), \
+ "c" (FUTEX_WAIT), "d" (_val), \
+ "i" (offsetof (tcbhead_t, sysinfo))); \
+ __status; \
+ })
#define lll_futex_wake(futex, nr) \
/* Cancellable system call stubs. Linux/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 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>, 2003.
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. */
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
+ 02110-1301 USA. */
#include <sysdep.h>
#include <tls.h>
# define PSEUDO(name, syscall_name, args) \
.section ".text"; \
ENTRY (name) \
- cfi_startproc; \
SINGLE_THREAD_P; \
bne- .Lpseudo_cancel; \
.type __##syscall_name##_nocancel,@function; \
CGOTRESTORE; \
mtlr 4; \
mtcr 0; \
- addi 1,1,48; \
- cfi_endproc;
+ addi 1,1,48;
# define DOCARGS_0
# define UNDOCARGS_0
/* Cancellable system call stubs. Linux/PowerPC64 version.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>, 2003.
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. */
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
+ 02110-1301 USA. */
#include <sysdep.h>
#include <tls.h>
# define PSEUDO(name, syscall_name, args) \
.section ".text"; \
ENTRY (name) \
- cfi_startproc; \
SINGLE_THREAD_P; \
bne- .Lpseudo_cancel; \
.type DASHDASHPFX(syscall_name##_nocancel),@function; \
ld 3,64(1); \
mtlr 9; \
mtcr 0; \
- addi 1,1,128; \
- cfi_endproc;
+ addi 1,1,128;
# define DOCARGS_0
# define UNDOCARGS_0
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
#define lll_futex_wait(futex, val) \
- do { \
- int __ignore; \
+ ({ \
+ int __status; \
register __typeof (val) _val asm ("edx") = (val); \
__asm __volatile ("xorq %%r10, %%r10\n\t" \
"syscall" \
- : "=a" (__ignore) \
+ : "=a" (__status) \
: "0" (SYS_futex), "D" (futex), "S" (FUTEX_WAIT), \
"d" (_val) \
: "memory", "cc", "r10", "r11", "cx"); \
- } while (0)
+ __status; \
+ })
+
+
+#define lll_futex_timed_wait(futex, val, timeout) \
+ ({ \
+ register const struct timespec *__to __asm__ ("r10") = timeout; \
+ int __status; \
+ register __typeof (val) _val asm ("edx") = (val); \
+ __asm __volatile ("syscall" \
+ : "=a" (__status) \
+ : "0" (SYS_futex), "D" (futex), "S" (FUTEX_WAIT), \
+ "d" (_val), "r" (__to) \
+ : "memory", "cc", "r11", "cx"); \
+ __status; \
+ })
#define lll_futex_wake(futex, nr) \
-#include <cstdlib>
-#include <cstdio>
#include <pthread.h>
#include <semaphore.h>
+#include <stdlib.h>
+#include <stdio.h>
#include <unistd.h>
#endif /* Use BSD || X/Open Unix. */
-#ifdef __USE_GNU
+#ifdef __USE_ATFILE
/* Change the owner and group of FILE relative to the directory FD is open
on. */
extern int fchownat (int __fd, __const char *__file, __uid_t __owner,
extern int link (__const char *__from, __const char *__to)
__THROW __nonnull ((1, 2)) __wur;
-#ifdef __USE_GNU
+#ifdef __USE_ATFILE
/* Like link but relative paths in TO and FROM are interpreted relative
to FROMFD and TOFD respectively. */
extern int linkat (int __fromfd, __const char *__from, int __tofd,
size_t __len) __THROW __nonnull ((1, 2)) __wur;
#endif /* Use BSD. */
-#ifdef __USE_GNU
+#ifdef __USE_ATFILE
/* Like symlink but a relative path in TO is interpreted relative to TOFD. */
extern int symlinkat (__const char *__from, int __tofd,
__const char *__to) __THROW __nonnull ((1, 3)) __wur;
/* Remove the link NAME. */
extern int unlink (__const char *__name) __THROW __nonnull ((1));
-#ifdef __USE_GNU
+#ifdef __USE_ATFILE
/* Remove the link NAME relative to FD. */
extern int unlinkat (int __fd, __const char *__name, int __flag)
__THROW __nonnull ((2));
-# Copyright (C) 1997-2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1997-2004, 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
tests := tst-shm tst-clock tst-clock_nanosleep tst-timer tst-timer2 \
tst-aio tst-aio64 tst-aio2 tst-aio3 tst-aio4 tst-aio5 tst-aio6 \
- tst-aio7 tst-mqueue1 tst-mqueue2 tst-mqueue3 tst-mqueue4 \
+ tst-aio7 tst-aio8 tst-aio9 tst-aio10 \
+ tst-mqueue1 tst-mqueue2 tst-mqueue3 tst-mqueue4 \
tst-mqueue5 tst-mqueue6 tst-mqueue7 tst-mqueue8 tst-mqueue9 \
tst-timer3 tst-timer4 tst-timer5 \
tst-cpuclock1 tst-cpuclock2 \
--- /dev/null
+#include <aio.h>
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+#include <unistd.h>
+
+static pthread_barrier_t b;
+static pthread_t main_thread;
+static int flag;
+
+
+static void *
+tf (void *arg)
+{
+ int e = pthread_barrier_wait (&b);
+ if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ puts ("child: barrier_wait failed");
+ exit (1);
+ }
+
+ /* There is unfortunately no other way to try to make sure the other
+ thread reached the aio_suspend call. This test could fail on
+ highly loaded machines. */
+ sleep (2);
+
+ pthread_kill (main_thread, SIGUSR1);
+
+ while (1)
+ sleep (1000);
+
+ return NULL;
+}
+
+
+static void
+sh (int sig)
+{
+ flag = 1;
+}
+
+
+static int
+do_test (void)
+{
+ main_thread = pthread_self ();
+
+ struct sigaction sa;
+
+ sa.sa_handler = sh;
+ sa.sa_flags = 0;
+ sigemptyset (&sa.sa_mask);
+
+ if (sigaction (SIGUSR1, &sa, NULL) != 0)
+ {
+ puts ("sigaction failed");
+ return 1;
+ }
+
+ if (pthread_barrier_init (&b, NULL, 2) != 0)
+ {
+ puts ("barrier_init");
+ return 1;
+ }
+
+ int fds[2];
+ if (pipe (fds) != 0)
+ {
+ puts ("pipe failed");
+ return 1;
+ }
+
+ char buf[42];
+ struct aiocb req;
+ req.aio_fildes = fds[0];
+ req.aio_lio_opcode = LIO_READ;
+ req.aio_reqprio = 0;
+ req.aio_offset = 0;
+ req.aio_buf = buf;
+ req.aio_nbytes = sizeof (buf);
+ req.aio_sigevent.sigev_notify = SIGEV_NONE;
+
+ pthread_t th;
+ if (pthread_create (&th, NULL, tf, NULL) != 0)
+ {
+ puts ("create failed");
+ return 1;
+ }
+
+ int e = pthread_barrier_wait (&b);
+ if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ puts ("parent: barrier_wait failed");
+ exit (1);
+ }
+
+ struct aiocb *list[1];
+ list[0] = &req;
+
+ e = lio_listio (LIO_WAIT, list, 1, NULL);
+ if (e != -1)
+ {
+ puts ("lio_listio succeeded");
+ return 1;
+ }
+ if (errno != EINTR)
+ {
+ printf ("lio_listio did not return EINTR: %d (%d = %m)\n", e, errno);
+ return 1;
+ }
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#define TIMEOUT 5
+#include "../test-skeleton.c"
/* Test for notification mechanism in lio_listio.
- Copyright (C) 2000,02 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 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
#include <unistd.h>
#include <errno.h>
-int flag;
+static pthread_barrier_t b;
static void
thrfct (sigval_t arg)
{
- flag = 1;
+ int e = pthread_barrier_wait (&b);
+ if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ puts ("child: barrier_wait failed");
+ exit (1);
+ }
}
unlink (name);
+ if (pthread_barrier_init (&b, NULL, 2) != 0)
+ {
+ puts ("barrier_init failed");
+ return 1;
+ }
+
arr[0] = &cb;
cb.aio_fildes = fd;
return 1;
}
- if (flag != 0)
+ int e = pthread_barrier_wait (&b);
+ if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
{
- puts ("thread created, should not have happened");
+ puts ("parent: barrier_wait failed");
return 1;
}
--- /dev/null
+#include <aio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+static int
+do_test (void)
+{
+ int fd = open ("/dev/full", O_RDWR);
+ if (fd == -1)
+ {
+ puts ("could not open /dev/full");
+ return 0;
+ }
+
+ struct aiocb req;
+ req.aio_fildes = fd;
+ req.aio_lio_opcode = LIO_WRITE;
+ req.aio_reqprio = 0;
+ req.aio_buf = (void *) "hello";
+ req.aio_nbytes = 5;
+ req.aio_offset = 0;
+ req.aio_sigevent.sigev_notify = SIGEV_NONE;
+
+ struct aiocb *list[1];
+ list[0] = &req;
+
+ int r = lio_listio (LIO_WAIT, list, 1, NULL);
+ int e = errno;
+
+ printf ("r = %d, e = %d (%s)\n", r, e, strerror (e));
+
+ return r != -1 || e != EIO;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
--- /dev/null
+#include <aio.h>
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+#include <unistd.h>
+
+static pthread_barrier_t b;
+static pthread_t main_thread;
+static int flag;
+
+
+static void *
+tf (void *arg)
+{
+ int e = pthread_barrier_wait (&b);
+ if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ puts ("child: barrier_wait failed");
+ exit (1);
+ }
+
+ /* There is unfortunately no other way to try to make sure the other
+ thread reached the aio_suspend call. This test could fail on
+ highly loaded machines. */
+ sleep (2);
+
+ pthread_kill (main_thread, SIGUSR1);
+
+ while (1)
+ sleep (1000);
+
+ return NULL;
+}
+
+
+static void
+sh (int sig)
+{
+ flag = 1;
+}
+
+
+static int
+do_test (void)
+{
+ main_thread = pthread_self ();
+
+ struct sigaction sa;
+
+ sa.sa_handler = sh;
+ sa.sa_flags = 0;
+ sigemptyset (&sa.sa_mask);
+
+ if (sigaction (SIGUSR1, &sa, NULL) != 0)
+ {
+ puts ("sigaction failed");
+ return 1;
+ }
+
+ if (pthread_barrier_init (&b, NULL, 2) != 0)
+ {
+ puts ("barrier_init");
+ return 1;
+ }
+
+ int fds[2];
+ if (pipe (fds) != 0)
+ {
+ puts ("pipe failed");
+ return 1;
+ }
+
+ char buf[42];
+ struct aiocb req;
+ req.aio_fildes = fds[0];
+ req.aio_reqprio = 0;
+ req.aio_offset = 0;
+ req.aio_buf = buf;
+ req.aio_nbytes = sizeof (buf);
+ req.aio_sigevent.sigev_notify = SIGEV_NONE;
+
+ if (aio_read (&req) != 0)
+ {
+ puts ("aio_read failed");
+ return 1;
+ }
+
+ pthread_t th;
+ if (pthread_create (&th, NULL, tf, NULL) != 0)
+ {
+ puts ("create failed");
+ return 1;
+ }
+
+ int e = pthread_barrier_wait (&b);
+ if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ puts ("parent: barrier_wait failed");
+ exit (1);
+ }
+
+ const struct aiocb *list[1];
+ list[0] = &req;
+
+ e = aio_suspend (list, 1, NULL);
+ if (e != -1)
+ {
+ puts ("aio_suspend succeeded");
+ return 1;
+ }
+ if (errno != EINTR)
+ {
+ puts ("aio_suspend did not return EINTR");
+ return 1;
+ }
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#define TIMEOUT 5
+#include "../test-skeleton.c"
/* Machine-dependent ELF startup code. PowerPC version.
- Copyright (C) 1995-2000, 2002, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1995-2000, 2002, 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
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. */
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
+ 02110-1301 USA. */
#include <sysdep.h>
bl _dl_start@local
/* FALLTHRU */
-ENTRY(_dl_start_user)
+_dl_start_user:
/* Now, we do our main work of calling initialisation procedures.
The ELF ABI doesn't say anything about parameters for these,
so we just pass argc, argv, and the environment.
Take the opportunity to clear LR, so anyone who accidentally returns
from _start gets SEGV. Also clear the next few words of the stack. */
-ENTRY(_dl_main_dispatch)
+_dl_main_dispatch:
li r31,0
stw r31,0(r1)
mtlr r31
-/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 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
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. */
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
+ 02110-1301 USA. */
/*
Floating Point Registers (FPRs) restore routine
lfd fp30,-16(r1) #restore f30
lfd fp31,-8(r1) #restore f31
blr #return
+END (_restfpr_all)
-/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 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
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. */
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
+ 02110-1301 USA. */
/*
Floating Point Registers (FPRs) save routine
stfd fp31,-8(r1) #save f31
stw r0,8(r1) #save LR in callers frame
blr #return
+END (_savefpr_all)
-/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 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
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. */
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
+ 02110-1301 USA. */
/*
General Purpose Register (GPR) restore routine
lwz r30,-8(r1) #restore r30
lwz r31,-4(r1) #restore r31
blr #return
+END (_restgpr0_all)
-/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 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
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. */
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
+ 02110-1301 USA. */
/*
General Purpose Register (GPR) restore routine
lwz r30,-8(r12) #restore r30
lwz r31,-4(r12) #restore r31
blr #return
+END (_restgpr1_all)
-/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 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
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. */
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
+ 02110-1301 USA. */
/*
General Purpose Register (GPR) save routine
stw r31,-4(r1) #save r31
stw r0,8(r1) #save LR in callers frame
blr #return
+END (_savegpr0_all)
-/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 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
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. */
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
+ 02110-1301 USA. */
/*
General Purpose Register (GPR) save routine
stw r30,-8(r12) #save r30
stw r31,-4(r12) #save r31
blr #return
+END (_savegpr1_all)
/* Assembly macros for 32-bit PowerPC.
- Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2001, 2002, 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
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. */
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
+ 02110-1301 USA. */
#include <sysdeps/powerpc/sysdep.h>
for its benefit. */
# define CALL_MCOUNT \
mflr r0; \
- stw r0,4(r1); \
+ stw r0,4(r1); \
+ cfi_offset (lr, 4); \
bl JUMPTARGET(_mcount);
#else /* PROF */
# define CALL_MCOUNT /* Do nothing. */
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
.align ALIGNARG(2); \
C_LABEL(name) \
+ cfi_startproc; \
CALL_MCOUNT
#define EALIGN_W_0 /* No words to insert. */
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
.align ALIGNARG(2); \
C_LABEL(name) \
+ cfi_startproc; \
CALL_MCOUNT \
b 0f; \
.align ALIGNARG(alignt); \
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
.align ALIGNARG(alignt); \
EALIGN_W_##words; \
- C_LABEL(name)
+ C_LABEL(name) \
+ cfi_startproc;
#endif
#undef END
#define END(name) \
+ cfi_endproc; \
ASM_SIZE_DIRECTIVE(name)
#define DO_CALL(syscall) \
/* Assembly macros for 64-bit PowerPC.
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 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
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. */
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
+ 02110-1301 USA. */
#include <sysdeps/powerpc/sysdep.h>
#define ENTRY(name) \
ENTRY_2(name) \
.align ALIGNARG(2); \
-BODY_LABEL(name):
+BODY_LABEL(name): \
+ cfi_startproc;
#define EALIGN_W_0 /* No words to insert. */
#define EALIGN_W_1 nop
ENTRY_2(name) \
.align ALIGNARG(alignt); \
EALIGN_W_##words; \
-BODY_LABEL(name):
+BODY_LABEL(name): \
+ cfi_startproc;
/* Local labels stripped out by the linker. */
#undef L
/* END generates Traceback tables */
#undef END
#define END(name) \
+ cfi_endproc; \
TRACEBACK(name) \
END_2(name)
/* This form supports more informative traceback tables */
#define END_GEN_TB(name,mask) \
+ cfi_endproc; \
TRACEBACK_MASK(name,mask) \
END_2(name)
-/* Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1999,2000,2001,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
{
struct waitlist *next;
+ /* The next two fields is used in synchronous `lio_listio' operations. */
+#ifndef DONT_NEED_AIO_MISC_COND
pthread_cond_t *cond;
+#endif
+ int *result;
+
volatile int *counterp;
/* The next field is used in asynchronous `lio_listio' operations. */
struct sigevent *sigevp;
/* Notify initiator of AIO request.
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004
- Free Software Foundation, Inc.
+ Copyright (C) 1997-2001, 2003, 2004, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
{
struct waitlist *next = waitlist->next;
- /* Decrement the counter. This is used in both cases. */
- --*waitlist->counterp;
-
if (waitlist->sigevp == NULL)
- pthread_cond_signal (waitlist->cond);
+ {
+ if (waitlist->result != NULL && aiocbp->__return_value == -1)
+ *waitlist->result = -1;
+
+#ifdef DONT_NEED_AIO_MISC_COND
+ AIO_MISC_NOTIFY (waitlist);
+#else
+ /* Decrement the counter. */
+ --*waitlist->counterp;
+
+ pthread_cond_signal (waitlist->cond);
+#endif
+ }
else
/* This is part of a asynchronous `lio_listio' operation. If
this request is the last one, send the signal. */
- if (*waitlist->counterp == 0)
+ if (--*waitlist->counterp == 0)
{
#ifdef BROKEN_THREAD_SIGNALS
__aio_notify_only (waitlist->sigevp, waitlist->caller_pid);
/* Suspend until termination of a requests.
- Copyright (C) 1997,1998,1999,2000,2002,2003,2005
- Free Software Foundation, Inc.
+ Copyright (C) 1997-2000,2002,2003,2005,2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
const struct aiocb *const *list;
struct waitlist *waitlist;
struct requestlist **requestlist;
+#ifndef DONT_NEED_AIO_MISC_COND
pthread_cond_t *cond;
+#endif
int nent;
};
static void
cleanup (void *arg)
{
+#ifdef DONT_NEED_AIO_MISC_COND
+ /* Acquire the mutex. If pthread_cond_*wait is used this would
+ happen implicitly. */
+ pthread_mutex_lock (&__aio_requests_mutex);
+#endif
+
const struct clparam *param = (const struct clparam *) arg;
/* Now remove the entry in the waiting list for all requests
*listp = (*listp)->next;
}
+#ifndef DONT_NEED_AIO_MISC_COND
/* Release the conditional variable. */
(void) pthread_cond_destroy (param->cond);
+#endif
/* Release the mutex. */
pthread_mutex_unlock (&__aio_requests_mutex);
int nent;
const struct timespec *timeout;
{
+ if (__builtin_expect (nent < 0, 0))
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
struct waitlist waitlist[nent];
struct requestlist *requestlist[nent];
+#ifndef DONT_NEED_AIO_MISC_COND
pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
+#endif
int cnt;
bool any = false;
int result = 0;
- int dummy;
+ int cntr = 1;
/* Request the mutex. */
pthread_mutex_lock (&__aio_requests_mutex);
if (requestlist[cnt] != NULL)
{
+#ifndef DONT_NEED_AIO_MISC_COND
waitlist[cnt].cond = &cond;
+#endif
+ waitlist[cnt].result = NULL;
waitlist[cnt].next = requestlist[cnt]->waiting;
- waitlist[cnt].counterp = &dummy;
+ waitlist[cnt].counterp = &cntr;
waitlist[cnt].sigevp = NULL;
#ifdef BROKEN_THREAD_SIGNALS
waitlist[cnt].caller_pid = 0; /* Not needed. */
.list = list,
.waitlist = waitlist,
.requestlist = requestlist,
+#ifndef DONT_NEED_AIO_MISC_COND
.cond = &cond,
+#endif
.nent = nent
};
pthread_cleanup_push (cleanup, &clparam);
+#ifdef DONT_NEED_AIO_MISC_COND
+ AIO_MISC_WAIT (result, cntr, timeout, 1);
+#else
if (timeout == NULL)
result = pthread_cond_wait (&cond, &__aio_requests_mutex);
else
result = pthread_cond_timedwait (&cond, &__aio_requests_mutex,
&abstime);
}
+#endif
pthread_cleanup_pop (0);
}
*listp = (*listp)->next;
}
+#ifndef DONT_NEED_AIO_MISC_COND
/* Release the conditional variable. */
if (__builtin_expect (pthread_cond_destroy (&cond) != 0, 0))
/* This must never happen. */
abort ();
+#endif
if (result != 0)
{
- /* An error occurred. Possibly it's EINTR. We have to translate
+#ifndef DONT_NEED_AIO_MISC_COND
+ /* An error occurred. Possibly it's ETIMEDOUT. We have to translate
the timeout error report of `pthread_cond_timedwait' to the
form expected from `aio_suspend'. */
if (result == ETIMEDOUT)
__set_errno (EAGAIN);
else
+#endif
__set_errno (result);
result = -1;
}
else if (LIO_MODE (mode) == LIO_WAIT)
{
+#ifndef DONT_NEED_AIO_MISC_COND
pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
- struct waitlist waitlist[nent];
int oldstate;
+#endif
+ struct waitlist waitlist[nent];
total = 0;
for (cnt = 0; cnt < nent; ++cnt)
if (requests[cnt] != NULL && list[cnt]->aio_lio_opcode != LIO_NOP)
{
+#ifndef DONT_NEED_AIO_MISC_COND
waitlist[cnt].cond = &cond;
+#endif
+ waitlist[cnt].result = &result;
waitlist[cnt].next = requests[cnt]->waiting;
waitlist[cnt].counterp = &total;
waitlist[cnt].sigevp = NULL;
}
}
- /* Since `pthread_cond_wait'/`pthread_cond_timedwait' are cancelation
+#ifdef DONT_NEED_AIO_MISC_COND
+ AIO_MISC_WAIT (result, total, NULL, 0);
+#else
+ /* Since `pthread_cond_wait'/`pthread_cond_timedwait' are cancellation
points we must be careful. We added entries to the waiting lists
- which we must remove. So defer cancelation for now. */
+ which we must remove. So defer cancellation for now. */
pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &oldstate);
while (total > 0)
pthread_cond_wait (&cond, &__aio_requests_mutex);
- /* Now it's time to restore the cancelation state. */
+ /* Now it's time to restore the cancellation state. */
pthread_setcancelstate (oldstate, NULL);
/* Release the conditional variable. */
if (pthread_cond_destroy (&cond) != 0)
/* This must never happen. */
abort ();
+#endif
+
+ /* If any of the I/O requests failed, return -1 and set errno. */
+ if (result != 0)
+ {
+ __set_errno (result == EINTR ? EINTR : EIO);
+ result = -1;
+ }
}
else
{
if (requests[cnt] != NULL
&& list[cnt]->aio_lio_opcode != LIO_NOP)
{
+#ifndef DONT_NEED_AIO_MISC_COND
waitlist->list[cnt].cond = NULL;
+#endif
+ waitlist->list[cnt].result = NULL;
waitlist->list[cnt].next = requests[cnt]->waiting;
waitlist->list[cnt].counterp = &waitlist->counter;
waitlist->list[cnt].sigevp = &waitlist->sigev;
--- /dev/null
+/* Change the protections of 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
+fchmodat (fd, file, mode, flag)
+ int fd;
+ const char *file;
+ mode_t mode;
+ int flag;
+{
+ if (flag & ~AT_SYMLINK_NOFOLLOW)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+#ifndef __NR_lchmod /* Linux so far has no lchmod syscall. */
+ if (flag & AT_SYMLINK_NOFOLLOW)
+ {
+ __set_errno (ENOTSUP);
+ return -1;
+ }
+#endif
+
+ 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;
+ }
+
+ int result;
+ INTERNAL_SYSCALL_DECL (err);
+
+#ifdef __NR_lchmod
+ if (flag & AT_SYMLINK_NOFOLLOW)
+ result = INTERNAL_SYSCALL (lchmod, err, 2, file, mode);
+ else
+#endif
+ result = INTERNAL_SYSCALL (chmod, 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;
+}
/* Set flags signalling availability of kernel features based on given
kernel version number.
- Copyright (C) 1999-2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1999-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
#endif
/* Starting with version 2.6.4-rc1 the getdents syscall returns d_type
- information as well. */
-#if __LINUX_KERNEL_VERSION >= 132612
+ information as well and in between 2.6.5 and 2.6.8 most compat wrappers
+ were fixed too. Except s390{,x} which was fixed in 2.6.11. */
+#if (__LINUX_KERNEL_VERSION >= 0x020608 && !defined __s390__) \
+ || (__LINUX_KERNEL_VERSION >= 0x02060b && defined __s390__)
# define __ASSUME_GETDENTS32_D_TYPE 1
#endif
#endif
/* Starting with version 2.6.9, the waitid system call is available.
- Except for powerpc and powerpc64, where it is available in 2.6.12. */
-#if (__LINUX_KERNEL_VERSION >= 0x020609 && !defined __powerpc__) \
- || (__LINUX_KERNEL_VERSION >= 0x02060c && defined __powerpc__)
+ Except for powerpc{,64} and s390{,x}, where it is available in 2.6.12. */
+#if (__LINUX_KERNEL_VERSION >= 0x020609 \
+ && !defined __powerpc__ && !defined __s390__) \
+ || (__LINUX_KERNEL_VERSION >= 0x02060c \
+ && (defined __powerpc__ || defined __s390__))
# define __ASSUME_WAITID_SYSCALL 1
#endif
"syscall" /* Perform the system call. */
: "=r" (res)
: "I" (SYS_ify (brk)), "r" (addr)
-+ : "$4", "$7", __SYSCALL_CLOBBERS);
+ : "$4", "$7", __SYSCALL_CLOBBERS);
newbrk = (void *) res;
}
__curbrk = newbrk;
-/* Copyright (C) 1995, 1996, 1997, 1999, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1995,96,97,99, 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
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. */
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
+ 02110-1301 USA. */
#include <sysdep-cancel.h>
#include <socketcall.h>
.text
ENTRY(__socket)
- cfi_startproc
stwu r1,-48(r1)
cfi_adjust_cfa_offset(48)
#if NARGS >= 1
addi r1,r1,48
PSEUDO_RET
#endif
- cfi_endproc
PSEUDO_END (__socket)
-/* Copyright (C) 1995, 1996, 1997, 1999, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1995,96,97,99, 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
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ write to the Free Software Foundation, Inc., 51 Franklin Street,
+ Fifth Floor, Boston MA 02110-1301, USA. */
#include <sysdep-cancel.h>
#include <socketcall.h>
.text
ENTRY(__socket)
CALL_MCOUNT NARGS
- cfi_startproc
stdu r1,-144(r1)
cfi_adjust_cfa_offset(144)
#if NARGS >= 1
addi r1,r1,144
PSEUDO_RET
#endif
- cfi_endproc
PSEUDO_END (__socket)
#ifndef NO_WEAK_ALIAS
-/* Copyright (C) 1991-1994,1996-2002,2003,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1994,1996-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
extern int futimes (int __fd, __const struct timeval __tvp[2]) __THROW;
#endif
-#ifdef __USE_GNU
+#ifdef __USE_ATFILE
/* Change the access time of FILE relative to FD to TVP[0] and the
modification time of FILE to TVP[1]. If TVP is a null pointer, use
the current time instead. Returns 0 on success, -1 on errors. */