Re: kqueue send over unix socket?

From: Alan Somers <asomers_at_freebsd.org>
Date: Tue, 12 Mar 2019 15:37:15 -0600
Is he trying to send the kqueue file descriptor itself using sendmsg
with SCM_RIGHTS?  It sounds like kqueues cannot be sent over unix
sockets; not every file type necessarily can.  But if you want to know
the nitty-gritty details, just run this:
dtrace -i 'fbt:::return /arg1 == 45/ {stack();}' -c "my_program
my_options" and that will usually tell you the exact function that set
the error.

If the output is too large, then you can filter it by writing a D
program like this:

#sendmsg.d
fbt:kernel:sys_sendmsg:entry
{
        this->trigger = 1;
}
fbt:::return
/ this->trigger == 1 && arg1 == 45 /
{
        stack();
}
fbt:kernel:sys_sendmsg:return
{
        this->trigger = 0;
}

dtrace -s sendmsg.d -c "my_program my_options"

Hope that helps.
-Alan

On Tue, Mar 12, 2019 at 3:22 PM Larry Rosenman <ler_at_lerctr.org> wrote:
>
> I'm working with Aki Tuomi of Dovecot and he asks:
>
> I tried to ask if you could ask from some Kernel hacker why I cannot
> send kqueue() fd over unix socket, I get "Operation not supported".
>
> Can anyone help me?
>
>
>
> --
> Larry Rosenman                     http://www.lerctr.org/~ler
> Phone: +1 214-642-9640                 E-Mail: ler_at_lerctr.org
> US Mail: 5708 Sabbia Dr, Round Rock, TX 78665-2106
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
Received on Tue Mar 12 2019 - 20:37:36 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:20 UTC