Date: Thu, 13 Dec 2018 00:11:21 -0500 From: Andrew Kelley <andrew@ziglang.org> To: freebsd-hackers@freebsd.org Subject: raise() implementation in freebsd libc vs musl libc Message-ID: <70c7214e-3619-115d-abca-09853a1729a6@ziglang.org>
next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --XIgApqZuOrt2zj5has1qHEWEWoc3PXhgM Content-Type: multipart/mixed; boundary="yKqsLoVNDuOgjEM2fX4ndnu9mScsO9dee"; protected-headers="v1" From: Andrew Kelley <andrew@ziglang.org> To: freebsd-hackers@freebsd.org Message-ID: <70c7214e-3619-115d-abca-09853a1729a6@ziglang.org> Subject: raise() implementation in freebsd libc vs musl libc --yKqsLoVNDuOgjEM2fX4ndnu9mScsO9dee Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Howdy, I noticed that musl-libc blocks signals in raise() to prevent a race condition, but freebsd libc does not. is there a reason it's necessary on linux and not freebsd? musl int raise(int sig) { sigset_t set; __block_app_sigs(&set); int ret =3D syscall(SYS_tkill, __pthread_self()->tid, sig); __restore_sigs(&set); return ret; } freebsd int __raise(int s) { long id; if (__sys_thr_self(&id) =3D=3D -1) return (-1); return (__sys_thr_kill(id, s)); } Regards, Andrew --yKqsLoVNDuOgjEM2fX4ndnu9mScsO9dee-- --XIgApqZuOrt2zj5has1qHEWEWoc3PXhgM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEl8v20Nl/A6duouJgfF9Uj3KFAakFAlwR6fkACgkQfF9Uj3KF AanXAhAAubSBV5ekwOjyRSXn9J1aeUx358Zes3vq7auuzyEgmjpI2tJ5o1du1QLM WRHHPvSpFzkGa3+P3or7Fs/ZZ+RzhJ4LEZwB9vRRFb8uzOQ0MztdQrwk4F+M0bTz VqLI8hF71FoXUZerjtxJo0tMGrHf3Q666ONp9L9/jwVP6KDsI2drBkoN3jie+Psz 1xAQ7nCpd+Zva4UXLkj7xYC3QfTG77yoEdBhwTH4yScCk5ppoh8ggT7OJ5fenNfq Tjxafc84DXsjtu9xIaV61M4EQaqdiLr5MroduHXX9XIC/qCdGV9PtY8+HTGJZgxP d7DdMSm+jVaWivjubnzgPeXn/e4GysAAGUVwPsFwchPSUbMsEQWfUr2In+NwPuRU +AKK9VzupX8l5G55NSpvmG/4tB2qz9h9JxHO2sOJCm2xLSWDQbKuUL8elH3E2ySj M7B8qRzITmfnviNKcgmi/8CrrF22YlJV2Xncz23ejD5ss2gMFBOaSgckuSTN/YNH d9RVA5sMZLn0wzk5Cbj3y4q3PZ8hsYZclnZs4epOif/cNOeqkvAFW0gaREdhAjXU NUxV/anCpX4YYv7igg4CWUMvGb3P1dGAsnfoJ4i8ei5b87qkfOcsjKtuuzXJw/sP kbiSykTtJQu6DR/FJhfFXjj/auFnqaL6YyTzlVmd4xaylni99Dg= =7NxN -----END PGP SIGNATURE----- --XIgApqZuOrt2zj5has1qHEWEWoc3PXhgM--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?70c7214e-3619-115d-abca-09853a1729a6>