libc: move read and write to jehanne_ namespace (where they actually belong)
This commit is contained in:
parent
e9e5e59740
commit
361a06f284
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This file is part of Jehanne.
|
* 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
|
* Jehanne is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -309,3 +309,5 @@
|
||||||
#define sizeD2M jehanne_sizeD2M
|
#define sizeD2M jehanne_sizeD2M
|
||||||
#define dirmodefmt jehanne_dirmodefmt
|
#define dirmodefmt jehanne_dirmodefmt
|
||||||
#define chartorune jehanne_chartorune
|
#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)
|
||||||
|
|
|
@ -614,6 +614,9 @@ extern Waitmsg* jehanne_wait(void);
|
||||||
extern int jehanne_waitpid(void);
|
extern int jehanne_waitpid(void);
|
||||||
extern int jehanne_wstat(const char*, uint8_t*, int);
|
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_dirstat(const char*);
|
||||||
extern Dir* jehanne_dirfstat(int);
|
extern Dir* jehanne_dirfstat(int);
|
||||||
extern int jehanne_dirwstat(const char*, Dir*);
|
extern int jehanne_dirwstat(const char*, Dir*);
|
||||||
|
|
|
@ -15,12 +15,11 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#define PORTABLE_SYSCALLS
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <libc.h>
|
||||||
|
|
||||||
int
|
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,12 +15,11 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#define PORTABLE_SYSCALLS
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <libc.h>
|
||||||
|
|
||||||
int
|
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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue