Neal H. Walfield
Mon Jan 21 23:27:00 GMT 2008
At Mon, 21 Jan 2008 12:12:23 -0500,
Jeff Johnston wrote:
> The code that uses HAVE_DD_LOCK in libc/posix was taken from an existing
> code base (IIRC FreeBSD).
> The code in libc/posix is offered optionally to platforms. The dir
> family routines code there can be ignored if the platform already
> supplies these functions (via the flag HAVE_OPENDIR). If not
> short-circuited via HAVE_OPENDIR, a port must implement sys/dirent.h or
> else the code will not build to begin with as you are probably already
> well-aware. A platform can also build these and also override them in
> either the libc/machine/xxx or libc/sys/xxxx directories.
> So, if you choose to build the functions in libc/posix for your platform
> and you do not short-circuit them with HAVE_OPENDIR and do not override
> them yourself in your libc/sys directory and you support
> multi-threading, then you had either better implement the dd_lock field
> and set HAVE_DD_LOCK or else document that those functions are not
Does that mean you agree that !__SINGLE_THREAD__ implies HAVE_DD_LOCK?
(A simple fix would be s/HAVE_DD_LOCK/!__SINGLE_THREAD__/g.)
More information about the Newlib