Issue using taskset on Linux

I am using taskset command to set the affinity for a process on RedHat5 machine. However I am observing some strange behavior with the taskset command.

/proc/cpuinfo for my machine shows that I have 2 cores and one processor with no support for hyperthreading.

When I run the command as


taskset -p <PID>

It returns the affinity as 3, but since I have only two cores why it is returning 3?

When I try to launch a process with setting affinity as 2/3, it gives argument error and accepts only 0 and 1 as argument.

Other strange behavior is when I run any command as "taskset -c 0 nedit", then when I query it using "taskset -p <PID>", it returns 1 (Shouldn't it return 0??)

Similarly on running a process with affinity set to 1, shows 2 when queried using taskset -p.

Can someone please explain this behavior.