sizeof(boot_tty_info));
if(boot_tty_info.magic == TTYMAGIC) {
- if(boot_tty_info.flags & (BTIF_CONSORIGIN|BTIF_CONSCURSOR) ==
+ if((boot_tty_info.flags & (BTIF_CONSORIGIN|BTIF_CONSCURSOR)) ==
(BTIF_CONSORIGIN|BTIF_CONSCURSOR)) {
int line;
raw_copy(mon2abs(consolescreen),
/* Driver task.
*/
message m;
- sigset_t set;
int r;
/* Initialize SEF. */
}
} else { /* Port number is out of range */
port = ENXIO;
+ dep = NULL;
}
reply_mess.m_type = DL_CONF_REPLY;
reply_mess.m3_i1 = port;
reply_mess.m3_i2 = DE_PORT_NR;
- /* FIXME: if port number is out of range, this uses
- * uninitialized variable 'dep'.
- */
- *(ether_addr_t *) reply_mess.m3_ca1 = dep->de_address;
+ if(dep != NULL){
+ *(ether_addr_t *) reply_mess.m3_ca1 = dep->de_address;
+ }
if (send(mp->m_source, &reply_mess) != OK)
panic(str_SendErrMsg, mp->m_source);
PRIVATE void do_reply(dpeth_t * dep, int err, int may_block)
{
message reply;
- int status = FALSE;
+ int status = 0;
if (dep->de_flags & DEF_ACK_SEND) status |= DL_PACK_SEND;
if (dep->de_flags & DEF_ACK_RECV) status |= DL_PACK_RECV;
int i,j,r;
vir_bytes descr_vir = dep->sendrecv_descr_buf;
vir_bytes buffer_vir = dep->sendrecv_buf;
- de_descr_t *phys_descr;
de_loc_descr_t *loc_descr;
u32_t temp;
if (rtype != rid) {
printf("hermes @ %lx: hermes_read_ltv(): rid (0x%04x)",
- hw->iobase);
- printf("does not match type (0x%04x)\n", rid, rtype);
+ hw->iobase, rid);
+ printf("does not match type (0x%04x)\n", rtype);
}
if (HERMES_RECLEN_TO_BYTES (rlength) > bufsize) {
/*===========================================================================*
* record_bars *
*===========================================================================*/
-PRIVATE void record_bars(devind, last_reg)
+PRIVATE void record_bars(int devind, int last_reg)
{
int i, reg, width;
port);
#if USER_SPACE
if (OK != (s=sys_outl(PCII_CONFADD, PCII_UNSEL)))
- printf("PCI: warning, sys_outl failed: %d\n");
+ printf("PCI: warning, sys_outl failed: %d\n", s);
#else
outl(PCII_CONFADD, PCII_UNSEL);
#endif
port, value);
#if USER_SPACE
if (OK != (s=sys_outl(PCII_CONFADD, PCII_UNSEL)))
- printf("PCI: warning, sys_outl failed: %d\n");
+ printf("PCI: warning, sys_outl failed: %d\n",s);
#else
outl(PCII_CONFADD, PCII_UNSEL);
#endif
/*===========================================================================*
* pcii_rsts *
*===========================================================================*/
-PRIVATE u16_t pcii_rsts(busind)
-int busind;
+PRIVATE u16_t pcii_rsts(int busind)
{
u16_t v;
int s;
_PROTOTYPE( static void do_hard_int, (void) );
_PROTOTYPE( static void rtl8169_dump, (void) );
_PROTOTYPE( static void dump_phy, (re_t *rep) );
-_PROTOTYPE( static int rl_handler, (re_t *rep) );
+_PROTOTYPE( static void rl_handler, (re_t *rep) );
_PROTOTYPE( static void rl_watchdog_f, (timer_t *tp) );
/*
/*===========================================================================*
* rl_handler *
*===========================================================================*/
-static int rl_handler(rep)
-re_t *rep;
+static void rl_handler(re_t *rep)
{
int i, port, tx_head, tx_tail, link_up;
u16_t isr;
if (isr)
printf("rl_handler: unhandled interrupt isr = 0x%04x\n", isr);
-
- return 1;
}
/*===========================================================================*
mixer_set(input_cmd, mask);
} else { /* Get input */
if (shift > 0) {
- input.left = (((mask >> (shift+1)) & 1) == 1 ? ON : OFF);
- input.right = (((mask >> shift) & 1) == 1 ? ON : OFF);
+ input.left = ((((mask >> (shift+1)) & 1) == 1) ? ON : OFF);
+ input.right = ((((mask >> shift) & 1) == 1) ? ON : OFF);
} else {
- input.left = ((mask & 1) == 1 ? ON : OFF);
+ input.left = (((mask & 1) == 1) ? ON : OFF);
}
/* Copy back to user */
mixer_set(MIXER_OUTPUT_CTRL, mask);
} else { /* Get input */
if (shift > 0) {
- output.left = (((mask >> (shift+1)) & 1) == 1 ? ON : OFF);
- output.right = (((mask >> shift) & 1) == 1 ? ON : OFF);
+ output.left = ((((mask >> (shift+1)) & 1) == 1) ? ON : OFF);
+ output.right = ((((mask >> shift) & 1) == 1) ? ON : OFF);
} else {
- output.left = ((mask & 1) == 1 ? ON : OFF);
+ output.left = (((mask & 1) == 1) ? ON : OFF);
}
/* Copy back to user */
v8= pci_attr_r8(devind, TI_CARD_CTRL);
if (v8 & TI_CCR_IFG)
{
- printf("ti1225: got functional interrupt\n", v8);
+ printf("ti1225: got functional interrupt\n");
pci_attr_w8(devind, TI_CARD_CTRL, v8);
}
case 3: ld_dr3(linaddr); break;
default: panic(__FILE__, "invalid breakpoint index", __LINE__);
}
-printf("ld_dr%d(0x%x, 0x%x)\n",bp,linaddr);
+printf("ld_dr%d(0x%x)\n",bp,linaddr);
/* set new flags */
dr7 |= dr7flags;
rc = proc_addr(exit_p); /* clean up */
/* Don't clear if already cleared. */
- if(isemptyp(rc)) return;
+ if(isemptyp(rc)) return OK;
/* Check the table with IRQ hooks to see if hooks should be released. */
for (i=0; i < NR_IRQ_HOOKS; i++) {
*/
endpoint_t src_e, dst_e;
int src_p, dst_p;
- struct proc *src_rp, *dst_rp, *rp;
+ struct proc *src_rp, *dst_rp;
struct priv *src_privp, *dst_privp;
struct proc orig_src_proc;
struct proc orig_dst_proc;
struct priv orig_src_priv;
struct priv orig_dst_priv;
- int r;
- reg_t src_vbp, dst_vbp;
/* Lookup slots for source and destination process. */
src_e = m_ptr->SYS_UPD_SRC_ENDPT;
int proc_nr;
endpoint_t ep = m_ptr->SVMCTL_WHO;
struct proc *p, *rp, *target;
- int err;
if(ep == SELF) { ep = m_ptr->m_source; }
if (dst->ds_type != 'M') {
return dst->ds_date[0] -
- (dst->ds_type == 'J'
+ ((dst->ds_type == 'J')
&& leap
&& dst->ds_date[0] < 58);
}
/*===========================================================================*
* nop_prepare *
*===========================================================================*/
-PUBLIC struct device *nop_prepare(device)
+PUBLIC struct device *nop_prepare(int device)
{
/* Nothing to prepare for. */
return(NIL_DEV);
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
{
- sigset_t set;
- int r;
-
/* Only check for termination signal, ignore anything else. */
if (signo != SIGTERM) return;
PUBLIC void timing_dmp()
{
static struct util_timingdata timingdata[TIMING_CATEGORIES];
- int r, c, f, skipped = 0, printed = 0, maxlines = 23, x = 0;
- static int offsetlines = 0;
+ int r, c, x = 0;
if ((r = sys_getlocktimings(&timingdata[0])) != OK) {
printf("IS: warning: couldn't get copy of lock timings: %d\n", r);
*===========================================================================*/
PUBLIC void image_dmp()
{
- int m, i,j,r;
+ int m, r;
struct boot_image *ip;
if ((r = sys_getimage(image)) != OK) {
register struct proc *rp;
static struct proc *oldrp = BEG_PROC_ADDR;
register struct priv *sp;
- int r, i, n = 0;
+ int r, i;
/* First obtain a fresh copy of the current process and system table. */
if ((r = sys_getprivtab(priv)) != OK) {
register struct proc *rp;
static struct proc *oldrp = BEG_PROC_ADDR;
- int r, n = 0;
+ int r;
phys_clicks text, data, size;
/* First obtain a fresh copy of the current process table. */
register struct proc *rp;
static struct proc *oldrp = BEG_PROC_ADDR;
- int r, n = 0;
+ int r;
/* First obtain a fresh copy of the current process table. */
if ((r = sys_getproctab(proc)) != OK) {
{
register struct proc *rp;
static struct proc *oldrp = proc;
- int r, n = 0;
+ int r;
phys_clicks size;
/* First obtain a fresh copy of the current process table. */
* sending the reply. The loop never terminates, unless a panic occurs.
*/
int result;
- sigset_t sigset;
/* SEF local startup. */
env_setargs(argc, argv);
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
-PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
+PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
{
/* Initialize the information server. */
PUBLIC struct buf *get_block(block)
register block_t block; /* which block is wanted? */
{
- int b;
register struct buf *bp, *free_bp;
free_bp = NIL_BUF;
int *vec_grants;
vir_bytes bytes;
{
- int size;
int j;
iovec_t *v;
static iovec_t new_iovec[NR_IOREQS];
int flags; /* special flags, like O_NONBLOCK */
{
/* Read or write from a device. The parameter 'dev' tells which one. */
- struct dmap *dp;
int r, safe;
message m;
- iovec_t *v;
cp_grant_id_t gid = GRANT_INVALID;
int vec_grants;
int op_used;
*===========================================================================*/
PUBLIC int main(void) {
endpoint_t who_e, ind, error;
- message m;
/* SEF local startup. */
sef_local_startup();
*===========================================================================*/
PUBLIC int fs_lookup() {
cp_grant_id_t grant;
- int r, r1, len, flags;
+ int r, len, flags;
size_t offset;
ino_t dir_ino, root_ino;
struct dir_record *dir;
ino_t *numb; /* pointer to new dir record */
{
struct dir_record *dir_tmp;
- register struct buf *bp,*bp2;
- int pos,len;
+ register struct buf *bp;
+ int pos;
char* comma_pos = NULL;
char tmp_string[NAME_MAX];
*/
register struct dir_record *rip = NULL;
- int r, inumb;
- dev_t mnt_dev;
+ int r;
ino_t numb;
/* If 'string' is empty, yield same inode straight away. */
int nrbytes;
u64_t position;
unsigned int off, cum_io;
- mode_t mode_word;
- int completed, r2 = OK;
+ int completed;
struct dir_record *dir;
r = OK;
register struct buf *bp;
register int r = OK;
- int n;
block_t b;
- dev_t dev;
int file_unit, rel_block, offset;
*completed = 0;
/* Common code for stat and fstat system calls. */
struct stat statbuf;
- mode_t mo;
- int r, s;
+ int r;
struct tm ltime;
time_t time1;
int *vec_grants;
vir_bytes bytes;
{
- int access = 0, size;
int j;
iovec_t *v;
static iovec_t *new_iovec;
int flags; /* special flags, like O_NONBLOCK */
{
/* Read or write from a device. The parameter 'dev' tells which one. */
- struct dmap *dp;
int r, safe;
message m;
- iovec_t *v;
cp_grant_id_t gid = GRANT_INVALID;
int vec_grants;
int op_used;
/* Find the inode in the hash table. If it is not there, get a free inode
* load it from the disk if it's necessary and put on the hash list
*/
- register struct inode *rip, *xp;
+ register struct inode *rip;
int hashi;
hashi = numb & INODE_HASH_MASK;
* sending the reply. The loop never terminates, unless a panic occurs.
*/
int error, ind;
- message m;
/* SEF local startup. */
env_setargs(argc, argv);
* so that the VFS knows that it has to find the vnode on which this FS
* process' partition is mounted on.
*/
- struct super_block *xp;
struct inode *root_ip;
cp_grant_id_t label_gid;
size_t label_len;
PUBLIC int fs_unmount()
{
/* Unmount a file system by device number. */
- struct super_block *sp1;
int count;
struct inode *rip, *root_ip;
PUBLIC int fs_create()
{
phys_bytes len;
- int r, b;
+ int r;
struct inode *ldirp;
struct inode *rip;
mode_t omode;
if(user_path[len - 1] != '\0') return(EINVAL);
if(flags & PATH_GET_UCRED) { /* Do we have to copy uid/gid credentials? */
- int i;
grant2 = fs_m_in.REQ_GRANT2;
cred_size = fs_m_in.REQ_UCRED_SIZE;
/* Perform the chmod(name, mode) system call. */
register struct inode *rip;
- register int r;
/* Temporarily open the file. */
if( (rip = get_inode(fs_dev, fs_m_in.REQ_INODE_NR)) == NIL_INODE)
*/
register struct inode *old_rip = rip;
- register struct super_block *sp;
register mode_t bits, perm_bits;
int r, shift;
PUBLIC int fs_readwrite(void)
{
int r, rw_flag, chunk, block_size, block_spec;
- int partial_cnt, regular, nrbytes;
+ int regular, nrbytes;
cp_grant_id_t gid;
off_t position, f_size, bytes_left;
unsigned int off, cum_io;
int nrbytes;
u64_t position;
unsigned int off, cum_io;
- mode_t mode_word;
- int completed, r2 = OK;
+ int completed;
/* Pseudo inode for rw_chunk */
struct inode rip;
zone_t z;
zone_t zone_size;
int scale, r;
- struct super_block *sp;
/* Is another block available in the current zone? */
if ( (b = read_map(rip, position)) == NO_BLOCK) {
/* Find the inode in the hash table. If it is not there, get a free inode
* load it from the disk if it's necessary and put on the hash list
*/
- register struct inode *rip, *xp;
+ register struct inode *rip;
int hashi;
hashi = numb & INODE_HASH_MASK;
/* Allocate a free inode on 'dev', and return a pointer to it. */
register struct inode *rip;
- int major, minor;
bit_t b;
ino_t i_num;
* inode is to be truncated.
*/
- register int i;
-
rip->i_size = 0;
rip->i_update = ATIME | CTIME | MTIME; /* update all times later */
}
#include "fs.h"
-#include <sys/stat.h>
#include <string.h>
-#include <minix/com.h>
-#include <minix/callnr.h>
#include "buf.h"
#include "inode.h"
#include <minix/vfsif.h>
{
struct inode *rip;
off_t start, end;
- int r;
ino_t inumb;
inumb = fs_m_in.REQ_INODE_NR;
* O_APPEND mode, as this is different per fd and is checked when
* writing is done.
*/
- int scale;
/* Pipes can shrink, so adjust size to make sure all zones are removed. */
if(newsize != 0) return(EINVAL); /* Only truncate pipes to 0. */
* sending the reply. The loop never terminates, unless a panic occurs.
*/
int error, ind;
- message m;
/* SEF local startup. */
env_setargs(argc, argv);
PUBLIC int fs_readwrite(void)
{
int r, rw_flag;
- block_t b;
struct buf *bp;
cp_grant_id_t gid;
off_t position, f_size;
PUBLIC int do_exec()
{
message m;
- int r;
/* Forward call to FS */
m.m_type = PM_EXEC;
register struct mproc *rmc; /* pointer to child */
pid_t new_pid;
static int next_child;
- int i, n = 0, r, s;
+ int i, n = 0, s;
endpoint_t child_ep;
message m;
int s;
pid_t new_pid;
static int next_child;
- int i, n = 0, r;
+ int i, n = 0;
endpoint_t child_ep;
message m;
* become a zombie.
*/
register int proc_nr, proc_nr_e;
- int parent_waiting, r;
+ int r;
pid_t procgrp;
struct mproc *p_mp;
clock_t user_time, sys_time;
*/
register struct mproc *rmp = mp;
- int r, proc;
+ int r;
int ngroups;
switch(call_nr) {
PUBLIC int do_reboot()
{
message m;
- int r;
/* Check permission to abort the system. */
if (mp->mp_effuid != SUPER_USER) return(EPERM);
/*===========================================================================*
* process_ksig *
*===========================================================================*/
-PUBLIC int process_ksig(proc_nr_e, signo)
-int proc_nr_e;
-int signo;
+PUBLIC int process_ksig(int proc_nr_e, int signo)
{
register struct mproc *rmp;
int proc_nr;
if(pm_isokendpt(proc_nr_e, &proc_nr) != OK || proc_nr < 0) {
printf("PM: process_ksig: %d?? not ok\n", proc_nr_e);
- return;
+ return EDEADSRCDST; /* process is gone. */
}
rmp = &mproc[proc_nr];
if ((rmp->mp_flags & (IN_USE | EXITING)) != IN_USE) {
#if 0
printf("PM: process_ksig: %d?? exiting / not in use\n", proc_nr_e);
#endif
- return;
+ return EDEADSRCDST; /* process is gone. */
}
proc_id = rmp->mp_pid;
mp = &mproc[0]; /* pretend signals are from PM */
* so it can check for READs and WRITEs from pipes, ttys and the like.
*/
message m;
- int r, slot;
+ int r;
/* If we're already waiting for a delayed call, don't do anything now. */
if (rmp->mp_flags & DELAY_CALL)
size_t string_off;
size_t n;
int ov;
- message m;
int r;
/* Assumptions: size_t and char *, it's all the same thing. */
proc_e, (vir_bytes) vsp, (phys_bytes)frame_len);
if (r != OK) {
printf("RS: stack_top is 0x%lx; tried to copy to 0x%lx in %d\n",
- stack_top, vsp);
+ stack_top, vsp, proc_e);
printf("do_exec: copying out new stack failed: %d\n", r);
error= r;
goto fail;
int *hdrlenp;
{
/* Read the header and extract the text, data, bss and total sizes from it. */
- block_t b;
struct exec hdr; /* a.out header is read in here */
/* Read the header and check the magic number. The standard MINIX header
* used here only. The symbol table is for the benefit of a debugger and
* is ignored here.
*/
- int r;
-
if (exec_len < sizeof(hdr)) return(ENOEXEC);
memcpy(&hdr, exec, sizeof(hdr));
*/
int r;
- off_t n, o, b_off, seg_off;
if (off+seg_bytes > exec_len) return ENOEXEC;
r= sys_vircopy(SELF, D, (vir_bytes)exec+off, proc_e, seg, 0, seg_bytes);
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
{
- int exit_status;
-
/* Check for known signals, ignore anything else. */
switch(signo) {
case SIGCHLD:
if(rs_verbose)
printf("RS: ignoring spurious signal %d for process %d\n",
signo, target);
- return;
+ return OK; /* Since we're ignoring it, we have handled
+ * the signal without problem. All is OK.
+ */
}
rp = rproc_ptr[target_p];
rpub = rp->r_pub;
/* Don't bother if a termination signal has already been processed. */
- if( rp->r_flags & (RS_TERMINATED|RS_EXITING) == RS_TERMINATED ) {
+ if(rp->r_flags & RS_TERMINATED) {
return EDEADSRCDST; /* process is gone */
}
* service has a period, a status request will be forced in the next period.
*/
struct rproc *old_rp, *new_rp, *exiting_rp, *surviving_rp;
- message m;
old_rp = rupdate.rp;
new_rp = old_rp->r_new_rp;
int err;
{
/* Crash a system service and don't let it restart. */
- struct rprocpub *rpub;
-
if(errstr && !shutting_down) {
printf("RS: %s (error %d)\n", errstr, err);
}
/* Create the given system service. */
int child_proc_nr_e, child_proc_nr_n; /* child process slot */
pid_t child_pid; /* child's process id */
- char *file_only;
- int s, use_copy, slot_nr;
- bitchunk_t *vm_mask;
- message m;
+ int s, use_copy;
extern char **environ;
- char * null_env = NULL;
struct rprocpub *rpub;
rpub = rp->r_pub;
}
}
+/*===========================================================================*
+ * run_script *
+ *===========================================================================*/
+PRIVATE int run_script(struct rproc *rp)
+{
+ int r, endpoint;
+ pid_t pid;
+ char *reason;
+ char incarnation_str[20]; /* Enough for a counter? */
+ char *envp[1] = { NULL };
+ struct rprocpub *rpub;
+
+ rpub = rp->r_pub;
+ if (rp->r_flags & RS_REFRESHING)
+ reason= "restart";
+ else if (rp->r_flags & RS_NOPINGREPLY)
+ reason= "no-heartbeat";
+ else reason= "crashed";
+ sprintf(incarnation_str, "%d", rp->r_restarts);
+
+ if(rs_verbose) {
+ printf("RS: %s:\n", srv_to_string(rp));
+ printf("RS: calling script '%s'\n", rp->r_script);
+ printf("RS: reason: '%s'\n", reason);
+ printf("RS: incarnation: '%s'\n", incarnation_str);
+ }
+
+ pid= fork();
+ switch(pid)
+ {
+ case -1:
+ return kill_service(rp, "unable to fork script", errno);
+ case 0:
+ execle(rp->r_script, rp->r_script, rpub->label, reason,
+ incarnation_str, NULL, envp);
+ printf("RS: run_script: execl '%s' failed: %s\n",
+ rp->r_script, strerror(errno));
+ exit(1);
+ default:
+ /* Set the privilege structure for the child process. */
+ endpoint = getnprocnr(pid);
+ if ((r = sys_privctl(endpoint, SYS_PRIV_SET_USER, NULL))
+ != OK) {
+ return kill_service(rp,"can't set script privileges",r);
+ }
+ /* Allow the script to run. */
+ if ((r = sys_privctl(endpoint, SYS_PRIV_ALLOW, NULL)) != OK) {
+ return kill_service(rp,"can't let the script run",r);
+ }
+ }
+ return OK;
+}
+
/*===========================================================================*
* restart_service *
*===========================================================================*/
-PUBLIC void restart_service(rp)
-struct rproc *rp;
+PUBLIC void restart_service(struct rproc *rp)
{
/* Restart service via a recovery script or directly. */
struct rproc *replica_rp;
{
/* Initialize a slot as requested by the client. */
struct rprocpub *rpub;
- int slot_nr; /* local table entry */
- int arg_count; /* number of arguments */
- char *cmd_ptr; /* parse command string */
char *label; /* unique name of command */
- enum dev_style dev_style; /* device style */
- struct rproc *tmp_rp;
- struct rprocpub *tmp_rpub;
int len; /* length of string */
int i;
int s;
rproc_ptr[_ENDPOINT_P(rpub->endpoint)] = NULL;
}
-/*===========================================================================*
- * run_script *
- *===========================================================================*/
-PUBLIC int run_script(rp)
-struct rproc *rp;
-{
- int r, endpoint;
- pid_t pid;
- char *reason;
- char incarnation_str[20]; /* Enough for a counter? */
- char *envp[1] = { NULL };
- struct rprocpub *rpub;
-
- rpub = rp->r_pub;
- if (rp->r_flags & RS_REFRESHING)
- reason= "restart";
- else if (rp->r_flags & RS_NOPINGREPLY)
- reason= "no-heartbeat";
- else reason= "crashed";
- sprintf(incarnation_str, "%d", rp->r_restarts);
-
- if(rs_verbose) {
- printf("RS: %s:\n", srv_to_string(rp));
- printf("RS: calling script '%s'\n", rp->r_script);
- printf("RS: reason: '%s'\n", reason);
- printf("RS: incarnation: '%s'\n", incarnation_str);
- }
-
- pid= fork();
- switch(pid)
- {
- case -1:
- return kill_service(rp, "unable to fork script", errno);
- case 0:
- execle(rp->r_script, rp->r_script, rpub->label, reason,
- incarnation_str, NULL, envp);
- printf("RS: run_script: execl '%s' failed: %s\n",
- rp->r_script, strerror(errno));
- exit(1);
- default:
- /* Set the privilege structure for the child process. */
- endpoint = getnprocnr(pid);
- if ((r = sys_privctl(endpoint, SYS_PRIV_SET_USER, NULL))
- != OK) {
- return kill_service(rp,"can't set script privileges",r);
- }
- /* Allow the script to run. */
- if ((r = sys_privctl(endpoint, SYS_PRIV_ALLOW, NULL)) != OK) {
- return kill_service(rp,"can't let the script run",r);
- }
- }
-}
-
/*===========================================================================*
* get_next_label *
if (len > RS_MAX_LABEL_LEN)
{
printf(
- "rs:get_next_label: bad ipc list entry '.*s' for %s: too long\n",
+ "rs:get_next_label: bad ipc list entry '%.*s' for %s: too long\n",
len, p, caller_label);
continue;
}
_PROTOTYPE( struct rproc* lookup_slot_by_pid, (pid_t pid) );
_PROTOTYPE( int alloc_slot, (struct rproc **rpp) );
_PROTOTYPE( void free_slot, (struct rproc *rp) );
-_PROTOTYPE( int run_script, (struct rproc *rp) );
_PROTOTYPE( char *get_next_label, (char *ptr, char *label, char *caller_label));
_PROTOTYPE( void add_forward_ipc, (struct rproc *rp, struct priv *privp) );
_PROTOTYPE( void add_backward_ipc, (struct rproc *rp, struct priv *privp) );
struct vmnt *vmp;
struct fproc *rfp;
struct vnode *vp;
- message m;
/* Open a device once for every filp that's opened on it,
* and once for every filesystem mounted from it.
{
/* Perform the link(name1, name2) system call. */
int r = OK;
- endpoint_t linked_fs_e, link_lastdir_fs_e;
struct vnode *vp, *vp_d;
/* See if 'name1' (file to be linked to) exists. */
* is almost the same. They differ only in some condition testing. Unlink()
* may be used by the superuser to do dangerous things; rmdir() may not.
*/
- register struct fproc *rfp;
struct vnode *vldirp, *vp;
int r;
{
/* Perform the rename(name1, name2) system call. */
int r = OK, r1;
- size_t len;
struct vnode *old_dirp, *new_dirp, *vp;
char old_name[PATH_MAX+1];
PUBLIC int do_ftruncate()
{
/* As with do_truncate(), truncate_vnode() does the actual work. */
- int r;
struct filp *rfilp;
if ((off_t) m_in.flength < 0) return(EINVAL);
PUBLIC int do_slink()
{
/* Perform the symlink(name1, name2) system call. */
- int r, linklen;
+ int r;
struct vnode *vp;
- char string[NAME_MAX]; /* last component of the new dir's path name */
if(m_in.name1_length <= 1) return(ENOENT);
if(m_in.name1_length >= SYMLINK_MAX) return(ENAMETOOLONG);
register struct filp *f;
int new_fd, r, fl;
- long cloexec_mask; /* bit map for the FD_CLOEXEC flag */
- long clo_value; /* FD_CLOEXEC flag in proper position */
struct filp *dummy;
/* Is the file descriptor valid? */
gid_t *groups;
{
struct fproc *rfp;
- int slot, i;
+ int slot;
okendpt(proc_e, &slot);
rfp = &fproc[slot];
int proc_e;
struct mem_map *seg_ptr;
{
- int r, proc_s;
+ int proc_s;
/* Terminate the process */
okendpt(proc_e, &proc_s);
struct fproc *tfp;
struct dmap *dp;
dev_t dev;
- message m;
struct vnode *root_node, *vp = NULL, *bspec;
struct vmnt *vmp;
char *label;
Dev_t dev; /* block-special device */
char *label; /* buffer to retrieve label, or NULL */
{
- struct vnode *vp, *vi;
+ struct vnode *vp;
struct vmnt *vmp_i = NULL, *vmp = NULL;
struct dmap *dp;
int count, r;
- int fs_e;
/* Find vmnt that is to be unmounted */
for(vmp_i = &vmnt[0]; vmp_i < &vmnt[NR_MNTS]; ++vmp_i) {
* and the path is the root node of a mounted file system, return that device
* number. In all other cases, return NO_DEV and an error code in 'err_code'.
*/
- int r;
dev_t dev;
struct vnode *vp;
/*===========================================================================*
* is_nonedev *
*===========================================================================*/
-PRIVATE int is_nonedev(dev)
+PRIVATE int is_nonedev(int dev)
{
/* Return whether the given device is a "none" pseudo device.
*/
struct vnode *dirp, *vp;
int r, flags;
struct node_details res;
- struct vnode *rest;
/* When O_CREAT and O_EXCL flags are set, the path may not be named by a
* symbolic link. */
* and parse the path up to the penultimate component.
*/
- int r;
size_t len;
char *cp;
char dir_entry[PATH_MAX+1];
struct filp *fil_ptr0, *fil_ptr1;
int fil_des[2]; /* reply goes here */
struct vnode *vp;
- struct vmnt *vmp;
struct node_details res;
/* See if a free vnode is available */
*===========================================================================*/
PUBLIC int select_request_pipe(struct filp *f, int *ops, int block)
{
- int orig_ops, r = 0, err, canwrite;
+ int orig_ops, r = 0, err;
orig_ops = *ops;
if ((*ops & (SEL_RD|SEL_ERR))) {
if ((err = pipe_check(f->filp_vno, READING, 0,
PUBLIC int do_chown()
{
/* Perform the chmod(name, mode) and fchmod(fd, mode) system calls. */
- int inode_nr;
- int fs_e;
struct filp *flp;
struct vnode *vp;
int r;
* if it is forbidden, EACCES is returned.
*/
- register struct super_block *sp;
register mode_t bits, perm_bits;
uid_t uid;
gid_t gid;
- int r, shift, type;
+ int r, shift;
if (vp->v_uid == (uid_t) -1 || vp->v_gid == (gid_t) -1) return(EACCES);
/* Perform read(fd, buffer, nbytes) or write(fd, buffer, nbytes) call. */
register struct filp *f;
register struct vnode *vp;
- off_t bytes_left;
u64_t position, res_pos, new_pos;
- unsigned int off, cum_io, cum_io_incr, res_cum_io;
- int op, oflags, r, chunk, block_spec, char_spec;
+ unsigned int cum_io, cum_io_incr, res_cum_io;
+ int op, oflags, r, block_spec, char_spec;
int regular;
mode_t mode_word;
- phys_bytes p;
- struct dmap *dp;
/* If the file descriptor is valid, get the vnode, size and mode. */
if (m_in.nbytes < 0) return(EINVAL);
/* Perform the getdents(fd, buf, size) system call. */
int r;
u64_t new_pos;
- cp_grant_id_t gid;
register struct filp *rfilp;
/* Is the file descriptor valid? */
char *buf;
size_t req_size;
{
- int r, oflags, partial_pipe = 0, r2;
- size_t size, cum_io, cum_io_incr, cum_io_incr2;
+ int r, oflags, partial_pipe = 0;
+ size_t size, cum_io, cum_io_incr;
struct vnode *vp;
- u64_t position, new_pos, new_pos2;
+ u64_t position, new_pos;
oflags = f->filp_flags;
vp = f->filp_vno;
#include <sys/stat.h>
#include <sys/statfs.h>
#include <minix/vfsif.h>
-#include <minix/callnr.h>
#include <minix/com.h>
-#include <minix/keymap.h>
#include <minix/const.h>
#include <minix/endpoint.h>
#include <minix/u64.h>
*/
int r, old_driver_e, new_driver_e;
message origm, m;
- struct vmnt *vmp;
if(fs_e <= 0 || fs_e == NONE)
panic("talking to bogus endpoint: %d", fs_e);
*===========================================================================*/
PUBLIC void select_reply1()
{
- int i, s, minor, status;
+ int i, minor, status;
endpoint_t driver_e;
dev_t dev;
struct filp *fp;
{
/* Do the actual work for chdir() and chroot(). */
struct vnode *vp;
- int r;
/* Try to open the directory */
if (fetch_name(name_ptr, len, M3) != OK) return(err_code);
/* Perform the utime(name, timep) system call. */
register int len;
int r;
- uid_t uid;
time_t actime, modtime;
struct vnode *vp;
endpoint_t ke;
*proc = _ENDPOINT_P(endpoint);
if(endpoint == NONE) {
- printf("vfs:%s: endpoint is NONE\n", file, line, endpoint);
+ printf("vfs:%s:%d: endpoint is NONE\n", file, line);
failed = 1;
} else if(*proc < 0 || *proc >= NR_PROCS) {
printf("vfs:%s:%d: proc (%d) from endpoint (%d) out of range\n",