Which is the first version of the linux-kernel implementing the system call write? (sys_write)
-
1That's a lot harder (one of the very first kernels :-) ) – Thomas Dickey Oct 31 '16 at 00:15
-
@ThomasDickey ok. maybe version 1.x? – ncomputers Oct 31 '16 at 00:16
-
1Linux started before 1.0 (I've used it since some 0.9x). See 1.0 page. – Thomas Dickey Oct 31 '16 at 00:18
-
2"*one* of the first"? Are you kidding? The "write" system call was in Unix in the mid 1970s, before Linux even existed. – G-Man Says 'Reinstate Monica' Oct 31 '16 at 01:31
3 Answers
As you might expect, given that the write
system call is a staple of Unix-style kernels, Linux had it as soon as it was “grown up” enough to be a kernel. You can see its implementation in version 0.01 from 1991.

- 434,908
The yggdrasil tarball from November 1994 has sys_write
in /usr/src/linux/fs/read_write.c
(actually gzip'd).
That file has this: Copyright (C) 1991, 1992 Linus Torvalds which indicates it was added in 1991 or 1992. There was no version-control system in use at that time, so details are scarce.

- 76,765
-
the source file of the file you mendtion has this:
Copyright (C) 1991, 1992 Linus Torvalds
do you have any idea of which version could it be? – ncomputers Oct 31 '16 at 00:42 -
1not offhand (and there was no version-control system in use at that time, so details are scarce) – Thomas Dickey Oct 31 '16 at 00:44
-
ok, thank you very very much! would you mind if i add some info to your answers or do you prefer to do it instead of me? i would like to talk about the fact that the file you did mention has that copyright leyend, what suggest that
sys_write
was introduced during those years ... – ncomputers Oct 31 '16 at 00:51 -
At the risk of repeating information that is undoubtedly documented in a million places:
“Unix Version 6” (or “Unix Sixth Edition”) was the first version of Unix released outside of AT&T Bell Laboratories (the birthplace of Unix). I know this happened by 1975 at the latest. I know nothing about versions before that. (Chronology note: “Version 7”, naturally, came shortly after “Version 6”. Then “System III” and “System V” came long after that.)
The write
system call was present in Unix Version 6.
Here is the write(II)
man page from Unix Version 6;
note that it is dated 8/5/73.
Here is an index of all the man pages.
Linux was announced in 1991; see, for example, Wikipedia. This answer to the U&L question Is it true that the first version of Linux was based on parts of Unix? claims that Linus Torvalds based the Linux system calls on the Unix man pages, saying that this information comes from the book Just for Fun.
So, the write
system call was in Unix long before Linux existed.
-
4First Edition Unix source has been reconstructed from tapes and published. – JdeBP Oct 31 '16 at 09:23
-
2@JdeBP: *First Edition? As in from the late 1960s?* That could be interesting, and perhaps useful. Can you provide a link? – G-Man Says 'Reinstate Monica' Oct 31 '16 at 17:01
-
2
-
1Interesting. There seems to be a sys_write call at line 24 in the C compiler from mid 1972: https://github.com/DoctorWkt/unix-jun72/blob/master/src/c/c1t.s – Bjorn A. Oct 31 '16 at 19:17
-
1
sys write
can be found in lots of places where you would expect it to be; e.g., cat.s lines 46 and 55; df.s lines 8, 12, 16, 22, and 61; etc.; and the most obvious place, write.s line 17. I could find only one C file that calledwrite()
— because there is so little C code! — in cp.c lines 9, 13, 31, 35, 41, 44, and 45. – G-Man Says 'Reinstate Monica' Nov 01 '16 at 05:09 -