While programming with buffers like uint8_t*
in C++ I often arrive at situations on where I'm forced to do copies. For example, if I receive packets in chuncks from the world and I want to parse something big that is formed of these packets, I'd have to create a bigger buffer and store them, in this buffer, sequentially as they arrive. Then I can parse this big buffer efficiently.
Since the kernel can have virtual memory through page tables, shouldn't it be possible for someone to create a syscall that gets a pointer to a list of all these small buffers (and their sizes), and create a big virtual buffer that acts as if I've copied all the mini buffers inside it?