[DRMAA-WG] Torque/PBS DRMAA - buffer size, string size

Rajic, Hrabri hrabri.rajic at intel.com
Tue May 1 21:13:19 CDT 2007


Issue:

There is a confusion regarding *_len input parameters (e.g.
error_diag_len for error messages): whether they should include 1
additional byte for '\0' character or not.

C binding specification makes it even more ambiguous. It uses the term
"buffer length" which might be not clear for a C programmer. Usually
"buffer size" means sizeof(buf) and "string length" means that one needs
to supply sizeof(buf) - 1 as the argument for function call. It would be
good to see some explicit explanation.
---------------

sizeof(buf) - 1 is meant to be used, since the programmers expect this
behavior.

That needs to be clarified in the spec wherever matters to leave no room
for ambiguities.   


-Hrabri 


More information about the drmaa-wg mailing list