summaryrefslogtreecommitdiff
path: root/qa/src/username.c
blob: 6984997803c13c73e3cc7d422eb678ff677ce713 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * Copyright (c) 2012 Red Hat.
 */

#include <pcp/pmapi.h>
#include <pcp/impl.h>
#include <unistd.h>

#include "localconfig.h"

#if PCP_VER < 3611
#define __pmSetProcessIdentity(x) (exit(1), 1)
#endif

static void
usage (void)
{
    fprintf(stderr, "Usage %s: username\n", pmProgname);
    exit(1);
}

int
main(int argc, char* argv[])
{
    int sts;

    __pmSetProgname(argv[0]);
    if (argc != 2)
	usage();
    sts = __pmSetProcessIdentity(argv[1]);
    pause();
    return sts;
}