Older blog entries for cmc (starting at number 2)

I've just completed a small modification to the patch for fdesc that inlined the fdesc_attr() function into the fdesc_getattr() function since that's now the only use. The main benefit of this is that originally the code that grabbed attributes for stat(2) was in there, and it was not passed the vnode passed originally to fdesc_getattr().

Now open sockets and pipes are properly given inode numbers based on the number assigned to them by fdesc_lookup, which is unique for each file descriptor (it is FD_DESC+fileno). The patch is looking pretty good and I believe I've addressed all of the issues I can remember right now.

The patch is available here and will be until it is committed.

I've changed the design of fdesc to be mounted on /dev/fd instead of being a union mount on /dev. Since we already have the nodes that fdesc duplicates (std{in,out,err} and tty), there's no reason to bloat and complicate the code by reproducing them. The code itself looks clean, but there's still the issue of making a unique inode number for each file. This puts the code in a generally much more readable state as well.

Since I have not really made any journal entries, I believe I should go ahead and describe what my current project is. At this point, I am working on repairing FreeBSD's fdesc file system.

What is fdesc? Fdesc is a file system which basically gives you information in file system form about what files (i.e. sockets, pipes, etc.) you have open. Since devfs likely won't be available for a while, I decided I'd make this something to work on. Currently the FS data such as the date, owner and permissions in fdesc ``as-is'' is set inaccurately (or to zero).

Currently, FreeBSD uses a directory, /dev/fd, which is basically full of a bunch of device nodes that really tell you absolutely nothing about your open files. However, with what magic I'm working with at this point:

$ ls -l /dev/fd 3>/dev/tcp/ | tee /dev/null
total 0
crw-------  1 chris  tty      5,   3 Mar 29 06:14 0
prw-rw-rw-  1 chris  chris         0 Mar 29 06:14 1
crw-------  1 chris  tty      5,   3 Mar 29 06:14 2
srw-rw-rw-  1 chris  chris         0 Mar 29 06:14 3
dr--r--r--  2 root   wheel       512 Mar 27 06:03 4
dr--r--r--  2 root   wheel       512 Mar 27 06:03 5

Note: The /dev/tcp/addr/port-no is a feature of the Korn shell and is in no way related to my fdesc work (other than being an awfully convenient way to make a socket in the shell).

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!