Bug 97491 - sendfile man page should mention short "sends"
Summary: sendfile man page should mention short "sends"
Status: RESOLVED CODE_FIX
Alias: None
Product: Documentation
Classification: Unclassified
Component: man-pages (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: documentation_man-pages@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-29 08:09 UTC by Gregor Jasny
Modified: 2015-05-05 10:00 UTC (History)
1 user (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Gregor Jasny 2015-04-29 08:09:38 UTC
Hello,

Linux 3.16 (3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt4-1, glibc 2.19-18) seems to truncate larger requests to 2G (file to file copy):

strace output:
  sendfile(4, 3, [0], 10240000000)        = 2147479552


I know one should expect this behavior from read/write calls but for sendfile it was somehow unexpected.

Maybe you could mention that fact in the man page for sendfile?

Thanks,
Gregor
Comment 1 Michael Kerrisk 2015-05-05 10:00:58 UTC
I added some text to cover this:

RETURN VALUE
       If the transfer was successful, the number of bytes writ‐
       ten  to  out_fd is returned.  Note that a successful call
       to sendfile() may write fewer bytes than  requested;  the
       caller should be prepared to retry the call if there were
       unsent bytes.

Hopefully that suffices?

Thanks,

Michael

Note You need to log in before you can comment on or make changes to this bug.