Maybe like this?

```c
int uv__dup2_cloexec(int oldfd, int newfd) {
#if defined(__FreeBSD__) && __FreeBSD__ >= 10
  int r;
  do
    r = dup3(oldfd, newfd, O_CLOEXEC);
  while (r == -1 && errno == EINTR);
  if (r < 0)
    return -errno;
  return r;
#else
# if defined(__linux__)
  // ...
# elif /* etc. */
# endif
#endif
/* fall through goes here */
#endif
}
```