Having implemented two hacky solutions I recently noticed that Solaris does this by passing in a pointer to char, storing the carry flag in that char and then calling LibVEX_GuestAMD64_put_rflag_c(cflag, &tst->arch.vex) after ML_(do_syscall_for_client_WRK) That's much more elegant. Needs to be done on FreeBSD amd64 arm64 x86 and Darwin amd64 and x86.
commit 4fb1e502dbd2a492eb5c9b89151120b8f615840d (HEAD -> master, origin/master, origin/HEAD) Author: Paul Floyd <pjfloyd@wanadoo.fr> Date: Wed Oct 29 22:09:08 2025 +0100 Bug 511329 - Darwin and FreeBSD: Move setting of carry flag out of ML_(do_syscall_for_client_WRK) part 3 Remove guest_SETC and GENOFFSET (plus 2 other commits)