This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR ada/54040: [x32] Incorrect timeval and timespec


> Actually there are two issues with your change:
> 
> Using time_t for tv_nsec looks actually wrong, the definition on (my)
> linux is:
> 
> struct timespec {
>         __kernel_time_t tv_sec;                 /* seconds */
>         long            tv_nsec;                /* nanoseconds */
> };
> 
> As you can see, the types for tv_sec and tv_nsec are different.
> 
> So the change to timespec looks wrong to me.

In addition concerning s-taprop-linux.adb, the definition of struct
timeval on linux is:

/* A time value that is accurate to the nearest
   microsecond but also has a range of years.  */
struct timeval
  {
    __time_t tv_sec;            /* Seconds.  */
    __suseconds_t tv_usec;      /* Microseconds.  */
  };

So again, we have another type (__suseconds_t), and NOT time_t or __time_t
so it's really wrong for tv_nsec to use time_t.

Arno


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]