diff options
author | dzwdz | 2022-08-04 23:06:57 +0200 |
---|---|---|
committer | dzwdz | 2022-08-04 23:06:57 +0200 |
commit | ce00d1677d7a419b427e7f11963eee982a55a231 (patch) | |
tree | 2662c3861226f6909b83d57ff8b6ac3b2ba5ec8d /src/user/lib/file.c | |
parent | 26dc784103914b9d6ba36e0a96fa4b3af977626f (diff) |
do some simple TODOs, organize the rest; general code maintainance
Diffstat (limited to 'src/user/lib/file.c')
-rw-r--r-- | src/user/lib/file.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/user/lib/file.c b/src/user/lib/file.c index ffea99b..84242b2 100644 --- a/src/user/lib/file.c +++ b/src/user/lib/file.c @@ -115,7 +115,6 @@ size_t fread(void *restrict ptr, size_t size, size_t nitems, FILE *restrict f) { return 0; while (pos < total) { - // TODO shouldn't repeat reads long res = _syscall_read(f->fd, buf + pos, total - pos, f->pos); if (res < 0) { f->error = true; @@ -184,7 +183,6 @@ int fseek(FILE *f, long offset, int whence) { break; case SEEK_END: f->pos = -1; - // TODO doesn't -1 put the cursor before the last byte? i need to fix up the drivers break; default: errno = EINVAL; @@ -194,7 +192,8 @@ int fseek(FILE *f, long offset, int whence) { bool pos_neg = f->pos < 0; f->pos += offset; if (pos_neg && f->pos >= 0) { - errno = ENOSYS; // TODO + // TODO getting the file size + errno = ENOSYS; return -1; } f->eof = false; |