Index: xen-4.0.0-testing/tools/libxc/xc_ptrace.c =================================================================== --- a/tools/libxc/xc_ptrace.c Mon Mar 15 13:25:30 2010 +0000 +++ b/tools/libxc/xc_ptrace.c Mon Mar 15 10:22:23 2010 -0600 @@ -193,6 +193,13 @@ if (map == NULL) return NULL; + /* + * Due to the use of API fallback code in libxc, errno may + * be clobberred during successful operations. Since the caller + * of xc_ptrace is depending on errno for return status, clear + * errno here. + */ + errno = 0; return map + (va & ~PAGE_MASK); }