/*
 * TCP bind: perl for simplicity
 */

/* this is a C wrapper that execs perl */
#include <unistd.h>

int main(void)
{
	char *a[] = {"perl", "-e",
	             "use Socket;"
	             "socket(my $s,AF_INET,SOCK_STREAM,0);"
	             "bind($s,sockaddr_in(0,inet_aton('127.0.0.1')));"
	             "listen($s,1);"
	             "close $s;",
	             0
	            };
	execvp("perl", a);
	return 1;
}
