summaryrefslogtreecommitdiff
path: root/libc/sysdeps/unix
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2010-08-19 20:32:31 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2010-08-19 20:32:31 +0000
commit096e9b4c79c701a316691af323848344be3e9800 (patch)
treebf1952d85658602b6ecdd6c24419192d6e9696d5 /libc/sysdeps/unix
parentd630be5a2a0c9627406472140d9aa289dd8c0027 (diff)
downloadeglibc2-096e9b4c79c701a316691af323848344be3e9800.tar.gz
Merge changes between r11185 and r11304 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@11305 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/sysdeps/unix')
-rw-r--r--libc/sysdeps/unix/sysv/linux/Makefile4
-rw-r--r--libc/sysdeps/unix/sysv/linux/Versions5
-rw-r--r--libc/sysdeps/unix/sysv/linux/bits/resource.h30
-rw-r--r--libc/sysdeps/unix/sysv/linux/bits/statfs.h9
-rw-r--r--libc/sysdeps/unix/sysv/linux/bits/termios.h6
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/syscalls.list4
-rw-r--r--libc/sysdeps/unix/sysv/linux/internal_statvfs.c22
-rw-r--r--libc/sysdeps/unix/sysv/linux/kernel-features.h5
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/bits/termios.h5
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list2
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S7
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S73
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S1
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S39
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S2
-rw-r--r--libc/sysdeps/unix/sysv/linux/prlimit.c92
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/bits/statfs.h9
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/syscalls.list2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/bits/termios.h8
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sys/fanotify.h39
-rw-r--r--libc/sysdeps/unix/sysv/linux/sys/inotify.h4
-rw-r--r--libc/sysdeps/unix/sysv/linux/syscalls.list2
-rw-r--r--libc/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list3
25 files changed, 301 insertions, 76 deletions
diff --git a/libc/sysdeps/unix/sysv/linux/Makefile b/libc/sysdeps/unix/sysv/linux/Makefile
index f7f769422..ba572350a 100644
--- a/libc/sysdeps/unix/sysv/linux/Makefile
+++ b/libc/sysdeps/unix/sysv/linux/Makefile
@@ -18,7 +18,7 @@ endif
ifeq ($(subdir),misc)
sysdep_routines += sysctl clone llseek umount umount2 readahead \
setfsuid setfsgid makedev epoll_pwait signalfd \
- eventfd eventfd_read eventfd_write
+ eventfd eventfd_read eventfd_write prlimit
CFLAGS-gethostid.c = -fexceptions
@@ -31,7 +31,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
scsi/sg.h scsi/scsi.h scsi/scsi_ioctl.h sys/pci.h \
sys/ultrasound.h sys/raw.h sys/personality.h sys/epoll.h \
bits/a.out.h sys/inotify.h sys/signalfd.h sys/eventfd.h \
- sys/timerfd.h
+ sys/timerfd.h sys/fanotify.h
install-headers-nosubdir: $(inst_includedir)/bits/syscall.h
diff --git a/libc/sysdeps/unix/sysv/linux/Versions b/libc/sysdeps/unix/sysv/linux/Versions
index f09ef6d98..c66e04fee 100644
--- a/libc/sysdeps/unix/sysv/linux/Versions
+++ b/libc/sysdeps/unix/sysv/linux/Versions
@@ -149,6 +149,11 @@ libc {
recvmmsg;
}
+ GLIBC_2.13 {
+ prlimit; prlimit64;
+
+ fanotify_init; fanotify_mark;
+ }
GLIBC_PRIVATE {
# functions used in other libraries
__syscall_rt_sigqueueinfo;
diff --git a/libc/sysdeps/unix/sysv/linux/bits/resource.h b/libc/sysdeps/unix/sysv/linux/bits/resource.h
index cb3acf162..ca2c9f016 100644
--- a/libc/sysdeps/unix/sysv/linux/bits/resource.h
+++ b/libc/sysdeps/unix/sysv/linux/bits/resource.h
@@ -1,5 +1,5 @@
/* Bit values & structures for resource limits. Linux version.
- Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005, 2008, 2009
+ Copyright (C) 1994, 1996-2000, 2004, 2005, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -232,3 +232,31 @@ enum __priority_which
PRIO_USER = 2 /* WHO is a user ID. */
#define PRIO_USER PRIO_USER
};
+
+
+__BEGIN_DECLS
+
+#ifdef __USE_GNU
+/* Modify and return resource limits of a process atomically. */
+# ifndef __USE_FILE_OFFSET64
+extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource,
+ __const struct rlimit *__new_limit,
+ struct rlimit *__old_limit) __THROW;
+# else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (prlimit, (__pid_t __pid,
+ enum __rlimit_resource __resource,
+ __const struct rlimit *__new_limit,
+ struct rlimit *__old_limit), prlimit64);
+# else
+# define prlimit prlimit64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource,
+ __const struct rlimit64 *__new_limit,
+ struct rlimit64 *__old_limit) __THROW;
+# endif
+#endif
+
+__END_DECLS
diff --git a/libc/sysdeps/unix/sysv/linux/bits/statfs.h b/libc/sysdeps/unix/sysv/linux/bits/statfs.h
index 0e27865e8..7bd90d035 100644
--- a/libc/sysdeps/unix/sysv/linux/bits/statfs.h
+++ b/libc/sysdeps/unix/sysv/linux/bits/statfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1998,2000,2002,2003,2010 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
@@ -42,7 +42,8 @@ struct statfs
__fsid_t f_fsid;
__SWORD_TYPE f_namelen;
__SWORD_TYPE f_frsize;
- __SWORD_TYPE f_spare[5];
+ __SWORD_TYPE f_flags;
+ __SWORD_TYPE f_spare[4];
};
#ifdef __USE_LARGEFILE64
@@ -58,10 +59,12 @@ struct statfs64
__fsid_t f_fsid;
__SWORD_TYPE f_namelen;
__SWORD_TYPE f_frsize;
- __SWORD_TYPE f_spare[5];
+ __SWORD_TYPE f_flags;
+ __SWORD_TYPE f_spare[4];
};
#endif
/* Tell code we have these members. */
#define _STATFS_F_NAMELEN
#define _STATFS_F_FRSIZE
+#define _STATFS_F_FLAGS
diff --git a/libc/sysdeps/unix/sysv/linux/bits/termios.h b/libc/sysdeps/unix/sysv/linux/bits/termios.h
index c71e4ad1f..d7b4ce025 100644
--- a/libc/sysdeps/unix/sysv/linux/bits/termios.h
+++ b/libc/sysdeps/unix/sysv/linux/bits/termios.h
@@ -1,6 +1,5 @@
/* termios type and macro definitions. Linux version.
- Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 2005
- Free Software Foundation, Inc.
+ Copyright (C) 1993-1999, 2003, 2005, 2010 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
@@ -196,6 +195,9 @@ struct termios
# define PENDIN 0040000
#endif
#define IEXTEN 0100000
+#ifdef __USE_BSD
+# define EXTPROC 0200000
+#endif
/* tcflow() and TCXONC use these */
#define TCOOFF 0
diff --git a/libc/sysdeps/unix/sysv/linux/i386/syscalls.list b/libc/sysdeps/unix/sysv/linux/i386/syscalls.list
index 3ff3a73aa..149d43234 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/syscalls.list
+++ b/libc/sysdeps/unix/sysv/linux/i386/syscalls.list
@@ -6,3 +6,7 @@ vm86 - vm86 i:ip __vm86 vm86@@GLIBC_2.3.4
oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0
oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0
waitpid - waitpid Ci:ipi __waitpid waitpid __libc_waitpid
+
+prlimit64 EXTRA prlimit64 i:iipp prlimit64
+
+fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark
diff --git a/libc/sysdeps/unix/sysv/linux/internal_statvfs.c b/libc/sysdeps/unix/sysv/linux/internal_statvfs.c
index 59b173ed7..0169ae341 100644
--- a/libc/sysdeps/unix/sysv/linux/internal_statvfs.c
+++ b/libc/sysdeps/unix/sysv/linux/internal_statvfs.c
@@ -29,6 +29,11 @@
#include <sys/statfs.h>
#include <sys/statvfs.h>
#include "linux_fsinfo.h"
+#include "kernel-features.h"
+
+
+/* Special internal-only bit value. */
+#define ST_VALID 0x0020
#ifndef STATFS
@@ -37,6 +42,7 @@
# define INTERNAL_STATVFS __internal_statvfs
+# ifndef __ASSUME_STATFS_F_FLAGS
int
__statvfs_getflags (const char *name, int fstype, struct stat64 *st)
{
@@ -200,6 +206,7 @@ __statvfs_getflags (const char *name, int fstype, struct stat64 *st)
return result;
}
+# endif
#else
extern int __statvfs_getflags (const char *name, int fstype,
struct stat64 *st);
@@ -240,9 +247,14 @@ INTERNAL_STATVFS (const char *name, struct STATVFS *buf,
/* XXX I have no idea how to compute f_favail. Any idea??? */
buf->f_favail = buf->f_ffree;
- /* Determining the flags is tricky. We have to read /proc/mounts or
- the /etc/mtab file and search for the entry which matches the given
- file. The way we can test for matching filesystem is using the
- device number. */
- buf->f_flag = __statvfs_getflags (name, fsbuf->f_type, st);
+#ifndef __ASSUME_STATFS_F_FLAGS
+ if ((fsbuf->f_flags & ST_VALID) == 0)
+ /* Determining the flags is tricky. We have to read /proc/mounts or
+ the /etc/mtab file and search for the entry which matches the given
+ file. The way we can test for matching filesystem is using the
+ device number. */
+ buf->f_flag = __statvfs_getflags (name, fsbuf->f_type, st);
+ else
+#endif
+ buf->f_flag = fsbuf->f_flags ^ ST_VALID;
}
diff --git a/libc/sysdeps/unix/sysv/linux/kernel-features.h b/libc/sysdeps/unix/sysv/linux/kernel-features.h
index b3f245615..838b310fc 100644
--- a/libc/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/libc/sysdeps/unix/sysv/linux/kernel-features.h
@@ -530,3 +530,8 @@
#if __LINUX_KERNEL_VERSION >= 0x020621
# define __ASSUME_RECVMMSG 1
#endif
+
+/* statfs fills in f_flags since 2.6.36. */
+#if __LINUX_KERNEL_VERSION >= 0x020624
+# define __ASSUME_STATFS_F_FLAGS 1
+#endif
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/bits/termios.h b/libc/sysdeps/unix/sysv/linux/powerpc/bits/termios.h
index 7aac02dc5..26bbe77e6 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/bits/termios.h
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/bits/termios.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1999,2001,2003,2004,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1999,2001,2003-2005,2010 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
@@ -203,6 +203,9 @@ struct termios {
# define PENDIN 0x20000000
#endif
#define IEXTEN 0x00000400
+#ifdef __USE_BSD
+# define EXTPROC 0x10000000
+#endif
/* Values for the ACTION argument to `tcflow'. */
#define TCOOFF 0
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list
index 1233be671..30122853a 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list
@@ -6,3 +6,5 @@ oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0
# Due to 64bit alignment there is a dummy second parameter
readahead - readahead i:iiiii __readahead readahead
+
+prlimit64 EXTRA prlimit64 i:iipp prlimit64
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
index f2ac00d4c..ef574c14f 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
@@ -32,19 +32,16 @@ ENTRY (BP_SYM (__brk))
CALL_MCOUNT 1
DISCARD_BOUNDS (r3) /* the bounds are meaningless, so toss 'em. */
- stdu r1,-64(r1)
- cfi_adjust_cfa_offset (64)
std r3,48(r1)
DO_CALL(SYS_ify(brk))
- ld r6,48(r1)
+ ld r6,48(r1)
ld r5,.LC__curbrk@toc(r2)
std r3,0(r5)
cmpld r6,r3
- addi r1,r1,64
li r3,0
blelr+
li r3,ENOMEM
- b JUMPTARGET(__syscall_error)
+ TAIL_CALL_SYSCALL_ERROR
END (BP_SYM (__brk))
weak_alias (BP_SYM (__brk), BP_SYM (brk))
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
index f1a55e64d..d14da54fd 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
@@ -46,35 +46,32 @@ ENTRY (BP_SYM (__clone))
cror cr0*4+eq,cr1*4+eq,cr0*4+eq
beq- cr0,L(badargs)
- /* Set up stack frame for parent. */
- stdu r1,-80(r1)
- cfi_adjust_cfa_offset (80)
- std r29,56(r1)
- std r30,64(r1)
- std r31,72(r1)
- cfi_offset(r29,-56)
- cfi_offset(r30,-64)
- cfi_offset(r31,-72)
+ /* Save some regs in parm save area. */
#ifdef RESET_PID
- std r28,48(r1)
- cfi_offset(r28,-48)
+ std r29,48(r1)
#endif
+ std r30,56(r1)
+ std r31,64(r1)
+#ifdef RESET_PID
+ cfi_offset(r29,48)
+#endif
+ cfi_offset(r30,56)
+ cfi_offset(r31,64)
/* Set up stack frame for child. */
clrrdi r4,r4,4
li r0,0
- stdu r0,-48(r4) /* min stack frame is 48 bytes per ABI */
+ stdu r0,-112(r4) /* min stack frame is 112 bytes per ABI */
/* Save fn, args, stack across syscall. */
- mr r29,r3 /* Function in r29. */
- mr r30,r4 /* Stack pointer in r30. */
+ mr r30,r3 /* Function in r30. */
#ifdef RESET_PID
- mr r28,r5 /* Flags in r28. */
+ mr r29,r5 /* Flags in r29. */
#endif
mr r31,r6 /* Argument in r31. */
- /* 'flags' argument is first parameter to clone syscall. (The other
- argument is the stack pointer, already in r4.) */
+ /* 'flags' argument is first parameter to clone syscall.
+ Second is the stack pointer, already in r4. */
mr r3,r5
/* Move the parent_tid, child_tid and tls arguments. */
mr r5,r7
@@ -94,9 +91,9 @@ ENTRY (BP_SYM (__clone))
bne- cr1,L(parent) /* The '-' is to minimise the race. */
#ifdef RESET_PID
- andis. r0,r28,CLONE_THREAD>>16
+ andis. r0,r29,CLONE_THREAD>>16
bne+ cr0,L(oldpid)
- andi. r0,r28,CLONE_VM
+ andi. r0,r29,CLONE_VM
li r3,-1
bne- cr0,L(nomoregetpid)
DO_CALL(SYS_ify(getpid))
@@ -108,8 +105,8 @@ L(oldpid):
std r2,40(r1)
/* Call procedure. */
- ld r0,0(r29)
- ld r2,8(r29)
+ ld r0,0(r30)
+ ld r2,8(r30)
mtctr r0
mr r3,r31
bctrl
@@ -119,25 +116,35 @@ L(oldpid):
b JUMPTARGET(__GI__exit)
#else
b JUMPTARGET(_exit)
+ /* We won't ever get here but provide a nop so that the linker
+ will insert a toc adjusting stub if necessary. */
+ nop
#endif
+L(badargs):
+ cfi_startproc
+ li r3,EINVAL
+ TAIL_CALL_SYSCALL_ERROR
+
L(parent):
/* Parent. Restore registers & return. */
#ifdef RESET_PID
- ld r28,48(r1)
+ cfi_offset(r29,48)
#endif
- ld r31,72(r1)
- ld r30,64(r1)
- ld r29,56(r1)
- addi r1,r1,80
- bnslr+
- b JUMPTARGET(__syscall_error)
-
-L(badargs):
- li r3,EINVAL
- b JUMPTARGET(__syscall_error)
+ cfi_offset(r30,56)
+ cfi_offset(r31,64)
+#ifdef RESET_PID
+ ld r29,48(r1)
+#endif
+ ld r30,56(r1)
+ ld r31,64(r1)
+#ifdef RESET_PID
+ cfi_restore(r29)
+#endif
+ cfi_restore(r30)
+ cfi_restore(r31)
+ PSEUDO_RET
- cfi_startproc
END (BP_SYM (__clone))
weak_alias (BP_SYM (__clone), BP_SYM (clone))
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
index 4a82802d9..18baa39d6 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
@@ -154,6 +154,7 @@ L(BADSTATUS):
b JUMPTARGET(__GI_exit);
#else
b JUMPTARGET(exit);
+ nop
#endif
/* The address of the exit code is in the link register. Store the lr
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S
index 15d8e84c1..a0ae11594 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S
@@ -39,8 +39,6 @@
#define NARGS 3
#endif
-#define stackblock 80 /* offset to socket parm area. */
-
#ifndef __socket
# ifndef NO_WEAK_ALIAS
# define __socket P(__,socket)
@@ -49,11 +47,14 @@
# endif
#endif
+#define FRAMESIZE 128
+#define stackblock FRAMESIZE+48 /* offset to parm save area. */
+
.text
ENTRY(__socket)
CALL_MCOUNT NARGS
- stdu r1,-144(r1)
- cfi_adjust_cfa_offset(144)
+ stdu r1,-FRAMESIZE(r1)
+ cfi_adjust_cfa_offset(FRAMESIZE)
#if NARGS >= 1
std r3,stackblock(r1)
#endif
@@ -87,33 +88,39 @@ ENTRY(__socket)
bne- .Lsocket_cancel
#endif
- li r3,P(SOCKOP_,socket)
+ li r3,P(SOCKOP_,socket)
addi r4,r1,stackblock
DO_CALL(SYS_ify(socketcall))
- addi r1,r1,144
+ addi r1,r1,FRAMESIZE
+ cfi_adjust_cfa_offset(-FRAMESIZE)
PSEUDO_RET
#if defined NEED_CANCELLATION && defined CENABLE
.Lsocket_cancel:
+ cfi_adjust_cfa_offset(FRAMESIZE)
mflr r9
- std r9,144+16(r1)
+ std r9,FRAMESIZE+16(r1)
cfi_offset (lr, 16)
CENABLE
- std r3,72(r1)
- li r3,P(SOCKOP_,socket)
+ std r3,120(r1)
+ li r3,P(SOCKOP_,socket)
addi r4,r1,stackblock
DO_CALL(SYS_ify(socketcall))
mfcr r0
- std r3,64(r1)
- std r0,8(r1)
- ld r3,72(r1)
+ std r3,112(r1)
+ std r0,FRAMESIZE+8(r1)
+ cfi_offset (cr, 8)
+ ld r3,120(r1)
CDISABLE
- ld r4,144+16(r1)
- ld r0,8(r1)
- ld r3,64(r1)
+ ld r4,FRAMESIZE+16(r1)
+ ld r0,FRAMESIZE+8(r1)
+ ld r3,112(r1)
mtlr r4
mtcr r0
- addi r1,r1,144
+ addi r1,r1,FRAMESIZE
+ cfi_adjust_cfa_offset(-FRAMESIZE)
+ cfi_restore(lr)
+ cfi_restore(cr)
PSEUDO_RET
#endif
PSEUDO_END (__socket)
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S
index 2f5df38cf..14d0c2bf1 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S
@@ -39,7 +39,7 @@ ENTRY (__vfork)
bnslr+
/* Check if vfork syscall is known at all. */
cmpdi r3,ENOSYS
- bne JUMPTARGET(__syscall_error)
+ bne .Local_syscall_error
# endif
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/prlimit.c b/libc/sysdeps/unix/sysv/linux/prlimit.c
new file mode 100644
index 000000000..5f7a19725
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/prlimit.c
@@ -0,0 +1,92 @@
+/* Copyright (C) 2010 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 <sys/resource.h>
+#include <sys/syscall.h>
+
+
+#ifdef __NR_prlimit64
+int
+prlimit (__pid_t pid, enum __rlimit_resource resource,
+ __const struct rlimit *new_rlimit, struct rlimit *old_rlimit)
+{
+ struct rlimit64 new_rlimit64_mem;
+ struct rlimit64 *new_rlimit64 = NULL;
+ struct rlimit64 old_rlimit64_mem;
+ struct rlimit64 *old_rlimit64 = (old_rlimit != NULL
+ ? &old_rlimit64_mem : NULL);
+
+ if (new_rlimit != NULL)
+ {
+ if (new_rlimit->rlim_cur == RLIM_INFINITY)
+ new_rlimit64_mem.rlim_cur = RLIM64_INFINITY;
+ else
+ new_rlimit64_mem.rlim_cur = new_rlimit->rlim_cur;
+ if (new_rlimit->rlim_max == RLIM_INFINITY)
+ new_rlimit64_mem.rlim_max = RLIM64_INFINITY;
+ else
+ new_rlimit64_mem.rlim_max = new_rlimit->rlim_max;
+ new_rlimit64 = &new_rlimit64_mem;
+ }
+
+ int res = INLINE_SYSCALL (prlimit64, 4, pid, resource, new_rlimit64,
+ old_rlimit64);
+
+ if (res == 0 && old_rlimit != NULL)
+ {
+ /* The prlimit64 syscall is ill-designed for 32-bit machines.
+ We have to provide a 32-bit variant since otherwise the LFS
+ system would not work. But what shall we do if the syscall
+ succeeds but the old values do not fit into a rlimit
+ structure? We cannot return an error because the operation
+ itself worked. Best is perhaps to return RLIM_INFINITY. */
+ old_rlimit->rlim_cur = old_rlimit64_mem.rlim_cur;
+ if (old_rlimit->rlim_cur != old_rlimit64_mem.rlim_cur)
+ {
+ if (new_rlimit == NULL)
+ {
+ __set_errno (EOVERFLOW);
+ return -1;
+ }
+ old_rlimit->rlim_cur = RLIM_INFINITY;
+ }
+ old_rlimit->rlim_max = old_rlimit64_mem.rlim_max;
+ if (old_rlimit->rlim_max != old_rlimit64_mem.rlim_max)
+ {
+ if (new_rlimit == NULL)
+ {
+ __set_errno (EOVERFLOW);
+ return -1;
+ }
+ old_rlimit->rlim_max = RLIM_INFINITY;
+ }
+ }
+
+ return res;
+}
+#else
+int
+prlimit (__pid_t pid, enum __rlimit_resource resource,
+ __const struct rlimit *new_rlimit, struct rlimit *old_rlimit)
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+stub_warning (prlimit)
+#endif
diff --git a/libc/sysdeps/unix/sysv/linux/s390/bits/statfs.h b/libc/sysdeps/unix/sysv/linux/s390/bits/statfs.h
index d838e6bf4..956150b1f 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/bits/statfs.h
+++ b/libc/sysdeps/unix/sysv/linux/s390/bits/statfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000, 2003, 2010 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
@@ -42,7 +42,8 @@ struct statfs
__fsid_t f_fsid;
int f_namelen;
int f_frsize;
- int f_spare[5];
+ int f_flags;
+ int f_spare[4];
};
#ifdef __USE_LARGEFILE64
@@ -58,10 +59,12 @@ struct statfs64
__fsid_t f_fsid;
int f_namelen;
int f_frsize;
- int f_spare[5];
+ int f_flags;
+ int f_spare[4];
};
#endif
/* Tell code we have this member. */
#define _STATFS_F_NAMELEN
#define _STATFS_F_FRSIZE
+#define _STATFS_F_FLAGS
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list b/libc/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list
index 0e7685730..d3a05d2d2 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list
@@ -3,3 +3,5 @@
oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0
oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0
vfork - vfork 0 __vfork vfork
+
+prlimit64 EXTRA prlimit64 i:iipp prlimit64
diff --git a/libc/sysdeps/unix/sysv/linux/sh/syscalls.list b/libc/sysdeps/unix/sysv/linux/sh/syscalls.list
index a6665936e..be9ffed22 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/syscalls.list
+++ b/libc/sysdeps/unix/sysv/linux/sh/syscalls.list
@@ -1,3 +1,5 @@
# File name Caller Syscall name # args Strong name Weak names
waitpid - waitpid Ci:ipi __waitpid waitpid __libc_waitpid
+
+prlimit64 EXTRA prlimit64 i:iipp prlimit64
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/bits/termios.h b/libc/sysdeps/unix/sysv/linux/sparc/bits/termios.h
index cea13227f..8ad575121 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/bits/termios.h
+++ b/libc/sysdeps/unix/sysv/linux/sparc/bits/termios.h
@@ -1,6 +1,5 @@
/* termios type and macro definitions. Linux/SPARC version.
- Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2005
- Free Software Foundation, Inc.
+ Copyright (C) 1993-1997, 2000, 2005, 2010 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
@@ -193,11 +192,14 @@ struct termios
# define ECHOCTL 0x00000200
# define ECHOPRT 0x00000400
# define ECHOKE 0x00000800
-# define DEFECHO 0x00001000 /* SUNOS thing, what is it? */
+# define DEFECHO 0x00001000 /* SUNOS thing, what is it? */
# define FLUSHO 0x00002000
# define PENDIN 0x00004000
#endif
#define IEXTEN 0x00008000
+#ifdef __USE_BSD
+# define EXTPROC 0x00010000
+#endif
/* modem lines */
#define TIOCM_LE 0x001
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list
index 2bfe376a3..8b1d6829b 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list
@@ -4,3 +4,5 @@ setrlimit - setrlimit 2 __setrlimit setrlimit
getrlimit - getrlimit 2 __getrlimit getrlimit
getresuid - getresuid32 3 getresuid
getresgid - getresgid32 3 getresgid
+
+prlimit64 EXTRA prlimit64 i:iipp prlimit64
diff --git a/libc/sysdeps/unix/sysv/linux/sys/fanotify.h b/libc/sysdeps/unix/sysv/linux/sys/fanotify.h
new file mode 100644
index 000000000..bf8500caf
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/sys/fanotify.h
@@ -0,0 +1,39 @@
+/* Copyright (C) 2010 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. */
+
+#ifndef _SYS_FANOTIFY_H
+#define _SYS_FANOTIFY_H 1
+
+#include <stdint.h>
+#include <linux/fanotify.h>
+
+
+__BEGIN_DECLS
+
+/* Create and initialize fanotify group. */
+extern int fanotify_init (unsigned int __flags, unsigned int __event_f_flags)
+ __THROW;
+
+/* Add, remove, or modify an fanotify mark on a filesystem object. */
+extern int fanotify_mark (int __fanotify_fd, unsigned int __flags,
+ uint64_t __mask, int __dfd, const char *__pathname)
+ __THROW;
+
+__END_DECLS
+
+#endif /* sys/fanotify.h */
diff --git a/libc/sysdeps/unix/sysv/linux/sys/inotify.h b/libc/sysdeps/unix/sysv/linux/sys/inotify.h
index 8b3a85280..aee999afa 100644
--- a/libc/sysdeps/unix/sysv/linux/sys/inotify.h
+++ b/libc/sysdeps/unix/sysv/linux/sys/inotify.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2008, 2009, 2010 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
@@ -72,6 +72,8 @@ struct inotify_event
#define IN_ONLYDIR 0x01000000 /* Only watch the path if it is a
directory. */
#define IN_DONT_FOLLOW 0x02000000 /* Do not follow a sym link. */
+#define IN_EXCL_UNLINK 0x04000000 /* Exclude events on unlinked
+ objects. */
#define IN_MASK_ADD 0x20000000 /* Add to the mask of an already
existing watch. */
#define IN_ISDIR 0x40000000 /* Event occurred against dir. */
diff --git a/libc/sysdeps/unix/sysv/linux/syscalls.list b/libc/sysdeps/unix/sysv/linux/syscalls.list
index a87906a4e..0f3345490 100644
--- a/libc/sysdeps/unix/sysv/linux/syscalls.list
+++ b/libc/sysdeps/unix/sysv/linux/syscalls.list
@@ -101,3 +101,5 @@ mq_setattr - mq_getsetattr i:ipp __GI_mq_setattr mq_setattr
timerfd_create EXTRA timerfd_create i:ii timerfd_create
timerfd_settime EXTRA timerfd_settime i:iipp timerfd_settime
timerfd_gettime EXTRA timerfd_gettime i:ip timerfd_gettime
+
+fanotify_init EXTRA fanotify_init i:ii fanotify_init
diff --git a/libc/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list b/libc/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
index 60915507b..fda3db1de 100644
--- a/libc/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
+++ b/libc/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
@@ -17,3 +17,6 @@ sendfile - sendfile i:iipi sendfile sendfile64
sync_file_range - sync_file_range i:iiii sync_file_range
creat - creat Ci:si __libc_creat creat creat64
open - open Ci:siv __libc_open __open open __open64 open64
+prlimit EXTRA prlimit64 i:iipp prlimit prlimit64
+
+fanotify_mark EXTRA fanotify_mark i:iiiis fanotify_mark