Date: Sat, 11 May 2024 19:21:21 -0600 From: Warner Losh <imp@bsdimp.com> To: Warner Losh <imp@freebsd.org> Cc: src-committers <src-committers@freebsd.org>, "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, "<dev-commits-src-main@freebsd.org>" <dev-commits-src-main@freebsd.org> Subject: Re: git: 02f481a30b82 - main - linprocfs: Fix i386 time type Message-ID: <CANCZdfrVuytd_yhThzuWBb5SbTek5jyXVDFKit1Dh8ArwCB2FA@mail.gmail.com> In-Reply-To: <202405120039.44C0dDhe052663@gitrepo.freebsd.org> References: <202405120039.44C0dDhe052663@gitrepo.freebsd.org>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] On Sat, May 11, 2024, 6:39 PM Warner Losh <imp@freebsd.org> wrote: > The branch main has been updated by imp: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=02f481a30b8269c7cad24ec2920ca09751708a1e > > commit 02f481a30b8269c7cad24ec2920ca09751708a1e > Author: Warner Losh <imp@FreeBSD.org> > AuthorDate: 2024-05-11 22:36:23 +0000 > Commit: Warner Losh <imp@FreeBSD.org> > CommitDate: 2024-05-12 00:38:17 +0000 > > linprocfs: Fix i386 time type > > Cast the time type to (long). This is correct on all architectures. On > i386, this promotes the int time_t to a long (which is also 32-bit). On > 64-bit architectures, this promotes the 64-bit signed time_t to a > 64-bit > signed int type. > While this compiles everywhere, it will trucate on armv7 and powerpc. I'll fix it after the play I'm about to see when I realized this. Sorry for the churn. Warner Sponsored by: Netflix > --- > sys/compat/linprocfs/linprocfs.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/sys/compat/linprocfs/linprocfs.c > b/sys/compat/linprocfs/linprocfs.c > index a877d4065c18..aa5af0b3c1c1 100644 > --- a/sys/compat/linprocfs/linprocfs.c > +++ b/sys/compat/linprocfs/linprocfs.c > @@ -2145,9 +2145,9 @@ again: > msqids[id].u.msg_perm.gid, > msqids[id].u.msg_perm.cuid, > msqids[id].u.msg_perm.cgid, > - msqids[id].u.msg_stime, > - msqids[id].u.msg_rtime, > - msqids[id].u.msg_ctime); > + (long)msqids[id].u.msg_stime, > + (long)msqids[id].u.msg_rtime, > + (long)msqids[id].u.msg_ctime); > > free(msqids, M_TEMP); > return (0); > @@ -2199,8 +2199,8 @@ again: > semids[id].u.sem_perm.gid, > semids[id].u.sem_perm.cuid, > semids[id].u.sem_perm.cgid, > - semids[id].u.sem_otime, > - semids[id].u.sem_ctime); > + (long)semids[id].u.sem_otime, > + (long)semids[id].u.sem_ctime); > > free(semids, M_TEMP); > return (0); > @@ -2256,9 +2256,9 @@ again: > shmids[id].u.shm_perm.gid, > shmids[id].u.shm_perm.cuid, > shmids[id].u.shm_perm.cgid, > - shmids[id].u.shm_atime, > - shmids[id].u.shm_dtime, > - shmids[id].u.shm_ctime, > + (long)shmids[id].u.shm_atime, > + (long)shmids[id].u.shm_dtime, > + (long)shmids[id].u.shm_ctime, > 0, 0); /* XXX rss & swp are not supported > */ > > free(shmids, M_TEMP); > [-- Attachment #2 --] <div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 11, 2024, 6:39 PM Warner Losh <<a href="mailto:imp@freebsd.org">imp@freebsd.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The branch main has been updated by imp:<br> <br> URL: <a href="https://cgit.FreeBSD.org/src/commit/?id=02f481a30b8269c7cad24ec2920ca09751708a1e" rel="noreferrer noreferrer" target="_blank">https://cgit.FreeBSD.org/src/commit/?id=02f481a30b8269c7cad24ec2920ca09751708a1e</a><br> <br> commit 02f481a30b8269c7cad24ec2920ca09751708a1e<br> Author: Warner Losh <imp@FreeBSD.org><br> AuthorDate: 2024-05-11 22:36:23 +0000<br> Commit: Warner Losh <imp@FreeBSD.org><br> CommitDate: 2024-05-12 00:38:17 +0000<br> <br> linprocfs: Fix i386 time type<br> <br> Cast the time type to (long). This is correct on all architectures. On<br> i386, this promotes the int time_t to a long (which is also 32-bit). On<br> 64-bit architectures, this promotes the 64-bit signed time_t to a 64-bit<br> signed int type.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">While this compiles everywhere, it will trucate on armv7 and powerpc. I'll fix it after the play I'm about to see when I realized this. Sorry for the churn.</div><div dir="auto"><br></div><div dir="auto">Warner</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Sponsored by: Netflix<br> ---<br> sys/compat/linprocfs/linprocfs.c | 16 ++++++++--------<br> 1 file changed, 8 insertions(+), 8 deletions(-)<br> <br> diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c<br> index a877d4065c18..aa5af0b3c1c1 100644<br> --- a/sys/compat/linprocfs/linprocfs.c<br> +++ b/sys/compat/linprocfs/linprocfs.c<br> @@ -2145,9 +2145,9 @@ again:<br> msqids[id].u.msg_perm.gid,<br> msqids[id].u.msg_perm.cuid,<br> msqids[id].u.msg_perm.cgid,<br> - msqids[id].u.msg_stime,<br> - msqids[id].u.msg_rtime,<br> - msqids[id].u.msg_ctime);<br> + (long)msqids[id].u.msg_stime,<br> + (long)msqids[id].u.msg_rtime,<br> + (long)msqids[id].u.msg_ctime);<br> <br> free(msqids, M_TEMP);<br> return (0);<br> @@ -2199,8 +2199,8 @@ again:<br> semids[id].u.sem_perm.gid,<br> semids[id].u.sem_perm.cuid,<br> semids[id].u.sem_perm.cgid,<br> - semids[id].u.sem_otime,<br> - semids[id].u.sem_ctime);<br> + (long)semids[id].u.sem_otime,<br> + (long)semids[id].u.sem_ctime);<br> <br> free(semids, M_TEMP);<br> return (0);<br> @@ -2256,9 +2256,9 @@ again:<br> shmids[id].u.shm_perm.gid,<br> shmids[id].u.shm_perm.cuid,<br> shmids[id].u.shm_perm.cgid,<br> - shmids[id].u.shm_atime,<br> - shmids[id].u.shm_dtime,<br> - shmids[id].u.shm_ctime,<br> + (long)shmids[id].u.shm_atime,<br> + (long)shmids[id].u.shm_dtime,<br> + (long)shmids[id].u.shm_ctime,<br> 0, 0); /* XXX rss & swp are not supported */<br> <br> free(shmids, M_TEMP);<br> </blockquote></div></div></div>help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrVuytd_yhThzuWBb5SbTek5jyXVDFKit1Dh8ArwCB2FA>
