mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-16 07:28:13 +08:00
Added more initialization of FIXME_ucred elements.
This commit is contained in:
@@ -48,6 +48,7 @@
|
|||||||
#include <freebsd/sys/lock.h>
|
#include <freebsd/sys/lock.h>
|
||||||
#include <freebsd/sys/mutex.h>
|
#include <freebsd/sys/mutex.h>
|
||||||
#include <freebsd/sys/jail.h>
|
#include <freebsd/sys/jail.h>
|
||||||
|
#include <freebsd/sys/resourcevar.h>
|
||||||
|
|
||||||
RTEMS_CHAIN_DEFINE_EMPTY(rtems_bsd_thread_chain);
|
RTEMS_CHAIN_DEFINE_EMPTY(rtems_bsd_thread_chain);
|
||||||
|
|
||||||
@@ -63,6 +64,9 @@ static struct prison FIXME_prison = {
|
|||||||
.pr_parent = NULL
|
.pr_parent = NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static struct uidinfo FIXME_uidinfo; /* per euid resource consumption */
|
||||||
|
static struct uidinfo FIXME_ruidinfo; /* per ruid resource consumption */
|
||||||
|
|
||||||
static struct thread *
|
static struct thread *
|
||||||
rtems_bsd_thread_init_note( rtems_id id )
|
rtems_bsd_thread_init_note( rtems_id id )
|
||||||
{
|
{
|
||||||
@@ -99,10 +103,14 @@ rtems_bsd_thread_init_note( rtems_id id )
|
|||||||
|
|
||||||
if (prison_init ) {
|
if (prison_init ) {
|
||||||
mtx_init(&FIXME_prison.pr_mtx, "prison lock", NULL, MTX_DEF | MTX_DUPOK);
|
mtx_init(&FIXME_prison.pr_mtx, "prison lock", NULL, MTX_DEF | MTX_DUPOK);
|
||||||
|
|
||||||
prison_init = 0;
|
prison_init = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
FIXME_ucred.cr_prison = &FIXME_prison; /* jail(2) */
|
FIXME_ucred.cr_prison = &FIXME_prison; /* jail(2) */
|
||||||
|
FIXME_ucred.cr_uidinfo = uifind(0);
|
||||||
|
FIXME_ucred.cr_ruidinfo = uifind(0);
|
||||||
|
FIXME_ucred.cr_ngroups = 1; /* group 0 */
|
||||||
|
|
||||||
td->td_proc->p_ucred = crhold(&FIXME_ucred);
|
td->td_proc->p_ucred = crhold(&FIXME_ucred);
|
||||||
mtx_init(&td->td_proc->p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK);
|
mtx_init(&td->td_proc->p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK);
|
||||||
|
Reference in New Issue
Block a user