History log of /linux-master/tools/testing/selftests/prctl/set-process-name.c
Revision Date Author Comments
# d837813f 20-Aug-2023 Osama Muhammad <osmtendev@gmail.com>

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>


# e0606dae 07-Jun-2023 Osama Muhammad <osmtendev@gmail.com>

selftests: prctl: Add new prctl test for PR_SET_NAME

This patch will add the new test, which covers the prctl call
PR_SET_NAME command. The test tries to give a name using the PR_SET_NAME
call and then confirm it that it changed correctly by using PR_GET_NAME.
It also tries to rename it with empty name.In the test PR_GET_NAME is
tested by passing null pointer to it and check its behaviour.

Signed-off-by: Osama Muhammad <osmtendev@gmail.com>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Tested-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>