This is a port from FreeBSD. I think this implementation is not so good, thus I do not recommend to use this :-p