about summary refs log tree commit diff
path: root/sysdeps/mach/hurd/openat.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2008-07-07 00:41:05 +0000
committerRoland McGrath <roland@gnu.org>2008-07-07 00:41:05 +0000
commitf20ac01059f1adff71890ca3fc5b9bf62df7e97d (patch)
tree09fa52f8253dcb4d5dc533cb1a0b7367e6a29e4e /sysdeps/mach/hurd/openat.c
parent45ec3e79a8e0df7eb41e6356b20c15b93ea6ad57 (diff)
downloadglibc-f20ac01059f1adff71890ca3fc5b9bf62df7e97d.tar.gz
glibc-f20ac01059f1adff71890ca3fc5b9bf62df7e97d.tar.xz
glibc-f20ac01059f1adff71890ca3fc5b9bf62df7e97d.zip
2008-07-06 Samuel Thibault <samuel.thibault@ens-lyon.org>
	* sysdeps/mach/hurd/open.c: Include <stdio.h>.
	(__open_2): New function.
	(__open64_2): New alias to __open_2.
	* sysdeps/mach/hurd/openat.c: Include <stdio.h>.
	(__openat_2): New function.
	(__openat64_2): New alias to __openat_2.
Diffstat (limited to 'sysdeps/mach/hurd/openat.c')
-rw-r--r--sysdeps/mach/hurd/openat.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sysdeps/mach/hurd/openat.c b/sysdeps/mach/hurd/openat.c
index 1faf857e16..f0a3404cd8 100644
--- a/sysdeps/mach/hurd/openat.c
+++ b/sysdeps/mach/hurd/openat.c
@@ -21,6 +21,7 @@
 #include <fcntl.h>
 #include <stdarg.h>
 #include <stddef.h>
+#include <stdio.h>
 #include <sys/stat.h>
 #include <hurd.h>
 #include <hurd/fd.h>
@@ -56,7 +57,20 @@ __openat (fd, file, oflag)
 libc_hidden_def (__openat)
 weak_alias (__openat, openat)
 
+int
+__openat_2 (fd, file, oflag)
+     int fd;
+     const char *file;
+     int oflag;
+{
+  if (oflag & O_CREAT)
+    __fortify_fail ("invalid openat call: O_CREAT without mode");
+
+  return __openat (fd, file, oflag);
+}
+
 /* openat64 is just the same as openat for us.  */
 weak_alias (__openat, __openat64)
 libc_hidden_weak (__openat64)
 weak_alias (__openat, openat64)
+strong_alias (__openat_2, __openat64_2)