[comp.os.minix] 68000 minix.

"glen lalonde" <glen.lalonde@canrem.uucp> (02/26/91)

I attempted to do a 'nm' on the kernel image that I had, but
it failed. After I investigated the problem, I think I have at
least one good question. The header files show that 'read'
takes an unsigned int for the number of bytes to read. Yet fs
has a check "if (nbytes <0) return(EINVAL)" Thus if you try
to read > 32767 bytes at once the read will fail. There is a
comment a few lines above "only MM >32K at once". Why can't
a normal user process read up to 64K at once?
--
Canada Remote Systems.  Toronto, Ontario
NorthAmeriNet Host

HBO043%DJUKFA11.BITNET@cunyvm.cuny.edu (Christoph van Wuellen) (03/03/91)

To answer 'why can't a user read more than 32K at once?'

This is a consequence of using 16-bit ints.
The read system call has to return the number of bytes OR some error info.
Thus, not all values from 0...65535 are legal byte counts.

The most common way is to define the byte count as a SIGNED quantity, and
to reserve the values below 0 for error conditions.

It is a very weak point of MINIX that byte counts are defined to be
unsigned in the library.

C.v.W.