basic/process-util: add mode where posix shell escape is used for quoting

The new flag is not used, except in tests, so no functional change yet.

This way, the command as shown can be copied-and-pasted into the shell
in more cases. For simple cases, shell quoting with "" is enough. But
$'' is needed when there are control characters in the command.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-05-05 13:59:23 +02:00
parent 07468a16e4
commit 99009ed0f4
3 changed files with 20 additions and 2 deletions
+1
View File
@@ -36,6 +36,7 @@ typedef enum ProcessCmdlineFlags {
PROCESS_CMDLINE_COMM_FALLBACK = 1 << 0,
PROCESS_CMDLINE_USE_LOCALE = 1 << 1,
PROCESS_CMDLINE_QUOTE = 1 << 2,
PROCESS_CMDLINE_QUOTE_POSIX = 1 << 3,
} ProcessCmdlineFlags;
int get_process_comm(pid_t pid, char **name);