2017-06-06 13:43:24 UTC
1. The VMS CRTL getcwd() will not pass configure tests and will be
marked for replacement from gnulib.
2. The replacement from gnulib causes canonicalize-lgpl.c to fail
because the replacement only has 2 parameters, not three.
3. The replacement from gnulib also does not fix all the known ills in
I do not have fixes here for all of these issues, however this VMS
specific code in canonicalize-lgpl.c probably should just be removed.
--- /src_root/gnulib/lib/canonicalize-lgpl.c 2017-06-01 07:48:41 -0500
+++ /vms_root/gnulib/lib/canonicalize-lgpl.c 2017-06-06 08:01:11 -0500
@@ -59,12 +59,7 @@
# undef getcwd
-# ifdef VMS
- /* We want the directory in Unix syntax, not in VMS syntax. */
-# define __getcwd(buf, max) getcwd (buf, max, 0)
-# define __getcwd getcwd
+# define __getcwd getcwd
# define __getcwd(buf, max) getwd (buf)
This code is not needed anymore on VMS.
At VMS 5.5-2, VMS switched from VAXC/VAXCRTL to DECC/DECCRTL. GCC/VAX
can also use the DECCRTL non-prefixed shared library.
For the DECCRTL having the routines like getcwd() to return results in
Unix syntax instead of VMS syntax was a run time setting that the
program could do. Unfortunately there are two APIs for setting this
based on the version of VMS, which can be hidden with a macro.
Because some of these settings must be made before main() is called,
they are typically placed in a "lib$initialize" object module that
linked with the program. Typically this lib$initialize module is common
to a lot of programs, so application source code does not need to be
The DECCRTL getcwd() has two known bugs.
1. If buffer is NULL and size is 0, it access violates,
so a wrapper must detect this and allocate 4097 bytes on non-VAX
and 256 bytes on VAX.
2. If the directory is too long to fit into 4097 bytes, it must
be returned in VMS format, and then translated to Unix syntax.
Because of that, VMS is not currently using the GNULIB replacement getcwd.
At this time, I have not worked out what would be needed for GNULIB to
support replacing the DECCRTL getcwd, or providing a suitable
"lib$initialize" source module.