On Fri, Feb 15, 2019 at 4:33 PM Howard Chu <hyc(a)symas.com> wrote:
Matthieu GUEGAN wrote:
> On Fri, Feb 15, 2019 at 3:56 PM Howard Chu <hyc(a)symas.com> wrote:
>> mguegan(a)virtua.ch wrote:
>>> Full_Name: Matthieu Guegan
>>> Version: current
>>> OS: SmartOS
>>> Submission from: (NULL) (184.108.40.206)
>>> In order to compile knot on SmartOS, I have done a series of little
>>> One of them is linked to the LMDB project, which redirects me here.
>>> The idea is to tell SmartOS (and I think the SunOS family) to make use of
>>> posix_madvise(3), instead of madvise(3) as implementation on this OS is
>>> different than, for example, the Linux one.
>>> So, I kindly ask you to take a look at the merge request of the knot
>>> in particular the `src/contrib/lmdb/mdb.c` patch (that's just a ifdef
>>> modification) : would it be possible to apply this patch directly in this
>>> repository ?
>> I see no functional difference between your references  and .
>> What is the benefit of this patch?
> Well, the Solaris/SunOS's madvise(3) is defined with an old `caddr_t`
> type whereas Linux (and *BSD OSes too) use a more modern approach with
> `void *`.
> On the `knot` project, which embed the lmdb part of openldap,
> compilation failed when using madvise(3) on SmartOS, so I did a
> replacement with posix_madvise(3) which uses the `void *` argument
> I don't know what's the best way to handle this case, that's why I ask
A caddr_t is just a typedef of "char *". It should always be legal to
pass a void * to such a parameter. What is your compile error message?
contrib/lmdb/mdb.c: In function 'mdb_env_map':
contrib/lmdb/mdb.c:3998:3: error: implicit declaration of function
'madvise'; did you mean 'raise'?
madvise(env->me_map, env->me_mapsize, MADV_RANDOM);