Re: Need a Replica of FIOSENDFD (BSD) on Linux - Unix

This is a discussion on Re: Need a Replica of FIOSENDFD (BSD) on Linux - Unix ; 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 ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Re: Need a Replica of FIOSENDFD (BSD) on Linux

  1. Re: Need a Replica of FIOSENDFD (BSD) on Linux

    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

  2. Re: Need a Replica of FIOSENDFD (BSD) on Linux

    On Aug 13, 1:29*pm, Willem wrote:

    []

    > ) 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.


    If what you are looking for is to send a file descriptor to another
    process, unix sockets can do that. http://linux.die.net/man/7/unix

+ Reply to Thread