Hi all, I have a few questions about the libc wrapper layer on FreeBSD,
and its implementation of xf86shmat() and friends.

On FreeBSD, XFree86's libc wrapper is:

        xc/programs/Xserver/hw/xfree86/os-support/bsd/libc_wrapper.c

which is a symlink to:

        xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c

There are two implementations of xf86shmget(), xf86shmat(), xf86shmctl(),
and xf86shmdt() in libc_wrapper.c:

- an implementation that just calls into the C library via shmget(),
shmat(), shmdt() and shmctl(); this implementation is protected by "#ifdef
HAVE_SYSV_IPC"

- an implementation that is used when HAVE_SYSV_IPC is not defined; in
this case, the four functions each just return -1.

It seems that HAVE_SYSV_IPC is not defined by default.  Is there a more
correct way to enable it, rather than just adding "-DHAVE_SYSV_IPC" to
the DefaultCCOptions in my host.def?

When I do define HAVE_SYSV_IPC, then I hit a problem with the
implementation of xf86shmat():


char *
xf86shmat(int id, char *addr, int xf86shmflg)
{
    int shmflg = 0;

    if (xf86shmflg & XF86SHM_RDONLY) shmflg |= SHM_RDONLY;
    if (xf86shmflg & XF86SHM_RND) shmflg    |= SHM_RND;
    if (xf86shmflg & XF86SHM_REMAP) shmflg  |= SHM_REMAP;

    return shmat(id,addr,shmflg);
}

complaining that SHM_REMAP isn't defined.  Grepping in /usr/include/, I
couldn't find SHM_REMAP.  Does anyone know if this doesn't exist on
FreeBSD?

I'm using FreeBSD-4.5 (haven't tried any of this on -CURRENT, yet).

I'm a little confused how XFree86 could use shared memory with the current
CVS code.  Does anyone know anything about this?

Thanks,
- Andy Ritger
_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to