Linux man page terminology: `[.n]`?

99 views Asked by At

In some man pages, e.g. https://man7.org/linux/man-pages/man3/memchr.3.html, I see the following:

       void *memchr(const void s[.n], int c, size_t n);

What is the significance or interpretation of the [.n] term?

update

As sj95126 points out, this was well covered in Linux memcpy restrict keyword syntax. This entry could be marked as a duplicate, though the subject line is substantially different.

1

There are 1 answers

0
Soner from The Ottoman Empire On

I think the representation is too new, and maybe it has been used for 2-3 years. It denotes the dimensions of arrays or the size of the referenced object. I would expect it to be const void * s. Looking at the commit change, by which I've learned that it is a kind of VLA syntax, we can see my expectation is not groundless. The documentation says

The memchr() function scans the initial n bytes of the memory area pointed to by s for the first instance of c.