port: set shm size with ftruncate before writing
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 4 Nov 2020 15:00:31 +0000 (10:00 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 13 Nov 2020 20:21:12 +0000 (15:21 -0500)
commit053e6e240f3fb5b2427fb28f8f09c652e2bdb39a
treee67276ac436a3db64addf776ad9bf77aa0f31603
parent0402284861ef6417ebdb828647adee6b904aa21c
port: set shm size with ftruncate before writing

According to POSIX, the size of shared memory object must be set with
ftruncate before writing to it. This happenen to work on Linux because
the implementation simply creates files on a tmpfs but on FreeBSD it is
implemented using actual shared memory objects and as such requires the
size to be set first.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I048f65104d7c34142025337ec1f6777650bfd62f
libringbuffer/shm.c
This page took 0.025688 seconds and 5 git commands to generate.