Hi, I have been working on a rewrite of procfs. I believe this new implementation is now ready for broader scrutiny, and I have retrofitted it into a git branch off the upstream Hurd repository.
- What it can do I have successfully tested it with most of the Linux procps utilities, as well as busybox and htop. It seems to be stable, not too slow, and it stays under 1.5M in resident size. - How you can try it out If you already have a hurd git clone, you can grab the branch with these commands: $ git remote add jk git://github.com/jeremie-koenig/hurd.git $ git fetch jk $ git checkout jk/procfs # Add "-b procfs" to create a local branch. A re-./configure will be necessary if you're using a separate build dir, otherwise "make procfs" should work right away. Once you've built it, you can start the translator (the option below will make sure that procfs plays nice with the Linux utilities): # settrans -ag /proc procfs/procfs --compatible NB: You will need the latest libps fixes or procfs will crash. If you're running Debian, upgrading the hurd package should be enough. Otherwise, you can use the libps from your build by using this command line instead: # settrans -ag /proc /usr/bin/env LD_LIBRARY_PATH=libps procfs/procfs -c - What's next? I would be glad to hear your comments or questions. In particular, my goal is to have this eventually merged into the upstream repository. Does it sound like a good idea? What do you think would be needed before this can happen? If you would like to read the code, here is a suggested order: * procfs.h, procfs.c, netfs.c: Implement a "wrapper" around libnetfs, to adapt its interface to our purposes. * proclist.c, proclist.h: Implement the list of pids. * dircat.h, dircat.c: Concatenates the contents of several directories (this is used to append the proclist above the regular files defined in rootdir.c) * procfs_dir.h, procfs_dir.c: Create directories from entry tables and callback functions. * rootdir.h, rootdir.c: Use procfs_dir above to implement the regular files in the root directory. * process.h, process.c: Implement process directories. In addition to grabbing a copy, the code can be browsed online here: http://github.com/jeremie-koenig/hurd The Hurd branch above has been cleaned up, but if you're interested in the "true" history, my old standalone repository is still lying around: http://github.com/jeremie-koenig/procfs Thanks, -- Jeremie Koenig <j...@jk.fr.eu.org> http://jk.fr.eu.org