Documentation for mq_unlink says
ENAMETOOLONG name was too long.
but what is this limit? I thought it is NAME_MAX
, but it's not. The following code runs forever (as long as there is memory, I guess).
#include <mqueue.h>
#include <string>
#include <errno.h>
#include <unistd.h>
int main(void)
{
std::string tooLong = "long";
do
{
usleep(10);
tooLong.append("longer");
mq_unlink(tooLong.c_str());
}
while(errno != ENAMETOOLONG);
}
So what is the limit? When does this function return ENAMETOOLONG
?