in reply to Re^2: [Ceph::RADOS] Help Debugging Inline C
in thread [Ceph::RADOS] Help Debugging Inline C

Regarding rados library and the rados_pool_list() — seeing that code instantly reminded me of snprintf.

The snprintf/vsnprintf functions return n. of chars that would have been written with large enough buffer. The length argument is size_t, whereas return type is int... (Historical stdio matter?) SUSv2 and C99 are in disagreement concerning a snprintf call with len==0; with C99 allowing buf==NULL in that case.

The ssize_t type allows a -1 error return where a size_t would otherwise be suitable. Like e.g. read() or pwrite.

  • Comment on Re^3: [Ceph::RADOS] Help Debugging Inline C