Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/imgact_shell.c
Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | exec_shell_imgact(struct image_params *imgp) | ||||
imgp->interpreted |= IMGACT_SHELL; | imgp->interpreted |= IMGACT_SHELL; | ||||
/* | /* | ||||
* At this point we have the first page of the file mapped. | * At this point we have the first page of the file mapped. | ||||
* However, we don't know how far into the page the contents are | * However, we don't know how far into the page the contents are | ||||
* valid -- the actual file might be much shorter than the page. | * valid -- the actual file might be much shorter than the page. | ||||
* So find out the file size. | * So find out the file size. | ||||
*/ | */ | ||||
error = VOP_GETATTR(imgp->vp, &vattr, imgp->proc->p_ucred); | error = VOP_GETATTR(imgp->vp, 0, &vattr, imgp->proc->p_ucred); | ||||
if (error) | if (error) | ||||
return (error); | return (error); | ||||
/* | /* | ||||
* Copy shell name and arguments from image_header into a string | * Copy shell name and arguments from image_header into a string | ||||
* buffer. | * buffer. | ||||
*/ | */ | ||||
maxp = &image_header[MIN(vattr.va_size, MAXSHELLCMDLEN)]; | maxp = &image_header[MIN(vattr.va_size, MAXSHELLCMDLEN)]; | ||||
▲ Show 20 Lines • Show All 117 Lines • Show Last 20 Lines |