diff options
| author | Michael Brown | 2021-03-03 00:37:41 +0100 |
|---|---|---|
| committer | Michael Brown | 2021-03-03 00:59:30 +0100 |
| commit | 5c8a9905ce3b04a4317d356d5481552fd17b63cb (patch) | |
| tree | 5b9c13b219632bb6171fe6acc5dcfd505ae1c27d /src/interface/linux/linux_api.c | |
| parent | [linux] Free cached ACPI tables on shutdown (diff) | |
| download | ipxe-5c8a9905ce3b04a4317d356d5481552fd17b63cb.tar.gz ipxe-5c8a9905ce3b04a4317d356d5481552fd17b63cb.tar.xz ipxe-5c8a9905ce3b04a4317d356d5481552fd17b63cb.zip | |
[linux] Add a generic function for reading files from sysfs
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface/linux/linux_api.c')
| -rw-r--r-- | src/interface/linux/linux_api.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/interface/linux/linux_api.c b/src/interface/linux/linux_api.c index fa694330e..6fa2b0e76 100644 --- a/src/interface/linux/linux_api.c +++ b/src/interface/linux/linux_api.c @@ -32,6 +32,7 @@ #include <sys/mman.h> #include <sys/socket.h> #include <sys/time.h> +#include <sys/stat.h> #include <netinet/in.h> #include <ipxe/linux_api.h> #include <ipxe/slirp.h> @@ -199,6 +200,20 @@ int __asmcall linux_ioctl ( int fd, unsigned long request, ... ) { } /** + * Wrap statx() + * + */ +int __asmcall linux_statx ( int dirfd, const char *pathname, int flags, + unsigned int mask, struct statx *statxbuf ) { + int ret; + + ret = statx ( dirfd, pathname, flags, mask, statxbuf ); + if ( ret == -1 ) + linux_errno = errno; + return ret; +} + +/** * Wrap poll() * */ @@ -516,6 +531,7 @@ PROVIDE_IPXE_SYM ( linux_read ); PROVIDE_IPXE_SYM ( linux_write ); PROVIDE_IPXE_SYM ( linux_fcntl ); PROVIDE_IPXE_SYM ( linux_ioctl ); +PROVIDE_IPXE_SYM ( linux_statx ); PROVIDE_IPXE_SYM ( linux_poll ); PROVIDE_IPXE_SYM ( linux_nanosleep ); PROVIDE_IPXE_SYM ( linux_usleep ); |
