[comp.os.vms] Info-Vax Digest V0 #22

Info-Vax-REQUEST@KL.SRI.COM (Ramon Curiel) (05/13/87)

Info-Vax Digest         Wednesday, 13 May 1987     Volume 0 : Issue 22

Today's Topics:
  Re: spelling checker from within EDT
  An easy way to determine the X29 calling node ?
  Getting complete name of batch log file.
  Re: MORIA
  Misc. answers (SPAN?, Where PHOTO?, Get vol. label in DCL, etc.)
  re: What is SPAN ??
  RE: Fatal Bug in VAX C pointer indirection (NO BUG FOUND)
  Ingres
  Help for PDP-11
  Reading Diskquotas
----------------------------------------------------------------------

Date: Wed, 13 May 87 10:36 N
From: <SCHOMAKE%HNYKUN53.BITNET@wiscvm.wisc.edu> (Lambert Schomaker)
Subject: Re: spelling checker from within EDT

[]
From Kang Sun SUN@YALEVAX5.BITNET  @ 8-MAY-1987 16:59:11.89 EST
>        An related question, what does it take to associate speller inside
>EDT ? Do you know if anyone has done so ? I'd appreciate if you can offer
>me some advices or references.

I have a solution (sort of) for doing DCL commands from within EDT.
You could write the current contents of the buffer to a file
and give a DCL command to get your spelling checker working on that file.

At login I start a subprocess, the Listener, which will read DCL
commands from a mailbox and spawn another subprocess to execute them
(OK OK it's not so system-friendly, I know, but the system is supposed
to work for users, remember?). Process-output appears in a file at SYS$LOGIN.
The mailbox has its own logical name, e.g. LISTEN:. So the thing I do in EDT is
type in a DCL command and press GOLD D, (for Dcl).

The file EDTINI.EDT contains the following three lines:

DEF KEY GOLD D AS "EXT WRITE LISTEN: .."
            which will write the current line to LISTEN:

DEF KEY GOLD O AS "EXT CLEAR LISBUF; F =LISBUF; INCL SYS$LOGIN:LISTEN.OUT ;T B."
            which will include the most recent LISTEN: results into another
            buffer and goes to the beginning of that buffer.

DEF KEY GOLD M AS "EXT F =MAIN.."
            which brings us back to where we were.

And then there is the Listener off course, which is written in
DEC VAX Fortran-77, the Listener spawn command in LOGIN.COM,

foo...

This solution has several disadvantages, but it works.
Now before you decide you would like to have this kludge consider the
following:  EVE and Emacs can do these things already. For some reason,
however, I myself could not gather the forces to step into EVE yet.
Maybe because I will miss the keypad layout, the line editing commands,
my favorite GOLD T that gives me "13-may-1987 10:13:13" date and time
in the text etc. etc..

                 *
               ^^^^^
      KKKKKUUUUNNNNN
      KKK  UUUU NNNN           Lambert Schomaker
      K    UUUU  NNN           SCHOMAKE@HNYKUN53.BITNET
      KKK  UUUU   NN           Nijmegen, The Netherlands.
      KKKKK UU     N

------------------------------

Date: Wed, 13 May 87 11:06:12 +0200 (Central European Summer Time)
From: XBR1Y049%DDATHD21.BITNET@wiscvm.wisc.edu
Subject: An easy way to determine the X29 calling node ?

Hello !

I am looking for an easy way to get the remote-node-id of an user, which
logged on via X29.
The restriction is : no need of priv's , since it should be included in
                     the login.com of a capitive account.
Thanks for all hints.

Regards
Mit freundlichen Gruessen
                           Stephan Leicht

        Name : Stephan Leicht
Organisation : Computer Center of Technical University Darmstadt, Germany
Organisation : Hochschulrechenzentrum der Technischen Hochsschule Darmstadt
     Telefon : (49) 6151 16 3150
      Bitnet : XBR1Y049@DDATHD21

------------------------------

Date: Wed, 13 May 87 11:17 A
From: <RECERIK%DKARH02.BITNET@wiscvm.wisc.edu>
Subject: Getting complete name of batch log file.

My question to the list is:
How does a batch job determine the full file specification of its log file ?

What I want to do is to be able to send batch jobs where the log is kept
if the job fails, but if the job succeeds it will somehow (directly or
indirectly via another job without log) discard its log file.

Thanks in advance,
Erik Bertelsen, UNI-C.
EARN/Bitnet address: RECERIK @ DKARH02.

------------------------------

Date: 12 May 87 22:00:31 GMT
From: ihnp4!inuxc!iuvax!bsu-cs!oliver@ucbvax.Berkeley.EDU  (T. Tim
      Hsu)
Subject: Re: MORIA

I was wondering how to get a hold of moria, hack, ultrarogue, or empire
for the unix (or vms) that will run on BSD4.3 or VMS4.5

My school (BSU) is new to the nationwide network, so there is not much in
terms of games (except for "basic" games), and I read about a few of the
interesting ones, which is why I would like a copy of them so I could put them
up for access (source code would be great, but I would take anything I could
get my hands on).

If you know where to get some, send me a message about it.


--
T. Tim Hsu

UUCP: {ihnp4,seismo}!{iuvax,pur-ee}!bsu-cs!oliver

------------------------------

Date: Wed, 13 May 87 05:14:36 PDT
From: nagy%warner.hepnet@lbl.arpa
Subject: Misc. answers (SPAN?, Where PHOTO?, Get vol. label in DCL,
         etc.)

Here are some miscellaneous answers to some miscellaneous questions
which appeared on Info-VAX in the past day or two:

>Does anybody know what is SPAN, I think it is a network for DEC machines
>that may be using a different protocol other than Decnet.

SPAN is NASA's Space Physics Analysis Network and definitely is DECnet
(we had area problems when SPAN and HEPnet met as new universities were
added to one or the other network).  HEPnet is the High Energy Physics
network.

>If anybody has a PD version of PHOTO which isn't simply a SET HOST/LOG,
>I'd appreciate you sending me the source, or telling me how I could get
>it (ie - FTP).

A PHOTO program and the pseudo-terminal driver needed for it can be found
on the Fall '85 VAX SIG tape in [VAX85C.BATTELLE.PTY...].  I have used this
under VMS V4.5 on a MicroVAX with no problems.

>Ethernet multicast addresses are as follows:
>AB-00-04-01-00-00 through
>AB-00-04-01-FF-FF       System Communication Architecture (SCA) [I don't know
>                        what this is; wild guess: LAVC]

"Wild guess" is correct.  SCA (or SCS: System Communications Services) are
the core of the VAXCluster.  So the SCA stuff for Ethernet is the LAVC.

>I working on a small integrated BACKUP/TAPE Management Facility for our site
>and I am yet to be able to find a way to extract a magnetic tape's volume
>label for use in a DCL com file. If there is a lexical for this, I am really
>at a loss.  I would appreciate any suggstions.

If the volume is mounted (even /FOREIGN), then F$GETDVI(device,"VOLNAM")
should return the volume name (at least it did for me) in DCL.

=Frank Nagy
=Fermilab Research Division EED/Controls
=FNAL::NAGY.HEPNET or NAGY@FNAL.Bitnet

------------------------------

Date: Wed, 13 May 87 08:53 EDT
From: <SYSTEM%CRNLNS.BITNET@wiscvm.wisc.edu>
Subject: re: What is SPAN ??

Tim,

SPAN is NASA's Space Physics Analysis Network.
It is based on DECnet, as is PHYSnet/HEPnet, the High Energy Physics
network. Some of the circuits run X.25 with DECnet on top so that they
can also be used to talk to non-DEC hosts.
Most of the communication is done over 9600 baud leased lines.
SPAN and HEPnet recently joined into one physical network
although they are separate administratively.
There are about 2000 systems connected this way.

I hope this helps.

Selden E. Ball, Jr.
(Wilson Lab's network and system manager)

Cornell University                 NYNEX: +1-607-255-0688
Laboratory of Nuclear Studies     BITNET: SYSTEM@CRNLNS
Wilson Synchrotron Lab              ARPA: SYSTEM%CRNLNS.BITNET@WISCVM.WISC.EDU
Judd Falls & Dryden Road          PHYSnet/HEPnet/SPAN:
Ithaca, NY, USA  14853             LNS61::SYSTEM = 44283::SYSTEM (node 43.251)

------------------------------

Date: Wed, 13 May 87 06:11:10 PDT
From: nagy%warner.hepnet@lbl.arpa
Subject: RE: Fatal Bug in VAX C pointer indirection (NO BUG FOUND)

Paul Frommeyer and Russ Walker (Comp. Sci. Dept., Ball State Univ.)
submitted an earlier message to Info-VAX about "Fatal Bug in VAX C
pointer indirection".  Since we use VAX C heavily in my group, I
attempted to reproduce the problem with the following program:

========================Start of PTRS.C test==========================
#include    stdio

extern char *malloc();

struct lista {
    struct lista *link;
    int useless[63];
    };

static struct lista *list1;

void show();

main()
{
list1 = (struct lista *) malloc( sizeof (struct lista));
show( 1);

list1->link = (struct lista *) malloc( sizeof (struct lista));
show( 2);

list1->link->link = (struct lista *) malloc( sizeof (struct lista));
show( 3);

list1->link->link->link = (struct lista *) malloc( sizeof (struct lista));
show( 4);

list1->link->link->link->link =
    (struct lista *) malloc( sizeof (struct lista));
show( 5);

list1->link->link->link->link->link =
    (struct lista *) malloc( sizeof (struct lista));
show( 6);

list1->link->link->link->link->link->link =
    (struct lista *) malloc( sizeof (struct lista));
show( 7);

list1->link->link->link->link->link->link->link =
    (struct lista *) malloc( sizeof (struct lista));
show( 8);

list1->link->link->link->link->link->link->link->link =
    (struct lista *) malloc( sizeof (struct lista));
show( 9);

list1->link->link->link->link->link->link->link->link->link =
    (struct lista *) malloc( sizeof (struct lista));
show( 10);

list1->link->link->link->link->link->link->link->link->link->link =
    (struct lista *) malloc( sizeof (struct lista));
show( 11);

list1->link->link->link->link->link->link->link->link->link->link->link =
    (struct lista *) malloc( sizeof (struct lista));
show( 12);

}

void show( n)
int n;
{
register struct lista *lp;

printf( "\nPointers to list entries (%d deep) are:\n", n);
for (lp = list1; lp != NULL; lp = lp->link)
    printf( "\t%d\n", lp);

}
=============================End of PTRS.C====================================

As you can see, this program goes over the edge with pointer indirection
to see if there is a problem.  This program WORKS perfectly correctly.
The machine code producted by the compiler (/LIST /MACHINE) looks correct
also.

After a more careful re-reading of their submission, I have some points
that the they should investigate:

        - malloc just calls the VMS RunTime library routine LIB$GET_VM
          to allocate virtual memory.  LIB$GET_VM will, if needed, call
          the VMS service $CRETVA to expand the virtual address space
          (of the P0 program region).

        - One can NOT depend upon successive calls to malloc returning
          contiguous chunks of memory.  If, by circumstance, they are
          contiguous one must not treat them as such; i.e., to release
          memory allocated by malloc you must use free (or cfree) in
          AN EXACT ONE-TO-ONE relationship.  I.e., the block of N bytes
          allocated by a call to malloc must be balanced by a call to
          free for N bytes.  YOU CANNOT TELL FREE TO RELEASE 2*N BYTES
          IF TWO SEPARATE MALLOC CALLS RETURNED TWO CONTIGUOUS N BYTE
          BLOCKS!  This is true for all VMS programs which use the
          dynamic memory allocation routines LIB$GET_VM and LIB$FREE_VM.
          Malloc and free are just C-specific interfaces to these routines.

        - Malloc "knows" nothing about how deep your pointer indirection
          is in statements like those in my test program.  All malloc
          "knows" is to return A pointer to a chunk of N bytes of virtual
          memory gotten from some free memory list someplace, whereever.
          The fault, if any, is not in malloc or LIB$GET_VM or SYS$CRETVA
          but in the generation of the code to store the pointer value
          in the structure field pointed to by the series of pointer
          indirections.  However, my test program seems to show that this
          is not at fault.

Finally, the obvious one of: beware of releasing a memory block someplace
in your program but still keeping a pointer to it in some other structure.
You might (WILL!!!) find things coming back to haunt you.

=Frank Nagy
=Fermilab Research Division EED/Controls
=FNAL::NAGY.HEPNET or NAGY@FNAL.Bitnet

------------------------------

Date: Wed, 13 May 87 15:16 N
From: <AKVELD%HROEUR51.BITNET@wiscvm.wisc.edu> (Ton Akveld --- E R C
      ---)
Subject: Ingres

I heard some rumours concerning RTI's RDBMS Ingres.
They tell that Ingres isn't sold anymore in Scandinavian countries.
They don't tell why.
Is there anybody out there to confirm or deny these rumours ?

Ton Akveld

------------------------------

Date: Wed 13 May 1987 10:41 CDT
From: Samir Kaleem <XSAK%ECNCDC.BITNET@wiscvm.wisc.edu>
Subject: Help for PDP-11

Hello again folks,

Thanx to all who helped me with the PDP-11 problem last time. I'm afraid I
have another problem that I hope someone can help me with (why the heck isn't
there a mailing list for PDP users???).

We recently got the Kermit tapes from Columbia University. I've had no problem
getting them to run on the MicroVax IIs running VAX/VMS and ULTRIX. Unfortuna-
tely, that is not the case with the PDP-11 running RSX-11M+. The problem that
I have is that the Kermit file is in Hex, and although the DeHexing program is
given I can't use it. This is because the program is in Fortran and we don't
have Fortran on the PDP-11 (you wonder why? You'd have to be here to know). I
could write the program in Macro-11, but I thought I'd see if someone already
has such a program. If so, I'd appreciate it very much if I could get a copy
of it. I have just a couple of weeks to get it going, and a lot of other
projects that I'm working on so I really don't have the time to write the
program myself.

Oh yes, please answer direcetly to me since I do not belong to this mailing
list. Thanx.


Samir Kaleem
                              __________________
                      _______/                  \_______
                     /        XSAK@ECNCDC.BITNET        \
        ____________/ XSAK%ECNCDC.BITNET@WISCVM.WISC.EDU \___________
       /                                                             \
      /  "My employer doesn't like disclaimers, so I don't have any"  \
     /                           "Huda Hafiz"                          \
     ---------------------------              --------------------------
                                \____________/

------------------------------

Date: Wed, 13 May 87 11:43 CDT
From: <BMW6957%TAMCHEM.BITNET@wiscvm.wisc.edu> (Brad Wilson)
Subject: Reading Diskquotas

There have recently been some questions about reading diskquotas from
within a program.  The code below may be of some help.  Extract the
lines from --(Cut here)-- to --(End)-- (exclusive) into a command
procedure and execute it.  It will create seven files:

        DQFDEF.FOR        -- Definitions for DQF structure ('include' file)
        ENDQUOTA.FOR      -- Cleanup routine called to end quota retrieval
        GETQUOTA.FOR      -- routine to get next quota record
        PRIMEQUOTA.FOR    -- Initialization routine to begin quota retrieval
        QUOTACOM.FOR      -- Common 'include' file defining the common block
        TEST.FOR          -- Sample main program to read quotas and type them
                             on the terminal.
        BUILDTEST.COM     -- Procedure to compile and link TEST

These routines are written specifically to access ALL quota entries on a
particular volume set.  TEST will examine the diskquotas on DISK$USER and
write them to the terminal.  I believe that SYSPRV is needed to use these
routines.  These routines may be buggy, I haven't tested them thoroughly.
I cannot offer any support for these, i.e. you're on your own.

Brad Wilson
Department of Chemistry
Texas A&M University
BMW6957@TAMCHEM.BITNET

--(Cut here)--
$ create dqfdef.for
$ deck/dollars="$$$EOF$$$"
*
*     Define the Quota block structure (see $DQFDEF in SYS$LIBRARY:LIB.MLB)
*
      PARAMETER DQF$M_ACTIVE = 1
      PARAMETER DQF$V_ACTIVE = 0
      PARAMETER DQF$K_LENGTH = 32
      PARAMETER DQF$C_LENGTH = 32
      PARAMETER DQF$S_DQFDEF = 32
      STRUCTURE /DQFDEF/
          INTEGER*4     DQF$L_FLAGS
          INTEGER*4     DQF$L_UIC
          INTEGER*4     DQF$L_USAGE
          INTEGER*4     DQF$L_PERMQUOTA
          INTEGER*4     DQF$L_OVERDRAFT
          BYTE  %FILL(12)
      END STRUCTURE
$$$EOF$$$
$ create endquota.for
$ deck/dollars="$$$EOF$$$"
      Integer Function End_Quota
*
*     Deassigns the channel currently in use by Get_Quota
*
      Implicit  Integer*4       (A-Z)
      Include           '($FIBDEF)'
      Include           '($UICDEF)'
      Include           'dqfdef'
      Include           'quotacom'

      End_Quota = Sys$Dassgn ( %Val(chan) )

      Return
      End
$$$EOF$$$
$ create getquota.for
$ deck/dollars="$$$EOF$$$"
      Integer Function Get_Quota( UIC, USAGE, PERMQUOTA, OVERDRAFT )
*
*     Gets the next available quota entry from the disk.  Requires
*     that Prime_Quota be called to initialize data structures.
*
*     Get_Quota returns the longword status of the quota request.
*     UIC, USAGE, PERMQUOTA, and OVERDRAFT are all longwords passed
*     by reference to receive the statistics from the quota record.
*     Note that UIC,USAGE,PERMQUOTA, and OVERDRAFT are undefined if
*     an error is returned.
*
      Implicit  Integer*4       (A-Z)
      Include           '($FIBDEF)'
      Include           '($UICDEF)'
      Include           '($IODEF)'
      Include           'dqfdef'
      Include           'quotacom'

      Integer*4 iosb(2)
      Integer*4 FIB_descriptor(2)
      Integer*4 In_descriptor(2)
      Integer*4 Out_descriptor(2)

      FIB_descriptor(1) = FIB$C_LENGTH
      FIB_descriptor(2) = %Loc(FIBrecord)

      In_descriptor(1) = DQF$C_LENGTH
      In_descriptor(2) = %Loc(INdqf)
      Out_descriptor(1) = DQF$C_LENGTH
      Out_Descriptor(2) = %Loc(OUTdqf)

      Iret = Sys$Qiow(,%Val(Chan),%Val(IO$_ACPCONTROL),iosb,,,
     1          FIB_descriptor,In_descriptor,Length,
     2          Out_Descriptor,,)

*     Sys$Qiow returns any errors involved in queuing the I/O
*     request.  The completion status of the I/O is returned in
*     the IOSB.  If the Qiow is not successful, the status returned
*     is that from Sys$Qiow.  If the Qiow IS successful, the status
*     returned is the one from the IOSB.

      If(Iret) Iret = iosb(1)

      Get_Quota = Iret
      UIC = OUTdqf.DQF$L_UIC
      Usage = OUTdqf.DQF$L_USAGE
      Permquota = OUTdqf.DQF$L_PERMQUOTA
      Overdraft = OUTdqf.DQF$L_OVERDRAFT

      Return
      End
$$$EOF$$$
$ create primequota.for
$ deck/dollars="$$$EOF$$$"
      Integer Function Prime_Quota( Device )
*
*     Sets up the data structures for Get_Quota and assigns a channel
*     to the device.
*
      Implicit  Integer*4       (A-Z)
      Include           '($FIBDEF)'
      Include           '($UICDEF)'
      Include           'dqfdef'
      Include           'quotacom'

      Character*(*)     Device
      Integer*4 iosb(2)
      Integer*4 FIB_descriptor(2)
      Integer*4 In_descriptor(2)
      Integer*4 Out_descriptor(2)

*     Assign a channel to the device and return the status.

      Iret = Sys$Assign(Device,chan,,)
      Prime_Quota = Iret

      If (.not.Iret ) Return

      FIBrecord.FIB$W_EXCTL = FIB$C_EXA_QUOTA
      FIBrecord.FIB$L_EXSZ  = FIB$M_ALL_MEM .or. FIB$M_ALL_GRP
      FIBrecord.FIB$L_WCC = 0
      INdqf.DQF$L_UIC = UIC$K_MATCH_ALL

      Return
      End
$$$EOF$$$
$ create quotacom.for
$ deck/dollars="$$$EOF$$$"
*
*     Define the common block for communication between the prime
*     routine and the Get_Quota routine.
*
      Logical*4 Primed
      Integer*2 chan
      Record    /FIBDEF/        FIBrecord
      Record    /dqfdef/        INdqf, OUTdqf
      Common/Quota_Common/ chan, Primed, FIBrecord, INdqf, OUTdqf

$$$EOF$$$
$ create test.for
$ deck/dollars="$$$EOF$$$"
      Implicit  Integer*4 (A-Z)
      Include      '($SSDEF)'
      Integer*2    OutLength
      Character*67 OutString
*
*     Read the diskquota file on DISK$USER:.  This program reads the
*     quota file from DISK$USER (you may want to change this) and
*     prints out the information found.  This program is meant to
*     be a demonstration, no warranty is expressed or implied, no
*     support is offered.
*
*     Author: Brad Wilson, Texas A&M University, Department of Chemistry
*     Internet address: BMW6957@TAMCHEM.BITNET

*     Prime_Quota is called to assign a channel and initialize the
*     data structures.

      Iret = Prime_Quota('DISK$USER:')          ! Initialize
      If(.not.Iret) Call Exit(Iret)             ! Nasty, get out fast

      Do While (Iret)                           ! Do until we get error

*       Get_Quota normally returns SS$_NORMAL if a quota record was
*       successfully received.  We will assume that any error returned
*       is SS$_NODISKQUOTA, indicating that no more records were
*       available (i.e. any error return will cause the program to exit).

        Iret = Get_Quota(UIC,Usage,Permquota,Overdraft)

*       If we got a quota record, parse the UIC field into the ASCII
*       identifier via SYS$FAO.  Then print out the info obtained.

        If(Iret) Then

          Call Sys$FAO('!%I',OutLength,OutString,%Val(UIC))

          If ( OutLength.gt.20 ) Then
              Write(unit=6,Fmt='('' '',A<OutLength>/'' '',21X,
     1              ''Usage='',I7,''  Perm='',I7,''  Over='',I7)')
     2              OutString(:OutLength),Usage,Permquota,Overdraft
          Else
              Write(unit=6,Fmt='('' '',A<OutLength>,<21-OutLength>X,
     1              ''Usage='',I7,''  Perm='',I7,''  Over='',I7)')
     2              OutString(:OutLength),Usage,Permquota,Overdraft
          End If

        End If

      End Do

      status = Iret             ! Hold the status from Get_Quota
      Iret = End_Quota()        ! Clean up (deassign channel)
      If(.not.Iret) Call Exit(Iret)
      If(Status.ne.SS$_NODISKQUOTA) Call Exit(Status)
      End
$$$EOF$$$
$ create buildtest.com
$ deck/dollars="$$$EOF$$$"
$ fortran test,primequota,getquota,endquota
$ link test,primequota,getquota,endquota
$$$EOF$$$
--(End)--

------------------------------

End of Info-Vax Digest
**********************