[PATCH] librt: Add shm_open and shm_unlink + testcase

Mikael Lund Jepsen, ICCC mlj at iccc.dk
Tue Jun 2 08:29:55 UTC 2009


Hi all,
As I have received interest from multiple sides over the last week or so 
in getting shm to work, I guess it is time I took this up again and 
finished it.
(Alexander: Your mailprovider blocks my IP for unknown reasons, so I 
have not been able to get through to you).

I have however run into a few problems:

Bernhard Reutner-Fischer wrote:
> The argument name should be flagged with attribute_nonnull.
>   
I cannot get this to work. As per some googling and grepping for nonnull 
in other uclibc sources, I've tried
__nonnull;
__nonnull((1));
__attribute((nonnull(1)));
and possibly a few more variations thereof. The result is however always 
in the lines of:
    error: expected identifier or '(' before '{' token
I guess I'm missing a point somewhere, but fail to see it. Can someone 
please enlighten me?

> Most of those two function's bodies are a common thing, i.e. should
> be in some
> static char* get_shm_name(const char*name)
> which returns the malloc'ed, 0 terminated path to operate on
>   
This also gives me some trouble. How do I go about creating a function 
shared between two source files?
I've just dropped my .c and .h files in librt and issued a make, which 
automatically picks up my source files fine, but the dependency is 
obviously not right:
../librt/shm_create_name.c:16: warning: 'create_shm_name' defined but 
not used
../librt/shm_create_name.h:10: warning: 'create_shm_name' used but never 
defined
Any help would be greatly appreciated...

TIA,
/Mikael


More information about the uClibc mailing list