Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Nov 2005 00:01:38 -0700 (MST)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        mayong@mail.com
Cc:        freebsd-drivers@freebsd.org
Subject:   Re: timer_list for FreeBSD?
Message-ID:  <20051124.000138.06946854.imp@bsdimp.com>
In-Reply-To: <20051124032041.CE1F31F50DE@ws1-2.us4.outblaze.com>
References:  <20051124032041.CE1F31F50DE@ws1-2.us4.outblaze.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20051124032041.CE1F31F50DE@ws1-2.us4.outblaze.com>
            "Yong Ma" <mayong@mail.com> writes:
: I tryed to make it with sleep(),but failed:
:  
:  ...
:  #include <unistd.h>
:  ...
:  sec=10; //wait for ten seconds
:  while(GetStatus() && sec-->0){
:     dosomething();
:     sleep(1);
:  }
:  ...
:  complied successfully and made the xxx.ko,but when kldload ./xxx.ko it told me can't load,I don't know why!

sleep(3) isn't available in the kernel.  You'll need to use tsleep(9) or
msleep(9) to accomplish the waiting.

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051124.000138.06946854.imp>