From 7a9a26813e387c4c6f73635bd04a005cfc0e2c08 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 24 Jul 2002 11:18:48 +0000 Subject: Update. 2002-07-22 Philip Blundell * sysdeps/unix/sysv/linux/arm/errlist.c: Remove extra weak alias definiton of _old_sys_nerr. Define _old_sys_errlist as strong alias. --- libio/bug-fseek.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'libio/bug-fseek.c') diff --git a/libio/bug-fseek.c b/libio/bug-fseek.c index d8cd712..1b60580 100644 --- a/libio/bug-fseek.c +++ b/libio/bug-fseek.c @@ -90,5 +90,34 @@ Got %d instead\n", fclose (f); + + if ((f = fopen (fname, "r+")) == (FILE *) NULL) + { + perror ("fopen(\"r+\")"); + } + + fread (buf, 3, 1, f); + if (ftell (f) != 3) + { + puts ("ftell failed"); + return 1; + } + errno = 0; + if (fseek (f, -10, SEEK_CUR) == 0) + { + printf ("fseek() for r+ to before start of file worked!\n"); + result = 1; + } + else if (errno != EINVAL) + { + printf ("\ +fseek() for r+ to before start of file did not set errno to EINVAL. \ +Got %d instead\n", + errno); + result = 1; + } + + fclose (f); + return result; } -- cgit v1.1