Dear OpenBSD experts,

I am working on a port that ships with an optional wrapper around mmap,
open, close, ... (i.e, to be used with LD_PRELOAD). I am stuck with the
mmap wrapper which is defined for FreeBSD (and alike) as

#if defined(__FreeBSD__)
#define SYS_MMAP(addr, len, prot, flags, fd, off) \
        __syscall(SYS_mmap, (void *)(addr), (size_t)(len), \
                        (int)(prot), (int)(flags), (int)(fd), (__off_t)(off))
#elif defined(__FreeBSD_kernel__)
#define SYS_MMAP(addr, len, prot, flags, fd, off) \
        syscall(SYS_mmap, (void *)(addr), (size_t)(len), \
                        (int)(prot), (int)(flags), (int)(fd), (__off_t)(off))

sys/sys/syscallargs.h tells me that in OpenBSD there is a further
argument "long pad" at sixth position. Just setting it to "(long) 0"
gives a segmentation fault.

Any recommendations/ideas what would be the proper definition for above
wrapper in OpenBSD?

Thanks!

Best regards,
Ingo

Reply via email to