Forgot the patch about jthread on hpux

kaffe@rufus.w3.org kaffe@rufus.w3.org
Sat, 25 Jul 1998 14:36:30 +0200


--cNdxnHkX5QqsyA0e
Content-Type: text/plain; charset=us-ascii

I forgot to add the patch to my last mail, I try again...

Regards,
Even Holen
-- 
<><   Even Holen, evenh@pvv.ntnu.no, http://www.pvv.ntnu.no/~evenh/   :-)

--cNdxnHkX5QqsyA0e
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="jthread.patch"

*** systems/unix-jthreads/jthread.c	Sat Jul 25 14:12:19 1998
--- /store/store/stash/kaffe/src-1.0.b1/kaffe/kaffevm/systems/unix-jthreads/jthread.c	Tue Jul 14 06:34:20 1998
*************** jthreadedFileDescriptor(int fd)
*** 1451,1457 ****
  	 * Apparently, this can fail, for instance when we stdout is 
  	 * redirected to /dev/null. (On FreeBSD)
  	 */
! 	r = fcntl(fd, F_SETFL, r | O_NONBLOCK 
  #if defined(O_ASYNC)
  		| O_ASYNC
  #elif defined(FASYNC)
--- 1451,1457 ----
  	 * Apparently, this can fail, for instance when we stdout is 
  	 * redirected to /dev/null. (On FreeBSD)
  	 */
! 	fcntl(fd, F_SETFL, r | O_NONBLOCK 
  #if defined(O_ASYNC)
  		| O_ASYNC
  #elif defined(FASYNC)
*************** jthreadedFileDescriptor(int fd)
*** 1461,1501 ****
  
  #if defined(FIOSSAIOSTAT)
  	/* on hpux */
! 	if ( (r = ioctl(fd, FIOSSAIOSTAT, &on)) < 0 && errno !=ENOTTY) {
! 		/* Defines ENOTTY to be an acceptable error */
! 		perror("Failed doing FIOSSAIOSTAT");
!  		return (r);
! 	}
  #elif defined(FIOASYNC)
  	/* 
  	 * On some systems, this will not work if a terminal fd is redirected.
  	 * (Solaris sets errno to ENXIO in this case.
  	 */
! 	if (r = ioctl(fd, FIOASYNC, &on)) < 0 && errno != ENXIO) {
! 		/* Defines ENXIO to be an acceptable error */
! 		perror("Failed doing FIOASYNC");
! 		return (r);
!         }
  #endif
  
  #if !(defined(O_ASYNC) || defined(FIOASYNC) ||  \
        defined(FASYNC) || defined(FIOSSAIOSTAT))
  #error	Could not put socket in async mode
  #endif
! 
! 
! #if defined(FIOSSAIOOWN)
! 	r=ioctl(fd, FIOSSAIOOWN, &pid);
!         if (r==-1 && errno != ENOTTY) {
! 		perror("Error doing FIOSSAIOWN");
! 	}
! 	
! #elif defined(F_SETOWN)
  	/* Allow socket to signal this process when new data is available */
  	/* On some systems, this will flag an error if fd is not a socket */
! 	if ((r=fcntl(fd, F_SETOWN, pid)) < 0) {
! 		perror("Error doing F_SETOWN");
! 	}
  #endif
  	return (fd);
  }
--- 1461,1485 ----
  
  #if defined(FIOSSAIOSTAT)
  	/* on hpux */
! 	if ((r = ioctl(fd, FIOSSAIOSTAT, &on)) < 0)
! 		return (r);
! 
  #elif defined(FIOASYNC)
  	/* 
  	 * On some systems, this will not work if a terminal fd is redirected.
  	 * (Solaris sets errno to ENXIO in this case.
  	 */
! 	ioctl(fd, FIOASYNC, &on);
  #endif
  
  #if !(defined(O_ASYNC) || defined(FIOASYNC) ||  \
        defined(FASYNC) || defined(FIOSSAIOSTAT))
  #error	Could not put socket in async mode
  #endif
! #if defined(F_SETOWN)
  	/* Allow socket to signal this process when new data is available */
  	/* On some systems, this will flag an error if fd is not a socket */
! 	fcntl(fd, F_SETOWN, pid);
  #endif
  	return (fd);
  }

--cNdxnHkX5QqsyA0e--