Re: Sendfile for Rtems

2015-06-23 Thread Joel Sherrill
On 6/23/2015 2:37 PM, Sebastian Huber wrote: I just had a quick look at kern_sendfile() in uipc_syscalls.c. It seems that it uses virtual memory for the file access, so this won't work on RTEMS. However it would be nice to have an optimized sendfile() which avoids one copy and uses mbufs dir

Re: Sendfile for Rtems

2015-06-23 Thread Sebastian Huber
I just had a quick look at kern_sendfile() in uipc_syscalls.c. It seems that it uses virtual memory for the file access, so this won't work on RTEMS. However it would be nice to have an optimized sendfile() which avoids one copy and uses mbufs directly. - Sujay Raj schrieb: >Okay, So I wil

Re: Sendfile for Rtems

2015-06-23 Thread Sujay Raj
Okay, So I will dig in to the details of the implementation of sendfile on freebsd to find if it does indeed use mmap, or if there is an implementation that doesn't. I will inform as soon as I figure it out if this is the correct way out. Thanks and Regards, Sujay Raj On Wed, Jun 24, 2015 at 12:

Re: Sendfile for Rtems

2015-06-23 Thread Joel Sherrill
On 6/23/2015 2:15 PM, Gedare Bloom wrote: On Tue, Jun 23, 2015 at 3:13 PM, Sujay Raj wrote: I agree with Sebastian. Using read write in a loop can only serve as a makeshift measure. If we have consensus here, then I can work on getting sendfile backed up in libbsd. (though, I have some seri

Re: Sendfile for Rtems

2015-06-23 Thread Gedare Bloom
On Tue, Jun 23, 2015 at 3:13 PM, Sujay Raj wrote: > I agree with Sebastian. > > Using read write in a loop can only serve as a makeshift measure. > > If we have consensus here, then I can work on getting sendfile backed up in > libbsd. (though, I have some serious background reading to do before I

Re: Sendfile for Rtems

2015-06-23 Thread Sujay Raj
I agree with Sebastian. Using read write in a loop can only serve as a makeshift measure. If we have consensus here, then I can work on getting sendfile backed up in libbsd. (though, I have some serious background reading to do before I am able to do it, but I think I can. ) Thanks and Regards,

Re: Sendfile for Rtems

2015-06-23 Thread Sebastian Huber
I would use the sendfile system call implementation from FreeBSD and add it to the libbsd. Its not a big win if you use read() and write() to implement sendfile(). This makes only sense if you can use kernel space zero-copy buffers. - Eduardo Silva schrieb: >Sujay, Monkey use conditiona

Re: Sendfile for Rtems

2015-06-23 Thread Eduardo Silva
Sujay, Monkey use conditionals for each implementation: Linux, FreeBSD and OSX. My suggestion is that RTEMS may implement a sendfile based on FreeBSD format which can easily be emulated as a read() and further write() for socket operations. That will help not only Monkey, but also other software t

Re: Sendfile for Rtems

2015-06-23 Thread Joel Sherrill
On 6/23/2015 12:49 PM, Sujay Raj wrote: I am working on porting Monkey HTTP server on rtems. Sendfile is not specified in POSIX.1-2001 or other standards and its implementations vary depending on the unix/linux system being used. Freebsd has sendfile in its libc. FreeBSD has a completely d