Skip to content

Commit d04578b

Browse files
committed
docs: fix an omission in the rtapi_shmem manpage
Make explicit an important promise made by rtapi_shmem_new(): When a block of memory is first allocated, it is initialized to all zero bytes. On Uspace rtapi_shmem_new() calls shmget(), which zeros the memory when creating a new shared memory block: https://man7.org/linux/man-pages/man2/shmget.2.html#DESCRIPTION On RTAI rtapi_shmem_new() calls rtai_kmalloc() and rtai_malloc(), which both end up calling _rt_shmem_new(). The documentation does not say anything about initialization of freshly allocated memory buffers, but Paolo Mantegazza (one of the main RTAI developers) said that RTAI *does* zeros shmem buffers, and pointed to this code: https://mail.rtai.org/pipermail/rtai/2022-January/028282.html http://cvs.savannah.nongnu.org/viewvc/rtai/magma/base/ipc/shm/shm.c?view=markup#l69
1 parent 27d8149 commit d04578b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/man/man3/rtapi_shmem.3rtapi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ wishing to access the same memory must use the same key.
3535
\fImodule_id\fR is the ID of the module that is making the call (see
3636
rtapi_init). The block will be at least \fIsize\fR bytes, and may
3737
be rounded up. Allocating many small blocks may be very wasteful.
38-
When a particular block is allocated for the first time, the first
39-
4 bytes are zeroed. Subsequent allocations of the same block
38+
When a particular block is allocated for the first time, the contents
39+
are zeroed. Subsequent allocations of the same block
4040
by other modules or processes will not touch the contents of the
4141
block. Applications can use those bytes to see if they need to
4242
initialize the block, or if another module already did so.

0 commit comments

Comments
 (0)