Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/modules/klibc/fread.c

Source at commit 1406 created 12 years 10 months ago.
By meklort, Revert drivers.c so that kexts are only loaded when OSBundleRequired is set and that value is not safe mode. Added some comments about it too.
1/*
2 * fread.c
3 */
4
5#include <errno.h>
6#include <unistd.h>
7#include <stdio.h>
8
9size_t _fread(void *buf, size_t count, FILE *f)
10{
11printf("WARNING: fread not implimented.\n");
12return 0;
13#if 0
14size_t bytes = 0;
15ssize_t rv;
16char *p = buf;
17
18while (count) {
19rv = read(fileno(f), p, count);
20if (rv == -1) {
21if (errno == EINTR) {
22errno = 0;
23continue;
24} else
25break;
26} else if (rv == 0) {
27break;
28}
29
30p += rv;
31bytes += rv;
32count -= rv;
33}
34
35return bytes;
36#endif
37}
38

Archive Download this file

Revision: 1406