Re: [PATCH 4/9] pppd: include time.h before using time_t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On 10/04/19 06:49, Kurt Van Dijck wrote:
>> IMHO time_t is defined in sys/types.h
> chapter

I believe that covers userland environments, not the kernel.

At least on Solaris (and its derivatives, such as Illumos), the symbols
available in the kernel are defined in sys/ (or net/, netinet/, or
similar for network bits).  The top-level header files are for userland
libraries.  Userland libraries are not accessible within the kernel.

In this case, the common net/ppp_defs.h file is used by both user-level
code (pppd itself) and by several kernel modules.

There may be systems on which including <time.h> within a kernel module
is harmless (I suspect Linux is one), but I have a hard time believing
that it's correct to do so.

Do you know of a system where either (a) <sys/time.h> does not exist or
(b) it exists but does not define 'time_t'?  I haven't been able to find
a system that matches either case.  I tried several flavors of Linux,
AIX, Solaris, HP/UX, and IBM USS on z/OS.

James Carlson         42.703N 71.076W         <carlsonj@xxxxxxxxxxxxxxx>

[Index of Archives]     [Linux Audio Users]     [Linux for Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Fedora Users]

  Powered by Linux