Documentation, copied the code from linux to the osx implementations