extern.h (169670) | extern.h (169857) |
---|---|
1/* 2 * Copyright (c) 1994 Christopher G. Demetriou 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * | 1/* 2 * Copyright (c) 1994 Christopher G. Demetriou 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * |
30 * $FreeBSD: head/usr.sbin/sa/extern.h 169670 2007-05-18 12:36:10Z dds $ | 30 * $FreeBSD: head/usr.sbin/sa/extern.h 169857 2007-05-22 06:51:38Z dds $ |
31 */ 32 33#include <sys/types.h> 34#include <sys/param.h> 35#include <db.h> 36 37/* structures */ 38 | 31 */ 32 33#include <sys/types.h> 34#include <sys/param.h> 35#include <db.h> 36 37/* structures */ 38 |
39/* All times are stored in 1e-6s units. */ 40 |
|
39struct cmdinfo { 40 char ci_comm[MAXCOMLEN+2]; /* command name (+ '*') */ | 41struct cmdinfo { 42 char ci_comm[MAXCOMLEN+2]; /* command name (+ '*') */ |
41 u_long ci_uid; /* user id */ | 43 uid_t ci_uid; /* user id */ |
42 u_quad_t ci_calls; /* number of calls */ | 44 u_quad_t ci_calls; /* number of calls */ |
43 u_quad_t ci_etime; /* elapsed time */ 44 u_quad_t ci_utime; /* user time */ 45 u_quad_t ci_stime; /* system time */ 46 u_quad_t ci_mem; /* memory use */ 47 u_quad_t ci_io; /* number of disk i/o ops */ | 45 double ci_etime; /* elapsed time */ 46 double ci_utime; /* user time */ 47 double ci_stime; /* system time */ 48 double ci_mem; /* memory use */ 49 double ci_io; /* number of disk i/o ops */ |
48 u_int ci_flags; /* flags; see below */ 49}; 50#define CI_UNPRINTABLE 0x0001 /* unprintable chars in name */ 51 52struct userinfo { | 50 u_int ci_flags; /* flags; see below */ 51}; 52#define CI_UNPRINTABLE 0x0001 /* unprintable chars in name */ 53 54struct userinfo { |
53 u_long ui_uid; /* user id; for consistency */ | 55 uid_t ui_uid; /* user id; for consistency */ |
54 u_quad_t ui_calls; /* number of invocations */ | 56 u_quad_t ui_calls; /* number of invocations */ |
55 u_quad_t ui_utime; /* user time */ 56 u_quad_t ui_stime; /* system time */ 57 u_quad_t ui_mem; /* memory use */ 58 u_quad_t ui_io; /* number of disk i/o ops */ | 57 double ui_utime; /* user time */ 58 double ui_stime; /* system time */ 59 double ui_mem; /* memory use */ 60 double ui_io; /* number of disk i/o ops */ |
59}; 60 61/* typedefs */ 62 63typedef int (*cmpf_t)(const DBT *, const DBT *); 64 | 61}; 62 63/* typedefs */ 64 65typedef int (*cmpf_t)(const DBT *, const DBT *); 66 |
67/* external functions in db.c */ 68int db_copy_in(DB **mdb, const char *dbname, const char *name, 69 BTREEINFO *bti, int (*v1_to_v2)(DBT *key, DBT *data)); 70int db_copy_out(DB *mdb, const char *dbname, const char *name, 71 BTREEINFO *bti); 72void db_destroy(DB *db, const char *uname); 73 |
|
65/* external functions in pdb.c */ 66int pacct_init(void); 67void pacct_destroy(void); 68int pacct_add(const struct cmdinfo *); 69int pacct_update(void); 70void pacct_print(void); 71 | 74/* external functions in pdb.c */ 75int pacct_init(void); 76void pacct_destroy(void); 77int pacct_add(const struct cmdinfo *); 78int pacct_update(void); 79void pacct_print(void); 80 |
81/* external functions in readrec.c */ 82int readrec_forward(FILE *f, struct acctv2 *av2); 83 |
|
72/* external functions in usrdb.c */ 73int usracct_init(void); 74void usracct_destroy(void); 75int usracct_add(const struct cmdinfo *); 76int usracct_update(void); 77void usracct_print(void); 78 79/* variables */ --- 19 unchanged lines hidden --- | 84/* external functions in usrdb.c */ 85int usracct_init(void); 86void usracct_destroy(void); 87int usracct_add(const struct cmdinfo *); 88int usracct_update(void); 89void usracct_print(void); 90 91/* variables */ --- 19 unchanged lines hidden --- |