From 69ecab2634d3f5a825e0baaa310ba048d5aed3b5 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 3 Mar 2021 00:34:02 +0000 Subject: [linux] Use fstat() rather than statx() The statx() system call has a clean header file and a consistent layout, but was unfortunately added only in kernel 4.11. Using stat() or fstat() directly is extremely messy since glibc does not necessarily use the kernel native data structures. However, as the only current use case is to obtain the length of an open file, we can merely provide a wrapper that does precisely this. Signed-off-by: Michael Brown --- src/include/ipxe/linux_api.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/include') diff --git a/src/include/ipxe/linux_api.h b/src/include/ipxe/linux_api.h index ab2e8014d..5b0b242d1 100644 --- a/src/include/ipxe/linux_api.h +++ b/src/include/ipxe/linux_api.h @@ -46,7 +46,6 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include -#include #define MAP_FAILED ( ( void * ) -1 ) #endif @@ -66,8 +65,7 @@ extern ssize_t __asmcall linux_read ( int fd, void *buf, size_t count ); extern ssize_t __asmcall linux_write ( int fd, const void *buf, size_t count ); extern int __asmcall linux_fcntl ( int fd, int cmd, ... ); extern int __asmcall linux_ioctl ( int fd, unsigned long request, ... ); -extern int __asmcall linux_statx ( int dirfd, const char *pathname, int flags, - unsigned int mask, struct statx *statxbuf ); +extern int __asmcall linux_fstat_size ( int fd, size_t *size ); extern int __asmcall linux_poll ( struct pollfd *fds, unsigned int nfds, int timeout ); extern int __asmcall linux_nanosleep ( const struct timespec *req, -- cgit v1.2.3-55-g7522