`fd` are 99.99% of the time `uintptr`. When you call the function, you convert your fd to int then convert it back to uintptr.. It would be best to keep uintptr as return type.