]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Remove GLIBC_VERSION_21 and _22
authorVMware, Inc <>
Mon, 26 Jul 2010 19:23:51 +0000 (12:23 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Mon, 26 Jul 2010 19:23:51 +0000 (12:23 -0700)
Glibc version 2.2 dates from RedHat 7.1 (released 2001).
Any code we have on modern branches no longer works on
things that old (guest tools are frozen, hosted lost
support long ago).

This change removes a bunch of GLIBC_VERSION checks
from our code.

NOTE: GLIBC_VERSION_23 checks are still in use; we
support such old OSes (RH7.1-3, RH8.0, RHEL2.x) with
the guest tools build.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/auth/authPosix.c
open-vm-tools/lib/file/fileIO.c
open-vm-tools/lib/file/fileIOPosix.c
open-vm-tools/lib/hgfsServer/hgfsServerLinux.c
open-vm-tools/lib/include/sigPosixRegs.h
open-vm-tools/lib/include/str.h
open-vm-tools/lib/misc/codesetOld.c
open-vm-tools/lib/misc/hostinfoPosix.c
open-vm-tools/lib/misc/idLinux.c
open-vm-tools/lib/string/str.c

index 251672a4c6998c2a474044bfd4a22a8126306a45..02141d7af313058af766d6c51e268d41066b9410 100644 (file)
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-
-#ifndef GLIBC_VERSION_22
-#define __USE_XOPEN
-#endif
-#include <unistd.h> // for access, etc.
-
-#if (defined(GLIBC_VERSION_22) && !defined(USING_AUTOCONF)) || defined(HAVE_CRYPT_H)
-#include <crypt.h>
-#endif
+#include <unistd.h> // for access, crypt, etc.
 
 #include "vmware.h"
 #include "vm_version.h"
index 15fe09f820b1b949c79403d2d61b41c0d2fdec44..0da2b980eb3ddfde494ac2c48d2ac8848a55228f 100644 (file)
@@ -373,7 +373,7 @@ FileIO_Filename(FileIODescriptor *fd)  // IN:
 }
 
 
-#if defined(_WIN32) || defined(GLIBC_VERSION_21) || defined(__APPLE__) || \
+#if defined(_WIN32) || defined(__linux__) || defined(__APPLE__) || \
     defined(__FreeBSD__)
 /*
  *----------------------------------------------------------------------
index 2fabb407ac2889a7fb4d736b5bab13c36a6d6527..bf37e2ecfc927bec6df6acebc27757f75aea91a4 100644 (file)
@@ -1604,7 +1604,7 @@ FileIO_Writev(FileIODescriptor *fd,  // IN:
 }
 
 
-#if defined(GLIBC_VERSION_21) || defined(__APPLE__) || defined(__FreeBSD__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
 
 /*
  *----------------------------------------------------------------------
@@ -1784,7 +1784,7 @@ exit:
 
    return fret;
 }
-#endif /* defined(GLIBC_VERSION_21) || defined(__APPLE__) || defined(__FreeBSD__) */
+#endif /* defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) */
 #endif /* !defined(N_PLAT_NLM) */
 
 /*
index cae586276ae2ce4e04c15759641094452e189db5..bd102316ccb7b0d136ae05a28281b7aae349a392 100644 (file)
 #   include "sig.h"
 #endif
 
-#if defined(linux) && !defined(GLIBC_VERSION_21)
-/*
- * Implements the system call (it is not wrapped by glibc 2.1.1)
- */
-static INLINE int
-_llseek(unsigned int fd,
-        unsigned long offset_high,
-        unsigned long offset_low,
-        loff_t *result,
-        unsigned int whence)
-{
-   return syscall(SYS__llseek, fd, offset_high, offset_low, result, whence);
-}
-#endif
-
 /*
  * On Linux, we must wrap getdents64, as glibc does not wrap it for us. We use getdents64
  * (rather than getdents) because with the latter, we'll get 64-bit offsets and inode
@@ -3377,7 +3362,7 @@ HgfsPlatformReadFile(HgfsHandle file,             // IN: Hgfs file handle
       return EBADF;
    }
 
-#if defined(GLIBC_VERSION_21) || defined(__APPLE__)
+#if defined(__linux__) || defined(__APPLE__)
    /* Read from the file. */
    if (sequentialOpen) {
       error = read(fd, payload, requiredSize);
@@ -3480,7 +3465,7 @@ HgfsPlatformWriteFile(HgfsHandle file,             // IN: Hgfs file handle
       return EBADF;
    }
 
-#if defined(GLIBC_VERSION_21) || defined(__APPLE__)
+#if defined(__linux__) || defined(__APPLE__)
    /* Write to the file. */
    if (sequentialOpen) {
       error = write(fd, payload, requiredSize);
index 6bcb3e8b01914b9883504992de49174933809d9b..9c54efbf7d46d7d3d28659470067f99b94de1312 100644 (file)
 #    define REG_R14 GNU_REG_R14
 #    define REG_R15 GNU_REG_R15
 #  elif defined(__i386__)
-#    if GLIBC_VERSION_22
-#       define REG_EAX GNU_REG_EAX
-#       define REG_EBX GNU_REG_EBX
-#       define REG_ECX GNU_REG_ECX
-#       define REG_EDX GNU_REG_EDX
-#       define REG_ESI GNU_REG_ESI
-#       define REG_EDI GNU_REG_EDI
-#       define REG_ESP GNU_REG_ESP
-#       define REG_EBP GNU_REG_EBP
-#       define REG_EIP GNU_REG_EIP
-#    else
-#       define EAX GNU_REG_EAX
-#       define EBX GNU_REG_EBX
-#       define ECX GNU_REG_ECX
-#       define EDX GNU_REG_EDX
-#       define ESI GNU_REG_ESI
-#       define EDI GNU_REG_EDI
-#       define ESP GNU_REG_ESP
-#       define EBP GNU_REG_EBP
-#       define EIP GNU_REG_EIP
-#    endif
+#    define REG_EAX GNU_REG_EAX
+#    define REG_EBX GNU_REG_EBX
+#    define REG_ECX GNU_REG_ECX
+#    define REG_EDX GNU_REG_EDX
+#    define REG_ESI GNU_REG_ESI
+#    define REG_EDI GNU_REG_EDI
+#    define REG_ESP GNU_REG_ESP
+#    define REG_EBP GNU_REG_EBP
+#    define REG_EIP GNU_REG_EIP
 #  endif
 #endif
 
 #    undef REG_R14
 #    undef REG_R15
 #  elif defined(__i386__)
-#    if GLIBC_VERSION_22
-#       undef REG_EAX
-#       undef REG_EBX
-#       undef REG_ECX
-#       undef REG_EDX
-#       undef REG_ESI
-#       undef REG_EDI
-#       undef REG_ESP
-#       undef REG_EBP
-#       undef REG_EIP
-#    else
-#       undef EAX
-#       undef EBX
-#       undef ECX
-#       undef EDX
-#       undef ESI
-#       undef EDI
-#       undef ESP
-#       undef EBP
-#       undef EIP
-#    endif
+#    undef REG_EAX
+#    undef REG_EBX
+#    undef REG_ECX
+#    undef REG_EDX
+#    undef REG_ESI
+#    undef REG_EDI
+#    undef REG_ESP
+#    undef REG_EBP
+#    undef REG_EIP
 #  endif
 #endif
 
index 81be1566d999255a4d12170abb9dfd3969ddb38c..2a0fc14760d11833456a4a50800f4c7f3ba219c8 100644 (file)
@@ -44,7 +44,7 @@
 #define INCLUDE_ALLOW_VMCORE
 #include "includeCheck.h"
 
-#if defined(GLIBC_VERSION_22)
+#if defined(__linux__)
 #include <wchar.h>
 #elif defined(_WIN32)
 #include <tchar.h>
@@ -108,7 +108,7 @@ EXTERN char *Str_SafeAsprintf(size_t *length,
 EXTERN char *Str_SafeVasprintf(size_t *length, const char *format,
                                va_list arguments);
 
-#if defined(_WIN32) || defined(GLIBC_VERSION_22) // {
+#if defined(_WIN32) || defined(__linux__) // {
 
 /*
  * wchar_t versions
@@ -167,7 +167,7 @@ unsigned char *Str_Mbscat(char *buf, const char *src,
 #endif
 #endif
 
-#endif // } defined(_WIN32) || defined(GLIBC_VERSION_22)
+#endif // } defined(_WIN32) || defined(__linux__)
 
 
 /*
index 7269c1e192a02921d6ef4aaa4aa40d74b63e4fbe..cdf5679688559c716493555a79f1265f6eb65a87 100644 (file)
@@ -1001,7 +1001,7 @@ CodeSetOld_GenericToGenericDb(char const *codeIn,   // IN:
        * change bufIn so a simple cast is safe. --plangdale
        */
 
-#if defined(GLIBC_VERSION_22) || (!defined(__i386__) && !defined(__x86_64__))
+#ifdef __linux__
       status = iconv(cd, (char **)&bufIn, &sizeIn, &out, &outLeft);
 #else
       status = iconv(cd, &bufIn, &sizeIn, &out, &outLeft);
index 0701a0a0f4e6b5cd09a5cd6abaa10562ca9c9281..6ce1fb6dbb85a083290c0573bcb9bfbe695015bd 100644 (file)
@@ -1394,8 +1394,7 @@ HostinfoGetLoadAverage(float *avg0,  // IN/OUT:
                        float *avg1,  // IN/OUT:
                        float *avg2)  // IN/OUT:
 {
-   /* getloadavg(3) was introduced with glibc 2.2 */
-#if defined(GLIBC_VERSION_22) || defined(__APPLE__)
+#if defined(__linux__) || defined(__APPLE__)
    double avg[3];
    int res;
 
index e47707b0fc2d154a357ff6f584c89afb44758760..b9e495650a7dba59f98801f89d701e6a23deb285 100644 (file)
 #include "vm_atomic.h"
 
 #if defined(__linux__)
-#if !defined(GLIBC_VERSION_21) && (defined(__i386__) || defined(__x86_64__))
-/*
- * SYS_ constants for glibc 2.0, some of which may already be defined on
- * some of those older systems.
- */
-
-#ifndef SYS_setresuid
-#define SYS_setresuid          164
-#endif
-#ifndef SYS_setresgid
-#define SYS_setresgid          170
-#endif
-#define SYS_setreuid32         203
-#define SYS_setregid32         204
-#define SYS_setresuid32        208
-#define SYS_setresgid32        210
-#define SYS_setuid32           213
-#define SYS_setgid32           214
-#endif // ifndef GLIBC_VERSION_21
-
 /*
  * 64bit linux has no 16 bit versions and
  * the 32bit versions have the un-suffixed names.
index 801d1dadd6e63c73a6d36c626ada00d802aa1c8c..a00e3fdbfce38e1f2827071b69883a9b4216655a 100644 (file)
@@ -64,10 +64,10 @@ extern int vasprintf(char **ptr, const char *f, va_list arg);
  * for x86, so we just assume it's already there.)
  *
  * XXX Str_Vsnwprintf and friends are still protected by _WIN32 and
- * GLIBC_VERSION_22.  I.e., even though they should be able to work on
+ * glibc >= 2.2.  I.e., even though they should be able to work on
  * FreeBSD 5.0+ and Solaris 8+, they aren't made available there.
  */
-#   if !(defined(GLIBC_VERSION_22) ||                                   \
+#   if !(defined(__linux__) ||                                          \
          (defined(__FreeBSD__) && (__FreeBSD_version >= 500000)) ||     \
          defined(sun))
 extern int vswprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, va_list args);
@@ -645,7 +645,7 @@ Str_SafeVasprintf(size_t *length,       // OUT
    return StrVasprintfInternal(length, format, arguments, TRUE);
 }
 
-#if defined(_WIN32) || defined(GLIBC_VERSION_22)
+#if defined(_WIN32) || defined(__linux__)
 
 /*
  *----------------------------------------------------------------------
@@ -1175,7 +1175,7 @@ Str_SafeVaswprintf(size_t *length,         // OUT
    return StrVaswprintfInternal(length, format, arguments, TRUE);
 }
 
-#endif // defined(_WIN32) || defined(GLIBC_VERSION_22)
+#endif // defined(_WIN32) || defined(__linux__)
 
 #ifndef _WIN32