libbpf: fix build warning on setns (#1246)
authorColin Ian King <colin.king@canonical.com>
Thu, 6 Jul 2017 12:58:17 +0000 (13:58 +0100)
committerSasha Goldshtein <goldshtn@gmail.com>
Thu, 6 Jul 2017 12:58:17 +0000 (15:58 +0300)
The macro _GNU_SOURCE should be defined to pick up the function
declaration for setns.  Fixes build warning:

"src/cc/libbpf.c:482:7: warning: implicit declaration of
 function 'setns' [-Wimplicit-function-declaration]
   if (setns(target_fd, CLONE_NEWNS)) {"

Signed-off-by: Colin Ian King <colin.king@canonical.com>
src/cc/libbpf.c

index e223580..906e44f 100644 (file)
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#define _GNU_SOURCE
 
 #include <arpa/inet.h>
 #include <errno.h>