_getdents.c \
_getdma.c \
_getnpid.c \
+ _getnuid.c \
+ _getngid.c \
_getnprocnr.c \
_getpprocnr.c \
_getprocnr.c \
_svrctl.c \
_sysuname.c \
_vm_dmacalls.c \
+ _vm_set_priv.c \
+ _vm_query_exit.c \
asynchio.c \
basename.c \
bcmp.c \
lrand.c \
lsearch.c \
memccpy.c \
+ minix_rs.c \
mstats.c \
mtab.c \
nlist.c \
message m;
if (addr != _brksize) {
- m.m1_p1 = addr;
+ m.PMBRK_ADDR = addr;
if (_syscall(MM, BRK, &m) < 0) return(-1);
_brksize = m.m2_p1;
}
--- /dev/null
+#include <lib.h>
+#define getngid _getngid
+#include <unistd.h>
+
+PUBLIC gid_t getngid(int proc_nr)
+{
+ message m;
+ m.m1_i1 = proc_nr; /* search gid for this process */
+ if (_syscall(MM, GETGID, &m) < 0) return ( (gid_t) -1);
+ return( (gid_t) m.m2_i2); /* return search result */
+}
{
message m;
m.m1_i1 = proc_nr; /* search pid for this process */
- if (_syscall(MM, GETPID, &m) < 0) return ( (pid_t) -1);
+ if (_syscall(MM, MINIX_GETPID, &m) < 0) return ( (pid_t) -1);
return( (pid_t) m.m2_i2); /* return search result */
}
--- /dev/null
+#include <lib.h>
+#define getnuid _getnuid
+#include <unistd.h>
+
+PUBLIC uid_t getnuid(int proc_nr)
+{
+ message m;
+ m.m1_i1 = proc_nr; /* search uid for this process */
+ if (_syscall(MM, GETUID, &m) < 0) return ( (uid_t) -1);
+ return( (uid_t) m.m2_i2); /* return search result */
+}
--- /dev/null
+#define _SYSTEM 1
+#include <lib.h>
+#define vm_query_exit _vm_query_exit
+#include <unistd.h>
+
+/* return -1, when the query itself or the processing of query has errors.
+ * return 1, when there are more processes waiting to be queried.
+ * return 0, when there are no more processes.
+ * note that for the return value of 0 and 1, the 'endpt' is set accordingly.
+ */
+PUBLIC int vm_query_exit(int *endpt)
+{
+ message m;
+ int r;
+
+ r = _syscall(VM_PROC_NR, VM_QUERY_EXIT, &m);
+ if (r != OK)
+ return -1;
+ if (endpt == NULL)
+ return -1;
+
+ *endpt = m.VM_QUERY_RET_PT;
+ return (m.VM_QUERY_IS_MORE ? 1 : 0);
+}
--- /dev/null
+#include <lib.h>
+#define vm_set_priv _vm_set_priv
+#include <unistd.h>
+
+PUBLIC int vm_set_priv(int nr, void *buf)
+{
+ message m;
+ m.VM_RS_NR = nr;
+ m.VM_RS_BUF = (long) buf;
+ return _syscall(VM_PROC_NR, VM_RS_SET_PRIV, &m);
+}