Re: Should linuxkpi linux_file_ioctl support flexible array copy?
yi zishun <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.hackers |
|---|---|
| Message-ID | <CABjVtiZxsXZKay3Lcw5-TbQjMKGNVT_duEQKLkc5hDqGC9uw_A@mail.gmail.com> |
On Fri, Feb 13, 2026 at 09:42:58PM +0800, Zhenlei Huang wrote: > Probably it does not matter. It is good to keep the ABI stable, well that implies > stable ABI cross different versions of OS, but not different OSes. Am I right ? > > I think make it work first, make it better second ! Thanks for your kind reply! You are absolutely right. I think the best way forward is to change the ABI to use an explicit pointer rather than a flexible array, which conforms better to the FreeBSD style. However, I noticed that the Linux ioctl scheme is designed to pass the raw user space pointer to the low level driver. Currently, the FreeBSD linuxkpi only provides a "fake" user space pointer (backed by kernel memory), which cannot be used for parameters involving flexible arrays. This implementation does not seem to fully conform to the Linux ioctl scheme. Do you think improving linuxkpi to support this pattern (flexible arrays in ioctl) is worth pursuing in the long run? It seems like a valuable compatibility improvement for future driver ports. But as you said, "make it work first, make it better second", I will use the above method to get it working first. Best Regards, Zishun Yi