On the x86 machine, i can use the below program to detect read or write fault. write_fault=uap->uc_mcontext.gregs[REG_ERR]&4; but it don't work on AMD64 machine. I have been search on internet, but there is no answer for AMD64. Anybody can tell me how to do?