Source code here: http://cgit.freedesktop.org/xorg/app/xinit/tree/xinit.c