summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/powerpc/powerpc32/dl-start.S10
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/fprrest.S7
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/fprsave.S7
-rw-r--r--sysdeps/powerpc/powerpc32/gprrest0.S7
-rw-r--r--sysdeps/powerpc/powerpc32/gprrest1.S7
-rw-r--r--sysdeps/powerpc/powerpc32/gprsave0.S7
-rw-r--r--sysdeps/powerpc/powerpc32/gprsave1.S7
-rw-r--r--sysdeps/powerpc/powerpc32/sysdep.h15
-rw-r--r--sysdeps/powerpc/powerpc64/sysdep.h14
-rw-r--r--sysdeps/pthread/aio_misc.h7
-rw-r--r--sysdeps/pthread/aio_notify.c22
-rw-r--r--sysdeps/pthread/aio_suspend.c40
-rw-r--r--sysdeps/pthread/lio_listio.c27
-rw-r--r--sysdeps/unix/sysv/linux/fchmodat.c87
-rw-r--r--sysdeps/unix/sysv/linux/kernel-features.h16
-rw-r--r--sysdeps/unix/sysv/linux/mips/brk.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S8
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S8
18 files changed, 231 insertions, 67 deletions
diff --git a/sysdeps/powerpc/powerpc32/dl-start.S b/sysdeps/powerpc/powerpc32/dl-start.S
index 7403a352fa..c77c4de198 100644
--- a/sysdeps/powerpc/powerpc32/dl-start.S
+++ b/sysdeps/powerpc/powerpc32/dl-start.S
@@ -1,5 +1,5 @@
/* 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
@@ -14,8 +14,8 @@
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>
@@ -39,7 +39,7 @@ ENTRY(_start)
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.
@@ -98,7 +98,7 @@ ENTRY(_dl_start_user)
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
diff --git a/sysdeps/powerpc/powerpc32/fpu/fprrest.S b/sysdeps/powerpc/powerpc32/fpu/fprrest.S
index 42317809eb..2f6c6deb2e 100644
--- a/sysdeps/powerpc/powerpc32/fpu/fprrest.S
+++ b/sysdeps/powerpc/powerpc32/fpu/fprrest.S
@@ -1,4 +1,4 @@
-/* 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
@@ -13,8 +13,8 @@
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
@@ -92,3 +92,4 @@ C_TEXT(_restfpr_29): lwz r0,8(r1) #get return address from frame
lfd fp30,-16(r1) #restore f30
lfd fp31,-8(r1) #restore f31
blr #return
+END (_restfpr_all)
diff --git a/sysdeps/powerpc/powerpc32/fpu/fprsave.S b/sysdeps/powerpc/powerpc32/fpu/fprsave.S
index d7bc1ab7dc..597c3e611f 100644
--- a/sysdeps/powerpc/powerpc32/fpu/fprsave.S
+++ b/sysdeps/powerpc/powerpc32/fpu/fprsave.S
@@ -1,4 +1,4 @@
-/* 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
@@ -13,8 +13,8 @@
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
@@ -91,3 +91,4 @@ C_TEXT(_savefpr_29): stfd fp29,-24(r1) #save f29
stfd fp31,-8(r1) #save f31
stw r0,8(r1) #save LR in callers frame
blr #return
+END (_savefpr_all)
diff --git a/sysdeps/powerpc/powerpc32/gprrest0.S b/sysdeps/powerpc/powerpc32/gprrest0.S
index cf493f0c47..90eb4a0c4c 100644
--- a/sysdeps/powerpc/powerpc32/gprrest0.S
+++ b/sysdeps/powerpc/powerpc32/gprrest0.S
@@ -1,4 +1,4 @@
-/* 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
@@ -13,8 +13,8 @@
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
@@ -67,3 +67,4 @@ C_TEXT(_restgpr0_29): lwz r0,8(r1) #get return address from frame
lwz r30,-8(r1) #restore r30
lwz r31,-4(r1) #restore r31
blr #return
+END (_restgpr0_all)
diff --git a/sysdeps/powerpc/powerpc32/gprrest1.S b/sysdeps/powerpc/powerpc32/gprrest1.S
index 5ac18606f8..ca00b8f133 100644
--- a/sysdeps/powerpc/powerpc32/gprrest1.S
+++ b/sysdeps/powerpc/powerpc32/gprrest1.S
@@ -1,4 +1,4 @@
-/* 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
@@ -13,8 +13,8 @@
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
@@ -61,3 +61,4 @@ C_TEXT(_restgpr1_29): lwz r29,-12(r12) #restore r29
lwz r30,-8(r12) #restore r30
lwz r31,-4(r12) #restore r31
blr #return
+END (_restgpr1_all)
diff --git a/sysdeps/powerpc/powerpc32/gprsave0.S b/sysdeps/powerpc/powerpc32/gprsave0.S
index a09f1e569a..8b81647dd7 100644
--- a/sysdeps/powerpc/powerpc32/gprsave0.S
+++ b/sysdeps/powerpc/powerpc32/gprsave0.S
@@ -1,4 +1,4 @@
-/* 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
@@ -13,8 +13,8 @@
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
@@ -66,3 +66,4 @@ C_TEXT(_savegpr0_29): stw r29,-12(r1) #save r29
stw r31,-4(r1) #save r31
stw r0,8(r1) #save LR in callers frame
blr #return
+END (_savegpr0_all)
diff --git a/sysdeps/powerpc/powerpc32/gprsave1.S b/sysdeps/powerpc/powerpc32/gprsave1.S
index 06ee4a69d3..6c1790129e 100644
--- a/sysdeps/powerpc/powerpc32/gprsave1.S
+++ b/sysdeps/powerpc/powerpc32/gprsave1.S
@@ -1,4 +1,4 @@
-/* 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
@@ -13,8 +13,8 @@
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
@@ -61,3 +61,4 @@ C_TEXT(_savegpr1_29): stw r29,-12(r12) #save r29
stw r30,-8(r12) #save r30
stw r31,-4(r12) #save r31
blr #return
+END (_savegpr1_all)
diff --git a/sysdeps/powerpc/powerpc32/sysdep.h b/sysdeps/powerpc/powerpc32/sysdep.h
index 552f595a10..8fc624ebd9 100644
--- a/sysdeps/powerpc/powerpc32/sysdep.h
+++ b/sysdeps/powerpc/powerpc32/sysdep.h
@@ -1,5 +1,5 @@
/* 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
@@ -14,8 +14,8 @@
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>
@@ -31,7 +31,8 @@
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. */
@@ -42,6 +43,7 @@
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. */
@@ -61,6 +63,7 @@
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
.align ALIGNARG(2); \
C_LABEL(name) \
+ cfi_startproc; \
CALL_MCOUNT \
b 0f; \
.align ALIGNARG(alignt); \
@@ -72,11 +75,13 @@
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) \
diff --git a/sysdeps/powerpc/powerpc64/sysdep.h b/sysdeps/powerpc/powerpc64/sysdep.h
index fead0b578a..2745d7eb71 100644
--- a/sysdeps/powerpc/powerpc64/sysdep.h
+++ b/sysdeps/powerpc/powerpc64/sysdep.h
@@ -1,5 +1,5 @@
/* 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
@@ -14,8 +14,8 @@
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>
@@ -92,7 +92,8 @@ name##: OPD_ENT (name); \
#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
@@ -109,7 +110,8 @@ BODY_LABEL(name):
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
@@ -173,11 +175,13 @@ LT_LABELSUFFIX(name,_name_end): ; \
/* 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)
diff --git a/sysdeps/pthread/aio_misc.h b/sysdeps/pthread/aio_misc.h
index 44d53b078f..50962c7519 100644
--- a/sysdeps/pthread/aio_misc.h
+++ b/sysdeps/pthread/aio_misc.h
@@ -1,4 +1,4 @@
-/* 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
@@ -46,7 +46,12 @@ struct waitlist
{
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;
diff --git a/sysdeps/pthread/aio_notify.c b/sysdeps/pthread/aio_notify.c
index 877e8d9363..3f7f70ef7c 100644
--- a/sysdeps/pthread/aio_notify.c
+++ b/sysdeps/pthread/aio_notify.c
@@ -1,6 +1,5 @@
/* 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.
@@ -144,15 +143,24 @@ __aio_notify (struct requestlist *req)
{
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);
diff --git a/sysdeps/pthread/aio_suspend.c b/sysdeps/pthread/aio_suspend.c
index 8f8e33a7dc..b85b16d10e 100644
--- a/sysdeps/pthread/aio_suspend.c
+++ b/sysdeps/pthread/aio_suspend.c
@@ -1,6 +1,5 @@
/* 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.
@@ -45,7 +44,9 @@ struct clparam
const struct aiocb *const *list;
struct waitlist *waitlist;
struct requestlist **requestlist;
+#ifndef DONT_NEED_AIO_MISC_COND
pthread_cond_t *cond;
+#endif
int nent;
};
@@ -53,6 +54,12 @@ struct clparam
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
@@ -76,8 +83,10 @@ cleanup (void *arg)
*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);
@@ -90,13 +99,21 @@ aio_suspend (list, nent, timeout)
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);
@@ -112,9 +129,12 @@ aio_suspend (list, nent, timeout)
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. */
@@ -140,12 +160,17 @@ aio_suspend (list, nent, timeout)
.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
@@ -167,6 +192,7 @@ aio_suspend (list, nent, timeout)
result = pthread_cond_timedwait (&cond, &__aio_requests_mutex,
&abstime);
}
+#endif
pthread_cleanup_pop (0);
}
@@ -190,19 +216,23 @@ aio_suspend (list, nent, timeout)
*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;
diff --git a/sysdeps/pthread/lio_listio.c b/sysdeps/pthread/lio_listio.c
index 815840397e..c652404ae2 100644
--- a/sysdeps/pthread/lio_listio.c
+++ b/sysdeps/pthread/lio_listio.c
@@ -122,9 +122,11 @@ lio_listio_internal (int mode, struct aiocb *const list[], int nent,
}
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)
@@ -133,7 +135,10 @@ lio_listio_internal (int mode, struct aiocb *const list[], int nent,
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;
@@ -145,21 +150,32 @@ lio_listio_internal (int mode, struct aiocb *const list[], int nent,
}
}
- /* 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
{
@@ -188,7 +204,10 @@ lio_listio_internal (int mode, struct aiocb *const list[], int nent,
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;
diff --git a/sysdeps/unix/sysv/linux/fchmodat.c b/sysdeps/unix/sysv/linux/fchmodat.c
new file mode 100644
index 0000000000..de35e4376f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/fchmodat.c
@@ -0,0 +1,87 @@
+/* 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;
+}
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index 9bbd97e6d2..3bc5dc03c2 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -1,6 +1,6 @@
/* 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
@@ -423,8 +423,10 @@
#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
@@ -435,9 +437,11 @@
#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
diff --git a/sysdeps/unix/sysv/linux/mips/brk.c b/sysdeps/unix/sysv/linux/mips/brk.c
index 33e51a22b2..00056bee7a 100644
--- a/sysdeps/unix/sysv/linux/mips/brk.c
+++ b/sysdeps/unix/sysv/linux/mips/brk.c
@@ -41,7 +41,7 @@ __brk (void *addr)
"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;
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S
index 3e4a188a20..0bb5bef78b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S
@@ -1,4 +1,4 @@
-/* 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
@@ -13,8 +13,8 @@
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>
@@ -53,7 +53,6 @@
.text
ENTRY(__socket)
- cfi_startproc
stwu r1,-48(r1)
cfi_adjust_cfa_offset(48)
#if NARGS >= 1
@@ -114,7 +113,6 @@ ENTRY(__socket)
addi r1,r1,48
PSEUDO_RET
#endif
- cfi_endproc
PSEUDO_END (__socket)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S
index a73f7be666..15d8e84c1f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S
@@ -1,4 +1,4 @@
-/* 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
@@ -13,8 +13,8 @@
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>
@@ -52,7 +52,6 @@
.text
ENTRY(__socket)
CALL_MCOUNT NARGS
- cfi_startproc
stdu r1,-144(r1)
cfi_adjust_cfa_offset(144)
#if NARGS >= 1
@@ -117,7 +116,6 @@ ENTRY(__socket)
addi r1,r1,144
PSEUDO_RET
#endif
- cfi_endproc
PSEUDO_END (__socket)
#ifndef NO_WEAK_ALIAS