summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowi@redhat.com>2017-06-14 15:26:38 -0500
committerYaakov Selkowitz <yselkowi@redhat.com>2017-06-19 08:16:42 -0500
commitf698efbce167768d9c859c07dd2bebc75ade7728 (patch)
tree0c10329624e134dc26fe4d534c99c01d820b2ac2
parent59e09b6419cdf400be3c73b61ac9c22560dc397e (diff)
downloadcygnal-f698efbce167768d9c859c07dd2bebc75ade7728.tar.gz
cygnal-f698efbce167768d9c859c07dd2bebc75ade7728.tar.bz2
cygnal-f698efbce167768d9c859c07dd2bebc75ade7728.zip
cygwin: export strverscmp, add versionsort
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
-rw-r--r--winsup/cygwin/common.din2
-rw-r--r--winsup/cygwin/include/cygwin/version.h3
-rw-r--r--winsup/cygwin/include/sys/dirent.h1
-rw-r--r--winsup/cygwin/release/2.8.12
-rw-r--r--winsup/cygwin/scandir.cc6
-rw-r--r--winsup/doc/posix.xml2
6 files changed, 15 insertions, 1 deletions
diff --git a/winsup/cygwin/common.din b/winsup/cygwin/common.din
index 75fe05c1f..93316532c 100644
--- a/winsup/cygwin/common.din
+++ b/winsup/cygwin/common.din
@@ -1396,6 +1396,7 @@ strtoull NOSIGFE
strtoull_l NOSIGFE
strtoumax = strtoull NOSIGFE
strupr NOSIGFE
+strverscmp NOSIGFE
strxfrm NOSIGFE
strxfrm_l NOSIGFE
swab NOSIGFE
@@ -1492,6 +1493,7 @@ vasprintf SIGFE
vdprintf SIGFE
verr SIGFE
verrx SIGFE
+versionsort NOSIGFE
vfiprintf SIGFE
vfork SIGFE
vfprintf SIGFE
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index c0254a8e0..bde358f72 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -476,12 +476,13 @@ details. */
309: Export getloadavg.
310: Export reallocarray.
311: Export __xpg_sigpause.
+ 312: Export strverscmp, versionsort.
Note that we forgot to bump the api for ualarm, strtoll, strtoull,
sigaltstack, sethostname. */
#define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 311
+#define CYGWIN_VERSION_API_MINOR 312
/* There is also a compatibity version number associated with the shared memory
regions. It is incremented when incompatible changes are made to the shared
diff --git a/winsup/cygwin/include/sys/dirent.h b/winsup/cygwin/include/sys/dirent.h
index 771f71620..049e87ad0 100644
--- a/winsup/cygwin/include/sys/dirent.h
+++ b/winsup/cygwin/include/sys/dirent.h
@@ -89,6 +89,7 @@ int alphasort (const struct dirent **__a, const struct dirent **__b);
int scandirat (int __dirfd, const char *__dir, struct dirent ***__namelist,
int (*select) (const struct dirent *),
int (*compar) (const struct dirent **, const struct dirent **));
+int versionsort (const struct dirent **__a, const struct dirent **__b);
#endif
#if __BSD_VISIBLE
diff --git a/winsup/cygwin/release/2.8.1 b/winsup/cygwin/release/2.8.1
index 1ebe7d839..d03f29647 100644
--- a/winsup/cygwin/release/2.8.1
+++ b/winsup/cygwin/release/2.8.1
@@ -5,6 +5,8 @@ What's new:
- New API: reallocarray
+- New API: strverscmp, versionsort.
+
What changed:
-------------
diff --git a/winsup/cygwin/scandir.cc b/winsup/cygwin/scandir.cc
index 1c324c196..d6ac64907 100644
--- a/winsup/cygwin/scandir.cc
+++ b/winsup/cygwin/scandir.cc
@@ -20,6 +20,12 @@ alphasort (const struct dirent **a, const struct dirent **b)
}
extern "C" int
+versionsort (const struct dirent **a, const struct dirent **b)
+{
+ return strverscmp ((*a)->d_name, (*b)->d_name);
+}
+
+extern "C" int
scandir (const char *dir,
struct dirent ***namelist,
int (*select) (const struct dirent *),
diff --git a/winsup/doc/posix.xml b/winsup/doc/posix.xml
index ced7e383d..7e28427b4 100644
--- a/winsup/doc/posix.xml
+++ b/winsup/doc/posix.xml
@@ -1367,6 +1367,7 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).</para>
strtoll_l
strtoul_l
strtoull_l
+ strverscmp
sysinfo
tdestroy
timegm
@@ -1377,6 +1378,7 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).</para>
vasnprintf
vasprintf
vasprintf_r
+ versionsort
wcsftime_l
wcstod_l
wcstof_l