File:  [Research Unix] / researchv10no / cmd / nupas / ipc / dkconnect.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:35 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Norman

#include <stdio.h>
#include <dk.h>
#include <string.h>

extern int ipcdebug;


dk_connect(dest, param)
char *dest, *param;
{
	int fd;
	char *bp;
	extern int dk_verbose, dk_errno;
	extern char *dkerr();
	static short timeout=500;	/* read timeout in ms */
#ifdef DKR_BLOCK
	static short dkrmode[3] = {DKR_BLOCK|DKR_TIME, 0, 0};
#endif

	if (ipcdebug)
		fprintf(stderr, "dk_connect %s\n", dest);
	if ((bp = strchr(dest, '!')) != NULL)
		*bp = '.';

	if (ipcdebug)
		fprintf(stderr, "dk_connect %s\n", dest);
	dk_verbose = 0;
	if ((fd = dkdial(dest)) < 0) {
		ipcseterror(-fd, dkerr(dk_errno), "Can't connect");
	}
#ifdef 	TCDKITIME
	ioctl(fd, TCDKITIME, &timeout);
	ioctl(fd, DIOCRMODE, dkrmode);
#endif
	return(fd);
}

int
dk_close(fd)
int fd;
{
	write(fd, &fd, 0);	/* stub - is this useful or necessary? */
	return close(fd);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.