summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:59:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:59:44 +0000
commitfb31765cbe33890f325a87015507364156741321 (patch)
tree0c5cd12aee0a0a6a6e2d542520df5846859bd40d /scripts
parentInitial commit. (diff)
downloadgnome-system-monitor-upstream/42.0.tar.xz
gnome-system-monitor-upstream/42.0.zip
Adding upstream version 42.0.upstream/42.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/gsm_execute_helper.c16
-rw-r--r--scripts/meson.build17
2 files changed, 33 insertions, 0 deletions
diff --git a/scripts/gsm_execute_helper.c b/scripts/gsm_execute_helper.c
new file mode 100644
index 0000000..2f20a85
--- /dev/null
+++ b/scripts/gsm_execute_helper.c
@@ -0,0 +1,16 @@
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <glib.h>
+
+int main(int argc, char* argv[])
+{
+ gchar **argv_modified;
+ argv_modified = g_new0 (gchar *, argc + 1);
+ memcpy (argv_modified, argv, argc * sizeof (char*));
+ argv_modified[0] = COMMAND;
+ if ( execvp(COMMAND, argv_modified) == -1) {
+ return errno;
+ }
+ return 0;
+}
diff --git a/scripts/meson.build b/scripts/meson.build
new file mode 100644
index 0000000..cb2213c
--- /dev/null
+++ b/scripts/meson.build
@@ -0,0 +1,17 @@
+commands = [
+ 'renice',
+ 'kill',
+ 'taskset',
+]
+
+foreach command : commands
+ executable('gsm-' + command,
+ 'gsm_execute_helper.c',
+ dependencies: [
+ glib,
+ ],
+ c_args: '-DCOMMAND="@0@"'.format(command),
+ install: true,
+ install_dir: join_paths(get_option('libexecdir'), meson.project_name())
+ )
+endforeach