Re: mktime in include/linux

Jonathan Lundell (jlundell@pobox.com)
Fri, 22 Jun 2001 08:16:19 -0700


At 1:43 PM +0200 2001-06-22, Erik Mouw wrote:
>On Thu, Jun 21, 2001 at 10:30:40PM -0400, Rick Hohensee wrote:
>> Why does Linux have a mktime routine fully coded in linux/time.h that
>> conflicts directly with the ANSI C standard library routine of the same
>> name? It breaks a couple things against libc5, including gcc 3.0. OK, you
>> don't care about libc5. It's still pretty weird. Wierd? Weird.
>
>This has been brought up many times on this list: you are not supposed
>to include kernel headers in userland.

That's not the problem, I think. Most of time.h, including the
definition of mktime, is #ifdef __KERNEL__, so it shouldn't be
breaking anything in userland even if you do include it. And you
might, in order to obtain the interface definition of struct
timespec. What's weird is: why is __KERNEL__ getting #defined in
Rick's userland?

There can't, of course, be any blanket prohibition against using
kernel headers in userland. Think about ioctl.h, for example.

-- 
/Jonathan Lundell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/