PERFORCE change 187675 for review
Edward Tomasz Napierala
trasz at FreeBSD.org
Mon Jan 10 21:31:04 UTC 2011
http://p4web.freebsd.org/@@187675?ac=10
Change 187675 by trasz at trasz_victim on 2011/01/10 21:30:07
Get rid of the HRL name, replacing it with "rctl". It's a good name;
Solaris uses it, although our syntax is completely different.
Affected files ...
.. //depot/projects/soc2009/trasz_limits/lib/libc/sys/Symbol.map#12 edit
.. //depot/projects/soc2009/trasz_limits/sys/compat/freebsd32/freebsd32_proto.h#12 edit
.. //depot/projects/soc2009/trasz_limits/sys/compat/freebsd32/freebsd32_syscall.h#11 edit
.. //depot/projects/soc2009/trasz_limits/sys/compat/freebsd32/freebsd32_syscalls.c#11 edit
.. //depot/projects/soc2009/trasz_limits/sys/compat/freebsd32/freebsd32_sysent.c#12 edit
.. //depot/projects/soc2009/trasz_limits/sys/compat/freebsd32/syscalls.master#14 edit
.. //depot/projects/soc2009/trasz_limits/sys/conf/NOTES#30 edit
.. //depot/projects/soc2009/trasz_limits/sys/conf/files#42 edit
.. //depot/projects/soc2009/trasz_limits/sys/conf/options#26 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/imgact_aout.c#13 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/imgact_elf.c#22 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/init_main.c#35 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/init_sysent.c#14 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_container.c#51 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_hrl.c#105 delete
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_loginclass.c#25 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_prot.c#31 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_rctl.c#1 add
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_resource.c#58 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/syscalls.c#13 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/syscalls.master#15 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/systrace_args.c#12 edit
.. //depot/projects/soc2009/trasz_limits/sys/sys/container.h#20 edit
.. //depot/projects/soc2009/trasz_limits/sys/sys/hrl.h#51 delete
.. //depot/projects/soc2009/trasz_limits/sys/sys/jail.h#18 edit
.. //depot/projects/soc2009/trasz_limits/sys/sys/loginclass.h#11 edit
.. //depot/projects/soc2009/trasz_limits/sys/sys/priv.h#13 edit
.. //depot/projects/soc2009/trasz_limits/sys/sys/rctl.h#1 add
.. //depot/projects/soc2009/trasz_limits/sys/sys/resourcevar.h#23 edit
.. //depot/projects/soc2009/trasz_limits/sys/sys/syscall.h#13 edit
.. //depot/projects/soc2009/trasz_limits/sys/sys/syscall.mk#13 edit
.. //depot/projects/soc2009/trasz_limits/sys/sys/sysproto.h#14 edit
.. //depot/projects/soc2009/trasz_limits/usr.bin/Makefile#15 edit
.. //depot/projects/soc2009/trasz_limits/usr.bin/rctl/Makefile#1 add
.. //depot/projects/soc2009/trasz_limits/usr.bin/rctl/rctl.8#1 add
.. //depot/projects/soc2009/trasz_limits/usr.bin/rctl/rctl.c#1 add
.. //depot/projects/soc2009/trasz_limits/usr.bin/userstat/userstat.sh#3 edit
.. //depot/projects/soc2009/trasz_limits/usr.sbin/Makefile#19 edit
.. //depot/projects/soc2009/trasz_limits/usr.sbin/hrl/Makefile#7 delete
.. //depot/projects/soc2009/trasz_limits/usr.sbin/hrl/hrl.8#5 delete
.. //depot/projects/soc2009/trasz_limits/usr.sbin/hrl/hrl.c#29 delete
Differences ...
==== //depot/projects/soc2009/trasz_limits/lib/libc/sys/Symbol.map#12 (text) ====
@@ -360,11 +360,11 @@
shmctl;
symlinkat;
unlinkat;
- hrl_get_usage;
- hrl_get_rules;
- hrl_get_limits;
- hrl_add_rule;
- hrl_remove_rule;
+ rctl_get_usage;
+ rctl_get_rules;
+ rctl_get_limits;
+ rctl_add_rule;
+ rctl_remove_rule;
};
FBSDprivate_1.0 {
==== //depot/projects/soc2009/trasz_limits/sys/compat/freebsd32/freebsd32_proto.h#12 (text+ko) ====
@@ -2,8 +2,8 @@
* System call prototypes.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.116 2010/06/28 18:17:21 kib Exp $
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 209579 2010-06-28 18:06:46Z kib
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.132 2010/06/28 18:06:46 kib Exp
*/
#ifndef _FREEBSD32_SYSPROTO_H_
==== //depot/projects/soc2009/trasz_limits/sys/compat/freebsd32/freebsd32_syscall.h#11 (text+ko) ====
@@ -2,8 +2,8 @@
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.112 2010/06/28 18:17:21 kib Exp $
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 209579 2010-06-28 18:06:46Z kib
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.132 2010/06/28 18:06:46 kib Exp
*/
#define FREEBSD32_SYS_syscall 0
@@ -410,4 +410,11 @@
#define FREEBSD32_SYS_freebsd32_shmctl 512
#define FREEBSD32_SYS_lpathconf 513
#define FREEBSD32_SYS_freebsd32_pselect 522
-#define FREEBSD32_SYS_MAXSYSCALL 523
+#define FREEBSD32_SYS_getloginclass 523
+#define FREEBSD32_SYS_setloginclass 524
+#define FREEBSD32_SYS_rctl_get_usage 525
+#define FREEBSD32_SYS_rctl_get_rules 526
+#define FREEBSD32_SYS_rctl_get_limits 527
+#define FREEBSD32_SYS_rctl_add_rule 528
+#define FREEBSD32_SYS_rctl_remove_rule 529
+#define FREEBSD32_SYS_MAXSYSCALL 530
==== //depot/projects/soc2009/trasz_limits/sys/compat/freebsd32/freebsd32_syscalls.c#11 (text+ko) ====
@@ -2,8 +2,8 @@
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.103 2010/06/28 18:17:21 kib Exp $
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 209579 2010-06-28 18:06:46Z kib
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.132 2010/06/28 18:06:46 kib Exp
*/
const char *freebsd32_syscallnames[] = {
@@ -546,4 +546,11 @@
"#520", /* 520 = pdgetpid */
"#521", /* 521 = pdwait */
"freebsd32_pselect", /* 522 = freebsd32_pselect */
+ "getloginclass", /* 523 = getloginclass */
+ "setloginclass", /* 524 = setloginclass */
+ "rctl_get_usage", /* 525 = rctl_get_usage */
+ "rctl_get_rules", /* 526 = rctl_get_rules */
+ "rctl_get_limits", /* 527 = rctl_get_limits */
+ "rctl_add_rule", /* 528 = rctl_add_rule */
+ "rctl_remove_rule", /* 529 = rctl_remove_rule */
};
==== //depot/projects/soc2009/trasz_limits/sys/compat/freebsd32/freebsd32_sysent.c#12 (text+ko) ====
@@ -2,8 +2,8 @@
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.114 2010/06/28 18:17:21 kib Exp $
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 209579 2010-06-28 18:06:46Z kib
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.132 2010/06/28 18:06:46 kib Exp
*/
#include "opt_compat.h"
@@ -583,4 +583,11 @@
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 520 = pdgetpid */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 521 = pdwait */
{ AS(freebsd32_pselect_args), (sy_call_t *)freebsd32_pselect, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 522 = freebsd32_pselect */
+ { AS(getloginclass_args), (sy_call_t *)getloginclass, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 523 = getloginclass */
+ { AS(setloginclass_args), (sy_call_t *)setloginclass, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 524 = setloginclass */
+ { AS(rctl_get_usage_args), (sy_call_t *)rctl_get_usage, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 525 = rctl_get_usage */
+ { AS(rctl_get_rules_args), (sy_call_t *)rctl_get_rules, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 526 = rctl_get_rules */
+ { AS(rctl_get_limits_args), (sy_call_t *)rctl_get_limits, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 527 = rctl_get_limits */
+ { AS(rctl_add_rule_args), (sy_call_t *)rctl_add_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 528 = rctl_add_rule */
+ { AS(rctl_remove_rule_args), (sy_call_t *)rctl_remove_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 529 = rctl_remove_rule */
};
==== //depot/projects/soc2009/trasz_limits/sys/compat/freebsd32/syscalls.master#14 (text+ko) ====
@@ -965,8 +965,8 @@
523 AUE_NULL NOPROTO { int getloginclass(char *namebuf, size_t \
namelen); }
524 AUE_NULL NOPROTO { int setloginclass(const char *namebuf); }
-525 AUE_NULL NOPROTO { int hrl_get_usage(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
-526 AUE_NULL NOPROTO { int hrl_get_rules(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
-527 AUE_NULL NOPROTO { int hrl_get_limits(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
-528 AUE_NULL NOPROTO { int hrl_add_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
-529 AUE_NULL NOPROTO { int hrl_remove_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
+525 AUE_NULL NOPROTO { int rctl_get_usage(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
+526 AUE_NULL NOPROTO { int rctl_get_rules(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
+527 AUE_NULL NOPROTO { int rctl_get_limits(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
+528 AUE_NULL NOPROTO { int rctl_add_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
+529 AUE_NULL NOPROTO { int rctl_remove_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
==== //depot/projects/soc2009/trasz_limits/sys/conf/NOTES#30 (text+ko) ====
@@ -1160,8 +1160,8 @@
# Resource Containers
options CONTAINERS
-# Hierarchical Resource Limits
-options HRL
+# Resource Limits
+options RCTL
#####################################################################
==== //depot/projects/soc2009/trasz_limits/sys/conf/files#42 (text+ko) ====
@@ -2142,7 +2142,6 @@
kern/kern_fork.c standard
kern/kern_gzio.c optional gzio
kern/kern_hhook.c standard
-kern/kern_hrl.c standard
kern/kern_idle.c standard
kern/kern_intr.c standard
kern/kern_jail.c standard
@@ -2169,6 +2168,7 @@
kern/kern_priv.c standard
kern/kern_proc.c standard
kern/kern_prot.c standard
+kern/kern_rctl.c standard
kern/kern_resource.c standard
kern/kern_rmlock.c standard
kern/kern_rwlock.c standard
==== //depot/projects/soc2009/trasz_limits/sys/conf/options#26 (text+ko) ====
@@ -860,5 +860,5 @@
# Resource Containers
CONTAINERS opt_global.h
-# Hierarchical Resource Limits
-HRL opt_global.h
+# Resource Limits
+RCTL opt_global.h
==== //depot/projects/soc2009/trasz_limits/sys/kern/imgact_aout.c#13 (text+ko) ====
@@ -29,7 +29,7 @@
#include <sys/param.h>
#include <sys/exec.h>
-#include <sys/hrl.h>
+#include <sys/container.h>
#include <sys/imgact.h>
#include <sys/imgact_aout.h>
#include <sys/kernel.h>
==== //depot/projects/soc2009/trasz_limits/sys/kern/imgact_elf.c#22 (text+ko) ====
@@ -37,7 +37,7 @@
#include <sys/param.h>
#include <sys/container.h>
#include <sys/exec.h>
-#include <sys/hrl.h>
+#include <sys/container.h>
#include <sys/fcntl.h>
#include <sys/imgact.h>
#include <sys/imgact_elf.h>
==== //depot/projects/soc2009/trasz_limits/sys/kern/init_main.c#35 (text+ko) ====
@@ -49,10 +49,10 @@
#include <sys/param.h>
#include <sys/kernel.h>
+#include <sys/container.h>
#include <sys/exec.h>
#include <sys/file.h>
#include <sys/filedesc.h>
-#include <sys/hrl.h>
#include <sys/jail.h>
#include <sys/ktr.h>
#include <sys/lock.h>
==== //depot/projects/soc2009/trasz_limits/sys/kern/init_sysent.c#14 (text+ko) ====
@@ -2,8 +2,8 @@
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/kern/init_sysent.c,v 1.257 2010/08/30 14:26:02 kib Exp $
- * created from FreeBSD: head/sys/kern/syscalls.master 211998 2010-08-30 14:24:44Z kib
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.265 2010/08/30 14:24:44 kib Exp
*/
#include "opt_compat.h"
@@ -557,4 +557,11 @@
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 520 = pdgetpid */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 521 = pdwait */
{ AS(pselect_args), (sy_call_t *)pselect, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 522 = pselect */
+ { AS(getloginclass_args), (sy_call_t *)getloginclass, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 523 = getloginclass */
+ { AS(setloginclass_args), (sy_call_t *)setloginclass, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 524 = setloginclass */
+ { AS(rctl_get_usage_args), (sy_call_t *)rctl_get_usage, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 525 = rctl_get_usage */
+ { AS(rctl_get_rules_args), (sy_call_t *)rctl_get_rules, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 526 = rctl_get_rules */
+ { AS(rctl_get_limits_args), (sy_call_t *)rctl_get_limits, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 527 = rctl_get_limits */
+ { AS(rctl_add_rule_args), (sy_call_t *)rctl_add_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 528 = rctl_add_rule */
+ { AS(rctl_remove_rule_args), (sy_call_t *)rctl_remove_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 529 = rctl_remove_rule */
};
==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_container.c#51 (text+ko) ====
@@ -56,8 +56,8 @@
#include <sys/systm.h>
#include <sys/umtx.h>
-#ifdef HRL
-#include <sys/hrl.h>
+#ifdef RCTL
+#include <sys/rctl.h>
#endif
#ifdef CONTAINERS
@@ -295,7 +295,7 @@
int
rusage_add(struct proc *p, int resource, uint64_t amount)
{
-#ifdef HRL
+#ifdef RCTL
int error;
#endif
@@ -308,8 +308,8 @@
resource, amount));
mtx_lock(&container_lock);
-#ifdef HRL
- error = hrl_enforce_proc(p, resource, amount);
+#ifdef RCTL
+ error = rctl_enforce_proc(p, resource, amount);
if (error && container_resource_deniable(resource)) {
SDT_PROBE(container, kernel, rusage, add_failure, p, resource, amount, 0, 0);
mtx_unlock(&container_lock);
@@ -380,7 +380,7 @@
rusage_set_locked(struct proc *p, int resource, uint64_t amount)
{
int64_t diff;
-#ifdef HRL
+#ifdef RCTL
int error;
#endif
@@ -398,9 +398,9 @@
("rusage_set: usage of non-reclaimable resource %d dropping",
resource));
#endif
-#ifdef HRL
+#ifdef RCTL
if (diff > 0) {
- error = hrl_enforce_proc(p, resource, diff);
+ error = rctl_enforce_proc(p, resource, diff);
if (error && container_resource_deniable(resource)) {
SDT_PROBE(container, kernel, rusage, set_failure, p, resource, amount, 0, 0);
return (error);
@@ -466,8 +466,8 @@
rusage_get_limit(struct proc *p, int resource)
{
-#ifdef HRL
- return (hrl_available_proc(p, resource));
+#ifdef RCTL
+ return (rctl_available_proc(p, resource));
#else
return (UINT64_MAX);
#endif
@@ -584,9 +584,9 @@
PROC_UNLOCK(child);
PROC_UNLOCK(parent);
-#ifdef HRL
+#ifdef RCTL
if (error == 0) {
- error = hrl_proc_fork(parent, child);
+ error = rctl_proc_fork(parent, child);
if (error != 0) {
mtx_lock(&container_lock);
/*
@@ -614,8 +614,8 @@
rusage_set(p, RUSAGE_NPTS, 0);
rusage_set(p, RUSAGE_NTHR, 0);
-#ifdef HRL
- hrl_proc_exit(p);
+#ifdef RCTL
+ rctl_proc_exit(p);
#endif
container_destroy(&p->p_container);
}
@@ -657,8 +657,8 @@
}
mtx_unlock(&container_lock);
-#ifdef HRL
- hrl_proc_ucred_changing(p, newcred);
+#ifdef RCTL
+ rctl_proc_ucred_changing(p, newcred);
#endif
}
==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_loginclass.c#25 (text+ko) ====
@@ -70,7 +70,7 @@
static struct mtx loginclasses_lock;
static void lc_init(void);
-SYSINIT(hrl, SI_SUB_CPU, SI_ORDER_FIRST, lc_init, NULL);
+SYSINIT(loginclass, SI_SUB_CPU, SI_ORDER_FIRST, lc_init, NULL);
void
loginclass_acquire(struct loginclass *lc)
==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_prot.c#31 (text+ko) ====
@@ -2117,7 +2117,7 @@
}
/*
- * Assign new credential to the process, fixing up HRL accounting
+ * Assign new credential to the process, fixing up RCTL accounting
* as neccessary.
*/
void
==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_resource.c#58 (text+ko) ====
@@ -44,7 +44,6 @@
#include <sys/sysproto.h>
#include <sys/container.h>
#include <sys/file.h>
-#include <sys/hrl.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/malloc.h>
==== //depot/projects/soc2009/trasz_limits/sys/kern/syscalls.c#13 (text+ko) ====
@@ -2,8 +2,8 @@
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/kern/syscalls.c,v 1.240 2010/08/30 14:26:02 kib Exp $
- * created from FreeBSD: head/sys/kern/syscalls.master 211998 2010-08-30 14:24:44Z kib
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.265 2010/08/30 14:24:44 kib Exp
*/
const char *syscallnames[] = {
@@ -530,4 +530,11 @@
"#520", /* 520 = pdgetpid */
"#521", /* 521 = pdwait */
"pselect", /* 522 = pselect */
+ "getloginclass", /* 523 = getloginclass */
+ "setloginclass", /* 524 = setloginclass */
+ "rctl_get_usage", /* 525 = rctl_get_usage */
+ "rctl_get_rules", /* 526 = rctl_get_rules */
+ "rctl_get_limits", /* 527 = rctl_get_limits */
+ "rctl_add_rule", /* 528 = rctl_add_rule */
+ "rctl_remove_rule", /* 529 = rctl_remove_rule */
};
==== //depot/projects/soc2009/trasz_limits/sys/kern/syscalls.master#15 (text+ko) ====
@@ -929,10 +929,10 @@
523 AUE_NULL STD { int getloginclass(char *namebuf, size_t \
namelen); }
524 AUE_NULL STD { int setloginclass(const char *namebuf); }
-525 AUE_NULL STD { int hrl_get_usage(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
-526 AUE_NULL STD { int hrl_get_rules(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
-527 AUE_NULL STD { int hrl_get_limits(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
-528 AUE_NULL STD { int hrl_add_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
-529 AUE_NULL STD { int hrl_remove_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
+525 AUE_NULL STD { int rctl_get_usage(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
+526 AUE_NULL STD { int rctl_get_rules(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
+527 AUE_NULL STD { int rctl_get_limits(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
+528 AUE_NULL STD { int rctl_add_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
+529 AUE_NULL STD { int rctl_remove_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
; Please copy any additions and changes to the following compatability tables:
; sys/compat/freebsd32/syscalls.master
==== //depot/projects/soc2009/trasz_limits/sys/kern/systrace_args.c#12 (text+ko) ====
@@ -2,7 +2,7 @@
* System call argument to DTrace register array converstion.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/kern/systrace_args.c,v 1.36 2010/08/30 14:26:02 kib Exp $
+ * $FreeBSD$
* This file is part of the DTrace syscall provider.
*/
@@ -3108,6 +3108,71 @@
*n_args = 6;
break;
}
+ /* getloginclass */
+ case 523: {
+ struct getloginclass_args *p = params;
+ uarg[0] = (intptr_t) p->namebuf; /* char * */
+ uarg[1] = p->namelen; /* size_t */
+ *n_args = 2;
+ break;
+ }
+ /* setloginclass */
+ case 524: {
+ struct setloginclass_args *p = params;
+ uarg[0] = (intptr_t) p->namebuf; /* const char * */
+ *n_args = 1;
+ break;
+ }
+ /* rctl_get_usage */
+ case 525: {
+ struct rctl_get_usage_args *p = params;
+ uarg[0] = (intptr_t) p->inbufp; /* const void * */
+ uarg[1] = p->inbuflen; /* size_t */
+ uarg[2] = (intptr_t) p->outbufp; /* void * */
+ uarg[3] = p->outbuflen; /* size_t */
+ *n_args = 4;
+ break;
+ }
+ /* rctl_get_rules */
+ case 526: {
+ struct rctl_get_rules_args *p = params;
+ uarg[0] = (intptr_t) p->inbufp; /* const void * */
+ uarg[1] = p->inbuflen; /* size_t */
+ uarg[2] = (intptr_t) p->outbufp; /* void * */
+ uarg[3] = p->outbuflen; /* size_t */
+ *n_args = 4;
+ break;
+ }
+ /* rctl_get_limits */
+ case 527: {
+ struct rctl_get_limits_args *p = params;
+ uarg[0] = (intptr_t) p->inbufp; /* const void * */
+ uarg[1] = p->inbuflen; /* size_t */
+ uarg[2] = (intptr_t) p->outbufp; /* void * */
+ uarg[3] = p->outbuflen; /* size_t */
+ *n_args = 4;
+ break;
+ }
+ /* rctl_add_rule */
+ case 528: {
+ struct rctl_add_rule_args *p = params;
+ uarg[0] = (intptr_t) p->inbufp; /* const void * */
+ uarg[1] = p->inbuflen; /* size_t */
+ uarg[2] = (intptr_t) p->outbufp; /* void * */
+ uarg[3] = p->outbuflen; /* size_t */
+ *n_args = 4;
+ break;
+ }
+ /* rctl_remove_rule */
+ case 529: {
+ struct rctl_remove_rule_args *p = params;
+ uarg[0] = (intptr_t) p->inbufp; /* const void * */
+ uarg[1] = p->inbuflen; /* size_t */
+ uarg[2] = (intptr_t) p->outbufp; /* void * */
+ uarg[3] = p->outbuflen; /* size_t */
+ *n_args = 4;
+ break;
+ }
default:
*n_args = 0;
break;
@@ -8265,6 +8330,124 @@
break;
};
break;
+ /* getloginclass */
+ case 523:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "size_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* setloginclass */
+ case 524:
+ switch(ndx) {
+ case 0:
+ p = "const char *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* rctl_get_usage */
+ case 525:
+ switch(ndx) {
+ case 0:
+ p = "const void *";
+ break;
+ case 1:
+ p = "size_t";
+ break;
+ case 2:
+ p = "void *";
+ break;
+ case 3:
+ p = "size_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* rctl_get_rules */
+ case 526:
+ switch(ndx) {
+ case 0:
+ p = "const void *";
+ break;
+ case 1:
+ p = "size_t";
+ break;
+ case 2:
+ p = "void *";
+ break;
+ case 3:
+ p = "size_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* rctl_get_limits */
+ case 527:
+ switch(ndx) {
+ case 0:
+ p = "const void *";
+ break;
+ case 1:
+ p = "size_t";
+ break;
+ case 2:
+ p = "void *";
+ break;
+ case 3:
+ p = "size_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* rctl_add_rule */
+ case 528:
+ switch(ndx) {
+ case 0:
+ p = "const void *";
+ break;
+ case 1:
+ p = "size_t";
+ break;
+ case 2:
+ p = "void *";
+ break;
+ case 3:
+ p = "size_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* rctl_remove_rule */
+ case 529:
+ switch(ndx) {
+ case 0:
+ p = "const void *";
+ break;
+ case 1:
+ p = "size_t";
+ break;
+ case 2:
+ p = "void *";
+ break;
+ case 3:
+ p = "size_t";
+ break;
+ default:
+ break;
+ };
+ break;
default:
break;
};
==== //depot/projects/soc2009/trasz_limits/sys/sys/container.h#20 (text+ko) ====
@@ -37,7 +37,7 @@
#include <sys/types.h>
struct proc;
-struct hrl_rule_link;
+struct rctl_rule_link;
struct ucred;
/*
@@ -85,13 +85,13 @@
* for other objects are initialized when there is a rule which requires
* it. For example, uidinfo will have container assigned only if there
* is a rule this uidinfo is subject to, and 'hr_per' for this rule
- * is HRL_SUBJECT_TYPE_USER.
+ * is RCTL_SUBJECT_TYPE_USER.
*
* This structure must be filled with zeroes initially.
*/
struct container {
int64_t c_resources[RUSAGE_MAX + 1];
- LIST_HEAD(, hrl_rule_link) c_rule_links;
+ LIST_HEAD(, rctl_rule_link) c_rule_links;
};
int rusage_add(struct proc *p, int resource, uint64_t amount);
==== //depot/projects/soc2009/trasz_limits/sys/sys/jail.h#18 (text+ko) ====
@@ -342,7 +342,6 @@
struct sockaddr;
struct statfs;
struct container;
-struct hrl_rule;
int jailed(struct ucred *cred);
int jailed_without_vnet(struct ucred *);
void getcredhostname(struct ucred *, char *, size_t);
==== //depot/projects/soc2009/trasz_limits/sys/sys/loginclass.h#11 (text+ko) ====
@@ -39,8 +39,6 @@
struct container lc_container;
};
-struct hrl_rule;
-
void loginclass_acquire(struct loginclass *lc);
void loginclass_release(struct loginclass *lc);
struct loginclass *loginclass_find(const char *name);
==== //depot/projects/soc2009/trasz_limits/sys/sys/priv.h#13 (text+ko) ====
@@ -484,10 +484,10 @@
#define PRIV_AFS_DAEMON 661 /* Can become the AFS daemon. */
/*
- * Hierarchical Resource Limits privileges.
+ * Resource Limits privileges.
*/
-#define PRIV_HRL_SET 670
-#define PRIV_HRL_GET 671
+#define PRIV_RCTL_SET 670
+#define PRIV_RCTL_GET 671
/*
* Track end of privilege list.
==== //depot/projects/soc2009/trasz_limits/sys/sys/resourcevar.h#23 (text+ko) ====
@@ -109,7 +109,6 @@
struct proc;
struct rusage_ext;
struct thread;
-struct hrl_rule;
void addupc_intr(struct thread *td, uintfptr_t pc, u_int ticks);
void addupc_task(struct thread *td, uintfptr_t pc, u_int ticks);
==== //depot/projects/soc2009/trasz_limits/sys/sys/syscall.h#13 (text+ko) ====
@@ -2,8 +2,8 @@
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/sys/syscall.h,v 1.237 2010/08/30 14:26:02 kib Exp $
- * created from FreeBSD: head/sys/kern/syscalls.master 211998 2010-08-30 14:24:44Z kib
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.265 2010/08/30 14:24:44 kib Exp
*/
#define SYS_syscall 0
@@ -431,4 +431,11 @@
#define SYS_shmctl 512
#define SYS_lpathconf 513
#define SYS_pselect 522
-#define SYS_MAXSYSCALL 523
+#define SYS_getloginclass 523
+#define SYS_setloginclass 524
+#define SYS_rctl_get_usage 525
+#define SYS_rctl_get_rules 526
+#define SYS_rctl_get_limits 527
+#define SYS_rctl_add_rule 528
+#define SYS_rctl_remove_rule 529
+#define SYS_MAXSYSCALL 530
==== //depot/projects/soc2009/trasz_limits/sys/sys/syscall.mk#13 (text+ko) ====
@@ -1,7 +1,7 @@
# FreeBSD system call names.
# DO NOT EDIT-- this file is automatically generated.
-# $FreeBSD: src/sys/sys/syscall.mk,v 1.192 2010/08/30 14:26:02 kib Exp $
-# created from FreeBSD: head/sys/kern/syscalls.master 211998 2010-08-30 14:24:44Z kib
+# $FreeBSD$
+# created from FreeBSD: src/sys/kern/syscalls.master,v 1.265 2010/08/30 14:24:44 kib Exp
MIASM = \
syscall.o \
exit.o \
@@ -379,4 +379,11 @@
msgctl.o \
shmctl.o \
lpathconf.o \
- pselect.o
+ pselect.o \
+ getloginclass.o \
+ setloginclass.o \
+ rctl_get_usage.o \
+ rctl_get_rules.o \
+ rctl_get_limits.o \
+ rctl_add_rule.o \
+ rctl_remove_rule.o
==== //depot/projects/soc2009/trasz_limits/sys/sys/sysproto.h#14 (text+ko) ====
@@ -2,8 +2,8 @@
* System call prototypes.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/sys/sysproto.h,v 1.244 2010/08/30 14:26:02 kib Exp $
- * created from FreeBSD: head/sys/kern/syscalls.master 211998 2010-08-30 14:24:44Z kib
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.265 2010/08/30 14:24:44 kib Exp
*/
#ifndef _SYS_SYSPROTO_H_
@@ -1665,6 +1665,43 @@
char ts_l_[PADL_(const struct timespec *)]; const struct timespec * ts; char ts_r_[PADR_(const struct timespec *)];
char sm_l_[PADL_(const sigset_t *)]; const sigset_t * sm; char sm_r_[PADR_(const sigset_t *)];
};
+struct getloginclass_args {
+ char namebuf_l_[PADL_(char *)]; char * namebuf; char namebuf_r_[PADR_(char *)];
+ char namelen_l_[PADL_(size_t)]; size_t namelen; char namelen_r_[PADR_(size_t)];
+};
+struct setloginclass_args {
+ char namebuf_l_[PADL_(const char *)]; const char * namebuf; char namebuf_r_[PADR_(const char *)];
+};
+struct rctl_get_usage_args {
+ char inbufp_l_[PADL_(const void *)]; const void * inbufp; char inbufp_r_[PADR_(const void *)];
+ char inbuflen_l_[PADL_(size_t)]; size_t inbuflen; char inbuflen_r_[PADR_(size_t)];
+ char outbufp_l_[PADL_(void *)]; void * outbufp; char outbufp_r_[PADR_(void *)];
+ char outbuflen_l_[PADL_(size_t)]; size_t outbuflen; char outbuflen_r_[PADR_(size_t)];
+};
+struct rctl_get_rules_args {
+ char inbufp_l_[PADL_(const void *)]; const void * inbufp; char inbufp_r_[PADR_(const void *)];
+ char inbuflen_l_[PADL_(size_t)]; size_t inbuflen; char inbuflen_r_[PADR_(size_t)];
+ char outbufp_l_[PADL_(void *)]; void * outbufp; char outbufp_r_[PADR_(void *)];
+ char outbuflen_l_[PADL_(size_t)]; size_t outbuflen; char outbuflen_r_[PADR_(size_t)];
+};
+struct rctl_get_limits_args {
+ char inbufp_l_[PADL_(const void *)]; const void * inbufp; char inbufp_r_[PADR_(const void *)];
+ char inbuflen_l_[PADL_(size_t)]; size_t inbuflen; char inbuflen_r_[PADR_(size_t)];
+ char outbufp_l_[PADL_(void *)]; void * outbufp; char outbufp_r_[PADR_(void *)];
+ char outbuflen_l_[PADL_(size_t)]; size_t outbuflen; char outbuflen_r_[PADR_(size_t)];
+};
+struct rctl_add_rule_args {
+ char inbufp_l_[PADL_(const void *)]; const void * inbufp; char inbufp_r_[PADR_(const void *)];
+ char inbuflen_l_[PADL_(size_t)]; size_t inbuflen; char inbuflen_r_[PADR_(size_t)];
+ char outbufp_l_[PADL_(void *)]; void * outbufp; char outbufp_r_[PADR_(void *)];
+ char outbuflen_l_[PADL_(size_t)]; size_t outbuflen; char outbuflen_r_[PADR_(size_t)];
+};
+struct rctl_remove_rule_args {
+ char inbufp_l_[PADL_(const void *)]; const void * inbufp; char inbufp_r_[PADR_(const void *)];
+ char inbuflen_l_[PADL_(size_t)]; size_t inbuflen; char inbuflen_r_[PADR_(size_t)];
+ char outbufp_l_[PADL_(void *)]; void * outbufp; char outbufp_r_[PADR_(void *)];
+ char outbuflen_l_[PADL_(size_t)]; size_t outbuflen; char outbuflen_r_[PADR_(size_t)];
+};
int nosys(struct thread *, struct nosys_args *);
void sys_exit(struct thread *, struct sys_exit_args *);
int fork(struct thread *, struct fork_args *);
@@ -2026,6 +2063,13 @@
int shmctl(struct thread *, struct shmctl_args *);
int lpathconf(struct thread *, struct lpathconf_args *);
int pselect(struct thread *, struct pselect_args *);
+int getloginclass(struct thread *, struct getloginclass_args *);
+int setloginclass(struct thread *, struct setloginclass_args *);
+int rctl_get_usage(struct thread *, struct rctl_get_usage_args *);
+int rctl_get_rules(struct thread *, struct rctl_get_rules_args *);
+int rctl_get_limits(struct thread *, struct rctl_get_limits_args *);
+int rctl_add_rule(struct thread *, struct rctl_add_rule_args *);
+int rctl_remove_rule(struct thread *, struct rctl_remove_rule_args *);
#ifdef COMPAT_43
@@ -2701,6 +2745,13 @@
#define SYS_AUE_shmctl AUE_SHMCTL
#define SYS_AUE_lpathconf AUE_LPATHCONF
#define SYS_AUE_pselect AUE_SELECT
+#define SYS_AUE_getloginclass AUE_NULL
+#define SYS_AUE_setloginclass AUE_NULL
+#define SYS_AUE_rctl_get_usage AUE_NULL
+#define SYS_AUE_rctl_get_rules AUE_NULL
+#define SYS_AUE_rctl_get_limits AUE_NULL
+#define SYS_AUE_rctl_add_rule AUE_NULL
+#define SYS_AUE_rctl_remove_rule AUE_NULL
#undef PAD_
#undef PADL_
==== //depot/projects/soc2009/trasz_limits/usr.bin/Makefile#15 (text+ko) ====
@@ -123,6 +123,7 @@
printenv \
printf \
procstat \
+ rctl \
renice \
rev \
revoke \
==== //depot/projects/soc2009/trasz_limits/usr.bin/userstat/userstat.sh#3 (text+ko) ====
@@ -60,7 +60,7 @@
printf "JID\t%%CPU\tRSS\tVSIZE\tSWAP\n"
for jail in $jails; do
printf "$jail\t"
- hrl $hflag -u j:$jail | format_stats
+ rctl $hflag -u j:$jail | format_stats
done
else
@@ -68,7 +68,7 @@
printf "USER\t%%CPU\tRSS\tVSIZE\tSWAP\n"
for user in $users; do
printf "$user\t"
- hrl $hflag -u u:$user | format_stats
+ rctl $hflag -u u:$user | format_stats
done
fi
==== //depot/projects/soc2009/trasz_limits/usr.sbin/Makefile#19 (text+ko) ====
@@ -28,7 +28,6 @@
getfmac \
getpmac \
gstat \
- hrl \
i2c \
ifmcstat \
inetd \
More information about the p4-projects
mailing list