diff options
author | Jamie Liu <jamieliu@google.com> | 2019-09-20 14:23:20 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-09-20 14:24:29 -0700 |
commit | fb55c2bd0d5d80b240184f643967f214d3dbc259 (patch) | |
tree | da6de2e6f4939ce4c1862c3dc94f33e10e130140 /pkg/sentry/vfs | |
parent | 002f1d4aaefa9abdd50e3e8906ae828c31d038e6 (diff) |
Change vfs.Dirent.Off to NextOff.
"d_off is the distance from the start of the directory to the start of the next
linux_dirent." - getdents(2).
PiperOrigin-RevId: 270349685
Diffstat (limited to 'pkg/sentry/vfs')
-rw-r--r-- | pkg/sentry/vfs/file_description.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/sentry/vfs/file_description.go b/pkg/sentry/vfs/file_description.go index 86bde7fb3..7eb2b2821 100644 --- a/pkg/sentry/vfs/file_description.go +++ b/pkg/sentry/vfs/file_description.go @@ -199,8 +199,11 @@ type Dirent struct { // Ino is the inode number. Ino uint64 - // Off is this Dirent's offset. - Off int64 + // NextOff is the offset of the *next* Dirent in the directory; that is, + // FileDescription.Seek(NextOff, SEEK_SET) (as called by seekdir(3)) will + // cause the next call to FileDescription.IterDirents() to yield the next + // Dirent. (The offset of the first Dirent in a directory is always 0.) + NextOff int64 } // IterDirentsCallback receives Dirents from FileDescriptionImpl.IterDirents. |