1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-03-28 09:50:20 +01:00

33465: use prctl() for "jobs -Z" where available

Bart apologizes for waiting 7 years to apply this change.
This commit is contained in:
Han Pingtian 2021-05-15 14:23:28 -07:00 committed by Bart Schaefer
parent 4fa4dcad17
commit 8bdbc61497
3 changed files with 16 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2021-05-15 Bart Schaefer <schaefer@zsh.org>
* Han Pingtian: 33465 (very belatedly): use prctl() for "jobs -Z"
where available
* Vincent Lefevre: 48723: Src/math.c: locale-safe recognition of
"Inf" and "NaN" constants

View File

@ -2270,6 +2270,13 @@ bin_fg(char *name, char **argv, Options ops, int func)
memcpy(hackzero, *argv, len);
memset(hackzero + len, 0, hackspace - len);
#endif
#ifdef HAVE_PRCTL
/* try to change /proc/$$/comm which will *
* be used when checking with "ps -e" */
#include <sys/prctl.h>
prctl(PR_SET_NAME, *argv);
#endif
unqueue_signals();
return 0;
}

View File

@ -2065,6 +2065,12 @@ AH_TEMPLATE([HAVE_SETPROCTITLE],
AC_CHECK_FUNC(setproctitle,AC_DEFINE(HAVE_SETPROCTITLE),
AC_SEARCH_LIBS(setproctitle,util,AC_DEFINE(HAVE_SETPROCTITLE)))
dnl CHECK FOR prctl() FOR jobs -Z / ARGV0 when checking with ps -e
AH_TEMPLATE([HAVE_PRCTL],
[Define to 1 if the system supports `prctl' to change process name])
AC_CHECK_FUNC(prctl,AC_DEFINE(HAVE_PRCTL),
AC_SEARCH_LIBS(prctl,c,AC_DEFINE(HAVE_PRCTL)))
dnl -------------
dnl CHECK FOR NIS
dnl -------------