Bug 17366

Summary: sendfile() has no pthreads wrapper
Product: Base System Reporter: Dan Nelson (old address) <dnelson>
Component: binAssignee: Jason Evans <jasone>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
sendfile.diff none

Description Dan Nelson (old address) 2000-03-13 23:50:01 UTC
There is no pthreads wrapper for the sendfile() call.  This causes a
problem if someone tries to call sendfile() on a blocking socket. 
Pthreads always set sockets to non-blocking, and sendfile() will return
EAGAIN on non-blocking sockets instead of blocking and sending the
file.

Even though sendfile() doesn't make much sense with out current
user-threads implementation, POLA suggests that a threaded sendfile()
should behave the same as a non-threaded sendfile() from the point of
view of the application.

Fix: 

write a sendfile() wrapper that does the right thing.
How-To-Repeat: 
call sendfile() on a blocking socket in a threaded application.
Comment 1 Jason Evans freebsd_committer freebsd_triage 2000-03-14 05:34:52 UTC
Responsible Changed
From-To: freebsd-bugs->jasone

Over to maintainer. 

Comment 2 Jason Evans 2000-03-25 00:43:08 UTC
Here's a completely untested patch (well, it compiles).  I'm going to be
out of town for the next four weeks, so unless someone can verify today
that this at least sort of works, it is going to be a long while before I
can commit it.

Jason
Comment 3 Jason Evans freebsd_committer freebsd_triage 2000-05-16 22:08:42 UTC
State Changed
From-To: open->closed

A fix was checked in to -current almost three weeks ago, with no feedback.