On Wed, Dec 17, 2014 at 02:33:36PM -0800, Isaac Dunham wrote: > > >> ssize_t according to man 2 sendfile. I just hadn't yet because nothing > > >> was using it. If I expand it, I'd want to move towards convergence with > > >> the syscall... except that gratuitously wants one of its arguments to be > > >> a network socket for NO OBVIOUS REASON. > > > > > > By "indicate bytes written" I mean "return the total number of > > > bytes written". > > > > > > According to my man pages, "In Linux kernels before 2.6.33, out_fd > > > must refer to a socket. Since Linux 2.6.33 it can be any file." > > > > That's still recent enough (2010) I need a probe, but yeah we should use it. > > > > > Using sendfile will of course require a loop if you have a file larger > > > than half the address space; > > > > Why? If you enable long file support in libc (hardwired on in musl, > > present in 2.4, _not_ enabling that is pilot error) then size_t should > > be 64 bit? > > size_t == maximum size *in memory* == long or unsigned long on *nix > (musl defines size_t the same as ssize_t, since C sporadically > intermixes the two...)
Huh? size_t is required to be an unsigned type and ssize_t is required to be signed, so there's no way to define them the same. musl certainly doesn't. But yes they are both about sizes of objects in the C sense (in memory), not file sizes. off_t is the type for file sizes. Rich _______________________________________________ Toybox mailing list [email protected] http://lists.landley.net/listinfo.cgi/toybox-landley.net
