[85] in Pthreads mailing list archive

home help back first fref pref prev next nref lref last post

hpux9.05 success?

daemon@ATHENA.MIT.EDU (Neal Becker)
Wed Aug 16 17:38:39 1995

Date: Wed, 16 Aug 95 17:21:49 -0400 (EDT)
From: neal@ctd.comsat.com (Neal Becker)
To: proven@MIT.EDU, pthreads@MIT.EDU

I got 1.60beta3 built on hpux9.05 gcc-2.7.0.  Took a bit of patching.

What should the outputs of the tests be?
Does this look good so far?
--------------------------
Running test test_create ...
Original thread stack at 7b0334a0
New thread was passed arg address deadbeef
New thread stack at 40027040
Running test test_pthread_join ...
Original thread stack at 7b0335a8
New thread 1 stack at 40027040
New thread 2 stack at 40038040
test_pthread_join PASSED
Running test test_switch ...
-------------------------

Here are patches so far:

--- ./gen/isatty.c.orig	Wed Jun 14 03:09:35 1995
+++ ./gen/isatty.c	Wed Aug 16 09:42:09 1995
@@ -73,6 +73,9 @@
 	  real_fd = fd;
 	else
 	  real_fd = fd_table[fd]->fd.i;
+#ifdef _POSIX_VERSION
+	return (tcgetattr(real_fd, &t) ? 0 : 1);
+#else
 	return (machdep_sys_ioctl(real_fd,
 #ifdef sunos4
 				  TCGETA,
@@ -80,6 +83,7 @@
 				  TIOCGETA,
 #endif /* sunos4 */
 				  &t) ? 0 : 1);
+#endif /* _POSIX_VERSION */
 }
 
 int isatty(int fd)
--- ./machdep/hpux-9.03/__stdio.h.orig	Tue Aug 15 16:47:45 1995
+++ ./machdep/hpux-9.03/__stdio.h	Tue Aug 15 16:12:04 1995
@@ -0,0 +1,7 @@
+
+#ifndef _SIZE_T 
+#define _SIZE_T
+typedef pthread_size_t  size_t;
+#endif
+
+typedef pthread_fpos_t fpos_t;
--- ./machdep/hpux-9.03/__signal.h.orig	Tue Aug 15 16:47:50 1995
+++ ./machdep/hpux-9.03/__signal.h	Wed Aug 16 17:08:34 1995
@@ -0,0 +1,50 @@
+#include <sys/signal.h>
+
+#ifndef SIGCLD
+#define SIGCLD		SIGCHLD
+#endif
+
+/* #define	__sigmask				sigmask */
+
+/*
+#define	__SIGFILLSET		0xffffffff
+#define	__SIGEMPTYSET		0
+#define	__SIGADDSET(s,n)	((*s) |= (__sigmask(n)))
+#define	__SIGDELSET(s,n)	((*s) &= ~(__sigmask(n))) 
+#define	__SIGISMEMBER(s,n)	((*s) & (__sigmask(n))) 
+*/
+
+static const sigset_t __SIGFILLSET = {0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
+				0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff};
+
+static const sigset_t __SIGEMPTYSET = { 0, 0, 0, 0, 0, 0, 0, 0 };
+
+static inline void __SIGADDSET(sigset_t *set, int signo) {
+  int word = (signo - 1) / 32;
+  int bit = (signo - 1) % 32;
+  set->sigset[word] |= 1 << bit;
+}
+
+static inline void __SIGDELSET(sigset_t *set, int signo) {
+  int word = (signo - 1) / 32;
+  int bit = (signo - 1) % 32;
+  set->sigset[word] &= ~(1 << bit);
+}
+
+static inline int __SIGISMEMBER(sigset_t *set, int signo) {
+  int word = (signo - 1) / 32;
+  int bit = (signo - 1) % 32;
+  return set->sigset[word] & (1 << bit);
+}
+
+#define SIGSET_SIZE sizeof(sigset_t)/sizeof(long)
+
+#define SIG_ANY(sig) sig_any(&sig)
+
+static inline int sig_any(sigset_t *sig) {
+  int i;
+  for (i=0; i < SIGSET_SIZE; i++)
+    if (sig->sigset[i] != 0)
+      return 1;
+  return 0;
+}
--- ./machdep/hpux-9.03/dirent.h.orig	Sun Aug  7 23:43:38 1994
+++ ./machdep/hpux-9.03/dirent.h	Tue Aug 15 16:48:32 1995
@@ -48,12 +48,8 @@
 	u_long	d_fileno;		/* file number of entry */
 	u_short	d_reclen;		/* length of this record */
 	u_short	d_namlen;		/* length of string in d_name */
-#ifdef _POSIX_SOURCE
-	char	d_name[255 + 1];	/* name must be no longer than this */
-#else
 #define	MAXNAMLEN	255
 	char	d_name[MAXNAMLEN + 1];	/* name must be no longer than this */
-#endif
 };
 
 #define d_ino	d_fileno
--- ./machdep/syscall-hppa-hpux-9.03.S.orig	Sat Feb 11 23:38:27 1995
+++ ./machdep/syscall-hppa-hpux-9.03.S	Wed Aug 16 12:07:10 1995
@@ -823,4 +823,49 @@
     .PROCEND
     .EXPORT     machdep_sys_sigprocmask,ENTRY
 
+machdep_sys_sigsuspend
+
+    .PROC
+    .CALLINFO   NO_CALLS,FRAME=0
+
+    ldil -0x80000,%r1
+    ble 4(%sr7,%r1)
+    ldi 241,%r22
+    or,= %r0,%r22,%r0
+    b,n machdep_error
+    bv,n %r0(%r2)
+
+    .PROCEND
+    .EXPORT     machdep_sys_sigsuspend,ENTRY
+
+machdep_sys_socketpair
+
+    .PROC
+    .CALLINFO   NO_CALLS,FRAME=0
+
+    ldil -0x80000,%r1
+    ble 4(%sr7,%r1)
+    ldi 291,%r22
+    or,= %r0,%r22,%r0
+    b,n machdep_error
+    bv,n %r0(%r2)
+
+    .PROCEND
+    .EXPORT     machdep_sys_socketpair,ENTRY
+
+machdep_sys_ftruncate
+
+    .PROC
+    .CALLINFO   NO_CALLS,FRAME=0
+
+    ldil -0x80000,%r1
+    ble 4(%sr7,%r1)
+    ldi 130,%r22
+    or,= %r0,%r22,%r0
+    b,n machdep_error
+    bv,n %r0(%r2)
+
+    .PROCEND
+    .EXPORT     machdep_sys_ftruncate,ENTRY
+
 	.END
--- ./machdep/engine-hppa-hpux-9.03.h.orig	Tue Nov  8 10:38:51 1994
+++ ./machdep/engine-hppa-hpux-9.03.h	Wed Aug 16 16:43:51 1995
@@ -79,21 +79,8 @@
 /*
  * Macros for sigset_t
  */
-#define SIGMAX	31
-#define SIG_ANY(sig)					\
-({										\
-	sigset_t *sig_addr = &sig;			\
-	int ret = 0;						\
-	int i;								\
-										\
-	for (i = 1; i <= SIGMAX; i++) {		\
-		if (sigismember(sig_addr, i)) {	\
-			ret = 1;					\
-			break;						\
-		}								\
-	}									\
-	ret;								\
-})	
+
+#define SIGMAX 30
 
 /*
  * New Strutures
--- ./pthreads/sig.c.orig	Sun Apr  2 06:45:02 1995
+++ ./pthreads/sig.c	Wed Aug 16 14:10:00 1995
@@ -347,11 +347,7 @@
 	return (0);
 }
 
-#ifdef hpux
-#define _MAXIMUM_SIG (SIGMAX+1)
-#else
 #define _MAXIMUM_SIG NSIG
-#endif /* hpux */
 
 int sigaddset(sigset_t *set, int signo)
 {

home help back first fref pref prev next nref lref last post