All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Eriksson <jen@ettnet.se>
To: Mark Hahn <hahn@coffee.psychology.mcmaster.ca>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Socket hack question.
Date: Thu, 19 Apr 2001 04:06:18 +0200	[thread overview]
Message-ID: <20010419040617.B8366@seth> (raw)
In-Reply-To: <20010419030315.A7923@seth> <Pine.LNX.4.10.10104181931310.14361-100000@coffee.psychology.mcmaster.ca>
In-Reply-To: <Pine.LNX.4.10.10104181931310.14361-100000@coffee.psychology.mcmaster.ca>; from hahn@coffee.psychology.mcmaster.ca on Wed, Apr 18, 2001 at 07:31:55PM -0400

On Wed, Apr 18, 2001 at 07:31:55PM -0400, Mark Hahn wrote:
> > post. :-) But I thought sendfile() could only be used for sending data
> > from a "regular" file descriptor to another file- or socket descriptor..?
> 
> he said the syscall (ie, interface) already existed,
> not that it was implemented how you want it.

Well, that's right, I could still use the sendfile() interface. If I
would like to implement sendfile() for socket -> [file|socket], would
it be possible to do something like in the following pseudocode:

if srcfd is socket then
	s = sock struct for srcfd
	s->foo_member = dstfd
	s->data_ready = my_data_ready
	block until srcfd is closed

Where foo_member was added by me to the sock struct and my_data_ready
writes to dstfd before calling the default data_ready function. To
follow the sendfile() semantics I should add a max_forward or something
too. Btw, how would I accomplish the block until srcfd is closed, is
it possible (ok, anything is _possible_ but..)?

-- 
Joel Eriksson

  parent reply	other threads:[~2001-04-18 23:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-19  1:03 Socket hack question Joel Eriksson
     [not found] ` <Pine.LNX.4.10.10104181931310.14361-100000@coffee.psychology.mcmaster.ca>
2001-04-19  2:06   ` Joel Eriksson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-04-18 22:28 Joel Eriksson
2001-04-18 21:31 ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010419040617.B8366@seth \
    --to=jen@ettnet.se \
    --cc=hahn@coffee.psychology.mcmaster.ca \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.