printf("ip_port->ip_dl.dl_eth.de_state= 0x%x",
ip_port->ip_dl.dl_eth.de_state);
ip_panic (( "strange status" ));
+ return -1;
}
PRIVATE void ipeth_set_ipaddr(ip_port)
if (ip_fd->if_flags & IFF_SEL_READ)
{
- ip_fd->if_flags & ~IFF_SEL_READ;
+ ip_fd->if_flags &= ~IFF_SEL_READ;
if (ip_fd->if_select_res)
ip_fd->if_select_res(ip_fd->if_srfd,
SR_SELECT_READ);
dst_fd->tf_conn != NULL ||
!(dst_fd->tf_flags & TFF_COOKIE))
{
- printf("tcp_acceptto: bad flags 0x%x or conn %p for fd %d\n",
+ printf("tcp_acceptto: bad flags 0x%lx or conn %p for fd %d\n",
dst_fd->tf_flags, dst_fd->tf_conn, dst_nr);
tcp_reply_ioctl(tcp_fd, EINVAL);
return NW_OK;
printf("tc_fd NULL");
else
{
- printf("tc_fd #%d: flags 0x%x, r %u@%u, w %u@%u",
+ printf("tc_fd #%d: flags 0x%lx, r %u@%u, w %u@%u",
tcp_fd-tcp_fd_table, tcp_fd->tf_flags,
tcp_fd->tf_read_count, tcp_fd->tf_read_offset,
tcp_fd->tf_write_count, tcp_fd->tf_write_offset);
int which_operation;
{
ip_panic(( "qp_cancel: should not be here, no blocking calls" ));
+ return OK;
}
PRIVATE int qp_select(fd, operations)
ip_panic((
"request not found: from %d, type %d, MINOR= %d, PROC= %d, REF= %d",
m->m_source, m->m_type, m->DEVICE,
- m->IO_ENDPT, m->IO_GRANT));
+ m->IO_ENDPT, (int) m->IO_GRANT));
+
+ return result;
}
PRIVATE int sr_select(m)
int i;
printf("key\tid\tpage\n");
for (i = 0; i < shm_list_nr; i++)
- printf("%d\t%d\t%x\n",
+ printf("%ld\t%d\t%lx\n",
shm_list[i].key,
shm_list[i].id,
shm_list[i].page);
int w;
if (!timingdata[c].lock_timings[b])
continue;
- x += (w = printf(" %5d: %5d", timingdata[c].lock_timings_range[0] +
+ x += (w = printf(" %5lu: %5lu", timingdata[c].lock_timings_range[0] +
b*timingdata[c].binsize,
timingdata[c].lock_timings[b]));
if (x + w >= 80) { printf("\n"); x = 0; }
printf("%10d ", e->proc_nr_e);
printf(" (%02d) ", e->irq);
printf(" %s", (e->policy & IRQ_REENABLE) ? "reenable" : " - ");
- printf(" %4d", e->notify_id);
+ printf(" %4lu", e->notify_id);
if (irq_actids[e->irq] & e->id)
printf(" masked");
printf("\n");
printf("---name- -nr- flags -qs- -queue- -stack-\n");
for (m=0; m<NR_BOOT_PROCS; m++) {
ip = &image[m];
- printf("%8s %4d %5s %4d %7d %7lu\n",
+ printf("%8s %4d %5s %4d %7d %7d\n",
ip->proc_name, ip->proc_nr,
boot_flags_str(ip->flags), ip->quantum, ip->priority, ip->stksize);
}
printf("- vdu_ega: %3d\n", machine.vdu_ega);
printf("- vdu_vga: %3d\n\n", machine.vdu_vga);
printf("Kernel info structure:\n");
- printf("- code_base: %5u\n", kinfo.code_base);
- printf("- code_size: %5u\n", kinfo.code_size);
- printf("- data_base: %5u\n", kinfo.data_base);
- printf("- data_size: %5u\n", kinfo.data_size);
- printf("- proc_addr: %5u\n", kinfo.proc_addr);
- printf("- bootdev_base: %5u\n", kinfo.bootdev_base);
- printf("- bootdev_size: %5u\n", kinfo.bootdev_size);
- printf("- ramdev_base: %5u\n", kinfo.ramdev_base);
- printf("- ramdev_size: %5u\n", kinfo.ramdev_size);
+ printf("- code_base: %5lu\n", kinfo.code_base);
+ printf("- code_size: %5lu\n", kinfo.code_size);
+ printf("- data_base: %5lu\n", kinfo.data_base);
+ printf("- data_size: %5lu\n", kinfo.data_size);
+ printf("- proc_addr: %5lu\n", kinfo.proc_addr);
+ printf("- bootdev_base: %5lu\n", kinfo.bootdev_base);
+ printf("- bootdev_size: %5lu\n", kinfo.bootdev_size);
+ printf("- ramdev_base: %5lu\n", kinfo.ramdev_base);
+ printf("- ramdev_size: %5lu\n", kinfo.ramdev_size);
printf("- nr_procs: %3u\n", kinfo.nr_procs);
printf("- nr_tasks: %3u\n", kinfo.nr_tasks);
printf("- release: %.6s\n", kinfo.release);
size = rp->p_memmap[T].mem_len
+ ((rp->p_memmap[S].mem_phys + rp->p_memmap[S].mem_len) - data);
printf(" %5d %10d ", _ENDPOINT_G(rp->p_endpoint), rp->p_endpoint);
- printf("%-8.8s %5u %5lu %6lu %6lu ",
+ printf("%-8.8s %5u %5u %6lu %6lu ",
rp->p_name,
rp->p_priority,
rp->p_quantum_size_ms,
size = rp->p_memmap[T].mem_len
+ ((rp->p_memmap[S].mem_phys + rp->p_memmap[S].mem_len)
- rp->p_memmap[D].mem_phys);
- printf("%-7.7s%7lx %8lx %4x %4x %4x %4x %5x %5x %8lx\n",
+ printf("%-7.7s%7lx %8lx %4x %4x %4x %4x %5x %5x %8lu\n",
rp->p_name,
(unsigned long) rp->p_reg.pc,
(unsigned long) rp->p_reg.sp,
if (mp->mp_pid == 0 && i != PM_PROC_NR) continue;
if (++n > 22) break;
printf("%8.8s %3d ", mp->mp_name, i);
- printf(" %08x %08x %08x ",
+ printf(" %08lx %08lx %08lx ",
mp->mp_ignore, mp->mp_catch, mp->mp_sigmask);
- printf("%08x ", mp->mp_sigpending);
- if (mp->mp_flags & ALARM_ON) printf("%8u", mp->mp_timer.tmr_exp_time-uptime);
+ printf("%08lx ", mp->mp_sigpending);
+ if (mp->mp_flags & ALARM_ON) printf("%8ld", mp->mp_timer.tmr_exp_time-uptime);
else printf(" -");
printf("\n");
}
rpub = &rprocpub[i];
if (! (rp->r_flags & RS_IN_USE)) continue;
if (++n > 22) break;
- printf("%13s %9d %5d %6s %3d/%1d %3u %8u %5dx %s",
+ printf("%13s %9d %5d %6s %3d/%1d %3ld %8ld %5dx %s",
rpub->label, rpub->endpoint, rp->r_pid,
s_flags_str(rp->r_flags, rpub->sys_flags), rpub->dev_nr,
rpub->dev_style, rpub->period, rp->r_alive_tm, rp->r_restarts,
/* Find starting inode inode according to the request message */
if ((start_dir = get_dir_record(dir_ino)) == NULL) {
- printf("ISOFS: couldn't find starting inode %d\n", dir_ino);
+ printf("ISOFS: couldn't find starting inode %lu\n", dir_ino);
return(ENOENT);
}
rip = find_inode(fs_dev, (ino_t) fs_m_in.REQ_INODE_NR);
if(!rip) {
- printf("%s:%d put_inode: inode #%ul dev: %d not found\n", __FILE__,
+ printf("%s:%d put_inode: inode #%lu dev: %d not found\n", __FILE__,
__LINE__, (ino_t) fs_m_in.REQ_INODE_NR, fs_dev);
panic("fs_putnode failed");
}
req_nr != REQ_PUTNODE && req_nr != REQ_READSUPER &&
req_nr != REQ_MOUNTPOINT && req_nr != REQ_UNMOUNT &&
req_nr != REQ_SYNC && req_nr != REQ_LOOKUP) {
- printf("MFS(%d) inode(%ul) cc: %d req_nr: %d\n", SELF_E,
+ printf("MFS(%d) inode(%lu) cc: %d req_nr: %d\n", SELF_E,
inode[i].i_num, inode[i].i_count - cch[i], req_nr);
}
#define DUMPED 0200 /* bit set in status when core dumped */
-#define MAX_SECS (((1<<(sizeof(clock_t)*8-1))-1)/system_hz)
+#define MAX_CLOCK_T ((unsigned long) 1 << ((sizeof(clock_t) * 8) - 1))
+#define MAX_SECS ( (clock_t) (MAX_CLOCK_T/system_hz) )
/* max.secs for setitimer() ((2^31-1)/HZ) */
#define NR_ITIMERS 3 /* number of supported interval timers */
*/
for (sn = 1; sn < _NSIG; sn++) {
if (sigismember(&rmp->mp_catch, sn)) {
- sigdelset(&rmp->mp_catch, sn);
+ (void) sigdelset(&rmp->mp_catch, sn);
rmp->mp_sigact[sn].sa_handler = SIG_DFL;
- sigemptyset(&rmp->mp_sigact[sn].sa_mask);
+ (void) sigemptyset(&rmp->mp_sigact[sn].sa_mask);
}
}
if (!(rmc->mp_trace_flags & TO_TRACEFORK)) {
rmc->mp_tracer = NO_TRACER; /* no tracer attached */
rmc->mp_trace_flags = 0;
- sigemptyset(&rmc->mp_sigtrace);
+ (void) sigemptyset(&rmc->mp_sigtrace);
}
/* Some system servers like to call regular fork, such as RS spawning
if (!(rmc->mp_trace_flags & TO_TRACEFORK)) {
rmc->mp_tracer = NO_TRACER; /* no tracer attached */
rmc->mp_trace_flags = 0;
- sigemptyset(&rmc->mp_sigtrace);
+ (void) sigemptyset(&rmc->mp_sigtrace);
}
/* inherit only these flags */
rmc->mp_flags &= (IN_USE|PRIV_PROC|DELAY_CALL);
*/
for (i = 1; i < _NSIG; i++) {
if (sigismember(&rp->mp_sigtrace, i)) {
- sigdelset(&rp->mp_sigtrace, i);
+ (void) sigdelset(&rp->mp_sigtrace, i);
mp->mp_reply.reply_res2 =
0177 | (i << 8);
/* Build the set of signals which cause core dumps, and the set of signals
* that are by default ignored.
*/
- sigemptyset(&core_sset);
+ (void) sigemptyset(&core_sset);
for (sig_ptr = core_sigs; sig_ptr < core_sigs+sizeof(core_sigs); sig_ptr++)
- sigaddset(&core_sset, *sig_ptr);
- sigemptyset(&ign_sset);
+ (void) sigaddset(&core_sset, *sig_ptr);
+ (void) sigemptyset(&ign_sset);
for (sig_ptr = ign_sigs; sig_ptr < ign_sigs+sizeof(ign_sigs); sig_ptr++)
- sigaddset(&ign_sset, *sig_ptr);
- sigemptyset(&noign_sset);
+ (void) sigaddset(&ign_sset, *sig_ptr);
+ (void) sigemptyset(&noign_sset);
for (sig_ptr = noign_sigs; sig_ptr < noign_sigs+sizeof(noign_sigs); sig_ptr++)
- sigaddset(&noign_sset, *sig_ptr);
+ (void) sigaddset(&noign_sset, *sig_ptr);
/* Obtain a copy of the boot monitor parameters and the kernel info struct.
* Parse the list of free memory chunks. This list is what the boot monitor
rmp = &mproc[ip->proc_nr];
strncpy(rmp->mp_name, ip->proc_name, PROC_NAME_LEN);
rmp->mp_nice = get_nice_value(ip->priority);
- sigemptyset(&rmp->mp_ignore);
- sigemptyset(&rmp->mp_sigmask);
- sigemptyset(&rmp->mp_catch);
+ (void) sigemptyset(&rmp->mp_ignore);
+ (void) sigemptyset(&rmp->mp_sigmask);
+ (void) sigemptyset(&rmp->mp_catch);
if (ip->proc_nr == INIT_PROC_NR) { /* user process */
/* INIT is root, we make it father of itself. This is
* not really OK, INIT should have no father, i.e.
if (m_in.stat_nr == SELF) {
mp->mp_reply.sig_set = mp->mp_sigpending;
- sigemptyset(&mp->mp_sigpending);
- sigemptyset(&mp->mp_ksigpending);
+ (void) sigemptyset(&mp->mp_sigpending);
+ (void) sigemptyset(&mp->mp_ksigpending);
}
else {
return(ENOSYS);
if (r != OK) return(r);
if (svec.sa_handler == SIG_IGN) {
- sigaddset(&mp->mp_ignore, m_in.sig_nr);
- sigdelset(&mp->mp_sigpending, m_in.sig_nr);
- sigdelset(&mp->mp_ksigpending, m_in.sig_nr);
- sigdelset(&mp->mp_catch, m_in.sig_nr);
+ (void) sigaddset(&mp->mp_ignore, m_in.sig_nr);
+ (void) sigdelset(&mp->mp_sigpending, m_in.sig_nr);
+ (void) sigdelset(&mp->mp_ksigpending, m_in.sig_nr);
+ (void) sigdelset(&mp->mp_catch, m_in.sig_nr);
} else if (svec.sa_handler == SIG_DFL) {
- sigdelset(&mp->mp_ignore, m_in.sig_nr);
- sigdelset(&mp->mp_catch, m_in.sig_nr);
+ (void) sigdelset(&mp->mp_ignore, m_in.sig_nr);
+ (void) sigdelset(&mp->mp_catch, m_in.sig_nr);
} else {
- sigdelset(&mp->mp_ignore, m_in.sig_nr);
- sigaddset(&mp->mp_catch, m_in.sig_nr);
+ (void) sigdelset(&mp->mp_ignore, m_in.sig_nr);
+ (void) sigaddset(&mp->mp_catch, m_in.sig_nr);
}
mp->mp_sigact[m_in.sig_nr].sa_handler = svec.sa_handler;
- sigdelset(&svec.sa_mask, SIGKILL);
- sigdelset(&svec.sa_mask, SIGSTOP);
+ (void) sigdelset(&svec.sa_mask, SIGKILL);
+ (void) sigdelset(&svec.sa_mask, SIGSTOP);
mp->mp_sigact[m_in.sig_nr].sa_mask = svec.sa_mask;
mp->mp_sigact[m_in.sig_nr].sa_flags = svec.sa_flags;
mp->mp_sigreturn = (vir_bytes) m_in.sig_ret;
switch (m_in.sig_how) {
case SIG_BLOCK:
- sigdelset((sigset_t *)&m_in.sig_set, SIGKILL);
- sigdelset((sigset_t *)&m_in.sig_set, SIGSTOP);
+ (void) sigdelset((sigset_t *)&m_in.sig_set, SIGKILL);
+ (void) sigdelset((sigset_t *)&m_in.sig_set, SIGSTOP);
for (i = 1; i < _NSIG; i++) {
if (sigismember((sigset_t *)&m_in.sig_set, i))
- sigaddset(&mp->mp_sigmask, i);
+ (void) sigaddset(&mp->mp_sigmask, i);
}
break;
case SIG_UNBLOCK:
for (i = 1; i < _NSIG; i++) {
if (sigismember((sigset_t *)&m_in.sig_set, i))
- sigdelset(&mp->mp_sigmask, i);
+ (void) sigdelset(&mp->mp_sigmask, i);
}
check_pending(mp);
break;
case SIG_SETMASK:
- sigdelset((sigset_t *) &m_in.sig_set, SIGKILL);
- sigdelset((sigset_t *) &m_in.sig_set, SIGSTOP);
+ (void) sigdelset((sigset_t *) &m_in.sig_set, SIGKILL);
+ (void) sigdelset((sigset_t *) &m_in.sig_set, SIGSTOP);
mp->mp_sigmask = (sigset_t) m_in.sig_set;
check_pending(mp);
break;
{
mp->mp_sigmask2 = mp->mp_sigmask; /* save the old mask */
mp->mp_sigmask = (sigset_t) m_in.sig_set;
- sigdelset(&mp->mp_sigmask, SIGKILL);
- sigdelset(&mp->mp_sigmask, SIGSTOP);
+ (void) sigdelset(&mp->mp_sigmask, SIGKILL);
+ (void) sigdelset(&mp->mp_sigmask, SIGSTOP);
mp->mp_flags |= SIGSUSPENDED;
check_pending(mp);
return(SUSPEND);
int r;
mp->mp_sigmask = (sigset_t) m_in.sig_set;
- sigdelset(&mp->mp_sigmask, SIGKILL);
- sigdelset(&mp->mp_sigmask, SIGSTOP);
+ (void) sigdelset(&mp->mp_sigmask, SIGKILL);
+ (void) sigdelset(&mp->mp_sigmask, SIGSTOP);
r = sys_sigreturn(who_e, (struct sigmsg *) m_in.sig_context);
check_pending(mp);
* the process itself could block/ignore debugger signals.
*/
- sigaddset(&rmp->mp_sigtrace, signo);
+ (void) sigaddset(&rmp->mp_sigtrace, signo);
if (!(rmp->mp_flags & STOPPED))
stop_proc(rmp, signo); /* a signal causes it to stop */
}
if (rmp->mp_flags & VFS_CALL) {
- sigaddset(&rmp->mp_sigpending, signo);
- if(ksig) sigaddset(&rmp->mp_ksigpending, signo);
+ (void) sigaddset(&rmp->mp_sigpending, signo);
+ if(ksig)
+ (void) sigaddset(&rmp->mp_ksigpending, signo);
if (!(rmp->mp_flags & PM_SIG_PENDING)) {
/* No delay calls: VFS_CALL implies the process called us. */
}
if (!badignore && sigismember(&rmp->mp_sigmask, signo)) {
/* Signal should be blocked. */
- sigaddset(&rmp->mp_sigpending, signo);
- if(ksig) sigaddset(&rmp->mp_ksigpending, signo);
+ (void) sigaddset(&rmp->mp_sigpending, signo);
+ if(ksig)
+ (void) sigaddset(&rmp->mp_ksigpending, signo);
return;
}
* (except SIGKILL) in order not to confuse the debugger. The signals
* will be delivered using the check_pending() calls in do_trace().
*/
- sigaddset(&rmp->mp_sigpending, signo);
- if(ksig) sigaddset(&rmp->mp_ksigpending, signo);
+ (void) sigaddset(&rmp->mp_sigpending, signo);
+ if(ksig)
+ (void) sigaddset(&rmp->mp_ksigpending, signo);
return;
}
if (!badignore && sigismember(&rmp->mp_catch, signo)) {
if (!(rmp->mp_flags & UNPAUSED)) {
/* not yet unpaused; continue later */
- sigaddset(&rmp->mp_sigpending, signo);
- if(ksig) sigaddset(&rmp->mp_ksigpending, signo);
+ (void) sigaddset(&rmp->mp_sigpending, signo);
+ if(ksig)
+ (void) sigaddset(&rmp->mp_ksigpending, signo);
return;
}
if (sigismember(&rmp->mp_sigpending, i) &&
!sigismember(&rmp->mp_sigmask, i)) {
ksig = sigismember(&rmp->mp_ksigpending, i);
- sigdelset(&rmp->mp_sigpending, i);
- sigdelset(&rmp->mp_ksigpending, i);
+ (void) sigdelset(&rmp->mp_sigpending, i);
+ (void) sigdelset(&rmp->mp_ksigpending, i);
sig_proc(rmp, i, FALSE /*trace*/, ksig);
if (rmp->mp_flags & VFS_CALL)
rmp->mp_sigmask |= rmp->mp_sigact[signo].sa_mask;
if (sigflags & SA_NODEFER)
- sigdelset(&rmp->mp_sigmask, signo);
+ (void) sigdelset(&rmp->mp_sigmask, signo);
else
- sigaddset(&rmp->mp_sigmask, signo);
+ (void) sigaddset(&rmp->mp_sigmask, signo);
if (sigflags & SA_RESETHAND) {
- sigdelset(&rmp->mp_catch, signo);
+ (void) sigdelset(&rmp->mp_catch, signo);
rmp->mp_sigact[signo].sa_handler = SIG_DFL;
}
- sigdelset(&rmp->mp_sigpending, signo);
- sigdelset(&rmp->mp_ksigpending, signo);
+ (void) sigdelset(&rmp->mp_sigpending, signo);
+ (void) sigdelset(&rmp->mp_ksigpending, signo);
if(vm_push_sig(rmp->mp_endpoint, &cur_sp) != OK)
return(FALSE);
/* Let all tracer-pending signals through the filter. */
for (i = 1; i < _NSIG; i++) {
if (sigismember(&child->mp_sigtrace, i)) {
- sigdelset(&child->mp_sigtrace, i);
+ (void) sigdelset(&child->mp_sigtrace, i);
check_sig(child->mp_pid, i, FALSE /* ksig */);
}
}
rmp->mp_flags |= STOPPED;
if (wait_test(rpmp, rmp)) {
- sigdelset(&rmp->mp_sigtrace, signo);
+ (void) sigdelset(&rmp->mp_sigtrace, signo);
rpmp->mp_flags &= ~WAITING; /* parent is no longer waiting */
rpmp->mp_reply.reply_res2 = 0177 | (signo << 8);
return EPERM;
if (sched_isokendpt(m_ptr->SCHEDULING_ENDPOINT, &proc_nr_n) != OK) {
- printf("SCHED: WARNING: got an invalid endpoint in OOQ msg %u.\n",
- m_ptr->SCHEDULING_ENDPOINT);
+ printf("SCHED: WARNING: got an invalid endpoint in OOQ msg "
+ "%ld\n", m_ptr->SCHEDULING_ENDPOINT);
return EBADEPT;
}
return EPERM;
if (sched_isokendpt(m_ptr->SCHEDULING_ENDPOINT, &proc_nr_n) != OK) {
- printf("SCHED: WARNING: got an invalid endpoint in OOQ msg %u.\n",
- m_ptr->SCHEDULING_ENDPOINT);
+ printf("SCHED: WARNING: got an invalid endpoint in OOQ msg "
+ "%ld\n", m_ptr->SCHEDULING_ENDPOINT);
return EBADEPT;
}
patch_ptr(mbuf, vsp);
if ((r = sys_datacopy(SELF, (vir_bytes) mbuf, proc_e, (vir_bytes) vsp,
(phys_bytes)frame_len)) != OK) {
- printf("VFS: datacopy failed (%d) trying to copy to %p\n", r, vsp);
+ printf("VFS: datacopy failed (%d) trying to copy to %lu\n", r, vsp);
return(r);
}
* as it isn't blocking on i/o.
*/
if(GRANT_VALID(fp->fp_grant)) {
- printf("vfs: fork: fp (endpoint %d) has grant %d\n", fp->fp_endpoint, fp->fp_grant);
+ printf("vfs: fork: fp (endpoint %d) has grant %ld\n", fp->fp_endpoint, fp->fp_grant);
panic("fp contains valid grant");
}
if(GRANT_VALID(cp->fp_grant)) {
- printf("vfs: fork: cp (endpoint %d) has grant %d\n", cp->fp_endpoint, cp->fp_grant);
+ printf("vfs: fork: cp (endpoint %d) has grant %ld\n", cp->fp_endpoint, cp->fp_grant);
panic("cp contains valid grant");
}
#include "vnode.h"
#include "vmnt.h"
-FORWARD _PROTOTYPE( in_group, (gid_t grp) );
+FORWARD _PROTOTYPE( int in_group, (gid_t grp) );
/*===========================================================================*
* do_chmod *
/* Is vnode pointer reasonable? */
#define SANEVP(v) ((((v) >= &vnode[0] && (v) < &vnode[NR_VNODES])))
-#define BADVP(v, f, l) printf("%s:%d: bad vp 0x%x\n", f, l, v)
+#define BADVP(v, f, l) printf("%s:%d: bad vp %p\n", f, l, v)
/* vp check that returns 0 for use in check_vrefs() */
#define CHECKVN(v) if(!SANEVP(v)) { \