diff options
author | Bruno Haible <bruno@clisp.org> | 2007-05-28 14:48:52 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2007-05-28 14:48:52 +0000 |
commit | cab1c5a2da80863739e730225ee4c1842b05e217 (patch) | |
tree | b6f6abe078440c78857e5b773482c3c90670dc6a /lib/fseek.c | |
parent | 97c12f59197ed29353e1dde89db3af59bcb3e1ff (diff) | |
download | gnulib-cab1c5a2da80863739e730225ee4c1842b05e217.tar.gz |
New module 'fseek'.
Diffstat (limited to 'lib/fseek.c')
-rw-r--r-- | lib/fseek.c | 31 |
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); +} |