-2

If an error occurs, I need to return ENOENT but I'm not sure which library this is from and surprisingly nothing came up on a Google search.

User
  • 23,729
  • 38
  • 124
  • 207

2 Answers2

4
#include <errno.h>

See errno(3).

Thomas
  • 174,939
  • 50
  • 355
  • 478
1

There are many errors that can occur anytime. You can use #include <errno.h> or you can copy this function to your code, it contain all the network errors that may occur anytime. You can also use strerror() and perror() to get description of the error by it's error number.

udit043
  • 1,610
  • 3
  • 22
  • 40