From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 5329A5A0268 for ; Mon, 27 Feb 2023 23:43:11 +0100 (CET) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4PQbB36QKKz4x5X; Tue, 28 Feb 2023 09:43:07 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1677537787; bh=gkfZ6HunHV2cvgw2nI5QWk0Fl/YwZyW2UOKxnQyi1FE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=guyj23fiWjv32fH5dmPgLnGuzR4VEjwA3D5k+ZJlrGzEvRwrpNS6OJfz57TXdHBvp LrA0lxdWkJIWViN1X2dSp32JBdd3lYr93/MOSPJ+X2SXWO3KDTs/Inb0Qb+ILlQqHG /h5/Bt9Zb3+ELpieU10Mvb3MV6+d0jvLetMh6ydc= Date: Tue, 28 Feb 2023 09:39:51 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH] util: Add own prototype for __clone2() on ia64 Message-ID: References: <20230227165051.292844-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="E4oHurdlZYnmDmAG" Content-Disposition: inline In-Reply-To: <20230227165051.292844-1-sbrivio@redhat.com> Message-ID-Hash: FDCAAEBER7UMUUOMVGUJWPIDVEXOUVHV X-Message-ID-Hash: FDCAAEBER7UMUUOMVGUJWPIDVEXOUVHV X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --E4oHurdlZYnmDmAG Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 27, 2023 at 05:50:51PM +0100, Stefano Brivio wrote: > ia64 needs to use __clone2() as clone() is not available, but glibc > doesn't export the prototype. Take it from clone(2) to avoid an > implicit declaration: >=20 > util.c: In function =E2=80=98do_clone=E2=80=99: > util.c:512:16: warning: implicit declaration of function =E2=80=98__clone= 2=E2=80=99 [-Wimplicit-function-declaration] > 512 | return __clone2(fn, stack_area + stack_size / 2, stack_si= ze / 2, > | ^~~~~~~~ >=20 > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > util.c | 9 +++++++++ > 1 file changed, 9 insertions(+) >=20 > diff --git a/util.c b/util.c > index c5ee1c0..799173f 100644 > --- a/util.c > +++ b/util.c > @@ -495,6 +495,15 @@ int write_file(const char *path, const char *buf) > return len =3D=3D 0 ? 0 : -1; > } > =20 > +#ifdef __ia64__ > +/* Needed by do_clone() below: glibc doesn't export the prototype of __c= lone2(), > + * use the description from clone(2). > + */ > +int __clone2(int (*fn)(void *), void *stack_base, size_t stack_size, int= flags, > + void *arg, ... /* pid_t *parent_tid, struct user_desc *tls, > + pid_t *child_tid */ ); > +#endif > + > /** > * do_clone() - Wrapper of __clone2() for ia64, clone() for other archit= ectures > * @fn: Entry point for child --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --E4oHurdlZYnmDmAG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmP9MRIACgkQzQJF27ox 2Gc5cg//cmFVAfzNkh7r9gIbohKZWFTqT1GhWr7GCRQRLI3Ecz3ECu5mP4BXPzFA RoVtgBn5Jp2WRA9BJH8hraO5lY4UEoLos+gejVxouNVjwTArhvPEp9RSuxrzgXns YdyCqp2Mz7dPIAesUqh61a1WmjoOifcl0ffbCTzJ5cH4hwi1Mug3PDWzPcaCkNra tvyIcc7lWJ3WU+tvsNm4YaxT0iO0RRsQZllqrJasJ4KoThnt5gxQb6PDxpZNNb6O N77DTZpYmAUqwmjDvIoRcszzxvqR1AG82JaZKJ1OnyATJXCgGHvGQ5NXVJEvHTZ4 IRzWhaSND0vr2vMb5mLMlcKRr7S0wD3lMniS3dpIsAVEW18ewROSmITlMcox3Y6F 5qicEcr+U6DiEl7ADBJGIU+33FYZLiOjfTHXYvIjigYBE4rbL0lR7Gu0ZwxyTYUv CWRC0MQmRd8CTdx6+Pp/j77CFg72TrkiJ/A0tBBGc+2HCYC3XNtQ9Ozbll/Sv2mM oHbHDN2cmFSXWVN173sUXMX72uD7HX9ySc8CT46Z9K3DUmYhyWMREiFEVV+7c6AL CfYSe3kbcgizLMgbuUsyhr5x1+XXjfuEw1BaVKOC6ukN/tqa/O9EWTA2Fm7m8nLA +bYuMOELuY9dCswmT1R8FzOu6/EIge/vM6/QkfuSKnPXsoOOnOI= =7ZuP -----END PGP SIGNATURE----- --E4oHurdlZYnmDmAG--