Re:“POSIX advisory locks are broken by design”
by kazinator on Tuesday July 24, 2018 @08:42PM
(#17606105)
Some of them turned out to be hyper-corrective duds, like readdir_r. No need for that one, since the buffer it needs can be allocated in the DIR object. You'd never want multiple threads concurrently doing readdir_r from the same DIR stream; there is no credible use case for it.
(Or, maybe, optimization? Since it can store the dirent-s directly into some space designated by the caller, eliminating a copy operation from a program that wants to retain all those dirent-s.)
[ Parent
| on HN ]
Re:“POSIX advisory locks are broken by design”
by throwaway76543 on Tuesday July 24, 2018 @09:04PM
(#17606210)
Is this because, as I recall, a DIR object is opaque while a FILE is not? Allowing the former to be expanded without breaking the API?
edit: Nevermind, that shouldn't matter should it? The important thing is that they're both by reference.
Re:“POSIX advisory locks are broken by design”
by loeg on Tuesday July 24, 2018 @10:18PM
(#17606466)
FILE can be opaque. Some implementations made the (arguable) mistake of implementing e.g. fileno() as a macro that accesses FILE internals, and this means they can't change that layout without breaking libc ABI of existing programs. But you can implement all POSIX stdio FILE APIs with an opaque FILE.