[git commit] not-cancel.h: use the non-cancellable functions in libc instead of inlining code

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Fri Jun 15 12:00:42 UTC 2012


commit: http://git.uclibc.org/uClibc/commit/?id=95c40e9fafcba415cf50611f8dc7c425f078f376
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

   text	   data	    bss	    dec	    hex	filename
 272224	   2298	  17576	 292098	  47502	lib/libuClibc-0.9.32-rc3-git.so.old
 271806	   2298	  17576	 291680	  47360	lib/libuClibc-0.9.32-rc3-git.so

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 libc/sysdeps/linux/common/not-cancel.h |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/libc/sysdeps/linux/common/not-cancel.h b/libc/sysdeps/linux/common/not-cancel.h
index 9418417..b3484de 100644
--- a/libc/sysdeps/linux/common/not-cancel.h
+++ b/libc/sysdeps/linux/common/not-cancel.h
@@ -20,6 +20,8 @@
 
 #include <sysdep.h>
 
+#ifdef NOT_IN_libc
+
 /* Uncancelable open.  */
 #define open_not_cancel(name, flags, mode) \
    INLINE_SYSCALL (open, 3, (const char *) (name), (flags), (mode))
@@ -58,3 +60,30 @@
 # define waitpid_not_cancel(pid, stat_loc, options) \
   INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL)
 #endif
+
+#else
+
+#include <cancel.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#define open_not_cancel(name, flags, mode) \
+	__NC(open)(name, flags, mode)
+#define open_not_cancel_2(name, flags) \
+	__NC(open2)(name, flags)
+
+#define close_not_cancel(fd) \
+	__NC(close)(fd)
+#define close_not_cancel_no_status(fd) \
+	__close_nocancel_no_status(fd)
+
+#define read_not_cancel(fd, buf, n) \
+	__NC(read)(fd, buf, n)
+
+#define write_not_cancel(fd, buf, n) \
+	__NC(write)(fd, buf, n)
+
+#define fcntl_not_cancel(fd, cmd, val) \
+	__NC(fcntl)(fd, cmd, val)
+
+#endif


More information about the uClibc-cvs mailing list