diff --git a/usr.bin/cpuset/cpuset.1 b/usr.bin/cpuset/cpuset.1 index 00f9e81b823f..b97234a274e7 100644 --- a/usr.bin/cpuset/cpuset.1 +++ b/usr.bin/cpuset/cpuset.1 @@ -89,8 +89,12 @@ queried using When running a command it may join a set specified with .Fl s otherwise a new set is created. -In addition, a mask for the set may be specified using +In addition, a mask for the command may be specified using .Fl l . +When used in conjunction with +.Fl c +the mask modifies the supplied or created set rather than the private mask +for the thread. .Pp The options are as follows: .Bl -tag -width ".Fl l Ar cpu-list" @@ -127,7 +131,7 @@ Specifies a thread id as the target of the operation. Create a new group with CPUs 0-4 inclusive and run .Pa /bin/sh on it: -.Dl cpuset -l 0-4 /bin/sh +.Dl cpuset -c -l 0-4 /bin/sh .Pp Query the mask of CPUs the .Aq sh pid diff --git a/usr.bin/cpuset/cpuset.c b/usr.bin/cpuset/cpuset.c index 41a715dff9e9..c31ebb7fb04f 100644 --- a/usr.bin/cpuset/cpuset.c +++ b/usr.bin/cpuset/cpuset.c @@ -257,7 +257,7 @@ main(int argc, char *argv[]) * The user wants to run a command with a set and possibly cpumask. */ if (argc) { - if (pflag | rflag | tflag || cflag) + if (pflag | rflag | tflag) usage(); if (sflag) { if (cpuset_setid(CPU_WHICH_PID, -1, setid)) @@ -267,7 +267,7 @@ main(int argc, char *argv[]) err(argc, "newid"); } if (lflag) { - if (cpuset_setaffinity(CPU_LEVEL_CPUSET, CPU_WHICH_PID, + if (cpuset_setaffinity(level, CPU_WHICH_PID, -1, sizeof(mask), &mask) != 0) err(EXIT_FAILURE, "setaffinity"); }