From:	MERC::"uunet!WKUVX1.BITNET!MacroMan" 28-APR-1992 20:41:43.28
To:	MACRO32@WKUVX1.BITNET
CC:	
Subj:	PPFs

Date sent:  28-APR-1992 08:55:32


        In working with some arcane SOC (Someone Else's Code) I came
        across the following comment:
        /* A trnlnm call for process permanent logical names will return
         * nonsense in the first longword of the buffer */

        This piqued my curiousity so I wrote some test code (included
        below).  Sure enough, the process permanent file logicals of
        sys$input, sys$Output, and sys$error contain some weird stuff
        in the first longword.

        Examination of [v54.login.lis]ppddef.mdl show that this
        longword is actually two words:
                The w_ifi and w_isi for RMS.

        Nifty!

        Ehud

--
Ehud Gavron        (EG76)
gavron@vesta.sunquest.com
"The world bores you when you're cool."

typedef union {
        struct {
                short s_buflen;
                short s_itemcode;
                char *s_bufaddr;
                short *s_retlen;
                } s;
        unsigned long end;
        } ITEMLIST;

#define buflen          s.s_buflen
#define itemcode        s.s_itemcode
#define bufaddr         s.s_bufaddr
#define retlen          s.s_retlen
/*
 * test sys$trnlnm on ppfs
 */
cmain()
#define MAXEQUIVLEN 64
#include <descrip.h>
#include <lnmdef.h>
#include <ssdef.h>
{
        static char ebuff[MAXEQUIVLEN];
        static $DESCRIPTOR(tabnam,"LNM$FILE_DEV");
        static $DESCRIPTOR(lognam,"SYS$OUTPUT");
        static $DESCRIPTOR(equivalence,&ebuff);
        static ITEMLIST itmlst[1];
        static unsigned long stat;

        itmlst[0].itemcode      =       LNM$_STRING;
        itmlst[0].buflen        =       sizeof(ebuff);
        itmlst[0].bufaddr       =       &ebuff;
        itmlst[0].retlen        =       &equivalence;
        itmlst[1].end           =       0L;

        stat = sys$trnlnm(0L,&tabnam,&lognam,0L,&itmlst);
        if (!(stat & 1)) lib$stop(stat);
}
