[Info-vax] Volatile, was: Re: yet another sys$qiow question

VAXman- at SendSpamHere.ORG VAXman- at SendSpamHere.ORG
Wed Aug 19 11:35:39 EDT 2015


Question:  If "volatile" is necessary, shouldn't this code keep spinning its
tail???

#pragma environment save
#ifndef __NEW_STARLET
#define __NEW_STARLET New_and_Improved
#endif

#include <descrip.h>		// OpenVMS descriptor structure definitions  
#include <efndef.h>		// OpenVMS event flag number definitions
#include <iodef.h>		// OpenVMS $QIO I/O function code definitions
#include <iosbdef.h>		// OpenVMS I/O status block structure definitions
#include <starlet.h>		// OpenVMS system service prototype & codes
#include <stsdef.h>		// OpenVMS system message format definitions

int main()
  {
    int sts = 0, ctr = 0;
    IOSB iosb = { 0, 0, 0};

    unsigned short channel;
    $DESCRIPTOR(sys$output,"SYS$OUTPUT");

    char star[] ={'|','/','-','\\'};

    if (!((sts=SYS$ASSIGN(
				&sys$output,		// device name
				&channel,		// channel
				0,			// access mode
				0			// mailbox name
			 ))&STS$M_SUCCESS)) return sts;

    while (iosb.iosb$w_status == 0)
      {
	if (!((sts=SYS$QIOW(
				EFN$C_ENF,		// event flag number
				channel,		// channel
				IO$_WRITEVBLK,		// QIO function
				&iosb,			// I/O status block
				0,			// AST address
				0,			// AST parameter
				&star[(ctr++)&3],	// P1: VA of buffer
				1,			// P2: number of bytes
				0,			// P3: n/a
				0x8D000000,		// P4: carriage control
				0,			// P5: n/a
				0			// P6: n/a
			   ))&STS$M_SUCCESS)) return sts;
      }
  }

#pragma environment restore

-- 
VAXman- A Bored Certified VMS Kernel Mode Hacker    VAXman(at)TMESIS(dot)ORG

I speak to machines with the voice of humanity.



More information about the Info-vax mailing list