More Makefile cleanups, otherwise mainly noticeable are the netfilter fix
[davej-history.git] / include / linux / acct.h
blobe20b183996e5bde928c76d7cf054209526df6c27
1 /*
2 * BSD Process Accounting for Linux - Definitions
4 * Author: Marco van Wieringen (mvw@planets.elm.net)
6 * This header file contains the definitions needed to implement
7 * BSD-style process accounting. The kernel accounting code and all
8 * user-level programs that try to do something useful with the
9 * process accounting log must include this file.
11 * Copyright (C) 1995 - 1997 Marco van Wieringen - ELM Consultancy B.V.
15 #ifndef _LINUX_ACCT_H
16 #define _LINUX_ACCT_H
18 #include <linux/types.h>
20 /*
21 * comp_t is a 16-bit "floating" point number with a 3-bit base 8
22 * exponent and a 13-bit fraction. See linux/kernel/acct.c for the
23 * specific encoding system used.
26 typedef __u16 comp_t;
29 * accounting file record
31 * This structure contains all of the information written out to the
32 * process accounting file whenever a process exits.
35 #define ACCT_COMM 16
37 struct acct
39 char ac_flag; /* Accounting Flags */
41 * No binary format break with 2.0 - but when we hit 32bit uid we'll
42 * have to bite one
44 __u16 ac_uid; /* Accounting Real User ID */
45 __u16 ac_gid; /* Accounting Real Group ID */
46 __u16 ac_tty; /* Accounting Control Terminal */
47 __u32 ac_btime; /* Accounting Process Creation Time */
48 comp_t ac_utime; /* Accounting User Time */
49 comp_t ac_stime; /* Accounting System Time */
50 comp_t ac_etime; /* Accounting Elapsed Time */
51 comp_t ac_mem; /* Accounting Average Memory Usage */
52 comp_t ac_io; /* Accounting Chars Transferred */
53 comp_t ac_rw; /* Accounting Blocks Read or Written */
54 comp_t ac_minflt; /* Accounting Minor Pagefaults */
55 comp_t ac_majflt; /* Accounting Major Pagefaults */
56 comp_t ac_swaps; /* Accounting Number of Swaps */
57 __u32 ac_exitcode; /* Accounting Exitcode */
58 char ac_comm[ACCT_COMM + 1]; /* Accounting Command Name */
59 char ac_pad[10]; /* Accounting Padding Bytes */
63 * accounting flags
65 /* bit set when the process ... */
66 #define AFORK 0x01 /* ... executed fork, but did not exec */
67 #define ASU 0x02 /* ... used super-user privileges */
68 #define ACOMPAT 0x04 /* ... used compatibility mode (VAX only not used) */
69 #define ACORE 0x08 /* ... dumped core */
70 #define AXSIG 0x10 /* ... was killed by a signal */
72 #define AHZ 100
74 #ifdef __KERNEL__
76 #include <linux/config.h>
78 #ifdef CONFIG_BSD_PROCESS_ACCT
79 extern void acct_auto_close(kdev_t dev);
80 extern int acct_process(long exitcode);
81 #else
82 #define acct_auto_close(x) do { } while (0)
83 #define acct_process(x) do { } while (0)
84 #endif
86 #endif /* __KERNEL */
88 #endif /* _LINUX_ACCT_H */