User: Password:
|
|
Subscribe / Log in / New account

Ghosts of Unix past, part 3: Unfixable designs

Ghosts of Unix past, part 3: Unfixable designs

Posted Nov 17, 2010 23:14 UTC (Wed) by Yorick (subscriber, #19241)
Parent article: Ghosts of Unix past, part 3: Unfixable designs

The articles in this series progress very neatly from minor inelegancies to serious mistakes. We can only speculate what unspeakable horrors the next installment will feature for our entertainment. The TTY system, perhaps? STREAMS? Or maybe telldir/seekdir?


(Log in to post comments)

telldir/seekdir

Posted Nov 18, 2010 16:36 UTC (Thu) by pr1268 (subscriber, #24648) [Link]

Just curious, why do you consider telldir()/seekdir() to be "unspeakable horrors"? Their interfaces are simple and straightforward, and even their manual pages are easy to read/understand.

telldir/seekdir

Posted Nov 18, 2010 17:19 UTC (Thu) by foom (subscriber, #14868) [Link]

Because of the requirements they impose on filesystem implementations: what happens when you add/delete files from the directory you have open. And with a saved position from "telldir"? How can you stuff enough information into a "long" to allow a stable iteration position in the face of concurrent modification of the directory contents? It's just a pain in the ass to implement.

And it's so tricky and so unused, that the implementation was actually horribly broken from its inception in BSD until 2008, 25 years later!

http://www.vnode.ch/fixing_seekdir

telldir/seekdir

Posted Nov 18, 2010 17:31 UTC (Thu) by pr1268 (subscriber, #24648) [Link]

Ahh yes, I almost forgot about those cases. In fact, there was some discussion here on LWN about the difficulties of these in the context of UnionFS. Thanks for jogging my memory.


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds