summaryrefslogtreecommitdiff
path: root/lib/fseek.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2007-05-28 14:48:52 +0000
committerBruno Haible <bruno@clisp.org>2007-05-28 14:48:52 +0000
commitcab1c5a2da80863739e730225ee4c1842b05e217 (patch)
treeb6f6abe078440c78857e5b773482c3c90670dc6a /lib/fseek.c
parent97c12f59197ed29353e1dde89db3af59bcb3e1ff (diff)
downloadgnulib-cab1c5a2da80863739e730225ee4c1842b05e217.tar.gz
New module 'fseek'.
Diffstat (limited to 'lib/fseek.c')
-rw-r--r--lib/fseek.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/fseek.c b/lib/fseek.c
new file mode 100644
index 0000000000..4afa0db8ab
--- /dev/null
+++ b/lib/fseek.c
@@ -0,0 +1,31 @@
+/* An fseek() function that, together with fflush(), is POSIX compliant.
+ Copyright (C) 2007 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdio.h>
+
+/* Get off_t. */
+#include <unistd.h>
+
+int
+fseek (FILE *fp, long offset, int whence)
+{
+ /* Use the replacement fseeko function with all its workarounds. */
+ return fseeko (fp, (off_t)offset, whence);
+}