+======== Changes in 1.5 ============
+
+* Updated man page and cpulimit's "--help" page to
+ reflect support for multi-core CPUs.
+
+* Added example of using cpulimit in a shell
+ in the man page and the README file.
+
+* The Makefile now uses the default compiler
+ on the system, "cc", and tries to fall back
+ on gcc if no other compiler is found.
+
+
======== Changes in 1.4 ============
* We can now accept limits of 100% or higher. Useful for multi-core
Once you have downloaded a copy of LimitCPU building should be fairly
straight forward. First we unpack the source code
-tar zxf cpulimit-1.4.tar.gz
+tar zxf cpulimit-1.5.tar.gz
Then we run the makefile.
-cd cpulimit-1.4
+cd cpulimit-1.5
make
This should produce the executable file "cpulimit". If you would like
The "-z" flag tells LimitCPU to stop running once its target is
no longer running itself.
+The following example is useful for scripts where we want
+to launch a program and then immediately throttle it
+without knowing its process ID. The "$!" symbol refers to
+the last program run and the -b flag tells cpulimit to
+run in the background, returning control to the shell.
+
+/usr/bin/someapp &
+cpulimit -p $! -l 25 -b
fprintf(stream, " TARGET must be exactly one of these:\n");
fprintf(stream, " -p, --pid=N pid of the process\n");
fprintf(stream, " -e, --exe=FILE name of the executable program file\n");
- fprintf(stream, " -P, --path=PATH absolute path name of the executable program file\n");
+ fprintf(stream, " The -e option only works when\n");
+ fprintf(stream, " cpulimit is run with admin rights.\n");
+ fprintf(stream, " -P, --path=PATH absolute path name of the\n");
+ fprintf(stream, " executable program file\n");
fprintf(stream, " OPTIONS\n");
fprintf(stream, " -b --background run in background\n");
- fprintf(stream, " -l, --limit=N percentage of cpu allowed from 0 to 100 (mandatory)\n");
+ fprintf(stream, " -l, --limit=N percentage of cpu allowed from 1 up.\n");
+ fprintf(stream, " Usually 1 - 100, but can be higher\n");
+ fprintf(stream, " on multi-core CPUs (mandatory)\n");
fprintf(stream, " -v, --verbose show control statistics\n");
- fprintf(stream, " -z, --lazy exit if there is no suitable target process, or if it dies\n");
+ fprintf(stream, " -z, --lazy exit if there is no suitable target process,\n");
+ fprintf(stream, " or if it dies\n");
fprintf(stream, " -h, --help display this help and exit\n");
exit(exit_code);
}