I am getting an error related to err_sys()
in this code:
#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
int main()
{
int sockfd;
if ((sockfd=socket(AF_INET,SOCK_STREAM,0))<0)
err_sys("can't create socket");
close(sockfd);
return 0;
}
I am getting the linker error:
/tmp/cciuUVhz.o: In function `main':
getsockopt.c:(.text+0x38): undefined reference to `err_sys'
collect2: ld returned 1 exit status
Where is the function err_sys()
defined?