diff --git a/wasi-filesystem.wit.md b/wasi-filesystem.wit.md index d19ef6f..bd3b126 100644 --- a/wasi-filesystem.wit.md +++ b/wasi-filesystem.wit.md @@ -96,10 +96,6 @@ flags descriptor-flags { /// /// Note: This was called `filestat` in earlier versions of WASI. record descriptor-stat { - /// Device ID of device containing the file. - dev: device, - /// File serial number. - ino: inode, /// File type. %type: descriptor-type, /// Number of hard links to the file. @@ -162,19 +158,6 @@ flags mode { type linkcount = u64 ``` -## `device` -```wit -/// Identifier for a device containing a file system. Can be used in combination -/// with `inode` to uniquely identify a file or directory in the filesystem. -type device = u64 -``` - -## `inode` -```wit -/// Filesystem object serial number that is unique within its file system. -type inode = u64 -``` - ## `new-timestamp` ```wit /// When setting a timestamp, this gives the value to set it to. @@ -193,14 +176,6 @@ variant new-timestamp { ```wit /// A directory entry. record dir-entry { - /// The serial number of the object referred to by this directory entry. - /// May be none if the inode value is not known. - /// - /// When this is none, libc implementations might do an extra `stat-at` - /// call to retrieve the inode number to fill their `d_ino` fields, so - /// implementations which can set this to a non-none value should do so. - ino: option, - /// The type of the file referred to by this directory entry. %type: descriptor-type, @@ -861,6 +836,28 @@ try-lock-exclusive: func() -> result<_, errno> unlock: func() -> result<_, errno> ``` +## `is-same-file` +```wit +/// Test whether two descriptors refer to the same file or directory. +/// +/// In POSIX, this corresponds to testing whether the two descriptors have the +/// same device (`st_dev`) and inode (`st_ino` or `d_ino`) numbers. +/// wasi-filesystem does not expose device and inode numbers, so this function +/// may be used instead. +is-same-file: func(other: descriptor) -> bool + +/// Test whether two descriptors refer to files or directories on the same +/// mountpoint. +/// +/// `rename-at` only works when source and destination are on the same mount +/// point. This function provides a way of testing whether two files or +/// directories are on the same mount point. +/// +/// In POSIX, this corresponds to testing whether the two descriptors have the +/// same device (`st_dev`) number. wasi-filesystem does not expose device +/// numbers, so this function may be used instead. +is-same-mountpoint(other: descriptor) -> bool + ```wit } ```