Sha256: 8b7025ea764f4a11144903315e11c23b853a34a96f1024f89a4117e10f1915a6
Contents?: true
Size: 1.06 KB
Versions: 16
Compression:
Stored size: 1.06 KB
Contents
/** * @file * Declares the scoped kstat resource. */ #pragma once #include <leatherman/util/scoped_resource.hpp> #include <kstat.h> namespace facter { namespace util { namespace solaris { /** * kstat exceptions */ struct kstat_exception : std::runtime_error { /** * Constructs a kstat_exception. * @param message The exception message. */ explicit kstat_exception(std::string const& message); }; /** * Represents a scoped kstat pointer that automatically is freed when it goes out of scope. */ struct scoped_kstat : leatherman::util::scoped_resource<kstat_ctl*> { /** * Default constructor. * This constructor will handle calling kstat_open. */ scoped_kstat(); /** * Constructs a scoped_descriptor. * @param ctrl The kstat pointer to free when destroyed */ explicit scoped_kstat(kstat_ctl* ctrl); private: static void close(kstat_ctl* ctrl); }; }}} // namespace facter::util::solaris
Version data entries
16 entries across 16 versions & 2 rubygems