summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/libstdio/fread.c
diff options
context:
space:
mode:
authorMystery Man <unknown@mandriva.org>2002-09-14 18:25:46 +0000
committerMystery Man <unknown@mandriva.org>2002-09-14 18:25:46 +0000
commit40fc236df0b0f5d9f61030264e4c82e88719a52e (patch)
treeb278238b7dc2559c8920bfb8a35f933b7754c7f5 /mdk-stage1/dietlibc/libstdio/fread.c
parentd4079232d73723aab49dfa9d81187a7e8a60bf55 (diff)
downloaddrakx-backup-do-not-use-40fc236df0b0f5d9f61030264e4c82e88719a52e.tar
drakx-backup-do-not-use-40fc236df0b0f5d9f61030264e4c82e88719a52e.tar.gz
drakx-backup-do-not-use-40fc236df0b0f5d9f61030264e4c82e88719a52e.tar.bz2
drakx-backup-do-not-use-40fc236df0b0f5d9f61030264e4c82e88719a52e.tar.xz
drakx-backup-do-not-use-40fc236df0b0f5d9f61030264e4c82e88719a52e.zip
This commit was manufactured by cvs2svn to create tag 'V1_1_9_48mdk'.V1_1_9_48mdk
Diffstat (limited to 'mdk-stage1/dietlibc/libstdio/fread.c')
-rw-r--r--mdk-stage1/dietlibc/libstdio/fread.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/mdk-stage1/dietlibc/libstdio/fread.c b/mdk-stage1/dietlibc/libstdio/fread.c
deleted file mode 100644
index 29afa1489..000000000
--- a/mdk-stage1/dietlibc/libstdio/fread.c
+++ /dev/null
@@ -1,51 +0,0 @@
-#include <sys/types.h>
-#include "dietstdio.h"
-#include <unistd.h>
-
-size_t fread( void *ptr, size_t size, size_t nmemb, FILE *stream) {
- int res;
-#ifdef WANT_BUFFERED_STDIO
- unsigned long i,j;
- j=size*nmemb;
-#ifdef WANT_UNGETC
- if (stream->ungotten) {
- *(char*)ptr=stream->ungetbuf;
- ptr=((char*)ptr)+1;
- --j;
- }
- if (!j) return 1;
-#endif
- for (i=0; i<j; ++i) {
- res=fgetc(stream);
- if (res==EOF)
- return i/size;
- else
- ((unsigned char*)ptr)[i]=(unsigned char)res;
- }
- return nmemb;
-#else
-#ifdef WANT_UNGETC
- unsigned long j=size*nmemb;
-#endif
- fflush(stream);
-#ifdef WANT_UNGETC
- if (stream->ungotten) {
- *(char*)ptr=stream->ungetbuf;
- ptr=((char*)ptr)+1;
- --j;
- }
- if (!j) return 1;
- res=read(stream->fd,ptr,j);
-#else
- res=read(stream->fd,ptr,size*nmemb);
-#endif
- if (res<0) {
- stream->flags|=ERRORINDICATOR;
- return 0;
- } else if (res<size*nmemb)
- if (!(stream->flags & UNSEEKABLE)
- || ((stream->flags & UNSEEKABLE) && res == 0))
- stream->flags|=EOFINDICATOR;
- return res/size;
-#endif
-}