10 /* socket extensions */
12 #include <sys/socket.h>
16 /* we can't avoid overrunning npath because we don't know how big it is. */
18 _sock_srvname(char *npath, char *path)
22 strcpy(npath, "/srv/UD.");
23 p = strrchr(path, '/');
32 _sock_srv(char *path, int fd)
37 /* change the path to something in srv */
38 _sock_srvname(msg, path);
40 /* remove any previous instance */
43 /* put the fd in /srv and then close it */
44 sfd = creat(msg, 0666);
49 snprintf(msg, sizeof msg, "%d", fd);
50 if(write(sfd, msg, strlen(msg)) < 0){