1 #ifndef _IPXE_POSIX_IO_H 2 #define _IPXE_POSIX_IO_H 16 #define POSIX_FD_MIN ( 1 ) 19 #define POSIX_FD_MAX ( 31 ) 24 extern int open (
const char *uri_string );
29 extern int close (
int fd );
72 return ( *
set & ( 1 << fd ) );
int open(const char *uri_string)
Open file.
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
Access to external ("user") memory.
uint32_t userptr_t
A pointer to a user buffer.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static __attribute__((always_inline)) void FD_ZERO(fd_set *set)
Zero a file descriptor set.
uint32_t fd_set
File descriptor set as used for select()
ssize_t read_user(int fd, userptr_t buffer, off_t offset, size_t len)
Read data from file.
static ssize_t read(int fd, void *buf, size_t len)
Read data from file.
userptr_t virt_to_user(volatile const void *addr)
Convert virtual address to user pointer.
int select(fd_set *readfds, int wait)
Check file descriptors for readiness.
uint16_t offset
Offset to command line.
ssize_t fsize(int fd)
Determine file size.
int close(int fd)
Close file.