Once again, reminds me of my /dev/ps driver, which had the
following ioctls:
#define DEVPS_GET_NUM_PIDS 0xeba1 /* Get a list of all PIDs */
#define DEVPS_GET_PID_LIST 0xeba2 /* Get a list of all PIDs */
#define DEVPS_GET_PID_INFO 0xeba3 /* Get info about a specific PID */
#define DEVPS_GET_CURRENT_PID 0xeba4 /* Get the current PID */
So a user spave ps app would call DEVPS_GET_NUM_PIDS to find out
how many processes there are, then it would allocate some memory
(and would allocate a some extra just in case some new processes
were to start up, the kernel would truncate things if we gave it
too little space) . Then ps would grab the pid list by calling
the DEVPS_GET_PID_LIST ioctl, and then for each item in the list
it would call DEVPS_GET_PID_INFO. Assuming that call was
successful, ps would print out a line of output and move on to
the next pid in the list.
The idea need not be implemented without using ioctl and without
using binary structures (which were the things Linus objected to)
The same thing could be easily done using flat ascii...
-Erik
-- Erik B. Andersen http://codepoet-consulting.com/ --This message was written using 73% post-consumer electrons-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/