tech-x11 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: explicit_bzero(Linux 3) -> explicit_memset(3)



On Thu, Feb 01, 2024 at 07:40:38AM +0100, tlaronde%kergis.com@localhost wrote:
> For example xorg libXau (I'm working on debugging X11 stuff; this is
> why...) uses explicit_bzero(Linux 3) that NetBSD does not provide
> (legitimately: bzero(3) has been deprecated in POSIX since there is
> memset(3)).
> 
> But there is explicit_memset(3) to avoid compiler optimizing the
> zeroing away.
> 
> Is there some policy concerning this, i.e. mapping explicit_bzero(3)
> to explicit_memset(3) in external code? (I could also propose a patch
> upstream to have a feature macro to use explicit_memset(3) when
> available).

FWIW, I have made patches on gitlab.freedesktop.org and suggested a
merge request for libXau, and I will do the same as I go on with X11
stuff so this should simplify NetBSD import.

The (general) problems fixed:

- Test for explicit_memset(3) to (supplementary to explicit_bzero(3));

- Test for __GNUC__ && __GNUC__ < 11 for optional deallocator arg to
__attribute__((malloc))---supplementary is supported starting with 11;

- Correct sed(1) invocation to place file argument last conforming to
POSIX.2 usage (they put the file first before the commands, and this
is why GNU sed(1) is then required for people---pkgsrc---using meson).

-- 
        Thierry Laronde <tlaronde +AT+ kergis +dot+ com>
                     http://www.kergis.com/
                    http://kertex.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C


Home | Main Index | Thread Index | Old Index