.title SET_PRCNAM .ident /01.2/ ;******************************************************************************* ;* Set_prcnam * ;* This routine is intended to set the current process's name to the * ;* given string. If it fails, it attempts to add a ":n", where "n" is a * ;* number from 0-99 inclusive. * ;******************************************************************************* ; .psect prc_data, noexe, pic, noshr ; prc_ctrl_str: .ascid /!AS:!UB/ ; Control string to set prcname process_name: .long 15 .address prc_str ; New process name descriptor prc_str: .byte 32[15] ; ; ; .psect prc_code, exe, pic, shr, nowrt ; .entry set_prcnam, ^m ; movl 4(ap), r10 ; Save the username descriptor pushl r10 ; Try to set process name to calls #1, g^sys$setprn ; - the new username blbc r0, try_again ; ret ; Leave, we set it ; try_again: clrl r11 ; Init our counter loop: movl #15, process_name ; Make sure we only have 15 ch. ; pushl r11 pushl r10 pushal process_name pushal process_name pushal prc_ctrl_str calls #5, g^sys$fao ; Format username with number ; pushal process_name calls #1, g^sys$setprn ; Try to set process name blbs r0, leave ; aobleq #99, r11, loop ; Try only 100 times ; leave: ret ; Leave whether or not it worked ; .end