bug-bash
[Top][All Lists]
Advanced

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

Re: source(builtin) and read(2)


From: Matthew Woehlke
Subject: Re: source(builtin) and read(2)
Date: Fri, 23 Mar 2007 14:38:54 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.4.0

Andreas Schwab wrote:
Matthew Woehlke writes:
Um. In fact, it is also an *ERROR* (i.e. read() will fail outright with -
IIRC - EINVAL) to try to read more than SSIZE_MAX bytes at once. Many, but
not all, systems define SSIZE_MAX to be a very large value, but it may be
as small as 32k. I guess I've never tried to source an autoconf configure
script on such a system.

If your ssize_t is smaller than 32 bits you'll have to worry about more
things than that.

Huh? I never said anything about ssize_t, I said SSIZE_MAX which appears to be guaranteed by POSIX to be at least 32 *kilobytes*, often bigger but /not reliably so/. Nothing about sizeof(ssize_t).

The point was that this is an error on some systems:

    read(fd, buffer, 65536); // size > SSIZE_MAX, will fail with EINVAL

--
Matthew
Excessive obscurity: -5





reply via email to

[Prev in Thread] Current Thread [Next in Thread]