le_fd_linux.h

Go to the documentation of this file.
1 //--------------------------------------------------------------------------------------------------
2 /** @file le_fd_linux.h
3  *
4  * Legato File Descriptor Linux-specific definitions.
5  *
6  * For individual function documentation, see the corresponding Linux man pages, as these macros are
7  * direct mappings to the underlying calls.
8  *
9  * Copyright (C) Sierra Wireless Inc.
10  */
11 //--------------------------------------------------------------------------------------------------
12 
13 #ifndef LEGATO_FD_LINUX_H_INCLUDE_GUARD
14 #define LEGATO_FD_LINUX_H_INCLUDE_GUARD
15 
16 #define le_fd_Close(fd) close(fd)
17 #define le_fd_Dup(oldfd) dup(oldfd)
18 #define le_fd_Fcntl fcntl
19 #define le_fd_Ioctl(fd, request, argp) ioctl((fd), (request), (argp))
20 #define le_fd_Fstat(fd, buf) fstat((fd), (buf))
21 #define le_fd_MkFifo(pathname, mode) mkfifo((pathname), (mode))
22 #define le_fd_MkPipe(pathname, mode) (-1)
23 #define le_fd_Open(pathname, flags, ...) open((pathname), (flags), ##__VA_ARGS__)
24 #define le_fd_Read(fd, buf, count) read((fd), (buf), (count))
25 #define le_fd_Write(fd, buf, count) write((fd), (buf), (count))
26 
27 #endif /* end LEGATO_FD_LINUX_H_INCLUDE_GUARD */