patacongo commented on PR #10602: URL: https://github.com/apache/nuttx/pull/10602#issuecomment-1719968467
> @patacongo I think @michallenc initial design may confuse you. stdio is a pure userspace library, the implementation of fopencookie or fmemopen doesn't need involve any kernel stuff: it's enough to add the callback(read/write/seek/close) to struct file_struct(FILE). > So, I would suggest you read the manual from: > https://pubs.opengroup.org/onlinepubs/9699919799/functions/fmemopen.html > https://man7.org/linux/man-pages/man3/fopencookie.3.html AFAIK that is not true. The user/supervisor mode is only one of several issues. I have enumerated many others below that this design pure user-space design will not handle. The bottom line: You cannot call from one task/process address space into another. In the FLAT build, that might work in some very, very simple cases. But it will not work in general. It will never work at all in the KERNEL build if the client and server lie in different process address spaces. The virtual user address spaces overlap and it you try calling into it you will certainly crash. In order to that successfully and reliably, a context switch is required. I don't see any reason for me to participate in this any further. I've tried to explain all of this as carefully as I can but I still see you guys marching ahead to fall off the cliff. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org