[PATCH] librt: Add shm_open and shm_unlink + testcase
Mikael Lund Jepsen, ICCC
mlj at iccc.dk
Mon Jun 8 08:10:09 UTC 2009
Bernhard Reutner-Fischer wrote:
> I suggest you base off the (completely untested) b32dd708df63d90f9d755b6c0de2588200e432ca
> Please also add testsuite entries.
>
Apart from the use of the GNU extension, this is very similar to what I
had, but I do have one comment though:
There is no check on the return value of snprintf, so if name is
(silently) truncated, two different names may trunctate to the same
filename - and the user will never know what hit him. Checking if
snprintf returned NAME_MAX or more and then setting ENAMETOOLONG should
do the trick...
Even though the man page of shm_open does not mention it, I think it
would be nice if we set ENOMEM if malloc fails, since dynamic allocation
is special to our implementation.
I've included a patch with my suggested changes and my testsuite entry.
TIA,
Mikael
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Set-errno-for-shm_open-and-shm_unlink-and-add-tests.patch
URL: <http://lists.busybox.net/pipermail/uclibc/attachments/20090608/c858f94f/attachment.diff>
More information about the uClibc
mailing list