libc: move read and write to jehanne_ namespace (where they actually belong)

This commit is contained in:
Giacomo Tesio 2019-11-26 00:35:41 +01:00
parent e9e5e59740
commit 361a06f284
4 changed files with 10 additions and 7 deletions

View File

@ -1,7 +1,7 @@
/*
* This file is part of Jehanne.
*
* Copyright (C) 2017 Giacomo Tesio <giacomo@tesio.it>
* Copyright (C) 2017-2019 Giacomo Tesio <giacomo@tesio.it>
*
* Jehanne is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -309,3 +309,5 @@
#define sizeD2M jehanne_sizeD2M
#define dirmodefmt jehanne_dirmodefmt
#define chartorune jehanne_chartorune
#define read(fd, buf, size) jehanne_pread(fd, buf, size, -1)
#define write(fd, buf, size) jehanne_pwrite(fd, buf, size, -1)

View File

@ -614,6 +614,9 @@ extern Waitmsg* jehanne_wait(void);
extern int jehanne_waitpid(void);
extern int jehanne_wstat(const char*, uint8_t*, int);
extern int32_t jehanne_read(int, void*, int32_t);
extern int32_t jehanne_write(int, const void*, int32_t);
extern Dir* jehanne_dirstat(const char*);
extern Dir* jehanne_dirfstat(int);
extern int jehanne_dirwstat(const char*, Dir*);

View File

@ -15,12 +15,11 @@
* You should have received a copy of the GNU General Public License
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
*/
#define PORTABLE_SYSCALLS
#include <u.h>
#include <libc.h>
int
read(int fd, void* buf, int nbytes)
jehanne_read(int fd, void* buf, int nbytes)
{
return pread(fd, buf, nbytes, ~0LL);
return sys_pread(fd, buf, nbytes, ~0LL);
}

View File

@ -15,12 +15,11 @@
* You should have received a copy of the GNU General Public License
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
*/
#define PORTABLE_SYSCALLS
#include <u.h>
#include <libc.h>
int
write(int fd, const void* buf, int nbytes)
jehanne_write(int fd, const void* buf, int nbytes)
{
return pwrite(fd, buf, nbytes, ~0LL);
return sys_pwrite(fd, buf, nbytes, ~0LL);
}