:i	static char d_socket_sccs_id[] = "%W% %G%";
:1#include "V.h"
/*
* On ESIX systems, the socket() and related routines require that you link to
* the -lnet library, which is /usr/lib/liblan.a; the header files are kept in
* the /usr/include/lan directory.  Other Sys/V machines are likely similar.
*/
d_socket(af, type, protocol)
	int   af;
	int   type;
	int   protocol;
{	int   e, sock;
:f	Fenter("d_socket");
:8	V8 "socket(%d,%d,%d)" ,af,type,protocol D;
	errno = 0;
	sock = socket(af, type, protocol);
	e = errno;
:6	V6 "socket(%d,%d,%d)=%d [Err %d=%s=%s]",af,type,protocol,sock,Errinfo D;
	if (sock >= 0) {
		d_newfile(File_LOCAL|File_PIPE|File_SOCK,sock,"[socket]",0);
	}
	errno = e;
:f	Fexit;
	return sock;
}
