Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/lib/libc/stdio Pull up following revision(s) (requested b...



details:   https://anonhg.NetBSD.org/src/rev/0a6585ac5507
branches:  netbsd-6
changeset: 775542:0a6585ac5507
user:      riz <riz%NetBSD.org@localhost>
date:      Wed Nov 28 23:50:57 2012 +0000

description:
Pull up following revision(s) (requested by christos in ticket #723):
        lib/libc/stdio/flags.c: revision 1.17
        lib/libc/stdio/fopen.3: revision 1.29
Add 'x' to the mode bits to specify O_EXCL, like glibc.

diffstat:

 lib/libc/stdio/flags.c |   8 ++++++--
 lib/libc/stdio/fopen.3 |  10 ++++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diffs (67 lines):

diff -r 250b19e0eb51 -r 0a6585ac5507 lib/libc/stdio/flags.c
--- a/lib/libc/stdio/flags.c    Wed Nov 28 23:47:37 2012 +0000
+++ b/lib/libc/stdio/flags.c    Wed Nov 28 23:50:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: flags.c,v 1.15 2011/06/26 16:42:41 christos Exp $      */
+/*     $NetBSD: flags.c,v 1.15.4.1 2012/11/28 23:50:57 riz Exp $       */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)flags.c    8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: flags.c,v 1.15 2011/06/26 16:42:41 christos Exp $");
+__RCSID("$NetBSD: flags.c,v 1.15.4.1 2012/11/28 23:50:57 riz Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -90,6 +90,7 @@
         * [rwa]\+ or [rwa]b\+ means read and write 
         * f means open only plain files,
         * e means set close on exec.
+        * x means exclusive open.
         */
        for (; *mode; mode++)
                switch (*mode) {
@@ -103,6 +104,9 @@
                case 'e':
                        o |= O_CLOEXEC;
                        break;
+               case 'x':
+                       o |= O_EXCL;
+                       break;
                case 'b':
                        break;
                default:        /* We could produce a warning here */
diff -r 250b19e0eb51 -r 0a6585ac5507 lib/libc/stdio/fopen.3
--- a/lib/libc/stdio/fopen.3    Wed Nov 28 23:47:37 2012 +0000
+++ b/lib/libc/stdio/fopen.3    Wed Nov 28 23:50:57 2012 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: fopen.3,v 1.27 2011/07/18 05:17:16 jruoho Exp $
+.\"    $NetBSD: fopen.3,v 1.27.4.1 2012/11/28 23:50:57 riz Exp $
 .\"
 .\" Copyright (c) 1990, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -33,7 +33,7 @@
 .\"
 .\"     @(#)fopen.3    8.1 (Berkeley) 6/4/93
 .\"
-.Dd July 18, 2011
+.Dd November 14, 2012
 .Dt FOPEN 3
 .Os
 .Sh NAME
@@ -118,6 +118,12 @@
 This is a non
 .St -ansiC
 extension.
+.It Sq x
+The letter
+.Sq x
+in the mode turns on exclusive open mode to the file (
+.Dv O_EXCL )
+which means that the file will not be created if it already exists.
 .El
 .Pp
 Any created files will have mode



Home | Main Index | Thread Index | Old Index