Recently in FreeBSD waitid was implemented[1] this includes:
* waitid function, implemented via wait6 syscall
* option flags WEXITED WTRAPPED added
More details & patch in the PR linked.
This is now available in prerelease FreeBSD 9.2 (I'm using 9.2-rc2). I
have verified and tested that it works correctly for my needs.
[1] http://www.freebsd.org/cgi/query-pr.cgi?pr=170346&cat=
Can it please be added to eglibc as used by Debian/kFreeBSD ports? the
9.2 kernel is already available in Debian. (If possible in sid, or
e.g. at least in experimental)
I can help writting a patch, but I have no prior knoweledge in hacking eglibc.