blob: c87d5e6c5e886a5e3bbffa929e6c826e3f45c8f9 [file] [log] [blame]
Patrick Venture8b588562018-11-18 08:44:33 -08001/*
2 * Copyright 2018 Google Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "sys.hpp"
18
19#include <fcntl.h>
Patrick Venture7b91cbc2018-11-28 14:24:41 -080020#include <sys/ioctl.h>
Patrick Venture8b588562018-11-18 08:44:33 -080021#include <sys/mman.h>
22#include <unistd.h>
23
24namespace blobs
25{
26namespace flash
27{
28namespace internal
29{
30
31int SysImpl::open(const char* pathname, int flags) const
32{
33 return ::open(pathname, flags);
34}
35
36int SysImpl::close(int fd) const
37{
38 return ::close(fd);
39}
40
41void* SysImpl::mmap(void* addr, size_t length, int prot, int flags, int fd,
42 off_t offset) const
43{
44 return ::mmap(addr, length, prot, flags, fd, offset);
45}
46
47int SysImpl::munmap(void* addr, size_t length) const
48{
49 return ::munmap(addr, length);
50}
51
52int SysImpl::getpagesize() const
53{
54 return ::getpagesize();
55}
56
Patrick Venture7b91cbc2018-11-28 14:24:41 -080057int SysImpl::ioctl(int fd, unsigned long request, void* param) const
58{
59 return ::ioctl(fd, request, param);
60}
61
Patrick Venture8b588562018-11-18 08:44:33 -080062SysImpl sys_impl;
63
64} // namespace internal
65} // namespace flash
66} // namespace blobs