PATCH: (RFC) show name of actual .exe in "ps" output

Marcus Meissner marcus at jet.franken.de
Sat Feb 18 13:05:45 CST 2006


Hi,

Suggested by Andi Kleen.

Basically this will change the "short" ps output to show
the actualy .exe running. The long output will still have

"/usr/lib/../bin/wine-preloader /usr/bin/wine-pthread notepad.exe"

This will make "killall notepad.exe" work, but break
"killall wine-preloader".

Ciao, Marcus

Changelog:
	Display the running .exe name in short "ps" output
	and make it available for "killall".

Index: libs/wine/loader.c
===================================================================
RCS file: /home/wine/wine/libs/wine/loader.c,v
retrieving revision 1.35
diff -u -r1.35 loader.c
--- libs/wine/loader.c	17 Feb 2006 17:42:54 -0000	1.35
+++ libs/wine/loader.c	18 Feb 2006 19:03:00 -0000
@@ -28,6 +28,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
+#ifdef HAVE_SYS_PRCTL_H
+# include <sys/prctl.h>
+#endif
 #ifdef HAVE_SYS_MMAN_H
 #include <sys/mman.h>
 #endif
@@ -576,6 +579,12 @@
     void *ntdll = NULL;
     void (*init_func)(void);
 
+#ifdef HAVE_SYS_PRCTL_H
+    /* have it show the .exe in "ps" output */
+    if (argc > 1)
+	prctl(PR_SET_NAME,argv[1]);
+#endif
+
     wine_init_argv0_path( argv[0] );
     build_dll_path();
     __wine_main_argc = argc;
Index: configure.ac
===================================================================
RCS file: /home/wine/wine/configure.ac,v
retrieving revision 1.441
diff -u -r1.441 configure.ac
--- configure.ac	17 Feb 2006 13:21:57 -0000	1.441
+++ configure.ac	18 Feb 2006 19:03:01 -0000
@@ -251,6 +251,7 @@
 	sys/mtio.h \
 	sys/param.h \
 	sys/poll.h \
+	sys/prctl.h \
 	sys/ptrace.h \
 	sys/reg.h \
 	sys/scsiio.h \
@@ -1082,7 +1083,7 @@
 esac
 
 case $host in
-  *i[[3456789]]86*-linux* | *i[[3456789]]86*-k*bsd*-gnu)
+  *i[[3456789]]86*-linux* | *i[[3456789]]86*-k*bsd*-gnu | *x86_64*-linux*)
     AC_SUBST(MAIN_BINARY,"wine-glibc")
     AC_SUBST(EXTRA_BINARIES,"wine-kthread wine-pthread wine-preloader")
     ;;



More information about the wine-patches mailing list