Hi, with this new syscall.c content above things are going in the right direction:-). I make a test with strace from the program testthread of the Qemu testsuite. When I understand the result right, threading works now with this new compiled qemu-i386. The child and the parents tidptr NOW have the same number in one thread, and different but also same in other thread. This means for the not working program testclone: The functioncall with its sets of parameters is just wrong there. When you do a function call with those Flags as in testthread, threads can be builded with qemu-i386. So, the error is in the wrong calling of the function clone(). This can be corrected. Please tell me your thoughts, Dietmar root@raspberrypi:/home/pi/raspidev# qemu-i386 -strace testthread 1583 brk(NULL) = 0x0804a000 1583 uname(0x4300d4ca) = 0 1583 access("/etc/ld.so.nohwcap",F_OK) = -1 errno=2 (No such file or directory) 1583 mmap2(NULL,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0) = 0x4311c000 1583 access("/etc/ld.so.preload",R_OK) = -1 errno=2 (No such file or directory) 1583 open("/etc/ld.so.cache",O_RDONLY) = 3 1583 fstat64(3,0x4300d184) = 0 1583 mmap2(NULL,41656,PROT_READ,MAP_PRIVATE,3,0) = 0x4311e000 1583 close(3) = 0 1583 access("/etc/ld.so.nohwcap",F_OK) = -1 errno=2 (No such file or directory) 1583 open("/lib/i386-linux-gnu/tls/i686/sse2/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/i386-linux-gnu/tls/i686/sse2/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/i386-linux-gnu/tls/i686/sse2/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/i386-linux-gnu/tls/i686/sse2",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/i386-linux-gnu/tls/i686/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/i386-linux-gnu/tls/i686/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/i386-linux-gnu/tls/i686/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/i386-linux-gnu/tls/i686",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/i386-linux-gnu/tls/sse2/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/i386-linux-gnu/tls/sse2/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/i386-linux-gnu/tls/sse2/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/i386-linux-gnu/tls/sse2",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/i386-linux-gnu/tls/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/i386-linux-gnu/tls/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/i386-linux-gnu/tls/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/i386-linux-gnu/tls",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/i386-linux-gnu/i686/sse2/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/i386-linux-gnu/i686/sse2/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/i386-linux-gnu/i686/sse2/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/i386-linux-gnu/i686/sse2",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/i386-linux-gnu/i686/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/i386-linux-gnu/i686/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/i386-linux-gnu/i686/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/i386-linux-gnu/i686",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/i386-linux-gnu/sse2/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/i386-linux-gnu/sse2/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/i386-linux-gnu/sse2/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/i386-linux-gnu/sse2",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/i386-linux-gnu/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/i386-linux-gnu/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/i386-linux-gnu/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/i386-linux-gnu",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/usr/lib/i386-linux-gnu/tls/i686/sse2/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/usr/lib/i386-linux-gnu/tls/i686/sse2/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/usr/lib/i386-linux-gnu/tls/i686/sse2/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/usr/lib/i386-linux-gnu/tls/i686/sse2",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/usr/lib/i386-linux-gnu/tls/i686/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/usr/lib/i386-linux-gnu/tls/i686/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/usr/lib/i386-linux-gnu/tls/i686/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/usr/lib/i386-linux-gnu/tls/i686",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/usr/lib/i386-linux-gnu/tls/sse2/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/usr/lib/i386-linux-gnu/tls/sse2/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/usr/lib/i386-linux-gnu/tls/sse2/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/usr/lib/i386-linux-gnu/tls/sse2",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/usr/lib/i386-linux-gnu/tls/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/usr/lib/i386-linux-gnu/tls/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/usr/lib/i386-linux-gnu/tls/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/usr/lib/i386-linux-gnu/tls",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/usr/lib/i386-linux-gnu/i686/sse2/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/usr/lib/i386-linux-gnu/i686/sse2/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/usr/lib/i386-linux-gnu/i686/sse2/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/usr/lib/i386-linux-gnu/i686/sse2",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/usr/lib/i386-linux-gnu/i686/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/usr/lib/i386-linux-gnu/i686/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/usr/lib/i386-linux-gnu/i686/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/usr/lib/i386-linux-gnu/i686",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/usr/lib/i386-linux-gnu/sse2/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/usr/lib/i386-linux-gnu/sse2/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/usr/lib/i386-linux-gnu/sse2/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/usr/lib/i386-linux-gnu/sse2",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/usr/lib/i386-linux-gnu/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/usr/lib/i386-linux-gnu/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/usr/lib/i386-linux-gnu/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/usr/lib/i386-linux-gnu",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/tls/i686/sse2/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/tls/i686/sse2/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/tls/i686/sse2/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/tls/i686/sse2",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/tls/i686/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/tls/i686/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/tls/i686/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/tls/i686",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/tls/sse2/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/tls/sse2/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/tls/sse2/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/tls/sse2",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/tls/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/tls/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/tls/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/tls",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/i686/sse2/cmov/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/i686/sse2/cmov",0x4300d1e8) = -1 errno=2 (No such file or directory) 1583 open("/lib/i686/sse2/libpthread.so.0",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 stat64("/lib/i686/sse2",0x4300d1e8) = 0 1583 open("/lib/i686/cmov/libpthread.so.0",O_RDONLY) = 3 1583 read(3,0x4300d2b8,512) = 512 1583 fstat64(3,0x4300d1d8) = 0 1583 mmap2(NULL,98816,PROT_EXEC|PROT_READ,MAP_PRIVATE|MAP_DENYWRITE,3,0) = 0x43129000 1583 mmap2(0x4313e000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_DENYWRITE|MAP_FIXED,3,0x14) = 0x4313e000 1583 mmap2(0x43140000,4608,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED,-1,0) = 0x43140000 1583 close(3) = 0 1583 access("/etc/ld.so.nohwcap",F_OK) = -1 errno=2 (No such file or directory) 1583 open("/lib/i686/sse2/libc.so.6",O_RDONLY) = -1 errno=2 (No such file or directory) 1583 open("/lib/i686/cmov/libc.so.6",O_RDONLY) = 3 1583 read(3,0x4300d29c,512) = 512 1583 fstat64(3,0x4300d1bc) = 0 1583 mmap2(NULL,1427832,PROT_EXEC|PROT_READ,MAP_PRIVATE|MAP_DENYWRITE,3,0) = 0x43142000 1583 mprotect(0x43298000,4096,PROT_NONE) = 0 1583 mmap2(0x43299000,12288,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_DENYWRITE|MAP_FIXED,3,0x156) = 0x43299000 1583 mmap2(0x4329c000,10616,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED,-1,0) = 0x4329c000 1583 close(3) = 0 1583 mmap2(NULL,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0) = 0x4329f000 1583 mmap2(NULL,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0) = 0x432a0000 1583 set_thread_area(1124128384,1125224436,1126824768,1,0,1124128412) = 0 1583 mprotect(0x43299000,8192,PROT_READ) = 0 1583 mprotect(0x4313e000,4096,PROT_READ) = 0 1583 mprotect(0x43118000,4096,PROT_READ) = 0 1583 munmap(0x4311e000,41656) = 0 1583 set_tid_address(1126824872,1125380084,1126824872,47,29,1124128640) = 1583 1583 set_robust_list(1126824880,12,1125380084,47,1126824768,1124128640) = -1 errno=38 (Function not implemented) 1583 futex(0x4300d770,FUTEX_PRIVATE_FLAG|265,1,NULL,NULL,0) = -1 errno=38 (Function not implemented) 1583 rt_sigaction(320x4300d41c,NULL) = 0 1583 rt_sigaction(330x4300d41c,NULL) = -1 errno=22 (Invalid argument) 1583 rt_sigprocmask(SIG_UNBLOCK,0x4300d6d8,NULL) = 0 1583 ugetrlimit(3,1124128608,1126805492,8,1,1124127924) = 0 1583 uname(0x4300d4d4) = 0 1583 mmap2(NULL,8392704,PROT_EXEC|PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS|0x20000,-1,0) = 0x432a1000 1583 brk(NULL) = 0x0804a000 1583 brk(0x0806b000) = 0x0806b000 1583 mprotect(0x432a1000,4096,PROT_NONE) = 0 1583 clone(CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID,child_stack=0x43aa1494,parent_tidptr=0x43aa1bd8,tls=0x4300d6c8,child_tidptr=0x43aa1bd8) = 1584 1583 mmap2(NULL,8392704,PROT_EXEC|PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS|0x20000,-1,0) = 0x43aa4000 1583 set_robust_list(1135221728,12,1125380084,0,4001536,1135219864) = -1 errno=38 (Function not implemented) 1583 mprotect(0x43aa4000,4096,PROT_NONE) = 0 1583 clone(CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID,child_stack=0x442a4494,parent_tidptr=0x442a4bd8,tls=0x4300d6b8,child_tidptr=0x442a4bd8) = 1585 1583 1583 set_robust_list(1143622624,12,1125380084,0,4001536,1143620760) = -1 errno=38 (Function not implemented) 1583 futex(0x43aa1bd8,FUTEX_WAIT,1584,NULL,0x4313eff4,1125380084)1583 write(1,0x43aa1198,18)thread1: 0 hello1 = 18 1583 write(1,0x442a4198,18)thread2: 0 hello2 = 18 1583 nanosleep(1143619920,0,1143619992,0,1143620011,1143619928)nanosleep(1135219024,0,1135219096,0,1135219115,1135219032) = 0 1583 write(1,0x43aa1198,18)thread1: 1 hello1 = 18 1583 nanosleep(1135219024,0,1135219096,1,1135219115,1135219032) = 0 1583 write(1,0x442a4198,18)thread2: 1 hello2 = 18 1583 nanosleep(1143619920,0,1143619992,1,1143620011,1143619928) = 0 1583 write(1,0x43aa1198,18)thread1: 2 hello1 = 18 1583 nanosleep(1135219024,0,1135219096,2,1135219115,1135219032) = 0 1583 write(1,0x442a4198,18)thread2: 2 hello2 = 18 1583 nanosleep(1143619920,0,1143619992,2,1143620011,1143619928) = 0 1583 write(1,0x43aa1198,18)thread1: 3 hello1 = 18 1583 nanosleep(1135219024,0,1135219096,3,1135219115,1135219032) = 0 1583 write(1,0x43aa1198,18)thread1: 4 hello1 = 18 1583 nanosleep(1135219024,0,1135219096,4,1135219115,1135219032) = 0 1583 write(1,0x442a4198,18)thread2: 3 hello2 = 18 1583 nanosleep(1143619920,0,1143619992,3,1143620011,1143619928) = 0 1583 write(1,0x43aa1198,18)thread1: 5 hello1 = 18 1583 nanosleep(1135219024,0,1135219096,5,1135219115,1135219032) = 0 1583 write(1,0x442a4198,18)thread2: 4 hello2 = 18 1583 nanosleep(1143619920,0,1143619992,4,1143620011,1143619928) = 0 1583 write(1,0x43aa1198,18)thread1: 6 hello1 = 18 1583 nanosleep(1135219024,0,1135219096,6,1135219115,1135219032) = 0 1583 write(1,0x43aa1198,18)thread1: 7 hello1 = 18 1583 nanosleep(1135219024,0,1135219096,7,1135219115,1135219032) = 0 1583 write(1,0x442a4198,18)thread2: 5 hello2 = 18 1583 nanosleep(1143619920,0,1143619992,5,1143620011,1143619928) = 0 1583 write(1,0x43aa1198,18)thread1: 8 hello1 = 18 1583 nanosleep(1135219024,0,1135219096,8,1135219115,1135219032) = 0 1583 write(1,0x442a4198,18)thread2: 6 hello2 = 18 1583 nanosleep(1143619920,0,1143619992,6,1143620011,1143619928) = 0 1583 write(1,0x43aa1198,18)thread1: 9 hello1 = 18 1583 nanosleep(1135219024,0,1135219096,9,1135219115,1135219032) = 0 1583 madvise(1126830080,8372224,4,1135221616,1135221616,1135219864) = 0 1583 exit(0) = 0 1583 futex(0x442a4bd8,FUTEX_WAIT,1585,NULL,0x4313eff4,1125380084) = 0 1583 write(1,0x442a4198,18)thread2: 7 hello2 = 18 1583 nanosleep(1143619920,0,1143619992,7,1143620011,1143619928) = 0 1583 write(1,0x442a4198,18)thread2: 8 hello2 = 18 1583 nanosleep(1143619920,0,1143619992,8,1143620011,1143619928) = 0 1583 write(1,0x442a4198,18)thread2: 9 hello2 = 18 1583 nanosleep(1143619920,0,1143619992,9,1143620011,1143619928) = 0 1583 write(1,0x442a4198,19)thread2: 10 hello2 = 19 1583 nanosleep(1143619920,0,1143619992,10,1143620012,1143619928) = 0 1583 write(1,0x442a4198,19)thread2: 11 hello2 = 19 1583 nanosleep(1143619920,0,1143619992,11,1143620012,1143619928) = 0 1583 write(1,0x442a4198,19)thread2: 12 hello2 = 19 1583 nanosleep(1143619920,0,1143619992,12,1143620012,1143619928) = 0 1583 write(1,0x442a4198,19)thread2: 13 hello2 = 19 1583 nanosleep(1143619920,0,1143619992,13,1143620012,1143619928) = 0 1583 write(1,0x442a4198,19)thread2: 14 hello2 = 19 1583 nanosleep(1143619920,0,1143619992,14,1143620012,1143619928) = 0 1583 write(1,0x442a4198,19)thread2: 15 hello2 = 19 1583 nanosleep(1143619920,0,1143619992,15,1143620012,1143619928) = 0 1583 write(1,0x442a4198,19)thread2: 16 hello2 = 19 1583 nanosleep(1143619920,0,1143619992,16,1143620012,1143619928) = 0 1583 write(1,0x442a4198,19)thread2: 17 hello2 = 19 1583 nanosleep(1143619920,0,1143619992,17,1143620012,1143619928) = 0 1583 write(1,0x442a4198,19)thread2: 18 hello2 = 19 1583 nanosleep(1143619920,0,1143619992,18,1143620012,1143619928) = 0 1583 write(1,0x442a4198,19)thread2: 19 hello2 = 19 1583 nanosleep(1143619920,0,1143619992,19,1143620012,1143619928) = 0 1583 madvise(1135230976,8372224,4,1143622512,1143622512,1143620760) = 0 1583 exit(0) = 0 1583 fstat64(1,0x4300d094) = 0 1583 mmap2(NULL,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0) = 0x44312000 1583 write(1,0x44312000,21)End of pthread test. = 21 1583 exit_group(0) root@raspberrypi:/home/pi/raspidev#