diff -Naur -X exclude-files ac_cur/arch/um/defconfig ac/arch/um/defconfig --- ac_cur/arch/um/defconfig Sun Jul 15 21:25:01 2001 +++ ac/arch/um/defconfig Sun Jul 15 21:30:38 2001 @@ -30,6 +30,7 @@ CONFIG_UNIX98_PTY_COUNT=256 CONFIG_SSL=y CONFIG_HOSTFS=m +CONFIG_MCONSOLE=y # # Block devices @@ -101,7 +102,6 @@ CONFIG_REISERFS_FS=m # CONFIG_REISERFS_CHECK is not set # CONFIG_ADFS_FS is not set -# CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BFS_FS is not set @@ -119,7 +119,6 @@ CONFIG_MINIX_FS=m # CONFIG_VXFS_FS is not set # CONFIG_NTFS_FS is not set -# CONFIG_NTFS_RW is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y CONFIG_DEVFS_FS=y @@ -127,37 +126,22 @@ # CONFIG_DEVFS_DEBUG is not set CONFIG_DEVPTS_FS=y # CONFIG_QNX4FS_FS is not set -# CONFIG_QNX4FS_RW is not set # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set -# CONFIG_SYSV_FS_WRITE is not set # CONFIG_UDF_FS is not set -# CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set -# CONFIG_UFS_FS_WRITE is not set # # Network File Systems # # CONFIG_CODA_FS is not set # CONFIG_NFS_FS is not set -# CONFIG_NFS_V3 is not set -# CONFIG_ROOT_NFS is not set # CONFIG_NFSD is not set -# CONFIG_NFSD_V3 is not set # CONFIG_SUNRPC is not set # CONFIG_LOCKD is not set # CONFIG_SMB_FS is not set # CONFIG_NCP_FS is not set -# CONFIG_NCPFS_PACKET_SIGNING is not set -# CONFIG_NCPFS_IOCTL_LOCKING is not set -# CONFIG_NCPFS_STRONG is not set -# CONFIG_NCPFS_NFS_NS is not set -# CONFIG_NCPFS_OS2_NS is not set -# CONFIG_NCPFS_SMALLDOS is not set -# CONFIG_NCPFS_NLS is not set -# CONFIG_NCPFS_EXTRAS is not set # # Partition Types diff -Naur -X exclude-files ac_cur/arch/um/drivers/mconsole_user.c ac/arch/um/drivers/mconsole_user.c --- ac_cur/arch/um/drivers/mconsole_user.c Sun Jul 15 21:26:31 2001 +++ ac/arch/um/drivers/mconsole_user.c Sun Jul 15 21:30:40 2001 @@ -125,7 +125,7 @@ strcpy(socket_name, temp); strcpy(addr.sun_path, temp); - err = bind(sock, &addr, sizeof(addr)); + err = bind(sock, (struct sockaddr *) &addr, sizeof(addr)); if (err < 0) { if (errno != EADDRINUSE) { perror("bind"); diff -Naur -X exclude-files ac_cur/arch/um/drivers/ubd.c ac/arch/um/drivers/ubd.c --- ac_cur/arch/um/drivers/ubd.c Sun Jul 15 21:25:02 2001 +++ ac/arch/um/drivers/ubd.c Sun Jul 15 21:30:40 2001 @@ -459,7 +459,7 @@ g.start = 2; return copy_to_user(loc, &g, sizeof g) ? -EFAULT : 0; case BLKRASET: - if(!suser()) return -EACCES; + if(!capable(CAP_SYS_ADMIN)) return -EACCES; if(arg > 0xff) return -EINVAL; read_ahead[MAJOR(inode->i_rdev)] = arg; return 0; @@ -477,14 +477,14 @@ put_user(ubd_dev[dev].size >> 9, (long *) arg); return 0; case BLKFLSBUF: - if(!suser()) return -EACCES; + if(!capable(CAP_SYS_ADMIN)) return -EACCES; return 0; case BLKRRPART: /* Re-read partition tables */ return 0; /* revalidate_hddisk(inode->i_rdev, 1); */ case HDIO_SET_UNMASKINTR: - if (!suser()) return -EACCES; + if (!capable(CAP_SYS_ADMIN)) return -EACCES; if ((arg > 1) || (MINOR(inode->i_rdev) & 0x3F)) return -EINVAL; return 0; @@ -504,7 +504,7 @@ return 0; case HDIO_SET_MULTCOUNT: - if (!suser()) return -EACCES; + if (!capable(CAP_SYS_ADMIN)) return -EACCES; if (MINOR(inode->i_rdev) & 0x3F) return -EINVAL; return 0; diff -Naur -X exclude-files ac_cur/arch/um/include/kern_util.h ac/arch/um/include/kern_util.h --- ac_cur/arch/um/include/kern_util.h Sun Jul 15 21:26:31 2001 +++ ac/arch/um/include/kern_util.h Sun Jul 15 21:30:40 2001 @@ -31,7 +31,7 @@ extern void do_bh(void); extern void set_init_pid(int pid); extern unsigned long alloc_stack(void); -extern int do_signal(void *t, unsigned long *error, int *again_out); +extern int do_signal(unsigned long *error, int *again_out); extern int is_stack_fault(unsigned long sp); extern unsigned long segv(unsigned long address, unsigned long ip, int is_write, int is_user); diff -Naur -X exclude-files ac_cur/arch/um/include/sysdep-ppc/ptrace.h ac/arch/um/include/sysdep-ppc/ptrace.h --- ac_cur/arch/um/include/sysdep-ppc/ptrace.h Sun Jul 15 21:25:02 2001 +++ ac/arch/um/include/sysdep-ppc/ptrace.h Sun Jul 15 21:30:40 2001 @@ -41,7 +41,7 @@ #define UM_MAX_REG (PT_FPR0) #define UM_MAX_REG_OFFSET (UM_MAX_REG * sizeof(PPC_REG)) -#define EMPTY_REGS { { [ 0 ... NUM_REGS ] = 0 } } +#define EMPTY_REGS { { [ 0 ... NUM_REGS - 1] = 0 } } #define UM_REG(r, n) ((r)->regs[n]) diff -Naur -X exclude-files ac_cur/arch/um/kernel/ksyms.c ac/arch/um/kernel/ksyms.c --- ac_cur/arch/um/kernel/ksyms.c Sun Jul 15 21:25:02 2001 +++ ac/arch/um/kernel/ksyms.c Sun Jul 15 21:30:40 2001 @@ -15,5 +15,6 @@ EXPORT_SYMBOL(kernel_thread); EXPORT_SYMBOL(__const_udelay); EXPORT_SYMBOL(sys_waitpid); -EXPORT_SYMBOL(__do_copy_from_user); EXPORT_SYMBOL(task_size); +EXPORT_SYMBOL(__do_copy_from_user); +EXPORT_SYMBOL(__do_strncpy_from_user); diff -Naur -X exclude-files ac_cur/arch/um/kernel/process_kern.c ac/arch/um/kernel/process_kern.c --- ac_cur/arch/um/kernel/process_kern.c Sun Jul 15 21:26:29 2001 +++ ac/arch/um/kernel/process_kern.c Sun Jul 15 21:30:40 2001 @@ -236,12 +236,7 @@ if(task == NULL) task = current; do_bh(); if(task->need_resched) schedule(); - if((task->sigpending != 0) && - (task->thread.signal.state == SIGNAL_NONE)){ - block_signals(); - do_signal(task, NULL, NULL); - unblock_signals(); - } + if(task->sigpending != 0) do_signal(NULL, NULL); } void release_thread(struct task_struct *task) @@ -664,9 +659,8 @@ void interrupt_end(void) { if(current->need_resched) schedule(); - if(current->thread.signal.state == SIGNAL_NONE) - do_signal(current, NULL, NULL); - if(current->thread.signal.state > SIGNAL_PENDING) + do_signal(NULL, NULL); + if(current->thread.signal.state != SIGNAL_NONE) probe_stack(UM_SP(¤t->thread.process_regs)); } diff -Naur -X exclude-files ac_cur/arch/um/kernel/signal_kern.c ac/arch/um/kernel/signal_kern.c --- ac_cur/arch/um/kernel/signal_kern.c Sun Jul 15 21:25:02 2001 +++ ac/arch/um/kernel/signal_kern.c Sun Jul 15 21:30:42 2001 @@ -129,16 +129,13 @@ * stack-frames in one go after that. */ -static int kern_do_signal(void *t, sigset_t *oldset, unsigned long *error, +static int kern_do_signal(sigset_t *oldset, unsigned long *error, int *again_out) { - struct task_struct *task; siginfo_t info; struct k_sigaction *ka; int again; - task = t; - if(task == NULL) task = current; if (!oldset) oldset = ¤t->blocked; @@ -146,24 +143,24 @@ for (;;) { unsigned long signr; - spin_lock_irq(&task->sigmask_lock); - signr = dequeue_signal(&task->blocked, &info); - spin_unlock_irq(&task->sigmask_lock); + spin_lock_irq(¤t->sigmask_lock); + signr = dequeue_signal(¤t->blocked, &info); + spin_unlock_irq(¤t->sigmask_lock); if (!signr) break; - if ((task->ptrace & PT_PTRACED) && signr != SIGKILL) { + if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { /* Let the debugger run. */ - task->exit_code = signr; - task->state = TASK_STOPPED; - notify_parent(task, SIGCHLD); + current->exit_code = signr; + current->state = TASK_STOPPED; + notify_parent(current, SIGCHLD); schedule(); /* We're back. Did the debugger cancel the sig? */ - if (!(signr = task->exit_code)) + if (!(signr = current->exit_code)) continue; - task->exit_code = 0; + current->exit_code = 0; /* The debugger continued. Ignore SIGSTOP. */ if (signr == SIGSTOP) @@ -174,18 +171,18 @@ info.si_signo = signr; info.si_errno = 0; info.si_code = SI_USER; - info.si_pid = task->p_pptr->pid; - info.si_uid = task->p_pptr->uid; + info.si_pid = current->p_pptr->pid; + info.si_uid = current->p_pptr->uid; } /* If the (new) signal is now blocked, requeue it. */ - if (sigismember(&task->blocked, signr)) { - send_sig_info(signr, &info, task); + if (sigismember(¤t->blocked, signr)) { + send_sig_info(signr, &info, current); continue; } } - ka = &task->sig->action[signr-1]; + ka = ¤t->sig->action[signr-1]; if (ka->sa.sa_handler == SIG_IGN) { if (signr != SIGCHLD) continue; @@ -199,7 +196,7 @@ int exit_code = signr; /* Init gets no signals it doesn't want. */ - if (task->pid == 1) + if (current->pid == 1) continue; switch (signr) { @@ -207,15 +204,15 @@ continue; case SIGTSTP: case SIGTTIN: case SIGTTOU: - if (is_orphaned_pgrp(task->pgrp)) + if (is_orphaned_pgrp(current->pgrp)) continue; /* FALLTHRU */ case SIGSTOP: - task->state = TASK_STOPPED; - task->exit_code = signr; - if (!(task->p_pptr->sig->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDSTOP)) - notify_parent(task, SIGCHLD); + current->state = TASK_STOPPED; + current->exit_code = signr; + if (!(current->p_pptr->sig->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDSTOP)) + notify_parent(current, SIGCHLD); schedule(); continue; @@ -227,25 +224,27 @@ /* FALLTHRU */ default: - sigaddset(&task->pending.signal, signr); - recalc_sigpending(task); - task->flags |= PF_SIGNALED; + sigaddset(¤t->pending.signal, signr); + recalc_sigpending(current); + current->flags |= PF_SIGNALED; do_exit(exit_code); /* NOTREACHED */ } } /* Whee! Actually deliver the signal. */ - again = handle_signal(task, signr, ka, oldset, error); + again = handle_signal(current, signr, ka, oldset, error); if(again_out && (*again_out == 0)) *again_out = again; return(1); } return(0); } -int do_signal(void *t, unsigned long *error, int *again_out) +int do_signal(unsigned long *error, int *again_out) { - return(kern_do_signal(t, NULL, error, again_out)); + if(current->thread.signal.state == SIGNAL_NONE) + return(kern_do_signal(NULL, error, again_out)); + return(0); } /* @@ -266,7 +265,7 @@ while (1) { current->state = TASK_INTERRUPTIBLE; schedule(); - if (kern_do_signal(current, &saveset, NULL, NULL)) + if (kern_do_signal(&saveset, NULL, NULL)) return -EINTR; } } @@ -293,7 +292,7 @@ while (1) { current->state = TASK_INTERRUPTIBLE; schedule(); - if (kern_do_signal(current, &saveset, NULL, NULL)) + if (kern_do_signal(&saveset, NULL, NULL)) return -EINTR; } } diff -Naur -X exclude-files ac_cur/arch/um/kernel/syscall_user.c ac/arch/um/kernel/syscall_user.c --- ac_cur/arch/um/kernel/syscall_user.c Sun Jul 15 21:25:02 2001 +++ ac/arch/um/kernel/syscall_user.c Sun Jul 15 21:30:42 2001 @@ -81,7 +81,7 @@ again = 0; if((result == -ERESTARTNOHAND) || (result == -ERESTARTSYS) || (result == -ERESTARTNOINTR)) - do_signal(NULL, &result, &again); + do_signal(&result, &again); UM_SET_SYSCALL_RETURN(regs, result); set_repeat_syscall(again); syscall_trace();