acctctl.h revision da14cebe459d3275048785f25bd869cb09b5307f
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_ACCTCTL_H
#define _SYS_ACCTCTL_H
#include <sys/sysmacros.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Definitions for acctctl() system call
*/
/*
* modes
*/
#define AC_MODE(x) ((x) & 0xff000000)
/*
* options
*/
#define AC_OPTION(x) ((x) & 0x00ffffff)
/*
* Process accounting resource IDs
*/
#define AC_NONE 0 /* special end-of-list identifier */
/*
* Task accounting resource IDs
*/
/*
* Flow accounting resource IDs
*/
/*
* Network accounting resource IDs
*/
#define AC_MAX_RES \
/*
* resource states
*/
#define AC_OFF 0 /* disabled resource */
typedef struct ac_res {
int ar_id; /* resource ID */
int ar_state; /* resource state; see above */
} ac_res_t;
#ifdef _KERNEL
typedef struct ac_info {
char *ac_file; /* exacct file name */
int ac_state; /* accounting state */
} ac_info_t;
/*
* Key used for retrieving per-zone exacct settings. This remains
* uninitialized (ZONE_KEY_UNINITIALIZED) until the acctctl module is loaded.
*/
extern zone_key_t exacct_zone_key;
/*
* Per-zone exacct settings. Each zone may have its own settings for
* process, task, flow, and network accounting.
*
* Per-zone flow accounting has not yet been implemented, so this
* provides zones with the view that flow accounting in the zone hasn't
* been initialized (which is true). The various system calls will fail
* to set flow accounting parameters from within a zone.
*
* The global list of accounting settings is used when we check to see
* if the accounting file is already in use by any zone.
*/
struct exacct_globals {
};
#else
#endif /* ifdef _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_ACCTCTL_H */