+2019-09-18 Frederic Konrad <konrad@adacore.com>
+
+ * adaint.c: Include dosFsLib.h and vwModNum.h for VxWorks 6.
+ (__gnat_rename): Map S_dosFsLib_FILE_NOT_FOUND to ENOENT.
+
2019-09-18 Steve Baird <baird@adacore.com>
* freeze.adb (Freeze_Object_Declaration): Do not call
(such as chmod) are only available on VxWorks 6. */
#include "version.h"
+/* vwModNum.h and dosFsLib.h are needed for the VxWorks 6 rename workaround.
+ See below. */
+#if (_WRS_VXWORKS_MAJOR == 6)
+#include <vwModNum.h>
+#include <dosFsLib.h>
+#endif /* 6.x */
#endif /* VxWorks */
#if defined (__APPLE__)
S2WSC (wto, to, GNAT_MAX_PATH_LEN);
return _trename (wfrom, wto);
}
+#elif defined (__vxworks) && (_WRS_VXWORKS_MAJOR == 6)
+ {
+ /* When used on a dos filesystem under VxWorks 6.9 rename will trigger a
+ S_dosFsLib_FILE_NOT_FOUND errno when the file is not found. Let's map
+ that to ENOENT so Ada.Directory.Rename can detect that and raise the
+ Name_Error exception. */
+ int ret = rename (from, to);
+
+ if (ret && (errno == S_dosFsLib_FILE_NOT_FOUND))
+ {
+ errno = ENOENT;
+ }
+ return ret;
+ }
#else
return rename (from, to);
#endif