Skip to content

waitpid() desn't check for invalid options #1449

@adamdebek

Description

@adamdebek

If the option argument is invalid, -1 should be returned and errno should be set to EINVAL and this should be done before waiting.

Reproduction (ia32-generic-qemu):

#include <stdio.h>
#include <errno.h>
#include <sys/wait.h>

int main(void)
{
        int ret;
        int dummy = 123;

        ret = waitpid((pid_t)dummy, NULL, dummy);
        printf("waitpid ret: %d errno: %d\n", ret, errno);

        return 0;
}
Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions