diff -u --recursive --new-file v2.1.56/linux/CREDITS linux/CREDITS
--- v2.1.56/linux/CREDITS	Tue Sep 23 16:48:46 1997
+++ linux/CREDITS	Mon Sep 22 14:55:59 1997
@@ -483,6 +483,15 @@
 N: Philip Gladstone
 E: philip@raptor.com
 D: Kernel / timekeeping stuff
+  
+N: Richard E. Gooch
+E: rgooch@atnf.csiro.au
+D: parent process death signal to children
+D: prctl() syscall
+S: CSIRO Australia Telescope National Facility
+S: P.O. Box 76, Epping
+S: N.S.W., 2121
+S: Australia
 
 N: Dmitry S. Gorodchanin
 E: begemot@bgm.rosprint.net
diff -u --recursive --new-file v2.1.56/linux/Documentation/magic-number.txt linux/Documentation/magic-number.txt
--- v2.1.56/linux/Documentation/magic-number.txt	Sun Feb  2 05:18:29 1997
+++ linux/Documentation/magic-number.txt	Tue Sep 23 19:17:35 1997
@@ -28,37 +28,50 @@
 					Theodore Ts'o
 					31-Mar-94
 
-The magic table is current to Linux 1.3.98.
+The magic table is current to Linux 2.1.55.
 
 					Michael Chastain
-					<mec@duracef.shout.net>
-					6 May 1996
+					<mailto:mec@shout.net>
+					22 Sep 1997
 
 
 
 Magic Name          Number      Structure            File
 ===========================================================================
-RISCOM8_MAGIC       0x0907      struct riscom_port   drivers/char/riscom8.h
-APM_BIOS_MAGIC      0x4101      struct apm_struct    include/linux/apm_bios.h
-CYCLADES_MAGIC      0x4359      struct cyclades_port include/linux/cyclades.h
-FASYNC_MAGIC        0x4601      struct fasync_struct include/linux/fs.h
-PTY_MAGIC           0x5001      struct pty_struct    drivers/char/pty.c
-PPP_MAGIC           0x5002      struct ppp_struct    include/linux/if_ppp.h
-SERIAL_MAGIC        0x5301      struct async_struct  include/linux/serial.h
-SLIP_MAGIC          0x5302      struct slip          drivers/net/slip.h
-STRIP_MAGIC         0x5303      struct strip         drivers/net/strip.c
-TTY_MAGIC           0x5401      struct tty_struct    include/linux/tty.h
-TTY_DRIVER_MAGIC    0x5402      struct tty_driver    include/linux/tty_driver.h
-TTY_LDISC_MAGIC     0x5403      struct tty_ldisc     include/linux/tty_ldisc.h
-SCC_MAGIC           0x8530      struct scc_channel   include/linux/scc.h
-ISDN_ASYNC_MAGIC    0x49344C01  modem_info           include/linux/isdn.h
-ISDN_NET_MAGIC      0x49344C02  isdn_net_ndev        include/linux/isdn.h
-STLI_BOARDMAGIC     0x4bc6c825  stlibrd_t            include/linux/istallion.h
-ROUTER_MAGIC        0x524d4157  wanlink_t            include/linux/router.h
-STLI_PORTMAGIC      0xe671c7a1  stliport_t           include/linux/istallion.h
-STL_PANELMAGIC      0x7ef621a1  stlpanel_t           include/linux/stallion.h
-STL_BOARDMAGIC      0xa2267f52  stlbrd_t             include/linux/stallion.h
-STL_PORTMAGIC       0x5a7182c9  stlport_t            include/linux/stallion.h
-PCXX_MAGIC          0x5c6df104  struct channel       drivers/char/pcxx.h
-BAYCOM_MAGIC        0x3105bac0  struct baycom_state  drivers/char/baycom.c
 
+MKISS_DRIVER_MAGIC    0x04bf      mkiss_channel     drivers/net/mkiss.h
+RISCOM8_MAGIC         0x0907      riscom_port       drivers/char/riscom8.h
+APM_BIOS_MAGIC        0x4101      apm_bios_struct   include/linux/apm_bios.h
+CYCLADES_MAGIC        0x4359      cyclades_port     include/linux/cyclades.h
+FASYNC_MAGIC          0x4601      fasync_struct     include/linux/fs.h
+PPP_MAGIC             0x5002      ppp               include/linux/if_ppp.h
+SERIAL_MAGIC          0x5301      async_struct      include/linux/serial.h
+SSTATE_MAGIC          0x5302      serial_state      include/linux/serial.h
+SLIP_MAGIC            0x5302      slip              drivers/net/slip.h
+STRIP_MAGIC           0x5303      strip             drivers/net/strip.c
+X25_ASY_MAGIC         0x5303      x25_asy           drivers/net/x25_asy.h
+AX25_MAGIC            0x5316      ax_disp           drivers/net/mkiss.h
+ESP_MAGIC             0x53ee      esp_struct        drivers/char/esp.h
+TTY_MAGIC             0x5401      tty_struct        include/linux/tty.h
+TTY_DRIVER_MAGIC      0x5402      tty_driver        include/linux/tty_driver.h
+TTY_LDISC_MAGIC       0x5403      tty_ldisc         include/linux/tty_ldisc.h
+SCC_MAGIC             0x8530      scc_channel       include/linux/scc.h
+RPORT_MAGIC           0x525001    r_port            drivers/char/rocket_int.h
+SLAB_C_MAGIC          0x4f17a36d  kmem_cache_s      mm/slab.c
+SLAB_RED_MAGIC2       0x170fc2a5  (any)             mm/slab.c
+ECP_MAGIC             0x21504345  cdkecpsig         include/linux/cdk.h
+ISDN_ASYNC_MAGIC      0x49344C01  modem_info        include/linux/isdn.h
+ISDN_NET_MAGIC        0x49344C02  isdn_net_local_s  include/linux/isdn.h
+STLI_BOARDMAGIC       0x4bc6c825  stlibrd           include/linux/istallion.h
+ROUTER_MAGIC          0x524d4157  wan_device        include/linux/wanrouter.h
+SLAB_RED_MAGIC1       0x5a2cf071  (any)             mm/slab.c
+STL_PORTMAGIC         0x5a7182c9  stlport           include/linux/stallion.h
+HDLCDRV_MAGIC         0x5ac6e778  hdlcdrv_state     include/linux/hdlcdrv.h
+EPCA_MAGIC            0x5c6df104  channel           include/linux/epca.h
+PCXX_MAGIC            0x5c6df104  channel           drivers/char/pcxx.h
+STL_PANELMAGIC        0x7ef621a1  stlpanel          include/linux/stallion.h
+STL_BOARDMAGIC        0xa2267f52  stlbrd            include/linux/stallion.h
+SLAB_MAGIC_ALLOC      0xa5c32f2b  kmem_slab_s       mm/slab.c
+SLAB_MAGIC_DESTROYED  0xb2f23c5a  kmem_slab_s       mm/slab.c
+STLI_PORTMAGIC        0xe671c7a1  stliport          include/linux/istallion.h
+CCB_MAGIC             0xf2691ad2  ccb               drivers/scsi/ncr53c8xx.c
diff -u --recursive --new-file v2.1.56/linux/Makefile linux/Makefile
--- v2.1.56/linux/Makefile	Tue Sep 23 16:48:46 1997
+++ linux/Makefile	Sat Sep 20 14:54:48 1997
@@ -1,6 +1,6 @@
 VERSION = 2
 PATCHLEVEL = 1
-SUBLEVEL = 56
+SUBLEVEL = 57
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
 
diff -u --recursive --new-file v2.1.56/linux/arch/alpha/kernel/entry.S linux/arch/alpha/kernel/entry.S
--- v2.1.56/linux/arch/alpha/kernel/entry.S	Wed Sep  3 20:52:41 1997
+++ linux/arch/alpha/kernel/entry.S	Mon Sep 22 14:55:59 1997
@@ -771,4 +771,5 @@
 	.quad sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, do_entSys /* sys_afs_syscall */, sys_newuname
 	.quad sys_nanosleep, sys_mremap, sys_nfsservctl, sys_setresuid, sys_getresuid
 	.quad sys_pciconfig_read, sys_pciconfig_write, sys_query_module
+	.quad sys_prctl
 	.quad do_entSys, do_entSys
diff -u --recursive --new-file v2.1.56/linux/arch/i386/boot/compressed/misc.c linux/arch/i386/boot/compressed/misc.c
--- v2.1.56/linux/arch/i386/boot/compressed/misc.c	Wed Apr 16 14:14:59 1997
+++ linux/arch/i386/boot/compressed/misc.c	Sat Sep 20 15:20:35 1997
@@ -75,6 +75,9 @@
  * This is set up by the setup-routine at boot-time
  */
 #define EXT_MEM_K (*(unsigned short *)0x90002)
+#ifndef STANDARD_MEMORY_BIOS_CALL
+#define ALT_MEM_K (*(unsigned long *) 0x901e0)
+#endif
 #define SCREEN_INFO (*(struct screen_info *)0x90000)
 
 extern char input_data[];
@@ -287,9 +290,9 @@
 void setup_normal_output_buffer()
 {
 #ifdef STANDARD_MEMORY_BIOS_CALL
-	if (EXT_MEM_K < 1024) error("<2M of mem\n");
+	if (EXT_MEM_K < 1024) error("Less than 2MB of memory.\n");
 #else
-	if (EXT_MEM_K*64 < 1024) error("<2M of mem\n");
+	if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < 1024) error("Less than 2MB of memory.\n");
 #endif
 	output_data = (char *)0x100000; /* Points to 1M */
 }
@@ -305,7 +308,7 @@
 #ifdef STANDARD_MEMORY_BIOS_CALL
 	if (EXT_MEM_K < (3*1024)) error("Less than 4MB of memory.\n");
 #else
-	if (EXT_MEM_K*64 < (3*1024)) error("Less than 4MB of memory.\n");
+	if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < (3*1024)) error("Less than 4MB of memory.\n");
 #endif	
 	mv->low_buffer_start = output_data = (char *)LOW_BUFFER_START;
 	high_loaded = 1;
diff -u --recursive --new-file v2.1.56/linux/arch/i386/kernel/entry.S linux/arch/i386/kernel/entry.S
--- v2.1.56/linux/arch/i386/kernel/entry.S	Thu Sep 11 09:02:23 1997
+++ linux/arch/i386/kernel/entry.S	Mon Sep 22 14:55:59 1997
@@ -528,6 +528,7 @@
 	.long SYMBOL_NAME(sys_nfsservctl)
 	.long SYMBOL_NAME(sys_setresgid)	/* 170 */
 	.long SYMBOL_NAME(sys_getresgid)
-	.rept NR_syscalls-171
+	.long SYMBOL_NAME(sys_prctl)
+	.rept NR_syscalls-172
 		.long SYMBOL_NAME(sys_ni_syscall)
 	.endr
diff -u --recursive --new-file v2.1.56/linux/arch/m68k/kernel/entry.S linux/arch/m68k/kernel/entry.S
--- v2.1.56/linux/arch/m68k/kernel/entry.S	Mon Aug  4 16:25:36 1997
+++ linux/arch/m68k/kernel/entry.S	Mon Sep 22 14:55:59 1997
@@ -568,6 +568,7 @@
 	.long SYMBOL_NAME(sys_query_module)
 	.long SYMBOL_NAME(sys_poll)
 	.long SYMBOL_NAME(sys_nfsservctl)
+	.long SYMBOL_NAME(sys_prctl)
 	.rept NR_syscalls-(.-SYMBOL_NAME(sys_call_table))/4
 		.long SYMBOL_NAME(sys_ni_syscall)
 	.endr
diff -u --recursive --new-file v2.1.56/linux/arch/mips/kernel/irixsig.c linux/arch/mips/kernel/irixsig.c
--- v2.1.56/linux/arch/mips/kernel/irixsig.c	Mon Aug 18 18:19:42 1997
+++ linux/arch/mips/kernel/irixsig.c	Sat Sep 20 14:51:53 1997
@@ -565,7 +565,7 @@
 			timeo = 1;
 			break;
 		}
-		if(current->signal & ~(current->blocked)) return -EINTR;
+		if(signal_pending(current)) return -EINTR;
 	}
 
 	if(timeo) return -EAGAIN;
@@ -692,7 +692,7 @@
 		if(options & W_NOHANG)
 			goto end_waitsys;
 		retval = -ERESTARTSYS;
-		if(current->signal & ~current->blocked)
+		if(signal_pending(current))
 			goto end_waitsys;
 		current->state = TASK_INTERRUPTIBLE;
 		schedule();
diff -u --recursive --new-file v2.1.56/linux/arch/mips/kernel/syscalls.h linux/arch/mips/kernel/syscalls.h
--- v2.1.56/linux/arch/mips/kernel/syscalls.h	Mon Aug 18 18:19:42 1997
+++ linux/arch/mips/kernel/syscalls.h	Mon Sep 22 14:55:59 1997
@@ -212,3 +212,4 @@
 SYS(sys_getresgid, 3)
 SYS(sys_setresgid, 3)				/* 4190 */
 SYS(sys_getresgid, 3)
+SYS(sys_prctl, 5)
diff -u --recursive --new-file v2.1.56/linux/arch/ppc/kernel/misc.S linux/arch/ppc/kernel/misc.S
--- v2.1.56/linux/arch/ppc/kernel/misc.S	Mon Aug 18 18:19:44 1997
+++ linux/arch/ppc/kernel/misc.S	Mon Sep 22 14:55:59 1997
@@ -539,6 +539,7 @@
 	.long sys_query_module
 	.long sys_poll
 	.long sys_nfsservctl
+	.long sys_prctl
 	.long sys_debug
-	.space (NR_syscalls-170)*4
+	.space (NR_syscalls-171)*4
 
diff -u --recursive --new-file v2.1.56/linux/arch/sparc/ap1000/aplib.c linux/arch/sparc/ap1000/aplib.c
--- v2.1.56/linux/arch/sparc/ap1000/aplib.c	Mon Aug 18 18:19:44 1997
+++ linux/arch/sparc/ap1000/aplib.c	Sat Sep 20 14:51:53 1997
@@ -457,7 +457,7 @@
 		tnet_check_completion();
 		if (resched_needed())
 			break;
-		if (current->signal & ~current->blocked) break;
+		if (signal_pending(current)) break;
 	}
 	return 0;
 }
diff -u --recursive --new-file v2.1.56/linux/arch/sparc/ap1000/util.c linux/arch/sparc/ap1000/util.c
--- v2.1.56/linux/arch/sparc/ap1000/util.c	Sun Jan 26 02:07:06 1997
+++ linux/arch/sparc/ap1000/util.c	Sat Sep 20 14:51:53 1997
@@ -376,7 +376,7 @@
 		add_timer(timer);
 		interruptible_sleep_on(&timer_wait);
 		del_timer(timer);
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			return -EINTR;
 	}
 	kfree_s(timer,sizeof(*timer));
diff -u --recursive --new-file v2.1.56/linux/arch/sparc/kernel/systbls.S linux/arch/sparc/kernel/systbls.S
--- v2.1.56/linux/arch/sparc/kernel/systbls.S	Tue May 13 22:41:03 1997
+++ linux/arch/sparc/kernel/systbls.S	Mon Sep 22 14:55:59 1997
@@ -125,6 +125,7 @@
 	.long C_LABEL(sys_fdatasync)
 	.long C_LABEL(sys_nfsservctl)
 /*255*/	.long C_LABEL(sys_aplib)
+	.long C_LABEL(sys_prctl)
 	.long C_LABEL(sys_nis_syscall)
 
 	/* Now the SunOS syscall table. */
@@ -219,3 +220,4 @@
 	.long C_LABEL(sunos_nosys), C_LABEL(sunos_nosys)
 /*250*/	.long C_LABEL(sunos_nosys), C_LABEL(sunos_nosys), C_LABEL(sunos_nosys)
 	.long C_LABEL(sunos_nosys), C_LABEL(sunos_nosys), C_LABEL(sys_aplib)
+	.long C_LABEL(sunos_nosys)
diff -u --recursive --new-file v2.1.56/linux/arch/sparc64/kernel/systbls.S linux/arch/sparc64/kernel/systbls.S
--- v2.1.56/linux/arch/sparc64/kernel/systbls.S	Thu Sep  4 17:07:30 1997
+++ linux/arch/sparc64/kernel/systbls.S	Mon Sep 22 14:55:59 1997
@@ -68,7 +68,7 @@
 /*240*/	.word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys_nis_syscall, sys_nis_syscall
 	.word sys_nis_syscall, sys_sched_get_priority_max, sys_sched_get_priority_min, sys32_sched_rr_get_interval, sys32_nanosleep
 /*250*/	.word sys32_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys32_nfsservctl
-	.word sys_aplib
+	.word sys_aplib, sys_prctl
 
 	/* Now the 64-bit native Linux syscall table. */
 
@@ -127,7 +127,7 @@
 /*240*/	.word sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_nis_syscall, sys_nis_syscall
 	.word sys_nis_syscall, sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, sys_nanosleep
 /*250*/	.word sys_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl
-	.word sys_aplib
+	.word sys_aplib, sys_prctl
 
 	/* Now the 32-bit SunOS syscall table. */
 
@@ -221,3 +221,4 @@
 	.word sunos_nosys, sunos_nosys
 /*250*/	.word sunos_nosys, sunos_nosys, sunos_nosys
 	.word sunos_nosys, sunos_nosys, sys_aplib
+	.word sunos_nosys
diff -u --recursive --new-file v2.1.56/linux/drivers/block/acsi_slm.c linux/drivers/block/acsi_slm.c
--- v2.1.56/linux/drivers/block/acsi_slm.c	Mon Aug  4 16:25:37 1997
+++ linux/drivers/block/acsi_slm.c	Sat Sep 20 14:51:54 1997
@@ -634,7 +634,7 @@
 	while( SLMState == PRINTING ||
 		   (SLMState == FILLING && SLMBufOwner != device) ) {
 		interruptible_sleep_on( &slm_wait );
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			return( -ERESTARTSYS );
 	}
 	if (SLMState == IDLE) {
diff -u --recursive --new-file v2.1.56/linux/drivers/block/ataflop.c linux/drivers/block/ataflop.c
--- v2.1.56/linux/drivers/block/ataflop.c	Tue Sep 23 16:48:47 1997
+++ linux/drivers/block/ataflop.c	Sun Sep 21 10:46:52 1997
@@ -1978,10 +1978,14 @@
 
   drive = inode->i_rdev & 3;
 
-  if (!filp || (filp->f_mode & (2 | OPEN_WRITE_BIT)))
-    /* if the file is mounted OR (writable now AND writable at open
-       time) Linus: Does this cover all cases? */
-    block_fsync (filp, filp->f_dentry);
+	/*
+	 * If filp is NULL, we're being called from blkdev_release
+	 * or after a failed mount attempt.  In the former case the
+	 * device has already been sync'ed, and in the latter no
+	 * sync is required.  Otherwise, sync if filp is writable.
+	 */
+	if (filp && (filp->f_mode & (2 | OPEN_WRITE_BIT)))
+		block_fsync (filp, filp->f_dentry);
 
   if (fd_ref[drive] < 0)
     fd_ref[drive] = 0;
diff -u --recursive --new-file v2.1.56/linux/drivers/block/floppy.c linux/drivers/block/floppy.c
--- v2.1.56/linux/drivers/block/floppy.c	Tue Sep 23 16:48:47 1997
+++ linux/drivers/block/floppy.c	Sun Sep 21 10:46:52 1997
@@ -415,7 +415,7 @@
 
 static volatile int command_status = FD_COMMAND_NONE, fdc_busy = 0;
 static struct wait_queue *fdc_wait = NULL, *command_done = NULL;
-#define NO_SIGNAL (!(current->signal & ~current->blocked) || !interruptible)
+#define NO_SIGNAL (!interruptible || !signal_pending(current))
 #define CALL(x) if ((x) == -EINTR) return -EINTR
 #define ECALL(x) if ((ret = (x))) return ret;
 #define _WAIT(x,i) CALL(ret=wait_til_done((x),i))
@@ -3500,9 +3500,13 @@
 
 	drive = DRIVE(inode->i_rdev);
 
-	if (!filp || (filp->f_mode & (2 | OPEN_WRITE_BIT)))
-		/* if the file is mounted OR (writable now AND writable at
-		 * open time) Linus: Does this cover all cases? */
+	/*
+	 * If filp is NULL, we're being called from blkdev_release
+	 * or after a failed mount attempt.  In the former case the
+	 * device has already been sync'ed, and in the latter no
+	 * sync is required.  Otherwise, sync if filp is writable.
+	 */
+	if (filp && (filp->f_mode & (2 | OPEN_WRITE_BIT)))
 		block_fsync(filp, filp->f_dentry);
 
 	if (UDRS->fd_ref < 0)
diff -u --recursive --new-file v2.1.56/linux/drivers/block/swim3.c linux/drivers/block/swim3.c
--- v2.1.56/linux/drivers/block/swim3.c	Tue Sep 23 16:48:47 1997
+++ linux/drivers/block/swim3.c	Sun Sep 21 10:46:52 1997
@@ -683,8 +683,7 @@
 	if (fs->state != idle) {
 		++fs->wanted;
 		while (fs->state != available) {
-			if (interruptible
-			    && (current->signal & ~current->blocked)) {
+			if (interruptible && signal_pending(current)) {
 				--fs->wanted;
 				restore_flags(flags);
 				return -EINTR;
@@ -720,7 +719,7 @@
 	for (n = 2*HZ; n > 0; --n) {
 		if (swim3_readbit(fs, RELAX))
 			break;
-		if ((current->signal & ~current->blocked) != 0) {
+		if (signal_pending(current)) {
 			err = -EINTR;
 			break;
 		}
@@ -781,7 +780,7 @@
 		for (n = HZ; n > 0; --n) {
 			if (swim3_readbit(fs, SEEK_COMPLETE))
 				break;
-			if ((current->signal & ~current->blocked) != 0) {
+			if (signal_pending(current)) {
 				err = -EINTR;
 				break;
 			}
@@ -840,9 +839,16 @@
 
 	if (MINOR(inode->i_rdev) != 0)
 		return -ENXIO;
+	/*
+	 * If filp is NULL, we're being called from blkdev_release
+	 * or after a failed mount attempt.  In the former case the
+	 * device has already been sync'ed, and in the latter no
+	 * sync is required.  Otherwise, sync if filp is writable.
+	 */
+	if (filp && (filp->f_mode & (2 | OPEN_WRITE_BIT)))
+		block_fsync (filp, filp->f_dentry);
+
 	fs = &floppy_states[0];
-	if (filp == 0 || (filp->f_mode & (2 | OPEN_WRITE_BIT)))
-		block_fsync(filp, filp->f_dentry);
 	sw = fs->swim3;
 	if (fs->ref_count > 0 && --fs->ref_count == 0) {
 		swim3_action(fs, MOTOR_OFF);
@@ -880,7 +886,7 @@
 	for (n = HZ; n > 0; --n) {
 		if (swim3_readbit(fs, SEEK_COMPLETE))
 			break;
-		if ((current->signal & ~current->blocked) != 0)
+		if (signal_pending(current))
 			break;
 		current->state = TASK_INTERRUPTIBLE;
 		current->timeout = jiffies + 1;
diff -u --recursive --new-file v2.1.56/linux/drivers/cdrom/cdu31a.c linux/drivers/cdrom/cdu31a.c
--- v2.1.56/linux/drivers/cdrom/cdu31a.c	Tue May 13 22:41:06 1997
+++ linux/drivers/cdrom/cdu31a.c	Sat Sep 20 14:51:54 1997
@@ -844,7 +844,7 @@
       while (sony_inuse)
       {
          interruptible_sleep_on(&sony_wait);
-         if (current->signal & ~current->blocked)
+         if (signal_pending(current))
          {
             result_buffer[0] = 0x20;
             result_buffer[1] = SONY_SIGNAL_OP_ERR;
@@ -1556,7 +1556,7 @@
    while (sony_inuse)
    {
       interruptible_sleep_on(&sony_wait);
-      if (current->signal & ~current->blocked)
+      if (signal_pending(current))
       {
          restore_flags(flags);
          if (CURRENT && CURRENT->rq_status != RQ_INACTIVE)
@@ -2262,7 +2262,7 @@
    while (sony_inuse)
    {
       interruptible_sleep_on(&sony_wait);
-      if (current->signal & ~current->blocked)
+      if (signal_pending(current))
       {
          restore_flags(flags);
          return -EAGAIN;
diff -u --recursive --new-file v2.1.56/linux/drivers/cdrom/mcdx.c linux/drivers/cdrom/mcdx.c
--- v2.1.56/linux/drivers/cdrom/mcdx.c	Sat May 24 09:10:23 1997
+++ linux/drivers/cdrom/mcdx.c	Sat Sep 20 14:51:54 1997
@@ -947,7 +947,7 @@
 		xtrace(SLEEP, "*** delay: sleepq\n");
 		interruptible_sleep_on(&stuff->sleepq);
 		xtrace(SLEEP, "delay awoken\n");
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			xtrace(SLEEP, "got signal\n");
 		}
 	}
@@ -1410,7 +1410,7 @@
 
 			if (!stuffp->introk) { xtrace(XFER, "error via interrupt\n"); }
 			else if (current->timeout == 0) { xtrace(XFER, "timeout\n"); }
-			else if (current->signal & ~current->blocked) {
+			else if (signal_pending(current)) {
 				xtrace(XFER, "signal\n");
 			} else continue;
 
diff -u --recursive --new-file v2.1.56/linux/drivers/char/apm_bios.c linux/drivers/char/apm_bios.c
--- v2.1.56/linux/drivers/char/apm_bios.c	Tue Sep 23 16:48:47 1997
+++ linux/drivers/char/apm_bios.c	Sat Sep 20 15:21:42 1997
@@ -831,8 +831,7 @@
 		add_wait_queue(&process_list, &wait);
 repeat:
 		current->state = TASK_INTERRUPTIBLE;
-		if (queue_empty(as)
-		    && !(current->signal & ~current->blocked)) {
+		if (queue_empty(as) && !signal_pending(current)) {
 			schedule();
 			goto repeat;
 		}
@@ -859,7 +858,7 @@
 	}
 	if (i < count)
 		return count - i;
-	if (current->signal & ~current->blocked)
+	if (signal_pending(current))
 		return -ERESTARTSYS;
 	return 0;
 }
@@ -958,7 +957,7 @@
 
 	as = (struct apm_bios_struct *)kmalloc(sizeof(*as), GFP_KERNEL);
 	if (as == NULL) {
-		printk(KERN_ER "apm_bios: cannot allocate struct of size %d bytes",
+		printk(KERN_ERR "apm_bios: cannot allocate struct of size %d bytes",
 		       sizeof(*as));
 		return -ENOMEM;
 	}
diff -u --recursive --new-file v2.1.56/linux/drivers/char/cyclades.c linux/drivers/char/cyclades.c
--- v2.1.56/linux/drivers/char/cyclades.c	Thu Jul 17 10:06:04 1997
+++ linux/drivers/char/cyclades.c	Sat Sep 20 14:51:54 1997
@@ -2217,7 +2217,7 @@
 			break;
 		}
 	    restore_flags(flags);
-	    if (current->signal & ~current->blocked) {
+	    if (signal_pending(current)) {
 		retval = -ERESTARTSYS;
 		break;
 	    }
@@ -2275,7 +2275,7 @@
 	      || (ch_ctrl[channel].rs_status & C_RS_DCD))) {
 		break;
 	    }
-	    if (current->signal & ~current->blocked) {
+	    if (signal_pending(current)) {
 		retval = -ERESTARTSYS;
 		break;
 	    }
diff -u --recursive --new-file v2.1.56/linux/drivers/char/epca.c linux/drivers/char/epca.c
--- v2.1.56/linux/drivers/char/epca.c	Tue May 13 22:41:07 1997
+++ linux/drivers/char/epca.c	Sat Sep 20 14:51:54 1997
@@ -1384,7 +1384,7 @@
 			  (do_clocal || (ch->imodem & ch->dcd)))
 			break;
 
-		if (current->signal & ~current->blocked) 
+		if (signal_pending(current)) 
 		{
 			retval = -ERESTARTSYS;
 			break;
diff -u --recursive --new-file v2.1.56/linux/drivers/char/esp.c linux/drivers/char/esp.c
--- v2.1.56/linux/drivers/char/esp.c	Thu Aug 14 20:49:16 1997
+++ linux/drivers/char/esp.c	Sat Sep 20 14:51:54 1997
@@ -1733,7 +1733,7 @@
 
 	interruptible_sleep_on(&info->break_wait);
 
-	if (current->signal & ~current->blocked) {
+	if (signal_pending(current)) {
 		serial_out(info, UART_ESI_CMD1, ESI_ISSUE_BREAK);
 		serial_out(info, UART_ESI_CMD2, 0x00);
 		sti();
@@ -1775,11 +1775,11 @@
 			if (retval)
 				return retval;
 			tty_wait_until_sent(tty, 0);
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return -EINTR;
 			if (!arg) {
 				send_break(info, HZ/4);	/* 1/4 second */
-				if (current->signal & ~current->blocked)
+				if (signal_pending(current))
 					return -EINTR;
 			}
 			return 0;
@@ -1788,10 +1788,10 @@
 			if (retval)
 				return retval;
 			tty_wait_until_sent(tty, 0);
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return -EINTR;
 			send_break(info, arg ? arg*(HZ/10) : HZ/4);
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return -EINTR;
 			return 0;
 		case TIOCGSOFTCAR:
@@ -1845,7 +1845,7 @@
 			while (1) {
 				interruptible_sleep_on(&info->delta_msr_wait);
 				/* see if a signal did it */
-				if (current->signal & ~current->blocked)
+				if (signal_pending(current))
 					return -ERESTARTSYS;
 				cli();
 				cnow = info->icount;	/* atomic copy */
@@ -2086,7 +2086,7 @@
 		current->timeout = jiffies + char_time;
 		schedule();
 
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			break;
 
 		if (timeout && ((orig_jiffies + timeout) < jiffies))
@@ -2243,7 +2243,7 @@
 		    !(info->flags & ASYNC_CLOSING) &&
 		    (do_clocal))
 			break;
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			retval = -ERESTARTSYS;
 			break;
 		}
diff -u --recursive --new-file v2.1.56/linux/drivers/char/ftape/fdc-io.c linux/drivers/char/ftape/fdc-io.c
--- v2.1.56/linux/drivers/char/ftape/fdc-io.c	Sun Oct  6 22:55:46 1996
+++ linux/drivers/char/ftape/fdc-io.c	Sat Sep 20 14:51:54 1997
@@ -335,12 +335,12 @@
 /*** remove me when sure this doesn't happen ***/
 			if (current->timeout > 0) {
 				TRACE(-1, "*** BUG: unexpected schedule exit ***");
-				if (current->signal & ~current->blocked) {
+				if (signal_pending(current)) {
 					TRACE(4, "caused by signal ?");
 				}
 			}
 #endif
-			if (current->signal & ~current->blocked) {
+			if (signal_pending(current)) {
 				result = -EINTR;
 			} else {
 				result = -ETIME;
diff -u --recursive --new-file v2.1.56/linux/drivers/char/ftape/ftape-io.c linux/drivers/char/ftape/ftape-io.c
--- v2.1.56/linux/drivers/char/ftape/ftape-io.c	Tue Oct 29 15:40:36 1996
+++ linux/drivers/char/ftape/ftape-io.c	Sat Sep 20 14:51:54 1997
@@ -138,7 +138,7 @@
 			while (current->state != TASK_RUNNING) {
 				schedule();
 			}
-			if (current->signal & ~current->blocked) {
+			if (signal_pending(current)) {
 				TRACE(1, "awoken by non-blocked signal :-(");
 				break;	/* exit on signal */
 			}
diff -u --recursive --new-file v2.1.56/linux/drivers/char/istallion.c linux/drivers/char/istallion.c
--- v2.1.56/linux/drivers/char/istallion.c	Tue Sep 23 16:48:47 1997
+++ linux/drivers/char/istallion.c	Sat Sep 20 14:51:54 1997
@@ -813,7 +813,7 @@
 	portp->refcount++;
 
 	while (test_bit(ST_INITIALIZING, &portp->state)) {
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			return(-ERESTARTSYS);
 		interruptible_sleep_on(&portp->raw_wait);
 	}
@@ -1048,7 +1048,7 @@
  *	memory, so we must wait until it is complete.
  */
 	while (test_bit(ST_CLOSING, &portp->state)) {
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			restore_flags(flags);
 			return(-ERESTARTSYS);
 		}
@@ -1081,7 +1081,7 @@
 	rc = 0;
 	set_bit(ST_OPENING, &portp->state);
 	while (test_bit(ST_OPENING, &portp->state)) {
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			rc = -ERESTARTSYS;
 			break;
 		}
@@ -1123,7 +1123,7 @@
  */
 	if (wait) {
 		while (test_bit(ST_CLOSING, &portp->state)) {
-			if (current->signal & ~current->blocked) {
+			if (signal_pending(current)) {
 				restore_flags(flags);
 				return(-ERESTARTSYS);
 			}
@@ -1155,7 +1155,7 @@
  */
 	rc = 0;
 	while (test_bit(ST_CLOSING, &portp->state)) {
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			rc = -ERESTARTSYS;
 			break;
 		}
@@ -1188,7 +1188,7 @@
 	save_flags(flags);
 	cli();
 	while (test_bit(ST_CMDING, &portp->state)) {
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			restore_flags(flags);
 			return(-ERESTARTSYS);
 		}
@@ -1198,7 +1198,7 @@
 	stli_sendcmd(brdp, portp, cmd, arg, size, copyback);
 
 	while (test_bit(ST_CMDING, &portp->state)) {
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			restore_flags(flags);
 			return(-ERESTARTSYS);
 		}
@@ -1312,7 +1312,7 @@
 				(doclocal || (portp->sigs & TIOCM_CD))) {
 			break;
 		}
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			rc = -ERESTARTSYS;
 			break;
 		}
diff -u --recursive --new-file v2.1.56/linux/drivers/char/lp.c linux/drivers/char/lp.c
--- v2.1.56/linux/drivers/char/lp.c	Tue Sep 23 16:48:47 1997
+++ linux/drivers/char/lp.c	Sat Sep 20 14:51:54 1997
@@ -11,6 +11,9 @@
  * lp_read (Status readback) support added by Carsten Gross,
  *                                             carsten@sol.wohnheim.uni-ulm.de
  * Support for parport by Philip Blundell <Philip.Blundell@pobox.com>
+ * Reverted interrupt to polling at runtime if more than one device is parport
+ * registered and joined the interrupt and polling code.
+ *                               by Andrea Arcangeli <arcangeli@mbox.queen.it>
  */
 
 /* This driver is about due for a rewrite. */
@@ -251,7 +254,7 @@
 					sti();
 				}
 
-				if (current->signal & ~current->blocked) {
+				if (signal_pending(current)) {
 					if (total_bytes_written + bytes_written)
 						return total_bytes_written + bytes_written;
 					else
@@ -376,7 +379,7 @@
 #ifdef LP_READ_DEBUG
 			printk(KERN_DEBUG "lp_read: (Autofeed low) timeout\n");
 #endif
-			if (current->signal & ~current->blocked) {
+			if (signal_pending(current)) {
 				lp_select_in_high(minor);
 				parport_release(lp_table[minor].dev);
 				if (temp !=buf)
diff -u --recursive --new-file v2.1.56/linux/drivers/char/lp_m68k.c linux/drivers/char/lp_m68k.c
--- v2.1.56/linux/drivers/char/lp_m68k.c	Tue Sep 23 16:48:47 1997
+++ linux/drivers/char/lp_m68k.c	Sat Sep 20 14:51:54 1997
@@ -222,7 +222,7 @@
       lp_table[dev]->do_print = 0;
       rc = total_bytes_written + lp_table[dev]->bytes_written;
 
-      if (current->signal & ~current->blocked) {
+      if (signal_pending(current)) {
 	if (rc)
 	  return rc;
 	else
@@ -320,7 +320,7 @@
 			}
 
 			/* check for signals before going to sleep */
-			if (current->signal & ~current->blocked) {
+			if (signal_pending(current)) {
 				if (temp != buf)
 					return temp-buf;
 				else
diff -u --recursive --new-file v2.1.56/linux/drivers/char/n_tty.c linux/drivers/char/n_tty.c
--- v2.1.56/linux/drivers/char/n_tty.c	Thu Jul 17 10:06:04 1997
+++ linux/drivers/char/n_tty.c	Sat Sep 20 14:51:54 1997
@@ -924,7 +924,7 @@
 				retval = -EAGAIN;
 				break;
 			}
-			if (current->signal & ~current->blocked) {
+			if (signal_pending(current)) {
 				retval = -ERESTARTSYS;
 				break;
 			}
@@ -1022,7 +1022,7 @@
 	add_wait_queue(&tty->write_wait, &wait);
 	while (1) {
 		current->state = TASK_INTERRUPTIBLE;
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			retval = -ERESTARTSYS;
 			break;
 		}
diff -u --recursive --new-file v2.1.56/linux/drivers/char/pcxx.c linux/drivers/char/pcxx.c
--- v2.1.56/linux/drivers/char/pcxx.c	Tue May 13 22:41:07 1997
+++ linux/drivers/char/pcxx.c	Sat Sep 20 14:51:54 1997
@@ -368,7 +368,7 @@
 		    (info->asyncflags & ASYNC_CLOSING) == 0 &&
 			(do_clocal || (info->imodem & info->dcd)))
 			break;
-		if(current->signal & ~current->blocked) {
+		if(signal_pending(current)) {
 			retval = -ERESTARTSYS;
 			break;
 		}
diff -u --recursive --new-file v2.1.56/linux/drivers/char/psaux.c linux/drivers/char/psaux.c
--- v2.1.56/linux/drivers/char/psaux.c	Tue Sep 23 16:48:47 1997
+++ linux/drivers/char/psaux.c	Sat Sep 20 14:51:54 1997
@@ -540,7 +540,7 @@
 		add_wait_queue(&queue->proc_list, &wait);
 repeat:
 		current->state = TASK_INTERRUPTIBLE;
-		if (queue_empty() && !(current->signal & ~current->blocked)) {
+		if (queue_empty() && !signal_pending(current)) {
 			schedule();
 			goto repeat;
 		}
@@ -557,7 +557,7 @@
 		inode->i_atime = CURRENT_TIME;
 		return count-i;
 	}
-	if (current->signal & ~current->blocked)
+	if (signal_pending(current))
 		return -ERESTARTSYS;
 	return 0;
 }
diff -u --recursive --new-file v2.1.56/linux/drivers/char/random.c linux/drivers/char/random.c
--- v2.1.56/linux/drivers/char/random.c	Thu Jul 17 10:06:04 1997
+++ linux/drivers/char/random.c	Sat Sep 20 14:51:54 1997
@@ -1098,7 +1098,7 @@
 				retval = -EAGAIN;
 				break;
 			}
-			if (current->signal & ~current->blocked) {
+			if (signal_pending(current)) {
 				retval = -ERESTARTSYS;
 				break;
 			}
diff -u --recursive --new-file v2.1.56/linux/drivers/char/riscom8.c linux/drivers/char/riscom8.c
--- v2.1.56/linux/drivers/char/riscom8.c	Thu May 29 21:53:05 1997
+++ linux/drivers/char/riscom8.c	Sat Sep 20 14:51:54 1997
@@ -1040,7 +1040,7 @@
 		    !(port->flags & ASYNC_CLOSING) &&
 		    (do_clocal || CD))
 			break;
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			retval = -ERESTARTSYS;
 			break;
 		}
diff -u --recursive --new-file v2.1.56/linux/drivers/char/rocket.c linux/drivers/char/rocket.c
--- v2.1.56/linux/drivers/char/rocket.c	Sun Jul 27 12:11:00 1997
+++ linux/drivers/char/rocket.c	Sat Sep 20 14:51:54 1997
@@ -836,7 +836,7 @@
 		    (do_clocal || (sGetChanStatusLo(&info->channel) &
 				   CD_ACT)))
 			break;
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			retval = -ERESTARTSYS;
 			break;
 		}
@@ -1333,11 +1333,11 @@
 			if (retval)
 				return retval;
 			tty_wait_until_sent(tty, 0);
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return -EINTR;
 			if (!arg) {
 				send_break(info, HZ/4);	/* 1/4 second */
-				if (current->signal & ~current->blocked)
+				if (signal_pending(current))
 					return -EINTR;
 			}
 			return 0;
@@ -1346,10 +1346,10 @@
 			if (retval)
 				return retval;
 			tty_wait_until_sent(tty, 0);
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return -EINTR;
 			send_break(info, arg ? arg*(HZ/10) : HZ/4);
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return -EINTR;
 			return 0;
 		case TIOCGSOFTCAR:
@@ -1548,7 +1548,7 @@
 		current->counter = 0;	/* make us low-priority */
 		current->timeout = jiffies + check_time;
 		schedule();
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			break;
 	}
 	current->state = TASK_RUNNING;
diff -u --recursive --new-file v2.1.56/linux/drivers/char/rtc.c linux/drivers/char/rtc.c
--- v2.1.56/linux/drivers/char/rtc.c	Tue Sep 23 16:48:47 1997
+++ linux/drivers/char/rtc.c	Sat Sep 20 14:51:54 1997
@@ -164,7 +164,7 @@
 			retval = -EAGAIN;
 			break;
 		}
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			retval = -ERESTARTSYS;
 			break;
 		}
diff -u --recursive --new-file v2.1.56/linux/drivers/char/serial.c linux/drivers/char/serial.c
--- v2.1.56/linux/drivers/char/serial.c	Mon Aug 11 14:47:04 1997
+++ linux/drivers/char/serial.c	Sat Sep 20 14:51:54 1997
@@ -2207,11 +2207,11 @@
 			if (retval)
 				return retval;
 			tty_wait_until_sent(tty, 0);
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return -EINTR;
 			if (!arg) {
 				send_break(info, HZ/4);	/* 1/4 second */
-				if (current->signal & ~current->blocked)
+				if (signal_pending(current))
 					return -EINTR;
 			}
 			return 0;
@@ -2220,10 +2220,10 @@
 			if (retval)
 				return retval;
 			tty_wait_until_sent(tty, 0);
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return -EINTR;
 			send_break(info, arg ? arg*(HZ/10) : HZ/4);
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return -EINTR;
 			return 0;
 		case TIOCSBRK:
@@ -2310,7 +2310,7 @@
 			while (1) {
 				interruptible_sleep_on(&info->delta_msr_wait);
 				/* see if a signal did it */
-				if (current->signal & ~current->blocked)
+				if (signal_pending(current))
 					return -ERESTARTSYS;
 				cli();
 				cnow = info->state->icount; /* atomic copy */
@@ -2562,7 +2562,7 @@
 		current->counter = 0;	/* make us low-priority */
 		current->timeout = jiffies + char_time;
 		schedule();
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			break;
 		if (timeout && ((orig_jiffies + timeout) < jiffies))
 			break;
@@ -2709,7 +2709,7 @@
 		    (do_clocal || (serial_in(info, UART_MSR) &
 				   UART_MSR_DCD)))
 			break;
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			retval = -ERESTARTSYS;
 			break;
 		}
diff -u --recursive --new-file v2.1.56/linux/drivers/char/stallion.c linux/drivers/char/stallion.c
--- v2.1.56/linux/drivers/char/stallion.c	Tue Sep 23 16:48:47 1997
+++ linux/drivers/char/stallion.c	Sat Sep 20 14:51:54 1997
@@ -889,7 +889,7 @@
 				(doclocal || (portp->sigs & TIOCM_CD))) {
 			break;
 		}
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			rc = -ERESTARTSYS;
 			break;
 		}
diff -u --recursive --new-file v2.1.56/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
--- v2.1.56/linux/drivers/char/tty_io.c	Tue Sep 23 16:48:47 1997
+++ linux/drivers/char/tty_io.c	Sat Sep 20 14:51:54 1997
@@ -607,7 +607,7 @@
 		if (!count)
 			break;
 		ret = -ERESTARTSYS;
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			break;
 		if (need_resched)
 			schedule();
@@ -1217,7 +1217,7 @@
 		release_dev(filp);
 		if (retval != -ERESTARTSYS)
 			return retval;
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			return retval;
 		schedule();
 		/*
diff -u --recursive --new-file v2.1.56/linux/drivers/char/tty_ioctl.c linux/drivers/char/tty_ioctl.c
--- v2.1.56/linux/drivers/char/tty_ioctl.c	Thu Aug 14 20:49:16 1997
+++ linux/drivers/char/tty_ioctl.c	Sat Sep 20 14:51:54 1997
@@ -60,7 +60,7 @@
 		printk("waiting %s...(%d)\n", tty_name(tty), tty->driver.chars_in_buffer(tty));
 #endif
 		current->state = TASK_INTERRUPTIBLE;
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			goto stop_waiting;
 		if (!tty->driver.chars_in_buffer(tty))
 			break;
@@ -170,7 +170,7 @@
 
 	if (opt & TERMIOS_WAIT) {
 		tty_wait_until_sent(tty, 0);
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			return -EINTR;
 	}
 
@@ -516,7 +516,7 @@
 			if (retval)
 				return retval;
 			tty_wait_until_sent(tty, 0);
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return -EINTR;
 			if (!tty->driver.ioctl)
 				return 0;
diff -u --recursive --new-file v2.1.56/linux/drivers/char/vt.c linux/drivers/char/vt.c
--- v2.1.56/linux/drivers/char/vt.c	Wed Sep  3 20:52:42 1997
+++ linux/drivers/char/vt.c	Sat Sep 20 14:51:54 1997
@@ -1089,7 +1089,7 @@
 		if (vt == fg_console)
 			break;
 		retval = -EINTR;
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			break;
 		schedule();
 	}
diff -u --recursive --new-file v2.1.56/linux/drivers/isdn/avmb1/b1capi.c linux/drivers/isdn/avmb1/b1capi.c
--- v2.1.56/linux/drivers/isdn/avmb1/b1capi.c	Thu May 29 21:53:05 1997
+++ linux/drivers/isdn/avmb1/b1capi.c	Sat Sep 20 14:51:54 1997
@@ -760,7 +760,7 @@
 			current->state = TASK_INTERRUPTIBLE;
 			schedule();
 
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return -EINTR;
 		}
 		return 0;
diff -u --recursive --new-file v2.1.56/linux/drivers/isdn/avmb1/capi.c linux/drivers/isdn/avmb1/capi.c
--- v2.1.56/linux/drivers/isdn/avmb1/capi.c	Mon Aug 11 14:47:04 1997
+++ linux/drivers/isdn/avmb1/capi.c	Sat Sep 20 14:51:54 1997
@@ -138,7 +138,7 @@
 			interruptible_sleep_on(&cdev->recv_wait);
 			if ((skb = skb_dequeue(&cdev->recv_queue)) != 0)
 				break;
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				break;
 		}
 		if (skb == 0)
diff -u --recursive --new-file v2.1.56/linux/drivers/isdn/isdn_tty.c linux/drivers/isdn/isdn_tty.c
--- v2.1.56/linux/drivers/isdn/isdn_tty.c	Thu May 29 21:53:06 1997
+++ linux/drivers/isdn/isdn_tty.c	Sat Sep 20 14:51:54 1997
@@ -1576,7 +1576,7 @@
 		    (do_clocal || (info->msr & UART_MSR_DCD))) {
 			break;
 		}
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			retval = -ERESTARTSYS;
 			break;
 		}
diff -u --recursive --new-file v2.1.56/linux/drivers/macintosh/adb.c linux/drivers/macintosh/adb.c
--- v2.1.56/linux/drivers/macintosh/adb.c	Tue Sep 23 16:48:47 1997
+++ linux/drivers/macintosh/adb.c	Sat Sep 20 14:51:54 1997
@@ -36,7 +36,7 @@
 			ret = -EAGAIN;
 			break;
 		}
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			ret = -ERESTARTSYS;
 			break;
 		}
diff -u --recursive --new-file v2.1.56/linux/drivers/macintosh/macserial.c linux/drivers/macintosh/macserial.c
--- v2.1.56/linux/drivers/macintosh/macserial.c	Mon Aug 18 18:19:46 1997
+++ linux/drivers/macintosh/macserial.c	Sat Sep 20 14:51:54 1997
@@ -1562,7 +1562,7 @@
 		    !(info->flags & ZILOG_CLOSING) &&
 		    (do_clocal || (read_zsreg(info->zs_channel, 0) & DCD)))
 			break;
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			retval = -ERESTARTSYS;
 			break;
 		}
diff -u --recursive --new-file v2.1.56/linux/drivers/misc/TODO-parport linux/drivers/misc/TODO-parport
--- v2.1.56/linux/drivers/misc/TODO-parport	Sun Jul 27 12:11:00 1997
+++ linux/drivers/misc/TODO-parport	Sat Sep 20 11:43:22 1997
@@ -6,7 +6,7 @@
 
 2. Overhaul lp.c:
 
-   a) It's a mess, and there is a lot of code duplication.
+   a) It's a _mess_
 
    b) ECP support would be nice.  This can only work if both the port and
       the printer support it.
diff -u --recursive --new-file v2.1.56/linux/drivers/net/ppp.c linux/drivers/net/ppp.c
--- v2.1.56/linux/drivers/net/ppp.c	Sun Sep  7 13:10:42 1997
+++ linux/drivers/net/ppp.c	Sat Sep 20 14:51:54 1997
@@ -1711,7 +1711,7 @@
 			current->state	 = TASK_INTERRUPTIBLE;
 			schedule ();
 
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return -EINTR;
 			continue;
 		}
@@ -1753,7 +1753,7 @@
 					"ppp_tty_read: sleeping(read_wait)\n");
 
 			interruptible_sleep_on (&ppp->read_wait);
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return -EINTR;
 			continue;
 		}
@@ -2104,7 +2104,7 @@
 			return 0;
 		}
 
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			kfree (new_data);
 			return -EINTR;
 		}
diff -u --recursive --new-file v2.1.56/linux/drivers/sbus/audio/audio.c linux/drivers/sbus/audio/audio.c
--- v2.1.56/linux/drivers/sbus/audio/audio.c	Mon Apr 14 16:28:13 1997
+++ linux/drivers/sbus/audio/audio.c	Sat Sep 20 14:51:54 1997
@@ -183,7 +183,7 @@
 		/* Check to make sure that an output buffer is available. */
 		if (driver->output_count == driver->num_output_buffers) {
 			interruptible_sleep_on(&driver->output_write_wait);
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return bytes_written > 0 ? bytes_written : -EINTR;
 		}
 
@@ -226,7 +226,7 @@
 	case AUDIO_DRAIN:
 		if (driver->output_count > 0) {
 			interruptible_sleep_on(&driver->output_drain_wait);
-			retval = (current->signal & ~current->blocked) ? -EINTR : 0;
+			retval = signal_pending(current) ? -EINTR : 0;
 		}
 		break;
 
@@ -270,7 +270,7 @@
 			return -EBUSY;
 
 		interruptible_sleep_on(&driver->open_wait);
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			return -EINTR;
 		goto retry_open;
 	}
@@ -279,7 +279,7 @@
 			return -EBUSY;
 
 		interruptible_sleep_on(&driver->open_wait);
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			return -EINTR;
 		goto retry_open;
 	}
diff -u --recursive --new-file v2.1.56/linux/drivers/sbus/char/pcikbd.c linux/drivers/sbus/char/pcikbd.c
--- v2.1.56/linux/drivers/sbus/char/pcikbd.c	Sun Sep  7 13:10:42 1997
+++ linux/drivers/sbus/char/pcikbd.c	Sat Sep 20 14:51:54 1997
@@ -740,7 +740,7 @@
 		add_wait_queue(&queue->proc_list, &wait);
 repeat:
 		current->state = TASK_INTERRUPTIBLE;
-		if (queue_empty() && !(current->signal & ~current->blocked)) {
+		if (queue_empty() && !signal_pending(current)) {
 			schedule();
 			goto repeat;
 		}
@@ -757,7 +757,7 @@
 		inode->i_atime = CURRENT_TIME;
 		return count-i;
 	}
-	if (current->signal & ~current->blocked)
+	if (signal_pending(current))
 		return -ERESTARTSYS;
 	return 0;
 }
diff -u --recursive --new-file v2.1.56/linux/drivers/sbus/char/sab82532.c linux/drivers/sbus/char/sab82532.c
--- v2.1.56/linux/drivers/sbus/char/sab82532.c	Thu Sep  4 17:07:31 1997
+++ linux/drivers/sbus/char/sab82532.c	Sat Sep 20 14:51:54 1997
@@ -1247,11 +1247,11 @@
 			if (retval)
 				return retval;
 			tty_wait_until_sent(tty, 0);
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return -EINTR;
 			if (!arg) {
 				send_break(info, HZ/4);	/* 1/4 second */
-				if (current->signal & ~current->blocked)
+				if (signal_pending(current))
 					return -EINTR;
 			}
 			return 0;
@@ -1260,10 +1260,10 @@
 			if (retval)
 				return retval;
 			tty_wait_until_sent(tty, 0);
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return -EINTR;
 			send_break(info, arg ? arg*(HZ/10) : HZ/4);
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return -EINTR;
 			return 0;
 		case TIOCSBRK:
@@ -1325,7 +1325,7 @@
 			while (1) {
 				interruptible_sleep_on(&info->delta_msr_wait);
 				/* see if a signal did it */
-				if (current->signal & ~current->blocked)
+				if (signal_pending(current))
 					return -ERESTARTSYS;
 				cli();
 				cnow = info->icount; /* atomic copy */
@@ -1699,7 +1699,7 @@
 		    !(info->flags & ASYNC_CLOSING) &&
 		    (do_clocal || !(info->regs->r.vstr & SAB82532_VSTR_CD)))
 			break;
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			retval = -ERESTARTSYS;
 			break;
 		}
diff -u --recursive --new-file v2.1.56/linux/drivers/sbus/char/sunkbd.c linux/drivers/sbus/char/sunkbd.c
--- v2.1.56/linux/drivers/sbus/char/sunkbd.c	Thu Sep  4 17:07:31 1997
+++ linux/drivers/sbus/char/sunkbd.c	Sat Sep 20 14:51:54 1997
@@ -1256,7 +1256,7 @@
 		if (f->f_flags & O_NONBLOCK)
 			return -EWOULDBLOCK;
 		add_wait_queue (&kbd_wait, &wait);
-		while (kbd_head == kbd_tail && !(current->signal & ~current->blocked)){
+		while (kbd_head == kbd_tail && !signal_pending(current)) {
 			current->state = TASK_INTERRUPTIBLE;
 			schedule ();
 		}
diff -u --recursive --new-file v2.1.56/linux/drivers/sbus/char/sunmouse.c linux/drivers/sbus/char/sunmouse.c
--- v2.1.56/linux/drivers/sbus/char/sunmouse.c	Thu Sep  4 17:07:31 1997
+++ linux/drivers/sbus/char/sunmouse.c	Sat Sep 20 14:51:54 1997
@@ -367,7 +367,7 @@
 		if (file->f_flags & O_NONBLOCK)
 			return -EWOULDBLOCK;
 		add_wait_queue (&sunmouse.proc_list, &wait);
-		while (queue_empty () && !(current->signal & ~current->blocked)){
+		while (queue_empty () && !signal_pending(current)) {
 			current->state = TASK_INTERRUPTIBLE;
 			schedule ();
 		}
@@ -414,7 +414,7 @@
 		return count-c;
 	}
 	/* Only called if nothing was sent */
-	if (current->signal & ~current->blocked)
+	if (signal_pending(current))
 		return -ERESTARTSYS;
 	return 0;
 }
diff -u --recursive --new-file v2.1.56/linux/drivers/sbus/char/zs.c linux/drivers/sbus/char/zs.c
--- v2.1.56/linux/drivers/sbus/char/zs.c	Thu Sep  4 17:07:31 1997
+++ linux/drivers/sbus/char/zs.c	Sat Sep 20 14:51:54 1997
@@ -1775,7 +1775,7 @@
 		    !(info->flags & ZILOG_CLOSING) &&
 		    (do_clocal || (DCD & r0)))
 			break;
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			retval = -ERESTARTSYS;
 			break;
 		}
diff -u --recursive --new-file v2.1.56/linux/drivers/scsi/ChangeLog.ncr53c8xx linux/drivers/scsi/ChangeLog.ncr53c8xx
--- v2.1.56/linux/drivers/scsi/ChangeLog.ncr53c8xx	Wed Sep  3 20:52:43 1997
+++ linux/drivers/scsi/ChangeLog.ncr53c8xx	Sun Sep 21 11:45:42 1997
@@ -1,4 +1,24 @@
-Thu Aug 23 23:43 1997 Gerard Roudier (groudier@club-internet.fr)
+Sat Sep 20 21:00 1997 Gerard Roudier (groudier@club-internet.fr)
+	* revision 2.5c
+	- Several PCI configuration registers fix-ups for powerpc.
+	  (Patch sent by Cort).
+
+Thu Aug 28 10:00 1997 Gerard Roudier (groudier@club-internet.fr)
+	* revision 2.5b
+	- Add 'ncr53c8xx' char pointer variable. This variable allows to 
+	  pass a boot command to the driver when it is loaded as a module.
+	  Option separator is ' ' instead of ','. Example:
+	    insmod <mod_path>/ncr53c8xx.o ncr53c8xx='verb:2 sync:0 specf:n'
+	- Always use 'driver_setup.settle_delay' for internal resets.
+	  2 seconds hardcoded is sometimes too short. Suggested by Richard W. 
+	  This delay may be shortenned in order to avoid spurious timeouts.
+	- Fix release module stuff that failed for more than 1 controller.
+	- For linux versions > 1.3.70, trust the 'dev_id' parameter passed 
+	  to the interrupt handler (dev_id = struct ncb *).
+	- Fix up in 'ncr_log_hard_error()' when the DSP points outside scripts.
+	  Suggested by Stefan Esser.
+
+Tue Aug 23 23:43 1997 Gerard Roudier (groudier@club-internet.fr)
 	* revision 2.5a
 	- Update Configure.help for inclusion in linux-2.1.51/2/3
 	- Use BASE_2 address from PCI config space instead of some 
diff -u --recursive --new-file v2.1.56/linux/drivers/scsi/ncr53c8xx.c linux/drivers/scsi/ncr53c8xx.c
--- v2.1.56/linux/drivers/scsi/ncr53c8xx.c	Wed Sep  3 20:52:43 1997
+++ linux/drivers/scsi/ncr53c8xx.c	Sun Sep 21 11:45:42 1997
@@ -67,7 +67,7 @@
 */
 
 /*
-**	23 August 1997, version 2.5a
+**	20 September 1997, version 2.5c
 **
 **	Supported SCSI-II features:
 **	    Synchronous negotiation
@@ -457,9 +457,9 @@
 /*
 **	Head of list of NCR boards
 **
-**	Host is retrieved by its irq level.
-**	If interrupts are shared, the internal host control block 
-**	address (struct ncb) is used as device id.
+**	For kernel version < 1.3.70, host is retrieved by its irq level.
+**	For later kernels, the internal host control block address 
+**	(struct ncb) is used as device id parameter of the irq stuff.
 */
 
 static struct Scsi_Host		*first_host	= NULL;
@@ -528,6 +528,9 @@
 #ifdef	SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT
 static struct ncr_driver_setup
 	driver_safe_setup __initdata	= SCSI_NCR_DRIVER_SAFE_SETUP;
+#ifdef	MODULE
+char *ncr53c8xx = 0;	/* command line passed by insmod */
+#endif
 #endif
 
 /*
@@ -4579,7 +4582,7 @@
 			SA_INTERRUPT|SA_SHIRQ, "ncr53c8xx", np)) {
 #else
 	if (request_irq(device->slot.irq, ncr53c8xx_intr,
-			SA_INTERRUPT, "ncr53c8xx", NULL)) {
+			SA_INTERRUPT, "ncr53c8xx", np)) {
 #endif
 #else
 	if (request_irq(device->slot.irq, ncr53c8xx_intr,
@@ -4736,7 +4739,9 @@
 
 	/*---------------------------------------------------
 	**
-	**	Assign a ccb / bind cmd
+	**	Assign a ccb / bind cmd.
+	**	If resetting, shorten settle_time if necessary
+	**	in order to avoid spurious timeouts.
 	**	If resetting or no free ccb,
 	**	insert cmd into the waiting list.
 	**
@@ -4744,6 +4749,11 @@
 	*/
 	save_flags(flags); cli();
 
+	if (np->settle_time && cmd->timeout_per_command >= HZ &&
+		np->settle_time > jiffies + cmd->timeout_per_command - HZ) {
+		np->settle_time = jiffies + cmd->timeout_per_command - HZ;
+	}
+
         if (np->settle_time || !(cp=ncr_get_ccb (np, cmd->target, cmd->lun))) {
 		insert_into_waiting_list(np, cmd);
 		restore_flags(flags);
@@ -5234,7 +5244,7 @@
  * Commands will now be queued in the waiting list until a settle 
  * delay of 2 seconds will be completed.
  */
-	ncr_start_reset(np, 2);
+	ncr_start_reset(np, driver_setup.settle_delay);
 /*
  * First, look in the wakeup list
  */
@@ -5382,7 +5392,7 @@
 */
 
 #ifdef MODULE
-static int ncr_detach(ncb_p np, int irq)
+static int ncr_detach(ncb_p np)
 {
 	ccb_p cp;
 	tcb_p tp;
@@ -5421,16 +5431,12 @@
 */
 
 #ifdef DEBUG_NCR53C8XX
-	printf("%s: freeing irq %d\n", ncr_name(np), irq);
+	printf("%s: freeing irq %d\n", ncr_name(np), np->irq);
 #endif
 #if LINUX_VERSION_CODE >= LinuxVersionCode(1,3,70)
-#   ifdef SCSI_NCR_SHARE_IRQ
-	free_irq(irq, np);
-#   else
-	free_irq(irq, NULL);
-#   endif
+	free_irq(np->irq, np);
 #else
-	free_irq(irq);
+	free_irq(np->irq);
 #endif
 
 	/*
@@ -6786,14 +6792,20 @@
 		script_base	= (u_char *) np->script;
 		script_name	= "script";
 	}
-	else {
+	else if (np->p_scripth < dsp && 
+		 dsp <= np->p_scripth + sizeof(struct scripth)) {
 		script_ofs	= dsp - np->p_scripth;
 		script_size	= sizeof(struct scripth);
 		script_base	= (u_char *) np->scripth;
 		script_name	= "scripth";
+	} else {
+		script_ofs	= dsp;
+		script_size	= 0;
+		script_base	= 0;
+		script_name	= "mem";
 	}
 
-	printf ("%s:%d: ERROR (%x:%x) (%x-%x-%x) (%x/%x) @ %s (%x:%08x).\n",
+	printf ("%s:%d: ERROR (%x:%x) (%x-%x-%x) (%x/%x) @ (%s %x:%08x).\n",
 		ncr_name (np), (unsigned)INB (nc_ctest0)&0x0f, dstat, sist,
 		(unsigned)INB (nc_socl), (unsigned)INB (nc_sbcl), (unsigned)INB (nc_sbdl),
 		(unsigned)INB (nc_sxfer),(unsigned)INB (nc_scntl3), script_name, script_ofs,
@@ -6978,13 +6990,13 @@
 
 	if ((sist & (SGE)) ||
 		(dstat & (MDPE|BF|ABORT|IID))) {
-		ncr_start_reset(np, 2);
+		ncr_start_reset(np, driver_setup.settle_delay);
 		return;
 	};
 
 	if (sist & HTH) {
 		printf ("%s: handshake timeout\n", ncr_name(np));
-		ncr_start_reset(np, 2);
+		ncr_start_reset(np, driver_setup.settle_delay);
 		return;
 	};
 
@@ -6994,7 +7006,7 @@
 			OUTB (nc_scr1, HS_UNEXPECTED);
 			OUTL (nc_dsp, NCB_SCRIPT_PHYS (np, cleanup));
 		};
-		ncr_start_reset(np, 2);
+		ncr_start_reset(np, driver_setup.settle_delay);
 		return;
 	};
 
@@ -7085,7 +7097,7 @@
 		ncr_name(np), np->scsi_mode, scsi_mode);
 
 	np->scsi_mode = scsi_mode;
-	ncr_start_reset(np, 2);
+	ncr_start_reset(np, driver_setup.settle_delay);
 
 	return 1;
 }
@@ -8913,7 +8925,11 @@
 		else
 			printf("ncr53c8xx_setup: unexpected boot option '%.*s' ignored\n", (int)(pc-cur+1), cur);
 
+#ifdef MODULE
+		if ((cur = strchr(cur, ' ')) != NULL)
+#else
 		if ((cur = strchr(cur, ',')) != NULL)
+#endif
 			++cur;
 	}
 #endif /* SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT */
@@ -9089,6 +9105,11 @@
 # endif
 #endif
 
+#if	defined(SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT) && defined(MODULE)
+if (ncr53c8xx)
+	ncr53c8xx_setup(ncr53c8xx, (int *) 0);
+#endif
+
 	/* 
 	** Detect all 53c8xx hosts and then attach them.
 	**
@@ -9248,6 +9269,28 @@
 		return -1;
 	}
 
+#ifdef __powerpc__
+	/*
+	 *	Severall fix-up for power/pc.
+	 *	Should not be performed by the driver.
+	 */
+	if ((command &
+		(PCI_COMMAND_MASTER|PCI_COMMAND_IO|PCI_COMMAND_MEMORY)) !=
+		(PCI_COMMAND_MASTER|PCI_COMMAND_IO|PCI_COMMAND_MEMORY)) {
+		printk("ncr53c8xx : setting PCI master/io/command bit\n");
+		command |= PCI_COMMAND_MASTER|PCI_COMMAND_IO|PCI_COMMAND_MEMORY;
+		pcibios_write_config_word(bus, device_fn, PCI_COMMAND, command);
+	}
+       if (io_port >= 0x10000000) {
+		io_port = (io_port & 0x00FFFFFF) | 0x01000000;
+		pcibios_write_config_dword(bus, device_fn, PCI_BASE_ADDRESS_0, io_port);
+       }
+	if (base >= 0x10000000) {
+		base = (base & 0x00FFFFFF) | 0x01000000;
+		pcibios_write_config_dword(bus, device_fn, PCI_BASE_ADDRESS_1, base);
+	}
+#endif
+
 	/*
 	 * Check availability of IO space, memory space and master capability.
 	 */
@@ -9510,47 +9553,41 @@
 }
 
 /*
-**   Linux entry point of the interrupt handler
+**   Linux entry point of the interrupt handler.
+**   Fort linux versions > 1.3.70, we trust the kernel for 
+**   passing the internal host descriptor as 'dev_id'.
+**   Otherwise, we scan the host list and call the interrupt 
+**   routine for each host that uses this IRQ.
 */
 
 #if LINUX_VERSION_CODE >= LinuxVersionCode(1,3,70)
 static void ncr53c8xx_intr(int irq, void *dev_id, struct pt_regs * regs)
+{
+#ifdef DEBUG_NCR53C8XX
+     printk("ncr53c8xx : interrupt received\n");
+#endif
+
+     if (DEBUG_FLAGS & DEBUG_TINY) printf ("[");
+     ncr_exception((ncb_p) dev_id);
+     if (DEBUG_FLAGS & DEBUG_TINY) printf ("]\n");
+}
+
 #else
 static void ncr53c8xx_intr(int irq, struct pt_regs * regs)
-#endif
 {
      struct Scsi_Host *host;
      struct host_data *host_data;
-#if 0
-     u_long flags;
-
-     save_flags(flags); cli();
-#endif
-
-#ifdef DEBUG_NCR53C8XX
-printk("ncr53c8xx : interrupt received\n");
-#endif
 
      for (host = first_host; host; host = host->next) {
 	  if (host->hostt == the_template && host->irq == irq) {
 	       host_data = (struct host_data *) host->hostdata;
-#if LINUX_VERSION_CODE >= LinuxVersionCode(1,3,70)
-#   ifdef SCSI_NCR_SHARE_IRQ
-               if (dev_id == host_data->ncb) {
-#else
-               if (1) {
-#   endif
-#endif
-                    if (DEBUG_FLAGS & DEBUG_TINY) printf ("[");
-	            ncr_exception(host_data->ncb);
-                    if (DEBUG_FLAGS & DEBUG_TINY) printf ("]\n");
-               }
+               if (DEBUG_FLAGS & DEBUG_TINY) printf ("[");
+               ncr_exception(host_data->ncb);
+               if (DEBUG_FLAGS & DEBUG_TINY) printf ("]\n");
 	  }
      }
-#if 0
-     restore_flags(flags);
-#endif
 }
+#endif
 
 /*
 **   Linux entry point of the timer handler
@@ -9656,17 +9693,10 @@
 #ifdef MODULE
 int ncr53c8xx_release(struct Scsi_Host *host)
 {
-     struct host_data *host_data;
 #ifdef DEBUG_NCR53C8XX
 printk("ncr53c8xx : release\n");
 #endif
-
-     for (host = first_host; host; host = host->next) {
-	  if (host->hostt == the_template) {
-	       host_data = (struct host_data *) host->hostdata;
-	       ncr_detach(host_data->ncb, host->irq);
-	  }
-     }
+     ncr_detach(((struct host_data *) host->hostdata)->ncb);
 
      return 1;
 }
diff -u --recursive --new-file v2.1.56/linux/drivers/scsi/ncr53c8xx.h linux/drivers/scsi/ncr53c8xx.h
--- v2.1.56/linux/drivers/scsi/ncr53c8xx.h	Wed Sep  3 20:52:43 1997
+++ linux/drivers/scsi/ncr53c8xx.h	Wed Sep 24 09:25:00 1997
@@ -45,7 +45,7 @@
 /*
 **	Name and revision of the driver
 */
-#define SCSI_NCR_DRIVER_NAME		"ncr53c8xx - revision 2.5a"
+#define SCSI_NCR_DRIVER_NAME		"ncr53c8xx - revision 2.5c"
 
 /*
 **	Check supported Linux versions
diff -u --recursive --new-file v2.1.56/linux/drivers/scsi/scsi_module.c linux/drivers/scsi/scsi_module.c
--- v2.1.56/linux/drivers/scsi/scsi_module.c	Sun Jan 26 02:07:19 1997
+++ linux/drivers/scsi/scsi_module.c	Sat Sep 20 11:42:33 1997
@@ -34,7 +34,11 @@
 int init_module(void) {
     driver_template.module = &__this_module;
     scsi_register_module(MODULE_SCSI_HA, &driver_template);
-    return (driver_template.present == 0);
+    if (driver_template.present)
+	return 0;
+
+    scsi_unregister_module(MODULE_SCSI_HA, &driver_template);
+    return -1;
 }
 
 void cleanup_module( void) {
diff -u --recursive --new-file v2.1.56/linux/drivers/scsi/sg.c linux/drivers/scsi/sg.c
--- v2.1.56/linux/drivers/scsi/sg.c	Thu Jul 17 10:06:05 1997
+++ linux/drivers/scsi/sg.c	Sat Sep 20 14:51:54 1997
@@ -106,7 +106,7 @@
 	    if (flags & O_NONBLOCK)
 		return -EBUSY;
 	    interruptible_sleep_on(&scsi_generics[dev].generic_wait);
-	    if (current->signal & ~current->blocked)
+	    if (signal_pending(current))
 		return -ERESTARTSYS;
 	}
 	scsi_generics[dev].exclude=1;
@@ -121,7 +121,7 @@
 	    if (flags & O_NONBLOCK)
 		return -EBUSY;
 	    interruptible_sleep_on(&scsi_generics[dev].generic_wait);
-	    if (current->signal & ~current->blocked)
+	    if (signal_pending(current))
 		return -ERESTARTSYS;
 	}
 
@@ -172,7 +172,7 @@
 	while(big_inuse)
 	{
 	    interruptible_sleep_on(&big_wait);
-	    if (current->signal & ~current->blocked)
+	    if (signal_pending(current))
 		return NULL;
 	}
 	big_inuse=1;
@@ -222,7 +222,7 @@
 	    return -EAGAIN;
 	}
 	interruptible_sleep_on(&device->read_wait);
-	if (current->signal & ~current->blocked)
+	if (signal_pending(current))
 	{
 	    restore_flags(flags);
 	    return -ERESTARTSYS;
@@ -355,7 +355,7 @@
 	printk("sg_write: sleeping on pending request\n");
 #endif
 	interruptible_sleep_on(&device->write_wait);
-	if (current->signal & ~current->blocked)
+	if (signal_pending(current))
 	    return -ERESTARTSYS;
     }
 
diff -u --recursive --new-file v2.1.56/linux/drivers/sound/dmabuf.c linux/drivers/sound/dmabuf.c
--- v2.1.56/linux/drivers/sound/dmabuf.c	Mon Jun 16 16:35:56 1997
+++ linux/drivers/sound/dmabuf.c	Sat Sep 20 14:51:54 1997
@@ -277,7 +277,7 @@
   audio_devs[dev]->dmap_out->flags |= DMA_SYNCING;
 
   audio_devs[dev]->dmap_out->underrun_count = 0;
-  if (!(current->signal & ~current->blocked)
+  if (!signal_pending(current)
       && audio_devs[dev]->dmap_out->qlen
       && audio_devs[dev]->dmap_out->underrun_count == 0)
     {
@@ -416,7 +416,7 @@
       audio_devs[dev]->dmap_out->flags |= DMA_SYNCING;
 
       audio_devs[dev]->dmap_out->underrun_count = 0;
-      while (!(current->signal & ~current->blocked)
+      while (!signal_pending(current)
 	     && n++ <= audio_devs[dev]->dmap_out->nbufs
 	     && audio_devs[dev]->dmap_out->qlen
 	     && audio_devs[dev]->dmap_out->underrun_count == 0)
@@ -456,7 +456,7 @@
       cli ();
       if (audio_devs[dev]->d->local_qlen)	/* Device has hidden buffers */
 	{
-	  while (!((current->signal & ~current->blocked))
+	  while (!signal_pending(current)
 		 && audio_devs[dev]->d->local_qlen (dev))
 	    {
 
@@ -496,7 +496,7 @@
 
   if (audio_devs[dev]->open_mode & OPEN_WRITE)
     if (!(audio_devs[dev]->dmap_in->mapping_flags & DMA_MAP_MAPPED))
-      if (!((current->signal & ~current->blocked))
+      if (!signal_pending(current)
 	  && (audio_devs[dev]->dmap_out->dma_mode == DMODE_OUTPUT))
 	{
 	  DMAbuf_sync (dev);
@@ -856,7 +856,7 @@
 	tmout = 20 * HZ;
     }
 
-  if ((current->signal & ~current->blocked))
+  if (signal_pending(current))
     return -EIO;
 
 
@@ -882,7 +882,7 @@
       ;
       dma_reset_output (dev);
     }
-  else if ((current->signal & ~current->blocked))
+  else if (signal_pending(current))
     {
       err = -EINTR;
     }
diff -u --recursive --new-file v2.1.56/linux/drivers/sound/dmasound.c linux/drivers/sound/dmasound.c
--- v2.1.56/linux/drivers/sound/dmasound.c	Tue Sep 23 16:48:48 1997
+++ linux/drivers/sound/dmasound.c	Sat Sep 20 14:51:54 1997
@@ -628,7 +628,7 @@
 static struct sound_queue sq;
 
 #define sq_block_address(i)	(sq.buffers[i])
-#define SIGNAL_RECEIVED	(current->signal & ~current->blocked)
+#define SIGNAL_RECEIVED	(signal_pending(current))
 #define NON_BLOCKING(open_mode)	(open_mode & O_NONBLOCK)
 #define ONE_SECOND	HZ	/* in jiffies (100ths of a second) */
 #define NO_TIME_LIMIT	0xffffffff
diff -u --recursive --new-file v2.1.56/linux/drivers/sound/maui.c linux/drivers/sound/maui.c
--- v2.1.56/linux/drivers/sound/maui.c	Wed May 28 10:51:32 1997
+++ linux/drivers/sound/maui.c	Sat Sep 20 14:51:54 1997
@@ -95,8 +95,8 @@
 	      maui_sleep_flag.opts |= WK_TIMEOUT;
 	  }
 	maui_sleep_flag.opts &= ~WK_SLEEP;
-      };
-      if ((current->signal & ~current->blocked))
+      }
+      if (signal_pending(current))
 	{
 	  return 0;
 	}
diff -u --recursive --new-file v2.1.56/linux/drivers/sound/midi_synth.c linux/drivers/sound/midi_synth.c
--- v2.1.56/linux/drivers/sound/midi_synth.c	Wed May 28 10:51:32 1997
+++ linux/drivers/sound/midi_synth.c	Sat Sep 20 14:51:54 1997
@@ -533,7 +533,7 @@
 
   sysex_sleep_flag.opts = WK_NONE;
 
-  for (i = 0; i < left && !(current->signal & ~current->blocked); i++)
+  for (i = 0; i < left && !signal_pending(current); i++)
     {
       unsigned char   data;
 
@@ -554,7 +554,7 @@
 	}
 
       while (!midi_devs[orig_dev]->outputc (orig_dev, (unsigned char) (data & 0xff)) &&
-	     !(current->signal & ~current->blocked))
+	     !signal_pending(current))
 
 	{
 	  unsigned long   tlimit;
diff -u --recursive --new-file v2.1.56/linux/drivers/sound/midibuf.c linux/drivers/sound/midibuf.c
--- v2.1.56/linux/drivers/sound/midibuf.c	Wed May 28 10:51:32 1997
+++ linux/drivers/sound/midibuf.c	Sat Sep 20 14:51:54 1997
@@ -93,7 +93,7 @@
    */
 
   if (midi_devs[dev]->buffer_status != NULL)
-    while (!(current->signal & ~current->blocked) &&
+    while (!signal_pending(current) &&
 	   midi_devs[dev]->buffer_status (dev))
 
       {
@@ -289,7 +289,7 @@
 						   * devices
 						 */
 
-      while (!(current->signal & ~current->blocked) &&
+      while (!signal_pending(current) &&
 	     DATA_AVAIL (midi_out_buf[dev]))
 
 	{
@@ -370,8 +370,8 @@
 		  midi_sleep_flag[dev].opts |= WK_TIMEOUT;
 	      }
 	    midi_sleep_flag[dev].opts &= ~WK_SLEEP;
-	  };
-	  if ((current->signal & ~current->blocked))
+	  }
+	  if (signal_pending(current))
 	    {
 	      restore_flags (flags);
 	      return -EINTR;
@@ -430,7 +430,7 @@
 	  }
 	input_sleep_flag[dev].opts &= ~WK_SLEEP;
       };
-      if ((current->signal & ~current->blocked))
+      if (signal_pending(current))
 	c = -EINTR;		/*
 				   * The user is getting restless
 				 */
diff -u --recursive --new-file v2.1.56/linux/drivers/sound/sequencer.c linux/drivers/sound/sequencer.c
--- v2.1.56/linux/drivers/sound/sequencer.c	Wed May 28 10:51:33 1997
+++ linux/drivers/sound/sequencer.c	Sat Sep 20 14:51:54 1997
@@ -1227,7 +1227,7 @@
 
   n = 1;
 
-  while (!(current->signal & ~current->blocked) && n)
+  while (!signal_pending(current) && n)
     {
       n = 0;
 
@@ -1279,7 +1279,7 @@
 
   if (mode != OPEN_READ && !(file->flags & (O_NONBLOCK) ?
 			     1 : 0))
-    while (!(current->signal & ~current->blocked) && qlen > 0)
+    while (!signal_pending(current) && qlen > 0)
       {
 	seq_sync ();
 
@@ -1344,7 +1344,7 @@
 {
   unsigned long   flags;
 
-  if (qlen && !seq_playing && !(current->signal & ~current->blocked))
+  if (qlen && !seq_playing && !signal_pending(current))
     seq_startplay ();
 
   save_flags (flags);
@@ -1572,7 +1572,7 @@
 
       if (mode == OPEN_READ)
 	return 0;
-      while (qlen > 0 && !(current->signal & ~current->blocked))
+      while (qlen > 0 && !signal_pending(current))
 	seq_sync ();
       if (qlen)
 	return -EINTR;
diff -u --recursive --new-file v2.1.56/linux/fs/autofs/root.c linux/fs/autofs/root.c
--- v2.1.56/linux/fs/autofs/root.c	Thu Sep 11 09:02:23 1997
+++ linux/fs/autofs/root.c	Sat Sep 20 14:51:54 1997
@@ -223,7 +223,7 @@
 	 * a signal. If so we can force a restart..
 	 */
 	if (dentry->d_flags & DCACHE_AUTOFS_PENDING) {
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			return -ERESTARTNOINTR;
 	}
 
diff -u --recursive --new-file v2.1.56/linux/fs/fcntl.c linux/fs/fcntl.c
--- v2.1.56/linux/fs/fcntl.c	Tue Sep 23 16:48:48 1997
+++ linux/fs/fcntl.c	Sat Sep 20 14:51:55 1997
@@ -179,7 +179,7 @@
 		    (uid ^ p->suid) && (uid ^ p->uid))
 			continue;
 		p->signal |= 1 << (SIGIO-1);
-		if (p->state == TASK_INTERRUPTIBLE && (p->signal & ~p->blocked))
+		if (p->state == TASK_INTERRUPTIBLE && signal_pending(p))
 			wake_up_process(p);
 	}
 	read_unlock(&tasklist_lock);
diff -u --recursive --new-file v2.1.56/linux/fs/fifo.c linux/fs/fifo.c
--- v2.1.56/linux/fs/fifo.c	Thu Jul 17 10:06:07 1997
+++ linux/fs/fifo.c	Sat Sep 20 14:51:55 1997
@@ -29,7 +29,7 @@
 		if (!(filp->f_flags & O_NONBLOCK) && !PIPE_WRITERS(*inode)) {
 			PIPE_RD_OPENERS(*inode)++;
 			while (!PIPE_WRITERS(*inode)) {
-				if (current->signal & ~current->blocked) {
+				if (signal_pending(current)) {
 					retval = -ERESTARTSYS;
 					break;
 				}
@@ -62,7 +62,7 @@
 		if (!PIPE_READERS(*inode)) {
 			PIPE_WR_OPENERS(*inode)++;
 			while (!PIPE_READERS(*inode)) {
-				if (current->signal & ~current->blocked) {
+				if (signal_pending(current)) {
 					retval = -ERESTARTSYS;
 					break;
 				}
diff -u --recursive --new-file v2.1.56/linux/fs/locks.c linux/fs/locks.c
--- v2.1.56/linux/fs/locks.c	Tue Sep 23 16:48:49 1997
+++ linux/fs/locks.c	Sat Sep 20 14:51:55 1997
@@ -560,7 +560,7 @@
 		if (posix_locks_conflict(fl, &tfl)) {
 			if (filp && (filp->f_flags & O_NONBLOCK))
 				return (-EAGAIN);
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return (-ERESTARTSYS);
 			if (posix_locks_deadlock(&tfl, fl))
 				return (-EDEADLK);
@@ -569,7 +569,7 @@
 			interruptible_sleep_on(&tfl.fl_wait);
 			locks_delete_block(fl, &tfl);
 
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return (-ERESTARTSYS);
 			/* If we've been sleeping someone might have
 			 * changed the permissions behind our back.
@@ -822,7 +822,7 @@
 repeat:
 	/* Check signals each time we start */
 	error = -ERESTARTSYS;
-	if (current->signal & ~current->blocked)
+	if (signal_pending(current))
 		goto out;
 	for (fl = inode->i_flock; (fl != NULL) && (fl->fl_flags & FL_FLOCK);
 	     fl = fl->fl_next) {
@@ -882,7 +882,7 @@
 	if (caller->fl_type != F_UNLCK) {
   repeat:
 		error = -ERESTARTSYS;
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			goto out;
 		for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
 			if (!(fl->fl_flags & FL_POSIX))
diff -u --recursive --new-file v2.1.56/linux/fs/ncpfs/sock.c linux/fs/ncpfs/sock.c
--- v2.1.56/linux/fs/ncpfs/sock.c	Thu Sep 11 09:02:23 1997
+++ linux/fs/ncpfs/sock.c	Sat Sep 20 14:51:55 1997
@@ -167,7 +167,7 @@
 			schedule();
 			remove_wait_queue(entry.wait_address, &entry.wait);
 			current->state = TASK_RUNNING;
-			if (current->signal & ~current->blocked) {
+			if (signal_pending(current)) {
 				current->timeout = 0;
 				result = -ERESTARTSYS;
 				break;
diff -u --recursive --new-file v2.1.56/linux/fs/nfs/dir.c linux/fs/nfs/dir.c
--- v2.1.56/linux/fs/nfs/dir.c	Thu Sep 11 09:02:23 1997
+++ linux/fs/nfs/dir.c	Sat Sep 20 14:51:55 1997
@@ -148,7 +148,7 @@
 again:
 	if (waitp) {
 		interruptible_sleep_on(waitp);
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			return -ERESTARTSYS;
 		waitp = NULL;
 	}
diff -u --recursive --new-file v2.1.56/linux/fs/nfs/file.c linux/fs/nfs/file.c
--- v2.1.56/linux/fs/nfs/file.c	Tue Sep 23 16:48:49 1997
+++ linux/fs/nfs/file.c	Sat Sep 20 14:51:55 1997
@@ -209,7 +209,7 @@
 	/* If unlocking a file region, flush dirty pages (unless we've
 	 * been killed by a signal, that is). */
 	if (cmd == F_SETLK && fl->fl_type == F_UNLCK
-	 && !(current->signal & ~current->blocked)) {
+	    && !signal_pending(current)) {
 		status = nfs_flush_dirty_pages(inode,
 			fl->fl_start, fl->fl_end == NLM_OFFSET_MAX? 0 :
 			fl->fl_end - fl->fl_start + 1);
diff -u --recursive --new-file v2.1.56/linux/fs/nfsd/export.c linux/fs/nfsd/export.c
--- v2.1.56/linux/fs/nfsd/export.c	Mon Aug 18 18:19:46 1997
+++ linux/fs/nfsd/export.c	Sat Sep 20 14:51:55 1997
@@ -404,7 +404,7 @@
 	while (hash_count || hash_lock)
 		interruptible_sleep_on(&hash_wait);
 	want_lock--;
-	if (current->signal & ~current->blocked)
+	if (signal_pending(current))
 		return -EINTR;
 	hash_lock = 1;
 	return 0;
diff -u --recursive --new-file v2.1.56/linux/fs/pipe.c linux/fs/pipe.c
--- v2.1.56/linux/fs/pipe.c	Tue Sep 23 16:48:49 1997
+++ linux/fs/pipe.c	Sat Sep 20 14:51:55 1997
@@ -52,7 +52,7 @@
 			if (!PIPE_WRITERS(*inode))
 				return 0;
 		}
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			return -ERESTARTSYS;
 		interruptible_sleep_on(&PIPE_WAIT(*inode));
 	}
@@ -104,7 +104,7 @@
 				send_sig(SIGPIPE,current,0);
 				return written? :-EPIPE;
 			}
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return written? :-ERESTARTSYS;
 			if (filp->f_flags & O_NONBLOCK)
 				return written? :-EAGAIN;
diff -u --recursive --new-file v2.1.56/linux/fs/proc/array.c linux/fs/proc/array.c
--- v2.1.56/linux/fs/proc/array.c	Wed Sep  3 20:52:43 1997
+++ linux/fs/proc/array.c	Sun Sep 21 10:50:01 1997
@@ -900,18 +900,18 @@
  * For the /proc/<pid>/maps file, we use fixed length records, each containing
  * a single line.
  */
-#define MAPS_LINE_LENGTH	1024
-#define MAPS_LINE_SHIFT		10
+#define MAPS_LINE_LENGTH	4096
+#define MAPS_LINE_SHIFT		12
 /*
  * f_pos = (number of the vma in the task->mm->mmap list) * MAPS_LINE_LENGTH
  *         + (index into the line)
  */
 /* for systems with sizeof(void*) == 4: */
-#define MAPS_LINE_FORMAT4	  "%08lx-%08lx %s %08lx %s %lu\n"
+#define MAPS_LINE_FORMAT4	  "%08lx-%08lx %s %08lx %s %lu"
 #define MAPS_LINE_MAX4	49 /* sum of 8  1  8  1 4 1 8 1 5 1 10 1 */
 
 /* for systems with sizeof(void*) == 8: */
-#define MAPS_LINE_FORMAT8	  "%016lx-%016lx %s %016lx %s %lu\n"
+#define MAPS_LINE_FORMAT8	  "%016lx-%016lx %s %016lx %s %lu"
 #define MAPS_LINE_MAX8	73 /* sum of 16  1  16  1 4 1 16 1 5 1 10 1 */
 
 #define MAPS_LINE_MAX	MAPS_LINE_MAX8
@@ -926,6 +926,7 @@
 	int column;
 	struct vm_area_struct * map;
 	int i;
+	char * buffer;
 
 	if (!p)
 		return -EINVAL;
@@ -933,6 +934,8 @@
 	if (!p->mm || p->mm == &init_mm || count == 0)
 		return 0;
 
+	buffer = (char*)__get_free_page(GFP_KERNEL);
+
 	/* decode f_pos */
 	lineno = file->f_pos >> MAPS_LINE_SHIFT;
 	column = file->f_pos & (MAPS_LINE_LENGTH-1);
@@ -945,11 +948,13 @@
 
 	for ( ; map ; ) {
 		/* produce the next line */
-		char line[MAPS_LINE_MAX+1];
+		char *line;
 		char str[5], *cp = str;
 		int flags;
 		kdev_t dev;
 		unsigned long ino;
+		int maxlen = (sizeof(void*) == 4) ? 
+			MAPS_LINE_MAX4 :  MAPS_LINE_MAX8;
 		int len;
 
 		flags = map->vm_flags;
@@ -965,13 +970,26 @@
 		if (map->vm_dentry != NULL) {
 			dev = map->vm_dentry->d_inode->i_dev;
 			ino = map->vm_dentry->d_inode->i_ino;
-		}
+			line = d_path(map->vm_dentry, buffer, PAGE_SIZE);
+			buffer[PAGE_SIZE-1] = '\n';
+			line -= maxlen;
+			if(line < buffer)
+				line = buffer;
+		} else
+			line = buffer;
 
 		len = sprintf(line,
 			      sizeof(void*) == 4 ? MAPS_LINE_FORMAT4 : MAPS_LINE_FORMAT8,
 			      map->vm_start, map->vm_end, str, map->vm_offset,
 			      kdevname(dev), ino);
 
+		if(map->vm_dentry) {
+			int i;
+			for(i = len; i < maxlen; i++)
+				line[i] = ' ';
+			len = buffer + PAGE_SIZE - line;
+		} else
+			line[len++] = '\n';
 		if (column >= len) {
 			column = 0; /* continue with next line at column 0 */
 			lineno++;
@@ -1005,6 +1023,7 @@
 	/* encode f_pos */
 	file->f_pos = (lineno << MAPS_LINE_SHIFT) + column;
 
+	free_page((unsigned long)buffer);
 	return destptr-buf;
 }
 
diff -u --recursive --new-file v2.1.56/linux/fs/proc/mem.c linux/fs/proc/mem.c
--- v2.1.56/linux/fs/proc/mem.c	Tue Sep 23 16:48:49 1997
+++ linux/fs/proc/mem.c	Sat Sep 20 14:51:55 1997
@@ -91,7 +91,7 @@
 		return count;
 	tmp = buf;
 	while (count > 0) {
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			break;
 		page_dir = pgd_offset(tsk->mm,addr);
 		if (pgd_none(*page_dir))
@@ -145,7 +145,7 @@
 		return -ESRCH;
 	tmp = buf;
 	while (count > 0) {
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			break;
 		page_dir = pgd_offset(tsk,addr);
 		if (pgd_none(*page_dir))
@@ -180,7 +180,7 @@
 	file->f_pos = addr;
 	if (tmp != buf)
 		return tmp-buf;
-	if (current->signal & ~current->blocked)
+	if (signal_pending(current))
 		return -ERESTARTSYS;
 	return 0;
 }
diff -u --recursive --new-file v2.1.56/linux/fs/readdir.c linux/fs/readdir.c
--- v2.1.56/linux/fs/readdir.c	Thu Sep 11 09:02:24 1997
+++ linux/fs/readdir.c	Sat Sep 20 12:21:34 1997
@@ -87,7 +87,13 @@
 	if (!file->f_op || !file->f_op->readdir)
 		goto out;
 
+	/*
+	 * Get the inode's semaphore to prevent changes
+	 * to the directory while we read it.
+	 */
+	down(&inode->i_sem);
 	error = file->f_op->readdir(file, &buf, fillonedir);
+	up(&inode->i_sem);
 	if (error < 0)
 		goto out;
 	error = buf.count;
@@ -173,7 +179,13 @@
 	if (!file->f_op || !file->f_op->readdir)
 		goto out;
 
+	/*
+	 * Get the inode's semaphore to prevent changes
+	 * to the directory while we read it.
+	 */
+	down(&inode->i_sem);
 	error = file->f_op->readdir(file, &buf, filldir);
+	up(&inode->i_sem);
 	if (error < 0)
 		goto out;
 	lastdirent = buf.previous;
diff -u --recursive --new-file v2.1.56/linux/fs/select.c linux/fs/select.c
--- v2.1.56/linux/fs/select.c	Thu Sep  4 17:07:31 1997
+++ linux/fs/select.c	Sat Sep 20 14:51:55 1997
@@ -184,7 +184,7 @@
 			}
 		}
 		wait = NULL;
-		if (retval || !current->timeout || (current->signal & ~current->blocked))
+		if (retval || !current->timeout || signal_pending(current))
 			break;
 		schedule();
 	}
@@ -333,7 +333,7 @@
 		goto out;
 	if (!error) {
 		error = -ERESTARTNOHAND;
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			goto out;
 		error = 0;
 	}
@@ -384,7 +384,7 @@
 		}
 
 		wait = NULL;
-		if (count || !current->timeout || (current->signal & ~current->blocked))
+		if (count || !current->timeout || signal_pending(current))
 			break;
 		schedule();
 	}
@@ -439,7 +439,7 @@
 		__put_user(fds->revents, &ufds->revents);
 	}
 	kfree(fds1);
-	if (!fdcount && (current->signal & ~current->blocked))
+	if (!fdcount && signal_pending(current))
 		err = -EINTR;
 	else
 		err = fdcount;
diff -u --recursive --new-file v2.1.56/linux/fs/super.c linux/fs/super.c
--- v2.1.56/linux/fs/super.c	Sun Sep  7 13:10:43 1997
+++ linux/fs/super.c	Tue Sep 23 14:08:39 1997
@@ -47,6 +47,14 @@
 #include <linux/nfs_fs_sb.h>
 #include <linux/nfs_mount.h>
 
+/*
+ * We use a semaphore to synchronize all mount/umount
+ * activity - imagine the mess if we have a race between
+ * unmounting a filesystem and re-mounting it (or something
+ * else).
+ */
+static struct semaphore mount_sem = MUTEX;
+
 extern void wait_for_keypress(void);
 extern struct file_operations * get_blkfops(unsigned int major);
 
@@ -665,6 +673,9 @@
 		goto out_iput;
 
 	fsync_dev(dev);
+
+	down(&mount_sem);
+
 	retval = do_umount(dev,0);
 	if (!retval) {
 		fsync_dev(dev);
@@ -673,6 +684,8 @@
 			put_unnamed_dev(dev);
 		}
 	}
+
+	up(&mount_sem);
 out_iput:
 	iput(inode);
 out:
@@ -767,6 +780,7 @@
 	struct vfsmount *vfsmnt;
 	int error;
 
+	down(&mount_sem);
 	error = -EACCES;
 	if (!(flags & MS_RDONLY) && dev && is_read_only(dev))
 		goto out;
@@ -810,12 +824,14 @@
 		vfsmnt->mnt_sb = sb;
 		vfsmnt->mnt_flags = flags;
 		d_mount(dir_d, sb->s_root);
-		return 0;		/* we don't dput(dir) - see umount */
+		error = 0;
+		goto out;		/* we don't dput(dir) - see umount */
 	}
 
 dput_and_out:
 	dput(dir_d);
 out:
+	up(&mount_sem);
 	return error;	
 }
 
diff -u --recursive --new-file v2.1.56/linux/include/asm-alpha/elf.h linux/include/asm-alpha/elf.h
--- v2.1.56/linux/include/asm-alpha/elf.h	Sun Sep  7 13:10:43 1997
+++ linux/include/asm-alpha/elf.h	Sun Sep 21 12:57:05 1997
@@ -28,7 +28,7 @@
  * These are used to set parameters in the core dumps.
  */
 #define ELF_CLASS	ELFCLASS64
-#define ELF_DATA	ELFDATA2LSB;
+#define ELF_DATA	ELFDATA2LSB
 #define ELF_ARCH	EM_ALPHA
 
 #define USE_ELF_CORE_DUMP
diff -u --recursive --new-file v2.1.56/linux/include/asm-alpha/unistd.h linux/include/asm-alpha/unistd.h
--- v2.1.56/linux/include/asm-alpha/unistd.h	Thu May 29 21:53:08 1997
+++ linux/include/asm-alpha/unistd.h	Mon Sep 22 14:55:59 1997
@@ -285,6 +285,7 @@
 #define __NR_pciconfig_read		345
 #define __NR_pciconfig_write		346
 #define __NR_query_module		347
+#define __NR_prctl			348
 
 #if defined(__LIBRARY__) && defined(__GNUC__)
 
diff -u --recursive --new-file v2.1.56/linux/include/asm-i386/elf.h linux/include/asm-i386/elf.h
--- v2.1.56/linux/include/asm-i386/elf.h	Sun Sep  7 13:10:43 1997
+++ linux/include/asm-i386/elf.h	Sun Sep 21 12:57:05 1997
@@ -24,7 +24,7 @@
  * These are used to set parameters in the core dumps.
  */
 #define ELF_CLASS	ELFCLASS32
-#define ELF_DATA	ELFDATA2LSB;
+#define ELF_DATA	ELFDATA2LSB
 #define ELF_ARCH	EM_386
 
 /* SVR4/i386 ABI (pages 3-31, 3-32) says that when the program starts %edx
diff -u --recursive --new-file v2.1.56/linux/include/asm-i386/unistd.h linux/include/asm-i386/unistd.h
--- v2.1.56/linux/include/asm-i386/unistd.h	Thu Jun 26 12:33:39 1997
+++ linux/include/asm-i386/unistd.h	Mon Sep 22 14:55:59 1997
@@ -177,6 +177,7 @@
 #define __NR_nfsservctl		169
 #define __NR_setresgid		170
 #define __NR_getresgid		171
+#define __NR_prctl              172
 
 /* user-visible error numbers are in the range -1 - -122: see <asm-i386/errno.h> */
 
diff -u --recursive --new-file v2.1.56/linux/include/asm-m68k/elf.h linux/include/asm-m68k/elf.h
--- v2.1.56/linux/include/asm-m68k/elf.h	Thu Sep  4 17:07:31 1997
+++ linux/include/asm-m68k/elf.h	Sun Sep 21 12:57:05 1997
@@ -24,7 +24,7 @@
  * These are used to set parameters in the core dumps.
  */
 #define ELF_CLASS	ELFCLASS32
-#define ELF_DATA	ELFDATA2MSB;
+#define ELF_DATA	ELFDATA2MSB
 #define ELF_ARCH	EM_68K
 
 /* For SVR4/m68k the function pointer to be registered with `atexit' is
diff -u --recursive --new-file v2.1.56/linux/include/asm-m68k/unistd.h linux/include/asm-m68k/unistd.h
--- v2.1.56/linux/include/asm-m68k/unistd.h	Thu May 29 21:53:08 1997
+++ linux/include/asm-m68k/unistd.h	Mon Sep 22 14:55:59 1997
@@ -174,6 +174,7 @@
 #define __NR_query_module	167
 #define __NR_poll		168
 #define __NR_nfsservctl		169
+#define __NR_prctl		170
 
 /* user-visible error numbers are in the range -1 - -122: see
    <asm-m68k/errno.h> */
diff -u --recursive --new-file v2.1.56/linux/include/asm-mips/elf.h linux/include/asm-mips/elf.h
--- v2.1.56/linux/include/asm-mips/elf.h	Thu Sep  4 17:07:31 1997
+++ linux/include/asm-mips/elf.h	Sun Sep 21 12:57:05 1997
@@ -22,9 +22,9 @@
  */
 #define ELF_CLASS	ELFCLASS32
 #ifdef __MIPSEB__
-#define ELF_DATA       ELFDATA2MSB;
+#define ELF_DATA	ELFDATA2MSB
 #elif __MIPSEL__
-#define ELF_DATA       ELFDATA2LSB;
+#define ELF_DATA	ELFDATA2LSB
 #endif
 #define ELF_ARCH	EM_MIPS
 
diff -u --recursive --new-file v2.1.56/linux/include/asm-mips/unistd.h linux/include/asm-mips/unistd.h
--- v2.1.56/linux/include/asm-mips/unistd.h	Mon Aug  4 16:25:39 1997
+++ linux/include/asm-mips/unistd.h	Mon Sep 22 14:55:59 1997
@@ -1179,11 +1179,12 @@
 #define __NR_nfsservctl			(__NR_Linux + 189)
 #define __NR_setresgid			(__NR_Linux + 190)
 #define __NR_getresgid			(__NR_Linux + 191)
+#define __NR_prctl			(__NR_Linux + 192)
 
 /*
  * Offset of the last Linux flavoured syscall
  */
-#define __NR_Linux_syscalls		191
+#define __NR_Linux_syscalls		192
 
 #ifndef __LANGUAGE_ASSEMBLY__
 
diff -u --recursive --new-file v2.1.56/linux/include/asm-ppc/elf.h linux/include/asm-ppc/elf.h
--- v2.1.56/linux/include/asm-ppc/elf.h	Thu Sep  4 17:07:31 1997
+++ linux/include/asm-ppc/elf.h	Sun Sep 21 12:57:05 1997
@@ -19,7 +19,7 @@
  */
 #define ELF_ARCH	EM_PPC
 #define ELF_CLASS	ELFCLASS32
-#define ELF_DATA	ELFDATA2MSB;
+#define ELF_DATA	ELFDATA2MSB
 
 #define USE_ELF_CORE_DUMP
 #define ELF_EXEC_PAGESIZE	4096
diff -u --recursive --new-file v2.1.56/linux/include/asm-ppc/unistd.h linux/include/asm-ppc/unistd.h
--- v2.1.56/linux/include/asm-ppc/unistd.h	Mon Aug  4 16:25:39 1997
+++ linux/include/asm-ppc/unistd.h	Mon Sep 22 14:55:59 1997
@@ -174,6 +174,7 @@
 #define __NR_query_module	166
 #define __NR_poll		167
 #define __NR_nfsservctl		168
+#define __NR_prctl		169
 
 #define __NR(n)	#n
 #define __do_syscall(n) \
diff -u --recursive --new-file v2.1.56/linux/include/asm-sparc/elf.h linux/include/asm-sparc/elf.h
--- v2.1.56/linux/include/asm-sparc/elf.h	Thu Sep  4 17:07:31 1997
+++ linux/include/asm-sparc/elf.h	Sun Sep 21 12:57:05 1997
@@ -25,7 +25,7 @@
  */
 #define ELF_ARCH	EM_SPARC
 #define ELF_CLASS	ELFCLASS32
-#define ELF_DATA	ELFDATA2MSB;
+#define ELF_DATA	ELFDATA2MSB
 
 #define USE_ELF_CORE_DUMP
 #define ELF_EXEC_PAGESIZE	4096
diff -u --recursive --new-file v2.1.56/linux/include/asm-sparc/unistd.h linux/include/asm-sparc/unistd.h
--- v2.1.56/linux/include/asm-sparc/unistd.h	Thu May 29 21:53:09 1997
+++ linux/include/asm-sparc/unistd.h	Mon Sep 22 14:55:59 1997
@@ -272,6 +272,7 @@
 #define __NR_fdatasync          253
 #define __NR_nfsservctl         254
 #define __NR_aplib              255
+#define __NR_prctl              256
 
 #define _syscall0(type,name) \
 type name(void) \
diff -u --recursive --new-file v2.1.56/linux/include/asm-sparc64/elf.h linux/include/asm-sparc64/elf.h
--- v2.1.56/linux/include/asm-sparc64/elf.h	Thu Sep  4 17:07:31 1997
+++ linux/include/asm-sparc64/elf.h	Sun Sep 21 12:57:05 1997
@@ -22,7 +22,7 @@
 #ifndef ELF_ARCH
 #define ELF_ARCH		EM_SPARC64
 #define ELF_CLASS		ELFCLASS64
-#define ELF_DATA		ELFDATA2MSB;
+#define ELF_DATA		ELFDATA2MSB
 #endif
 
 #ifndef ELF_FLAGS_INIT
diff -u --recursive --new-file v2.1.56/linux/include/asm-sparc64/unistd.h linux/include/asm-sparc64/unistd.h
--- v2.1.56/linux/include/asm-sparc64/unistd.h	Thu Jun 26 12:33:40 1997
+++ linux/include/asm-sparc64/unistd.h	Mon Sep 22 14:55:59 1997
@@ -272,6 +272,7 @@
 #define __NR_fdatasync          253
 #define __NR_nfsservctl         254
 #define __NR_aplib              255
+#define __NR_prctl              256
 
 #define _syscall0(type,name) \
 type name(void) \
diff -u --recursive --new-file v2.1.56/linux/include/linux/prctl.h linux/include/linux/prctl.h
--- v2.1.56/linux/include/linux/prctl.h	Wed Dec 31 16:00:00 1969
+++ linux/include/linux/prctl.h	Mon Sep 22 14:55:59 1997
@@ -0,0 +1,9 @@
+#ifndef _LINUX_PRCTL_H
+#define _LINUX_PRCTL_H
+
+/*  Values to pass as first argument to prctl()  */
+
+#define PR_SET_PDEATHSIG  1  /*  Second arg is a signal  */
+
+
+#endif /* _LINUX_PRCTL_H */
diff -u --recursive --new-file v2.1.56/linux/include/linux/sched.h linux/include/linux/sched.h
--- v2.1.56/linux/include/linux/sched.h	Wed Sep  3 20:52:44 1997
+++ linux/include/linux/sched.h	Wed Sep 24 09:24:18 1997
@@ -191,6 +191,7 @@
 	struct task_struct *next_task, *prev_task;
 	struct task_struct *next_run,  *prev_run;
 	int exit_code, exit_signal;
+	int pdeath_signal;  /*  The signal sent when the parent dies  */
 	/* ??? */
 	unsigned long personality;
 	int dumpable:1;
@@ -312,7 +313,7 @@
 /* exec domain */&default_exec_domain, \
 /* binfmt */	NULL, \
 /* schedlink */	&init_task,&init_task, &init_task, &init_task, \
-/* ec,brk... */	0,0,0,0,0, \
+/* ec,brk... */	0,0,0,0,0,0, \
 /* pid etc.. */	0,0,0,0,0, \
 /* suppl grps*/ 0, {0,}, \
 /* proc links*/ &init_task,&init_task,NULL,NULL,NULL, \
@@ -448,6 +449,11 @@
 extern void force_sig(unsigned long sig,struct task_struct * p);
 extern int send_sig(unsigned long sig,struct task_struct * p,int priv);
 extern int in_group_p(gid_t grp);
+
+extern inline int signal_pending(struct task_struct *p)
+{
+	return (p->signal &~ p->blocked) != 0;
+}
 
 extern int request_irq(unsigned int irq,
 		       void (*handler)(int, void *, struct pt_regs *),
diff -u --recursive --new-file v2.1.56/linux/include/linux/sunrpc/types.h linux/include/linux/sunrpc/types.h
--- v2.1.56/linux/include/linux/sunrpc/types.h	Thu Jun 12 15:30:27 1997
+++ linux/include/linux/sunrpc/types.h	Sat Sep 20 14:51:55 1997
@@ -70,6 +70,6 @@
 /*
  * Shorthands
  */
-#define signalled()		(current->signal & ~current->blocked)
+#define signalled()		(signal_pending(current))
 
 #endif /* _LINUX_SUNRPC_TYPES_H_ */
diff -u --recursive --new-file v2.1.56/linux/include/linux/wrapper.h linux/include/linux/wrapper.h
--- v2.1.56/linux/include/linux/wrapper.h	Thu Jul 17 10:06:09 1997
+++ linux/include/linux/wrapper.h	Sat Sep 20 14:51:55 1997
@@ -8,7 +8,7 @@
 #define file_operation_handle file_operations
 
 #define connect_wrapper(x) 0
-#define current_got_fatal_signal() (current->signal & ~current->blocked)
+#define current_got_fatal_signal() (signal_pending(current))
 #define current_set_timeout(val) current->timeout = val
 
 #define module_interruptible_sleep_on interruptible_sleep_on
diff -u --recursive --new-file v2.1.56/linux/ipc/msg.c linux/ipc/msg.c
--- v2.1.56/linux/ipc/msg.c	Tue May 13 22:41:19 1997
+++ linux/ipc/msg.c	Sat Sep 20 14:51:55 1997
@@ -136,7 +136,7 @@
 			/* still no space in queue */
 			if (msgflg & IPC_NOWAIT)
 				return -EAGAIN;
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return -EINTR;
 			if (in_interrupt()) {
 				/* Very unlikely, but better safe than sorry */
@@ -383,7 +383,7 @@
 				DROP_TIMER;
 				return -ENOMSG;
 			}
-			if (current->signal & ~current->blocked) {
+			if (signal_pending(current)) {
 				DROP_TIMER;
 				return -EINTR; 
 			}
diff -u --recursive --new-file v2.1.56/linux/kernel/exit.c linux/kernel/exit.c
--- v2.1.56/linux/kernel/exit.c	Tue Sep 23 16:48:50 1997
+++ linux/kernel/exit.c	Mon Sep 22 14:55:59 1997
@@ -55,7 +55,7 @@
 	spin_lock(&p->sigmask_lock);
 	p->signal |= mask;
 	spin_unlock(&p->sigmask_lock);
-	if (p->state == TASK_INTERRUPTIBLE && (p->signal & ~p->blocked))
+	if (p->state == TASK_INTERRUPTIBLE && signal_pending(p))
 		wake_up_process(p);
 out:
 	spin_unlock_irqrestore(&p->sig->siglock, flags);
@@ -349,7 +349,8 @@
 	for_each_task(p) {
 		if (p->p_opptr == father) {
 			p->exit_signal = SIGCHLD;
-			p->p_opptr = task[smp_num_cpus] ? : task[0];	/* init */
+			p->p_opptr = task[smp_num_cpus] ? : task[0]; /* init */
+			if (p->pdeath_signal) send_sig(p->pdeath_signal, p, 0);
 		}
 	}
 	read_unlock(&tasklist_lock);
@@ -659,7 +660,7 @@
 		if (options & WNOHANG)
 			goto end_wait4;
 		retval = -ERESTARTSYS;
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			goto end_wait4;
 		current->state=TASK_INTERRUPTIBLE;
 		schedule();
diff -u --recursive --new-file v2.1.56/linux/kernel/fork.c linux/kernel/fork.c
--- v2.1.56/linux/kernel/fork.c	Wed Sep  3 20:52:44 1997
+++ linux/kernel/fork.c	Mon Sep 22 14:55:59 1997
@@ -497,6 +497,7 @@
 	/* ok, now we should be set up.. */
 	p->swappable = 1;
 	p->exit_signal = clone_flags & CSIGNAL;
+	p->pdeath_signal = 0;
 
 	/*
 	 * "share" dynamic priority between parent and child, thus the
diff -u --recursive --new-file v2.1.56/linux/kernel/printk.c linux/kernel/printk.c
--- v2.1.56/linux/kernel/printk.c	Tue May 13 22:41:20 1997
+++ linux/kernel/printk.c	Sat Sep 20 14:51:55 1997
@@ -96,7 +96,7 @@
 		cli();
 		error = -ERESTARTSYS;
 		while (!log_size) {
-			if (current->signal & ~current->blocked) {
+			if (signal_pending(current)) {
 				sti();
 				goto out;
 			}
diff -u --recursive --new-file v2.1.56/linux/kernel/sched.c linux/kernel/sched.c
--- v2.1.56/linux/kernel/sched.c	Thu Sep 11 09:02:24 1997
+++ linux/kernel/sched.c	Sat Sep 20 14:51:55 1997
@@ -400,7 +400,7 @@
 	timeout = 0;
 	switch (prev->state) {
 		case TASK_INTERRUPTIBLE:
-			if (prev->signal & ~prev->blocked)
+			if (signal_pending(prev))
 				goto makerunnable;
 			timeout = prev->timeout;
 			if (timeout && (timeout <= jiffies)) {
@@ -623,9 +623,7 @@
 		if (waking_non_zero(sem))	/* are we waking up?  */
 			break;			/* yes, exit loop */
 
-		if (   task_state == TASK_INTERRUPTIBLE
-		    && (tsk->signal & ~tsk->blocked)	/* signalled */
-		   ) {
+		if (task_state == TASK_INTERRUPTIBLE && signal_pending(tsk)) {
 			ret = -EINTR;			/* interrupted */
 			atomic_inc(&sem->count);	/* give up on down operation */
 			break;
diff -u --recursive --new-file v2.1.56/linux/kernel/sys.c linux/kernel/sys.c
--- v2.1.56/linux/kernel/sys.c	Thu Sep 11 09:02:24 1997
+++ linux/kernel/sys.c	Mon Sep 22 14:55:59 1997
@@ -25,6 +25,7 @@
 #include <linux/smp_lock.h>
 #include <linux/notifier.h>
 #include <linux/reboot.h>
+#include <linux/prctl.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -1004,4 +1005,26 @@
 {
 	mask = xchg(&current->fs->umask, mask & S_IRWXUGO);
 	return mask;
+}
+    
+asmlinkage int sys_prctl(int option, unsigned long arg2, unsigned long arg3,
+                         unsigned long arg4, unsigned long arg5)
+{
+	int error = 0;
+	int sig;
+
+	switch (option) {
+		case PR_SET_PDEATHSIG:
+			sig = arg2;
+			if (sig > _NSIG) {
+                        	error = -EINVAL;
+                                break;
+                        }
+                        current->pdeath_signal = sig;
+                        break;
+		default:
+			error = -EINVAL;
+			break;
+        }
+        return error;
 }
diff -u --recursive --new-file v2.1.56/linux/mm/vmscan.c linux/mm/vmscan.c
--- v2.1.56/linux/mm/vmscan.c	Wed Sep  3 20:52:44 1997
+++ linux/mm/vmscan.c	Sun Sep 21 17:05:45 1997
@@ -355,6 +355,9 @@
 	int i=6;
 	int stop;
 
+	/* Always trim SLAB caches when memory gets low. */
+	(void) kmem_cache_reap(0, dma, wait);
+
 	/* we don't try as hard if we're not waiting.. */
 	stop = 3;
 	if (wait)
@@ -366,19 +369,9 @@
 				return 1;
 			state = 1;
 		case 1:
-			/*
-			 * We shouldn't have a priority here:
-			 * If we're low on memory we should
-			 * unconditionally throw away _all_
-			 * kmalloc caches!
-			 */
-			if (kmem_cache_reap(0, dma, wait))
-				return 1;
-			state = 2;
-		case 2:
 			if (shm_swap(i, dma))
 				return 1;
-			state = 3;
+			state = 2;
 		default:
 			if (swap_out(i, dma, wait))
 				return 1;
diff -u --recursive --new-file v2.1.56/linux/net/ax25/af_ax25.c linux/net/ax25/af_ax25.c
--- v2.1.56/linux/net/ax25/af_ax25.c	Thu Sep  4 17:07:32 1997
+++ linux/net/ax25/af_ax25.c	Sat Sep 20 14:51:55 1997
@@ -1174,7 +1174,7 @@
 	/* A DM or timeout will go to closed, a UA will go to ABM */
 	while (sk->state == TCP_SYN_SENT) {
 		interruptible_sleep_on(sk->sleep);
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			sti();
 			return -ERESTARTSYS;
 		}
@@ -1227,7 +1227,7 @@
 				return -EWOULDBLOCK;
 			}
 			interruptible_sleep_on(sk->sleep);
-			if (current->signal & ~current->blocked) {
+			if (signal_pending(current)) {
 				sti();
 				return -ERESTARTSYS;
 			}
diff -u --recursive --new-file v2.1.56/linux/net/core/datagram.c linux/net/core/datagram.c
--- v2.1.56/linux/net/core/datagram.c	Mon Apr 14 16:28:27 1997
+++ linux/net/core/datagram.c	Sat Sep 20 14:51:55 1997
@@ -114,7 +114,7 @@
 
 		/* handle signals */
 		error = -ERESTARTSYS;
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			goto no_packet;
 
 		/* User doesn't want to wait */
diff -u --recursive --new-file v2.1.56/linux/net/core/sock.c linux/net/core/sock.c
--- v2.1.56/linux/net/core/sock.c	Thu Sep  4 17:07:32 1997
+++ linux/net/core/sock.c	Sat Sep 20 14:51:55 1997
@@ -674,7 +674,7 @@
 			{
 				sk->socket->flags &= ~SO_NOSPACE;
 				interruptible_sleep_on(sk->sleep);
-				if (current->signal & ~current->blocked) 
+				if (signal_pending(current)) 
 				{
 					sti();
 					*errcode = -ERESTARTSYS;
diff -u --recursive --new-file v2.1.56/linux/net/ipv4/af_inet.c linux/net/ipv4/af_inet.c
--- v2.1.56/linux/net/ipv4/af_inet.c	Thu Sep  4 17:07:32 1997
+++ linux/net/ipv4/af_inet.c	Sat Sep 20 14:51:55 1997
@@ -605,7 +605,7 @@
 	cli();
 	while(sk->state == TCP_SYN_SENT || sk->state == TCP_SYN_RECV) {
 		interruptible_sleep_on(sk->sleep);
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			sti();
 			return(-ERESTARTSYS);
 		}
@@ -670,7 +670,7 @@
 	cli();
 	while (sk2->state == TCP_SYN_RECV) {
 		interruptible_sleep_on(sk2->sleep);
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			goto do_interrupted;
 	}
 	sti();
diff -u --recursive --new-file v2.1.56/linux/net/ipv4/tcp.c linux/net/ipv4/tcp.c
--- v2.1.56/linux/net/ipv4/tcp.c	Sun Sep  7 13:10:43 1997
+++ linux/net/ipv4/tcp.c	Sat Sep 20 14:51:55 1997
@@ -724,7 +724,7 @@
 		sk->socket->flags &= ~SO_NOSPACE;
 		add_wait_queue(sk->sleep, &wait);
 		for (;;) {
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				break;
 			current->state = TASK_INTERRUPTIBLE;
 			if (tcp_memory_free(sk))
@@ -792,7 +792,7 @@
 		if (flags&MSG_DONTWAIT)
 			return -EAGAIN;
 		
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			return -ERESTARTSYS;
 		
 		wait_for_tcp_connect(sk);
@@ -915,7 +915,7 @@
 					return -EAGAIN;
 				}
 
-				if (current->signal & ~current->blocked) {
+				if (signal_pending(current)) {
 					if (copied)
 						return copied;
 					return -ERESTARTSYS;
@@ -1155,7 +1155,7 @@
 		 * handling. FIXME: Need to check this doesnt impact 1003.1g
 		 * and move it down to the bottom of the loop
 		 */
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			if (copied)
 				break;
 			copied = -ERESTARTSYS;
@@ -1473,7 +1473,7 @@
 		current->timeout = timeout;
 		while(closing(sk) && current->timeout) {
 			interruptible_sleep_on(sk->sleep);
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				break;
 		}
 		current->timeout=0;
@@ -1518,7 +1518,7 @@
 		req = tcp_find_established(&(sk->tp_pinfo.af_tcp), pprev);
 		if (req) 
 			break;
-		if (current->signal & ~current->blocked)
+		if (signal_pending(current))
 			break;
 	}
 	remove_wait_queue(sk->sleep, &wait);
diff -u --recursive --new-file v2.1.56/linux/net/netlink.c linux/net/netlink.c
--- v2.1.56/linux/net/netlink.c	Tue Sep 23 16:48:50 1997
+++ linux/net/netlink.c	Sat Sep 20 14:51:55 1997
@@ -111,7 +111,7 @@
 			return -EAGAIN;
 		}
 		interruptible_sleep_on(&read_space_wait[minor]);
-		if(current->signal & ~current->blocked)
+		if(signal_pending(current))
 		{
 			sti();
 			return -ERESTARTSYS;
diff -u --recursive --new-file v2.1.56/linux/net/netrom/af_netrom.c linux/net/netrom/af_netrom.c
--- v2.1.56/linux/net/netrom/af_netrom.c	Thu Sep  4 17:07:32 1997
+++ linux/net/netrom/af_netrom.c	Sat Sep 20 14:51:55 1997
@@ -699,7 +699,7 @@
 	 */
 	while (sk->state == TCP_SYN_SENT) {
 		interruptible_sleep_on(sk->sleep);
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			sti();
 			return -ERESTARTSYS;
 		}
@@ -750,7 +750,7 @@
 				return -EWOULDBLOCK;
 			}
 			interruptible_sleep_on(sk->sleep);
-			if (current->signal & ~current->blocked) {
+			if (signal_pending(current)) {
 				sti();
 				return -ERESTARTSYS;
 			}
diff -u --recursive --new-file v2.1.56/linux/net/rose/af_rose.c linux/net/rose/af_rose.c
--- v2.1.56/linux/net/rose/af_rose.c	Thu Sep  4 17:07:32 1997
+++ linux/net/rose/af_rose.c	Sat Sep 20 14:51:55 1997
@@ -787,7 +787,7 @@
 	 */
 	while (sk->state == TCP_SYN_SENT) {
 		interruptible_sleep_on(sk->sleep);
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			sti();
 			return -ERESTARTSYS;
 		}
@@ -838,7 +838,7 @@
 				return -EWOULDBLOCK;
 			}
 			interruptible_sleep_on(sk->sleep);
-			if (current->signal & ~current->blocked) {
+			if (signal_pending(current)) {
 				sti();
 				return -ERESTARTSYS;
 			}
diff -u --recursive --new-file v2.1.56/linux/net/sunrpc/clnt.c linux/net/sunrpc/clnt.c
--- v2.1.56/linux/net/sunrpc/clnt.c	Tue Sep 23 16:48:50 1997
+++ linux/net/sunrpc/clnt.c	Tue Sep 23 13:29:54 1997
@@ -142,7 +142,10 @@
 	dprintk("RPC: destroying %s client for %s\n",
 			clnt->cl_protname, clnt->cl_server);
 
-	rpcauth_destroy(clnt->cl_auth);
+	if (clnt->cl_auth) {
+		rpcauth_destroy(clnt->cl_auth);
+		clnt->cl_auth = NULL;
+	}
 	if (clnt->cl_xprt) {
 		xprt_destroy(clnt->cl_xprt);
 		clnt->cl_xprt = NULL;
diff -u --recursive --new-file v2.1.56/linux/net/unix/af_unix.c linux/net/unix/af_unix.c
--- v2.1.56/linux/net/unix/af_unix.c	Thu Sep  4 17:07:32 1997
+++ linux/net/unix/af_unix.c	Sat Sep 20 14:51:55 1997
@@ -705,7 +705,7 @@
 		if(nonblock)
 			return -EINPROGRESS;
 		interruptible_sleep_on(sk->sleep);
-		if(current->signal & ~current->blocked)
+		if(signal_pending(current))
 			return -ERESTARTSYS;
 	}
 	
@@ -802,7 +802,7 @@
 			if(flags&O_NONBLOCK)
 				return -EAGAIN;
 			interruptible_sleep_on(sk->sleep);
-			if(current->signal & ~current->blocked)
+			if(signal_pending(current))
 				return -ERESTARTSYS;
 			continue;
 		}
@@ -1219,7 +1219,7 @@
 			if (noblock)
 				return -EAGAIN;
 			unix_data_wait(sk);
-			if (current->signal & ~current->blocked)
+			if (signal_pending(current))
 				return -ERESTARTSYS;
 			down(&sk->protinfo.af_unix.readsem);
 			continue;
diff -u --recursive --new-file v2.1.56/linux/net/x25/af_x25.c linux/net/x25/af_x25.c
--- v2.1.56/linux/net/x25/af_x25.c	Thu Sep  4 17:07:32 1997
+++ linux/net/x25/af_x25.c	Sat Sep 20 14:51:55 1997
@@ -653,7 +653,7 @@
 	 */
 	while (sk->state == TCP_SYN_SENT) {
 		interruptible_sleep_on(sk->sleep);
-		if (current->signal & ~current->blocked) {
+		if (signal_pending(current)) {
 			sti();
 			return -ERESTARTSYS;
 		}
@@ -704,7 +704,7 @@
 				return -EWOULDBLOCK;
 			}
 			interruptible_sleep_on(sk->sleep);
-			if (current->signal & ~current->blocked) {
+			if (signal_pending(current)) {
 				sti();
 				return -ERESTARTSYS;
 			}
diff -u --recursive --new-file v2.1.56/linux/scripts/ksymoops.cc linux/scripts/ksymoops.cc
--- v2.1.56/linux/scripts/ksymoops.cc	Thu Jun 26 12:33:41 1997
+++ linux/scripts/ksymoops.cc	Sun Sep 21 10:48:50 1997
@@ -2,6 +2,9 @@
 // Copyright (C) 1995 Greg McGary <gkm@magilla.cichlid.com>
 // compile like so: g++ -o ksymoops ksymoops.cc -liostream
 
+// Update to binutils 2.8 and handling of header text on oops lines by
+// Keith Owens <kaos@ocs.com.au>
+
 //////////////////////////////////////////////////////////////////////////////
 
 // This program is free software; you can redistribute it and/or modify
@@ -26,8 +29,6 @@
 //////////////////////////////////////////////////////////////////////////////
 
 // BUGS:
-// * Doesn't deal with line-prefixes prepended by syslog--strip
-//   these off first, before submitting to ksymoops.
 // * Only resolves operands of jump and call instructions.
 
 #include <fstream.h>
@@ -39,7 +40,6 @@
 #include <unistd.h>
 #include <ctype.h>
 
-inline int strequ(char const* x, char const* y) { return (::strcmp(x, y) == 0); }
 inline int strnequ(char const* x, char const* y, size_t n) { return (::strncmp(x, y, n) == 0); }
 
 const int code_size = 20;
@@ -188,6 +188,8 @@
     int eip_seen = 0;
     long offset;
     while (fgets(buf, sizeof(buf), objdump_FILE)) {
+	if (strlen(buf) < 14)
+	    continue;
 	if (eip_seen && buf[4] == ':') {
 	    // assume objdump from binutils 2.8..., reformat to old style
 	    offset = strtol(buf, 0, 16);
@@ -279,6 +281,7 @@
 main(int argc, char** argv)
 {
     char c;
+    char *oops_column = NULL;
     program_name = (argc--, *argv++);
 
     NameList names;
@@ -299,46 +302,63 @@
     cout << endl;
 
     char buffer[1024];
-    while (!cin.eof())
-    {
+    while (1) {
 	long eip_addr;
-	cin >> buffer;
-	if (strequ(buffer, "EIP:") && names.valid()) {
-	    cin >> ::hex >> eip_addr;
-	    cin >> c >> c >> c;
-	    cin >> ::hex >> eip_addr;
-	    cin >> c >> c >> buffer;
-	    if (!strequ(buffer, "EFLAGS:")) {
-		clog << "Please strip the line-prefixes and rerun " << program_name << endl;
+	cin.get(buffer, sizeof(buffer));
+	if (cin.eof())
+	    break;
+	cin.get(c);	/* swallow newline */
+	if (strstr(buffer, "EIP:") && names.valid()) {
+	    oops_column =  strstr(buffer, "EIP:");
+	    if (sscanf(oops_column+13, "[<%x>]", &eip_addr) != 1) {
+	    	cout << "Cannot read eip address from EIP: line.  Is this a valid oops file?" << endl;
 		exit(1);
 	    }
+	    cout << ">>EIP: ";
 	    KSym* ksym = names.find(eip_addr);
 	    if (ksym)
-		cout << ">>EIP: " << *ksym << endl;
-	} else if (strequ(buffer, "Trace:") && names.valid()) {
+		cout << *ksym << endl;
+	    else
+		cout << ::hex << eip_addr << " cannot be resolved" << endl;
+	}
+	else if (oops_column && strstr(oops_column, "[<") && names.valid()) {
 	    unsigned long address;
-	    while ((cin >> buffer) && 
-		   (sscanf(buffer, " [<%x>]", &address) == 1) &&
-		   address > 0xc) {
-		cout << "Trace: ";
-		KSym* ksym = names.find(address);
-		if (ksym)
-		    cout << *ksym;
-		else
-		    cout << ::hex << address;
-		cout << endl;
+	    while (strstr(oops_column, "[<")) {
+		char *p = oops_column;
+		while (1) {
+		    while (*p && *p++ != '[')
+			;
+		    if (sscanf(p, "<%x>]", &address) != 1)
+			break;
+		    cout << "Trace: ";
+		    KSym* ksym = names.find(address);
+		    if (ksym)
+			cout << *ksym;
+		    else
+			cout << ::hex << address;
+		    cout << endl;
+		}
+		cin.get(buffer, sizeof(buffer));
+		if (cin.eof())
+		    break;
+		cin.get(c);	/* swallow newline */
 	    }
-	    cout << endl;
 	}
-	if (strequ(buffer, "ode:") || strequ(buffer, "Code:")) {
-	    // The 'C' might have been consumed as a hex number
+	if (oops_column && strnequ(oops_column, "Code:", 5)) {
 	    unsigned char code[code_size];
 	    unsigned char* cp = code;
 	    unsigned char* end = &code[code_size];
-	    while (cp < end) {
-		int c;
-		cin >> ::hex >> c;
+	    char *p = oops_column + 5;
+	    int c;
+	    memset(code, '\0', sizeof(code));
+	    while (*p && cp < end) {
+	    	while (*p == ' ')
+		    ++p;
+		if (sscanf(p, "%x", &c) != 1)
+		    break;
 		*cp++ = c;
+	    	while (*p && *p++ != ' ')
+		    ;
 	    }
 	    names.decode(code, eip_addr);
 	}
