Hi,

New version of the patch, with good versions comments and whithout
compilation of getpid on recent linux.

Previuously, I've only checked if the installation baseline is ok, so I
checked if Glibc and kernel version's on LibreOffice download page are
good, sorry for this. This patch have the correct baseline (Glibc 2.4 and
of course Linux 2.6+).


2011/11/23 Michael Meeks <michael.me...@suse.com>

>
> On Wed, 2011-11-23 at 14:06 +0000, Caolán McNamara wrote:
> > > On Tue, 2011-11-22 at 22:17 +0100, Arnaud Versini wrote:
> > > >       * Linux kernel version 2.6.18 or higher; -> clone() for NTPL
> > > >       * glibc2 version 2.5 or higher; -> NPTL
> ...
> > My understanding is that our practical baseline is the RHEL-4.9 x86
> > build machine, which is...
> >
> > glibc: glibc-2.3.4-2.54
>

This version of GLibc can also be used with LinuxThreads, internal getpid
is used instead of the glibc version with this patch. As mentioned Caolán,
RHEL 4.9 use NPTL, but with this version of Glibc, LinuxThreads can also be
used.


> > kernel: uname -r -> 2.6.9-101.plus.c4smp
>
>         Looks like we can't remove it for now then; thanks for digging out
> the
> versions Arnaud - I've added them in a comment to that piece of
> system.c.
>
>        All the best,
>
>                Michael.
>
> --
> michael.me...@suse.com  <><, Pseudo Engineer, itinerant idiot
>
>
Sorry for the delay

Best regards

-- 
Arnaud Versini
From 9ab9a5035813d6648afc757d4b23ce1a3f0eaabb Mon Sep 17 00:00:00 2001
From: Arnaud Versini <arnaud.vers...@gmail.com>
Date: Tue, 6 Dec 2011 19:49:34 +0100
Subject: [PATCH] Don't replace getpid on Linux when the system version is
 correct

---
 sal/osl/unx/system.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/sal/osl/unx/system.c b/sal/osl/unx/system.c
index 478fdaf..d1fc724 100644
--- a/sal/osl/unx/system.c
+++ b/sal/osl/unx/system.c
@@ -201,14 +201,16 @@ int macxp_resolveAlias(char *path, int buflen)
 
 #endif /* NO_PTHREAD_RTL */
 
-#if defined(LINUX)
-/* The linux kernel thread implemention, always return the pid of the
-   thread subprocess and not of the main process. So we save the main
-   pid at startup
+#if defined(LINUX) && defined (__GLIBC__) && __GLIBC__ == 2 || __GLIBC_MINOR__ < 4
+/* The linux kernel 2.4 getpid implemention always return the pid of the
+   thread subprocess and not of the main process, the NPTL implementation
+   with a Linux kernel 2.6 kernel return the pid. So when possibly
+   their is the wrong implementation of getpid, we save the pid at startup.
    FIXME: when our Linux base-line is above:
-        + Linux kernel version 2.6.18 or higher; -> clone() for NTPL
-        + glibc2 version 2.5 or higher; -> NPTL
+        + Linux kernel version 2.6 or higher; -> clone() for NTPL
+        + glibc2 version 2.4 or higher; -> No longer LinuxThreads, only NPTL
    Then we get a working getpid() and can remove this hack.
+   FIXME: getppid is also wrong in this situation
 */
 
 // Directly from libc.so.6, obviously missing from some unistd.h:
-- 
1.7.5.4

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to