May 2024 | ||||||
Mo | Tu | We | Th | Fr | Sa | Su |
29 | 30 | 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 | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
001: /* Copyright (C) 1996, 1997, 1998, 1999, 2007 Free Software Foundation, Inc. 002: This file is part of the GNU C Library. 003: 004: The GNU C Library is free software; you can redistribute it and/or 005: modify it under the terms of the GNU Lesser General Public 006: License as published by the Free Software Foundation; either 007: version 2.1 of the License, or (at your option) any later version. 008: 009: The GNU C Library is distributed in the hope that it will be useful, 010: but WITHOUT ANY WARRANTY; without even the implied warranty of 011: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012: Lesser General Public License for more details. 013: 014: You should have received a copy of the GNU Lesser General Public 015: License along with the GNU C Library; if not, write to the Free 016: Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 017: 02111-1307 USA. */ 018: 019: #ifndef _SYS_ACCT_H 020: #define _SYS_ACCT_H 1 021: 022: #include <features.h> 023: 024: #include <endian.h> 025: #define __need_time_t 026: #include <time.h> 027: #include <sys/types.h> 028: 029: __BEGIN_DECLS 030: 031: #define ACCT_COMM 16 032: 033: /* 034: comp_t is a 16-bit "floating" point number with a 3-bit base 8 035: exponent and a 13-bit fraction. See linux/kernel/acct.c for the 036: specific encoding system used. 037: */ 038: 039: typedef u_int16_t comp_t; 040: 041: struct acct 042: { 043: char ac_flag; /* Flags. */ 044: u_int16_t ac_uid; /* Real user ID. */ 045: u_int16_t ac_gid; /* Real group ID. */ 046: u_int16_t ac_tty; /* Controlling terminal. */ 047: u_int32_t ac_btime; /* Beginning time. */ 048: comp_t ac_utime; /* User time. */ 049: comp_t ac_stime; /* System time. */ 050: comp_t ac_etime; /* Elapsed time. */ 051: comp_t ac_mem; /* Average memory usage. */ 052: comp_t ac_io; /* Chars transferred. */ 053: comp_t ac_rw; /* Blocks read or written. */ 054: comp_t ac_minflt; /* Minor pagefaults. */ 055: comp_t ac_majflt; /* Major pagefaults. */ 056: comp_t ac_swaps; /* Number of swaps. */ 057: u_int32_t ac_exitcode; /* Process exitcode. */ 058: char ac_comm[ACCT_COMM+1]; /* Command name. */ 059: char ac_pad[10]; /* Padding bytes. */ 060: }; 061: 062: 063: struct acct_v3 064: { 065: char ac_flag; /* Flags */ 066: char ac_version; /* Always set to ACCT_VERSION */ 067: u_int16_t ac_tty; /* Control Terminal */ 068: u_int32_t ac_exitcode; /* Exitcode */ 069: u_int32_t ac_uid; /* Real User ID */ 070: u_int32_t ac_gid; /* Real Group ID */ 071: u_int32_t ac_pid; /* Process ID */ 072: u_int32_t ac_ppid; /* Parent Process ID */ 073: u_int32_t ac_btime; /* Process Creation Time */ 074: float ac_etime; /* Elapsed Time */ 075: comp_t ac_utime; /* User Time */ 076: comp_t ac_stime; /* System Time */ 077: comp_t ac_mem; /* Average Memory Usage */ 078: comp_t ac_io; /* Chars Transferred */ 079: comp_t ac_rw; /* Blocks Read or Written */ 080: comp_t ac_minflt; /* Minor Pagefaults */ 081: comp_t ac_majflt; /* Major Pagefaults */ 082: comp_t ac_swaps; /* Number of Swaps */ 083: char ac_comm[ACCT_COMM]; /* Command Name */ 084: }; 085: 086: 087: enum 088: { 089: AFORK = 0x01, /* Has executed fork, but no exec. */ 090: ASU = 0x02, /* Used super-user privileges. */ 091: ACORE = 0x08, /* Dumped core. */ 092: AXSIG = 0x10 /* Killed by a signal. */ 093: }; 094: 095: #if __BYTE_ORDER == __BIG_ENDIAN 096: # define ACCT_BYTEORDER 0x80 /* Accounting file is big endian. */ 097: #else 098: # define ACCT_BYTEORDER 0x00 /* Accounting file is little endian. */ 099: #endif 100: 101: #define AHZ 100 102: 103: 104: /* Switch process accounting on and off. */ 105: extern int acct (__const char *__filename) __THROW; 106: 107: __END_DECLS 108: 109: #endif /* sys/acct.h */ 110: