summaryrefslogtreecommitdiff
path: root/src/libpcp_pmcd/src/data.c
blob: ca257b0a729cc6a0e0cfde9a8742a1f6b3a5f0cb (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
34
35
36
37
38
39
40
41
42
43
/*
 * Copyright (c) 2012 Red Hat.
 * Copyright (c) 1995-2001,2004 Silicon Graphics, Inc.  All Rights Reserved.
 * 
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 */

#include "pmcd.h"

/*
 * Global data shared by pmcd and the pmcd PMDA DSO must reside
 * in a DSO as well, due to linkage oddities with Windows DLLs.
 */

PMCD_INTERN int	pmcd_hi_openfds = -1;   /* Highest open pmcd file descriptor */
PMCD_INTERN int	_pmcd_done;		/* flag from pmcd pmda */
PMCD_INTERN int	_pmcd_timeout = 5;	/* Timeout for hung agents */

PMCD_INTERN int	nAgents;		/* Number of active agents */
PMCD_INTERN AgentInfo *agent;		/* Array of agent info structs */

PMCD_INTERN char *_pmcd_hostname;	/* Explicitly requested hostname */
/*
 * File descriptors are used as an internal index with the advent
 * of NSPR in libpcp.  We (may) need to first decode the index to
 * an internal representation and lookup the real file descriptor.
 * Note the use of on-stack fd overwrite, avoiding local variable.
 */

void
pmcd_openfds_sethi(int fd)
{
    if ((fd = __pmFD(fd)) > pmcd_hi_openfds)
	pmcd_hi_openfds = fd;
}