Changeset View
Changeset View
Standalone View
Standalone View
sys/ufs/ufs/ufs_vnops.c
Show First 20 Lines • Show All 2,212 Lines • ▼ Show 20 Lines | #endif | ||||
break; | break; | ||||
} | } | ||||
if (offset < startoffset || dp->d_ino == 0) | if (offset < startoffset || dp->d_ino == 0) | ||||
goto nextentry; | goto nextentry; | ||||
dstdp.d_fileno = dp->d_ino; | dstdp.d_fileno = dp->d_ino; | ||||
dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); | dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); | ||||
bcopy(dp->d_name, dstdp.d_name, dstdp.d_namlen); | bcopy(dp->d_name, dstdp.d_name, dstdp.d_namlen); | ||||
dstdp.d_name[dstdp.d_namlen] = '\0'; | dstdp.d_name[dstdp.d_namlen] = '\0'; | ||||
/* NOTE: d_off is the offset of the *next* entry. */ | |||||
dstdp.d_off = offset + dp->d_reclen; | |||||
if (dstdp.d_reclen > uio->uio_resid) { | if (dstdp.d_reclen > uio->uio_resid) { | ||||
if (uio->uio_resid == startresid) | if (uio->uio_resid == startresid) | ||||
error = EINVAL; | error = EINVAL; | ||||
else | else | ||||
error = EJUSTRETURN; | error = EJUSTRETURN; | ||||
break; | break; | ||||
} | } | ||||
/* Advance dp. */ | /* Advance dp. */ | ||||
▲ Show 20 Lines • Show All 560 Lines • Show Last 20 Lines |