backport to Mac OS X