From: Richard W. <ri...@no...> - 2016-06-12 21:05:16
|
Am 12.06.2016 um 22:59 schrieb Vegard Nossum: > On 12 June 2016 at 22:11, Richard Weinberger > <ric...@gm...> wrote: >>> I wonder why setup_env_path() ends up calling the kernel's snprintf(), >>> I thought that it would be using the glibc snprintf() at this point? >> >> That early you cannot use current() nor any other core kernel stuff >> since the kernel has not started so far. >> So, the current thread info struct points to garbage. > > Yes, I know. I think setup_env_path() should call the libc snprintf > rather than the kernel one, can you explain how to do that properly? Currently UML sets up nasty maps for known namespaces clashes. i.e. KBUILD_CFLAGS += $(CFLAGS) $(CFLAGS-y) -D__arch_um__ \ $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \ -Din6addr_loopback=kernel_in6addr_loopback \ -Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr A much better approach would be having a real linker scope. Some time ago I posted some thoughts on that: https://lkml.org/lkml/2015/11/19/758 Due to -ENOTIME this never materialized, though. ;-( Thanks, //richard |