Why create system call is called creat? [closed]

断了今生、忘了曾经 提交于 2019-12-21 07:06:12

问题


Why create system call is called creat?

Also, why a define for a buffer size is called BUFSIZ and not BUFSIZE?

Are there any other such examples?

Related: (taken from comments)
What did Ken Thompson mean when he said, “I'd spell create with an 'e'.”


回答1:


From LSP (page 28):

Yes, this function’s name is missing an e. Ken Thompson, the creator of Unix, once joked that the missing letter was his largest regret in the design of Unix.




回答2:


Back in the time of pdp-11, there was an encoding called radix50, packing three characters (from a limited set) into one 16 bits word. That introduced the limitation of 6 letters for filename and 3 for extension, 6 letters for identifier, etc.

That said, it doesn't explain creat in no way.




回答3:


You have to remember that memory was very valuable in the old days. It was common for compilers to have very short maximum variable name lengths. I worked on systems with max lengths of 3. Many of the early C compilers limited variable names to 6 characters.




回答4:


My favourite example of the short-name-madness on unixoid systems is the umount command (see the "Why is 'umount' not spelled 'unmount'?" thread over on unix.stackexchange.org for an explanation, once again, a six-letter-limit). It would be very interesting to compare the time saved by having one letter less to type with the time invested for reading manpages and consulting info, over all those thousands of Unix users over the years...



来源:https://stackoverflow.com/questions/8390979/why-create-system-call-is-called-creat

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!