public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: 2.4 sendfile() not doing as manpage promises?
  2000-11-18 23:15 2.4 sendfile() not doing as manpage promises? bert hubert
@ 2000-11-18 23:15 ` Dan Hollis
  2000-11-19  0:53   ` bert hubert
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Hollis @ 2000-11-18 23:15 UTC (permalink / raw)
  To: bert hubert; +Cc: linux-kernel

On Sun, 19 Nov 2000, bert hubert wrote:
> After some exploring with 'ddd' (a very nice graphical frontend for gdb,
> which includes tools to display and traverse structs), I found that this
> probably means that sendfile() can only be used to send files from
> blockdevices which support mmap()-like functionality. Is this correct?

Correct.

> In that case, the wording of the manpage needs to be changed, as it
> implies that 'either or both' of the filedescriptors can be sockets.

Its quite clear.

DESCRIPTION
       This  call copies data between file descriptor and another
       file  descriptor  or  socket.   in_fd  should  be  a  file
       descriptor   opened  for  reading.   out_fd  should  be  a
       descriptor opened for writing or a connected socket.

in_fd must be a file, out_fd can be a file or socket.

-Dan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* 2.4 sendfile() not doing as manpage promises?
@ 2000-11-18 23:15 bert hubert
  2000-11-18 23:15 ` Dan Hollis
  0 siblings, 1 reply; 6+ messages in thread
From: bert hubert @ 2000-11-18 23:15 UTC (permalink / raw)
  To: linux-kernel

Hi everybody,

I tried to use sendfile() to send data from a tcp/ip socket to a file on
disk. This does not work, giving EINVAL. 

Using the very fine kgdb product (http://kgdb.sourceforge.net) and my laptop
for remote debugging, I was able to trace this to this:

sys/filemap.c::sys_sendfile():

        if (!in_inode->i_mapping->a_ops->readpage)
                goto fput_in;

After some exploring with 'ddd' (a very nice graphical frontend for gdb,
which includes tools to display and traverse structs), I found that this
probably means that sendfile() can only be used to send files from
blockdevices which support mmap()-like functionality.

Is this correct? In that case, the wording of the manpage needs to be
changed, as it implies that 'either or both' of the filedescriptors can be
sockets.

Regards,

bert hubert

-- 
PowerDNS                     Versatile DNS Services  
Trilab                       The Technology People   
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 2.4 sendfile() not doing as manpage promises?
  2000-11-18 23:15 ` Dan Hollis
@ 2000-11-19  0:53   ` bert hubert
  2000-11-19 16:36     ` Andries Brouwer
  0 siblings, 1 reply; 6+ messages in thread
From: bert hubert @ 2000-11-19  0:53 UTC (permalink / raw)
  To: linux-kernel

On Sat, Nov 18, 2000 at 03:15:28PM -0800, Dan Hollis wrote:

> > In that case, the wording of the manpage needs to be changed, as it
> > implies that 'either or both' of the filedescriptors can be sockets.
> 
> Its quite clear.
> 
> DESCRIPTION
>        This  call copies data between file descriptor and another
>        file  descriptor  or  socket.   in_fd  should  be  a  file
>        descriptor   opened  for  reading.   out_fd  should  be  a
>        descriptor opened for writing or a connected socket.
> 
> in_fd must be a file, out_fd can be a file or socket.

My manpages must be outdated then, my manpage is from 1 Dec 1998. Thanks for
the correction.

Regards,

bert hubert


-- 
PowerDNS                     Versatile DNS Services  
Trilab                       The Technology People   
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 2.4 sendfile() not doing as manpage promises?
  2000-11-19  0:53   ` bert hubert
@ 2000-11-19 16:36     ` Andries Brouwer
  2000-11-19 23:16       ` bert hubert
  2000-11-20  1:11       ` Dan Hollis
  0 siblings, 2 replies; 6+ messages in thread
From: Andries Brouwer @ 2000-11-19 16:36 UTC (permalink / raw)
  To: linux-kernel; +Cc: ahu, goemon

On Sun, Nov 19, 2000 at 01:53:00AM +0100, bert hubert wrote:
:  On Sat, Nov 18, 2000 at 03:15:28PM -0800, Dan Hollis wrote:
:  
:::  In that case, the wording of the manpage needs to be changed, as it
:::  implies that 'either or both' of the filedescriptors can be sockets.
::  
::  Its quite clear.
::  
::  DESCRIPTION
::         This  call copies data between file descriptor and another
::         file  descriptor  or  socket.   in_fd  should  be  a  file
::         descriptor   opened  for  reading.   out_fd  should  be  a
::         descriptor opened for writing or a connected socket.
::  
::  in_fd must be a file, out_fd can be a file or socket.
:  
:  My manpages must be outdated then, my manpage is from 1 Dec 1998. Thanks for
:  the correction.

The manpage is dated 1 Dec 1998 and reads

DESCRIPTION
       This call copies data  between  one  file  descriptor  and
       another.   Either  or  both  of these file descriptors may
       refer to a socket.  in_fd  should  be  a  file  descriptor
       opened  for  reading  and  out_fd  should  be a descriptor
       opened for writing.

If that is incorrect, then editing a private copy of the manpage,
as Dan Hollis, or the distributor from whom he got his page,
seems to have done, does not suffice to change the manpage distribution.

(Moreover, the text Dan Hollis quotes is rather strange --
also sockets give one a file descriptor, so the author
of that modified man page did not know what he was talking
about, or was not being precise.)

Andries
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 2.4 sendfile() not doing as manpage promises?
  2000-11-19 16:36     ` Andries Brouwer
@ 2000-11-19 23:16       ` bert hubert
  2000-11-20  1:11       ` Dan Hollis
  1 sibling, 0 replies; 6+ messages in thread
From: bert hubert @ 2000-11-19 23:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: aeb

On Sun, Nov 19, 2000 at 05:36:23PM +0100, Andries Brouwer wrote:
> DESCRIPTION
>        This call copies data  between  one  file  descriptor  and
>        another.   Either  or  both  of these file descriptors may
>        refer to a socket.  in_fd  should  be  a  file  descriptor
>        opened  for  reading  and  out_fd  should  be a descriptor
>        opened for writing.
> 
> If that is incorrect, then editing a private copy of the manpage,
> as Dan Hollis, or the distributor from whom he got his page,
> seems to have done, does not suffice to change the manpage distribution.

Improved attempt:

DESCRIPTION 
	This call copies data between one file descriptor and another.  The
	descriptor from which data is read cannot be a socket but must
	correspond to a file which supports mmap()-like operations. in_fd
	should be a filedescriptor opened for reading and out_fd should be a
	descriptor opened for writing. Because this copying is done within
	the kernel, sendfile() does not need to spend time transfering data
	to and from userspace.

Regards,

bert hubert

-- 
PowerDNS                     Versatile DNS Services  
Trilab                       The Technology People   
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 2.4 sendfile() not doing as manpage promises?
  2000-11-19 16:36     ` Andries Brouwer
  2000-11-19 23:16       ` bert hubert
@ 2000-11-20  1:11       ` Dan Hollis
  1 sibling, 0 replies; 6+ messages in thread
From: Dan Hollis @ 2000-11-20  1:11 UTC (permalink / raw)
  To: Andries Brouwer; +Cc: linux-kernel, ahu

On Sun, 19 Nov 2000, Andries Brouwer wrote:
> Moreover, the text Dan Hollis quotes is rather strange

It's from redhat 6.0 man-pages-1.23-3 rpm package.

-Dan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2000-11-20  1:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-11-18 23:15 2.4 sendfile() not doing as manpage promises? bert hubert
2000-11-18 23:15 ` Dan Hollis
2000-11-19  0:53   ` bert hubert
2000-11-19 16:36     ` Andries Brouwer
2000-11-19 23:16       ` bert hubert
2000-11-20  1:11       ` Dan Hollis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox