X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=libiberty%2Fsetproctitle.c;h=1d3fafbf0a3cee8f909879f6c9267264f04555d5;hb=1087441f0712681bf0c30d104870ea299aa326c1;hp=734af2eca6e7b31d8aae89d2903a27ef4fab3e97;hpb=80347f88a2e87534cf0123e9f87d069e96ceba36;p=deliverable%2Fbinutils-gdb.git diff --git a/libiberty/setproctitle.c b/libiberty/setproctitle.c index 734af2eca6..1d3fafbf0a 100644 --- a/libiberty/setproctitle.c +++ b/libiberty/setproctitle.c @@ -1,5 +1,5 @@ /* Set the title of a process. - Copyright (C) 2010 Free Software Foundation, Inc. + Copyright (C) 2010-2019 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or @@ -20,14 +20,15 @@ Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif -#ifdef HAVE_PRCTL_SET_NAME +#ifdef HAVE_SYS_PRCTL_H +#include #include #endif #include "ansidecl.h" /* -@deftypefn Supplemental void setproctitle (const char *@var{fmt} ...) +@deftypefn Supplemental void setproctitle (const char *@var{fmt}, ...) Set the title of a process to @var{fmt}. va args not supported for now, but defined for compatibility with BSD. @@ -39,9 +40,9 @@ but defined for compatibility with BSD. void setproctitle (const char *name ATTRIBUTE_UNUSED, ...) { -#ifdef HAVE_PRCTL_SET_NAME - /* On Linux this sets the top visible "comm", but not necessarily - the name visible in ps. */ +#ifdef PR_SET_NAME + /* On GNU/Linux this sets the top visible "comm", but not + necessarily the name visible in ps. */ prctl (PR_SET_NAME, name); #endif }