[136] in Pthreads mailing list archive
Patches for 1.60b3 on Alpha/OSF1v3.0
daemon@ATHENA.MIT.EDU (Owen Rees)
Mon Oct 9 12:29:48 1995
To: pthreads@MIT.EDU
Date: Mon, 09 Oct 1995 15:59:13 +0100
From: Owen Rees <rtor@ansa.co.uk>
I found three problems with 1.60b3 on an Alpha OSF1v3.0 system. I was
compiling with gcc 2.7.0, but I do not think that that is significant.
Patches to fix these are attached.
1) Name conflict in test_stdio_1 - basename and dirname are already
declared, fixed by renaming the variables in the test.
2) test_stdio_1 reports sscanf/sprintf error - fixed by using fcvt
rather than ecvt for %f formats in stdio/vfprintf.c. This gets it past
the test, but I have not checked other cases.
3) 'pipe' was broken. Message 2 in the pthreads archive explains the
problem (need to fill in the array passed as a parameter) and gave a
solution for SunOS4.1.3. I made pipe a special case in the syscall
code and, with some poking around with gdb, tried to do what the
standard library does. It seems to work, but if someone who knows
Alpha assembly language is listening, it would be nice to know if I
got it right.
Here are the patches for all three problems:
Only in pthreads: alpha_osf_3.0
diff -ru p1-60b3/pthreads/config/alpha-osf1.mk pthreads/config/alpha-osf1.mk
--- p1-60b3/pthreads/config/alpha-osf1.mk Fri Mar 17 07:25:51 1995
+++ pthreads/config/alpha-osf1.mk Mon Oct 9 14:38:06 1995
@@ -1,2 +1,2 @@
# alpha stuff
-SYSCALL_EXCEPTIONS = fork sigsuspend
+SYSCALL_EXCEPTIONS = fork pipe sigsuspend
diff -ru p1-60b3/pthreads/machdep/syscall-alpha-osf1.S pthreads/machdep/syscall-alpha-osf1.S
--- p1-60b3/pthreads/machdep/syscall-alpha-osf1.S Wed Mar 1 01:21:32 1995
+++ pthreads/machdep/syscall-alpha-osf1.S Mon Oct 9 14:39:02 1995
@@ -60,6 +60,16 @@
ret
.end machdep_sys_fork
+
+/* and so is pipe... */
+SYSCALL(pipe)
+ stl v0, 0(a0)
+ bis zero, zero, v0
+ stl a4, 4(a0)
+ ret
+ .end machdep_sys_pipe
+
+
/* So is the sigsuspend system call */
.align 4
.globl machdep_sys_sigsuspend
diff -ru p1-60b3/pthreads/stdio/vfprintf.c pthreads/stdio/vfprintf.c
--- p1-60b3/pthreads/stdio/vfprintf.c Sun Mar 26 00:10:54 1995
+++ pthreads/stdio/vfprintf.c Mon Oct 9 12:05:42 1995
@@ -733,8 +733,12 @@
digits = __dtoa(value, mode, ndigits, decpt, &dsgn, &rve);
#else
{ char *ecvt(double,int,int*,int*);
-
- digits = ecvt(value, ndigits, decpt, &dsgn);
+ char *fcvt(double,int,int*,int*);
+ if (tolower(ch) == 'f') {
+ digits = fcvt(value, ndigits, decpt, &dsgn);
+ } else {
+ digits = ecvt(value, ndigits, decpt, &dsgn);
+ };
rve = (digits + (int)strlen(digits));
}
#endif
Only in pthreads/stdio: vfprintf.c.orig
diff -ru p1-60b3/pthreads/tests/test_stdio_1.c pthreads/tests/test_stdio_1.c
--- p1-60b3/pthreads/tests/test_stdio_1.c Tue Apr 18 03:40:38 1995
+++ pthreads/tests/test_stdio_1.c Mon Oct 9 11:05:36 1995
@@ -4,8 +4,10 @@
#include <stdlib.h>
#include <stdio.h>
-char * basename = "test_stdio_1.c";
-char * dirname = SRCDIR;
+/* basename and dirname are library fns on OSF1 */
+
+char * base_name = "test_stdio_1.c";
+char * dir_name = SRCDIR;
char * fullname;
#define OK 0
@@ -104,8 +106,8 @@
printf("test_stdio_1 START\n");
- if (fullname = malloc (strlen (dirname) + strlen (basename) + 2)) {
- sprintf (fullname, "%s/%s", dirname, basename);
+ if (fullname = malloc (strlen (dir_name) + strlen (base_name) + 2)) {
+ sprintf (fullname, "%s/%s", dir_name, base_name);
} else {
perror ("malloc");
exit(1);
Owen Rees
<rtor@ansa.co.uk>, <URL:http://www.ansa.co.uk/Staff/rtor.html>
Information about ANSA is at <URL:http://www.ansa.co.uk/>.