I am using cpuset from the command line (i.e. http://man7.org/linux/man-pages/man7/cpuset.7.html) to run a C/C++ program.
I wonder whether the C/C++ is able to retrieve the cpuset it is running on top of.
I read http://man7.org/linux/man-pages/man3/CPU_SET.3.html but I don't see any macro there to be able to achieve what I want.
The main reason I would like to retrieve the cpuset inside the program is to fill cpu_set_t* so that I can pass it to pthread_attr_setaffinity_np().
Thanks in advance.