This article states:
A user space C/C++ program must have been granted access to the /dev/ion device before it can allocate memory from ION. A call to open("/dev/ion", O_RDONLY) returns a file descriptor as a handle representing an ION client. Yes, one can allocate writable memory with an O_RDONLY open. There can be no more than one client per user process.
However, what is unclear to me is if there there can be only one file descriptor to /dev/ion per user process. I mean, "there can be no more than one client per user process" may not necessarily mean "there can be no more than one FD to /dev/ion per user process". For example, it could be that there is only one ION client per process, but that opening multiple /dev/ion FDs just increments an internal ION client reference count, meaning that these multiple FDs all refer to the same ION client.
So, is calling open() multiple times OK?
This is important, because I have multiple code fragments here in a project, and all of them try to open /dev/ion by themselves. If this is okay to do, then I leave them as they are, otherwise I have to refactor them to use one global /dev/ion FD.