Freenas 11.1 jail: 2.2.9 server install failed, 2.2.8 server install succeed as aspected

Installation as described in
https://www.urbackup.org/freenasserverinstall.html
with server 2.2.9 fails with error.
Installation of server 2.2.8 is running as aspected without errors.
warden jail

    root@urbackup:/urbackup-server-2.2.9 # make install -j4
--- install-recursive ---
Making install in .
--- urbackupcommon/urbackup_mount_helper-os_functions_lin_min.o ---
--- urbackupsrv-Client.o ---
--- urbackupsrv-Database.o ---
--- urbackupsrv-Query.o ---
--- urbackupcommon/urbackup_mount_helper-os_functions_lin_min.o ---
c++ -DHAVE_CONFIG_H -I.  -fstack-protector-strong --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIE -I/usr/include -I/usr/include -DOS_FUNC_NO_NET -DOS_FUNC_NO_IFACE_SERVER -DLINUX   -DBINDIR='"/usr/local/bin"' -g -O2 -MT urbackupcommon/urbackup_mount_helper-os_functions_lin_min.o -MD -MP -MF urbackupcommon/.deps/urbackup_mount_helper-os_functions_lin_min.Tpo -c -o urbackupcommon/urbackup_mount_helper-os_functions_lin_min.o `test -f 'urbackupcommon/os_functions_lin_min.cpp' || echo './'`urbackupcommon/os_functions_lin_min.cpp
--- urbackupsrv-Client.o ---
c++ -DHAVE_CONFIG_H -I.  -I/usr/local/include -I/usr/local/include   -fstack-protector-strong --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIE -DSQLITE_PREPARE_RETRIES=5  -DNDEBUG  -I/usr/include -I/usr/include -D_THREAD_SAFE -pthread -DLINUX -DSTATIC_PLUGIN   -DVARDIR='"/usr/local/var"'  -DBINDIR='"/usr/local/bin"' -DDATADIR='"/usr/local/share"'    -g -O2 -MT urbackupsrv-Client.o -MD -MP -MF .deps/urbackupsrv-Client.Tpo -c -o urbackupsrv-Client.o `test -f 'Client.cpp' || echo './'`Client.cpp
--- urbackupsrv-Database.o ---
c++ -DHAVE_CONFIG_H -I.  -I/usr/local/include -I/usr/local/include   -fstack-protector-strong --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIE -DSQLITE_PREPARE_RETRIES=5  -DNDEBUG  -I/usr/include -I/usr/include -D_THREAD_SAFE -pthread -DLINUX -DSTATIC_PLUGIN   -DVARDIR='"/usr/local/var"'  -DBINDIR='"/usr/local/bin"' -DDATADIR='"/usr/local/share"'    -g -O2 -MT urbackupsrv-Database.o -MD -MP -MF .deps/urbackupsrv-Database.Tpo -c -o urbackupsrv-Database.o `test -f 'Database.cpp' || echo './'`Database.cpp
--- urbackupsrv-Query.o ---
c++ -DHAVE_CONFIG_H -I.  -I/usr/local/include -I/usr/local/include   -fstack-protector-strong --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIE -DSQLITE_PREPARE_RETRIES=5  -DNDEBUG  -I/usr/include -I/usr/include -D_THREAD_SAFE -pthread -DLINUX -DSTATIC_PLUGIN   -DVARDIR='"/usr/local/var"'  -DBINDIR='"/usr/local/bin"' -DDATADIR='"/usr/local/share"'    -g -O2 -MT urbackupsrv-Query.o -MD -MP -MF .deps/urbackupsrv-Query.Tpo -c -o urbackupsrv-Query.o `test -f 'Query.cpp' || echo './'`Query.cpp
--- urbackupcommon/urbackup_mount_helper-os_functions_lin_min.o ---
urbackupcommon/os_functions_lin_min.cpp:89:20: error: use of undeclared identifier 'readdir64'; did you mean 'readdir'?
    while ((dirp = readdir64(dp)) != NULL)
                   ^~~~~~~~~
                   readdir
/usr/include/dirent.h:98:3: note: 'readdir' declared here
         readdir(DIR *);
         ^
urbackupcommon/os_functions_lin_min.cpp:89:18: error: assigning to 'struct dirent64 *' from incompatible type 'struct dirent *'
    while ((dirp = readdir64(dp)) != NULL)
                 ^ ~~~~~~~~~~~~~
urbackupcommon/os_functions_lin_min.cpp:92:21: error: member access into incomplete type 'struct dirent64'
        f.name=(dirp->d_name);
                    ^
urbackupcommon/os_functions_lin_min.cpp:63:12: note: forward declaration of 'dirent64'
    struct dirent64 *dirp;
           ^
urbackupcommon/os_functions_lin_min.cpp:96:16: error: member access into incomplete type 'struct dirent64'
                f.isdir=(dirp->d_type==DT_DIR);
                             ^
urbackupcommon/os_functions_lin_min.cpp:63:12: note: forward declaration of 'dirent64'
    struct dirent64 *dirp;
           ^
urbackupcommon/os_functions_lin_min.cpp:99:29: error: member access into incomplete type 'struct dirent64'
                int rc=lstat64((upath+dirp->d_name).c_str(), &f_info);
                                          ^
urbackupcommon/os_functions_lin_min.cpp:63:12: note: forward declaration of 'dirent64'
    struct dirent64 *dirp;
           ^
urbackupcommon/os_functions_lin_min.cpp:115:33: error: member access into incomplete type 'struct dirent64'
                                int rc2 = stat64((upath+dirp->d_name).c_str(), &l_info);
                                                            ^
urbackupcommon/os_functions_lin_min.cpp:63:12: note: forward declaration of 'dirent64'
    struct dirent64 *dirp;
           ^
6 errors generated.
*** [urbackupcommon/urbackup_mount_helper-os_functions_lin_min.o] Error code 1

make[1]: stopped in /urbackup-server-2.2.9
--- urbackupsrv-Client.o ---
mv -f .deps/urbackupsrv-Client.Tpo .deps/urbackupsrv-Client.Po
--- urbackupsrv-Query.o ---
mv -f .deps/urbackupsrv-Query.Tpo .deps/urbackupsrv-Query.Po
--- urbackupsrv-Database.o ---
mv -f .deps/urbackupsrv-Database.Tpo .deps/urbackupsrv-Database.Po
1 error

make[1]: stopped in /urbackup-server-2.2.9
*** [install-recursive] Error code 1

make: stopped in /urbackup-server-2.2.9
1 error

make: stopped in /urbackup-server-2.2.9

changing in

urbackup-server-2.2.9/urbackupcommon/os_functions_lin.cpp

#if defined(FreeBSD) || defined(APPLE)
#define lstat64 lstat
#define stat64 stat
#define statvfs64 statvfs
#define open64 open
#define readdir64 readdir
#define dirent64 dirent
#endif

to

#if defined(FreeBSD) || defined(APPLE)
#define lstat64 lstat
#define stat64 stat
#define statvfs64 statvfs
#define open64 open
#define readdir64 readdir
#define dirent64 dirent
#define fsblkcnt64 fsblkcnt
#define fsblkcnt64_t fsblkcnt_t
#endif

and in

urbackup-server-2.2.9/urbackupcommon/os_functions_lin_min.cpp

#if defined(FreeBSD)
#define open64 open
#define stat64 stat
#define lstat64 lstat
#endif

to

#if defined(FreeBSD)
#define open64 open
#define stat64 stat
#define lstat64 lstat
#define readdir64 readdir
#define dirent64 dirent
#endif

did the trick

i had the same error on alpinelinux 3.9 while compiling urbackup-client 2.4.9

i solved it with
`apk add linux-headers

cd urbackup-client-2.4.9.0

./configure --enable-embedded-cryptopp --enable-embedded-zstd --enable-headless
make && make install
`

reference to issue ticket (solved)
https://urbackup.atlassian.net/browse/UC-75