Date: Sun, 11 Dec 2022 07:57:12 -0700 From: Warner Losh <imp@bsdimp.com> To: Cy Schubert <Cy.Schubert@cschubert.com> Cc: Piotr Kubaj <pkubaj@freebsd.org>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 83bf6ab56829 - main - uname: switch machine to HW_MACHINE_ARCH Message-ID: <CANCZdfrh_07uc_EHAPEihA=75H2akBxYNRLGb_4HX1kiGL6hTA@mail.gmail.com> In-Reply-To: <20221211143724.4D42C415@slippy.cwsent.com> References: <202212111208.2BBC835O095410@gitrepo.freebsd.org> <20221211143724.4D42C415@slippy.cwsent.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000b2602205ef8e9a18 Content-Type: text/plain; charset="UTF-8" On Sun, Dec 11, 2022 at 7:37 AM Cy Schubert <Cy.Schubert@cschubert.com> wrote: > In message <202212111208.2BBC835O095410@gitrepo.freebsd.org>, Piotr Kubaj > write > s: > > The branch main has been updated by pkubaj (ports committer): > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=83bf6ab568293e325f437342cdb87a62 > > 6353e27c > > > > commit 83bf6ab568293e325f437342cdb87a626353e27c > > Author: Piotr Kubaj <pkubaj@FreeBSD.org> > > AuthorDate: 2022-12-11 03:01:44 +0000 > > Commit: Piotr Kubaj <pkubaj@FreeBSD.org> > > CommitDate: 2022-12-11 12:05:39 +0000 > > > > uname: switch machine to HW_MACHINE_ARCH > > > > On powerpc64, powerpc64le and riscv64 some software wrongly assumes > that > > it runs on powerpc or riscv (32-bit). > > > > Differential revision: https://reviews.freebsd.org/D35962 > > Approved by: alfredo, imp > > --- > > lib/libc/gen/__xuname.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/lib/libc/gen/__xuname.c b/lib/libc/gen/__xuname.c > > index fba5eaeebc88..bd328d4f880f 100644 > > --- a/lib/libc/gen/__xuname.c > > +++ b/lib/libc/gen/__xuname.c > > @@ -127,11 +127,11 @@ __xuname(int namesize, void *namebuf) > > } > > q += namesize; > > > > - if ((p = getenv("UNAME_m"))) > > + if ((p = getenv("UNAME_p"))) > > strlcpy(q, p, namesize); > > else { > > mib[0] = CTL_HW; > > - mib[1] = HW_MACHINE; > > + mib[1] = HW_MACHINE_ARCH; > > len = namesize; > > oerrno = errno; > > if (sysctl(mib, 2, q, &len, NULL, 0) == -1) { > > > > This probably needs to go into RELNOTES at some point. Though small it's > significant enough to document. > It's also only for uname(3), not uname(1). Warner --000000000000b2602205ef8e9a18 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">= <div dir=3D"ltr" class=3D"gmail_attr">On Sun, Dec 11, 2022 at 7:37 AM Cy Sc= hubert <<a href=3D"mailto:Cy.Schubert@cschubert.com">Cy.Schubert@cschube= rt.com</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"m= argin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left= :1ex">In message <<a href=3D"mailto:202212111208.2BBC835O095410@gitrepo.= freebsd.org" target=3D"_blank">202212111208.2BBC835O095410@gitrepo.freebsd.= org</a>>, Piotr Kubaj <br> write<br> s:<br> > The branch main has been updated by pkubaj (ports committer):<br> ><br> > URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D83bf6ab56829= 3e325f437342cdb87a62" rel=3D"noreferrer" target=3D"_blank">https://cgit.Fre= eBSD.org/src/commit/?id=3D83bf6ab568293e325f437342cdb87a62</a><br> > 6353e27c<br> ><br> > commit 83bf6ab568293e325f437342cdb87a626353e27c<br> > Author:=C2=A0 =C2=A0 =C2=A0Piotr Kubaj <pkubaj@FreeBSD.org><br> > AuthorDate: 2022-12-11 03:01:44 +0000<br> > Commit:=C2=A0 =C2=A0 =C2=A0Piotr Kubaj <pkubaj@FreeBSD.org><br> > CommitDate: 2022-12-11 12:05:39 +0000<br> ><br> >=C2=A0 =C2=A0 =C2=A0uname: switch machine to HW_MACHINE_ARCH<br> >=C2=A0 =C2=A0 =C2=A0<br> >=C2=A0 =C2=A0 =C2=A0On powerpc64, powerpc64le and riscv64 some software= wrongly assumes that<br> >=C2=A0 =C2=A0 =C2=A0it runs on powerpc or riscv (32-bit).<br> >=C2=A0 =C2=A0 =C2=A0<br> >=C2=A0 =C2=A0 =C2=A0Differential revision:=C2=A0 <a href=3D"https://rev= iews.freebsd.org/D35962" rel=3D"noreferrer" target=3D"_blank">https://revie= ws.freebsd.org/D35962</a><br> >=C2=A0 =C2=A0 =C2=A0Approved by:=C2=A0 =C2=A0 alfredo, imp<br> > ---<br> >=C2=A0 lib/libc/gen/__xuname.c | 4 ++--<br> >=C2=A0 1 file changed, 2 insertions(+), 2 deletions(-)<br> ><br> > diff --git a/lib/libc/gen/__xuname.c b/lib/libc/gen/__xuname.c<br> > index fba5eaeebc88..bd328d4f880f 100644<br> > --- a/lib/libc/gen/__xuname.c<br> > +++ b/lib/libc/gen/__xuname.c<br> > @@ -127,11 +127,11 @@ __xuname(int namesize, void *namebuf)<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0}<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0q +=3D namesize;<br> >=C2=A0 <br> > -=C2=A0 =C2=A0 =C2=A0if ((p =3D getenv("UNAME_m")))<br> > +=C2=A0 =C2=A0 =C2=A0if ((p =3D getenv("UNAME_p")))<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0strlcpy(q, p, na= mesize);<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0else {<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mib[0] =3D CTL_H= W;<br> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mib[1] =3D HW_MACHINE= ;<br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mib[1] =3D HW_MACHINE= _ARCH;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0len =3D namesize= ;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0oerrno =3D errno= ;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (sysctl(mib, = 2, q, &len, NULL, 0) =3D=3D -1) {<br> ><br> <br> This probably needs to go into RELNOTES at some point. Though small it'= s <br> significant enough to document.<br></blockquote><div><br></div><div>It'= s also only for uname(3), not uname(1).</div><div><br></div><div>Warner=C2= =A0</div></div></div> --000000000000b2602205ef8e9a18--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrh_07uc_EHAPEihA=75H2akBxYNRLGb_4HX1kiGL6hTA>