Add autotools scripts to irqbalance

Steve Grubb sent this patch as part of issue 3:
http://code.google.com/p/irqbalance/issues/detail?id=3

He requested that we add the ability to drop capabilities from irqbalance since
it nominally runs as root, and he suggested using the capng library, which makes
that process easier.  Since capng is a fairly new library, and many distros may
not have it, we need to start using a configure script to optionally include it
during the build.  This patch accomplishes all of that.

Signed-off-by: Neil Horman <nhorman@gmail.com>



git-svn-id: https://irqbalance.googlecode.com/svn/trunk@21 46b42954-3823-0410-bd82-eb80b452c9b5
This commit is contained in:
nhorman 2009-09-01 15:50:39 +00:00
parent 175844b91b
commit 37e0a0963d
15 changed files with 28 additions and 9 deletions

3
AUTHORS Normal file
View file

@ -0,0 +1,3 @@
Arjen Van De Ven <arjanvandeven@gmail.com>
Neil Horman <nhorman@gmail.com>

3
ChangeLog Normal file
View file

@ -0,0 +1,3 @@
This is all tracked in the SVN repo. This file is just here to keep the
autotools from complaining

1
NEWS Normal file
View file

@ -0,0 +1 @@
No news currently

0
README Normal file
View file

View file

@ -23,6 +23,7 @@
* This file contains the code to communicate a selected distribution / mapping
* of interrupts to the kernel.
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

View file

@ -11,7 +11,7 @@ This file is taken from the Linux kernel and minimally adapted for use in usersp
* This source code is licensed under the GNU General Public License,
* Version 2. See the file COPYING for more details.
*/
#include "config.h"
#include <unistd.h>
#include <errno.h>
#include <stdio.h>

View file

@ -1,3 +1,4 @@
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>

View file

@ -24,8 +24,7 @@
* cache domains and processor cores.
*/
#define _GNU_SOURCE
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

View file

@ -18,12 +18,15 @@
* 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#include "config.h"
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <sys/time.h>
#ifdef HAVE_LIBCAP_NG
#include <cap-ng.h>
#endif
#include "irqbalance.h"
int one_shot_mode;
@ -82,6 +85,13 @@ int main(int argc, char** argv)
if (daemon(0,0))
exit(EXIT_FAILURE);
#ifdef HAVE_LIBCAP_NG
// Drop capabilities
capng_clear(CAPNG_SELECT_BOTH);
capng_lock();
capng_apply(CAPNG_SELECT_BOTH);
#endif
parse_proc_interrupts();
sleep(SLEEP_INTERVAL/4);
reset_counts();

View file

@ -22,7 +22,7 @@
/*
* This file has the basic functions to manipulate interrupt metadata
*/
#define _GNU_SOURCE
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

View file

@ -24,7 +24,7 @@
* even though the amount of work is high; this file is there to compensate for this
* by adding actual package counts to the calculated amount of work of interrupts
*/
#define _GNU_SOURCE
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

2
numa.c
View file

@ -24,7 +24,7 @@
* In addition the PCI class information is used to refine the classification
* of interrupt sources
*/
#define _GNU_SOURCE
#include "config.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>

View file

@ -18,6 +18,7 @@
* 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

View file

@ -18,7 +18,7 @@
* 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#define _GNU_SOURCE
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

View file

@ -18,7 +18,7 @@
* 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#define _GNU_SOURCE
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>