350 pts.
 rslvsp function returns null
Documentation for rslvsp points: "A null pointer value means the object was found in a machine context." But I verified that my user space was created successsful rslvsp(_Usrspc,"userspace", "QTEMP", _AUTH_ALL) If it is found in machine context, how can I resolve to it (Have a pointer to the user space)? if is not in a machine context , but it exists how can I otain a pointer for that location? why is returning me NULL?

Software/Hardware used:
v6r1, iseries, rslvsp function, API
ASKED: December 21, 2012  9:41 PM
UPDATED: December 21, 2012  10:10 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question. GraceP   350 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

We need to see more of the programming to know if any part of your rslvsp() call is valid. However, if you just want a pointer for your user space, use the Retrieve Pointer to User Space (QUSPTRUS) API. — Tom

 110,135 pts.

 

With QUSPTRUS function my program correctly return a pointer to my user space, but no matter if I change to _Program I obtain a null pointer with rslvsp even if the object is in there, we use the rslvsp due to performance reasons.The call for rslvsp is just: _SYSPTR sysP = rslvsp(_Usrspc,”USRSPC01″, “QTEMP”, _AUTH_ALL) ;
Can you explain me a little bit about that context machine ?  ( because is the only clue that I have ) 

 350 pts.

 

First, do you have evidence that using QUSPTRUS causes any significant delay? Next, you say this:
 
Documentation for rslvsp points: “A null pointer value means the object was found in a machine context.”
 
But as far as I know, that is only in the MI rslvsp documentation and you are using the rslvsp() MI library procedure in C. Those are not the same. The rslvsp() MI library procedure has no such statement.
 
A null pointer might be returned from rslvsp() for a number of reasons, but there’s no way to know what that might mean without seeing more of your program. Especially, how are you handling errors?
 
Tom

 110,135 pts.

 

My error, I thought that the cast between pointers was good and clear, but it is  when I do the cast when is returning NULL , it is weird,  when I call the program from another remote programs it returns NULL but if I call into an interactive session the pointer is correct.   I guess it is not the way to manage the system pointer 

static char * pointer = NULL ; f() {
#pragma exception_handler(errorLabel,0,0,_C2_ALL,_CTLA_HANDLE)
pointer = (char *)((void *)rslvsp(_Usrspc,”USRSPC01″, “QTEMP”, _AUTH_ALL) );
#pragma disable_handler
errorLabel:

}

 350 pts.

 

I tested the splitting the cast and the char pointer has a valid pointer :   
static char * pointer = NULL ;
{
#pragma exception_handler(errorLabel,0,0,_C2_ALL,_CTLA_HANDLE)
void * a = (void *)rslvsp(_Usrspc,”USRSPC01″, “QTEMP”, _AUTH_ALL) ;
pointer = (char *) a;
#pragma disable_handler
}

 350 pts.