On Fri, 22 Feb 2002, Frank v Waveren wrote:
> On Thu, Feb 21, 2002 at 11:18:25AM -0600, Dave Williss wrote:
> > How do I determine if my X connection is local
>
> This may be a bit naieve, but how about just checking your display
> string (ie env var DISPLAY or whatever you passed to XOpenDisplay)?
> If the first character is a ':' it's local, else it's tcp or decnet,
> right?
I haven't looked at this code but I was under impression that
it was smarter than that and could use an AF_UNIX socket even if
you passed the IP address of your machine.
> But, as stated elsewhere in the thread, localness does not guarantee
> shm availability.
>
Yes, creating a segment and seeing if XShmAttach succeeds is
the only reliable way I can think of to do this. Unfortunatly
it also means you have to install an error handler.
SHM can fail on local connections if the server was built
without shm support, kernel was built without SysV IPC support,
extmod module wasn't loaded, ran out of shared segments (there
are only 127 or so on Linux 2.2 kernels). Perhaps there are
some other reasons as well.
Mark.
_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert