[net.unix-wizards] which UNIX?

cottrell@nbs-vms.ARPA (02/20/85)

/*
>    If you need to know at compile time whether you're on a Berklix or 
> a System V system, this might help.  It seems to work on all of our
> systems, including the Pyramid split universe wonder:
> 
> 	# include	<fcntl.h>
> 	# ifdef		FNDELAY
> 	# define	BSD
> 	# else
> 	# define	SYS5
> 	# endif
> 
> This assumes that FNDELAY is not defined in the System V fcntl.h, and
> is in the BSD.  Can anyone think of a case where this is not true, or
> suggest a more convenient/valid alternative?
> "The closer you look, the worse it gets."

Hopefully the C std will define once & for all the appropriate
system names. In the meantime, one could make up one's own names, then
define them in <something.h> as follows:

	/* something.h */
	#ifdef ___V4_1
	#define ___OK
	#endif
	#ifdef ___V4_2
	#define ___OK
	#endif
	#ifdef ___SYSV
	#define ___OK
	#endif
	#ifdef ___V6
	#define ___OK
	#endif
	#ifdef ___V7
	#define ___OK
	#endif
	#ifndef ___OK
	something horrible! ! % ^ & * ( ) - + = [ { } ]
	#endif
	#undef ___OK

The user would be instructed to edit this file & define his system.
All source files would include this file. Multiple defs could also
be forbidden by this technique. Kinda gross tho. Oh well...

	jim
*/

gwyn@BRL-VLD.ARPA (VLD/VMB) (02/21/85)

> Hopefully the C std will define once & for all the appropriate
> system names.

No way, Jos'e!  The library section of the proposed ANSI C standard
looks remarkably like both the /usr/group standard and the System V
interface definition.  The idea is to do away with the NEED for
system dependencies, rather than trying to accomodate them.