+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+
+//config:config TASKSET
+//config: bool "taskset"
+//config: default n # doesn't build on some non-x86 targets (m68k)
+//config: help
+//config: Retrieve or set a processes's CPU affinity.
+//config: This requires sched_{g,s}etaffinity support in your libc.
+//config:
+//config:config FEATURE_TASKSET_FANCY
+//config: bool "Fancy output"
+//config: default y
+//config: depends on TASKSET
+//config: help
+//config: Add code for fancy output. This merely silences a compiler-warning
+//config: and adds about 135 Bytes. May be needed for machines with alot
+//config: of CPUs.
+
+//applet:IF_TASKSET(APPLET(taskset, BB_DIR_USR_BIN, BB_SUID_DROP))
+//kbuild:lib-$(CONFIG_TASKSET) += taskset.o
+
+//usage:#define taskset_trivial_usage
+//usage: "[-p] [MASK] [PID | PROG ARGS]"
+//usage:#define taskset_full_usage "\n\n"
+//usage: "Set or get CPU affinity\n"
+//usage: "\n -p Operate on an existing PID"
+//usage:
+//usage:#define taskset_example_usage
+//usage: "$ taskset 0x7 ./dgemm_test&\n"
+//usage: "$ taskset -p 0x1 $!\n"
+//usage: "pid 4790's current affinity mask: 7\n"
+//usage: "pid 4790's new affinity mask: 1\n"
+//usage: "$ taskset 0x7 /bin/sh -c './taskset -p 0x1 $$'\n"
+//usage: "pid 6671's current affinity mask: 1\n"
+//usage: "pid 6671's new affinity mask: 1\n"
+//usage: "$ taskset -p 1\n"
+//usage: "pid 1's current affinity mask: 3\n"
+/*
+ Not yet implemented:
+ * -a/--all-tasks (affect all threads)
+ * -c/--cpu-list (specify CPUs via "1,3,5-7")