misc.c File Reference

#include "pm.h"
#include <minix/callnr.h>
#include <signal.h>
#include <sys/svrctl.h>
#include <sys/resource.h>
#include <minix/com.h>
#include <minix/config.h>
#include <minix/type.h>
#include <string.h>
#include <lib.h>
#include "mproc.h"
#include "param.h"
#include "../../kernel/proc.h"

Include dependency graph for misc.c:

Go to the source code of this file.

Defines

#define MAX_LOCAL_PARAMS   2

Functions

PUBLIC int do_allocmem ()
PUBLIC int do_freemem ()
PUBLIC int do_procstat ()
PUBLIC int do_getsysinfo ()
PUBLIC int do_getprocnr ()
PUBLIC int do_reboot ()
PUBLIC int do_getsetpriority ()
PUBLIC int do_svrctl ()
PUBLIC ssize_t _read_pm (int fd, void *buffer, size_t nbytes, int seg, int ep)
PUBLIC ssize_t _write_pm (int fd, void *buffer, size_t nbytes, int seg, int ep)


Detailed Description

Definition in file misc.c.


Define Documentation

#define MAX_LOCAL_PARAMS   2
 

Referenced by do_svrctl().


Function Documentation

PUBLIC ssize_t _read_pm int  fd,
void *  buffer,
size_t  nbytes,
int  seg,
int  ep
 

Definition at line 396 of file misc.c.

References _syscall(), FS_PROC_NR, m, and READ.

Referenced by rw_seg().

PUBLIC ssize_t _write_pm int  fd,
void *  buffer,
size_t  nbytes,
int  seg,
int  ep
 

Definition at line 416 of file misc.c.

References _syscall(), FS_PROC_NR, m, and WRITE.

Referenced by rw_seg().

PUBLIC int do_allocmem  ) 
 

Miscellaneous system calls. Author: Kees J. Bot 31 Mar 2000 The entry points into this file are: do_reboot: kill all processes, then reboot system do_procstat: request process status (Jorrit N. Herder) do_getsysinfo: request copy of PM data structure (Jorrit N. Herder) do_getprocnr: lookup process slot number (Jorrit N. Herder) do_allocmem: allocate a chunk of memory (Jorrit N. Herder) do_freemem: deallocate a chunk of memory (Jorrit N. Herder) do_getsetpriority: get/set process priority do_svrctl: process manager control

Definition at line 34 of file misc.c.

References alloc_mem(), CLICK_SHIFT, CLICK_SIZE, ENOMEM, m_in, mp, mproc::mp_reply, NO_MEM, and OK.

PUBLIC int do_freemem  ) 
 

Definition at line 49 of file misc.c.

References CLICK_SHIFT, CLICK_SIZE, free_mem(), m_in, and OK.

PUBLIC int do_getprocnr  ) 
 

Definition at line 143 of file misc.c.

References IN_USE, m_in, mp, mproc::mp_endpoint, mproc::mp_flags, mproc::mp_pid, mproc::mp_reply, NR_PROCS, OK, PROC_NAME_LEN, and s.

PUBLIC int do_getsetpriority  ) 
 

Definition at line 227 of file misc.c.

References call_nr, EACCES, EINVAL, EPERM, ESRCH, GETPRIORITY, m_in, mp, mproc::mp_effuid, mproc::mp_endpoint, mproc::mp_nice, mproc::mp_realuid, PRIO_MIN, PRIO_PROCESS, proc_from_pid(), SUPER_USER, sys_nice(), and who_p.

PUBLIC int do_getsysinfo  ) 
 

Definition at line 84 of file misc.c.

References EINVAL, if(), kinfo, m_in, mem_holes_copy(), NR_PROCS, NR_TASKS, OK, pm_mem_info::pmi_hi_watermark, pm_mem_info::pmi_holes, proc_addr, proctab, r, s, SELF, SI_KINFO, SI_KPROC_TAB, SI_LOADINFO, SI_MEM_ALLOC, SI_PROC_ADDR, SI_PROC_TAB, sys_datacopy, sys_getkinfo, sys_getloadinfo, sys_getproctab, and who_e.

PUBLIC int do_procstat  ) 
 

Definition at line 63 of file misc.c.

References ENOSYS, m_in, mp, mproc::mp_reply, mproc::mp_sigpending, OK, SELF, and sigemptyset.

PUBLIC int do_reboot  ) 
 

Definition at line 183 of file misc.c.

References check_sig(), EINVAL, EPERM, if(), INIT_PROC_NR, m_in, mp, mproc::mp_effuid, OK, PM_PROC_NR, PRIO_STOP, r, REBOOT, SELF, SIGKILL, SUPER_USER, SUSPEND, sys_abort(), sys_datacopy, sys_nice(), tell_fs(), and who_e.

PUBLIC int do_svrctl  ) 
 

Definition at line 272 of file misc.c.

References E2BIG, EFAULT, EINVAL, ENOSPC, ESRCH, find_param(), if(), m_in, MAX_LOCAL_PARAMS, MIN, MMGETPARAM, MMSETPARAM, monitor_params, NULL, OK, p, ptr, SELF, strcmp, strlen(), sys_datacopy, and who_e.


Generated on Fri Apr 14 23:02:05 2006 for minix by  doxygen 1.4.6