|
|
1.1 root 1: #include <stdio.h>
2: #include <dk.h>
3: #include <string.h>
4:
5: extern int ipcdebug;
6:
7:
8: dk_connect(dest, param)
9: char *dest, *param;
10: {
11: int fd;
12: char *bp;
13: extern int dk_verbose, dk_errno;
14: extern char *dkerr();
15: static short timeout=500; /* read timeout in ms */
16: #ifdef DKR_BLOCK
17: static short dkrmode[3] = {DKR_BLOCK|DKR_TIME, 0, 0};
18: #endif
19:
20: if (ipcdebug)
21: fprintf(stderr, "dk_connect %s\n", dest);
22: if ((bp = strchr(dest, '!')) != NULL)
23: *bp = '.';
24:
25: if (ipcdebug)
26: fprintf(stderr, "dk_connect %s\n", dest);
27: dk_verbose = 0;
28: if ((fd = dkdial(dest)) < 0) {
29: ipcseterror(-fd, dkerr(dk_errno), "Can't connect");
30: }
31: #ifdef TCDKITIME
32: ioctl(fd, TCDKITIME, &timeout);
33: ioctl(fd, DIOCRMODE, dkrmode);
34: #endif
35: return(fd);
36: }
37:
38: int
39: dk_close(fd)
40: int fd;
41: {
42: write(fd, &fd, 0); /* stub - is this useful or necessary? */
43: return close(fd);
44: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.