int buf_sz = rados_pool_list(clu,NULL,0); char buf[buf_sz]; #### use Inline C => Config => BUILD_NOISY => 1; __C__ void list_pools_c (rados_t clu) { Inline_Stack_Vars; int buf_sz = rados_pool_list(clu,NULL,0); char *b; int r; Newx(b, buf_sz, char); r = rados_pool_list(clu,b,buf_sz); if (r != buf_sz) { printf("buffer size mismatch: got %d the first time, but %d " "the second.\n", buf_sz, r); } Inline_Stack_Reset; while(1) { if(b[0] == '\0') { Inline_Stack_Done; Safefree(b); break; } Inline_Stack_Push(sv_2mortal(newSVpv(b,0))); b += strlen(b) +1; } }