From owner-freebsd-questions Tue Jan 30 22: 8:40 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mailhost01.reflexnet.net (mailhost01.reflexnet.net [64.6.192.82]) by hub.freebsd.org (Postfix) with ESMTP id 47D1537B491 for ; Tue, 30 Jan 2001 22:08:22 -0800 (PST) Received: from rfx-216-196-73-168.users.reflexcom.com ([216.196.73.168]) by mailhost01.reflexnet.net with Microsoft SMTPSVC(5.5.1877.197.19); Tue, 30 Jan 2001 22:06:28 -0800 Received: (from cjc@localhost) by rfx-216-196-73-168.users.reflexcom.com (8.11.1/8.11.1) id f0V684415101; Tue, 30 Jan 2001 22:08:04 -0800 (PST) (envelope-from cjc) Date: Tue, 30 Jan 2001 22:08:03 -0800 From: "Crist J. Clark" To: Prasad.Chemburkar@Vashimail.ltitl.com Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Regarding Compilation Message-ID: <20010130220803.O91447@rfx-216-196-73-168.users.reflex> Reply-To: cjclark@alum.mit.edu References: <652569E5.0019F6E3.00@Vashimail.ltitl.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <652569E5.0019F6E3.00@Vashimail.ltitl.com>; from Prasad.Chemburkar@Vashimail.ltitl.com on Wed, Jan 31, 2001 at 10:13:35AM +0530 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Jan 31, 2001 at 10:13:35AM +0530, Prasad.Chemburkar@Vashimail.ltitl.com wrote: > > > > Hi! > Everybody, > > > our developer team is developing some application on 4.2 FreeBSD, they are using > tsleep() function in there code but when they compile there code using 'C' > compiler it gives following error > > /usr/include/sys/systm.h::332: syntax error before 'int' > /usr/include/sys/systm.h::333: syntax error before 'int' > /usr/include/sys/systm.h::334: syntax error before '{' > > i want to ask whether any compilation options in kernel conf had to be used to > use above function, pl help me on this topic, > thanks in advance. Yep, that looks broken. $ cat tsleeptest.c #include #include #include int main() { return 0; } $ cc -o tsleeptest tsleeptest.c In file included from tsleeptest.c:2: /usr/include/sys/systm.h:332: syntax error before `int' /usr/include/sys/systm.h:333: syntax error before `int' /usr/include/sys/systm.h:334: syntax error before `(' $ tail +332 /usr/include/sys/systm.h | head int major(dev_t x); int minor(dev_t x); dev_t makedev(int x, int y); udev_t dev2udev(dev_t x); dev_t udev2dev(udev_t x, int b); int uminor(udev_t dev); int umajor(udev_t dev); udev_t makeudev(int x, int y); #endif /* !_SYS_SYSTM_H_ */ $ cc -E tsleeptest.c | awk '/wakeup_one/ { go = 1; next } ( go == 1 ) { print }' | head -13 int ((int)(((u_int)( dev_t x ) >> 8)&0xff)) ; int ((int)(( dev_t x )&0xffff00ff)) ; dev_t ((dev_t)((( int x ) << 8) | ( int y ))) ; dev_t dev2udev(dev_t x); dev_t udev2dev(dev_t x, int b); int uminor(dev_t dev); int umajor(dev_t dev); dev_t makeudev(int x, int y); The macros for 'major' and 'minor' are being substituted in for these major() and minor() functions. You might want to try sending in a PR, see send-pr(1). The documentation on the manpage saying to use these h-files might be the problem too. -- Crist J. Clark cjclark@alum.mit.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message