posix_mq RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* How to set "maxmsg"?
@ 2010-01-07 23:24 Iñaki Baz Castillo
  2010-01-07 23:31 ` How to set "maxmsg"? [SOLVED] Iñaki Baz Castillo
  0 siblings, 1 reply; 2+ messages in thread
From: Iñaki Baz Castillo @ 2010-01-07 23:24 UTC (permalink / raw)
  To: ruby.posix.mq

I'm trying to set "maxmsg" to 100 (rather than the system default 10). For 
this I try:

---------------------------------------
MQ = POSIX_MQ.new(
  "/mq",                      # queue name
  IO::RDONLY | IO::CREAT,     # read only and force creation
  nil,                        # mode
  POSIX_MQ::Attr.new(
    0,                        # flags
    100,                      # maxmsg
    8192,                     # msgsize
    0                         # curmsgs
  )
)
---------------------------------------

But I get an error:

  `initialize': Invalid argument - mq_open (Errno::EINVAL)


mq_setattr(3) says that such error occurs when:

  EINVAL newattr->mq_flags contained set bits other than O_NONBLOCK.

Well, I'm setting 0 for flags, so what am I doing wrong?

Thanks a lot.

-- 
Iñaki Baz Castillo <ibc@aliax.net>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to set "maxmsg"? [SOLVED]
  2010-01-07 23:24 How to set "maxmsg"? Iñaki Baz Castillo
@ 2010-01-07 23:31 ` Iñaki Baz Castillo
  0 siblings, 0 replies; 2+ messages in thread
From: Iñaki Baz Castillo @ 2010-01-07 23:31 UTC (permalink / raw)
  To: ruby.posix.mq

El Viernes, 8 de Enero de 2010, Iñaki Baz Castillo escribió:
> I'm trying to set "maxmsg" to 100 (rather than the system default 10). For
> this I try:
> 
> ---------------------------------------
> MQ = POSIX_MQ.new(
>   "/mq",                      # queue name
>   IO::RDONLY | IO::CREAT,     # read only and force creation
>   nil,                        # mode
>   POSIX_MQ::Attr.new(
>     0,                        # flags
>     100,                      # maxmsg
>     8192,                     # msgsize
>     0                         # curmsgs
>   )
> )
> ---------------------------------------
> 
> But I get an error:
> 
>   `initialize': Invalid argument - mq_open (Errno::EINVAL)
> 
> 
> mq_setattr(3) says that such error occurs when:
> 
>   EINVAL newattr->mq_flags contained set bits other than O_NONBLOCK.
> 
> Well, I'm setting 0 for flags, so what am I doing wrong?

Understood! "maxmsg" cannot be greater than the system settings (if I'm not 
root).
:)


-- 
Iñaki Baz Castillo <ibc@aliax.net>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-07 23:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-07 23:24 How to set "maxmsg"? Iñaki Baz Castillo
2010-01-07 23:31 ` How to set "maxmsg"? [SOLVED] Iñaki Baz Castillo

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/ruby_posix_mq.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).