[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] [PATCH] nbd-server: add setproctitle support

On Thu, Jun 28, 2012 at 01:08:30AM +0200, Wouter Verhelst wrote:
> On Mon, Jun 25, 2012 at 03:08:06AM +0400, Dmitry V. Levin wrote:
> > +#  include <setproctitle.h>
> > +# endif
> > +#endif
> This means <setproctitle.h> is only included if we have it, and the user
> asked us to compile it in.
> > +	setproctitle("%s", client->clientname);
> > +#endif
> This means we try to compile it in if the user asked us to do so,
> regardless of whether the header is available.

setproctitle != setproctitle.h

There are more than one implementation of setproctitle interface.  The
setproctitle signatures are compatible, but header file names may differ.

For example, *BSD implement it within libc with prototype defined in
system header files (e.g. NetBSD in stdlib.h, FreeBSD in unistd.h):

The setproctitle implementation I use is
This is a library I maintain with setproctitle prototype defined in
setproctitle.h header file.

> Additionally, I'm not convinced we need a compile-time option for this.
> What's your reason for doing it that way?

This is the most conservative way to introduce a new feature I could think
of: one has to specify --with-setproctitle to use setproctitle even if
operating system supports setproctitle interface.


Attachment: pgpWIYCMNXejN.pgp
Description: PGP signature

Reply to: