Re: problem with systm.h trying to call resettodr()

2001-06-08 Thread Louis A. Mamakos


I didn't think resettodr(9) was a system call exposed to user program,
but instead a function available to be called from kernel code.  Thus,
the section 9 manual page.

louie

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: problem with systm.h trying to call resettodr()

2001-06-08 Thread Peter Pentchev

On Fri, Jun 08, 2001 at 12:47:31PM +0100, Rasputin wrote:
> I'm playing with resettodr(9), to set the BIOS clock from the system time..
> 
> When I try to compile the following snippet,
> 
> [rasputin@dogma rasputin]$ cat b0rken.c 
> #include 
> #include 
> #include 
> 
> int main(void){
> resettodr();
> return(0);
> }
> 
> I get warning about syntax errors in systm.h:
> 
> [rasputin@dogma rasputin]$ gcc b0rken.c 
> In file included from b0rken.c:3:
> /usr/include/sys/systm.h:333: syntax error before `int'
> /usr/include/sys/systm.h:334: syntax error before `int'
> /usr/include/sys/systm.h:335: syntax error before `('
> 
> (System is STABLE/RELENG_4 freshly cvsupped a few days ago, although
> /usr/src/sys/sys/systm.h doesn't seem to have changed in STABLE
> for four months.
> 
> Any ideas? I know I'm not exactly '3l337' but I'd say that header file
> was screwed. Or am I missing some wierd ass compiler option?

As others pointed out, resettodr(9) is a kernel-space function.
Section 9 of the manual is for those - see the intro(9) manual page
with man 9 intro (just man intro would probably show you intro(1)).

G'luck,
Peter

-- 
If I had finished this sentence,

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: problem with systm.h trying to call resettodr()

2001-06-08 Thread Ceri

On Fri, Jun 08, 2001 at 12:47:31PM +0100, Rasputin said:
> I'm playing with resettodr(9), to set the BIOS clock from the system time..
> 
> I get warning about syntax errors in systm.h:
> 
> [rasputin@dogma rasputin]$ gcc b0rken.c 
> In file included from b0rken.c:3:
> /usr/include/sys/systm.h:333: syntax error before `int'
> /usr/include/sys/systm.h:334: syntax error before `int'
> /usr/include/sys/systm.h:335: syntax error before `('

I been getting the exact same thing, so it's definitely not local to you.

Ceri

-- 
Your local RFC Nazi

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: problem with systm.h trying to call resettodr()

2001-06-08 Thread Rasputin

* Peter Pentchev <[EMAIL PROTECTED]> [010608 13:35]:
> On Fri, Jun 08, 2001 at 12:47:31PM +0100, Rasputin wrote:
> > I'm playing with resettodr(9), to set the BIOS clock from the system time..

> As others pointed out, resettodr(9) is a kernel-space function.
> Section 9 of the manual is for those - see the intro(9) manual page
> with man 9 intro (just man intro would probably show you intro(1)).

Thanks, I'd already read intro(9), but it doesn't explain how to *use*
kernel-space functions. 


I suppose the manpage would be huge then, though maybe book size?
Is this another 'get that daemon book, you tight-fisted...' 
situation?

So the syntax errors in systm.h are related to what-
Missing compiler flags (-DKERNEL?), or missing headers?



I *know* you guys all know, but where did you get this knowledge from?
Is there a secret BSD monastery you all hang out at, or is there a secret
switch you give man that lets you into the *real* details ?


Thanks. I'll bring water wings next time

--
"These are the propulsion systems used by NASA for the moonshots,"
said Tom apologetically. 
Rasputin :: Jack of All Trades - Master of Nuns ::

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: problem with systm.h trying to call resettodr()

2001-06-08 Thread Peter Pentchev

On Fri, Jun 08, 2001 at 01:49:12PM +0100, Rasputin wrote:
> * Peter Pentchev <[EMAIL PROTECTED]> [010608 13:35]:
> > On Fri, Jun 08, 2001 at 12:47:31PM +0100, Rasputin wrote:
> > > I'm playing with resettodr(9), to set the BIOS clock from the system time..
> 
> > As others pointed out, resettodr(9) is a kernel-space function.
> > Section 9 of the manual is for those - see the intro(9) manual page
> > with man 9 intro (just man intro would probably show you intro(1)).
> 
> Thanks, I'd already read intro(9), but it doesn't explain how to *use*
> kernel-space functions. 

You can only use kernel-space functions in kernel code, that is, writing
a kernel module, or writing a piece of code that is to be compiled along
with the rest in src/sys.

If you're doing that, look at some kernel source files to see which header
files need to be included.  If you're not doing that, you cannot use
the functions documented in section 9.

G'luck,
Peter

-- 
This sentence claims to be an Epimenides paradox, but it is lying.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: problem with systm.h trying to call resettodr()

2001-06-08 Thread Alexey V. Neyman

On Fri, 8 Jun 2001, Peter Pentchev wrote:

>On Fri, Jun 08, 2001 at 01:49:12PM +0100, Rasputin wrote:
>You can only use kernel-space functions in kernel code, that is, writing
>a kernel module, or writing a piece of code that is to be compiled along
>with the rest in src/sys.

By the way, are there any underwater stones in linking userland programs
against libkern with '-static -nostdlib' to gcc?

Regards,
Alexey.



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message