summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/paths.h1
-rw-r--r--sysdeps/posix/preadv.c4
-rw-r--r--sysdeps/posix/pwritev.c34
-rw-r--r--sysdeps/posix/readv.c2
-rw-r--r--sysdeps/sh/sh4/setjmp.S4
-rw-r--r--sysdeps/unix/make-syscalls.sh1
-rw-r--r--sysdeps/unix/sysv/linux/kernel-features.h4
-rw-r--r--sysdeps/unix/sysv/linux/paths.h1
-rw-r--r--sysdeps/unix/sysv/linux/preadv.c10
-rw-r--r--sysdeps/unix/sysv/linux/pwritev.c10
-rw-r--r--sysdeps/unix/sysv/linux/sys/mount.h6
-rw-r--r--sysdeps/unix/sysv/linux/sys/timex.h14
12 files changed, 49 insertions, 42 deletions
diff --git a/sysdeps/generic/paths.h b/sysdeps/generic/paths.h
index 03bf0f355f..439992fe7b 100644
--- a/sysdeps/generic/paths.h
+++ b/sysdeps/generic/paths.h
@@ -44,6 +44,7 @@
#define _PATH_DEVDB "/var/run/dev.db"
#define _PATH_DEVNULL "/dev/null"
#define _PATH_DRUM "/dev/drum"
+#define _PATH_GSHADOW "/etc/gshadow"
#define _PATH_KMEM "/dev/kmem"
#define _PATH_MAILDIR "/var/mail"
#define _PATH_LASTLOG "/var/log/lastlog"
diff --git a/sysdeps/posix/preadv.c b/sysdeps/posix/preadv.c
index e697604c19..791077399e 100644
--- a/sysdeps/posix/preadv.c
+++ b/sysdeps/posix/preadv.c
@@ -48,7 +48,7 @@ ifree (char **ptrp)
without change the file pointer, and put the result in the buffers
described by VECTOR, which is a vector of COUNT 'struct iovec's.
The buffers are filled in the order specified. Operates just like
- 'read' (see <unistd.h>) except that data are put in VECTOR instead
+ 'pread' (see <unistd.h>) except that data are put in VECTOR instead
of a contiguous buffer. */
ssize_t
PREADV (int fd, const struct iovec *vector, int count, OFF_T offset)
@@ -83,7 +83,7 @@ PREADV (int fd, const struct iovec *vector, int count, OFF_T offset)
/* Read the data. */
ssize_t bytes_read = PREAD (fd, buffer, bytes, offset);
- if (bytes_read <= 0)
+ if (bytes_read < 0)
return -1;
/* Copy the data from BUFFER into the memory specified by VECTOR. */
diff --git a/sysdeps/posix/pwritev.c b/sysdeps/posix/pwritev.c
index 0b6627dc9d..f2f0574aac 100644
--- a/sysdeps/posix/pwritev.c
+++ b/sysdeps/posix/pwritev.c
@@ -44,12 +44,12 @@ ifree (char **ptrp)
}
-/* Read data from file descriptor FD at the given position OFFSET
- without change the file pointer, and put the result in the buffers
- described by VECTOR, which is a vector of COUNT 'struct iovec's.
- The buffers are filled in the order specified. Operates just like
- 'read' (see <unistd.h>) except that data are put in VECTOR instead
- of a contiguous buffer. */
+/* Write data pointed by the buffers described by IOVEC, which is a
+ vector of COUNT 'struct iovec's, to file descriptor FD at the given
+ position OFFSET without change the file pointer. The data is
+ written in the order specified. Operates just like 'write' (see
+ <unistd.h>) except that the data are taken from IOVEC instead of a
+ contiguous buffer. */
ssize_t
PWRITEV (int fd, const struct iovec *vector, int count, OFF_T offset)
{
@@ -81,26 +81,14 @@ PWRITEV (int fd, const struct iovec *vector, int count, OFF_T offset)
return -1;
}
- /* Read the data. */
- ssize_t bytes_read = PWRITE (fd, buffer, bytes, offset);
- if (bytes_read <= 0)
- return -1;
-
/* Copy the data from BUFFER into the memory specified by VECTOR. */
- bytes = bytes_read;
+ char *ptr = buffer;
for (int i = 0; i < count; ++i)
- {
- size_t copy = MIN (vector[i].iov_len, bytes);
-
- (void) memcpy ((void *) vector[i].iov_base, (void *) buffer, copy);
-
- buffer += copy;
- bytes -= copy;
- if (bytes == 0)
- break;
- }
+ ptr = __mempcpy ((void *) ptr, (void *) vector[i].iov_base,
+ vector[i].iov_len);
- return bytes_read;
+ /* Write the data. */
+ return PWRITE (fd, buffer, bytes, offset);
}
#if __WORDSIZE == 64 && defined pwritev64
# undef pwritev64
diff --git a/sysdeps/posix/readv.c b/sysdeps/posix/readv.c
index 50bcc91315..6f16b9d946 100644
--- a/sysdeps/posix/readv.c
+++ b/sysdeps/posix/readv.c
@@ -70,7 +70,7 @@ __libc_readv (int fd, const struct iovec *vector, int count)
/* Read the data. */
ssize_t bytes_read = __read (fd, buffer, bytes);
- if (bytes_read <= 0)
+ if (bytes_read < 0)
return -1;
/* Copy the data from BUFFER into the memory specified by VECTOR. */
diff --git a/sysdeps/sh/sh4/setjmp.S b/sysdeps/sh/sh4/setjmp.S
index 03f0b08dcd..9d8fab7a99 100644
--- a/sysdeps/sh/sh4/setjmp.S
+++ b/sysdeps/sh/sh4/setjmp.S
@@ -22,13 +22,15 @@
ENTRY (__sigsetjmp)
/* Save registers */
- add #JB_SIZE, r4
#ifdef __SH_FPU_ANY__
+ add #JB_SIZE, r4
fmov.s fr15, @-r4
fmov.s fr14, @-r4
fmov.s fr13, @-r4
fmov.s fr12, @-r4
sts.l fpscr, @-r4
+#else
+ add #(JB_SIZE - 4 * 5), r4
#endif /* __SH_FPU_ANY__ */
stc.l gbr, @-r4
#ifdef PTR_MANGLE
diff --git a/sysdeps/unix/make-syscalls.sh b/sysdeps/unix/make-syscalls.sh
index ca82e1f331..8abb0349bf 100644
--- a/sysdeps/unix/make-syscalls.sh
+++ b/sysdeps/unix/make-syscalls.sh
@@ -155,6 +155,7 @@ shared-only-routines += $file
case x"$callnum" in
x_)
echo "\
+ \$(make-target-directory)
(echo '/* Dummy module requested by syscalls.list */'; \\"
;;
x*)
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index 2fa8524db9..97725e7291 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -531,9 +531,7 @@
#endif
/* Support for preadv and pwritev was added in 2.6.30. */
-#if __LINUX_KERNEL_VERSION >= 0x02061e \
- && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
- || defined __ia64__ || defined __sparc__ && defined __sh__)
+#if __LINUX_KERNEL_VERSION >= 0x02061e
# define __ASSUME_PREADV 1
# define __ASSUME_PWRITEV 1
#endif
diff --git a/sysdeps/unix/sysv/linux/paths.h b/sysdeps/unix/sysv/linux/paths.h
index a87831e74a..1b01c0d179 100644
--- a/sysdeps/unix/sysv/linux/paths.h
+++ b/sysdeps/unix/sysv/linux/paths.h
@@ -44,6 +44,7 @@
#define _PATH_DEVDB "/var/run/dev.db"
#define _PATH_DEVNULL "/dev/null"
#define _PATH_DRUM "/dev/drum"
+#define _PATH_GSHADOW "/etc/gshadow"
#define _PATH_KLOG "/proc/kmsg"
#define _PATH_KMEM "/dev/kmem"
#define _PATH_LASTLOG "/var/log/lastlog"
diff --git a/sysdeps/unix/sysv/linux/preadv.c b/sysdeps/unix/sysv/linux/preadv.c
index 0d4a6c3803..72722ebc0d 100644
--- a/sysdeps/unix/sysv/linux/preadv.c
+++ b/sysdeps/unix/sysv/linux/preadv.c
@@ -37,6 +37,10 @@
# define OFF_T off_t
#endif
+#define LO_HI_LONG(val) \
+ (off_t) val, \
+ (off_t) ((((uint64_t) (val)) >> (sizeof (long) * 4)) >> (sizeof (long) * 4))
+
#ifndef __ASSUME_PREADV
static ssize_t PREADV_REPLACEMENT (int, __const struct iovec *,
int, OFF_T) internal_function;
@@ -55,15 +59,13 @@ PREADV (fd, vector, count, offset)
if (SINGLE_THREAD_P)
result = INLINE_SYSCALL (preadv, 5, fd, vector, count,
- (off_t) ((off64_t) offset >> 32),
- (off_t) (offset & 0xffffffff));
+ LO_HI_LONG (offset));
else
{
int oldtype = LIBC_CANCEL_ASYNC ();
result = INLINE_SYSCALL (preadv, 5, fd, vector, count,
- (off_t) ((off64_t) offset >> 32),
- (off_t) (offset & 0xffffffff));
+ LO_HI_LONG (offset));
LIBC_CANCEL_RESET (oldtype);
}
diff --git a/sysdeps/unix/sysv/linux/pwritev.c b/sysdeps/unix/sysv/linux/pwritev.c
index 5c30eae51f..2e9cbb2536 100644
--- a/sysdeps/unix/sysv/linux/pwritev.c
+++ b/sysdeps/unix/sysv/linux/pwritev.c
@@ -37,6 +37,10 @@
# define OFF_T off_t
#endif
+#define LO_HI_LONG(val) \
+ (off_t) val, \
+ (off_t) ((((uint64_t) (val)) >> (sizeof (long) * 4)) >> (sizeof (long) * 4))
+
#ifndef __ASSUME_PWRITEV
static ssize_t PWRITEV_REPLACEMENT (int, __const struct iovec *,
int, OFF_T) internal_function;
@@ -55,15 +59,13 @@ PWRITEV (fd, vector, count, offset)
if (SINGLE_THREAD_P)
result = INLINE_SYSCALL (pwritev, 5, fd, vector, count,
- (off_t) ((off64_t) offset >> 32),
- (off_t) (offset & 0xffffffff));
+ LO_HI_LONG (offset));
else
{
int oldtype = LIBC_CANCEL_ASYNC ();
result = INLINE_SYSCALL (pwritev, 5, fd, vector, count,
- (off_t) ((off64_t) offset >> 32),
- (off_t) (offset & 0xffffffff));
+ LO_HI_LONG (offset));
LIBC_CANCEL_RESET (oldtype);
}
diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
index b30554987a..57d440f273 100644
--- a/sysdeps/unix/sysv/linux/sys/mount.h
+++ b/sysdeps/unix/sysv/linux/sys/mount.h
@@ -96,8 +96,12 @@ enum
/* Possible value for FLAGS parameter of `umount2'. */
enum
{
- MNT_FORCE = 1 /* Force unmounting. */
+ MNT_FORCE = 1, /* Force unmounting. */
#define MNT_FORCE MNT_FORCE
+ MNT_DETACH = 2, /* Just detach from the tree. */
+#define MNT_DETACH MNT_DETACH
+ MNT_EXPIRE = 4 /* Mark for expiry. */
+#define MNT_EXPIRE MNT_EXPIRE
};
diff --git a/sysdeps/unix/sysv/linux/sys/timex.h b/sysdeps/unix/sysv/linux/sys/timex.h
index f7bd6e7929..5f10c7fa4c 100644
--- a/sysdeps/unix/sysv/linux/sys/timex.h
+++ b/sysdeps/unix/sysv/linux/sys/timex.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997, 1999, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1997, 1999, 2007, 2009 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
@@ -22,7 +22,7 @@
#include <features.h>
#include <sys/time.h>
-/* These definitions from linux/timex.h as of 2.2.0. */
+/* These definitions from linux/timex.h as of 2.6.30. */
struct ntptimeval
{
@@ -54,10 +54,12 @@ struct timex
long int errcnt; /* calibration errors (ro) */
long int stbcnt; /* stability limit exceeded (ro) */
+ int tai; /* TAI offset (ro) */
+
/* ??? */
int :32; int :32; int :32; int :32;
int :32; int :32; int :32; int :32;
- int :32; int :32; int :32; int :32;
+ int :32; int :32; int :32;
};
/* Mode codes (timex.mode) */
@@ -67,6 +69,9 @@ struct timex
#define ADJ_ESTERROR 0x0008 /* estimated time error */
#define ADJ_STATUS 0x0010 /* clock status */
#define ADJ_TIMECONST 0x0020 /* pll time constant */
+#define ADJ_TAI 0x0080 /* set TAI offset */
+#define ADJ_MICRO 0x1000 /* select microsecond resolution */
+#define ADJ_NANO 0x2000 /* select nanosecond resolution */
#define ADJ_TICK 0x4000 /* tick value */
#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */
#define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */
@@ -99,6 +104,9 @@ struct timex
#define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */
#define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */
+#define STA_NANO 0x2000 /* resolution (0 = us, 1 = ns) (ro) */
+#define STA_MODE 0x4000 /* mode (0 = PLL, 1 = FLL) (ro) */
+#define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */
#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \
STA_PPSERROR | STA_CLOCKERR) /* read-only bits */