summaryrefslogtreecommitdiff
path: root/lib/fseterr.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2007-03-10 16:08:20 +0000
committerBruno Haible <bruno@clisp.org>2007-03-10 16:08:20 +0000
commit94fe90cc97104818d2187b82cc918a2fc929dd5a (patch)
treef8ded57ec614ae7449f36f7333591b275f9936c5 /lib/fseterr.c
parent67323e00d04e4790947f0f0b0ac8c244769008a2 (diff)
downloadgnulib-94fe90cc97104818d2187b82cc918a2fc929dd5a.tar.gz
Avoid using the fallback implementation; prefer porting efforts.
Diffstat (limited to 'lib/fseterr.c')
-rw-r--r--lib/fseterr.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/fseterr.c b/lib/fseterr.c
index 3f876155b3..52b47273e5 100644
--- a/lib/fseterr.c
+++ b/lib/fseterr.c
@@ -33,10 +33,17 @@ fseterr (FILE *fp)
#elif defined __sferror /* FreeBSD, NetBSD, OpenBSD, MacOS X, Cygwin */
fp->_flags |= __SERR;
#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */
+# if defined __sun && defined __sparc && defined _LP64 /* Solaris/SPARC 64-bit */
+ ((unsigned int *) fp) [9] |= 0x20;
+# else
fp->_flag |= _IOERR;
-#else /* unknown */
+# endif
+#elif 0 /* unknown */
/* Portable fallback, based on an idea by Rich Felker.
- Wow! 6 system calls for something that is just a bit operation! */
+ Wow! 6 system calls for something that is just a bit operation!
+ Not activated on any system, because there is no way to repair FP when
+ the sequence of system calls fails, and library code should not call
+ abort(). */
int saved_errno;
int fd;
int fd2;
@@ -56,5 +63,7 @@ fseterr (FILE *fp)
close (fd2);
}
errno = saved_errno;
+#else
+ #error "Please port gnulib fseterr.c to your platform! Look at the definitions of ferror and clearerr on your system, then report this to bug-gnulib."
#endif
}