Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Variables
acct.c File Reference
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/acct.h>
#include <linux/capability.h>
#include <linux/file.h>
#include <linux/tty.h>
#include <linux/security.h>
#include <linux/vfs.h>
#include <linux/jiffies.h>
#include <linux/times.h>
#include <linux/syscalls.h>
#include <linux/mount.h>
#include <asm/uaccess.h>
#include <asm/div64.h>
#include <linux/blkdev.h>
#include <linux/pid_namespace.h>

Go to the source code of this file.

Data Structures

struct  bsd_acct_struct
 

Macros

#define RESUME   (acct_parm[0]) /* >foo% free space - resume */
 
#define SUSPEND   (acct_parm[1]) /* <foo% free space - suspend */
 
#define ACCT_TIMEOUT   (acct_parm[2]) /* foo second timeout between checks */
 

Variables

int acct_parm [3] = {4, 2, 30}
 

: file name for accounting records or NULL to shutdown accounting

sys_acct - enable/disable process accounting

Returns 0 for success or negative errno values for failure.

sys_acct() is the only system call needed to implement process accounting. It takes the name of the file where accounting records should be written. If the filename is NULL, accounting will be shutdown.

#define MANTSIZE   13 /* 13 bit mantissa. */
 
#define EXPSIZE   3 /* Base 8 (3 bit) exponent. */
 
#define MAXFRACT   ((1 << MANTSIZE) - 1) /* Maximum fractional value. */
 
 SYSCALL_DEFINE1 (acct, const char __user *, name)
 
void acct_auto_close_mnt (struct vfsmount *m)
 
void acct_auto_close (struct super_block *sb)
 
void acct_exit_ns (struct pid_namespace *ns)
 
void acct_collect (long exitcode, int group_dead)
 
void acct_process (void)
 

Macro Definition Documentation

#define ACCT_TIMEOUT   (acct_parm[2]) /* foo second timeout between checks */

Definition at line 73 of file acct.c.

#define EXPSIZE   3 /* Base 8 (3 bit) exponent. */

Definition at line 349 of file acct.c.

#define MANTSIZE   13 /* 13 bit mantissa. */

Definition at line 348 of file acct.c.

#define MAXFRACT   ((1 << MANTSIZE) - 1) /* Maximum fractional value. */

Definition at line 350 of file acct.c.

#define RESUME   (acct_parm[0]) /* >foo% free space - resume */

Definition at line 71 of file acct.c.

#define SUSPEND   (acct_parm[1]) /* <foo% free space - suspend */

Definition at line 72 of file acct.c.

Function Documentation

void acct_auto_close ( struct super_block sb)

acct_auto_close - turn off a filesystem's accounting if it is on : super block for the filesystem

If the accounting is turned on for a file in the filesystem pointed to by sb, turn accounting off.

Definition at line 311 of file acct.c.

void acct_auto_close_mnt ( struct vfsmount m)

acct_auto_close - turn off a filesystem's accounting if it is on : vfsmount being shut down

If the accounting is turned on for a file in the subtree pointed to to by m, turn accounting off. Done when m is about to die.

Definition at line 290 of file acct.c.

void acct_collect ( long  exitcode,
int  group_dead 
)

acct_collect - collect accounting information into pacct_struct : task exit code : not 0, if this thread is the last one in the process.

Definition at line 566 of file acct.c.

void acct_exit_ns ( struct pid_namespace ns)

Definition at line 325 of file acct.c.

void acct_process ( void  )

acct_process - now just a wrapper around acct_process_in_ns, which in turn is a wrapper around do_acct_process.

handles process accounting for an exiting task

Definition at line 634 of file acct.c.

SYSCALL_DEFINE1 ( acct  ,
const char __user ,
name   
)

Definition at line 255 of file acct.c.

Variable Documentation

int acct_parm[3] = {4, 2, 30}

Definition at line 70 of file acct.c.