Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new constant called SYSTEM_PROCESS_NAME_BUFFER_LENGTH
Previously we were using the value of C.PR_SET_NAME to limit the size of the buffer used to write the process name into when calling 'nvmlSystemGetProcessName()'. While this technically wouldn't cause a buffer overrun, it limited the length of the process name by a (somewhat) arbitrary amount since C.PR_SET_NAME is not meant to indicate a maximum length for a process name, but rather an arbitrary code for telling 'prctl()' to set the name for a process (which has nothing to do with its length). It was a clear oversight to use this random value as the buffer length. In the new implementation we simply hard code a new variable called SYSTEM_PROCESS_NAME_BUFFER_LENGTH to 256 (which is well more than the actual maximum process name length on linux). Having a larger value won't hurt anything, and will make it more portable if / when we decide to start supporting windows. Signed-off-by: Kevin Klues <[email protected]>
- Loading branch information