Red Hat Bugzilla – Bug 73076
ioctl returns invalid argument
Last modified: 2016-11-24 09:52:58 EST
Description of Problem: process attempts to use ioctl to pas file descriptor to another process. each of the ioctls fails with errno=22 (invalid argument)
Version-Release number of selected component (if applicable):
How Reproducible:compile and run attached source.
Steps to Reproduce:
1. compile attached source
Actual Results:ioctl from both processes return invalid argument.
Expected Results:file descriptor should be passed and both processes write to disk file.
Created attachment 73964 [details]
source file to produce problem.
Why are you using the STREAMS ioctl instead of the posix SCM_RIGHTS interface ?
Solaris STREAMS are not supported in linux.
has some example code fwiw
the main reason to use the ioctl is that the code is MUCH more straight forward (none of the recv,sendmsg bs) as well as the socket creation. if the functionality
(SEND_FD, RECV_FD) doesnt work, remove it, at least in the documentation. you can replace the pipe call with a socketpair, creating a unix domain pair of sockets
and it still doesnt work.
i was under the impression that streams were part of unix, not just solaris; i know that linux likes to do things its way sometimes rather than the unix way. that is not
a support of the way that unix does things; just a comment on trying to be standardly uniform in the way features are implemented.
STREAMS are not required by Unix anymore. It is an optional part of Unix which
is not supported under Linux. The only support in the official components
consists of the wrappers around the STREAMS syscalls. That's all. If anything
fails you're on your own.