]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - io/openat.c
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / io / openat.c
index efcbaa90c9504b01f38c8398ceafed991373969b..e54eb9bcad5410feff75866a57d92a55dd60eb22 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2015 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
@@ -22,6 +22,7 @@
 #include <stdio.h>
 #include <sys/stat.h>
 #include <kernel-features.h>
+#include <libc-internal.h>
 
 /* Some mostly-generic code (e.g. sysdeps/posix/getcwd.c) uses this variable
    if __ASSUME_ATFCTS is not defined.  */
@@ -33,10 +34,7 @@ int __have_atfcts;
    the directory associated with FD.  If OFLAG includes O_CREAT, a
    third argument is the file protection.  */
 int
-__openat (fd, file, oflag)
-     int fd;
-     const char *file;
-     int oflag;
+__openat (int fd, const char *file, int oflag, ...)
 {
   int mode;
 
@@ -66,6 +64,8 @@ __openat (fd, file, oflag)
       va_start (arg, oflag);
       mode = va_arg (arg, int);
       va_end (arg);
+
+      ignore_value (mode);
     }
 
   __set_errno (ENOSYS);
@@ -75,16 +75,6 @@ libc_hidden_def (__openat)
 weak_alias (__openat, openat)
 stub_warning (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);
-}
+/* __openat_2 is a generic wrapper that calls __openat.
+   So give a stub warning for that symbol too.  */
 stub_warning (__openat_2)