Author Topic: How to initialize C library opaque types in NASM?  (Read 71 times)

Offline paml27

  • Jr. Member
  • *
  • Posts: 25
How to initialize C library opaque types in NASM?
« on: January 16, 2020, 10:16:02 PM »
I am creating threads in NASM with the pthread library, so far with success. 

Now I need to go farther and specify the affinity mask for each thread, so each thread runs on a unique core. 

The pthreads library has two opaque types, pthread_attr_t and cpu_set_t, and they are needed to specify the affinity mask for a call to pthread_attr_setaffinity_np.  I don't know how to initialize them in NASM, and I hope someone else knows.   

More generally, are there any examples of using pthread_attr_setaffinity_np in NASM? 

I'm writing in 64-bit NASM. 

Thanks.