From owner-freebsd-questions Tue Jan 30 9: 4:36 2001 Delivered-To: freebsd-questions@freebsd.org Received: from dsl-64-193-218-89.telocity.com (dsl-64-193-218-89.telocity.com [64.193.218.89]) by hub.freebsd.org (Postfix) with SMTP id BDFCF37B4EC for ; Tue, 30 Jan 2001 09:04:14 -0800 (PST) Received: (qmail 1604 invoked by uid 1000); 30 Jan 2001 17:01:58 -0000 Date: Tue, 30 Jan 2001 11:01:58 -0600 From: Lucas Bergman To: Suyog.Vaidya@Vashimail.ltitl.com Cc: freebsd-questions@freebsd.org Subject: Re: Regarding tsleep() Message-ID: <20010130110158.A31190@billygoat.slb.to> Reply-To: lucas@slb.to References: <652569E4.00330805.00@Vashimail.ltitl.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <652569E4.00330805.00@Vashimail.ltitl.com>; from Suyog.Vaidya@Vashimail.ltitl.com on Tue, Jan 30, 2001 at 02:47:23PM +0530 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > On FreeBSD4.2 I am using tsleep() system call but it gives error > while compiling, the error is reported in systm.h file. > > /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 `(' Some crucial parts of the include files are surrounded by `#ifdef _KERNEL'. So, if you compile with `-D_KERNEL' or add `#define _KERNEL 1' to your source, it compiles fine. This should, of course, make you nervous. > If I am compiling it on FreeBSD3.0 then it gives "undefined > reference to 'tsleep' " There is not a single piece of non-kernel code that uses this call: % cd /usr/src % find . -name '*.c' | grep -v '^\./sys/' | xargs grep -l tsleep % Clearly, this was not meant to be used in applications. I'd advise getting the functionality you're looking for with signals. That's way more portable, anyway. Unless you're writing kernel modules, that is... > Can you help me please? Only partially. Sorry. :) Lucas To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message