diff options
author | Arnaud Versini <arnaud.versini@gmail.com> | 2012-12-01 20:42:50 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-12-01 20:57:42 +0000 |
commit | 04962221c3a0be2ef46fcc9b8f4da58b9947a6ee (patch) | |
tree | 42eeba737a30390c57a53d133537609cb864b616 /sal | |
parent | c140d0a585dd82af370c7310b57f56392b3889e1 (diff) |
Remove useless getpid implementation on Linux.
The new minimal target have a proper getpid implementation.
Change-Id: I1cf209d8b4cb651866287c3a682ebd0806ab35b9
Reviewed-on: https://gerrit.libreoffice.org/1219
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/system.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/sal/osl/unx/system.c b/sal/osl/unx/system.c index 328f4fc334f4..fca765566785 100644 --- a/sal/osl/unx/system.c +++ b/sal/osl/unx/system.c @@ -207,40 +207,6 @@ int macxp_resolveAlias(char *path, int buflen) #endif /* NO_PTHREAD_RTL */ -#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 - there 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 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: -extern __pid_t __getpid(void); - -static pid_t pid = -1; - -static void savePid(void) __attribute__((constructor)); - -static void savePid(void) -{ - if (pid == -1) - pid = __getpid(); -} - -pid_t getpid(void) -{ - if (pid == -1) - savePid(); - - return (pid); -} -#endif /* defined LINUX */ - #ifdef NO_PTHREAD_SEMAPHORES int sem_init(sem_t* sem, int pshared, unsigned int value) { |