tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Expected msgrcv(2) behaviour with msgsz > SSIZE_MAX ?



Hi,

While running LTP (Linux Testsuite Project) testcases under
compat_linux on my -current NetBSD/amd64 workstation, i discovered
that a testcase for msgrcv(2) syscall with msgsz < 0 was hanging
instead of failing with EINVAL.

Looking into this one, i noticed that the syscall man page state that
a negative msgsz value make it fail with errno set to EINVAL, but the
corresponding code does not seems to match.

As size_t type is unsigned, this can never happen ... But, at the same
time, the OpenGroup specification says that `msgsz > SSIZE_MAX' is
implementation dependant (test i can easily convert to `(ssize_t)msgsz
< 0', which was probably meant).

I'm pretty sure that our implementation does handle this nicely. Can
someone confirm that both man page and compat linux emulation needs to
be fixed ?

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.


Home | Main Index | Thread Index | Old Index