user8755398
user8755398

Reputation:

Updateing code to swift 4 results in an error message

I wan to update this code to swift 4:

rc = select(socket_fd + 1, readfd, writefd, NULL, &timeout);

return rc;
  }

But I get two errors:

Declaration of 'select' must be imported from module 'Darwin.POSIX.sys.time' before it is required
Implicit declaration of function 'select' is invalid in C99

How can I can fix this?

Upvotes: 2

Views: 1078

Answers (1)

aaron
aaron

Reputation: 43138

Add this near the top of your file:

#include <sys/time.h>

Upvotes: 8

Related Questions