forked from enlightenment/enlightenment
cpufreq: freebsd fixes
This fixes a sysctlbyname lookup and adds a stub for the "pstate"
command. Modified by Daniel Kolesa. Backport of bc41e68
.
@fix
This commit is contained in:
parent
3bdc2ebbba
commit
cd80a1ee84
|
@ -57,9 +57,8 @@ main(int argc, char *argv[])
|
||||||
#elif defined __FreeBSD__
|
#elif defined __FreeBSD__
|
||||||
if (!strcmp(argv[1], "frequency"))
|
if (!strcmp(argv[1], "frequency"))
|
||||||
{
|
{
|
||||||
int new_frequency = atoi(argv[2]);
|
int newfreq = atoi(argv[2]);
|
||||||
size_t len = sizeof(new_frequency);
|
if (sysctlbyname("dev.cpu.0.freq", NULL, NULL, &newfreq, sizeof(newfreq)) == -1)
|
||||||
if (sysctlbyname("dev.cpu.0.freq", NULL, 0, &new_frequency, &len) == -1)
|
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Unable to open frequency interface for writing.\n");
|
fprintf(stderr, "Unable to open frequency interface for writing.\n");
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -72,6 +71,11 @@ main(int argc, char *argv[])
|
||||||
fprintf(stderr, "Governors not (yet) implemented on FreeBSD.\n");
|
fprintf(stderr, "Governors not (yet) implemented on FreeBSD.\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
else if (!strcmp(argv[1], "pstate"))
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Pstates not (yet) implemented on FreeBSD.\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Unknown command.\n");
|
fprintf(stderr, "Unknown command.\n");
|
||||||
|
|
Loading…
Reference in New Issue