aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaximilian attems <max@stro.at>2011-08-31 00:57:06 +0200
committermaximilian attems <max@stro.at>2011-08-31 01:04:16 +0200
commit03f82fe5b7e3f39464a0fa499a315dc74837b63c (patch)
treeefeb3259d09a99c5f5932798707caa0b6ab21b7c
parent6c4e51f74c0c88be32e149b6293f578e1a394642 (diff)
downloadklibc-03f82fe5b7e3f39464a0fa499a315dc74837b63c.tar.gz
[klibc] f{open,read,write}: Retire the older sources
__create_file is no longer around. They are no longer referenced in Kbuild and thus not built. Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r--usr/klibc/fopen.c39
-rw-r--r--usr/klibc/fread.c33
-rw-r--r--usr/klibc/fwrite.c33
3 files changed, 0 insertions, 105 deletions
diff --git a/usr/klibc/fopen.c b/usr/klibc/fopen.c
deleted file mode 100644
index 6fa80d7b99f95..0000000000000
--- a/usr/klibc/fopen.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * fopen.c
- */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-/* This depends on O_RDONLY == 0, O_WRONLY == 1, O_RDWR == 2 */
-
-FILE *fopen(const char *file, const char *mode)
-{
- int flags = O_RDONLY;
- int plus = 0;
-
- while (*mode) {
- switch (*mode++) {
- case 'r':
- flags = O_RDONLY;
- break;
- case 'w':
- flags = O_WRONLY | O_CREAT | O_TRUNC;
- break;
- case 'a':
- flags = O_WRONLY | O_CREAT | O_APPEND;
- break;
- case '+':
- plus = 1;
- break;
- }
- }
-
- if (plus) {
- flags = (flags & ~(O_RDONLY | O_WRONLY)) | O_RDWR;
- }
-
- /* Note: __create_file(-1) == NULL, so this is safe */
- return __create_file(open(file, flags, 0666));
-}
diff --git a/usr/klibc/fread.c b/usr/klibc/fread.c
deleted file mode 100644
index b9433aa9a209b..0000000000000
--- a/usr/klibc/fread.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * fread.c
- */
-
-#include <errno.h>
-#include <unistd.h>
-#include <stdio.h>
-
-size_t _fread(void *buf, size_t count, FILE *f)
-{
- size_t bytes = 0;
- ssize_t rv;
- char *p = buf;
-
- while (count) {
- rv = read(fileno(f), p, count);
- if (rv == -1) {
- if (errno == EINTR) {
- errno = 0;
- continue;
- } else
- break;
- } else if (rv == 0) {
- break;
- }
-
- p += rv;
- bytes += rv;
- count -= rv;
- }
-
- return bytes;
-}
diff --git a/usr/klibc/fwrite.c b/usr/klibc/fwrite.c
deleted file mode 100644
index cba8de85ceadc..0000000000000
--- a/usr/klibc/fwrite.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * fwrite.c
- */
-
-#include <errno.h>
-#include <unistd.h>
-#include <stdio.h>
-
-size_t _fwrite(const void *buf, size_t count, FILE *f)
-{
- size_t bytes = 0;
- ssize_t rv;
- const char *p = buf;
-
- while (count) {
- rv = write(fileno(f), p, count);
- if (rv == -1) {
- if (errno == EINTR) {
- errno = 0;
- continue;
- } else
- break;
- } else if (rv == 0) {
- break;
- }
-
- p += rv;
- bytes += rv;
- count -= rv;
- }
-
- return bytes;
-}