From 8833066b122427710a9e14a888ce6cfa862332d3 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 31 Jul 2007 17:46:17 +0000 Subject: Updated to fedora-glibc-20070731T1624 --- sysdeps/unix/sysv/linux/openat.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'sysdeps/unix/sysv/linux/openat.c') diff --git a/sysdeps/unix/sysv/linux/openat.c b/sysdeps/unix/sysv/linux/openat.c index df53b6cf2c..45b566f2d0 100644 --- a/sysdeps/unix/sysv/linux/openat.c +++ b/sysdeps/unix/sysv/linux/openat.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2005, 2006, 2007 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 @@ -30,6 +30,7 @@ #ifndef OPENAT # define OPENAT openat +# define __OPENAT_2 __openat_2 # ifndef __ASSUME_ATFCTS /* Set errno after a failed call. If BUF is not null, @@ -173,3 +174,18 @@ __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) +#define MSG(s) MSG2 (s) +#define MSG2(s) "invalid " #s " call: O_CREAT without mode" + __fortify_fail (MSG (OPENAT)); + + return __OPENAT (fd, file, oflag); +} -- cgit v1.2.3