Fixed function prototypes to be same with APIs.
Added NOS-specific code block not to pick Unix-specific code.
Fixed declarations of int to long for 16-bit MCU (MSP430)