Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nhorman committed Sep 1, 2009
1 parent 175844b commit 37e0a09
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 9 deletions.
3 changes: 3 additions & 0 deletions AUTHORS
@@ -0,0 +1,3 @@
Arjen Van De Ven <arjanvandeven@gmail.com>
Neil Horman <nhorman@gmail.com>

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

1 change: 1 addition & 0 deletions NEWS
@@ -0,0 +1 @@
No news currently
Empty file added README
Empty file.
1 change: 1 addition & 0 deletions activate.c
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion bitmap.c
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions classify.c
@@ -1,3 +1,4 @@
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
Expand Down
3 changes: 1 addition & 2 deletions cputree.c
Expand Up @@ -24,8 +24,7 @@
* cache domains and processor cores.
*/

#define _GNU_SOURCE

#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
Expand Down
12 changes: 11 additions & 1 deletion irqbalance.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion irqlist.c
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion network.c
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion numa.c
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions placement.c
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion powermode.c
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion procinterrupts.c
Expand Up @@ -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>
Expand Down

0 comments on commit 37e0a09

Please sign in to comment.