add: if (path[0] != '/') { char relativePath[PATH_MAX]; strcpy(relativePath, path);   status = _kern_getcwd(path, sizeof(path)); FATAL((status != B_OK), status, "_kern_getcwd() failed\n");  if (strlcat(path, "/", sizeof(path)) >= sizeof(path) || strlcat(path, relativePath, sizeof(path)) >= sizeof(path)) { FATAL(true, B_NAME_TOO_LONG, "Absolute path of image %s is too " "long!\n", relativePath); } }
context: load_container(char const *name, image_type type, const char *rpath){	int32 pheaderSize, sheaderSize;	char path[PATH_MAX];	int fd;	int len;	char ph_buff[4096];	int num_regions;	bool map_success;	bool dynamic_success;	image_t *found;	image_t *image;	status_t status;	struct Elf32_Ehdr eheader;	// Have we already loaded that image? Don't check for add-ons -- we always	// reload them.	if (type != B_ADD_ON_IMAGE) {		found = find_image(name, APP_OR_LIBRARY_TYPE);		if (found) {			atomic_add(&found->ref_count, 1);			return found;		}	}	strlcpy(path, name, sizeof(path));	// Try to load explicit image path first	fd = open_executable(path, type, rpath);	FATAL((fd < 0), fd, "cannot open file %s\n", path);	len = _kern_read(fd, 0, &eheader, sizeof(eheader));	FATAL((len != sizeof(eheader)), B_BAD_DATA,		"troubles reading ELF header\n");	status = parse_elf_header(&eheader, &pheaderSize, &sheaderSize);	FATAL((status < B_OK), status, "incorrect ELF header\n");	// ToDo: what to do about this restriction??	FATAL((pheaderSize > (int)sizeof(ph_buff)), B_UNSUPPORTED,		"cannot handle Program headers bigger than %lu\n",		(long unsigned)sizeof(ph_buff));	len = _kern_read(fd, eheader.e_phoff, ph_buff, pheaderSize);	FATAL((len != pheaderSize), B_BAD_DATA,		"troubles reading Program headers\n");	num_regions = count_regions(ph_buff, eheader.e_phnum, eheader.e_phentsize);	FATAL((num_regions <= 0), B_BAD_DATA,		"troubles parsing Program headers, num_regions= %d\n", num_regions);	image = create_image(name, path, num_regions);	FATAL((!image), B_NO_MEMORY, "failed to allocate image_t control block\n");	parse_program_headers(image, ph_buff, eheader.e_phnum, eheader.e_phentsize);	FATAL(!assert_dynamic_loadable(image), B_UNSUPPORTED,		"dynamic segment must be loadable (implementation restriction)\n");	map_success = map_image(fd, path, image, type == B_APP_IMAGE);	FATAL(!map_success, B_ERROR, "troubles reading image\n");	dynamic_success = parse_dynamic_segment(image);	FATAL(!dynamic_success, B_BAD_DATA, "troubles handling dynamic section\n");	image->entry_point = eheader.e_entry + image->regions[0].delta;	image->type = type;	register_image(image, fd, path);	_kern_close(fd);	enqueue_image(&gLoadedImages, image);	return image;}