summaryrefslogtreecommitdiffstats
path: root/src/interface/linux/linux_sysfs.c
Commit message (Collapse)AuthorAgeFilesLines
* [uaccess] Remove trivial uses of userptr_tMichael Brown2025-04-241-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uaccess] Remove redundant user_to_virt()Michael Brown2025-04-211-2/+1Star
| | | | | | | | | The user_to_virt() function is now a straightforward wrapper around addition, with the addend almost invariably being zero. Remove this redundant wrapper. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Do not assume that stat() works on sysfs filesMichael Brown2021-03-031-29/+20Star
| | | | | | | | Linux kernel 3.12 and earlier report a zero size via stat() for all ACPI table files in sysfs. There is no way to determine the file size other than by reading the file until EOF. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Use fstat() rather than statx()Michael Brown2021-03-031-3/+1Star
| | | | | | | | | | | | 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 <mcb30@ipxe.org>
* [linux] Add a generic function for reading files from sysfsMichael Brown2021-03-031-0/+107
Signed-off-by: Michael Brown <mcb30@ipxe.org>