Skip to content

Handle RW case for open #80

Description

@krs85

Seems like the pash benchmarks like to open files for reading and writing. Surprisingly, I haven't run into anything before this that does this. But regardless, it needs to be handled.

First thought is it basically is open for reading + open for writing. So we need to add RW as a mode for SyscallEvent::Open() event. And then assign the proper preconditions and postconditions.

  • Replace OFlag in SyscallEvent::Open() with a custom enum OpenMode { Read, Write, Both }
  • Add another parameter to SyscallEvent::Open() : offset mode. This can be None if read only. Again, we can make a custom enum. Safer with less cases.
  • handle_open()
  • generate_open_syscall_event()
  • generate_preconditions()
  • generate_postconditions()
  • copying to cache
  • copying from the cache
  • in the case where no offset mode (O_APPEND or O_TRUNC) is provided, the default behavior is to start writing at the beginning of the file, overwriting whatever is there. Yuck! But for our purposes, we treat this the same as an O_APPEND, conservatively treating the entire starting contents as a precondition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions