chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] klibc: strlcpy/strlcat - don't alter destination if size == 0
[elogind.git]
/
klibc
/
klibc
/
llseek.c
diff --git
a/klibc/klibc/llseek.c
b/klibc/klibc/llseek.c
index fdffc16e2ce272bd8e280925a4260917fed70eba..857490b3782aeb5df68add1e70f4bc90c998ea97 100644
(file)
--- a/
klibc/klibc/llseek.c
+++ b/
klibc/klibc/llseek.c
@@
-1,33
+1,29
@@
/*
* llseek.c
*
/*
* llseek.c
*
- * On 32-bit platforms, we need llseek() as well as lseek() to be
- * able to handle large disks
+ * On 32-bit platforms, we need to use the _llseek() system call
+ * rather than lseek(), to be able to handle large disks. _llseek()
+ * isn't just a normal syscall which takes a 64-bit argument; it needs
+ * to return a 64-bit value and so takes an extra pointer.
*/
#include <unistd.h>
#include <sys/syscall.h>
*/
#include <unistd.h>
#include <sys/syscall.h>
+#include <bitsize.h>
-#if BITSIZE == 32
+#if
_
BITSIZE == 32
-
static inline _syscall5(int, _llseek, int, fd, unsigned long, hi, unsigned long, lo, loff_t *,res, int,
whence);
+
extern int __llseek(int fd, unsigned long hi, unsigned long lo, off_t *res, int
whence);
-
loff_t llseek(int fd, l
off_t offset, int whence)
+
off_t lseek(int fd,
off_t offset, int whence)
{
{
-
l
off_t result;
+ off_t result;
int rv;
int rv;
- rv = _
llseek(fd, (unsigned long)(offset >> 32)
,
-
(unsigned long)offset,
&result, whence);
+ rv = _
_llseek(fd, (unsigned long)(offset >> 32), (unsigned long)offset
,
+ &result, whence);
- return rv ? (loff_t)-1 : result;
-}
-
-#else
-
-loff_t llseek(int fd, loff_t offset, int whence)
-{
- return lseek(fd, offset, whence);
+ return rv ? (off_t)-1 : result;
}
#endif
}
#endif