en0 in promiscuous mode

hi,
How to put “en0” i promiscuous mode.
The following code doesnt seem to work .
I pass “en0” for interface.
After “Setting interface ::: en0 ::: to promisc” is printed , i get a
message “no process existing”.

thanks in advance
Sarath

CODE******
int Set_Promisc(char *interface, int sock ) {
struct ifreq ifr;
strncpy(ifr.ifr_name, interface,strnlen(interface)+1);
if((ioctl(sock, SIOCGIFFLAGS, &ifr) == -1)) {
/Could not retrieve flags for the interface/
perror(“Could not retrive flags for the interface”);
exit(0);
}
printf(“The interface is ::: %s\n”, interface);
perror(“Retrieved flags from interface successfully”);

/now that the flags have been retrieved/
/* set the flags to PROMISC */
ifr.ifr_flags |= IFF_PROMISC;
if (ioctl (sock, SIOCSIFFLAGS, &ifr) == -1 ) {
/*Could not set the flags on the interface */
perror(“Could not set the PROMISC flag:”);
exit(0);
}
printf(“Setting interface ::: %s ::: to promisc” interface);

return(0);
}