[FreeVMS] rtl$print

BERTRAND Joël joel.bertrand at systella.fr
Fri Jun 21 11:51:05 CEST 2013


Guido wrote:
> Hi,

	Hello,

	librtl is a static library that contains all convenient functions 
called from FreeVMS tasks (modules, drivers, but not kernel itself).

> Please tell me there is also a simple one liner to print a message in stead of
> this abomination (of which I even doubt that it does what is intended):
>
>              L4_Word_t arg$print1;
>              const char * arg$print2;

		vms$string_initializer(message, 80);

>              rtl$strcpy(&message, IPC_F_FAILED "IPC failed (error %ld: %s)");
>              L4_Word_t arg$print1 = L4_ErrorCode();
>              const char * arg$print2 = L4_ErrorCode_String(L4_ErrorCode());
>              void* arg$print[] = {&arg$print1,&arg$print2};
>              rtl$print(&message, arg$print);

	Today, this abomination is the solution as there is not mechanism to 
fill arg$print[]. I think we have to write a macro like rtl$args() to 
fill this list.

	// Initialization of a static string descriptor
	vms$string_initializer(message, 80);
	rtl$strcpy(&message, IPC_F_FAILED "IPC failed (error %ld: %s)");
	rtl$args(arg$print, L4_ErrorCode(),
			L4_ErrorCode_String(L4_ErrorCode()));
	rtl$print(&message, arg$print);

	I'm not sure that I'll have time to write it this week-end as I'm 
trying to debug strange bugs in L4 built by gcc 4.7 and 4.8.

	Regards,

	JKB


More information about the FreeVMS mailing list