/*
* call-seq:
* mq.name => string
*
* Returns the string name of message queue associated with +mq+
*/
static VALUE name(VALUE self)
{
struct posix_mq *mq = get(self, 0);
if (NIL_P(mq->name)) {
/*
* We could use readlink(2) on /proc/self/fd/N, but lots of
* care required.
* http://stackoverflow.com/questions/1188757/
*/
rb_raise(rb_eArgError, "can not get name of an adopted socket");
}
return rb_str_dup(mq->name);
}