/* taka proba zasmiecenia dmesg-a przez wypisywanie ciagle "is usuing obsolete
 * setsockopt SO_BSDCOMPAT" :)  
 * ale jest to nie wypal bo kernel sie chroni sam bo w kernelu jest(net/sock/core.c):
 
static void sock_warn_obsolete_bsdism(const char *name)
{
        static int warned;
        static char warncomm[TASK_COMM_LEN];
        if (strcmp(warncomm, current->comm) && warned < 5) {
                strcpy(warncomm,  current->comm);
                printk(KERN_WARNING "process `%s' is using obsolete "
                       "%s SO_BSDCOMPAT\n", warncomm, name);
                warned++;
        }
}

 nie dziala bo jest "static int warned"

 */
 
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <error.h>

int main()
{
	int on = 1;
	int s = socket(PF_INET, SOCK_STREAM, 0);
	if(s < 0) {
		perror("socket():");
		exit(1);
	}
	
	if(setsockopt(s, SOL_SOCKET, SO_BSDCOMPAT, (void *)&on, sizeof(on)) < 0) {
		perror("setsockopt():");
		exit(2);
	}
	printf("socketid=%d\n", s);
	
	return 0;
}



