|
Packit Service |
82fcde |
/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
|
|
Packit Service |
82fcde |
This file is part of the GNU C Library.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit Service |
82fcde |
modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
82fcde |
License as published by the Free Software Foundation; either
|
|
Packit Service |
82fcde |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit Service |
82fcde |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
82fcde |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
82fcde |
Lesser General Public License for more details.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
82fcde |
License along with the GNU C Library; if not, see
|
|
Packit Service |
82fcde |
<http://www.gnu.org/licenses/>. */
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#ifndef _SYS_ACCT_H
|
|
Packit Service |
82fcde |
#define _SYS_ACCT_H 1
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#include <sys/types.h>
|
|
Packit Service |
82fcde |
#include <stdint.h>
|
|
Packit Service |
82fcde |
#include <endian.h>
|
|
Packit Service |
82fcde |
#include <bits/types/time_t.h>
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
__BEGIN_DECLS
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#define ACCT_COMM 16
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
/*
|
|
Packit Service |
82fcde |
comp_t is a 16-bit "floating" point number with a 3-bit base 8
|
|
Packit Service |
82fcde |
exponent and a 13-bit fraction. See linux/kernel/acct.c for the
|
|
Packit Service |
82fcde |
specific encoding system used.
|
|
Packit Service |
82fcde |
*/
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
typedef uint16_t comp_t;
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
struct acct
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
char ac_flag; /* Flags. */
|
|
Packit Service |
82fcde |
uint16_t ac_uid; /* Real user ID. */
|
|
Packit Service |
82fcde |
uint16_t ac_gid; /* Real group ID. */
|
|
Packit Service |
82fcde |
uint16_t ac_tty; /* Controlling terminal. */
|
|
Packit Service |
82fcde |
uint32_t ac_btime; /* Beginning time. */
|
|
Packit Service |
82fcde |
comp_t ac_utime; /* User time. */
|
|
Packit Service |
82fcde |
comp_t ac_stime; /* System time. */
|
|
Packit Service |
82fcde |
comp_t ac_etime; /* Elapsed time. */
|
|
Packit Service |
82fcde |
comp_t ac_mem; /* Average memory usage. */
|
|
Packit Service |
82fcde |
comp_t ac_io; /* Chars transferred. */
|
|
Packit Service |
82fcde |
comp_t ac_rw; /* Blocks read or written. */
|
|
Packit Service |
82fcde |
comp_t ac_minflt; /* Minor pagefaults. */
|
|
Packit Service |
82fcde |
comp_t ac_majflt; /* Major pagefaults. */
|
|
Packit Service |
82fcde |
comp_t ac_swaps; /* Number of swaps. */
|
|
Packit Service |
82fcde |
uint32_t ac_exitcode; /* Process exitcode. */
|
|
Packit Service |
82fcde |
char ac_comm[ACCT_COMM+1]; /* Command name. */
|
|
Packit Service |
82fcde |
char ac_pad[10]; /* Padding bytes. */
|
|
Packit Service |
82fcde |
};
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
struct acct_v3
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
char ac_flag; /* Flags */
|
|
Packit Service |
82fcde |
char ac_version; /* Always set to ACCT_VERSION */
|
|
Packit Service |
82fcde |
uint16_t ac_tty; /* Control Terminal */
|
|
Packit Service |
82fcde |
uint32_t ac_exitcode; /* Exitcode */
|
|
Packit Service |
82fcde |
uint32_t ac_uid; /* Real User ID */
|
|
Packit Service |
82fcde |
uint32_t ac_gid; /* Real Group ID */
|
|
Packit Service |
82fcde |
uint32_t ac_pid; /* Process ID */
|
|
Packit Service |
82fcde |
uint32_t ac_ppid; /* Parent Process ID */
|
|
Packit Service |
82fcde |
uint32_t ac_btime; /* Process Creation Time */
|
|
Packit Service |
82fcde |
float ac_etime; /* Elapsed Time */
|
|
Packit Service |
82fcde |
comp_t ac_utime; /* User Time */
|
|
Packit Service |
82fcde |
comp_t ac_stime; /* System Time */
|
|
Packit Service |
82fcde |
comp_t ac_mem; /* Average Memory Usage */
|
|
Packit Service |
82fcde |
comp_t ac_io; /* Chars Transferred */
|
|
Packit Service |
82fcde |
comp_t ac_rw; /* Blocks Read or Written */
|
|
Packit Service |
82fcde |
comp_t ac_minflt; /* Minor Pagefaults */
|
|
Packit Service |
82fcde |
comp_t ac_majflt; /* Major Pagefaults */
|
|
Packit Service |
82fcde |
comp_t ac_swaps; /* Number of Swaps */
|
|
Packit Service |
82fcde |
char ac_comm[ACCT_COMM]; /* Command Name */
|
|
Packit Service |
82fcde |
};
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
enum
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
AFORK = 0x01, /* Has executed fork, but no exec. */
|
|
Packit Service |
82fcde |
ASU = 0x02, /* Used super-user privileges. */
|
|
Packit Service |
82fcde |
ACORE = 0x08, /* Dumped core. */
|
|
Packit Service |
82fcde |
AXSIG = 0x10 /* Killed by a signal. */
|
|
Packit Service |
82fcde |
};
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#if __BYTE_ORDER == __BIG_ENDIAN
|
|
Packit Service |
82fcde |
# define ACCT_BYTEORDER 0x80 /* Accounting file is big endian. */
|
|
Packit Service |
82fcde |
#else
|
|
Packit Service |
82fcde |
# define ACCT_BYTEORDER 0x00 /* Accounting file is little endian. */
|
|
Packit Service |
82fcde |
#endif
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#define AHZ 100
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
/* Switch process accounting on and off. */
|
|
Packit Service |
82fcde |
extern int acct (const char *__filename) __THROW;
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
__END_DECLS
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#endif /* sys/acct.h */
|