@whitequark @raggi @david_chisnall I think you could actually do a version of this as a driver rather than a subsystem change (so it'd be really easy to build just a single little module rather than having to do a whole kernel rebuild). Basically have the driver just have a couple ioctls where you use the driver fd to invoke the content negotiation actions on a pipe fd you pass in, just one level of indirection.
@whitequark @raggi @david_chisnall On the userspace side code could try to open /dev/content-negotiation, try the direct ioctls (once they exist), and fall back to good 'ol plaintext if neither are available.