read() function with THREE arguments???

I am referencing a code sample I found on the web, and there is a read() statement which takes THREE arguments. Open this URL:

http://www.ncsa.uiuc.edu/People/mfolk/ch9progs.c

and look in the function short getroot(). You will see:

read(btfd, &root, 2);

The read() that I know takes only two. Now I know that this code follows an outdated standard, but I cannot find any documentation of a read() function that takes three arguments at all.

Anyone have any idea what the above statement does?

Also, what on earth is 0L?

lseek(btfd, 0L, 0);
Last edited on
The read() you know is a non-static function: std::istream::read(). It can't be called without an std::istream object.
That read() is a completely different function declared in one of those headers. You'll have to see them in order to know what it does.

0L is the same as (long)0.
Last edited on
Topic archived. No new replies allowed.