/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/sysmacros.h>
/*
* getacct(2), putacct(2), and wracct(2) system calls
*
* The extended accounting subsystem provides three root-privileged system
* calls for interacting with the actual resource data associated with each
* task or process. getacct() copies a packed exacct record reflecting the
* resource usage out to the buffer provided by the user. wracct() writes a
* record to the appropriate extended accounting file. putacct() takes the
* buffer provided by the user, and appends a "tag" record associated with the
* specified task or project that encapsulates the user data. All three of
* these functions exit early if extended accounting is not active for the
* requested entity type.
*
* Locking
* calls are task observers, when executing on an existing task.
*/
/*
* getacct_callback() is used to copyout the buffer with accounting records
* from the kernel back to the user. It also sets actual to the size of the
* kernel buffer--the required minimum size for a successful outbound copy.
*/
/* ARGSUSED */
static int
{
return (EFAULT);
return (0);
}
static int
{
int error;
return (ENOTACTIVE);
}
return (ESRCH);
return (error);
}
static int
{
proc_t *p;
int error;
return (ENOTACTIVE);
}
return (ESRCH);
}
mutex_enter(&p->p_lock);
mutex_exit(&p->p_lock);
return (error);
}
static ssize_t
{
int error;
if (bufsize > EXACCT_MAX_BUFSIZE)
switch (idtype) {
case P_PID:
break;
case P_TASKID:
break;
default:
break;
}
}
static int
{
int error;
proc_t *p;
void *kbuf;
goto out;
}
switch (idtype) {
case P_PID:
} else {
}
break;
case P_TASKID:
} else {
}
break;
default:
break;
}
out:
}
static int
{
int error;
return (ENOTACTIVE);
}
return (ESRCH);
return (error);
}
static int
{
proc_t *p;
int error;
return (ENOTACTIVE);
}
return (ESRCH);
}
mutex_enter(&p->p_lock);
mutex_exit(&p->p_lock);
return (error);
}
static int
{
int error;
/*
* Validate flags.
*/
switch (flags) {
case EW_PARTIAL:
case EW_INTERVAL:
break;
default:
}
switch (idtype) {
case P_PID:
if (flags == EW_INTERVAL)
break;
case P_TASKID:
break;
default:
break;
}
}
static long
int flags)
{
if (secpolicy_acct(CRED()) != 0)
return (set_errno(ENOTACTIVE));
switch (code) {
case 0:
case 1:
case 2:
default:
}
}
#if defined(_LP64)
#else
#endif
6,
(int (*)())exacct
};
"extended accounting facility",
};
#ifdef _SYSCALL32_IMPL
6,
(int (*)())exacct
};
"32-bit extended accounting facility",
};
#endif
&modlsys,
#ifdef _SYSCALL32_IMPL
#endif
};
int
_init(void)
{
return (mod_install(&modlinkage));
}
int
_fini(void)
{
return (mod_remove(&modlinkage));
}
int
{
}