For example, let's assume that your ioctl is declared as:
int ioctl(int fd, int function, ...);
If your ioctl() has different parameter names, substitute those names instead in the description/code that follows.
Because ioctl() is a variadic function, VectorCAST does not provide direct access to the unnamed parameters via the parameter tree. Instead you can use user code to access the third parameter.
The user code will need to use the the macros in stdarg.h to manipulate the unnamed parameter. So the first step is to #include that header. You can also add a global variable to be used to store the parameter.
Now you can add user code to the actual library stub definition to
capture the third parameter:
vcast_ioctl_capture_3rd_int = va_arg(ap, int);
After making these changes, whenever your function under test calls ioctl, it will call the VectorCAST-generated library stub instead, and that stub will set the global variable vcast_ioctl_capture_3rd_int to the integer passed as the 3rd parameter to ioctl(). You can then use regular parameter user code for the ioctl() function to modify the pointer stored in that int.
int* ptrBytesAvailable = (int*)vcast_ioctl_capture_3rd_int;
*ptrBytesAvailable = 1234;
You can now execute the test case, and when ioctl is called, your parameter user code will put 1234 at the address pointed to by the 3rd parameter.