The source of my confusion with FreeBSD:

/usr/include/time.h contains: typedef __time_t time_t; and includes
 <sys/_types.h>

/usr/include/sys/types.h includes <machine/_types.h>

/usr/include/machine/_types.h includes <x86/_types.h>

/usr/include/x86/_types.h contains:
  typedef __int32_t __time_t;
  typedef int __int32_t;

Of course I am doing something wrong. Perhaps there is a definition
that makes the difference. I write only small programs I need,
no macros, and copy the necessary includes from the man pages, no
nested includes ad nauseam.

Rodrigo


On Mon, 5 Oct 2020, Roderick wrote:


Thanks anybody for the instructive answers!

On Mon, 5 Oct 2020, Todd C. Miller wrote:

> Are you sure about that?  FreeBSD declares __time_t to be __int64_t
> on amd64.  On FreeBSD/amd64 __int64_t is defined as a long.

You are right. My error. I just run:

#include <stdio.h>
#include <time.h>
int main() {printf("%ld\n",sizeof(time_t));}

And got: 8.

That is easier than navigating on the include files.

Rodrigo


Reply via email to