Skip to content

Calling close() system call with fd < 3 #435

@visitorckw

Description

@visitorckw

Currently, if the close() system call is invoked with fd < 3, close() won't take any action and won't return an error code of -1. Some programs may need to close stdout or stderr to avoid excessive output. Therefore, the current implementation may lead to users getting unexpected results. However, rv32emu also uses stdout and stderr to output some information. Therefore, directly closing stdout and stderr would result in the loss of relevant output information from rv32emu. Here are two possible ways to address this:

  1. close() performs no action but returns an error code of -1.
  2. Close stdout and stderr as usual and allow rv32emu to lose output information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions