6 /*===========================================================================*
8 *===========================================================================*/
9 int sys_getinfo(request
, ptr
, len
, ptr2
, len2
)
10 int request
; /* system info requested */
11 void *ptr
; /* pointer where to store it */
12 int len
; /* max length of value to get */
13 void *ptr2
; /* second pointer */
14 int len2
; /* length or process nr */
18 m
.m_lsys_krn_sys_getinfo
.request
= request
;
19 m
.m_lsys_krn_sys_getinfo
.endpt
= SELF
; /* always store values at caller */
20 m
.m_lsys_krn_sys_getinfo
.val_ptr
= (vir_bytes
)ptr
;
21 m
.m_lsys_krn_sys_getinfo
.val_len
= len
;
22 m
.m_lsys_krn_sys_getinfo
.val_ptr2
= (vir_bytes
)ptr2
;
23 m
.m_lsys_krn_sys_getinfo
.val_len2_e
= len2
;
25 return(_kernel_call(SYS_GETINFO
, &m
));
28 /*===========================================================================*
30 *===========================================================================*/
31 int sys_whoami(endpoint_t
*who_ep
, char *who_name
, int len
,
32 int *priv_flags
, int *init_flags
)
38 m
.m_lsys_krn_sys_getinfo
.request
= GET_WHOAMI
;
43 if((r
= _kernel_call(SYS_GETINFO
, &m
)) != OK
)
46 lenmin
= MIN((size_t) len
, sizeof(m
.m_krn_lsys_sys_getwhoami
.name
)) - 1;
48 strncpy(who_name
, m
.m_krn_lsys_sys_getwhoami
.name
, lenmin
);
49 who_name
[lenmin
] = '\0';
50 *who_ep
= m
.m_krn_lsys_sys_getwhoami
.endpt
;
51 *priv_flags
= m
.m_krn_lsys_sys_getwhoami
.privflags
;
52 *init_flags
= m
.m_krn_lsys_sys_getwhoami
.initflags
;