[Openais] more about readSize in saCkptCheckpointRead()

Maxi Combina maxicombina at gmail.com
Fri Jul 29 10:42:31 PDT 2005


Hi again :)
I have been testing the openais service after applying the
defect-784.patch posted in this list.
In first place, I have posted a mail saying that it worked, but
further tests show that, in fact, there is still something wrong...

I put a pseudo code here of the test I ran:
-----------------------------> cut here <----------------------------------
#define STRING "1234567890"
#define BUFFSIZE 400

  SaCkptIOVectorElementT e;
  char c[] = STRING;
  char d[BUFFSIZE];
  memset(d, '\0', BUFFSIZE);
     
    saCkptInitialize();

    saCkptCheckpointOpen();

    printf("strlen(STRING) = %d\n", strlen(STRING));
  
    e.sectionId = (SaCkptSectionIdT) SA_CKPT_DEFAULT_SECTION_ID;
    e.dataBuffer = c;
    e.dataSize = strlen(STRING);
    e.dataOffset = 0;
    e.readSize = 0;
      
    saCkptCheckpointWrite(handle previously obtained, &e, 1, NULL);
      
    e.sectionId = (SaCkptSectionIdT) SA_CKPT_DEFAULT_SECTION_ID;
    e.dataBuffer = d;
    e.dataSize = BUFFSIZE;
    e.dataOffset = 0;
    e.readSize = 0;

    saCkptCheckpointRead(handle previously obtained, &e, 1, NULL);
    printf("read bytes from ckpt = %llu\n", e.readSize);
-----------------------------> cut here <----------------------------------


and the output is:
-----------------------------> cut here <----------------------------------
strlen(STRING) = 10
read bytes from ckpt = 278
-----------------------------> cut here <----------------------------------

Wow!! I wrote 10 bytes, and then asked the service to read 400 bytes.
According to the discussion in other thread of the list, ckpt service
should have put 10 in e.readSize after the invocation of
saCkptCheckpointRead(), but it says 278 !!

Regards,
Maxi
--




More information about the Openais mailing list