chiark / gitweb /
meson: when pivot_root() is added one day, look for it in <unistd.h>
authorLennart Poettering <lennart@poettering.net>
Mon, 25 Dec 2017 11:07:40 +0000 (12:07 +0100)
committerSven Eden <yamakuzure@gmx.net>
Wed, 30 May 2018 05:49:41 +0000 (07:49 +0200)
We of course don't know in which header glibc will export pivot_root()
and if it ever will. But there's a good chance they'll place it where
chroot() is located, given the similarity in the operations, hence let's
try our luck and look for it at the same place.

If we are lucky this means we don't have to patch our code if glibc
decides to expose the call one day.

meson.build

index aea61990c5751947d3ab20495944f8ec48a84101..ac61dbc93b673207a9cc1a7fffcb7e99f99aad5a 100644 (file)
@@ -520,7 +520,8 @@ endforeach
 foreach ident : [
         ['memfd_create',      '''#include <sys/mman.h>'''],
         ['gettid',            '''#include <sys/types.h>'''],
-        ['pivot_root',        '''#include <stdlib.h>'''],     # no known header declares pivot_root
+        ['pivot_root',        '''#include <stdlib.h>
+//                                 #include <unistd.h>'''],     # no known header declares pivot_root
         ['name_to_handle_at', '''#include <sys/types.h>
                                  #include <sys/stat.h>
                                  #include <fcntl.h>'''],