Subject: type inconsistencies
To: None <mycroft@gnu.ai.mit.edu>
From: Gordon W. Ross <gwr@mc.com>
List: tech-kern
Date: 03/09/1995 11:26:56
> From: mycroft@gnu.ai.mit.edu
> Date: Thu, 9 Mar 95 10:45:18 est

>    Yes.  Check the POSIX 1003.1 spec. for the official prototypes for
>    mmap, munmap, mprotect, etc.
> 
> POSIX 1003.1 doesn't define any of these, and if it did, I *strongly*
> suspect it would have used size_t in the first place.  Right now,
> we're not even consistent; mmap(2) uses size_t, but the rest of them
> use int.

OK, I found my copy of the spec. and you're right, size_t is OK.

Quoting from:  IEEE Std. 1003.1b-1993
Section 12: Memory Management

Sec. 12.2.1.1
#include <sys/mman.h>
void *mmap(void *addr, size_t len, int prot, int flags,
	int fildes, off_t off);

Sec. 12.2.2.1
#include <sys/mman.h>
void *munmap(void *addr, size_t len);

Sec. 12.2.3.1
#include <sys/mman.h>
void *mprotect(void *addr, size_t len, int prot);