Skip to content

Writes to stdin pipe of a process can write less bytes than requested, but still report SDL_IO_STATUS_READY #13413

@HolyBlackCat

Description

@HolyBlackCat

This happens on both Windows and Linux.

If I create a process with SDL_PROP_PROCESS_CREATE_STDIN_NUMBER = SDL_PROCESS_STDIO_APP and try to write more than 64k bytes at once (that's the number on Linux, it's smaller on Windows), then SDL_WriteIO() will return a smaller value than the specified length (64k on Linux), but SDL_GetIOStatus() still reports SDL_IO_STATUS_READY. I've tested this on cat on Linux, and a similar custom program on Windows.

I don't mind this behavior per se, but I suggest documenting it (I could make a PR if needed).

Alternatively, SDL could retry the writes (for remaining bytes) automatically. Is there any downside to doing that?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions