title: How do I talk to an X server in C without a graphics library?
body: <p>If I wanted to write a C program to talk to an X server on Linux and produce the simplest possible visual result, e.g. setting a single pixel on the display, how would I do it?</p>
  
  <p>I want to use as few libraries as possible, to understand it from the ground up, no matter how inefficient/messy the code is.</p>
  
  <p><strong>Update</strong> - by "without a library", I mean basically without any of the helper libraries that are available for X, and without a graphics toolkit.</p>
  
  <p><strong>Update</strong> - the answer is "through a unix socket", specifically /tmp/.X11-unix/X0 (on this machine at least, presumably for display 0).  Actually drawing a pixel is too complicated to get into in an answer here I think.</p>