xiaoxiang781216 commented on PR #10602: URL: https://github.com/apache/nuttx/pull/10602#issuecomment-1719977191
> > @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. This case isn't suitable for stdio functions. How can you pass FILE * from one task/process to other task/process in kernel mode? It's impossible to happen in the first place. -- 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