tbray@mprvaxa.UUCP (Tim Bray) (03/22/84)
x <-- USENET insecticide Have seen a couple of requests re Sccs on 4.2, and I'm not certainly not about to distribute the working source because the required changes are so trivial. I put up the mouldy old PWB version (is there any other version?) under 4.2 in a few hours. 1. Either install libPW under 4.2, or hack the sccs makefiles to use a local copy of libPW (preferable), or hack sccs itself to call a more contemporary set of routines (best of all) - I took the second alternative. 2. Look through the sccs source for cases where they do directory reads to handle specification of a whole directory. You can just grep for "struct dir" or "<dir.h>". Don't worry, if you miss any sccs will blow up indicatively the first few times you use it. 3. Replace these instances of directory reading with calls to the 4.2 directory reading routines, opendir(), readdir(), etc. 4. NOW, go look for all occurences of the routine xfreeall(), mostly in the various cleanup() routines. Turns out Sccs, true to its PDP-11 heritage, uses the stingy PW alloc/malloc routines, and whenever it's finished processing one of a group of files, turns around and frees all memory via xfreeall(), which does an sbrk(). Unfortunately, the 4.2 dir(3) routines whimsically malloc() all over the place, and the sbrk() hits them where they live. Took me hours to nail that one down... it was trashing readdir()'s fd to 0, and the program would hang trying to read stdin. So fix the xfreell() calls one way or another. I just commented them out... this is a VM machine. 5. Now act like a responsible person and record these changes using RCS. Have fun.