1 #ifndef ZYPP_BASE_LINUXHELPERS_P_H_DEFINED 2 #define ZYPP_BASE_LINUXHELPERS_P_H_DEFINED 6 #include <zypp-core/zyppng/core/ByteArray> 16 strerror_r( err == -1 ? errno : err , strBuf.data(), strBuf.size() );
17 return std::string( strBuf.data() );
34 template<
typename Fun,
typename RestartCb,
typename... Args >
35 auto eintrSafeCallEx (
const Fun &
function,
const RestartCb &restartCb, Args&&... args ) {
40 if ( res == -1 && errno == EINTR ) {
49 template<
typename Fun,
typename... Args >
51 return eintrSafeCallEx( std::forward<Fun>(
function), [](){}, std::forward<Args>(args)... );
75 static std::optional<Pipe>
create (
int flags = 0 );
87 #endif // LINUXHELPERS_P_H
bool trySocketConnection(int &sockFD, const SockAddr &addr, uint64_t timeout)
AutoDispose<int> calling ::close
std::enable_if< std::is_member_pointer< typename std::decay< Functor >::type >::value, typename std::result_of< Functor &&(Args &&...)>::type >::type invoke(Functor &&f, Args &&... args)
bool blockSignalsForCurrentThread(const std::vector< int > &sigs)
void renumberFd(int origfd, int newfd)
std::string strerr_cxx(const int err=-1)
static std::optional< Pipe > create(int flags=0)
auto eintrSafeCall(Fun &&function, Args &&... args)
int64_t bytesAvailableOnFD(int fd)
bool blockAllSignalsForCurrentThread()
auto eintrSafeCallEx(const Fun &function, const RestartCb &restartCb, Args &&... args)