blob: 5f21bf2d76f7279f88b7b6a37b7979b3562a403f [file] [log] [blame]
Patrick Venture123b5c02019-03-05 14:01:00 -08001#pragma once
2
3/* NOTE: IIRC, wak@ is working on exposing some of this in stdplus, so we can
4 * transition when that's ready.
5 *
6 * Copied some from gpioplus to enable unit-testing of lpc nuvoton and later
7 * other pieces.
8 */
9
Patrick Venturef9ee95f2021-02-12 12:33:31 -080010#include "sys_interface.hpp"
11
Patrick Venture123b5c02019-03-05 14:01:00 -080012#include <poll.h>
13#include <sys/mman.h>
14
15#include <cinttypes>
16#include <cstddef>
17
Patrick Venture68448332019-03-07 09:08:04 -080018namespace ipmiblob
19{
Patrick Venture123b5c02019-03-05 14:01:00 -080020namespace internal
21{
22
23/**
Patrick Venture123b5c02019-03-05 14:01:00 -080024 * @class SysImpl
25 * @brief syscall concrete implementation
26 * @details Passes through all calls to the normal linux syscalls
27 */
28class SysImpl : public Sys
29{
30 public:
31 int open(const char* pathname, int flags) const override;
32 int read(int fd, void* buf, std::size_t count) const override;
33 int close(int fd) const override;
34 void* mmap(void* addr, std::size_t length, int prot, int flags, int fd,
35 off_t offset) const override;
36 int munmap(void* addr, std::size_t length) const override;
37 int getpagesize() const override;
38 int ioctl(int fd, unsigned long request, void* param) const override;
39 int poll(struct pollfd* fds, nfds_t nfds, int timeout) const override;
40};
41
Patrick Venture123b5c02019-03-05 14:01:00 -080042} // namespace internal
Patrick Venture68448332019-03-07 09:08:04 -080043} // namespace ipmiblob