kern/102956: [linux] [patch] Add partial support for SO_PEERCRED in Linux emulation

Marcin Cieslak saper at system.pl
Tue Sep 9 16:05:03 UTC 2008


Hello,

> (1) The value of LINUX_SO_PEERCRED is incorrect for Alpha, it should be 18 on
> that platform.

Well, in the meantime Alpha support is gone...

> (2) I'm a bit worried about pid not being set, but this may (may) be OK. On
> Linux, generally speaking you are guaranteed that either you get (0, -1,
> -1) or (pid, uid, gid), but not a blend of both. As we support the pid
> for SCM_CREDS, we might also consider adding a LOCAL_PEERPID for use by
> the linux emulator to query the remote pid (we'd need to add that where
> the peercred is currently cached though).

Will remote PID always be available?
> 
> (3) LOG_WARNING should perhaps be LOG_DEBUG or something more consistent with
> the res of the linuxulator.

I agree. This should be LOG_DEBUG.

  > FYI, I'm not sure I like that we just pass all other socket options 
through to
> getsockopt() without transformation or an error, it seems failure-prone. We
> may end up returning invalid data, etc, but that's not caused by this patch,
> but a generally poor failure mode in the linuxulator.

I agree. Probably we should explicitly list all supported socket option. 
I think most of the translation layer is coded for "fixing known 
differences" vs. "explicit support for X, Y, Z returning EA, EB or EC".

--Marcin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 273 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-emulation/attachments/20080909/aad11c7d/signature.pgp


More information about the freebsd-emulation mailing list