libnfs
libnfs copied to clipboard
the gettid issue -- need libc at least 2.30 to use, so add version check of libc to configure
First of all, thank you so much for getting out the corrected 5.0.1 release.
This builds without problem for me as it resolves the previous problem in 5.0.0 with the configure.ac not handling the multithreading option correctly.
Perhaps this issue is best resolved by just putting a test for the llibc version in "configure" because the version needs to be at least 2.30 in order for the problem of
../lib/.libs/libnfs.so: undefined reference to `gettid'
when net-cat is being linked in utils not to occur.
The only way I could get libnfs v5 with multithreading to build on an older system which really does need be upgraded to a more recent Lunux distriibution` with a libc of at least version 2.30, was (after searching the web abd looking at the manual pages for gettid and sysclall) to add to multithreading.c
#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>
and to change the call to gettid to
return (pid_t) (syscall(SYS_gettid));
I do call syscall(SYS_gettid) already and that should work for all versions of Linux. What needs to be done is wrap this inside a #ifdef LINUX and then have alternative #ifdefs for other platforms like BSD, OSX, IOS, ...