title: writing to /dev/uinput (on ubuntu 12.04)
body: <p>I'm developing a little program that creates virtual joysticks on linux, with a python front end. It is a fork of <a href="https://github.com/ml32/Linux-Virtual-Joystick" rel="nofollow">Linux-Virtual-Joystick</a>.</p>
  
  <p>I need to write to dev/uinput in order to create the user-defined joystick.
  The file is opened with O_RDWR (I temporarily added read/write access others for the file whilst debugging). When I do</p>
  
  <pre><code>write(uifd, &amp;uidev, sizeof(uinput_user_dev));
  </code></pre>
  
  <p>it returns -1 and sets errno to 22(EINVAL). The arguments are correct, and the file was successfully opened. </p>
  
  <p>Did anyone else encounter this problem? I shelved the project for about a month, but I remember that it worked in the last version of Ubuntu.</p>
  
  <p><strong>Update:</strong> uinput works on ubuntu 12.10</p>