Email List: Xaustin-review-lX
[All Lists]

Defect in XSH mmap()

To: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Defect in XSH mmap()
From: yyyyyyy@xxxxxxxxxx
Date: Sat, 1 Mar 2003 00:41:07 GMT
        Defect report from : Ulrich Drepper , Red Hat

(Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)

@ page 771 line 25203 section mmap() objection {ud-mmap}

Problem:

Defect code :  1. Error

This has probably been brought up before but I couldn't find anything in the 
standard or rationale.

The standard currently does not say what has to happen if len==0.

When using the len parameter in the description the interval [pa,pa+len)
mentioned but if you fill in 0 for len you get [pa,pa) which is invalid.

There is also no error value defined for it even though clearly no
mapping can happen.  Some implementations do not return an error but a
subsequent munmap() with the address returned by mmap() will fail.

I would suggest to explicitly describe the behavior of len == 0.  The
most logical possibility would be to require returning an error.

Action:

Add a new paragraph, perhaps after line 25202:

If /len/ is zero /mmap()/ shall fail and no mapping shall be
established.


Add after line 25321:

[EINVAL] The value of /len/ is zero.


<Prev in Thread] Current Thread [Next in Thread>