InitAndStartDevices()

InitAndStartDevices() is a DIX function that is called immediately after InitInput() from the X server's main() function. Its purpose is to initialize each input device that was registered with AddInputDevice(), enable each input device that was successfully initialized, and create the list of enabled input devices.

Finally xf86AddEnabledDevice() is called to add the fd to the ones monitored by the event loop. It calls xf86InstallSIGIOHandler() which installs the signal handler via sigaddset(), sigaction() system calls. The installed signal is SIGIO, which is mainly generated when new data arrive at the socket.