[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

670.0. "$TRNLM help, anyone?" by FOO::BHAVNANI (Must be the compiler...) Wed Jan 20 1988 03:41

	(Now  that I've got my detached process to behave somewhat  ...!),  is
	there any way for it to inherit logical names present in the invoker's
	logical name tables at the time of invocation?  I'm trying to do

		/* THIS IS IN FOO.C */
		wait_time = trnlog ("WAIT$TIME");
		do
		{
		  do_something();
		  sleep (wait_time);
		}
		forever;

	To run FOO.EXE as a detached process, I do

		$ define WAIT$TIME 10
		$ r /detach FOO

	trnlog() (which calls $TRNLNM) works fine when FOO is run as a non-
	detached and non-spawned (i.e. $ RUN FOO) pgm.  Tnx in advance  for
	any help.
	/ravi
T.RTitleUserPersonal
Name
DateLines
670.1Job or Group LogicalKBOMFG::COLDITZPeter Colditz @KBOWed Jan 20 1988 05:3611
    A detached or spawned process creates new process logical tables.
    Therefore your logical will not be found anymore.

    If you define $ def/job WAIT$TIME 10 a spawned process will be able
    to find the logical in the JOB Table.
    
    If you define $ def/grou WAIT$TIME 10 a detached process will find
    the logical in the logical GROUP. You need group privileges for the
    definement.
    
    Peter
670.2clarificationCSC32::S_LEDOUXScott LeDoux -- 8-522-4953 -- CXO3/2F2Wed Jan 20 1988 13:452
    Specifically, you need GRPNAM privilege to define logical names
    in the GROUP table.
670.3$ def /group rem$waitFOO::BHAVNANIMust be the compiler...Wed Jan 20 1988 16:032
	That works beautifully!  Tnx guys!
	/ravi
670.4What about ACL on LNM$GROUP?MDVAX3::COARThu Jan 21 1988 14:587
>    Specifically, you need GRPNAM privilege to define logical names
>    in the GROUP table.
    
    Can't you also create logical names in the group table if the ACL
    permits?
    
    #ken	:-)}
670.5SMAUG::MENDELPessimists Always Get Good News.Thu Jan 21 1988 15:243
    If you created your own table for logicals to pass to a detached
    process, say named "FOO_TABLE", could the other process find it
    by using $TRNLNM( ,TABLE=FOO_TABLE )?
670.6Vanilla trnlog()FOO::BHAVNANIMust be the compiler...Fri Jan 22 1988 03:477
	I suppose it could, though my version of trnlog() is nothing but a
	simple-minded  interface to SYS$TRNLOG with defaults, which causes
	the system, group, job and process tables to be searched  (in that
	order), until a match is found.  If no match occurs, a null string
	is returned.

	/ravi
670.7Simple functions for obsolescence compatibilityMDVAX3::COARFri Jan 22 1988 17:0417
    In order for the detached process to access the table, it would
    have to be a shared table, which requires privileges.
    
    Once you've overcome that, you would need to either use $TRNLNM
    in the detached process, or else use $TRNLOG and ensure that the
    logical name TRNLOG$_PROCESS_GROUP_SYSTEM was defined as your-table,
    LNM$PROCESS, LNM$JOB, LNM$GROUP, LNM$SYSTEM in either the
    LNM$PROCESS_DIRECTORY or LNM$SYSTEM_DIRECTORY logical name table.
    If you use LNM$PROCESS_DIRECTORY, you'd have to use $CRELNM, so
    why not use $TRNLOG directly?  If you use LNM$SYSTEM_DIRECTORY,
    you will affect [negatively] the performance of just about every
    $TRNLOG done on the system.
    
    If you can create the shared table, great - do so, and use $TRNLNM
    to access it..
    
    #ken	:-)}