Hi Bruno Yes it does look similar to HP-UX, OSF/1, so wherever I could I copied that code.
$ ./stdioext-flags #define _IOERR 0x40 #define _IOREAD 0x80 #define _IOWRT 0x4 #define _IORW 0x100 #define _IORW 0x100 Very nice. Downloaded, unpacked, modified gllib/stdio-impl.h as per above, configured, compiled, checked, all 33 tests passed! Time for checking I guess? I once tried, but failed, can you give me a full testdir with all gnulib features to run and check? So that we can get this 'strange' platform sorted once and forever? Bye, Jojo -----Original Message----- From: Bruno Haible [mailto:br...@clisp.org] Sent: Wednesday, December 22, 2010 3:37 PM To: Joachim Schmitz Cc: bug-gnulib@gnu.org; 'Eric Blake'; 'Chet Ramey' Subject: Re: porting stdioext to HP-NonStop Hi Joachim, > I believe I did this earlier and sent you some patches, back in early > October this year and from my company email account (schm...@hp.com), > in connection with getting ACL support to work for HP-NonStop. Yes, but there were too many TODOs in these patches, and you didn't use a testdir with test suite at that time. > I'm not sure how to go forward. 'make check' reports 4 failures, due to > failed assertions: > /usr/local/Floss/testdir-stdioext/gltests/test-freadable.c:52: > assertion failed > /usr/local/Floss/testdir-stdioext/gltests/test-freading.c:48: > assertion failed > /usr/local/Floss/testdir-stdioext/gltests/test-fwritable.c:41: > assertion failed > /usr/local/Floss/testdir-stdioext/gltests/test-fwriting.c:41: > assertion failed But it's interesting to see that your at some tests work. > I found no hints in stdio.h about these (attached too, in the hope you > can see something there) Thanks for this attachment. The 'FILE' structure looks quite similar to the one of AIX, HP-UX, and OSF/1. So there's a good chance that the code that we use for AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw will also work on NonStop Kernel. > The Problem is I don't know that the proper values for _IORW, _IOREAD, > _IOWRT are, for _IOERR I believe to have found it to be 64 on our > platform by experiment. Please run this program and send us the result: =========================== stdioext-flags.c =========================== #include <stdio.h> int main() { FILE *fp; int flags1, flags2, flags3, flags4, flags5, flags6, flags7; int i; char buf[80]; fp = fopen ("test1234", "w"); flags1 = fp->_flag; fwrite ("foo", 1, 3, fp); flags2 = fp->_flag; for (i = 0; i < 10000; i++) fwrite ("x", 1, 1, fp); fclose (fp); fp = fopen ("test1234", "r"); flags3 = fp->_flag; fgetc (fp); flags4 = fp->_flag; close (fp->_file); for (i = 0; i < 10000; i++) fread (buf, 1, 1, fp); flags5 = fp->_flag; fclose (fp); fp = fopen ("test1234", "r+w"); flags6 = fp->_flag; fgetc (fp); flags7 = fp->_flag; printf ("#define _IOERR 0x%X\n", flags5 & ~flags4); printf ("#define _IOREAD 0x%X\n", flags3); printf ("#define _IOWRT 0x%X\n", flags1); printf ("#define _IORW 0x%X\n", flags6); printf ("#define _IORW 0x%X\n", flags7 & ~flags4); return 0; } ======================================================================= For comparison, the output on AIX, Solaris, mingw: #define _IOERR 0x20 #define _IOREAD 0x1 #define _IOWRT 0x2 #define _IORW 0x80 #define _IORW 0x80 On HP-UX: #define _IOERR 0x20 #define _IOREAD 0x1 #define _IOWRT 0x2 #define _IORW 0x100 #define _IORW 0x100 On OSF/1: #define _IOERR 0x0 /* this one is not correct */ #define _IOREAD 0x1 #define _IOWRT 0x2 #define _IORW 0x100 #define _IORW 0x100 Then, please unpack the new tarball at http://www.haible.de/bruno/gnu/testdir-stdioext.tar.gz Replace the values in gllib/stdio-impl.h lines 80..83 with the values the program produced, then configure, build, and "make check" this testdir. Thanks! Bruno