From 8e329d12c791862ad3cd395b481831be3d62320d Mon Sep 17 00:00:00 2001 From: Joshua Peraza Date: Fri, 19 Oct 2018 13:14:36 -0700 Subject: [PATCH] linux: Use capget syscall instead of its libc wrapper The sys/capability.h header is only present if libcap is installed. We were only using it for its declaration of a capget() wrapper. Using the system call directly allows compiling without installing libcap. Change-Id: I83dfc5c8d56bb3cdd4efb62e0c568d8a221334cd Reviewed-on: https://chromium-review.googlesource.com/c/1292231 Commit-Queue: Joshua Peraza Reviewed-by: Mark Mentovai --- handler/linux/exception_handler_server.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/handler/linux/exception_handler_server.cc b/handler/linux/exception_handler_server.cc index 71a5dc74..12e73635 100644 --- a/handler/linux/exception_handler_server.cc +++ b/handler/linux/exception_handler_server.cc @@ -15,10 +15,11 @@ #include "handler/linux/exception_handler_server.h" #include -#include +#include #include #include #include +#include #include #include @@ -95,7 +96,7 @@ bool HaveCapSysPtrace() { cap_header.pid = getpid(); - if (capget(&cap_header, &cap_data) != 0) { + if (syscall(SYS_capget, &cap_header, &cap_data) != 0) { PLOG(ERROR) << "capget"; return false; }