~ubuntu-branches/ubuntu/wily/apparmor/wily

« back to all changes in this revision

Viewing changes to tests/regression/subdomain/syscall_setpriority.c

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2011-04-27 10:38:07 UTC
  • mfrom: (5.1.118 natty)
  • Revision ID: james.westby@ubuntu.com-20110427103807-ym3rhwys6o84ith0
Tags: 2.6.1-2
debian/copyright: clarify for some full organization names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: syscall_setpriority.c 61 2006-05-19 18:32:14Z steve-beattie $ */
2
 
 
3
 
/*
4
 
 *      Copyright (C) 2002-2005 Novell/SUSE
5
 
 *
6
 
 *      This program is free software; you can redistribute it and/or
7
 
 *      modify it under the terms of the GNU General Public License as
8
 
 *      published by the Free Software Foundation, version 2 of the
9
 
 *      License.
10
 
 */
11
 
 
12
 
#include <unistd.h>
13
 
#include <stdlib.h>
14
 
#include <stdio.h>
15
 
#include <errno.h>
16
 
#include <sys/time.h>
17
 
#include <sys/resource.h>
18
 
 
19
 
 
20
 
int
21
 
main (int argc, char * argv[]) {
22
 
        int rc;
23
 
        int niceval;
24
 
 
25
 
        if (argc == 2) {
26
 
                niceval = strtol (argv[1], NULL, 10);
27
 
        } else {
28
 
                niceval = -5;
29
 
        }
30
 
        
31
 
        rc = setpriority(PRIO_PROCESS, 0, niceval);
32
 
        if (rc != 0) {
33
 
                perror ("FAIL: setpriority failed");
34
 
                return errno;
35
 
        }
36
 
 
37
 
        printf ("PASS\n");
38
 
 
39
 
        return 0;
40
 
}
41