wcfs: _os: Fix gettid for older glibc
Kazuhiko reports that
On one of my servers, from wendelin.bigarray.array_zodb import ZBigArray fails.
>>> from wendelin.bigarray.array_zodb import ZBigArray
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/(SR)/parts/wendelin.core/bigarray/array_zodb.py", line 32, in <module>
from wendelin.bigfile.file_zodb import ZBigFile
File "/(SR)/parts/wendelin.core/bigfile/file_zodb.py", line 166, in <module>
from wendelin.bigfile._file_zodb import _ZBigFile
File "bigfile/_file_zodb.pyx", line 1, in init wendelin.bigfile._file_zodb
# -*- coding: utf-8 -*-
File "/(SR)/parts/wendelin.core/wcfs/__init__.py", line 87, in <module>
from wendelin.wcfs.internal import glog
File "/(SR)/parts/wendelin.core/wcfs/internal/glog.py", line 31, in <module>
from wendelin.wcfs.internal import os as xos
File "/(SR)/parts/wendelin.core/wcfs/internal/os.py", line 32, in <module>
from wendelin.wcfs.internal._os import gettid
ImportError: /(SR)/parts/wendelin.core/wcfs/internal/_os.so: undefined symbol: gettid
That happens because gettid is available only starting from glibc 2.30
https://www.man7.org/linux/man-pages/man2/gettid.2.html
and the system there is likely older.
We already use gettid via syscall(SYS_gettid) wcfs/client/wcfs_misc.cpp.
https://lab.nexedi.com/nexedi/wendelin.core/-/blob/e8a00ac0/wcfs/client/wcfs_misc.cpp
-> Do the same thing in wcfs/internal/_os.pyx to fix it.
/reported-by @kazuhiko
/reported-on erp5@c8998ed0 (comment 244984)
/helped-by @jerome