[CRIU] [PATCH 1/2] crtools: add setproctitle.h

Kir Kolyshkin kir at openvz.org
Wed Mar 26 22:22:17 PDT 2014


On 03/21/2014 02:57 AM, Ruslan Kuprieiev wrote:
> Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
> ---
>   include/setproctitle.h | 11 +++++++++++
>   1 file changed, 11 insertions(+)
>   create mode 100644 include/setproctitle.h
>
> diff --git a/include/setproctitle.h b/include/setproctitle.h
> new file mode 100644
> index 0000000..83d5736
> --- /dev/null
> +++ b/include/setproctitle.h
> @@ -0,0 +1,11 @@
> +#ifndef __CR_SETPROCTITLE_H__
> +#define __CR_SETPROCTITLE_H__
> +
> +#ifdef CONFIG_HAS_LIBBSD
> +#include <bsd/unistd.h>
> +#else
> +void setproctitle_init(int argc, char *argv[], char *envp[]) {return; }


Now the only problem I see is on my F18 box I have libbsd-0.4.2 which
doesn't have setproctitle_init() so this will not compile. I mean not this,
of course, but a call to setproctitle_init() from main() in your next patch.

F20 is fine though, and I haven't checked what's up with F19.

I think we can either require a minimum library version, or check
explicitly for setproctitle_init() and have an extra define for it.
Some other ways are possible, too. But I guess it should not fail
to compile.

Everything else looks fine for me.
> +void setproctitle(const char *fmt, ...) {return; }
> +#endif
> +
> +#endif /* __CR_SETPROCTITLE_H__ */



More information about the CRIU mailing list