]> sourceware.org Git - glibc.git/commitdiff
Make MIPS fallocate, fallocate64 and sync_file_range cancellation points.
authorJoseph Myers <joseph@codesourcery.com>
Fri, 1 Apr 2011 16:11:19 +0000 (16:11 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 1 Apr 2011 16:11:19 +0000 (16:11 +0000)
ChangeLog.mips
sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c
sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c
sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list

index c811fd73e24e1b1716d6490ac47929f5c92ff4d7..04cab0c6765c4bd08177c66da7afac6abac25f6a 100644 (file)
@@ -1,3 +1,14 @@
+2011-04-01  Joseph Myers  <joseph@codesourcery.com>
+
+       * sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c: Make
+       cancelable.
+       * sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c: Likewise.
+       * sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c: Likewise.
+       * sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list: Mark
+       sync_file_range as cancellation point.
+       * sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list: Mark
+       sync_file_range as cancellation point.
+
 2011-04-01  Joseph Myers  <joseph@codesourcery.com>
 
        * sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list: Add
index 13a21b0dacbd47f58493c0c593e94b89d2e9b5eb..21da50e3e62a1871d31afde3889a0e97f4511846 100644 (file)
@@ -1,5 +1,5 @@
 /* Selective file content synch'ing.
-   Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2007, 2011 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
@@ -21,7 +21,7 @@
 #include <fcntl.h>
 #include <sys/types.h>
 
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 #include <sys/syscall.h>
 
 
 int
 sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
 {
-  return INLINE_SYSCALL (sync_file_range, 7, fd, 0,
-                        __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
-                        __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
-                        flags);
+  if (SINGLE_THREAD_P)
+    return INLINE_SYSCALL (sync_file_range, 7, fd, 0,
+                          __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
+                          __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
+                          flags);
+
+  int result;
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  result = INLINE_SYSCALL (sync_file_range, 7, fd, 0,
+                          __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
+                          __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
+                          flags);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
 }
 #else
 int
index f973250deda24387b13b63b453c9a6840ba3ae0c..0aecba10e85b240b49429ed6c0a9403aeafccace 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2009, 2011 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
@@ -18,7 +18,7 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 
 
 /* Reserve storage for the data of the file associated with FD.  */
@@ -26,7 +26,17 @@ int
 fallocate (int fd, int mode, __off_t offset, __off_t len)
 {
 #ifdef __NR_fallocate
-  return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
+  if (SINGLE_THREAD_P)
+    return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
+
+  int result;
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  result = INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
 #else
   __set_errno (ENOSYS);
   return -1;
index 1f37f9121ab520c2a94469bbbff0328ebb3ebbd0..670cb0e32c829e07925321b9c16d797d3cc7ec66 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2009, 2011 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
@@ -18,7 +18,7 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 
 
 /* Reserve storage for the data of the file associated with FD.  */
@@ -26,7 +26,17 @@ int
 fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
 {
 #ifdef __NR_fallocate
-  return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
+  if (SINGLE_THREAD_P)
+    return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
+
+  int result;
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  result = INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
 #else
   __set_errno (ENOSYS);
   return -1;
index 87c19499012e037ac3d960e6f43dd7754f920837..0d37a9b48d08c7fa483be2a9bd7bf694f85bb801 100644 (file)
@@ -1,7 +1,7 @@
 # File name    Caller  Syscall name    # args  Strong name     Weak names
 
 readahead      -       readahead       i:iii   __readahead     readahead
-sync_file_range        -       sync_file_range i:iiii  sync_file_range
+sync_file_range        -       sync_file_range Ci:iiii sync_file_range
 ftruncate      -       ftruncate       i:ii    __ftruncate     ftruncate ftruncate64 __ftruncate64
 truncate       -       truncate        i:si    truncate        truncate64
 
index 2404709eece9cc6dfef7c0cc1cfdea10de5f5cb6..8d70e457f12cbe7f59c309554ee196f193e8991c 100644 (file)
@@ -1,6 +1,6 @@
 # File name    Caller  Syscall name    # args  Strong name     Weak names
 
-sync_file_range        -       sync_file_range i:iiii  sync_file_range
+sync_file_range        -       sync_file_range Ci:iiii sync_file_range
 
 prlimit                EXTRA   prlimit64       i:iipp  prlimit         prlimit64
 
This page took 0.057957 seconds and 5 git commands to generate.