On 06/18/2013 02:49 PM, Jason Gunthorpe wrote:
> This is simpler:
> 
> {
>       static char str[16];
>       snprintf(str, sizeof(str), "%d", ibv_mtu_to_num(max_mtu));
>         return str;
> }

That is not, however, multi-thread safe nor advisable unless you clearly
indicate in the man page to the function that subsequent calls to the
function wipe out the result of previous calls.  It's not even single
thread safe if you have more than one interface and don't know that
later calls wipe this buffer out.  Best to avoid library routines such
as this.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to