[332] in Pthreads mailing list archive
Patch for Linux a.out / libc version 4.6.27
daemon@ATHENA.MIT.EDU (Stefan Schafroth)
Fri Jun 7 06:03:47 1996
Date: Fri, 7 Jun 1996 11:32:11 +0200
From: Stefan Schafroth <schafrot@physik.unizh.ch>
To: pthreads@MIT.EDU
The following patch is necessary on a Linux a.out system using libc version
4.6.27. I know this combination is not 'state of the art' :-), but now
GNAT 3.04 tasking works.
I got the right names for the standard file variables from /usr/include/libio.h
where we have the lines:
extern struct _IO_FILE_plus _IO_stdin_, _IO_stdout_, _IO_stderr_;
#define _IO_stdin ((_IO_FILE*)(&_IO_stdin_))
#define _IO_stdout ((_IO_FILE*)(&_IO_stdout_))
#define _IO_stderr ((_IO_FILE*)(&_IO_stderr_))
Perhaps this patch should be applied by 'configure' when the above situation
exists.
--- stdio/findfp.c.orig Fri Jun 7 10:51:38 1996
+++ stdio/findfp.c Fri Jun 7 10:52:58 1996
@@ -65,8 +65,10 @@
std(__SWR|__SNBF, 2) /* stderr */
};
struct glue __sglue = { &uglue, 3, __sF };
-FILE *__iob = __sF;
-FILE *_iob = __sF;
+
+FILE _IO_stdin_ = std(__SRD, 0); /* stdin */
+FILE _IO_stdout_ = std(__SWR, 1); /* stdout */
+FILE _IO_stderr_ = std(__SWR|__SNBF, 2); /* stderr */
pthread_mutex_t __sfp_mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t __sfp_cond = PTHREAD_COND_INITIALIZER;