From: | ilmari(at)ilmari(dot)org (Dagfinn Ilmari Mannsåker ) |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: using explicit_bzero |
Date: | 2019-06-21 13:45:47 |
Message-ID: | d8jv9wzvypg.fsf@dalvik.ping.uio.no |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
>> +#ifndef HAVE_EXPLICIT_BZERO
>> +#define explicit_bzero(b, len) bzero(b, len)
>> +#endif
>
> This presumes that every platform has bzero, which is unsafe (POSIX
> doesn't specify it) and is an assumption we kicked to the curb a dozen
> years ago (067a5cdb3). Please use memset() for the substitute instead.
>
> Also, I'm a bit suspicious of using AC_CHECK_FUNCS for this; that
> generally Doesn't Work for anything that's not a vanilla out-of-line
> function. Are we worried about people implementing this as a macro,
> compiler built-in, etc?
Also, on Linux it requires libbsd: https://libbsd.freedesktop.org/
(which seems to be down, but
https://packages.debian.org/buster/libbsd-dev has a list of the
functions it provides).
- ilmari
--
"A disappointingly low fraction of the human race is,
at any given time, on fire." - Stig Sandbeck Mathisen
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2019-06-21 14:01:44 | Re: using explicit_bzero |
Previous Message | Tom Lane | 2019-06-21 13:45:32 | Re: File descriptors inherited by restore_command |