summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Hornsey <hornseyf@objectcomputing.com>2020-12-05 19:40:08 -0600
committerFred Hornsey <hornseyf@objectcomputing.com>2020-12-05 19:54:35 -0600
commitcf1d8477fd0d0f49748f30939e999b8a94c527ad (patch)
tree8423a71e137ad327b38fbb2946c0e9f5caaa0811
parentc62ecd5955c1350fa25f95deb9bce2c81bc70f1c (diff)
downloadATCD-cf1d8477fd0d0f49748f30939e999b8a94c527ad.tar.gz
Remove ACE_OS::readdir_r
glibc (https://man7.org/linux/man-pages/man3/readdir_r.3.html) and FreeBSD libc (https://www.freebsd.org/cgi/man.cgi?query=readdir&sektion=3) have both marked `readdir_r` deprecated, mainly because it can't deal with arbitrarily long path names, so we should probably remove it. Also removed `ACE_Dirent::(ACE_DIRENT *, ACE_DIRENT **)` which used it. `ACE_LACKS_READDIR_R` will now always be defined.
-rw-r--r--ACE/NEWS4
-rw-r--r--ACE/ace/Dirent.h8
-rw-r--r--ACE/ace/Dirent.inl9
-rw-r--r--ACE/ace/OS_NS_dirent.cpp1
-rw-r--r--ACE/ace/OS_NS_dirent.h5
-rw-r--r--ACE/ace/OS_NS_dirent.inl30
-rw-r--r--ACE/ace/config-aix-5.x.h1
-rw-r--r--ACE/ace/config-cygwin32.h1
-rw-r--r--ACE/ace/config-face-conftest.h1
-rw-r--r--ACE/ace/config-freebsd.h2
-rw-r--r--ACE/ace/config-hpux-11.00.h2
-rw-r--r--ACE/ace/config-hurd.h2
-rw-r--r--ACE/ace/config-kfreebsd.h3
-rw-r--r--ACE/ace/config-linux-common.h2
-rw-r--r--ACE/ace/config-lynxos.h1
-rw-r--r--ACE/ace/config-macros.h5
-rw-r--r--ACE/ace/config-netbsd.h1
-rw-r--r--ACE/ace/config-openbsd.h1
-rw-r--r--ACE/ace/config-qnx.h1
-rw-r--r--ACE/ace/config-rtems.h2
-rw-r--r--ACE/ace/config-sunos5.5.h4
-rw-r--r--ACE/ace/config-vxworks6.4.h1
-rw-r--r--ACE/ace/config-win32-common.h1
-rw-r--r--ACE/ace/config-win32-interix.h1
24 files changed, 9 insertions, 80 deletions
diff --git a/ACE/NEWS b/ACE/NEWS
index 2abf96b287b..575be4992e0 100644
--- a/ACE/NEWS
+++ b/ACE/NEWS
@@ -11,6 +11,10 @@ USER VISIBLE CHANGES BETWEEN ACE-6.5.12 and ACE-7.0.0
or you can disable dlclose yourself by adding
`#define ACE_LACKS_DLCLOSE` to your ace/config.h file
+. Removed `ACE_OS::readdir_r`. `readdir_r` was marked as depracated in glibc
+ and FreeBSD libc. Also removed `ACE_Dirent::(ACE_DIRENT *, ACE_DIRENT **)`
+ which used it. `ACE_LACKS_READDIR_R` will now always be defined.
+
USER VISIBLE CHANGES BETWEEN ACE-6.5.11 and ACE-6.5.12
======================================================
diff --git a/ACE/ace/Dirent.h b/ACE/ace/Dirent.h
index 1981a32127e..65fe3049bb5 100644
--- a/ACE/ace/Dirent.h
+++ b/ACE/ace/Dirent.h
@@ -69,14 +69,6 @@ public:
*/
ACE_DIRENT *read (void);
- /**
- * Has the equivalent functionality as @c read() except that an
- * @a entry and @a result buffer must be supplied by the caller to
- * store the result.
- */
- int read (struct ACE_DIRENT *entry,
- struct ACE_DIRENT **result);
-
// = Manipulators.
/// Returns the current location associated with the directory
/// stream.
diff --git a/ACE/ace/Dirent.inl b/ACE/ace/Dirent.inl
index 3e420f1cc71..24befd9f975 100644
--- a/ACE/ace/Dirent.inl
+++ b/ACE/ace/Dirent.inl
@@ -52,15 +52,6 @@ ACE_Dirent::read (void)
return this->dirp_ ? ACE_OS::readdir (this->dirp_) : 0;
}
-ACE_INLINE int
-ACE_Dirent::read (struct ACE_DIRENT *entry,
- struct ACE_DIRENT **result)
-{
- return this->dirp_
- ? ACE_OS::readdir_r (this->dirp_, entry, result)
- : 0;
-}
-
ACE_INLINE void
ACE_Dirent::close (void)
{
diff --git a/ACE/ace/OS_NS_dirent.cpp b/ACE/ace/OS_NS_dirent.cpp
index 182667c7243..a5efb466c06 100644
--- a/ACE/ace/OS_NS_dirent.cpp
+++ b/ACE/ace/OS_NS_dirent.cpp
@@ -181,7 +181,6 @@ ACE_OS::scandir_emulation (const ACE_TCHAR *dirname,
int nfiles = 0;
int fail = 0;
- // @@ This code shoulduse readdir_r() rather than readdir().
for (dp = ACE_OS::readdir (dirp);
dp != 0;
dp = ACE_OS::readdir (dirp))
diff --git a/ACE/ace/OS_NS_dirent.h b/ACE/ace/OS_NS_dirent.h
index 8a35cd9f931..562018d0390 100644
--- a/ACE/ace/OS_NS_dirent.h
+++ b/ACE/ace/OS_NS_dirent.h
@@ -87,11 +87,6 @@ namespace ACE_OS {
struct ACE_DIRENT *readdir (ACE_DIR *);
ACE_NAMESPACE_INLINE_FUNCTION
- int readdir_r (ACE_DIR *dirp,
- struct ACE_DIRENT *entry,
- struct ACE_DIRENT **result);
-
- ACE_NAMESPACE_INLINE_FUNCTION
void rewinddir (ACE_DIR *);
ACE_NAMESPACE_INLINE_FUNCTION
diff --git a/ACE/ace/OS_NS_dirent.inl b/ACE/ace/OS_NS_dirent.inl
index 145ccb17970..f55ec13406e 100644
--- a/ACE/ace/OS_NS_dirent.inl
+++ b/ACE/ace/OS_NS_dirent.inl
@@ -65,36 +65,6 @@ readdir (ACE_DIR *d)
#endif /* ACE_HAS_DIRENT */
}
-ACE_INLINE int
-readdir_r (ACE_DIR *dirp,
- struct ACE_DIRENT *entry,
- struct ACE_DIRENT **result)
-{
-#if !defined (ACE_HAS_REENTRANT_FUNCTIONS)
- ACE_UNUSED_ARG (entry);
- // <result> has better not be 0!
- *result = ACE_OS::readdir (dirp);
- if (*result)
- return 0; // Keep iterating
- else
- return 1; // Oops, some type of error!
-#elif defined (ACE_HAS_DIRENT) && !defined (ACE_LACKS_READDIR_R)
-# if defined (ACE_HAS_3_PARAM_READDIR_R)
- return ::readdir_r (dirp, entry, result);
-# else
- // <result> had better not be 0!
- *result = ::readdir_r (dirp, entry);
- return 0;
-# endif /* sun */
-#else /* ! ACE_HAS_DIRENT || ACE_LACKS_READDIR_R */
- ACE_UNUSED_ARG (dirp);
- ACE_UNUSED_ARG (entry);
- ACE_UNUSED_ARG (result);
- ACE_NOTSUP_RETURN (0);
-
-#endif /* ACE_HAS_REENTRANT_FUNCTIONS */
-}
-
ACE_INLINE void
rewinddir (ACE_DIR *d)
{
diff --git a/ACE/ace/config-aix-5.x.h b/ACE/ace/config-aix-5.x.h
index 6fbc666de25..a21755e98ab 100644
--- a/ACE/ace/config-aix-5.x.h
+++ b/ACE/ace/config-aix-5.x.h
@@ -307,7 +307,6 @@
// AIX 5.1 has netinet/tcp.h
#undef ACE_LACKS_NETINET_TCP_H
-#define ACE_HAS_3_PARAM_READDIR_R
#define ACE_HAS_SCANDIR
#define ACE_SCANDIR_CMP_USES_VOIDPTR
#define ACE_SCANDIR_SEL_LACKS_CONST
diff --git a/ACE/ace/config-cygwin32.h b/ACE/ace/config-cygwin32.h
index fd1b067ea81..c93e64b1fab 100644
--- a/ACE/ace/config-cygwin32.h
+++ b/ACE/ace/config-cygwin32.h
@@ -90,7 +90,6 @@
#define ACE_HAS_POLL
#define ACE_HAS_SOCKADDR_MSG_NAME 1
#define ACE_LACKS_PRI_T 1
-#define ACE_HAS_3_PARAM_READDIR_R
// Compiler/platform supports alloca().
// Although ACE does have alloca() on this compiler/platform combination, it is
diff --git a/ACE/ace/config-face-conftest.h b/ACE/ace/config-face-conftest.h
index 4cf74e11318..17285562e35 100644
--- a/ACE/ace/config-face-conftest.h
+++ b/ACE/ace/config-face-conftest.h
@@ -16,7 +16,6 @@
#define ACE_THREAD_T_IS_A_STRUCT
#define ACE_DEFAULT_SEM_KEY {}
-#define ACE_HAS_3_PARAM_READDIR_R
#define ACE_HAS_CLOCK_GETTIME
#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
#define ACE_HAS_DIRENT
diff --git a/ACE/ace/config-freebsd.h b/ACE/ace/config-freebsd.h
index 34fb9c2f7e4..0c1fa8e7c56 100644
--- a/ACE/ace/config-freebsd.h
+++ b/ACE/ace/config-freebsd.h
@@ -25,7 +25,6 @@
# undef ACE_HAS_PENTIUM
#endif /* ACE_HAS_PENTIUM */
-#define ACE_HAS_3_PARAM_READDIR_R
#define ACE_HAS_3_PARAM_WCSTOK
#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
#define ACE_HAS_ALLOCA
@@ -133,7 +132,6 @@
# define ACE_LACKS_SIGSET
# define ACE_LACKS_SIGSET_T
# define ACE_LACKS_RWLOCK_T
-# define ACE_LACKS_READDIR_R
# define ACE_LACKS_SETSCHED
# define ACE_LACKS_PTHREAD_THR_SIGSETMASK
# define ACE_LACKS_UCONTEXT_H
diff --git a/ACE/ace/config-hpux-11.00.h b/ACE/ace/config-hpux-11.00.h
index 48829300ee3..23d754068db 100644
--- a/ACE/ace/config-hpux-11.00.h
+++ b/ACE/ace/config-hpux-11.00.h
@@ -340,8 +340,6 @@
# define ACE_HAS_3_PARAM_WCSTOK
#endif
-#define ACE_HAS_3_PARAM_READDIR_R
-
#define ACE_LACKS_STRUCT_LIFNUM
//////////////////////////////////////////////////////////////////////////
diff --git a/ACE/ace/config-hurd.h b/ACE/ace/config-hurd.h
index 394e6dcd46b..7659d7d3b33 100644
--- a/ACE/ace/config-hurd.h
+++ b/ACE/ace/config-hurd.h
@@ -119,8 +119,6 @@
#define ACE_HAS_3_PARAM_WCSTOK
-#define ACE_HAS_3_PARAM_READDIR_R
-
#if !defined (ACE_DEFAULT_BASE_ADDR)
# define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000)
#endif /* ! ACE_DEFAULT_BASE_ADDR */
diff --git a/ACE/ace/config-kfreebsd.h b/ACE/ace/config-kfreebsd.h
index 86b594e8a7f..1c043cf0cf5 100644
--- a/ACE/ace/config-kfreebsd.h
+++ b/ACE/ace/config-kfreebsd.h
@@ -11,9 +11,6 @@
/* Uses ctime_r & asctime_r with only two parameters vs. three. */
#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R 1
-/* Define to 1 if platform has 3 parameter readdir_r() */
-#define ACE_HAS_3_PARAM_READDIR_R 1
-
/* Define to 1 if platform has 3 parameter wcstok() */
#define ACE_HAS_3_PARAM_WCSTOK 1
diff --git a/ACE/ace/config-linux-common.h b/ACE/ace/config-linux-common.h
index 06b9e3587f7..23e0f579594 100644
--- a/ACE/ace/config-linux-common.h
+++ b/ACE/ace/config-linux-common.h
@@ -101,8 +101,6 @@
#define ACE_HAS_3_PARAM_WCSTOK
-#define ACE_HAS_3_PARAM_READDIR_R
-
#define ACE_HAS_ALLOCA
// Compiler/platform has <alloca.h>
diff --git a/ACE/ace/config-lynxos.h b/ACE/ace/config-lynxos.h
index 35d5be315f6..74edb63bd1d 100644
--- a/ACE/ace/config-lynxos.h
+++ b/ACE/ace/config-lynxos.h
@@ -32,7 +32,6 @@
#endif /* __x86__ || __powerpc__ */
#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
-#define ACE_HAS_3_PARAM_READDIR_R
#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
#define ACE_HAS_ALLOCA
#define ACE_HAS_ALLOCA_H
diff --git a/ACE/ace/config-macros.h b/ACE/ace/config-macros.h
index 36c7ce61e2d..528f4451497 100644
--- a/ACE/ace/config-macros.h
+++ b/ACE/ace/config-macros.h
@@ -721,4 +721,9 @@ extern "C" u_long CLS##_Export _get_dll_unload_policy (void) \
# define ACE_GCC_NO_RETURN
#endif
+// ACE_OS::readdir_r was removed in ACE7
+#ifndef ACE_LACKS_READDIR_R
+# define ACE_LACKS_READDIR_R
+#endif
+
#endif /* ACE_CONFIG_MACROS_H */
diff --git a/ACE/ace/config-netbsd.h b/ACE/ace/config-netbsd.h
index 0c828a6d1ac..e07fa2b5e63 100644
--- a/ACE/ace/config-netbsd.h
+++ b/ACE/ace/config-netbsd.h
@@ -26,7 +26,6 @@
#define ACE_HAS_GETTIMEOFDAY 1
#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R 1
#define ACE_HAS_3_PARAM_WCSTOK 1
-#define ACE_HAS_3_PARAM_READDIR_R 1
#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG 1
#define ACE_HAS_ALT_CUSERID 1
#define ACE_HAS_AUTOMATIC_INIT_FINI 1
diff --git a/ACE/ace/config-openbsd.h b/ACE/ace/config-openbsd.h
index e928905ad6f..43a9364314a 100644
--- a/ACE/ace/config-openbsd.h
+++ b/ACE/ace/config-openbsd.h
@@ -17,7 +17,6 @@
#include "ace/config-g++-common.h"
#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
-#define ACE_HAS_3_PARAM_READDIR_R
#define ACE_HAS_3_PARAM_WCSTOK
#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
#define ACE_HAS_ALLOCA
diff --git a/ACE/ace/config-qnx.h b/ACE/ace/config-qnx.h
index 6fd507bad03..4b9024b5c8e 100644
--- a/ACE/ace/config-qnx.h
+++ b/ACE/ace/config-qnx.h
@@ -45,7 +45,6 @@
/////////////////////////////////////////////////////////////////
#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
#define ACE_HAS_3_PARAM_WCSTOK
-#define ACE_HAS_3_PARAM_READDIR_R
#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
// Although ACE does have alloca() on this compiler/platform combination, it is
// disabled by default since it can be dangerous. Uncomment the following line
diff --git a/ACE/ace/config-rtems.h b/ACE/ace/config-rtems.h
index 5943d8237b6..6c4c2995dfb 100644
--- a/ACE/ace/config-rtems.h
+++ b/ACE/ace/config-rtems.h
@@ -78,7 +78,6 @@
#define ACE_HAS_ALT_CUSERID
#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
-#define ACE_HAS_3_PARAM_READDIR_R
#define ACE_HAS_CLOCK_GETTIME
#define ACE_HAS_CLOCK_SETTIME
#define ACE_HAS_DIRENT
@@ -108,7 +107,6 @@
#define ACE_LACKS_MSYNC
#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
#define ACE_LACKS_PTHREAD_THR_SIGSETMASK
-#define ACE_LACKS_READDIR_R
#define ACE_LACKS_READLINK
#define ACE_LACKS_READV
#define ACE_LACKS_RLIMIT
diff --git a/ACE/ace/config-sunos5.5.h b/ACE/ace/config-sunos5.5.h
index 9eb343cdef0..b738080b32f 100644
--- a/ACE/ace/config-sunos5.5.h
+++ b/ACE/ace/config-sunos5.5.h
@@ -344,10 +344,6 @@
#undef ACE_HAS_PRUSAGE_T
#endif /* (_LARGEFILE_SOURCE) || (_FILE_OFFSET_BITS==64) */
-#if defined (_POSIX_PTHREAD_SEMANTICS) || (_FILE_OFFSET_BITS == 64) || (_POSIX_C_SOURCE - 0 >= 199506L)
-# define ACE_HAS_3_PARAM_READDIR_R
-#endif
-
// Sum of the iov_len values can't be larger then SSIZE_MAX
#define ACE_HAS_SOCK_BUF_SIZE_MAX
diff --git a/ACE/ace/config-vxworks6.4.h b/ACE/ace/config-vxworks6.4.h
index 260c559a563..5b5541e5d5a 100644
--- a/ACE/ace/config-vxworks6.4.h
+++ b/ACE/ace/config-vxworks6.4.h
@@ -87,7 +87,6 @@
// OS-specific configuration
#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
-#define ACE_HAS_3_PARAM_READDIR_R
#define ACE_HAS_NET_IF_DL_H
#define ACE_HAS_NONCONST_GETBY
#define ACE_HAS_NONCONST_INET_ADDR
diff --git a/ACE/ace/config-win32-common.h b/ACE/ace/config-win32-common.h
index b3f8517d270..b771a6418dc 100644
--- a/ACE/ace/config-win32-common.h
+++ b/ACE/ace/config-win32-common.h
@@ -241,7 +241,6 @@
#define ACE_HAS_WIN32_GETVERSION
/* LACKS dir-related facilities */
-#define ACE_LACKS_READDIR_R
#define ACE_LACKS_REWINDDIR
#define ACE_LACKS_SEEKDIR
#define ACE_LACKS_TELLDIR
diff --git a/ACE/ace/config-win32-interix.h b/ACE/ace/config-win32-interix.h
index 2f603d55ef0..e3d54cb54e8 100644
--- a/ACE/ace/config-win32-interix.h
+++ b/ACE/ace/config-win32-interix.h
@@ -11,7 +11,6 @@
#define ACE_HAS_SYS_SIGINFO_H
#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
-#define ACE_HAS_3_PARAM_READDIR_R
#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
#define ACE_HAS_AUTOMATIC_INIT_FINI
#define ACE_HAS_BROKEN_T_ERROR