[Libreoffice] [PATCH] [NOT_URGENT] Some OSL cleanup
Stephan Bergmann
sbergman at redhat.com
Wed Dec 7 00:52:19 PST 2011
> -#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 above looks broken, given that && binds tighter than ||. From the
comments, I gather that what actually should be checked is that
__GLIBC__.__GLIBC_MINOR__ < 2.4, right? So, since we would not care
about glibc 1, anyway, the || should be replaced with a && I think.
Stephan
> +/* 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
> */
More information about the LibreOffice
mailing list