Apologies for the cross post, wanted to highlight this on devel in case anyone has an opinion on it.
Summary for anyone joining late, we appear to get a short write in rapi_buffer_send on FreeBSD when writing a largeish file to the device. I've seen this before in isolated cases, not just on *bsd. When librapi2 is rebuilt and forced to use write() instead of writev(), all is fine. On Sun, 2008-08-17 at 15:40 +0200, Alexander Logvinov wrote: > Hello, Mark. > > > Could you guys try normal librapi2 with the attached patch. It just adds > > some more error checking, and maybe we can figure out if writev is worth > > keeping or just ditch it. > > # ls -l normal.png > -rw-r--r-- 1 incubus incubus 43012 14 Jul 22:27 normal.png > > # pcp normal.png :1 > [rapi_buffer_send:563] writev failed, returned 33580 and not 43028 > [rapi2_context_call:326] rapi_buffer_send failed > [anyfile_remote_write:131] Failed to write to remote file: 80004005: An > unspecified failure has occurred So this is a straight short write. The man page implies on failure a -1 should be returned, it says nothing about a short write return value, but we'll gloss over that. I can't see any reason we should get a short write. > pcp: Failed to write to destination file ':1' > [rapi_buffer_send:565] writev failed: Bad file descriptor > [rapi2_context_call:326] rapi_buffer_send failed > [anyfile_remote_close:85] Error closing remote file: 80004005: An unspecified > failure has occurred This is fine, on failure rapi_buffer_send closed the fd, so our second close fails. We probably shouldn't do this, but it isn't important here. > > # ls -l 113 > -rw-r--r-- 1 incubus incubus 710 20 Jul 11:17 113 > > # pcp 113 :1 > File copy took less than one second! > I can't see why it happens, but since I can't see any advantage to using writev() over write(), I inclined to remove writev(). Any comments ? Mark
signature.asc
Description: This is a digitally signed message part
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ SynCE-Devel mailing list SynCE-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/synce-devel