Objective-C : Incorrect UNIX API usage