11 #ifndef _CRT_SECURE_NO_WARNINGS 12 # define _CRT_SECURE_NO_WARNINGS 18 #include <sys/types.h> 27 # define O_CREAT _O_CREAT 28 # define O_TRUNC _O_TRUNC 31 # define S_IRUSR _S_IREAD 35 # define S_IWUSR _S_IWRITE 39 # define _SH_DENYNO 0x40 55 inline unsigned convert_rwcount(std::size_t
count) {
56 return count <= UINT_MAX ? static_cast<unsigned>(
count) : UINT_MAX;
60 typedef ssize_t RWResult;
62 inline std::size_t convert_rwcount(std::size_t count) {
return count; }
98 int mode = S_IRUSR | S_IWUSR;
99 #if defined(_WIN32) && !defined(__MINGW32__) 132 DWORD size_upper = 0;
133 HANDLE
handle =
reinterpret_cast<HANDLE
>(_get_osfhandle(fd_));
134 DWORD size_lower =
FMT_SYSTEM(GetFileSize(handle, &size_upper));
135 if (size_lower == INVALID_FILE_SIZE) {
136 DWORD error = GetLastError();
137 if (error != NO_ERROR)
138 FMT_THROW(WindowsError(GetLastError(),
"cannot get file size"));
141 return (long_size <<
sizeof(DWORD) * CHAR_BIT) | size_lower;
143 typedef struct stat Stat;
144 Stat file_stat =
Stat();
148 "return type of File::size is not large enough");
149 return file_stat.st_size;
183 "cannot duplicate file descriptor {} to {}", fd_, fd));
202 enum { DEFAULT_CAPACITY = 65536 };
203 int result =
FMT_POSIX_CALL(pipe(fds, DEFAULT_CAPACITY, _O_BINARY));
213 read_end =
File(fds[0]);
214 write_end =
File(fds[1]);
231 return si.dwPageSize;
#define FMT_STATIC_ASSERT(cond, message)
const Char * c_str() const
FMT_GCC_EXTENSION typedef unsigned long long ULongLong
int Stat(const char *path, StatStruct *buf)
bool write(ros_opcua_srvs::Write::Request &req, ros_opcua_srvs::Write::Response &res)
#define FMT_RETRY_VAL(result, expression, error_result)
std::size_t write(const void *buffer, std::size_t count)
#define FMT_RETRY(result, expression)
MakeUnsigned< Int >::Type to_unsigned(Int value)
FMT_API void report_system_error(int error_code, StringRef message) FMT_NOEXCEPT
bool read(ros_opcua_srvs::Read::Request &req, ros_opcua_srvs::Read::Response &res)
BufferedFile() FMT_NOEXCEPT
static void pipe(File &read_end, File &write_end)
BufferedFile fdopen(const char *mode)
std::size_t read(void *buffer, std::size_t count)
~BufferedFile() FMT_NOEXCEPT
#define FMT_POSIX_CALL(call)
FMT_GCC_EXTENSION typedef long long LongLong