WPILibC++
2025.3.2
Loading...
Searching...
No Matches
Errno.h
Go to the documentation of this file.
1
//===- llvm/Support/Errno.h - Portable+convenient errno handling -*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file declares some portable and convenient functions to deal with errno.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef WPIUTIL_WPI_ERRNO_H
14
#define WPIUTIL_WPI_ERRNO_H
15
16
#include <cerrno>
17
#include <string>
18
19
namespace
wpi
{
20
namespace
sys {
21
22
template
<
typename
FailT,
typename
Fun,
typename
... Args>
23
inline
decltype
(
auto
)
RetryAfterSignal
(
const
FailT &
Fail
,
const
Fun &F,
24
const
Args &... As) {
25
decltype
(F(As...)) Res;
26
do
{
27
errno = 0;
28
Res = F(As...);
29
}
while
(Res ==
Fail
&& errno == EINTR);
30
return
Res;
31
}
32
33
}
// namespace sys
34
}
// namespace wpi
35
36
#endif
// WPIUTIL_WPI_ERRNO_H
wpi::sys::RetryAfterSignal
decltype(auto) RetryAfterSignal(const FailT &Fail, const Fun &F, const Args &... As)
Definition
Errno.h:23
wpi
Foonathan namespace.
Definition
ntcore_cpp.h:26
wpi::DecodeLimits::Fail
@ Fail
wpi
Errno.h
Generated on Mon Mar 17 2025 23:50:36 for WPILibC++ by
1.12.0