Many system calls in Unix use overloading and default variables. This concept is absent in C, so Unix is coded in C++ also right?
I don't know which system calls you're referring to, but I bet that most UNIX-ee operating systems are coded in straight C. There's probably just C++ wrappers for the system calls.
UNIX systems are generally coded in straight C and for some reason most UNIX developers also seem to dislike C++.
kernel is in c; majority of programs/libraries are also in c.
do you have any programming question?
Pretty much straight C all the way down...
All major versions of Unix use entirely straight C for the kernel. (Well, Mac OS X has a little C++ in one interface.)
If you don't count the desktop layer, then without more than a few exceptions, the core libraries and utilities are in C as well. The only core utility that I can think of that is written in C++ is groff
.
Now, with packages, it's a different story...
When you talk about kernels for Unix-y operating systems like Linux, Solaris, Mac OS X, NetBSD, FreeBSD, etc. - they're typically all C. And I also am not sure what you mean by overloading or default variables - certainly not in kernel calls.
I was surprised when DigitalRoss said Mac OS X has Objective C in the kernel sources, so I downloaded the MacOS X 10.6.2 version of the Darwin xnu kernel sources, and indeed, there was no Objective C. I was, however, slightly shocked to discover a little C++.
Anyway, a lot of things "user-space" (non-kernel) programs rely on, like virtual memory, exception handling, device I/O, and so on, are done by the kernel. But the kernel can't use itself for those things, just like you can't lift yourself up in the air by picking up your shoes with your hands.
Object-oriented languages like C++ and Objective C make extensive use of exactly the things kernels can't do for themselves. That's why kernels are mostly written in C. In the case of that C++ I saw in the xnu sources, I'm sure it's very, very carefully written to avoid doing things that aren't safe in the kernel.
As far as user-space programs being written in C vs. C++, I think it's mostly tradition, personal preference, and what people are used to. As someone who's proficient in both languages, I think it's rather silly myself.
Definitely C - try man syscall
or man -s2 read
- that gives you C library interface, no C++ in sight.
Unix was first created at Bell Labs in 1969, well before C++ was conceived. (Src: Unix), you can confirm this by reading Lions' Commentary on Unix, or the BSD 4.4-Lite (which is similar to BSD Net/2) which is available in tarball or via cvs (from FreeBSD). Or the archives from The Unix Heritage Society which is from the very old Bell Labs / AT&T versions.
Bjarne Stroustrup created C++ in approximately 1983, prior to that he worked on "C with Classes", according to History of C++. Confirmed from Bjarne Stroustrup's FAQ, and the earliest date for C with Classes was 1979.
I hope that clarifies the impossibility of the idea that Unix was based upon C++. Note that Object-Oriented languages have been around since 1960s in Simula 67, so don't confuse objects and classes with C++.
A few OS kernels have been written in C++. I believe the Chorus kernel (for one example) is written (almost?) exclusively in C++ (it's somewhat like Mach: a microkernel that's used almost exclusively via a UNIX emulator running as a user-mode server).
There have been a few other semi-experimental systems in C++ as well. One fairly recent one is named Hybrid. A much older one was posted on comp.sources.misc (in four consecutive posts) years ago -- I'm pretty sure it'd take a fair amount of work to get it to compile with a current C++ compiler. This one runs on a virtual machine, and includes source to emulate the hardware.