Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:olh:xen-4.3
xen-tscinfo
xen-cpu_khz.c
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xen-cpu_khz.c of Package xen-tscinfo
/* gcc -Wall -o xen-cpu_khz -O -lxenctrl xen-cpu_khz.c */ #include <unistd.h> #include <errno.h> #include <stdlib.h> #include <stdio.h> #include <xenctrl.h> int main(int argc, char *argv[]) { int rc; unsigned int lflags; xentoollog_level lvl; xentoollog_logger *l; xc_interface *xch; xc_physinfo_t info = { 0 }; errno = 0; lvl = XTL_DEBUG; lflags = XTL_STDIOSTREAM_SHOW_PID | XTL_STDIOSTREAM_HIDE_PROGRESS; l = (xentoollog_logger *) xtl_createlogger_stdiostream(stderr, lvl, lflags); if (!l) goto out; xch = xc_interface_open(l, 0, 0); if (!xch) goto out; rc = xc_physinfo(xch, &info); if (rc) goto out; printf("%d.%03d\n", info.cpu_khz / 1000, info.cpu_khz % 1000); return 0; out: perror(argv[0]); return 1; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor