UNISTDX_SYSTEM_RESOURCE
using information_type = struct ::sysinfo
using resource_limit_type = struct ::rlimit
using resource_usage_type = struct ::rusage
using size_type = ::std::size_t

Alias to std::size_t.

enum path_options: int
    enum string_options: int
      enum resources: int
        enum options: int
          class sys::resource_limit
          Base classes
          • public resource_limit_type
          Types
          • using value_type = ::rlim_t
          Fields
          • constexpr const value_type infinity
          Methods
          class sys::cache_level

          A particular level of cache.

          Methods
          • associativity() const -> size_type

            Get cache associativity (the number of sets into which cache blocks go).

          • line_size() const -> size_type

            Get cache line size.

          • size() const -> size_type

            Get cache size.

          • level() const -> int

            Get level number.

          Friends
          • cache
          class sys::resource_usage
          Base classes
          • public resource_usage_type
          Enumerations
          • enum who: int
          Methods
          • involuntary_context_switches() const -> long
          • voluntary_context_switches() const -> long
          • signals_received() const -> long
          • ipc_messages_received() const -> long
          • ipc_messages_sent() const -> long
          • block_output_operations() const -> long
          • block_input_operations() const -> long
          • num_swaps() const -> long
          • page_faults() const -> long
          • page_reclaims() const -> long
          • integral_unshared_stack_size() const -> long
          • integral_unshared_data_size() const -> long
          • integral_shared_memory_size() const -> long
          • maximum_resident_set_size() const -> long
          • system_cpu_time() const -> std::chrono::microseconds
          • user_cpu_time() const -> std::chrono::microseconds
          • operator=(resource_usage &&) -> resource_usage &
          • resource_usage(resource_usage &&)
          • operator=(const resource_usage &) -> resource_usage &
          • resource_usage(const resource_usage &)
          • ~resource_usage()
          • resource_usage(who w = who::self)explicit
          class sys::cache

          System caches. The data is queried in a series of sysconf(3) calls.

          Types
          Fields
          • const typedef value_type * const_iterator

            Constant iterator.

          Methods
          • operator[](int i) const -> value_type

            Get cache by index.

          • size() const -> int

            The number of cache levels.

          • end() const -> const_iterator

            Get iterator to the end of cache level sequence.

          • begin() const -> const_iterator

            Get iterator to the beginning of cache level sequence.

          • num_levels() const -> int

            The number of cache levels.

          • cache(cache &&)

            Move-constructor.

          • cache(const cache &)

            Copy-constructor.

          • ~cache()
          • cache()
          class sys::information
          Base classes
          • public information_type
          Methods
          • uptime() const -> std::chrono::seconds
          • total_processes() const -> unsigned short
          • memory_unit() const -> int
          • unused_high_memory() const -> unsigned long
          • total_high_memory() const -> unsigned long
          • unused_swap() const -> unsigned long
          • total_swap() const -> unsigned long
          • buffers_memory() const -> unsigned long
          • shared_memory() const -> unsigned long
          • unused_memory() const -> unsigned long
          • total_memory() const -> unsigned long
          • load_average() const -> const unsigned long *
          • load_average_15min() const -> unsigned long
          • load_average_5min() const -> unsigned long
          • load_average_1min() const -> unsigned long
          • operator=(information &&) -> information &
          • information(information &&)
          • operator=(const information &) -> information &
          • information(const information &)
          • ~information()
          • information()
          limit(resources r, const resource_limit & lim) -> void
          get(fd_type fd, path_options name) -> long
          get(c_string path, path_options name) -> long
          get(options name) -> long
          io_concurrency() -> unsigned

          Always returns 1.

          limit(resources r) -> resource_limit
          get(string_options name, string & buf) -> void
          thread_concurrency() -> unsigned

          Returns maximum number of threads for the system.

          • If UNISTDX_SINGLE_THREAD preprocessor macro is defined, returns 1.
          • If UNISTDX_CONCURRENCY environment variable equals positive integer, returns its value.
          • Otherwise return std::thread::hardware_concurrency.

          get(options name, long default_value) -> long
          get(string_options name) -> string
          page_size() -> size_type

          Get system page size. Falls back to 4096 when the page size can not be determined.