The perror()
function takes a pointer to constant data so that you can pass a string literal to it and be assured that the function won't modify the string it is passed.
A called function taking an integer argument can modify its integer argument without affecting anything in the calling function.
A called function with an argument that is a pointer to non-const data can modify the data in the calling function via that argument.
A called function with an argument that is a pointer to const data cannot modify the data in the calling function without abusing the type system (using a cast).
Of course, a function with a pointer argument can change its copy of the pointer (for example, by incrementing it), but since the pointer value is local to the called function, that doesn't affect anything in the calling function either.
So, there's no need for const
on non-pointer arguments to functions because the value of the argument is a local variable.