Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [uml:next 29/44] arch/um/os-Linux/main.c:117:12: error: use of undeclared identifier 'PATH_MAX'
@ 2024-10-23 21:14 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-10-23 21:14 UTC (permalink / raw)
  To: Johannes Berg; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/uml/linux next
head:   3f17fed2149192c7d3b76a45a6a87b4ff22cd586
commit: 031acdcfb566ba18ffb57d51abf357a5e350424b [29/44] um: restore process name
config: um-allnoconfig (https://download.01.org/0day-ci/archive/20241024/202410240553.gYNIXN8i-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241024/202410240553.gYNIXN8i-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410240553.gYNIXN8i-lkp@intel.com/

All errors (new ones prefixed by >>):

>> arch/um/os-Linux/main.c:117:12: error: use of undeclared identifier 'PATH_MAX'
     117 |                 char buf[PATH_MAX] = {};
         |                          ^
   1 error generated.


vim +/PATH_MAX +117 arch/um/os-Linux/main.c

   107	
   108	int __init main(int argc, char **argv, char **envp)
   109	{
   110		char **new_argv;
   111		int ret, i, err;
   112	
   113		/* Disable randomization and re-exec if it was changed successfully */
   114		ret = personality(PER_LINUX | ADDR_NO_RANDOMIZE);
   115		if (ret >= 0 && (ret & (PER_LINUX | ADDR_NO_RANDOMIZE)) !=
   116				 (PER_LINUX | ADDR_NO_RANDOMIZE)) {
 > 117			char buf[PATH_MAX] = {};
   118			ssize_t ret;
   119	
   120			ret = readlink("/proc/self/exe", buf, sizeof(buf));
   121			if (ret < 0 || ret >= sizeof(buf)) {
   122				perror("readlink failure");
   123				exit(1);
   124			}
   125			execve(buf, argv, envp);
   126		}
   127	
   128		set_stklim();
   129	
   130		setup_env_path();
   131	
   132		setsid();
   133	
   134		new_argv = malloc((argc + 1) * sizeof(char *));
   135		if (new_argv == NULL) {
   136			perror("Mallocing argv");
   137			exit(1);
   138		}
   139		for (i = 0; i < argc; i++) {
   140			new_argv[i] = strdup(argv[i]);
   141			if (new_argv[i] == NULL) {
   142				perror("Mallocing an arg");
   143				exit(1);
   144			}
   145		}
   146		new_argv[argc] = NULL;
   147	
   148		/*
   149		 * Allow these signals to bring down a UML if all other
   150		 * methods of control fail.
   151		 */
   152		install_fatal_handler(SIGINT);
   153		install_fatal_handler(SIGTERM);
   154	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-10-23 21:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-23 21:14 [uml:next 29/44] arch/um/os-Linux/main.c:117:12: error: use of undeclared identifier 'PATH_MAX' kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox