WPILibC++ 2024.3.2
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
19namespace wpi {
20namespace sys {
21
22template <typename FailT, typename Fun, typename... Args>
23inline 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
static constexpr const unit_t< compound_unit< charge::coulomb, inverse< substance::mol > > > F(N_A *e)
Faraday constant.
decltype(auto) RetryAfterSignal(const FailT &Fail, const Fun &F, const Args &... As)
Definition: Errno.h:23
Definition: ntcore_cpp.h:26