Ok, I sorted through the relevant functions and made a little summary. Here it is in case anyone ever finds it helpful. Notes:
* there are many other functions related to file access
* BSD = NetBSD 4.0.1 and OpenBSD 4.4
* Linux = Slackware 11.0 and 12.2
* comments on speed are on my i386 machines (take with grain of salt
)
* corrections etc. are welcome
Functions using stdio library interface and FILE structures:
16- and 18-bit, exists in K&R and PDP-7 respectively but not Linux or BSD
seek
32-bit
fseek
ftell
32-bit Linux, can be changed to 64 by a #define.
... also ...
64-bit BSD.
fseeko
ftello - does not show the result of lseek. [Either in 32 or 64 bit mode (Linux)]
fread
Functions using system/kernel calls with file descriptors:
32-bit Linux, can be changed to 64 by a #define.
... also ...
64-bit BSD.
lseek
64-bit Linux
lseek64 = llseek
"ltell" - does not exist, ftell[o] don't work here.
read - faster than fread (Linux, NetBSD); not faster than fread (OpenBSD)
-----------------------------------
At the moment, I think I'll stick with read() over fread(), since it can be faster. A lot of reads are done, and portability to non-Unix-like is not important.
So lseek() must be used so as not to mix functions from the two categories (originally done via blundering).
On Linux lseek() is 32-bit by default, which is good enough for now, and can easily be changed if needed. Not a big downside.