#include #include #include #include int main () { char buffer[64]; int fd = socket (PF_INET, SOCK_RAW, IPPROTO_RAW); if (fd < 0) { fprintf (stderr, "Can't create raw socket: %s\n", strerror (errno)); return 1; } /* On a buggy kernel the next line generates an oops, on a fixed kernel it returns -1 with errno == EINVAL. */ sendto (fd, buffer, 64, 0, NULL, 16); printf ("sendto() => %s\n", strerror (errno)); close (fd); }