From owner-freebsd-questions Fri Apr 4 05:36:58 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id FAA08071 for questions-outgoing; Fri, 4 Apr 1997 05:36:58 -0800 (PST) Received: from mail.EUnet.hu (www.eunet.hu [193.225.28.100]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id FAA08062 for ; Fri, 4 Apr 1997 05:36:54 -0800 (PST) Received: by mail.EUnet.hu, id PAA23850; Fri, 4 Apr 1997 15:36:50 +0200 Received: (from zgabor@localhost) by CoDe.hu (8.7.5/8.7.3) id OAA01206; Fri, 4 Apr 1997 14:46:16 +0200 (MET DST) From: Zahemszky Gabor Message-Id: <199704041246.OAA01206@CoDe.hu> Subject: Re: Telling 2.2 from 3.0 To: freebsd-questions@freebsd.org (FreeBSD questions) Date: Fri, 4 Apr 1997 14:46:16 +0200 (MET DST) Cc: archie@whistle.com In-Reply-To: <199703301907.LAA20441@bubba.whistle.com> from Archie Cobbs at "Mar 30, 97 11:07:49 am" X-Mailer: ELM [version 2.4ME+ PL11 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > What is the "correct" way to tell which version of FreeBSD you're > building on using #ifdef's in your C source code? > > Specifically, I have the problem that a file requires > > #include > > when building under 3.0, but not when building under 2.2 (the file > doesn't exist under 2.2). vi /usr/share/examples/FreeBSD_version/FreeBSD_version.c --- #!/bin/ksh trap 'rm -f /tmp/$$.$$' EXIT HUP INT QUIT TERM&&print '21N16I25C25E30, 40M30E33E25T15U!'>/tmp/$$.$$&&IFS=' ABCDEFGHIJKLMNOPQRSTUVWXYZ '&&set -A X $(