THE UNIX NEWSLETTER JOLUME 3 NUMBER 5 MAY 1978 NOTICE This document may contain information covered by one or more licenses, copyrights, and non-disclosure agreements. Circulation of this document is restricted to holders | of a license for the UNIX*, PWB/UNIX*, or Mini-UNIX® software system from | Western Electric. Such license holders may reproduce this document for uses in | conformity with the Unix license. All other circulation or reproduction is prohibited. Page 1 *Trademark of Bell Laboratories Address editorial material, payments, and software submission to Melvin Ferentz Box 8 The Rockefeller University 1230 York Avenue New York, N.Y. 10021 Subscription requests and address changes should be addressed to Armand Gazes Box 8 The Rockefeller University 1230 York Avenue New York, N.Y, 10021 University | Computer Comer ses wer 57 seu tewtert NY 10 rtenw 22 677-9000 ot Ni May 16, 1978 Professor Melvin Ferentz Rockefeller University Box 8 1230 York Avenue New York, New York 10021 Dear Professor Ferentz: There is a bug in Version 7 of the UNIX C Compiler. The source of the "cc" command is being packaged by Bell Labs with a call to the "alloc" routine of the C Compiler "-le" library. The new "cc" command, which must be compiled with the "-15" library, indirectly uses the "malloc" routine of that library. The routines "malloc" and "alloc", however, are essentially the same and the linker therefore generates "Multiply defined" errors. To fix this problem, change the reference in "cc.c" from “alloc’to “malloc” such that "malloc" is used uniformly. Our system has been running the “cc” command compiled this way for nearly a month without incident. Yours truly, hive. Eoewe Steven R. Eisen PDP II System Manager SE/cec April 6, 1978 Computer Grafix Laboratory New York Institute of Technology P.O. Box 170, Old Westbury, NY 11568 UNIX news c/o Prof. Mel Ferentz Physics Dept. Brooklyn College of CUNY Brooklyn, N¥ 11210 Dear Mel: By now it is well known that nargs(III) does not work in programmes with separated instruction and data spaces, and that furthurmore, it cannot be made to work by using the mfpi instruc tion. Those of us that have tried to get it to go by writing a system entry which will read the instruction space of an I/D separated programme have discovered that the routine runs much to Slowly to be of use. The version of nargs which follows works with separated I & D _ space (given a system entry readi(addr) which returns the contents of the given address in instruction Space), and uses dynamic programming to run at a reasoneble speed {usually}. On the first call, the routine determines whether the programme is running with I/D separation or not. IF not, it uses the algorithm of the currently distributed nargs. Otherwise, it first checks a table to see if it already knows how many argu- ments were passed to the calling routine, and if so returns. If not, it uses the ‘classical’ nargs algorithm, in conjunction with the readi system entry, and saves the result in the table before returning. Which table entry is used is determined by a First- in, first-out algorithm, modified so that a table entry which has been accessed since the last time we overwrote it (or tried to overwrite it) is not overwritten. (This can be viewed as a least-recently-used replacement strategy, with the time since last use stored to 1 bit precision). The size of the table (NLSIZE) is adjustable to taste. Truc speed addicts might want to rewrite this coutine in assembly language. ftdefine NLSIZE 64 #define SIGSYS 12 fdefine JSRSCD 04737 tdefine TSTI 05726 t#define CMPI 022626 #define ADDI 062706 #define JMPI 0167 idefine BRI 0777 struct nlist{ int *pe: cher nargs; i 1 ]e char touched; struct{int integ;}; nargs(a)( register *pc, inst, count; int savesys; Struct nlist *np; static struct nlist nlist[NLSIZE], *nsweep; static notfirst, idsep; if(tnotfirst) { } nsweep=nlist; y* * If we have I/D separation, the next two calls to readi should return the same value, at least one of which will be different from notfirst, since it gets changed between the calls. SIGSYS must be ignored for the duration se eee Se savesys=signal{SIGSYS, 1}; if(ceadi{énot£irst} l=notfirst) idsep++; notfirst++; if(tidsep && readi{snotfirst})!=notfirst) idsep++; signal(SIGSYS, savesys); pe=(&a) [-2]; /* caller's 5 */ pe=pc[l]; count=G; if (idsep) { for (np=nlist;np!=nlist+NLSIZE;np++) if({np->pce=pc) | np->touched=]; return(np->nargs&0377) ; while (nsweep->touched} [ nsweep->touched=0; if (++nsweep=snlist+NLSIZE) nsweep=nlist; } nswecp->pc=pc; if(readi(pce-2) count= for(zz} inst=rcadi(pc); if (inst==JmMPI) ( =ISRSD) because of the possibility that snotfirst * is not a legal instruction space address “* caller of caller's return addr */ pe.integ=+readi(pe+l)}; pe=+2; } else if (inst>>8==(BRI>>8))[ pe.integ=+readi(pe) <<6>>7;3 pet+; ] else break; ] if(inst==TSTI) count=+1l; else if{inst==CMPI) count=+2; else if(inst==ADDI) count=+readi(pct+i)>>1; nsweep->nargs=count; else{ if(pe[-2}==JSRSD) count=1; for(33}( inst = *pc; if(inst==JMPI) [ pc.integ=+pcll]; pe=+2; } else if (inst>>8==(BRI>>8}}{ pe. integ=+*pc<<8>>7; pett; } else break; } if(inst==TSTI) count=+]l; else if(inst==CMPI) count=+2; else if(inst==ADDI) : count=+pc{1)>>1; return(count); } a hope this solution to the nargs problem cen be of some use to UNIX sites with 11/7Us and 11/45s, Yours very truly, ok ta: PURDUE UNIVERSITY ACHOOL OF ELECTRICAL ENGINEERING WERT LAFAVETI4, INDIANA 17907 March 31, 1978 Professor Kelvin Ferentz c/o CUNY/UCC 555 Ww. 57th Street New York, New York 10019 Dear Professor Ferentz: | would like to ask the UNIX user group of software developments In the area of TROFF to Versitec Interfacing. At the present time we are running NEQN and NROFF outputs onto a Diablo 1610 typewriter terminal. Using varlous filters between NROFF and the Diablo, a relatively flexible high quallty text output system has been achleved. In the future, we would like to extend our capabilities Into the areas provided by TROFF but do not require the output quality of the GSi typesetter. We would llke to further consider the concept of a TROFF to Versitec Interface. Assistance from UNIX User Group members would be greatly appreciated. SIncerely, LL - Raden Honager, Digital Services WRS/gb VANDERBILT UNIVERSITY 2) NASHVILLE, TENNESSEE 37235 TELerHoNeE (615) 322-7311 Electrical and Biomedical Engineering + Direct phone 322-2771 March 16, 1978 Dr. Melvin Ferentz Box 8 The Rockefeller University 1230 York Avenue New York, N. Y. 10021 Dear Dr. Ferentz: We are at the present looking for a statistical package to run under Unix. So far we don't know if there is any compiler that will successfully compile BMDP or SPSS or any other avail- able package, or if there is’any package written for Unix. Any information will be greatly appreciated. Sincerely, ek, Voce ee Baruch Hamel, Ph.D. Research Associate BH/ps P.S. Would you be interested in forming a group of INGRES users within the Unix users group? Maybe you would like to discuss this possibility as well as its financial implications with Bob Epstein.