Re: SSIZE_MAX

2020-01-16 Thread Otto Moerbeek
On Thu, Jan 16, 2020 at 10:19:52AM -0700, Raymond, David wrote: > Thanks, that is helpful. > > It is now clear to me that the default on OpenBSD for SSIZE_MAX is > 2^31 - 1 or greater. However, I still run into problems on writes to > a TCP/IP socket with sizes exceeding something like 32000

Re: SSIZE_MAX

2020-01-16 Thread Raymond, David
Thanks, that is helpful. It is now clear to me that the default on OpenBSD for SSIZE_MAX is 2^31 - 1 or greater. However, I still run into problems on writes to a TCP/IP socket with sizes exceeding something like 32000 bytes (probably 2^15 -1). Is it possible that TCP sockets have a smaller

Re: SSIZE_MAX

2020-01-16 Thread Marc Espie
On Thu, Jan 16, 2020 at 09:35:38AM +, cho...@jtan.com wrote: > Raymond, David writes: > > I am confused about SSIZE_MAX and read(2)/write(2). The POSIX > > SSIZE_MAX is something like 2^15 -1. This seems to be a real > > limitation when writing to a TCP/IP socket, as I learned from > >

Re: SSIZE_MAX

2020-01-16 Thread Martin Wanvik
tor. 16. jan. 2020 kl. 14:52 skrev Raymond, David : > > Hmm > > Thought I found a 2^15 -1 version of SSIZE_MAX in the includes, but I > guess I was mistaken. Not necessarily. What you have probably seen is _POSIX_SSIZE_MAX (which is almost literally what you wrote in your first post), defined

Re: SSIZE_MAX

2020-01-16 Thread Raymond, David
Yes, my code deals with the short reads and writes. On 1/16/20, Otto Moerbeek wrote: > On Thu, Jan 16, 2020 at 06:48:30AM -0700, Raymond, David wrote: > >> Hmm >> >> Thought I found a 2^15 -1 version of SSIZE_MAX in the includes, but I >> guess I was mistaken. >> >> The real issue is whether

Re: SSIZE_MAX

2020-01-16 Thread Otto Moerbeek
On Thu, Jan 16, 2020 at 06:48:30AM -0700, Raymond, David wrote: > Hmm > > Thought I found a 2^15 -1 version of SSIZE_MAX in the includes, but I > guess I was mistaken. > > The real issue is whether doing write(2) to a TCP/IP socket bigger > than 2^15 - 1 bytes causes problems. I am not

Re: SSIZE_MAX

2020-01-16 Thread Raymond, David
Hmm Thought I found a 2^15 -1 version of SSIZE_MAX in the includes, but I guess I was mistaken. The real issue is whether doing write(2) to a TCP/IP socket bigger than 2^15 - 1 bytes causes problems. I am not very experienced in this area. Dave Raymond On 1/15/20, Bryan Steele wrote: >>

Re: SSIZE_MAX

2020-01-16 Thread Stuart Longland
On 16/1/20 7:35 pm, cho...@jtan.com wrote: > I would guess this is part of the reason why ssize_t was invented > - so that half of the numeric range could be wasted in order for a > function to be able to return -1, and/or ridiculous notions of > symmetry. Actually it is used with fseekā€¦ in

Re: SSIZE_MAX

2020-01-16 Thread chohag
Raymond, David writes: > I am confused about SSIZE_MAX and read(2)/write(2). The POSIX > SSIZE_MAX is something like 2^15 -1. This seems to be a real > limitation when writing to a TCP/IP socket, as I learned from > experience. However, much larger reads and writes seem to be possible > to

Re: SSIZE_MAX

2020-01-15 Thread Theo de Raadt
Raymond, David wrote: > The POSIX SSIZE_MAX is something like 2^15 -1. I doubt that, you better backtrack a couple of steps.

Re: SSIZE_MAX

2020-01-15 Thread Bryan Steele
> I am confused about SSIZE_MAX and read(2)/write(2). The POSIX > SSIZE_MAX is something like 2^15 -1. This seems to be a real > limitation when writing to a TCP/IP socket, as I learned from > experience. However, much larger reads and writes seem to be possible > to files and UNIX sockets