diff options
author | Michael Brown | 2010-10-11 03:24:39 +0200 |
---|---|---|
committer | Michael Brown | 2010-10-11 03:24:39 +0200 |
commit | c0e3a774b2ef79f2b2e310c4d3255aa57eda78cb (patch) | |
tree | a713b5bd0e68cb8eb73471435da4431d89af147e /src/include/linux_api.h | |
parent | [dhcp] Include session state metadata in packet traces (diff) | |
download | ipxe-c0e3a774b2ef79f2b2e310c4d3255aa57eda78cb.tar.gz ipxe-c0e3a774b2ef79f2b2e310c4d3255aa57eda78cb.tar.xz ipxe-c0e3a774b2ef79f2b2e310c4d3255aa57eda78cb.zip |
[linux] Fix building on RHEL5 and similar platforms
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/linux_api.h')
-rw-r--r-- | src/include/linux_api.h | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/src/include/linux_api.h b/src/include/linux_api.h index 6f591d82..066cdd30 100644 --- a/src/include/linux_api.h +++ b/src/include/linux_api.h @@ -33,40 +33,41 @@ FILE_LICENCE(GPL2_OR_LATER); #include <stdint.h> -typedef int pid_t; - +#define __KERNEL_STRICT_NAMES #include <linux/types.h> #include <linux/posix_types.h> +typedef __kernel_pid_t pid_t; +typedef __kernel_time_t time_t; +typedef __kernel_suseconds_t suseconds_t; +typedef __kernel_loff_t loff_t; #include <linux/time.h> #include <linux/mman.h> #include <linux/fcntl.h> #include <linux/ioctl.h> #include <linux/poll.h> - -typedef uint32_t useconds_t; - -extern long linux_syscall(int number, ...); - -extern int linux_open(const char *pathname, int flags); -extern int linux_close(int fd); -extern ssize_t linux_read(int fd, void *buf, size_t count); -extern ssize_t linux_write(int fd, const void *buf, size_t count); -extern int linux_fcntl(int fd, int cmd, ...); -extern int linux_ioctl(int fd, int request, ...); - typedef unsigned long nfds_t; -extern int linux_poll(struct pollfd *fds, nfds_t nfds, int timeout); - -extern int linux_nanosleep(const struct timespec *req, struct timespec *rem); -extern int linux_usleep(useconds_t usec); -extern int linux_gettimeofday(struct timeval *tv, struct timezone *tz); - -#define MAP_FAILED ((void *)-1) - -extern void *linux_mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); -extern void *linux_mremap(void *old_address, size_t old_size, size_t new_size, int flags); -extern int linux_munmap(void *addr, size_t length); - -extern const char *linux_strerror(int errnum); +typedef uint32_t useconds_t; +#define MAP_FAILED ( ( void * ) -1 ) + +extern long linux_syscall ( int number, ... ); + +extern int linux_open ( const char *pathname, int flags ); +extern int linux_close ( int fd ); +extern __kernel_ssize_t linux_read ( int fd, void *buf, __kernel_size_t count ); +extern __kernel_ssize_t linux_write ( int fd, const void *buf, + __kernel_size_t count ); +extern int linux_fcntl ( int fd, int cmd, ... ); +extern int linux_ioctl ( int fd, int request, ... ); +extern int linux_poll ( struct pollfd *fds, nfds_t nfds, int timeout ); +extern int linux_nanosleep ( const struct timespec *req, struct timespec *rem ); +extern int linux_usleep ( useconds_t usec ); +extern int linux_gettimeofday ( struct timeval *tv, struct timezone *tz ); +extern void * linux_mmap ( void *addr, __kernel_size_t length, int prot, + int flags, int fd, off_t offset ); +extern void * linux_mremap ( void *old_address, __kernel_size_t old_size, + __kernel_size_t new_size, int flags ); +extern int linux_munmap ( void *addr, __kernel_size_t length ); + +extern const char * linux_strerror ( int errnum ); #endif /* _LINUX_API_H */ |