X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=libringbuffer%2Fring_buffer_frontend.c;h=b45ec543981c940b7beacce8dbc885625efb9a3a;hb=2432c3c9bdce3c94632f7c619165ab1278a69551;hp=01d0f5e87007c269f15026366a35fc1ae9827e85;hpb=431d5cf0d589654dfa74e07194dd186f5311cc29;p=lttng-ust.git diff --git a/libringbuffer/ring_buffer_frontend.c b/libringbuffer/ring_buffer_frontend.c index 01d0f5e8..b45ec543 100644 --- a/libringbuffer/ring_buffer_frontend.c +++ b/libringbuffer/ring_buffer_frontend.c @@ -55,6 +55,22 @@ #define max(a, b) ((a) > (b) ? (a) : (b)) #endif +/* + * Use POSIX SHM: shm_open(3) and shm_unlink(3). + * close(2) to close the fd returned by shm_open. + * shm_unlink releases the shared memory object name. + * ftruncate(2) sets the size of the memory object. + * mmap/munmap maps the shared memory obj to a virtual address in the + * calling proceess (should be done both in libust and consumer). + * See shm_overview(7) for details. + * Pass file descriptor returned by shm_open(3) to ltt-sessiond through + * a UNIX socket. + * + * Since we don't need to access the object using its name, we can + * immediately shm_unlink(3) it, and only keep the handle with its file + * descriptor. + */ + /* * Internal structure representing offsets to use at a sub-buffer switch. */