Adding shared memory implementation
Bernhard Reutner-Fischer
rep.dot.nop at gmail.com
Tue Jan 27 13:57:20 UTC 2009
On Tue, Jan 27, 2009 at 10:47:35AM +0100, Mikael Lund Jepsen, ICCC wrote:
> Bernhard Reutner-Fischer wrote:
>> This can simply be dropped into the proper tests/ subdir, no?
>>
> I'm not yet familiar with the test suite, so I had not considered
> putting it in there, but I think it is definitely a good idea.
> I just looked briefly at the (quite elaborate) test skeleton and a few
> of the existing tests, but I did not see any unique pattern or
> requirements to follow,
> so unless there are any special requirements to fit into the test
> environment, I guess it could just be dropped in...
Please include the testsuite code in the diff, TIA.
> I tried looking around a bit for similar functions constructing paths.
> Using FILENAME_MAX as in tempnam is just as bad, size wise.
> As I see it we can either impose a special (shorter) name lenght for
> uclibc or dynamically allocate a buffer with an appropriate size.
> Any preferences?
just allocate a buffer (if that's allowed by the std, quote the standard above
the declaration otherwise).
>>> +
>>> + /* Construct the filename. */
>>> + while (name[0] == '/')
>>> + ++name;
>>> +
>>> + /* create special shared memory file name and leave enough space to
>>> + cause a path/name error if name is too long */
>>> + strlcpy (shm_name + 9, name, PATH_MAX + 10);
>>>
>> sounds like a BSD extension.
>>
> Possibly - I'm not a BSD guy ;-)
So please try not to use it.
More information about the uClibc
mailing list