[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.c

Need a Replica of FIOSENDFD (BSD) on Linux

ansh

8/13/2008 12:07:00 PM

Hi Guys,

I am working with the porting of librpc from BSD to Linux, below is
the code snippet from the librpc(BSD)

--------------------------------
sfd = open(fbuf, O_WRONLY | O_NONBLOCK);
if (sfd < 0) {
goto error;
}

sts = pipe(pfds);
if (sts < 0) {
goto error;
}

sts = sfd_nonblock(pfds[0]);
sts |= sfd_nonblock(pfds[1]);
if (sts != 0) {
goto error;
}

sts = ioctl(sfd, FIOSENDFD, pfds[0]);
if (sts < 0) {
goto error;
}

/* close the daemon's end of the pipe */
close(pfds[0]);

/* close the fifo */
close(sfd);

/* return our end of the pipe */
return pfds[1];
------------------------------------

I need to port this code in linux, but there is no ioctl called
FIOSENDFD in Linux, Can someone tell me about an identical ioctl or
function in Linux that has the same functionality as FIOSENDFD.

7 Answers

Willem

8/13/2008 12:30:00 PM

0

ansh wrote:
) Hi Guys,
)
) I am working with the porting of librpc from BSD to Linux, below is
) the code snippet from the librpc(BSD)
)
) --------------------------------
) sfd = open(fbuf, O_WRONLY | O_NONBLOCK);
) if (sfd < 0) {
) goto error;
) }
)
) sts = pipe(pfds);
) if (sts < 0) {
) goto error;
) }
)
) sts = sfd_nonblock(pfds[0]);
) sts |= sfd_nonblock(pfds[1]);
) if (sts != 0) {
) goto error;
) }
)
) sts = ioctl(sfd, FIOSENDFD, pfds[0]);
) if (sts < 0) {
) goto error;
) }
)
) /* close the daemon's end of the pipe */
) close(pfds[0]);
)
) /* close the fifo */
) close(sfd);
)
) /* return our end of the pipe */
) return pfds[1];
) ------------------------------------
)
) I need to port this code in linux, but there is no ioctl called
) FIOSENDFD in Linux, Can someone tell me about an identical ioctl or
) function in Linux that has the same functionality as FIOSENDFD.

Somebody in comp.unix.programmer can probably answer your question,
a lot better than anyone on this group can.

Followups set to that group.


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT

jt

8/13/2008 12:31:00 PM

0

ansh <Anshul.gautam@gmail.com> wrote:
> I am working with the porting of librpc from BSD to Linux, below is
> the code snippet from the librpc(BSD)

<system specific code snipped>

> I need to port this code in linux, but there is no ioctl called
> FIOSENDFD in Linux, Can someone tell me about an identical ioctl or
> function in Linux that has the same functionality as FIOSENDFD.

This here is the wrong group since the problem you're facing
isn't related to C at all but some details of a very system
specific function. You may have a better chance for getting
an answer if you post in a linux group (comp.os.linux.development.apps
or comp.os.linux.development.system). If you do so you pro-
bably also should explain what 'FIOSENDFD' is supposed to do
- a quick google search didn''t give any hits at all.

Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://t...

gazelle

8/13/2008 12:59:00 PM

0

In article <6gg2f7Ffmn0pU1@mid.uni-berlin.de>,
Jens Thoms Toerring <jt@toerring.de> wrote:
>ansh <Anshul.gautam@gmail.com> wrote:
>> I am working with the porting of librpc from BSD to Linux, below is
>> the code snippet from the librpc(BSD)
>
><system specific code snipped>
>
>> I need to port this code in linux, but there is no ioctl called
>> FIOSENDFD in Linux, Can someone tell me about an identical ioctl or
>> function in Linux that has the same functionality as FIOSENDFD.

<This here is the wrong group, blah, blah, blah snipped>

IOW, nobody here gives a shit about you or your problems.

You may find some or all of the following links helpful in understanding
why this is so:

http://en.wikipedia.org/wiki...
http://en.wikipedia.org/w...
http://en.wikipedia.org/wiki/C_programmin...

John B. Matthews

8/13/2008 10:24:00 PM

0

On 13 Aug 2008 at 12:06, ansh wrote:
> I need to port this code in linux, but there is no ioctl called
> FIOSENDFD in Linux,

As far as Google knows, there's no such ioctl mentioned anywhere on the
web. Searching for FIOSENDFD with Google's codesearch also turns up no
hits.

> Can someone tell me about an identical ioctl or
> function in Linux that has the same functionality as FIOSENDFD.

Do you know what its functionality is meant to be? You should curse the
authors of the code you're trying to port for using an extremely obscure
ioctl without so much as providing a one-line comment saying what it's
meant to do.

richard

8/13/2008 10:50:00 PM

0

In article <slrnga6noj.1g9.nospam@nospam.invalid>,
Antoninus Twink <nospam@nospam.invalid> wrote:

>> Can someone tell me about an identical ioctl or
>> function in Linux that has the same functionality as FIOSENDFD.

>Do you know what its functionality is meant to be?

From the name, I would guess that it's for sending file descriptors
between programs. The OP may be able to work out whether that's what
it's doing. If so, BSD allows file descriptors to be sent across
unix-domain sockets using sendmsg().

-- Richard
--
Please remember to mention me / in tapes you leave behind.

Keith Thompson

8/13/2008 11:55:00 PM

0

ansh <Anshul.gautam@gmail.com> writes:
> I am working with the porting of librpc from BSD to Linux, below is
> the code snippet from the librpc(BSD)
[...]
> I need to port this code in linux, but there is no ioctl called
> FIOSENDFD in Linux, Can someone tell me about an identical ioctl or
> function in Linux that has the same functionality as FIOSENDFD.

The fact that the only Google hits for FIOSENDFD refer to this
discussion leads me to suspect that you may have misspelled it.

In any case, comp.unix.programmer would be a better place for your
question. (I haven't been paying enough attention to be sure whether
anyone else has mentioned this.)

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.ne...
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"

ansh

8/14/2008 9:05:00 PM

0

Hi Guys,
Thanks for your suggestions, I will look in to unix group for the same
and get back to you if i find a solution.

Thanks,
Anshul