Skip to content

Expose SSIZE_MAX to enable safe/portable read and write system calls #1504

Open
@ghost

Description

The results of read [1] and write [2] system calls are implementation-defined if the count parameter is larger than value of SSIZE_MAX constant defined in limits.h according to POSIX.1 standard.

So in order to make it possible to use read and write in a portable manner, SSIZE_MAX should be exposed on POSIX.1-conformant systems.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html
[2] https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html

Activity

ghost changed the title [-]Expose SSIZE_MAX to enable safe read system calls[/-] [+]Expose SSIZE_MAX to enable safe read and write system calls[/+] on Sep 7, 2019
ghost changed the title [-]Expose SSIZE_MAX to enable safe read and write system calls[/-] [+]Expose SSIZE_MAX to enable safe/portable read and write system calls[/+] on Sep 7, 2019
maxbla

maxbla commented on Oct 17, 2020

@maxbla
Contributor

I realize this issue is rather old, but is there any platform where SSIZE_MAX is not equal to libc::ssize::max_value()?

added
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
on Aug 29, 2024
added this to the 1.x milestone on Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-API-requestCategory: API requestE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.O-unix

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @maxbla@tgross35@JohnTitor

        Issue actions

          Expose SSIZE_MAX to enable safe/portable read and write system calls · Issue #1504 · rust-lang/libc