Subject: Re: Compatibilty with Linux or with FreeBSD
To: Gregg C Levine <firstname.lastname@example.org>
From: Erik Bertelsen <email@example.com>
Date: 07/23/2000 12:59:34
> Just out of plain curiosity, would a program written for FreeBSD work, as
> is, on NetBSD? And by the same token, would a program that was written for
> Linux, also work as is?
Actually you have two distinct questions here:
1. Will a compiled program that has been compiled and linked in another OS work
2. Will the sources of a program that has been developed for another OS compile,
link, and run correctly on NetBSD?
To question 1, the answer is: possibly. For several hardware types (i386, m68k, etc)
the kernel implements COMPAT_XXX modes for several systems (XXX being among LINUX,
FREEBSD, and others) that will enable binaries for those systems to run on NetBSD.
You will, however, not be able to run a binary from any OS on another type of CPU,
e.g. a i386 binary on a powerpc cpu. In short: Many Linux and FreeBSD binaries for
i386 CPU's will run happily on NetBSD/i386.
To question 2, the answer is: maybe. If the original author has written the code
to conform to the internatinal standards for the C language, Posix interface, and
lateron the Single Unix Specification, the chances for compilation on another OS
(even another CPU) are quite high. If the author has utilized, say Linux-specific
headers, the chances are lower.