1/* 2 * Run a process to set /proc/usbled/state periodically (every 1 second for example) 3 * to the proper state. 4 */ 5#include <time.h> 6#include <unistd.h> 7#include <stdio.h> 8#include <stdlib.h> 9#include <string.h> 10#include <errno.h> 11#include <sys/time.h> 12#include <sys/types.h> 13#include <sys/socket.h> 14 15int main(int argc, char **argv) 16{ 17 struct timeval timo; 18 19 daemon(1, 1); 20 21 for (;;) { 22 timo.tv_sec = 1; 23 timo.tv_usec = 0; 24 select(1, NULL, NULL, NULL, &timo); 25 26 system("/sbin/ledcontrol -n usb -c green -s on"); 27 } 28 29 return 0; 30} 31 32