[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: porting stdioext to HP-NonStop

From: Bruno Haible
Subject: Re: porting stdioext to HP-NonStop
Date: Wed, 22 Dec 2010 15:36:53 +0100
User-agent: KMail/1.9.9

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 (address@hidden),
> 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


#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

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]