Check for mkstemp, added a port implementation if it is not