Linux Creator Torvalds Details Code Differences
Linux creator Linus Torvalds detailed many specific code differences between Linux and Unix in an effort to contradict assertions of copyright violation by The SCO Group.The SCO Group Inc. recently made some specific claims about programs within Linux that it contends were stolen from the Lindon, Utah, companys Unix intellectual property. Linux founder Linus Torvalds on Monday offered eWEEK.com a number of specific code examples that countered SCOs assesment. To read the reponse of Torvalds and other Linux leaders to the SCO code examples, click here. Here are some specific areas where Torvalds found differences between Unix and Linux:
Torvalds looked at lib/ctype.c and include/linux/ctype.h.
.. we do something with the digit ... and the ctype files implement that logic." "Those files exist (in very similar form) in the original Linux-0.01 release under the names lib/ctype.c and include/ctype.h. That kernel was released in September of 1991, and contains no code except for mine and Lars Wirzenius, who co-wrotekernel/vsprintf.c." "In fact, you can look at the files today and 12 years ago, and you can see clearly that they are largely the same: the modern files have been cleaned up and fix a number of really ugly things (tolower/toupper works properly), but they are clearly incremental improvement on the original one." Torvalds added that original Linux version did not look like the Unix source one. He said it had several similarities that he attributed to the following reasons:
- The ctype interfaces are defined by the C standard library.
- The C standard also specifies what kinds of names a system-library interface can use internally. In particular, the C standard specifies that names that start with an underscore and a capital letter are internal to the library. This is important, Torvalds said, because it explains why both the Linux implementation and the Unix implementation used a particular naming scheme for the flags.
- Algorithmically, there arent many ways to test whether a character is a number or not. Thats especially true in C, where a macro must not use its argument more than once. Torvalds provided an example: "The obvious implementation of isdigit(), which tests for whether a character is a digit or not) would be: #define isdigit(x) ((x) >= 0 && (x) <= 9) but this is not actually allowed by the C standard, because x is used twice."