Sun-Spots-Request@RICE.EDU (William LeFebvre) (10/21/87)
SUN-SPOTS DIGEST Wednesday, 21 October 1987 Volume 5 : Issue 53 Today's Topics: Generating Sun2 binaries on a Sun3? (3) Re: SYNC on zs or mti Re: varargs: bug or feature? (2) Re: Sun csh weirdness Forking a shelltool from a shelltool Adding SCSI devices to Sun 3/60's Setting ps display after V7 Forwarding mail to other top level mail domains Looking for sendmail.cf file working with three level domain Seeking NFS for the 3B2/400 APL on Sun workstations? linpack and eispack libraries? Experiences with CDC SMD disks on SUN 3s? Backup procedure ---------------------------------------------------------------------- Date: Tue, 13 Oct 87 14:17:08 pdt From: rtech!llama!daveb@sun.com (Dave Brower) Subject: Generating Sun2 binaries on a Sun3? (1) HAVE: A Sun 3 running 3.4, with both /pub.68010 and /pub.68020 loaded. WANT: Instructions on how to compile executables that can be run on a 68010 Sun-2. Thanks, -dB sun!rtech!daveb, daveb@rtech.uucp ------------------------------ Date: Wed, 21 Oct 87 14:57:51 CDT From: phil@Rice.edu Subject: Generating Sun2 binaries on a Sun3? (2) (Place tongue in cheek) Why whoever would want to do that? (remove tongue from cheek). The "cc" command understands the option "-m68010", and passes it through to all steps of compilation and assembly (and these steps will generate 68010 code). Unfortunately, it does nothing to make the linking step correct. "cc" will still invoke "ld" with all the 68020 libraries, even though the 68010 libraries might be available. One can specify libraries on the "ld" command line as ".a" files and have everything work. In fact, "cc" expands a "-lmumble" option to something like "/usr/lib/libmumble.a" when it hands it to "ld". It also includes "/lib/libc.a" as an "ld" argument to get the c run-time library. If you could figure out all that you needed to include on an "ld" command line to link a c object file, then you'd have the problem pretty much licked. There are others at Rice that tried to tackle thiss problem. They tell me that it is very hard for the general case. The next article in this digest is a "reprint" of a message that one of the Rice people sent in to Sun-Spots the last time we were discussing this problem. Perhaps it will help you solve the problem. William LeFebvre ------------------------------ Date: Tue, 12 May 87 13:21:11 CDT From: bbc@rice.edu (Benjamin Chase) Subject: Generating Sun2 binaries on a Sun3? (3) The C runtime library, /lib/libc.a, is linked in automatically, and on a 68020 contains a few 68020 modules. Also, specifying the -pg flag complicates things significantly, since the names of the libraries change, and sometimes their location, too (eg. /lib/libc.a vs. /usr/lib/libc_p.a). Some of the -pg variants don't seem to exist (or is it just Rice that doesn't have libpixrect_p.a, etc.?). Also, whereas adding the -pg flag changes the names of the libraries, adding the -g flag causes the inclusion of another library, /usr/lib/libg.a. All these little details can be very frustating to the person constructing the ld command from scratch because he/she wants to do a "cross compile" from one flavor of sun to the other. Wouldn't it be convenient if cc and ld knew more about the m680?0 flags and ld could be told where to find the various flavors of libraries? The -m680?0 flags *are* documented, although they are hidden under the manual pages for as(1). To me this hints at the lack of support for these flags throughout the rest of cc and friends. Ben Chase Dept. of Computer Science bbc@rice.edu Rice University ------------------------------ Date: Fri, 16 Oct 87 01:14:18 EDT From: ted@braggvax.arpa Subject: Re: SYNC on zs or mti Sun will gladly (I'm sure) sell you a product called Sunlink that seems to be basically a syncronous version of SLIP. It can drive port A or B in SYNC mode. I don't think you can use regular SLIP on a SYNC modem. Ted Nolan ted@braggvax.arpa ------------------------------ Date: Sat, 17 Oct 87 12:53:53 EDT From: rsalz@pineapple.bbn.com Subject: Re: varargs: bug or feature? (1) Your code is broken; you're not supposed to do: va_arg(foo, short) ^^^^^ The only allowed datatypes here are whatever types C uses for function parameters: int, double, and pointers. /r$ [[ Another case of RT*M (that stands for "Read the * Manual"). I wish I had caught that before I sent the digest out. Please check the manual page for varargs(3) where it describes 'va_arg(pvar, type)'. --wnl ]] ------------------------------ Date: Sat, 17 Oct 87 14:50:45 EST From: Chris Torek <chris@mimsy.umd.edu> Subject: Re: varargs: bug or feature? (2) >From: unido!pbinfo!michael@uunet.uu.net (Michael Schmidt) And the diagnosis: Bug, but not in varargs. > if (va_arg(args, int)==0) > printf("0: %d\n", va_arg(args, int)); > else > printf("1: %d\n", va_arg(args, short)); The idea is right, but the code is wrong. C expressions have only five possible types (int, unsigned int, long, unsigned long, and double), and arguments to a function are always expressions. The compiler carefully converts a signed integer argument back to a signed short if the function is written as f(a, b) int a; short b; { ... } but when using varargs, C programmers must be aware of the promotion of short arguments to int. Or to put it another way, the following are never correct: va_arg(ap, char) va_arg(ap, signed char) /* if you have signed char */ va_arg(ap, unsigned char) va_arg(ap, short) va_arg(ap, unsigned short) va_arg(ap, float) To correct the code, use printf("1: %d\n", (short)(va_arg(args, int))); in place of the second printf. (The quoted code happens to produce the `expected' result on the Vax because the Vax is `little-endian'; Suns and Pyramids are `big-endian'.) Incidentally, a number of compilers have trouble with, e.g., f(n) float n; { ... &n ... } taking the address of a double version of n (the one that was in fact passed) instead of a float (by making one from the double value, if necessary). This is a compiler bug, unlike the varargs version. In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris ------------------------------ Date: Sat, 17 Oct 87 14:50:45 EST From: Chris Torek <chris@mimsy.umd.edu> Subject: Re: Sun csh weirdness >From: greg@muddy.cs.unlv.edu (Greg Wohletz) > >set tmp="aaa" >if($tmp == "bbb") then > if($tmp == "ccc") then > echo ccc > endif > echo bbb >endif >echo aaa The C shell does not have a true parser or scanner. Instead, when it is inside a false `if', it scans lines with a separate section of code (or more precisely, without the usual evaluation code, which would complain about unset variables, e.g.) that is not smart enough to tell that `if(' is two `words'. Hence it blindly gropes for lines that begin with `if' and end with `then', and misses any that are not precisely formatted. As far as I know, there is no version of C-shell that `does the right thing' with the above code. ------------------------------ Date: 16 Oct 87 14:07:11 GMT From: cosell@cosell.bbn.com (Bernie Cosell) Subject: Forking a shelltool from a shelltool Just a wrapup on the answers I received to my inquiry about forking a shelltool from within a shelltool. Several folk sent suggestions of the form: "menuentry" sh -c "echo -n <question>; read ans; exec shelltool ..." Which works fine. The only real downside is that the interaction happens in the console window. It was also suggested that "get_selection" could be used instead of the echo/read. The "winning" suggestion (to my view) came from John Arisco at MCC. It couples incredible simplicity with being able to do exactly what I wanted (I'm ashamed that I didn't think of trying this!): just put a sleep at the end of the script. It works like a charm. My little "asrkrlogin" script just looks like: echo <question>; read ans shelltool <-Wthis -Wthat> rlogin $ans& sleep 2 Simple, huh? Thanks John!! /Bernie\ ------------------------------ Date: 14 Oct 87 09:09:58 GMT From: collinge@uvicctr.UUCP (Doug Collinge) Subject: Adding SCSI devices to Sun 3/60's We have ordered a 3/60, a 60 Mb tape shoebox from CMS, and a 300 Mb CDC hard disk from ATI. None have arrived yet, but the smaller brother disk (160 Mb) has been in use at UBC for 2 months with no problems, and CMS uses identical hardware to Sun for their tape units. Prices are significantly lower than Sun. We're getting an excellent price on the 300 Mb disk. CMS also sells disk and disk/tape shoeboxes as well as SIMMS for Macs and (soon) 3/60s. (BTW: 3/60 SIMMs have 9 chips, Apple SIMMs only 8 (no parity)). Supposedly, Sun uses specific commands (non standard SCSI) in its microcode. This causes problems for most SCSI devices. The CDC accepts the commands but ignores them. I sure hope this all works! I will post the results when the system is assembled. CMS: Custom Memory Systems, 826 N. Hillview Drive, Milpitas, CA 95035. (408)263-8011 ATI: Alta Telecom International (business arm of Alberta Government Telephone) Edmonton (sorry, don't have their address at hand) 1-800-661-6963 (This may only work in Canada) The usual disclaimers apply. David Harris, Fac. Pharm. Sc., The University of British Columbia, Vancouver, BC, CANADA V6T 1W5 604-228-6216 -- Doug Collinge School of Music, University of Victoria, PO Box 1700, Victoria, B.C., Canada, V8W 2Y2 collinge@uvunix.BITNET decvax!uw-beaver!uvicctr!collinge ubc-vision!uvicctr!collinge ------------------------------ Date: 15 Oct 1987 1724-EDT (Thursday) From: geoff@utstat.toronto.edu Subject: Setting ps display after V7 I dimly recall someone asking here how to set the command that ps displays. These are the functions our init children now use to show ps the name of the terminal each init is trying to open. You call chars=argchars(argc,argv) once at the start and then call setpsargs(argc,argv,psdisplay,chars) whenever you want to set the ps display to the string psdisplay. [I was worried about destroying argv and wanting to call setpsargs repeatedly, which is why I broke argchars out. There is undoubtedly room for improvment in setpsargs, but it makes the Sun ps happy.] int argchars(argc, argv) /* count chars in argv, including NULs */ register int argc; register char **argv; { register int arg, chars = 0; for (arg = 0; arg < argc; arg++) chars += strlen(argv[arg]) + 1; /* +1 for NUL */ return chars; } /* * Set the ps args in (argc,argv) to as much of psdisp as fits in argvchars chars. * setpsargs destroys the old command line; if you call getopt(3), do it first. * This is grubby; see V7 exec(2) for more explanation. * * This would be trivial with V7 execargs (*execargs = psdisp). */ setpsargs(argc, argv, psdisp, argvchars) int argc; register char **argv; char *psdisp; int argvchars; { register int chars; register char *spacep; if (argc < 1) /* no argv[0]! */ return; chars = argvchars - 1; /* take off last terminator byte */ (void) strncpy(argv[0], psdisp, chars); /* try to overwrite args */ for (spacep = &argv[0][strlen(psdisp)]; spacep < &argv[0][chars]; spacep++) *spacep = ' '; /* pad arg0 */ argv[0][chars] = '\0'; /* terminate arg0 */ #ifdef notdef argc = 1; /* get count right */ #endif } ------------------------------ Date: Tue, 13 Oct 87 19:42:19 PDT From: spar!parns!harker@decwrl.dec.com (Robert Harker) Subject: Forwarding mail to other top level mail domains I have been modifying our sendmail.cf file for our main mail machine and have used a nice modification recommended to me by Bill Nowicki at Sun Microsystems. We have many users who want to send mail to the different top level mail domains, .arpa, .com, .edu, .csnet, .bitnet, etc. We are not connected to the ARPAnet, but our major UUCP mail relay does know how to forward mail to these different domains. What this modification does is to forward all of the mail messages that have a non-local domain extension to our UUCP mail relay. This modification has two parts, the first is to define a new class of name, "T", which has all of the top level domains, the second is to add a rewriting rule that forwards mail with one of these extensions to the UUCP mail relay. This modification adds four lines and deletes two lines from your sendmail.cf file. If you have a network of Suns, and use the sendmail.subsubsidiary.cf file on your clients and the sendmail.main.cf on your main mail machine, you only need to change the sendmail.cf file on your main mail machine. The normal precautions should be observed when editing your sendmail.cf file. Do not edit the file in place. Make a copy of the file and edit the copy. Save a copy of your old sendmail.cf file. Move the new sendmail.cf file in place when the system is in a quiescent state (like single user mode). And test this by sending to a few different domains. Step One: you need to add a new class of names (tokens) to sendmail. This is the class of all top level domains you want to have forwarded to your UUCP relay. In my case it includes .arpa, .edu, .gov, .com, .bitnet, .csnet, .net, .org, and .uk. After the entry for your major mail relay (around line 44) add the following two lines: # Other known top level domains to be forwarded to major relay host CTarpa edu gov com bitnet csnet net org uk (Note: there is >>NO<< white space on either side of "CT") Step Two: You need to add a new address rewriting rule to rule set zero to forward any mail addressed to one of the domains to your UUCP mail relay. To do this you need to comment out the old rewriting rules (with #OLD in this example) and add the new rewriting rule. Find the comment line that starts with "# Pass Arpanet and Bitnet names" (line 423) and comment out the two following rewriting rules: # Pass Arpanet and Bitnet names up the ladder to our forwarder #OLD R$*<@$*$-.arpa>$* $#$M $@$R $:$1@$2$3.arpa$4 user@anything.arpa #OLD R$*<@$*$-.bitnet>$* $#$M $@$R $:$1@$2$3.bitnet$4 user@anything.bitnet Then add the following two lines: # Pass top level domain names up the ladder to our forwarder R$*<@$*.$=T>$* $#$M $@$R $:$1<@$2.$3>$4 user@anything.TOP_DOMAIN ^^ ^^^^ ^ ^^^^^ tab spaces space tab The location of the tabs and spaces is very important. The tabs separate the different parts of the rule. The first part of the rule, R$*<@$*.$=T>$*, is the pattern matching test. The second part of the rule, $#$M $@$R $:$1<@$2.$3>$4, is the rewriting pattern. And the third part of the rule, user@anything.TOP_DOMAIN, is a comment field. Sendmail separates the rule into three parts by looking for the tabs. I hope people find this useful RLH ------------------------------ Date: 14 Oct 87 14:01:39 GMT From: Hans van Staveren <mcvax!cs.vu.nl!sater@uunet.uu.net> Subject: Looking for sendmail.cf file working with three level domain I tried to get the sendmail.cf files as supplied by SUN version 3.2 to wotk with our three level domain. I failed miserably. Now I do not claim to be a sendmail expert, so I humbly ask for help. Does anyone have a sendmail.cf file for a SUN so that it can use an address like machine.cs.vu.nl? Only a sendmail.subsidiary.cf is needed. Tia, Hans van Staveren Vrije Universiteit Amsterdam ------------------------------ Date: Wed, 14 Oct 87 23:02:49 EDT From: Tony Movshon <movshon@acf8.nyu.edu> Subject: Seeking NFS for the 3B2/400 We're looking for an implementation of NFS that runs on 3B2/400s under S5R2 or S5R3. Any leads, information or even rumors would be much appreciated. Tony Movshon Internet: movshon@nyu.nyu.edu Usenet: {ihnp4|allegra}!cmcl2!xp!tony or movshon@cmcl2.uucp US Mail: Department of Psychology, NYU 6 Washington Place New York, NY 10003 Phone: (212) 998-7880 ------------------------------ Date: 14 Oct 87 23:29:39 GMT From: cbmvax!vu-vlsi!mckee@rutgers.edu (Bruce McKee) Subject: APL on Sun workstations? Does anyone have information and/or experience with APL on a Sun workstation? I am looking for a well-supported package that can access SunView graphics and windows. In particular, it must be able to display grey-scale output on a Sun 3/60 screen. (I need this for an image processing application.) Information on cost and support fees would also be appreciated. I will summarize the responses to the net. -Bruce McKee Villanova University ------------------------------ Date: Thu, 15 Oct 87 13:45 EDT From: SYSRUTH@utorphys.bitnet Subject: linpack and eispack libraries? Does anyone have these for SUNs (preferably SUN 3 and SUN 4)? Are they public domain? Our VAX/VMS versions date from 1979, and when I tried to check recently I could find no records of when and from where we ordered them. I believe they are both (at least originally) from Argonne Labs. Linpack has become a fairly standard floating-point benchmarking package. Failing anyone having them, does anyone know where I can order a SUN version from? Many thanks. Ruth Milner Systems Manager University of Toronto Physics/Astronomy BITNET: sysruth@utorphys uucp: ...!seismo!utai!utgpu!radio!helios!sysruth ------------------------------ Date: Fri, 16 Oct 87 00:11:52 EDT From: rbthomas@jove.rutgers.edu (Rick Thomas) Subject: Experiences with CDC SMD disks on SUN 3s? Does anyone have experience using CDC 9720 SMD disk drives with XY451 controllers on SUN 3/180 fileservers? We have a vendor who is proposing to sell us a 600+ megabyte CDC SMD disk and XY451 controller for about $6000 cheaper than we can get a supereagle and controller from SUN, and $3000 cheaper than our best offer from 3rd party dealers for genuine supereagles. These are 8-inch drives, so I can almost fit four of them in the rack space that a single supereagle would take up. That is very attractive to us, because we are very cramped for floorspace, and we need the megabytes in the worst way. How about it, does anybody know if it will work? Rick Thomas rbthomas@caip.rutgers.edu (201)-932-4301 ------------------------------ Date: Wed, 14 Oct 87 10:10:38 NOR From: Jeremy Cook <JMC%NOCMI.bitnet@jade.berkeley.edu> Subject: Backup procedure Our systems guy (Tom) came up last Monday evening to backup our Sun. He was new to the job however and didn't know the root password. He phoned Ingolf, but Ingolf didn't know it either so Ingolf, who was meeting Kikki in town, asked Kikki. Kikki phoned in to Tom but the switchboard was closed so the cleaning lady answered. Kikki told the cleaning lady the root password, the cleaning lady went down to Tom and told him and Tom came up to do the backup! -- Jeremy [[ Gee. How can we contact your cleaning lady? :-) --wnl ]] ------------------------------ End of SUN-Spots Digest ***********************