selftests: prctl: Add prctl test for PR_GET_NAME
authorOsama Muhammad <osmtendev@gmail.com>
Sun, 20 Aug 2023 14:13:54 +0000 (19:13 +0500)
committerShuah Khan <skhan@linuxfoundation.org>
Thu, 30 Nov 2023 23:30:05 +0000 (16:30 -0700)
commitd837813ff42ef86dac8596dd491bf6869ac7a0e8
tree922aa49c11fd338cfe8dc5c4fff3d3975b8c54a0
parent25cfe960a858dd345176253088a8e56538007c22
selftests: prctl: Add prctl test for PR_GET_NAME

This patch covers the testing of PR_GET_NAME by
reading it's value from proc/self/task/pid/comm
and matching it with the value returned by PR_GET_NAME.
If the values are matched then it's successful, otherwise
it fails.

changes since v1:
- Handled fscanf,fopen error checking.
- Defined MAX_PATH_LEN.

Signed-off-by: Osama Muhammad <osmtendev@gmail.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/prctl/set-process-name.c