mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-16 17:22:44 +03:00
Revert "Fix RISC OS not having a pread/pwrite implementation."
This reverts commit 82c7a7a4ba
.
Conflicts:
content/fs_backing_store.c
This commit is contained in:
parent
576b1c55bf
commit
47d08b6506
@ -35,8 +35,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "utils/config.h"
|
||||
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -59,19 +59,6 @@ char *strcasestr(const char *haystack, const char *needle);
|
||||
char *strchrnul(const char *s, int c);
|
||||
#endif
|
||||
|
||||
/* Although these are in POSIX and implemented most places, RISC OS is
|
||||
* missing them.
|
||||
*/
|
||||
#if (defined(riscos))
|
||||
#undef HAVE_PREAD
|
||||
#undef HAVE_PWRITE
|
||||
ssize_t pread(int fd, void *buf, size_t count, off_t offset);
|
||||
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
|
||||
#else
|
||||
#define HAVE_PREAD
|
||||
#define HAVE_PWRITE
|
||||
#endif
|
||||
|
||||
#define HAVE_SYS_SELECT
|
||||
#define HAVE_INETATON
|
||||
#if (defined(_WIN32))
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include <regex.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "utils/config.h"
|
||||
#include "utils/log.h"
|
||||
@ -629,34 +628,3 @@ nserror nsc_snptimet(char *str, size_t size, time_t *timep)
|
||||
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
#ifndef HAVE_PREAD
|
||||
|
||||
ssize_t pread(int fd, void *buf, size_t count, off_t offset)
|
||||
{
|
||||
off_t sk;
|
||||
|
||||
sk = lseek(fd, offset, SEEK_SET);
|
||||
if (sk == -1) {
|
||||
return (off_t)-1;
|
||||
}
|
||||
return read(fd, buf, count);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAVE_PWRITE
|
||||
|
||||
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset)
|
||||
{
|
||||
off_t sk;
|
||||
|
||||
sk = lseek(fd, offset, SEEK_SET);
|
||||
if (sk == (off_t)-1) {
|
||||
return -1;
|
||||
}
|
||||
return write(fd, buf, count);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user