if an application built after API version 334 loads uname dynamically,
it actually gets the old uname, rather than the new uname_x. Fix this by
checking the apps API version in uname and call uname_x instead, if it's
a newer app.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
#define CYGWIN_VERSION_CHECK_FOR_EXTRA_TM_MEMBERS \
(CYGWIN_VERSION_USER_API_VERSION_COMBINED >= 272)
+#define CYGWIN_VERSION_CHECK_FOR_UNAME_X \
+ (CYGWIN_VERSION_USER_API_VERSION_COMBINED >= 335)
+
#define CYGWIN_VERSION_CYGWIN_CONV 181
/* API_MAJOR 0.0: Initial version. API_MINOR changes:
extern "C" int
uname (struct utsname *in_name)
{
+ /* This occurs if the application fetches the uname symbol dynamically.
+ We must call uname_x for newer API versions, otherwise the idea of
+ struct utsname doesn't match. */
+ if (CYGWIN_VERSION_CHECK_FOR_UNAME_X)
+ return uname_x (in_name);
+
struct old_utsname *name = (struct old_utsname *) in_name;
+
__try
{
char *snp = strstr (cygwin_version.dll_build_date, "SNP");