From 8ef1f19433634558da643ca163039d57a82fea5b Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Mon, 31 Jul 2023 16:30:23 -0700 Subject: [PATCH] descriptor-flags: eliminate non-blocking flag, and therefore set-flags A blocking or non-blocking read/write is a determined by which method is used on a read/write stream created from a file. Each of these stream methods must be implemened for all files. Therefore, it does not make sense to specify non-blocking at the file level. The set-flags method was only to be used to set or clear the non-blocking flag, so this entire method may now be eliminated. --- example-world.md | 23 ----------------------- wit/types.wit | 17 ----------------- 2 files changed, 40 deletions(-) diff --git a/example-world.md b/example-world.md index b4d9d23..10e1a15 100644 --- a/example-world.md +++ b/example-world.md @@ -673,15 +673,6 @@ any of the other types specified.

Write mode: Data can be written to.

  • -

    non-blocking:

    -

    Requests non-blocking operation. -

    When this flag is enabled, functions may return immediately with an -error-code::would-block error code in situations where they would -otherwise block. However, this non-blocking behavior is not -required. Implementations are permitted to ignore this flag and -block. This is similar to O_NONBLOCK in POSIX.

    -
  • -
  • file-integrity-sync:

    Request that writes be performed according to synchronized I/O file integrity completion. The data stored in the file and the file's @@ -921,20 +912,6 @@ from fdstat_get in earlier versions of WASI.

    -

    set-flags: func

    -

    Set status flags associated with a descriptor.

    -

    This function may only change the non-blocking flag.

    -

    Note: This is similar to fcntl(fd, F_SETFL, flags) in POSIX.

    -

    Note: This was called fd_fdstat_set_flags in earlier versions of WASI.

    -
    Params
    - -
    Return values
    -

    set-size: func

    Adjust the size of an open file. If this increases the file's size, the extra bytes are filled with zeros.

    diff --git a/wit/types.wit b/wit/types.wit index 9a1bc12..0772012 100644 --- a/wit/types.wit +++ b/wit/types.wit @@ -55,14 +55,6 @@ interface types { read, /// Write mode: Data can be written to. write, - /// Requests non-blocking operation. - /// - /// When this flag is enabled, functions may return immediately with an - /// `error-code::would-block` error code in situations where they would - /// otherwise block. However, this non-blocking behavior is not - /// required. Implementations are permitted to ignore this flag and - /// block. This is similar to `O_NONBLOCK` in POSIX. - non-blocking, /// Request that writes be performed according to synchronized I/O file /// integrity completion. The data stored in the file and the file's /// metadata are synchronized. This is similar to `O_SYNC` in POSIX. @@ -378,15 +370,6 @@ interface types { /// from `fdstat_get` in earlier versions of WASI. get-type: func(this: descriptor) -> result - /// Set status flags associated with a descriptor. - /// - /// This function may only change the `non-blocking` flag. - /// - /// Note: This is similar to `fcntl(fd, F_SETFL, flags)` in POSIX. - /// - /// Note: This was called `fd_fdstat_set_flags` in earlier versions of WASI. - set-flags: func(this: descriptor, %flags: descriptor-flags) -> result<_, error-code> - /// Adjust the size of an open file. If this increases the file's size, the /// extra bytes are filled with zeros. ///