Veethree D7 SDK
Loading...
Searching...
No Matches
syscall_wrappers.h File Reference

Detailed Description

syscall wrapper interface.

#include <memory>
#include <stdexcept>
#include <string>
#include <utility>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
Include dependency graph for syscall_wrappers.h:

Go to the source code of this file.

Namespaces

namespace  vsdk
 Any entities that belong to the Veethree SDK libraries.
namespace  vsdk::utils
 Any entities that belong to the utils library.

Typedefs

template<typename T>
using vsdk::utils::unique_ptr_free = std::unique_ptr<T, decltype([](T* t) { free(t); })>
 Convenience wrapper on top of std::unique_ptr that uses free() instead of delete() for managing objects allocated by malloc/calloc/etc Useful when receiving pointers allocated by C libraries (e.g. libuboot)

Functions

template<typename T, size_t N>
T & vsdk::utils::at (T(&arr)[N], size_t index)
 Return a reference to an array element.
template<typename T, size_t N>
size_t vsdk::utils::array_size (T(&arr)[N])
 Return the size of a fixed size array.
int vsdk::utils::open (const std::string &path, int flags)
 Wrapper implementation that deals with C++ linter (clang-tidy)
template<typename... Args>
int vsdk::utils::ioctl (Args &&... args)
 Wrapper implementation that deals with C++ linter (clang-tidy)
int vsdk::utils::system (const std::string &cmd)
 Wrapper implementation that deals with C++ linter (clang-tidy)
std::string vsdk::utils::errno_string (int err)
 Wrapper for strerror that returns a std::string.
template<typename... Args>
int vsdk::utils::fcntl (int fd, int cmd, Args &&... args)
 Wrapper for fcntl that deals with C++ linter (clang-tidy)

Detailed Description

syscall wrapper interface.