Date: Mon, 26 Nov 2018 17:15:19 -0700 From: Warner Losh <imp@bsdimp.com> To: eugen@freebsd.org Cc: John Baldwin <jhb@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-head@freebsd.org Subject: Re: svn commit: r340617 - head/sys/netgraph Message-ID: <CANCZdfrRBJivhYAFX3LAYaEi_p01CrAtbTvd=Rvz%2B5PAPUDJ0Q@mail.gmail.com> In-Reply-To: <5e7d2e8e-2a06-e687-f4c1-5c30ee4c50be@freebsd.org> References: <201811190727.wAJ7RpDN052165@repo.freebsd.org> <f3ef3476-4086-2477-9397-e0dc8f902e4f@FreeBSD.org> <5e7d2e8e-2a06-e687-f4c1-5c30ee4c50be@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 26, 2018 at 4:29 PM Eugene Grosbein <eugen@freebsd.org> wrote:
> 27.11.2018 4:26, John Baldwin wrote:
>
> >> /* Parse type for timeval */
> >> static const struct ng_parse_struct_field
> ng_source_timeval_type_fields[] = {
> >> +#ifdef __LP64__
> >> + { "tv_sec", &ng_parse_int64_type },
> >> + { "tv_usec", &ng_parse_int64_type },
> >> +#else
> >> { "tv_sec", &ng_parse_int32_type },
> >> { "tv_usec", &ng_parse_int32_type },
> >> +#endif
> >> { NULL }
> >
> > time_t (and thus tv_sec) is 64 bits on all but i386 now. tv_usec is
> still a
> > long, so follows LP64 though. If this is trying to match an actual
> struct
> > timeval then you might want something like this:
> >
> > #ifdef __i386__
> > { "tv_sec", &ng_parse_int32_type },
> > #else
> > { "tv_sec", &ng_parse_int64_type },
> > #endif
> > #ifdef __LP64__
> > { "tv_usec", &ng_parse_int32_type },
> > #else
> > { "tv_usec", &ng_parse_int64_type },
> > #endif
>
> I'm not sure I get it right: do you mean there is a difference for some
> platform we have?
>
time_t is 64-bits in FreeBSD for all architectures regardless of __LP64__,
except it's 32-bits on i386.
Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrRBJivhYAFX3LAYaEi_p01CrAtbTvd=Rvz%2B5PAPUDJ0Q>
