|
From: Lev W. <vl...@ne...> - 2002-01-21 20:15:28
|
Wesley W. Terpstra wrote:
> Has anyone tried to use libst with 64bit large file support on a 32bit
> platform?
>
> I assume it won't work, but wanted to check. I notice that the read/write
> apis all use size_t instead of off_t, so I doubt they'll work.
FreeBSD has the 64 bit large file support on 32 bit code. read/write
returns obvious ssize_t, and it is 32 bit in size. So particularly this
will work right.
> However,
> what I want to know is whether or not sticking them in a st_poll would work:
> There's that new errno value for if you use a 32bit call on a 64bit file
> and I am concerned that they could break even those st functions without
> offset paremeter.
>
> Has anyone gotten or failed to get this to work?
> If it doesn't work, should this be fixed?
>
> Before you say 'why would you need 64bit support for sockets', it's not for
> sockets... I want to have the equivalent of 'tail -f' on several files at
> the same time I'm watching sockets for incoming requests. These files could
> be >> 2Gb.
lseek(fd, 0, SEEK_END);
while(1) {
ssize_t rsize;
rsize = read(fd, buf, sizeof(buf));
if(rsize > 0) {
/* Do things */
} else {
usleep(250000);
}
}
This will work on 32-bit OS'es supporting 64-bit file systems. The off_t
parameter is being used only in lseek().
--
Lev Walkin
vl...@ne...
|