Fixing the spelling of O_CREAT

In which I attempt to correct a mistake made by Ken Thompson, one the of the original designers of Unix:

diff --git a/bits/fcntl.h b/bits/fcntl.h
 index f273f84..43e8e6b 100644
 --- a/bits/fcntl.h
 +++ b/bits/fcntl.h
 @@ -29,6 +29,7 @@

/* Bits OR'd into the second argument to open. */
 #define O_CREAT 0x0200 /* Create file if it doesn't exist. */
 +#define O_CREATE 0x0200 /* Create file if it doesn't exist. */
 #define O_EXCL 0x0800 /* Fail if file already exists. */
 #define O_TRUNC 0x0400 /* Truncate file to zero length. */
 #define O_NOCTTY 0x8000 /* Don't assign a controlling terminal. */

16:08 < wooster> what do you guys think of my patch?
17:26 < azanella_> wooster,
17:26 < wooster> my patch is still POSIX-compliant
17:26 < wooster> i did not rename it
17:27 < azanella_> wooster, so which specification defines O_CREATE?
17:28 < wooster> i am merely acceding to Ken Thompson‘s wishes
17:28 < wooster>
17:28 < wooster> O_CREATE is not defined in a specification, but it is not prohibited either by any specification
17:29 < azanella_> wooster, which is the gain of adding a non standard type on glibc? what happen if a program uses it and try to compile on a system that does not define?
17:29 < wooster> is every single thing in glibc only implemented if it is defined in a standard? everything?
17:30 < azanella_> wooster, no, but the extension either make sense to fix an not specified trait or necessity
17:31 < azanella_> this does not add anything, in fact only add confusion because it is a field to duplicate an already define field
17:31 < wooster> as i said, i am attempting to correct an error that ken thompson regrets making
17:31 < wooster> better late than never
17:31 < wooster> and i am attempting to do it in a backwards-compatible fashion
17:32 < azanella_> to late, this change is useless
17:32 < azanella_> imho
17:32 < wooster> i’
ll take ken thompson‘s judgement over yours
17:32 < wooster> no offense
17:35 < azanella_> sure, fell free to send a patch to libc-alpha
17:35 < wooster> thank you
17:35 < wooster> i shall
17:35 < azanella_> I am just foreseeing the possible answer to your patches
17:36 < azanella_> people try to avoid such useless changes that do not follow any specification
17:36 < wooster> understandibly
17:37 < wooster> however, you must admit that the design of unix was not 100% perfect the first time around, and it is useful to have the ability to correct mistakes, especially those mentioned rather famously by one of the original authors
17:41 < azanella_> wooster, in this specific case this change does not make sense, the compiler will get any typo error, there is no gain in expressiveness and you add a non-specification change, that will require additional prepcoressor defines
17:45 < wooster> i accuse you of standing in the way of progress
17:45 < azanella_> right…
17:45 < wooster> i will post to libc-alpha
17:47 < wooster> in the meantime may i suggest some light reading on the subject:
17:47 < azanella_> alright ….

Unix cannot move forward if everyone is resistant to fixing defects in the original design. This mentality of preserving the original misspellings is as much a blight on the POSIX standard as the spelling of “Referer” in the HTTP header specification. We can do better. Adding a vowel should not be obstructed with charges of “that will require additional prepcoressor defines”.
I noticed in a thread elsewhere on the internet that this mistake was corrected in the Go language Apr 04 23:42:14 2011 with Ken’s blessing.

c.f. The first commit after Go was released publicly, by Ken himself:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s