O'Reilly logo

Advanced UNIX Programming by Warren W. Gay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Compiling C Programs

This is an area in which there is considerable variation among the different UNIX platforms. The FreeBSD 3.4 Release of UNIX uses the very capable GNU compiler:

$ gcc --version
2.7.2.3
$

This is linked to the same command as the more commonly recognized UNIX command name cc, as demonstrated in the next FreeBSD session:

$ type cc
cc is a tracked alias for /usr/bin/cc
$ ls -li /usr/bin/cc
7951 -r-xr-xr-x  2 root  wheel  49680 Dec 20 00:46 /usr/bin/cc
$ type gcc
gcc is a tracked alias for /usr/bin/gcc
$ ls -li /usr/bin/gcc
7951 -r-xr-xr-x  2 root  wheel  49680 Dec 20 00:46 /usr/bin/gcc
$

Since both /usr/bin/cc and /usr/bin/gcc link to the same i-node 7951 in the example, you know that these two files are linked to the same executable ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required