Archives for: November 2005, 19

11/19/05

Permalink 11:40:33 pm, Categories: Linux, 136 words   English (US)

read() me a bedtime story

A friend of mine posted a blog about read() calls and the maximum amount you can read. It got me interested too, so I did some tests as well.

First of all, I notice the read() manpage states (man 2 read):

If count is zero, read() returns zero and has no other results. If count is greater than SSIZE_MAX, the result is unspecified.

SSIZE_MAX on my Linux system is 2gig, or 2^31. I cannot read more than that. In fact, the largest buffer I can malloc is about 2934062847. Both malloc() and read() take types of size_t, type unsigned long, which is 4gig, or 2^32. But it seems read() cannot read more than 2^31. Hm, I know I can't use values greater than 2^32 on 32-bit systems, but I would expect read() to do up to 2^32 and not only 2^31.

Permalink 07:18:57 am, Categories: Home, 17 words   English (US)

Housingmaps

Here is a great site that combines Google Maps with Craig's List to provide apartment/home locations.

Viraj's Weblog

Donate to keep this site going!

Amount USD $

November 2005
Mon Tue Wed Thu Fri Sat Sun
<<  <   >  >>
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        

Search

Categories


Misc

Syndicate this blog XML

What is RSS?

powered by
b2evolution