[CRIU] [PATCH] env: Introduce logging of runtime environment

Cyrill Gorcunov gorcunov at gmail.com
Fri Sep 19 08:11:42 PDT 2014


On Fri, Sep 19, 2014 at 07:03:33PM +0400, Pavel Emelyanov wrote:
> On 09/19/2014 06:59 PM, Cyrill Gorcunov wrote:
> > On Fri, Sep 19, 2014 at 05:51:15PM +0400, Pavel Emelyanov wrote:
> >> On 09/17/2014 11:22 AM, Cyrill Gorcunov wrote:
> >>
> >>> +void log_rt_env(unsigned int loglevel)
> >>> +{
> >>> +	if (pr_quelled(loglevel))
> >>> +		return;
> >>> +
> >>> +	print_on_level(loglevel, "Run time environment info\n");
> >>> +	print_on_level(loglevel, "  Command line: %s\n", rt_env.cmdline);
> >>> +}
> >>> +
> >>> +int fill_rt_env(int argc, char *argv[])
> >>
> >> Why do we need pre-fill? The getopt_long rearranges options, but
> >> doesn't eat them :)
> > 
> > Well, I not sure if it's guaranteed that argv and argc will remain
> > intact,
> 
> It is. The getopt_long only reshuffles them.

How it's different then? I mean we need a real copy of then command line,
and we fetch it early, what you propose instead?


More information about the CRIU mailing list