cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

test-pthread-attr-setaffinity-np.c (307B)


      1// SPDX-License-Identifier: GPL-2.0
      2#include <stdint.h>
      3#include <pthread.h>
      4#include <sched.h>
      5
      6int main(void)
      7{
      8	int ret = 0;
      9	pthread_attr_t thread_attr;
     10	cpu_set_t cs;
     11
     12	pthread_attr_init(&thread_attr);
     13	CPU_ZERO(&cs);
     14
     15	ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cs), &cs);
     16
     17	return ret;
     18}