Alexandre Julliard : configure: Get rid of the replacement function for gettid.

Alexandre Julliard julliard at winehq.org
Mon Dec 27 10:03:57 CST 2010


Module: wine
Branch: master
Commit: 13eafa047de1cd87dd81f0b3de19134d803e8eed
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=13eafa047de1cd87dd81f0b3de19134d803e8eed

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Dec 27 12:08:37 2010 +0100

configure: Get rid of the replacement function for gettid.

---

 configure             |    1 -
 configure.ac          |    1 -
 include/config.h.in   |    3 ---
 include/wine/port.h   |    4 ----
 libs/port/Makefile.in |    1 -
 libs/port/gettid.c    |   38 --------------------------------------
 loader/main.c         |    5 ++++-
 7 files changed, 4 insertions(+), 49 deletions(-)

diff --git a/configure b/configure
index f8aa35e..0fde42b 100755
--- a/configure
+++ b/configure
@@ -12753,7 +12753,6 @@ for ac_func in \
 	getopt_long \
 	getpagesize \
 	getpwuid \
-	gettid \
 	gettimeofday \
 	getuid \
 	kqueue \
diff --git a/configure.ac b/configure.ac
index 5e1810f..5fdcd18 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1904,7 +1904,6 @@ AC_CHECK_FUNCS(\
 	getopt_long \
 	getpagesize \
 	getpwuid \
-	gettid \
 	gettimeofday \
 	getuid \
 	kqueue \
diff --git a/include/config.h.in b/include/config.h.in
index 4fa566d..c7bf082 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -226,9 +226,6 @@
 /* Define to 1 if you have the `getservbyport' function. */
 #undef HAVE_GETSERVBYPORT
 
-/* Define to 1 if you have the `gettid' function. */
-#undef HAVE_GETTID
-
 /* Define to 1 if you have the `gettimeofday' function. */
 #undef HAVE_GETTIMEOFDAY
 
diff --git a/include/wine/port.h b/include/wine/port.h
index 180a6d8..8281653 100644
--- a/include/wine/port.h
+++ b/include/wine/port.h
@@ -248,10 +248,6 @@ int futimes(int fd, const struct timeval *tv);
 size_t getpagesize(void);
 #endif  /* HAVE_GETPAGESIZE */
 
-#ifndef HAVE_GETTID
-pid_t gettid(void);
-#endif /* HAVE_GETTID */
-
 #ifndef HAVE_ISINF
 int isinf(double x);
 #endif
diff --git a/libs/port/Makefile.in b/libs/port/Makefile.in
index 1609aca..f2f6db0 100644
--- a/libs/port/Makefile.in
+++ b/libs/port/Makefile.in
@@ -9,7 +9,6 @@ C_SRCS = \
 	getopt.c \
 	getopt1.c \
 	getpagesize.c \
-	gettid.c \
 	interlocked.c \
 	isinf.c \
 	isnan.c \
diff --git a/libs/port/gettid.c b/libs/port/gettid.c
deleted file mode 100644
index fd7a353..0000000
--- a/libs/port/gettid.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * gettid function
- *
- * Copyright 2003 Alexandre Julliard
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "config.h"
-#include "wine/port.h"
-
-#ifndef HAVE_GETTID
-
-pid_t gettid(void)
-{
-#if defined(__linux__) && defined(__i386__)
-    pid_t ret;
-    __asm__("int $0x80" : "=a" (ret) : "0" (224) /* SYS_gettid */);
-    if (ret < 0) ret = -1;
-    return ret;
-#else
-    return -1;  /* FIXME */
-#endif
-}
-
-#endif  /* HAVE_GETTID */
diff --git a/loader/main.c b/loader/main.c
index 9fe5e59..e19b1bb 100644
--- a/loader/main.c
+++ b/loader/main.c
@@ -30,6 +30,9 @@
 #ifdef HAVE_SYS_RESOURCE_H
 # include <sys/resource.h>
 #endif
+#ifdef HAVE_SYS_SYSCALL_H
+# include <sys/syscall.h>
+#endif
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
@@ -104,7 +107,7 @@ static void check_command_line( int argc, char *argv[] )
 /* separate thread to check for NPTL and TLS features */
 static void *needs_pthread( void *arg )
 {
-    pid_t tid = gettid();
+    pid_t tid = syscall( SYS_gettid );
     /* check for NPTL */
     if (tid != -1 && tid != getpid()) return (void *)1;
     /* check for TLS glibc */




More information about the wine-cvs mailing list