lseek: Use lseek64 is arch does not have the lseek syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
getdents: Use getdents64 if arch does not have the getdents syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
statfs: Use statfs64 if arch does not have the statfs syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
fstat: Use fstat64 if arch does not have the fstat syscall
fstatat: Use newfstatat only for 64-bit operations

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
fstatat64: Use newfstatat only for 64-bit operations

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
fstatat{64}: No conversion code is needed for new architectures

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
stat64: Use fstatat64 if arch does not have the stat64 syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
lstat: Use fstatat64 if arch does not have the lstat syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
lstat64: Use fstatat64 if arch does not have the lstat64 syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
ustat: Add ustat stub for arches that don't have the ustat system call

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
stat: Use fstatat64 if arch does not have the stat syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
fstatfs: Add __libc_fstatfs wrapper

New architectures don't have fstatfs anymore, so we use a wrapper for
__libc_fstatfs which will use fstatfs64 internally. The interface however
needs to remain the same (i.e accepting a struct statfs as a second
argument) for backwards compatibility

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
fstatfs64: Prefer fstatfs64 system call instead of __libc_fstatfs

Using __libc_fstatfs for fstatfs64 adds a small delay as it needs to
use a 32-bit data structure to get the file info and them pass them to
the 64-bit data structure which was given as a fstatfs64 argument. Using
the system call directly should make the entire process much faster.
Also fix the arguments for fstatfs64. It takes three arguments
(see fs/fstatfs.c in Linux kernel sources) so despite what the manpage
says, the size of the buffer needs to be passed as the second argument

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
fcntl: Use fcntl64 is arch does not have the fcntl syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
open64: Use openat if arch does not have the open syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
not-cancel.h: Use openat if arch does not have the open syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
open: Use openat if arch does not have the open syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
ldso: Use newer syscalls if arch does not have the deprecated syscalls

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
libc/ipc: Allow architectures to define their own __IPC_64 macro

New architectures don't define ARCH_WANT_IPC_PARSE_VERSION in their kernel.
This means that every cmd passed to semctl,msgctl and shmctl is IPC_64 by
default. For these architectures we need to define __IPC_64 as 0. Existing
architectures are not affected by this change.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>