From: VMware, Inc <> Date: Mon, 26 Jul 2010 19:23:51 +0000 (-0700) Subject: Remove GLIBC_VERSION_21 and _22 X-Git-Tag: 2010.07.25-280253~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=53f2e9563c5607a5261e6bc478cfd2711bf2dfda;p=thirdparty%2Fopen-vm-tools.git Remove GLIBC_VERSION_21 and _22 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 --- diff --git a/open-vm-tools/lib/auth/authPosix.c b/open-vm-tools/lib/auth/authPosix.c index 251672a4c..02141d7af 100644 --- a/open-vm-tools/lib/auth/authPosix.c +++ b/open-vm-tools/lib/auth/authPosix.c @@ -19,15 +19,7 @@ #include #include #include - -#ifndef GLIBC_VERSION_22 -#define __USE_XOPEN -#endif -#include // for access, etc. - -#if (defined(GLIBC_VERSION_22) && !defined(USING_AUTOCONF)) || defined(HAVE_CRYPT_H) -#include -#endif +#include // for access, crypt, etc. #include "vmware.h" #include "vm_version.h" diff --git a/open-vm-tools/lib/file/fileIO.c b/open-vm-tools/lib/file/fileIO.c index 15fe09f82..0da2b980e 100644 --- a/open-vm-tools/lib/file/fileIO.c +++ b/open-vm-tools/lib/file/fileIO.c @@ -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__) /* *---------------------------------------------------------------------- diff --git a/open-vm-tools/lib/file/fileIOPosix.c b/open-vm-tools/lib/file/fileIOPosix.c index 2fabb407a..bf37e2ecf 100644 --- a/open-vm-tools/lib/file/fileIOPosix.c +++ b/open-vm-tools/lib/file/fileIOPosix.c @@ -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) */ /* diff --git a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c index cae586276..bd102316c 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c @@ -95,21 +95,6 @@ # 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); diff --git a/open-vm-tools/lib/include/sigPosixRegs.h b/open-vm-tools/lib/include/sigPosixRegs.h index 6bcb3e8b0..9c54efbf7 100644 --- a/open-vm-tools/lib/include/sigPosixRegs.h +++ b/open-vm-tools/lib/include/sigPosixRegs.h @@ -56,27 +56,15 @@ # 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 @@ -103,27 +91,15 @@ # 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 diff --git a/open-vm-tools/lib/include/str.h b/open-vm-tools/lib/include/str.h index 81be1566d..2a0fc1476 100644 --- a/open-vm-tools/lib/include/str.h +++ b/open-vm-tools/lib/include/str.h @@ -44,7 +44,7 @@ #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" -#if defined(GLIBC_VERSION_22) +#if defined(__linux__) #include #elif defined(_WIN32) #include @@ -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__) /* diff --git a/open-vm-tools/lib/misc/codesetOld.c b/open-vm-tools/lib/misc/codesetOld.c index 7269c1e19..cdf567968 100644 --- a/open-vm-tools/lib/misc/codesetOld.c +++ b/open-vm-tools/lib/misc/codesetOld.c @@ -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); diff --git a/open-vm-tools/lib/misc/hostinfoPosix.c b/open-vm-tools/lib/misc/hostinfoPosix.c index 0701a0a0f..6ce1fb6db 100644 --- a/open-vm-tools/lib/misc/hostinfoPosix.c +++ b/open-vm-tools/lib/misc/hostinfoPosix.c @@ -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; diff --git a/open-vm-tools/lib/misc/idLinux.c b/open-vm-tools/lib/misc/idLinux.c index e47707b0f..b9e495650 100644 --- a/open-vm-tools/lib/misc/idLinux.c +++ b/open-vm-tools/lib/misc/idLinux.c @@ -38,26 +38,6 @@ #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. diff --git a/open-vm-tools/lib/string/str.c b/open-vm-tools/lib/string/str.c index 801d1dadd..a00e3fdbf 100644 --- a/open-vm-tools/lib/string/str.c +++ b/open-vm-tools/lib/string/str.c @@ -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