PhotonLibOS icon indicating copy to clipboard operation
PhotonLibOS copied to clipboard

Will it support system API hooks in the future? For example, sleep, connect, recv, etc.

Open mankouzhuya opened this issue 3 months ago • 2 comments

mankouzhuya avatar Apr 25 '24 06:04 mankouzhuya

I'm not sure, because none of us have prior experiences on this. And I doubt that its compatibility issues may make it little use in real applications.

Can you describe more about your situation?

lihuiba avatar Apr 25 '24 07:04 lihuiba

@mankouzhuya Because the libc API still has its use. Considering you need to write a file in disk or tmpfs, then libc's write is always the feasible way to do it, even we can also use Photon's capsulation of libaio or io_uring.

In a word, networking is a important part, but not all that we concern. We'd best just provide the alternatives, rather then overwrite them.

Photon's basic networking API calls are in net/basic_socket.h. For instance, photon::net::recv equals to libc's recv, and can only work in the coroutine runtime.

beef9999 avatar Apr 25 '24 14:04 beef9999