I think you'll want to test just doing the proper build with __POSIX_VISIBLE rather than trying to hardcode a header constant to work around it. It also simplifies the question of what happens on older FreeBSD platforms that don't support O_CLOEXEC.