Przeglądaj źródła

creat*.c: add LIBC_CANCEL_HANDLED to know that it is cancellable (handled by open)

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Peter S. Mazinger 14 lat temu
rodzic
commit
f9af28c64e

+ 3 - 0
libc/sysdeps/linux/common/creat.c

@@ -8,8 +8,11 @@
  */
 
 #include <fcntl.h>
+#include <cancel.h>
 
 int creat(const char *file, mode_t mode)
 {
 	return open(file, O_WRONLY | O_CREAT | O_TRUNC, mode);
 }
+/* open handled cancellation, noop on uClibc */
+LIBC_CANCEL_HANDLED();

+ 4 - 1
libc/sysdeps/linux/common/creat64.c

@@ -18,9 +18,12 @@
 
 #include <_lfs_64.h>
 #include <fcntl.h>
+#include <cancel.h>
 
 /* Create FILE with protections MODE.  */
 int creat64(const char *file, mode_t mode)
 {
-	return open64(file, O_WRONLY|O_CREAT|O_TRUNC, mode);
+	return open64(file, O_WRONLY | O_CREAT | O_TRUNC, mode);
 }
+/* open handled cancellation, noop on uClibc */
+LIBC_CANCEL_HANDLED();