bug-gnulib
[Top][All Lists]
Advanced

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

new module 'creat'


From: Bruno Haible
Subject: new module 'creat'
Date: Sun, 15 Sep 2019 17:49:48 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-159-generic; KDE/5.18.0; x86_64; ; )

The creat() function not only has some of the bugs that open() has
(w.r.t. file names that end in a slash). It also crashes when passed
a mode with executable bits, e.g.
   creat ("file", 0700);
on MSVC 14.

I'm therefore adding a new module that works around both issues.
Tested on AIX 7.1, HP-UX 11.31, Solaris 9.


2019-09-15  Bruno Haible  <address@hidden>

        open tests: Enhance test.
        * tests/test-open.h (test_open): Test the creation of an executable
        regular file. Also improve initial cleanup.

        creat: New module.
        * lib/fcntl.in.h (creat): New declaration.
        * lib/creat.c: New file, based on lib/open.c.
        * m4/creat.m4: New file.
        * m4/open-slash.m4: New file, extracted from m4/open.m4.
        * m4/open.m4 (gl_FUNC_OPEN): Move trailing-slash test to open-slash.m4.
        Invoke gl_OPEN_TRAILING_SLASH_BUG.
        * modules/open (Files): Add m4/open-slash.m4.
        * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Initialize GNULIB_CREAT,
        REPLACE_CREAT.
        * modules/fcntl-h (Makefile.am): Substitute GNULIB_CREAT, REPLACE_CREAT.
        * modules/creat: New file.
        * tests/test-fcntl-h-c++.cc (creat): Check signature.
        * doc/posix-functions/creat.texi: Mention the new module.

        creat: Add tests.
        * tests/test-creat.c: New file, based on tests/test-open.h.
        * modules/creat-tests: New file.

Attachment: 0001-open-tests-Enhance-test.patch
Description: Text Data

Attachment: 0002-creat-New-module.patch
Description: Text Data

Attachment: 0003-creat-Add-tests.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]