Hi,
I am trying to add NetBSD specific code to util/hostdisk.c in order to make
grub-probe work. This part is almost finished. However, I had a hard time
dealing with segfaults in callbacks (hook function pointers) in a number of
places of the vanilla code. Actually, I get segfaults in grub-probe with the
vanilla trunk code (see bug report #28392). This is on NetBSD 5.0 i386.
In the end, these segfaults were fixed by making sure that all variables
accessed by pointers to nested functions are declared static. I attach a
patch that fixes these segfaults on my NetBSD box (this patch is also
included in the bug report).
However, I am not a C expert, and I must be missing something as the code
(obviously) works well on other systems.
Thanks for your help,
Grégoire