Re: DISPLAY environment variable



> > > >"unix:0" is legal (if old-fashioned) and means the same thing as ":0".  If 
> 
> > 	"unix:0" is neither old-fashioned (it's necessary anytime you want
> > to run a program remotely on a host named "unix") nor is it the same as
> > ":0".

> No.  Historically, "unix:0" is the same as ":0" and tells the system
> that the X clients and X server are running on the same machine. 

	I stand corrected.  (To be honest, I didn't believe you, so I
decided to look it up myself.  :)

	Surfing through XFree86's _X11TransConnectDisplay()
implementation, I found the following:


#ifdef LOCALCONN
    /* check if phostname == localnodename */
    if (phostname && uname(&sys) >= 0 &&
        !strncmp(phostname, sys.nodename, strlen(sys.nodename)))
    {
        Xfree (phostname);
        phostname = copystring ("unix", 4);
    }
#endif

	...and later in the file, I found this comment:

    /*
     * At this point, we know the following information:
     *
     *     pprotocol                protocol string or NULL
     *     phostname                hostname string or NULL
     *     idisplay                 display number
     *     iscreen                  screen number
     *     dnet                     DECnet boolean
     * 
     * We can now decide which transport to use based on the ConnectionFlags
     * build parameter the hostname string.  If phostname is NULL or equals
     * the string "local", then choose the best transport.  If phostname
     * is "unix", then choose BSD UNIX domain sockets (if configured).
     */
     

	...I guess ya learn something new every day. :)


--Derek



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]