Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
visitorckw opened this issue May 10, 2024 · 0 comments
Open

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

visitorckw opened this issue May 10, 2024 · 0 comments

Comments

@visitorckw
Copy link
Collaborator

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant