Bruno Haible wrote:
John E. Malmberg wrote:
The open() would have to open or dup a file descriptor to the /dev/null
device to reserve a unique file descriptor, and then something needs to
map that file descriptor back to the pointer to the *DIR structure.
Do you need a pointer to the DIR structure, or only memorize the filename
of the directory? In the latter case, you can reuse most of the code from
gnulib/lib/fchdir.c.
Then the filename would have to be attached to the file descriptor
obtained by opening the null device.
Btw, does VMS have the dirfd function (as a function or as a macro)?
It should return the file descriptor to a directory that is "held inside"
a DIR structure.
There is no dirfd() function on VMS, and replacement function in
lib/dirfd is returning a -1.
The DIR structure on VMS is opaque to user code. It is unlikely that it
contains a file descriptor, as the VMS native I/O does not use file
descriptors.
Regards,
-John
[EMAIL PROTECTED]