From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmtpH-0001Lg-7K for qemu-devel@nongnu.org; Mon, 16 Jan 2012 16:10:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RmtpF-0000Sb-Mm for qemu-devel@nongnu.org; Mon, 16 Jan 2012 16:10:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37929) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmtpF-0000SW-Eg for qemu-devel@nongnu.org; Mon, 16 Jan 2012 16:10:45 -0500 Message-ID: <4F149252.2000502@redhat.com> Date: Mon, 16 Jan 2012 14:10:42 -0700 From: Eric Blake MIME-Version: 1.0 References: <1326482122-12619-1-git-send-email-lcapitulino@redhat.com> <1326482122-12619-3-git-send-email-lcapitulino@redhat.com> <4F10A694.8030900@redhat.com> <20120116150853.40626823@doriath> <4F1483B7.2010105@redhat.com> <20120116181934.2914f46f@doriath> In-Reply-To: <20120116181934.2914f46f@doriath> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigB0CEE773D9F16DDD940AFB7D" Subject: Re: [Qemu-devel] [PATCH 2/2] qemu-ga: Add the guest-suspend command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: jcody@redhat.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB0CEE773D9F16DDD940AFB7D Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 01/16/2012 01:19 PM, Luiz Capitulino wrote: >> memset(), strlen, strcpy, and friends in are all in the cla= ss >> of functions that I think are unintentional omissions from the list of= >> async-signal-safe functions (they don't read/modify anything but the >> pointers passed in, so the _only_ reason I can think of why they _migh= t_ >> have been omitted from the list is that there might be some machine >> state that could be observably different if you were interrupted in th= e >> middle of one of these operations, such as a processor flag bit when >> using a rep prefix on x86 controlling which direction to move, but no >> one has ever pointed me to a definitive answer to why they were omitte= d). >=20 > If this is right we shouldn't be using them then... The _nice_ thing is that the functions in are trivially replaceable by naive variants that _are_ async-signal-safe, since the algorithms behind them are so trivial. It's just that it's annoying to have to tell users that they have to write non-optimized code when doing string ops in a signal handler or after a fork (C code tends to not be as nice as the hand-tuned assembly in glibc for all these low-level functions), for what so far appears to be a theoretical rather than a confirmed restriction on why the standard does not require async-safety. I guess it's time for me to follow through with my threat to file a bug against the POSIX folks to get the string functions added to the list of async-signal-safe, and/or give me stronger justification why they are not already there. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigB0CEE773D9F16DDD940AFB7D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJPFJJSAAoJEKeha0olJ0NqAOkIAK0Q7LS/wh6lMA/2h5fWqGcm 0QYL3IZckJU5Q9zCZjOFtfU4P/NMlQgAt/zCvbMgjLm73A03KmmUQFLho1CxwbjE PLYtJ4qo+eW0asRumpt6Gt/MzM488oJYv5yK1GeV7a6tH5aBI0vvGL0UP5Tpe/WM agJTUqahyaNMQAEyiOlleWcOhcghyAefagapo4T4jRogMxHVXmXwJeKYJDV8RVcj beNFp9pVL6pz2ct7nVvNpt8tyl4PhB7aGOtoEVUGYIlvD4nCuVxwXyJ1avSvzd7d LQjUx0B8YHmhojCfCAXn1xkuF0QBYE618xHD+uTNmqNFYv9qxSjkNkYwkIwzrSM= =bnSW -----END PGP SIGNATURE----- --------------enigB0CEE773D9F16DDD940AFB7D--