3 #include <zypp-core/zyppng/io/SockAddr> 4 #include <zypp-core/zyppng/base/Timer> 10 #include <sys/ioctl.h> 19 int res = ::pthread_sigmask(SIG_BLOCK, &
set, NULL);
27 for (
const int sig : sigs )
28 ::sigaddset( &
set, sig );
30 int res = ::pthread_sigmask(SIG_BLOCK, &
set, NULL);
40 if ( res < 0 && errno != ECONNREFUSED && errno != EADDRNOTAVAIL ) {
65 if ( ioctl( fd, FIONREAD, &value) >= 0 )
66 return int64_t(value);
73 int pipeFds[]={ -1, -1 };
76 if ( ::pipe2( pipeFds, flags ) != 0 )
79 if ( ::pipe( pipeFds ) != 0 )
82 ::fcntl( pipeFds[0], F_SETFD, flags );
83 ::fcntl( pipeFds[1], F_SETFD, flags );
bool trySocketConnection(int &sockFD, const SockAddr &addr, uint64_t timeout)
AutoDispose<int> calling ::close
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)
virtual std::size_t size() const =0
int64_t bytesAvailableOnFD(int fd)
bool blockAllSignalsForCurrentThread()
virtual struct ::sockaddr * nativeSockAddr() const =0
static uint64_t elapsedSince(const uint64_t start)