add: return B_OK;
context: copydir(char *fromPath,char *toPath){    int     bfd, err = 0;    char    *myfs_name; //[1024];    char	*from_name; //[1024];	int		fd;    size_t  amt;    char	*buff; //[4 * 1024];    size_t  bufferSize = 4 * 1024;	DIR		*from;	dirent_t	*dirent;	from = opendir(fromPath);	if (from == NULL) {		printf("could not open %s\n", fromPath);		return;	}	myfs_name = malloc(1024);  from_name = malloc(1024);  buff = malloc(bufferSize);	if (myfs_name == NULL || from_name == NULL || buff == NULL) {		printf("out of memory\n");		return;	}	while ((dirent = readdir(from)) != NULL) {		DIR *attrDirectory;		dirent_t *attr;		struct stat st;		if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name, ".."))			continue;		strcpy(from_name, fromPath);		if (from_name[strlen(from_name) - 1] != '/')			strcat(from_name, "/");		strcat(from_name, dirent->d_name);		if (stat(from_name, &st) != 0)			continue;				if (st.st_mode & S_IFDIR) {			char path[1024];			strcpy(path, toPath);			strcat(path, "/");			strcat(path, dirent->d_name);			if ((err = sys_mkdir(1, -1, path, MY_S_IRWXU)) == B_OK)				copydir(from_name, path);			else				printf("Could not create directory %s: (%s)\n", path, strerror(err));		} else {			fd = open(from_name, O_RDONLY);			if (fd < 0) {				printf("can't open host file: %s\n", from_name);				return;			}			sprintf(myfs_name, "%s/%s", toPath, dirent->d_name);			if ((bfd = sys_open(1, -1, myfs_name, O_RDWR|O_CREAT,								MY_S_IFREG|MY_S_IRWXU, 0)) < 0) {		        close(fd);		        printf("error opening: %s\n", myfs_name);		        return;		    }			// copy attributes first!			if ((attrDirectory = fs_fopen_attr_dir(fd)) != NULL) {				while ((attr = fs_read_attr_dir(attrDirectory)) != NULL) {					struct attr_info attrInfo;					int32 size = bufferSize, bytesRead;					if (fs_stat_attr(fd, attr->d_name, &attrInfo) != 0)						continue;					if (attrInfo.size <= size)						size = attrInfo.size - 1;					else						printf("truncating attribute: %s\n", attr->d_name);					bytesRead = fs_read_attr(fd, attr->d_name, attrInfo.type, 0, buff, size);					if (bytesRead < size) {						printf("could not read attribute %s: %s\n", attr->d_name, strerror(bytesRead));						continue;					}					buff[size] = '\0';				    err = sys_write_attr(1, bfd, attr->d_name, attrInfo.type, buff, size, 0);					if (err < B_OK) {						printf("write attr (\"%s\", type = %p, %p, %ld bytes) failed: %s\n",							attr->d_name, (void *)attrInfo.type, buff, size, strerror(err));						continue;					}				}				fs_close_attr_dir(attrDirectory);			} else				puts("could not open attr-dir");			while ((amt = read(fd, buff, bufferSize)) == bufferSize) {				err = sys_write(1, bfd, buff, amt);				if (err < 0)					break;			}			if (amt && err >= 0) {				err = sys_write(1, bfd, buff, amt);			}			if (err < 0) {				printf("write error: err == %d, amt == %d\n", err, amt);			}			sys_close(1, bfd);			close(fd);		}	}	closedir(from);	free(myfs_name);  free(from_name);  free(buff);}