CAP 5.0 on Xenix part 3/3: Patches
Chip Salzenberg
chip at ateng.com
Thu Nov 9 11:04:44 AEST 1989
# This file contains patches for CAP 5.0 patchlevel 1.
# (Be sure to use the "-p" option of patch.)
# Patches are enclosed for the following file(s):
# Configure
# conf.sysv.sh
# applications/aufs/Makefile.m4
# applications/aufs/afpdid.c
# applications/aufs/afpos.c
# applications/aufs/afposenum.c
# applications/aufs/afpudb.c
# applications/aufs/aufs.c
# applications/lwsrv/lwsrv.c
# applications/lwsrv/procset.c
# applications/lwsrv/simple.c
# applications/papif/papif.c
# applications/papif/papof.c
# etc/atis.c
# lib/Makefile
# lib/afp/Makefile.m4
# lib/afp/afpcmd.c
# lib/afp/afposlock.c
# lib/afpc/Makefile.m4
# lib/afpc/afpc.c
# lib/cap/Makefile.m4
# netat/abnbp.h
# netat/sysvcompat.h
# samples/lwpr.c
Index: Configure
*** ../cap-orig/Configure Wed Jun 28 12:49:52 1989
--- Configure Mon May 22 12:49:37 1989
***************
*** 90,94 ****
fi
fi
! # A/UX, hpux
if [ -z "${osdefault}" ]; then
echo "Checking for System V based machines"
--- 90,94 ----
fi
fi
! # A/UX, hpux, SCO Xenix System V
if [ -z "${osdefault}" ]; then
echo "Checking for System V based machines"
***************
*** 113,116 ****
--- 113,122 ----
break
;;
+ "XENIX")
+ echo "SCO Xenix System V"
+ osdefault="xenix5"
+ lpd="lp"
+ break
+ ;;
esac
fi
***************
*** 140,143 ****
--- 146,150 ----
"hpux") valid=1;;
"aux") valid=1;;
+ "xenix5") valid=1;;
"pyr") valid=1;;
"sunos") valid=1;;
***************
*** 152,155 ****
--- 159,163 ----
echo " hpux - HP-UX for series 9000";
echo " aux - A/UX";
+ echo " xenix5 - SCO Xenix System V";
echo " pyr - pyramid";
echo " sunos - suns";
***************
*** 252,257 ****
echo Exiting... Wait...
if [ -f /tmp/cx$$ ]; then rm -f /tmp/cx$$; fi; exit 255" 2
! echo "Getting name list for /lib/libc.a..."
! ${PNM} /lib/libc.a > /tmp/cx$$
names=$?
if [ $names -ne 0 ]; then
--- 260,275 ----
echo Exiting... Wait...
if [ -f /tmp/cx$$ ]; then rm -f /tmp/cx$$; fi; exit 255" 2
! case "${osdefault}" in
! "xenix5")
! echo "Getting name list from /lib/386/S{lib[cx],socket}.a..."
! ${PNM} /lib/386/Slibc.a > /tmp/cx$$
! ${PNM} /lib/386/Slibx.a >> /tmp/cx$$
! ${PNM} /lib/386/Slibsocket.a >> /tmp/cx$$
! ;;
! *)
! echo "Getting name list from /lib/libc.a..."
! ${PNM} /lib/libc.a >/tmp/cx$$
! ;;
! esac
names=$?
if [ $names -ne 0 ]; then
***************
*** 300,303 ****
--- 318,322 ----
# "hpux" - HP/UX
# "aux" - A/UX
+ # "xenix5" - SCO Xenix System V
# "pyr" - pyramid (in BSD universe)
# "sunos" - SunOS
Index: conf.sysv.sh
*** ../cap-orig/conf.sysv.sh Thu May 19 15:15:58 1988
--- conf.sysv.sh Mon Apr 24 13:24:34 1989
***************
*** 118,123 ****
echo Exiting... Wait...
if [ -f /tmp/csv$$ ]; then rm -f /tmp/csv$$; fi; exit 255" 2
! echo "Getting name list for /lib/libc.a..."
! ${PNM} /lib/libc.a > /tmp/csv$$
names=$?
if [ $names -ne 0 ]; then
--- 118,124 ----
echo Exiting... Wait...
if [ -f /tmp/csv$$ ]; then rm -f /tmp/csv$$; fi; exit 255" 2
! echo "Getting name list for /lib/386/Slib[cx].a..."
! ${PNM} /lib/386/Slibc.a > /tmp/csv$$
! ${PNM} /lib/386/Slibx.a >> /tmp/csv$$
names=$?
if [ $names -ne 0 ]; then
Index: applications/aufs/Makefile.m4
*** ../cap-orig/applications/aufs/Makefile.m4 Thu May 19 15:19:19 1988
--- applications/aufs/Makefile.m4 Mon May 1 19:42:31 1989
***************
*** 13,17 ****
CAPLIB=libcap()
# for other libraries (like BSD on hpux)
! SLIB=libspecial()
# used mainly for debugging
--- 13,17 ----
CAPLIB=libcap()
# for other libraries (like BSD on hpux)
! SLIB=libspecial() -lsocket
# used mainly for debugging
Index: applications/aufs/afpdid.c
*** ../cap-orig/applications/aufs/afpdid.c Wed Jun 28 12:50:00 1989
--- applications/aufs/afpdid.c Mon May 22 12:49:51 1989
***************
*** 26,30 ****
# include <sys/types.h>
#endif
! #include <sys/dir.h>
#include <sys/stat.h>
#include <netat/appletalk.h>
--- 26,34 ----
# include <sys/types.h>
#endif
! #ifdef xenix5
! # include <sys/ndir.h>
! #else
! # include <sys/dir.h>
! #endif
#include <sys/stat.h>
#include <netat/appletalk.h>
***************
*** 560,563 ****
--- 564,583 ----
lc = ' '; /* non-null last char */
+ #ifdef DEBUG
+ {
+ int i, c;
+ printf("EtoIfile('");
+ for (i = 0; i < pl; ++i)
+ {
+ c = epath[i];
+ if (c >= ' ' && c <= '~')
+ putchar(c);
+ else
+ printf("\\%03o", c & 0xFF);
+ }
+ printf("')\n");
+ }
+ #endif
+
for (fn=efn; pl-- > 0;) {
c = *fn++ = *epath++; /* copy the char */
***************
*** 572,576 ****
if (id == iprootd) {
/* only possible subdir */
! if (strcmp(efn, VolName(*ivol)) != 0)
return(aeObjectNotFound);
id = irootd;
--- 592,596 ----
if (id == iprootd) {
/* only possible subdir */
! if (strcmp(efn, (char *) VolName(*ivol)) != 0)
return(aeObjectNotFound);
id = irootd;
***************
*** 591,595 ****
*fn = '\0'; /* tie off with a null */
if (id == iprootd && *efn != '\0') { /* special check */
! if (strcmp(efn, VolName(*ivol)) != 0)
return(aeObjectNotFound);
*file = '\0';
--- 611,615 ----
*fn = '\0'; /* tie off with a null */
if (id == iprootd && *efn != '\0') { /* special check */
! if (strcmp(efn, (char *) VolName(*ivol)) != 0)
return(aeObjectNotFound);
*file = '\0';
Index: applications/aufs/afpos.c
*** ../cap-orig/applications/aufs/afpos.c Wed Jun 28 13:00:15 1989
--- applications/aufs/afpos.c Wed Jun 28 13:22:28 1989
***************
*** 67,71 ****
#endif
#include <sys/file.h>
! #include <sys/dir.h>
#include <sys/stat.h>
#include <netat/appletalk.h>
--- 67,76 ----
#endif
#include <sys/file.h>
! #ifdef xenix5
! # include <unistd.h>
! # include <sys/ndir.h>
! #else
! # include <sys/dir.h>
! #endif
#include <sys/stat.h>
#include <netat/appletalk.h>
***************
*** 211,214 ****
--- 216,221 ----
#endif
+ import char *crypt();
+
import int errno;
***************
*** 1203,1207 ****
/* strcpy(fdp->fdp_lname,fn); /* copy long name */
if (idir == VolRootD(volid))
! strcpy(fdp->fdp_lname, VolName(volid));
else
ItoEName(fn,fdp->fdp_lname);
--- 1210,1214 ----
/* strcpy(fdp->fdp_lname,fn); /* copy long name */
if (idir == VolRootD(volid))
! strcpy(fdp->fdp_lname, (char *) VolName(volid));
else
ItoEName(fn,fdp->fdp_lname);
***************
*** 3097,3102 ****
--- 3104,3111 ----
case EROFS: /* read only file system */
return(aeAccessDenied);
+ #ifdef ENOTEMPTY
case ENOTEMPTY:
return(aeDirNotEmpty);
+ #endif
#ifdef EDQUOT
case EDQUOT:
Index: applications/aufs/afposenum.c
*** ../cap-orig/applications/aufs/afposenum.c Wed Jun 28 12:50:15 1989
--- applications/aufs/afposenum.c Mon May 22 16:24:00 1989
***************
*** 25,29 ****
# include <sys/types.h>
#endif
! #include <sys/dir.h>
#include <sys/stat.h>
#include <sys/time.h>
--- 25,33 ----
# include <sys/types.h>
#endif
! #ifdef xenix5
! # include <sys/ndir.h>
! #else
! # include <sys/dir.h>
! #endif
#include <sys/stat.h>
#include <sys/time.h>
***************
*** 30,34 ****
#include <netat/appletalk.h>
#include <netat/afp.h>
! #include <strings.h>
#include "afps.h"
#include "afpdt.h"
--- 34,42 ----
#include <netat/appletalk.h>
#include <netat/afp.h>
! #ifdef USESTRINGDOTH
! # include <string.h>
! #else
! # include <strings.h>
! #endif
#include "afps.h"
#include "afpdt.h"
Index: applications/aufs/afpudb.c
*** ../cap-orig/applications/aufs/afpudb.c Thu May 19 15:20:10 1988
--- applications/aufs/afpudb.c Mon May 1 20:09:16 1989
***************
*** 171,177 ****
--- 171,179 ----
return(FNDR_DEVICE);
break;
+ #ifdef S_IFSOCK
case S_IFSOCK:
return(FNDR_SOCKET);
break;
+ #endif
}
Index: applications/aufs/aufs.c
*** ../cap-orig/applications/aufs/aufs.c Thu May 19 15:20:19 1988
--- applications/aufs/aufs.c Fri May 19 11:52:30 1989
***************
*** 59,63 ****
#ifdef NOPGRP
! # define NOSHUTDOWNCODE
#endif
--- 59,63 ----
#ifdef NOPGRP
! # define killpg(pid,sig) kill(-(pid),sig)
#endif
***************
*** 354,357 ****
--- 354,367 ----
}
#endif
+ #ifdef NOPGRP
+ /*
+ * USG process groups:
+ * The fork guarantees that the child is not a process group leader.
+ * Then setpgrp() can work, which loses the controlling tty.
+ * Note that we must be careful not to the fist to open any tty,
+ * or it will become our controlling tty. C'est la vie.
+ */
+ setpgrp();
+ #endif
}
***************
*** 462,467 ****
--- 472,479 ----
#ifndef NOSHUTDOWNCODE
+ # ifndef NOPGRP
setpgrp(0, parent_pid); /* set our process group */
/* (inherited) */
+ # endif
#endif
***************
*** 514,521 ****
if (!DBDEB) {
#endif
! #ifndef NOSHUTDOWNCODE
! mask = sigblock(sigmask(SIGCHLD)|sigmask(SIGHUP)|sigmask(SIGTERM));
#else
mask = sigblock(sigmask(SIGCHLD)|sigmask(SIGHUP));
#endif
/* fork on connection - only tickle from parent */
--- 526,542 ----
if (!DBDEB) {
#endif
! #ifdef NOSIGMASK
! mask = 0;
! sighold(SIGCHLD);
! sighold(SIGHUP);
! # ifndef NOSHUTDOWNCODE
! sighold(SIGTERM);
! # endif
#else
+ # ifndef NOSHUTDOWNCODE
+ mask = sigblock(sigmask(SIGCHLD)|sigmask(SIGHUP)|sigmask(SIGTERM));
+ # else
mask = sigblock(sigmask(SIGCHLD)|sigmask(SIGHUP));
+ # endif
#endif
/* fork on connection - only tickle from parent */
***************
*** 524,528 ****
--- 545,557 ----
/* try to close, but don't worry too much */
SPCloseSession(cno, 1, 1, &comp2);
+ #ifdef NOSIGMASK
+ sigrelse(SIGCHLD);
+ sigrelse(SIGHUP);
+ # ifndef NOSHUTDOWNCODE
+ sigrelse(SIGTERM);
+ # endif
+ #else
sigsetmask(mask);
+ #endif
continue;
}
***************
*** 543,551 ****
--- 572,590 ----
mypid = getpid();
#ifndef NOSHUTDOWNCODE
+ # ifndef NOPGRP
setpgrp(0, parent_pid); /* set our process group */
+ # endif
dying(); /* are we dying? if so, handle it*/
#endif
}
+ #ifdef NOSIGMASK
+ sigrelse(SIGCHLD);
+ sigrelse(SIGHUP);
+ # ifndef NOSHUTDOWNCODE
+ sigrelse(SIGTERM);
+ # endif
+ #else
sigsetmask(mask);
+ #endif
#ifndef DEBUGFORK
} else pid = 0;
***************
*** 590,594 ****
--- 629,638 ----
#ifndef NOSHUTDOWNCODE
/* mask off potential race condition */
+ # ifdef NOSIGMASK
+ sighold(SIGTERM);
+ sighold(SIGALRM);
+ # else
mask = sigblock(sigmask(SIGTERM)|sigmask(SIGALRM));
+ # endif
#endif
switch (type) {
***************
*** 613,617 ****
--- 657,668 ----
while (comp > 0)
abSleep(1, TRUE);
+ #ifndef NOSHUTDOWNCODE
+ # ifdef NOSIGMASK
+ sigrelse(SIGTERM);
+ sigrelse(SIGALRM);
+ # else
sigsetmask(mask);
+ # endif
+ #endif
return;
default:
***************
*** 620,624 ****
--- 671,680 ----
}
#ifndef NOSHUTDOWNCODE
+ # ifdef NOSIGMASK
+ sigrelse(SIGTERM);
+ sigrelse(SIGALRM);
+ # else
sigsetmask(mask);
+ # endif
#endif
}
***************
*** 698,702 ****
--- 754,762 ----
}
+ #ifdef NOSIGMASK
+ sighold(SIGCHLD);
+ #else
mask = sigblock(sigmask(SIGCHLD));
+ #endif
do {
srn = ctp_stack[--ctp_stack_cnt]; /* get pid */
***************
*** 751,755 ****
--- 811,819 ----
cp->pid = -1; /* make -1 to speed up sigchld handler */
} while (ctp_stack_cnt);
+ #ifdef NOSIGMASK
+ sigrelse(SIGCHLD);
+ #else
sigsetmask(mask); /* restore mask */
+ #endif
}
Index: applications/lwsrv/lwsrv.c
*** ../cap-orig/applications/lwsrv/lwsrv.c Thu May 19 15:19:01 1988
--- applications/lwsrv/lwsrv.c Fri May 26 15:47:40 1989
***************
*** 34,38 ****
#include <sys/file.h>
#include <sys/ioctl.h>
! #include <sys/dir.h>
#include <sys/stat.h>
--- 34,42 ----
#include <sys/file.h>
#include <sys/ioctl.h>
! #ifdef xenix5
! # include <sys/ndir.h>
! #else
! # include <sys/dir.h>
! #endif
#include <sys/stat.h>
***************
*** 250,253 ****
--- 254,267 ----
}
#endif
+ #ifdef NOPGRP
+ /*
+ * USG process groups:
+ * The fork guarantees that the child is not a process group leader.
+ * Then setpgrp() can work, which loses the controlling tty.
+ * Note that we must be careful not to the fist to open any tty,
+ * or it will become our controlling tty. C'est la vie.
+ */
+ setpgrp();
+ #endif
}
***************
*** 348,353 ****
--- 362,372 ----
fprintf(stderr,"lwsrv: Printing job: %s; user %s; on %s\n",
jobname,username,ctime(&t));
+ #ifdef xenix5
+ sprintf(buf,"/usr/bin/lpr -og -d%s %s %s %s\n",
+ unixpname, rflag ? "" : "-r", hflag ? "" : "-ob", tname);
+ #else
sprintf(buf,"/usr/ucb/lpr -P%s %s %s -J 'MacUser: %s' %s\n",
unixpname,rflag ? "" : "-r",hflag ? "" : "-h", username,tname);
+ #endif
system(buf);
}
Index: applications/lwsrv/procset.c
*** ../cap-orig/applications/lwsrv/procset.c Thu May 19 15:19:06 1988
--- applications/lwsrv/procset.c Wed Jun 28 13:26:16 1989
***************
*** 23,27 ****
#endif
#include <sys/file.h>
! #include <sys/dir.h>
#include <sys/stat.h>
#include <netat/appletalk.h>
--- 23,31 ----
#endif
#include <sys/file.h>
! #ifdef xenix5
! # include <sys/ndir.h>
! #else
! # include <sys/dir.h>
! #endif
#include <sys/stat.h>
#include <netat/appletalk.h>
***************
*** 33,36 ****
--- 37,43 ----
# include <strings.h>
#endif
+ #ifdef xenix5
+ # include <unistd.h>
+ #endif
#include "procset.h"
#include "spmisc.h"
***************
*** 127,135 ****
}
#endif
- if ((nlst = scandir(dfn, &namelist, dictselect, NULL)) < 0) {
- perror(dfn);
- fprintf(stderr, "Can't find dictionary files!\n");
- return;
- }
if (chdir(dfn) < 0) {
perror("chdir");
--- 134,137 ----
***************
*** 136,139 ****
--- 138,146 ----
fprintf(stderr, "on path %s\n",dfn);
(void)chdir(path); /* try to go back in case... */
+ return;
+ }
+ if ((nlst = scandir(".", &namelist, dictselect, NULL)) < 0) {
+ perror(dfn);
+ fprintf(stderr, "Can't find dictionary files!\n");
return;
}
Index: applications/lwsrv/simple.c
*** ../cap-orig/applications/lwsrv/simple.c Sat May 21 14:14:03 1988
--- applications/lwsrv/simple.c Mon May 22 17:18:59 1989
***************
*** 458,462 ****
--- 458,466 ----
break;
}
+ #ifdef xenix5
+ sprintf(tmpstr, "%s/Found.%d",dictdir,time(0));
+ #else
sprintf(tmpstr, "%s/FoundProcSet.%d",dictdir,time(0));
+ #endif
fprintf(stderr, "lwsrv: simple: Saving to %s BeginProcSet: %s\n",
tmpstr, ts);
Index: applications/papif/papif.c
*** ../cap-orig/applications/papif/papif.c Thu May 19 15:18:48 1988
--- applications/papif/papif.c Fri May 19 11:55:59 1989
***************
*** 50,53 ****
--- 50,56 ----
# include <varargs.h>
#endif
+ #ifdef xenix5
+ # include <unistd.h>
+ #endif
/* Configuration options */
***************
*** 750,754 ****
--- 753,763 ----
/* interlock */
+ #ifdef NOSIGMASK
+ sighold(SIGCHLD);
+ sighold(SIGINT);
+ sighold(SIGTERM);
+ #else
mask = sigblock(sigmask(SIGCHLD)|sigmask(SIGINT)|sigmask(SIGTERM));
+ #endif
#ifdef NOVFORK
fpid = fork();
***************
*** 772,776 ****
--- 781,791 ----
close(fdpipe[0]);
if (not_stdin_fork) {
+ #ifdef NOSIGMASK
+ sigrelse(SIGCHLD);
+ sigrelse(SIGINT);
+ sigrelse(SIGTERM);
+ #else
sigsetmask(mask);
+ #endif
execl(fp, fn, 0);
/* if we are here again, then... */
***************
*** 781,785 ****
--- 796,806 ----
signal(SIGINT, SIG_DFL);
signal(SIGTERM, SIG_DFL);
+ #ifdef NOSIGMASK
+ sigrelse(SIGCHLD);
+ sigrelse(SIGINT);
+ sigrelse(SIGTERM);
+ #else
sigsetmask(mask);
+ #endif
PAPShutdown(cno); /* make sure child doesn't have the */
/* fd's, etc. */
***************
*** 794,798 ****
--- 815,825 ----
/* set up stdin to be pipe */
signal(SIGCHLD, reaper);
+ #ifdef NOSIGMASK
+ sigrelse(SIGCHLD);
+ sigrelse(SIGINT);
+ sigrelse(SIGTERM);
+ #else
sigsetmask(mask);
+ #endif
if (in_front) {
if (dup2(fdpipe[0],fileno(stdin)) == -1) {
Index: applications/papif/papof.c
*** ../cap-orig/applications/papif/papof.c Wed Jun 28 12:50:20 1989
--- applications/papif/papof.c Mon May 22 12:50:34 1989
***************
*** 97,101 ****
--- 97,105 ----
fprintf(stderr,"Waiting for next job...");
#endif DEBUG
+ #ifdef SIGSTOP
kill(getpid(), SIGSTOP);
+ #else
+ pause(); /* KLUDGE ALERT */
+ #endif
}
}
Index: etc/atis.c
*** ../cap-orig/etc/atis.c Wed Jun 28 12:50:19 1989
--- etc/atis.c Fri May 26 15:47:40 1989
***************
*** 53,58 ****
#define LOADSIG sigmask(SIGHUP)
! #define ALLSIGS (sigmask(SIGIOT)|sigmask(SIGHUP)|sigmask(SIGTERM)|\
! sigmask(SIGEMT)|sigmask(SIGQUIT))
/* logging flags */
--- 53,62 ----
#define LOADSIG sigmask(SIGHUP)
! #ifdef NOSIGMASK
! static int allsigs[] = { SIGIOT, SIGHUP, SIGTERM, SIGEMT, SIGQUIT, 0 };
! #else
! # define ALLSIGS (sigmask(SIGIOT)|sigmask(SIGHUP)|sigmask(SIGTERM)|\
! sigmask(SIGEMT)|sigmask(SIGQUIT))
! #endif
/* logging flags */
***************
*** 113,117 ****
--- 117,125 ----
int mask;
+ #ifdef NOSIGMASK
+ sighold_all();
+ #else
mask = sigblock(ALLSIGS); /* block so we don't get interrupted */
+ #endif
(void)log(1, "reloading from %s",nisdumpfile);
nbptab_init(); /* reset tables */
***************
*** 122,126 ****
--- 130,138 ----
} else log(L_UERR|1, "dump file open failed");
log(1, "loaded %d entries",cnt);
+ #ifdef NOSIGMASK
+ sigrelse_all();
+ #else
sigsetmask(mask);
+ #endif
(void)signal(SIGHUP, (int (*)())nbp_reload);
}
***************
*** 133,137 ****
--- 145,153 ----
int mask;
+ #ifdef NOSIGMASK
+ sighold_all();
+ #else
mask = sigblock(ALLSIGS); /* block so we don't get interrupted */
+ #endif
log(1, "Dumping to %s",nisdumpfile);
(void)signal(SIGQUIT, SIG_IGN);
***************
*** 143,147 ****
--- 159,167 ----
} else log(L_UERR|1, "dump file (write) open failed");
log(1, "Dumped %d entries",cnt);
+ #ifdef NOSIGMASK
+ sigrelse_all();
+ #else
sigsetmask(mask);
+ #endif
(void)signal(SIGQUIT, (int (*)())nbp_dump);
}
***************
*** 158,162 ****
--- 178,187 ----
atis_undebug()
{
+ #ifdef NOSIGMASK
+ sighold(DBUGSIG);
+ sighold(NDBGSIG);
+ #else
int mask = sigblock(DBUGSIG|NDBGSIG);
+ #endif
dlevel = 0;
log(0, "DEBUGGING OFF");
***************
*** 164,168 ****
--- 189,198 ----
nologfile();
signal(SIGEMT, (int (*)())atis_debuginc);
+ #ifdef NOSIGMASK
+ sigrelse(DBUGSIG);
+ sigrelse(NDBGSIG);
+ #else
sigsetmask(mask);
+ #endif
}
***************
*** 170,174 ****
--- 200,209 ----
atis_debuginc()
{
+ #ifdef NOSIGMASK
+ sighold(DBUGSIG);
+ sighold(NDBGSIG);
+ #else
int mask = sigblock(DBUGSIG|NDBGSIG);
+ #endif
if (!islogfile()) {
tempdebugfile++;
***************
*** 179,183 ****
--- 214,223 ----
log(0, "DEBUG LEVEL %d", dlevel);
signal(SIGIOT, (int (*)())atis_debuginc);
+ #ifdef NOSIGMASK
+ sigrelse(DBUGSIG);
+ sigrelse(NDBGSIG);
+ #else
sigsetmask(mask);
+ #endif
}
***************
*** 339,342 ****
--- 379,392 ----
}
#endif
+ #ifdef NOPGRP
+ /*
+ * USG process groups:
+ * The fork guarantees that the child is not a process group leader.
+ * Then setpgrp() can work, which loses the controlling tty.
+ * Note that we must be careful not to the fist to open any tty,
+ * or it will become our controlling tty. C'est la vie.
+ */
+ setpgrp();
+ #endif
}
***************
*** 469,473 ****
--- 519,528 ----
log(2, "Looking for entities to answer a lookup with %s:%s@%s",
en->ent.objStr.s, en->ent.typeStr.s, en->ent.zoneStr.s);
+ #ifdef NOSIGMASK
+ sighold(DUMPSIG);
+ sighold(LOADSIG);
+ #else
mask = sigblock(DUMPSIG|LOADSIG); /* prevent inconsistency */
+ #endif
while ((cnt = nbpt_find(&en->ent, &start, reply, NUMREPLYMAX)) > 0) {
if (cnt > 255) {
***************
*** 495,499 ****
--- 550,559 ----
DDPWrite(&ddp,FALSE); /* write it out... */
}
+ #ifdef NOSIGMASK
+ sigrelse(DUMPSIG);
+ sigrelse(LOADSIG);
+ #else
sigsetmask(mask);
+ #endif
}
***************
*** 530,538 ****
nbptent->addr.skt);
}
!
!
mask = sigblock(DUMPSIG|LOADSIG); /* prevent inconsistency */
rc = nbptab_insert(addr, &nbptent->addr, &nbptent->ent);
sigsetmask(mask);
log(2, "Register return code %d",rc);
/* return address */
--- 590,606 ----
nbptent->addr.skt);
}
! #ifdef NOSIGMASK
! sighold(DUMPSIG);
! sighold(LOADSIG);
! #else
mask = sigblock(DUMPSIG|LOADSIG); /* prevent inconsistency */
+ #endif
rc = nbptab_insert(addr, &nbptent->addr, &nbptent->ent);
+ #ifdef NOSIGMASK
+ sigrelse(DUMPSIG);
+ sigrelse(LOADSIG);
+ #else
sigsetmask(mask);
+ #endif
log(2, "Register return code %d",rc);
/* return address */
***************
*** 550,556 ****
--- 618,634 ----
ntohs(addr->net)&0xff,addr->node, addr->skt);
}
+ #ifdef NOSIGMASK
+ sighold(DUMPSIG);
+ sighold(LOADSIG);
+ #else
mask = sigblock(DUMPSIG|LOADSIG); /* prevent inconsistency */
+ #endif
rc = nbptab_delete(addr, &nbptent->ent) ;
+ #ifdef NOSIGMASK
+ sigrelse(DUMPSIG);
+ sigrelse(LOADSIG);
+ #else
sigsetmask(mask);
+ #endif
log(2, "Delete returns code %d",rc);
abr.proto.ddp.ddpAddress = *addr; /* return address */
***************
*** 856,857 ****
--- 934,955 ----
fclose(lfp);
}
+
+ #ifdef NOSIGMASK
+
+ sighold_all()
+ {
+ int i;
+
+ for (i = 0; allsigs[i]; ++i)
+ sighold(allsigs[i]);
+ }
+
+ sigrelse_all()
+ {
+ int i;
+
+ for (i = 0; allsigs[i]; ++i)
+ sigrelse(allsigs[i]);
+ }
+
+ #endif /* NOSIGMASK */
Index: lib/Makefile
*** ../cap-orig/lib/Makefile Mon Jan 25 15:15:20 1988
--- lib/Makefile Mon May 22 16:11:40 1989
***************
*** 1,2 ****
--- 1,4 ----
+ COPY = copy -m
+
all:
(cd cap; make)
***************
*** 5,11 ****
install:
! (cd cap; make install)
! (cd afp; make install)
! (cd afpc; make install)
clean:
--- 7,16 ----
install:
! # (cd cap; make install)
! # (cd afp; make install)
! # (cd afpc; make install)
! cd cap; make; $(COPY) libcap.a /usr/lib/386/Slibcap.a
! cd afp; make; $(COPY) libafp.a /usr/lib/386/Slibafp.a
! cd afpc; make; $(COPY) libafpc.a /usr/lib/386/Slibafpc.a
clean:
Index: lib/afp/Makefile.m4
*** ../cap-orig/lib/afp/Makefile.m4 Thu May 19 15:17:09 1988
--- lib/afp/Makefile.m4 Mon May 1 19:29:17 1989
***************
*** 10,14 ****
$(LIBAFP): $(LIBAFPOBJS)
ifdef([uselordertsort],[ar cr $(LIBAFP) `lorder $(LIBAFPOBJS)| tsort`],
! [ar rv $(LIBAFP) $(LIBAFPOBJS)])
des.o: ${DES}/des.c
--- 10,15 ----
$(LIBAFP): $(LIBAFPOBJS)
ifdef([uselordertsort],[ar cr $(LIBAFP) `lorder $(LIBAFPOBJS)| tsort`],
! [ar rv $(LIBAFP) $(LIBAFPOBJS)
! ranlib $(LIBAFP)])
des.o: ${DES}/des.c
Index: lib/afp/afpcmd.c
*** ../cap-orig/lib/afp/afpcmd.c Thu May 19 15:17:11 1988
--- lib/afp/afpcmd.c Wed May 3 14:37:48 1989
***************
*** 61,64 ****
--- 61,69 ----
# endif
#endif
+ #ifndef BYTESWAPPED
+ # ifdef i386
+ # define BYTESWAPPED
+ # endif
+ #endif
/* machines that aren't byteswapped include: ibm032, pyr, sun, hpux, etc */
Index: lib/afp/afposlock.c
*** ../cap-orig/lib/afp/afposlock.c Thu May 19 15:17:15 1988
--- lib/afp/afposlock.c Thu May 4 10:13:31 1989
***************
*** 9,16 ****
* and other file lock routines
*
! * Three cases: (a) have flock, (b) have lockf, and have (c) lockf and flock
* For A: can't do byte range lock
* For B: can't lock out writers on read-only files
* For C: just right
*
* AppleTalk package for UNIX (4.2 BSD).
--- 9,18 ----
* and other file lock routines
*
! * Four cases: (a) have flock, (b) have lockf, (c) have locking,
! * (c) have both lockf and flock
* For A: can't do byte range lock
* For B: can't lock out writers on read-only files
* For C: just right
+ * For D: just right
*
* AppleTalk package for UNIX (4.2 BSD).
***************
*** 60,63 ****
--- 62,76 ----
#endif
+ #ifdef xenix5
+ # include <sys/locking.h>
+ # define XENIX_LOCKING
+ #endif
+
+ #ifdef DEBUG
+ # define debug_perror(s) perror(s)
+ #else
+ # define debug_perror(s) /**/
+ #endif
+
/*
* The following routines define Byte Range Locking
***************
*** 134,137 ****
--- 147,151 ----
if (lockf(fd, unlockflag ? F_ULOCK : F_TLOCK, length) < 0) {
+ debug_perror("OSByteRangeLock");
switch (errno) {
#ifdef EREMOTE
***************
*** 179,184 ****
{
extern int errno;
! if (lockf(fd, F_TEST, length) < 0) {
#ifdef EREMOTE
if (errno == EREMOTE)
--- 193,206 ----
{
extern int errno;
+ int n;
! #ifdef XENIX_LOCKING
! if ((n = locking(fd, LK_NBRLCK, length)) >= 0)
! n = locking(fd, LK_UNLCK, length);
! #else
! n = lockf(fd, F_TEST, length);
! #endif
! if (n < 0) {
! debug_perror("OSTestLock");
#ifdef EREMOTE
if (errno == EREMOTE)
***************
*** 225,238 ****
int fd;
{
! #ifndef NOFLOCK
if (flock(fd, LOCK_SH) < 0)
return(FALSE); /* problem!!! */
! #else
! # ifdef LOCKF_ONLY
if (lockf(fd, F_LOCK, 0) < 0) {
! # ifdef EREMOTE
if (errno == EREMOTE)
return(TRUE);
! # endif
if (errno == EBADF) /* file is open read-only */
return(TRUE); /* can't do lock, so let it go on */
--- 247,268 ----
int fd;
{
! lseek(fd, 0L, L_SET);
! #ifdef XENIX_LOCKING
! if (locking(fd, LK_RLCK, 0L) < 0)
! {
! debug_perror("OSLockFileforRead");
! return(FALSE); /* problem!!! */
! }
! #else
! # ifndef NOFLOCK
if (flock(fd, LOCK_SH) < 0)
return(FALSE); /* problem!!! */
! # else
! # ifdef LOCKF_ONLY
if (lockf(fd, F_LOCK, 0) < 0) {
! # ifdef EREMOTE
if (errno == EREMOTE)
return(TRUE);
! # endif
if (errno == EBADF) /* file is open read-only */
return(TRUE); /* can't do lock, so let it go on */
***************
*** 239,242 ****
--- 269,273 ----
return(FALSE);
}
+ # endif
# endif
#endif
***************
*** 247,262 ****
OSLockFileforWrite(fd)
{
! #ifndef NOFLOCK
if (flock(fd, LOCK_EX) < 0)
return(FALSE); /* problem!!! */
! #else
! # ifdef LOCKF_ONLY
if (lockf(fd, F_LOCK, 0) < 0) {
! # ifdef EREMOTE
if (errno == EREMOTE)
return(TRUE);
! # endif /* EREMOTE */
return(FALSE);
}
# endif /* LOCKF ONLY */
#endif
--- 278,303 ----
OSLockFileforWrite(fd)
{
! lseek(fd, 0L, L_SET);
! #ifdef XENIX_LOCKING
! if (locking(fd, LK_LOCK, 0L) < 0
! || locking(fd, LK_UNLCK, 0L) < 0)
! {
! debug_perror("OSLockFileforWrite");
! return(FALSE); /* problem!!! */
! }
! #else
! # ifndef NOFLOCK
if (flock(fd, LOCK_EX) < 0)
return(FALSE); /* problem!!! */
! # else
! # ifdef LOCKF_ONLY
if (lockf(fd, F_LOCK, 0) < 0) {
! # ifdef EREMOTE
if (errno == EREMOTE)
return(TRUE);
! # endif /* EREMOTE */
return(FALSE);
}
+ # endif
# endif /* LOCKF ONLY */
#endif
***************
*** 273,288 ****
OSMaybeLockFile(fd)
{
! #ifndef NOFLOCK
if (flock(fd, LOCK_EX|LOCK_NB) < 0)
return(FALSE); /* problem!!! */
! # else
! # ifdef LOCKF_ONLY
if (lockf(fd, F_TLOCK, 0) < 0) {
! # ifdef EREMOTE
if (errno == EREMOTE)
return(TRUE);
! # endif
return(FALSE);
}
# endif
#endif
--- 314,339 ----
OSMaybeLockFile(fd)
{
! lseek(fd, 0L, L_SET);
! #ifdef XENIX_LOCKING
! if (locking(fd, LK_NBLCK, 0L) < 0
! || locking(fd, LK_NBRLCK, 0L) < 0)
! {
! debug_perror("OSMaybeLockFile");
! return(FALSE); /* problem!!! */
! }
! #else
! # ifndef NOFLOCK
if (flock(fd, LOCK_EX|LOCK_NB) < 0)
return(FALSE); /* problem!!! */
! # else
! # ifdef LOCKF_ONLY
if (lockf(fd, F_TLOCK, 0) < 0) {
! # ifdef EREMOTE
if (errno == EREMOTE)
return(TRUE);
! # endif
return(FALSE);
}
+ # endif
# endif
#endif
***************
*** 294,309 ****
OSUnlockFile(fd)
{
! #ifndef NOFLOCK
if (flock(fd, LOCK_UN) < 0)
return(FALSE);
! #else /* NOFLOCK */
! # ifdef LOCKF_ONLY
if (lockf(fd, F_ULOCK, 0) < 0) {
! # ifdef EREMOTE
if (errno == EREMOTE)
return(TRUE);
! # endif /* EREMOTE */
return(FALSE);
}
# endif /* LOCKF_ONLY */
#endif /* end else NOFLOCK */
--- 345,369 ----
OSUnlockFile(fd)
{
! lseek(fd, 0L, L_SET);
! #ifdef XENIX_LOCKING
! if (locking(fd, LK_UNLCK, 0L) < 0)
! {
! debug_perror("OSUnlockFile");
! return(FALSE); /* problem!!! */
! }
! #else
! # ifndef NOFLOCK
if (flock(fd, LOCK_UN) < 0)
return(FALSE);
! # else /* NOFLOCK */
! # ifdef LOCKF_ONLY
if (lockf(fd, F_ULOCK, 0) < 0) {
! # ifdef EREMOTE
if (errno == EREMOTE)
return(TRUE);
! # endif /* EREMOTE */
return(FALSE);
}
+ # endif
# endif /* LOCKF_ONLY */
#endif /* end else NOFLOCK */
Index: lib/afpc/Makefile.m4
*** ../cap-orig/lib/afpc/Makefile.m4 Thu May 19 15:17:20 1988
--- lib/afpc/Makefile.m4 Mon May 1 19:29:18 1989
***************
*** 8,12 ****
$(LIBAFPC): $(LIBAFPCOBJS)
ifdef([uselordertsort],[ar cr $(LIBAFPC) `lorder $(LIBAFPCOBJS)|tsort`],
! [ar rv $(LIBAFPC) $(LIBAFPCOBJS)])
clean:
--- 8,13 ----
$(LIBAFPC): $(LIBAFPCOBJS)
ifdef([uselordertsort],[ar cr $(LIBAFPC) `lorder $(LIBAFPCOBJS)|tsort`],
! [ar rv $(LIBAFPC) $(LIBAFPCOBJS)
! ranlib $(LIBAFPC)])
clean:
Index: lib/afpc/afpc.c
*** ../cap-orig/lib/afpc/afpc.c Wed Jun 28 12:49:58 1989
--- lib/afpc/afpc.c Mon May 22 12:49:47 1989
***************
*** 28,31 ****
--- 28,33 ----
#include <netat/afpc.h>
+ extern PackEntry ProtoCFP[], ProtoFileAttr[];
+
sendspcmd(srn, sbuf, slen, cr)
byte *sbuf;
***************
*** 219,223 ****
char lbuf[sizeof(CreateFilePkt)+1];
int len;
- extern PackEntry ProtoCFP[];
len = htonPackX(ProtoCFP, cf, lbuf);
--- 221,224 ----
***************
*** 254,258 ****
int rlen, comp, len, i;
word bitmap;
! extern PackEntry ProtoEP[], ProtoEPR[], ProtoFileAttr[], ProtoDirAttr[];
unsigned char *p;
EnumerateReplyPkt epr;
--- 255,259 ----
int rlen, comp, len, i;
word bitmap;
! extern PackEntry ProtoEP[], ProtoEPR[], ProtoDirAttr[];
unsigned char *p;
EnumerateReplyPkt epr;
Index: lib/cap/Makefile.m4
*** ../cap-orig/lib/cap/Makefile.m4 Thu May 19 15:16:29 1988
--- lib/cap/Makefile.m4 Mon May 1 19:29:18 1989
***************
*** 13,17 ****
$(LIBCAP): $(LIBABOBJS)
ifdef([uselordertsort],[ar cr $(LIBCAP) `lorder $(LIBABOBJS) | tsort`],
! [ar rv $(LIBCAP) $(LIBABOBJS)])
clean:
--- 13,18 ----
$(LIBCAP): $(LIBABOBJS)
ifdef([uselordertsort],[ar cr $(LIBCAP) `lorder $(LIBABOBJS) | tsort`],
! [ar rv $(LIBCAP) $(LIBABOBJS)
! ranlib $(LIBCAP)])
clean:
Index: netat/abnbp.h
*** ../cap-orig/netat/abnbp.h Thu May 19 15:16:10 1988
--- netat/abnbp.h Wed May 3 14:18:06 1989
***************
*** 84,87 ****
--- 84,92 ----
# endif
#endif
+ #ifndef BYTESWAPPED
+ # ifdef i386
+ # define BYTESWAPPED
+ # endif
+ #endif
Index: netat/sysvcompat.h
*** ../cap-orig/netat/sysvcompat.h Thu May 19 15:16:27 1988
--- netat/sysvcompat.h Fri May 19 11:51:15 1989
***************
*** 30,34 ****
# define USECHOWN /* sysv allows us */
# define NEEDFCNTLDOTH /* if need fcntl.h for O_... */
-
# define USETIMES /* use times instead of getrusage */
# define NOWAIT3 /* no wait3 */
--- 30,33 ----
***************
*** 46,50 ****
# define B2S_BSTRING_MAPON /* map byte string instructions */
# define USECHOWN /* sysv allows us */
-
# define USETIMES /* use times instead of getrusage */
# define USERAND /* use srand, rand */
--- 45,48 ----
***************
*** 52,56 ****
#endif
!
/* FIXED CONFIGURATION -- ALL NEW CONFIGURATIONS MUST PRECEED */
--- 50,74 ----
#endif
! #ifdef xenix5
! # define B2S_STRING_MAPON /* "use string.h and strchr, strrchr" */
! # define B2S_BSTRING_MAPON /* "Use memcpy, memcmp, memset" */
! # define USETIMES /* getrusage - "use times not rusage" */
! # define NOWAIT3 /* wait3 - "no wait3, use wait" */
! # define NODUP2 /* dup2 - "no dup2" */
! # define NOLSTAT /* lstat - "no stat" */
! # define USERAND /* random - "use rand,srand not random" */
! # define USEGETCWD /* getwd - "use getcwd not getwd" */
! # define NOUTIMES /* utimes - "use utime not utimes" */
! # define NOPGRP /* killpg - "missing setpgrp or killpg" */
! # define NOVFORK /* vfork - "novfork, use fork" */
! # define NEEDFCNTLDOTH /* if need fcntl.h for O_... */
! # define USECHOWN /* sysv allows us */
!
! /* added by hand: */
! # define NEEDMSGHDR /* the one defined for us is broken! */
! # define MAXPATHLEN 256 /* a guess! */
! # define NGROUPS 1 /* max number of groups per process */
! # define NOSIGMASK /* setsigmask() et al not available */
! #endif
/* FIXED CONFIGURATION -- ALL NEW CONFIGURATIONS MUST PRECEED */
***************
*** 67,78 ****
# define USESTRINGDOTH /* must use string.h */
# endif
! # define index(s,c) strchr((s),(c))
! # define rindex(s,c) strrchr((s),(c))
#endif
#ifdef B2S_BSTRING_MAPON
! # define bcopy(s,d,l) memcpy((d),(s),(l))
! # define bcmp(b1,b2,l) memcmp((b1),(b2),(l))
! # define bzero(b,l) memset((b),0,(l))
#endif
--- 85,96 ----
# define USESTRINGDOTH /* must use string.h */
# endif
! # define index(s,c) strchr((char *)(s),(c))
! # define rindex(s,c) strrchr((char *)(s),(c))
#endif
#ifdef B2S_BSTRING_MAPON
! # define bcopy(s,d,l) memcpy((char *)(d),(char *)(s),(l))
! # define bcmp(b1,b2,l) memcmp((char *)(b1),(char *)(b2),(l))
! # define bzero(b,l) memset((char *)(b),0,(l))
#endif
***************
*** 89,91 ****
#endif
!
--- 107,111 ----
#endif
! #define L_SET 0
! #define L_INCR 1
! #define L_XTND 2
Index: samples/lwpr.c
*** ../cap-orig/samples/lwpr.c Thu May 19 15:17:49 1988
--- samples/lwpr.c Thu May 4 14:36:35 1989
***************
*** 35,38 ****
--- 35,41 ----
# include <strings.h>
#endif
+ #ifdef xenix5
+ # include <unistd.h>
+ #endif
#ifndef CAPPRINTERS
--
You may redistribute this article only to those who may freely do likewise.
Chip Salzenberg at A T Engineering; <chip at ateng.com> or <uunet!ateng!chip>
More information about the Alt.sources
mailing list