Added some function to port.h