in reply to [Ceph::RADOS] Help Debugging Inline C
int buf_sz = rados_pool_list(clu,NULL,0); char buf[buf_sz];
I've moved the Inline_Stack_Vars to the top as is my usual practice - though I don't think that matters here.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; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: [Ceph::RADOS] Help Debugging Inline C
by three18ti (Monk) on Nov 07, 2013 at 07:29 UTC | |
by taint (Chaplain) on Nov 07, 2013 at 14:40 UTC | |
by three18ti (Monk) on Nov 09, 2013 at 20:03 UTC | |
by taint (Chaplain) on Nov 09, 2013 at 20:57 UTC |