diff -u ./gllib/fbufmode.c.orig ./gllib/fbufmode.c
--- ./gllib/fbufmode.c.orig	2010-01-01 03:50:43.000000000 -0600
+++ ./gllib/fbufmode.c	2010-12-22 04:32:01.000000000 -0600
@@ -77,6 +77,12 @@
   if (fp->__linebuf)
     return _IOLBF;
   return (fp->__bufsize > 0 ? _IOFBF : _IONBF);
+#elif defined __TANDEM /* HP-NonStop */
+  if (fp->_flag & _IOLBF)
+    return _IOLBF;
+  if (fp->_flag & _IONBF)
+    return _IONBF;
+  return _IOFBF;
 #else
  #error "Please port gnulib fbufmode.c to your platform! Look at the setvbuf implementation."
 #endif
diff -u ./gllib/fpurge.c.orig ./gllib/fpurge.c
--- ./gllib/fpurge.c.orig	2010-01-01 03:50:43.000000000 -0600
+++ ./gllib/fpurge.c	2010-12-22 03:09:06.000000000 -0600
@@ -129,6 +129,11 @@
   /* Nothing in the buffer, next putc is nontrivial.  */
   fp->__put_limit = fp->__buffer;
   return 0;
+# elif defined __TANDEM /* HP-NonStop */
+  fp->_ptr = fp->_base;
+  if (fp->_ptr != NULL)
+    fp->_cnt = 0;
+  return 0;
 # else
  #error "Please port gnulib fpurge.c to your platform! Look at the definitions of fflush, setvbuf and ungetc on your system, then report this to bug-gnulib."
 # endif
diff -u ./gllib/freadable.c.orig ./gllib/freadable.c
--- ./gllib/freadable.c.orig	2010-01-01 03:50:43.000000000 -0600
+++ ./gllib/freadable.c	2010-12-22 04:31:16.000000000 -0600
@@ -39,6 +39,13 @@
   return (fp->_Mode & 0x1 /* _MOPENR */) != 0;
 #elif defined __MINT__              /* Atari FreeMiNT */
   return fp->__mode.__read;
+#elif defined __TANDEM /* HP-NonStop */
+#if 0 /* ToDo: find out what _IORW and _IOREAD are for us */
+  return (fp->_flag & (_IORW | _IOREAD)) != 0;
+#else
+ #warning "Please port gnulib freadable.c to your platform! Look at the definition of fopen, fdopen on your system, then report this to bug-gnulib."
+  return 0;
+#endif
 #else
  #error "Please port gnulib freadable.c to your platform! Look at the definition of fopen, fdopen on your system, then report this to bug-gnulib."
 #endif
diff -u ./gllib/freadahead.c.orig ./gllib/freadahead.c
--- ./gllib/freadahead.c.orig	2010-01-01 03:50:43.000000000 -0600
+++ ./gllib/freadahead.c	2010-12-22 03:47:53.000000000 -0600
@@ -76,6 +76,12 @@
   return (fp->__pushed_back
           ? fp->__get_limit - fp->__pushback_bufp + 1
           : fp->__get_limit - fp->__bufp);
+#elif defined __TANDEM /* HP-NonStop */
+#if 0 /* ToDo: find out what _IOWRT is for us */
+  if ((fp_->_flag & _IOWRT) != 0)
+    return 0;
+#endif
+  return fp->_cnt;
 #elif defined SLOW_BUT_NO_HACKS     /* users can define this */
   abort ();
   return 0;
diff -u ./gllib/freading.c.orig ./gllib/freading.c
--- ./gllib/freading.c.orig	2010-12-22 04:32:57.000000000 -0600
+++ ./gllib/freading.c	2010-12-22 04:33:41.000000000 -0600
@@ -60,6 +60,14 @@
 # else
   return (fp->__buffer < fp->__get_limit /*|| fp->__bufp == fp->__put_limit ??*/);
 # endif
+#elif defined __TANDEM /* HP-NonStop */
+#if 0 /* ToDo: find out what _IOREAD is for us */
+  return (fp->_flag & _IOREAD) != 0;
+#else
+ #warning "Please port gnulib freading.c to your platform!"
+  return 0;
+#endif
+#else
  #error "Please port gnulib freading.c to your platform!"
 #endif
 }
diff -u ./gllib/freadptr.c.orig ./gllib/freadptr.c
--- ./gllib/freadptr.c.orig	2010-01-01 03:50:43.000000000 -0600
+++ ./gllib/freadptr.c	2010-12-22 03:51:12.000000000 -0600
@@ -93,6 +93,16 @@
     return NULL;
   *sizep = size;
   return fp->__bufp;
+#elif defined __TANDEM /* HP-NonStop */
+#if 0 /* ToDo: find out what _IOWTR is for us */
+  if ((fp_->_flag & _IOWRT) != 0)
+    return NULL;
+#endif
+  size = fp->_cnt;
+  if (size == 0)
+    return NULL;
+  *sizep = size;
+  return (const char *) fp->_ptr;
 #elif defined SLOW_BUT_NO_HACKS     /* users can define this */
   /* This implementation is correct on any ANSI C platform.  It is just
      awfully slow.  */
diff -u ./gllib/freadseek.c.orig ./gllib/freadseek.c
--- ./gllib/freadseek.c.orig	2010-01-01 03:50:43.000000000 -0600
+++ ./gllib/freadseek.c	2010-12-22 02:58:20.000000000 -0600
@@ -55,6 +55,9 @@
   fp->_Next += increment;
 #elif defined __MINT__              /* Atari FreeMiNT */
   fp->__bufp += increment;
+#elif defined __TANDEM /* HP-NonStop */
+  fp->_ptr += increment;
+  fp->_cnt -= increment;
 #elif defined SLOW_BUT_NO_HACKS     /* users can define this */
 #else
  #error "Please port gnulib freadseek.c to your platform! Look at the definition of getc, getc_unlocked on your system, then report this to bug-gnulib."
diff -u ./gllib/fseterr.c.orig ./gllib/fseterr.c
--- ./gllib/fseterr.c.orig	2010-01-01 03:50:43.000000000 -0600
+++ ./gllib/fseterr.c	2010-12-22 03:07:07.000000000 -0600
@@ -43,6 +43,8 @@
   fp->_Mode |= 0x200 /* _MERR */;
 #elif defined __MINT__              /* Atari FreeMiNT */
   fp->__error = 1;
+#elif defined __TANDEM /* HP-NonStop */
+  fp->_flag |= 64; /* _IOERR found by experiment ... */
 #elif 0                             /* unknown  */
   /* Portable fallback, based on an idea by Rich Felker.
      Wow! 6 system calls for something that is just a bit operation!
diff -u ./gllib/fwritable.c.orig ./gllib/fwritable.c
--- ./gllib/fwritable.c.orig	2010-01-01 03:50:43.000000000 -0600
+++ ./gllib/fwritable.c	2010-12-22 03:56:00.000000000 -0600
@@ -39,6 +39,13 @@
   return (fp->_Mode & 0x2 /* _MOPENW */) != 0;
 #elif defined __MINT__              /* Atari FreeMiNT */
   return fp->__mode.__write;
+#elif defined __TANDEM /* HP-NonStop */
+# if 0 /* ToDo: find out what _IORW and _IOWRT are for us */
+  return (fp->_flag & (_IORW | _IOWRT)) != 0;
+# else
+ #warning "Please port gnulib fwritable.c to your platform! Look at the definition of fopen, fdopen on your system, then report this to bug-gnulib."
+  return 0;
+# endif
 #else
  #error "Please port gnulib fwritable.c to your platform! Look at the definition of fopen, fdopen on your system, then report this to bug-gnulib."
 #endif
diff -u ./gllib/fwriting.c.orig ./gllib/fwriting.c
--- ./gllib/fwriting.c.orig	2010-01-01 03:50:43.000000000 -0600
+++ ./gllib/fwriting.c	2010-12-22 03:56:53.000000000 -0600
@@ -50,6 +50,13 @@
 # else
   return (fp->__buffer < fp->__put_limit /*|| fp->__bufp == fp->__get_limit ??*/);
 # endif
+#elif defined __TANDEM /* HP-NonStop */
+# if 0 /* ToDo: find out what _IOWTR is for us */
+  return (fp->_flag & _IOWRT) != 0;
+# else
+ #warning "Please port gnulib fwriting.c to your platform!"
+  return 0;
+# endif
 #else
  #error "Please port gnulib fwriting.c to your platform!"
 #endif
