Eric Wong [Tue, 30 Jan 2018 23:59:56 +0000 (30 23:59 +0000)]
Ruby posix_mq 2.4.1
This release fixes a problem affecting users of newer clang (5.x+)
and Ruby 2.5.0: https://bugs.ruby-lang.org/issues/14425
There is no need to upgrade if using gcc or Ruby <= 2.4.
* drop extra args to rb_funcall
Eric Wong [Tue, 30 Jan 2018 23:56:12 +0000 (30 23:56 +0000)]
drop extra args to rb_funcall
Having extra args was harmless in Ruby 2.4, but Ruby 2.5 with
newer versions of clang are not happy about it. Eventually this
may be fixed in Ruby 2.5.1: https://bugs.ruby-lang.org/issues/14425
Eric Wong [Mon, 20 Mar 2017 19:41:50 +0000 (20 19:41 +0000)]
Ruby posix_mq 2.4.0
Most notably there are some FreeBSD fixes. There are also
some minor internal cleanups and doc updates.
7 changes since 2.3.0 (2016-02-02):
doc: remove private email address
doc: update bogomips.org URLs to HTTPS
set correct condition for setting id_autoclose
test_posix_mq: get tests passing under FreeBSD 10.3
TypedData C-API conversion
freeze internal objects
build: remove build-time olddoc dependency
Eric Wong [Mon, 20 Mar 2017 19:35:01 +0000 (20 19:35 +0000)]
build: remove build-time olddoc dependency
This should make it easier for distros to pick this
up without picking up olddoc, too.
We will still use olddoc for generating the website since it
reduces bandwidth costs, and for generating NEWS for our own
builds.
Eric Wong [Mon, 20 Mar 2017 18:47:26 +0000 (20 18:47 +0000)]
freeze internal objects
We do not want ObjectSpace walkers to be able to mess with
our internals.
Eric Wong [Sat, 18 Mar 2017 08:16:31 +0000 (18 08:16 +0000)]
TypedData C-API conversion
This provides some extra type safety if combined with other
C extensions, as well as allowing us to account for memory usage of
the HTTP parser in ObjectSpace.
This requires Ruby 1.9.3+ and has remained a stable API since
then. This will become officially supported when Ruby 2.3.0 is
released later this month.
This API has only been documented in doc/extension.rdoc (formerly
README.EXT) in the Ruby source tree since April 2015, r50318
Eric Wong [Sat, 18 Mar 2017 08:07:26 +0000 (18 08:07 +0000)]
test_posix_mq: get tests passing under FreeBSD 10.3
Apparently POSIX message queues adopted close-on-fork behavior
in FreeBSD at some point. Oh well, somebody else who is more
interested in FreeBSD than can look into fixing it on their end.
Improve exception reporting a bit while we're at it.
Eric Wong [Sat, 18 Mar 2017 07:48:49 +0000 (18 07:48 +0000)]
set correct condition for setting id_autoclose
This bug was noticed under FreeBSD :x
Eric Wong [Sat, 18 Mar 2017 07:50:17 +0000 (18 07:50 +0000)]
doc: update bogomips.org URLs to HTTPS
It looks like HTTPS support provided by the Let's Encrypt
project is still going strong, and maybe we can rely on it.
Eric Wong [Sat, 18 Mar 2017 07:46:12 +0000 (18 07:46 +0000)]
doc: remove private email address
Email is not private, and we won't be able to protect your
privacy. Anonymity (when desired) should be the sender's
responsibility, not the recipients'.
Eric Wong [Tue, 2 Feb 2016 23:25:17 +0000 (2 23:25 +0000)]
Ruby posix_mq 2.3.0 - updates for Ruby 2.3+
This release updates our POSIX_MQ#close to match the idempotent
IO#close behavior under Ruby 2.3 and later. Previous Ruby versions
continue to be supported, but POSIX_MQ#close remains non-idempotent
when built against old Ruby versions.
4 changes since v2.2.0:
enable frozen_string_literal for Ruby 2.3+
support idempotent POSIX_MQ#close
README: remove cgit and ssoma references
build: use '--local' domain for dev gem install
Eric Wong [Tue, 2 Feb 2016 23:01:49 +0000 (2 23:01 +0000)]
build: use '--local' domain for dev gem install
This avoids unnecessary network requests for disconnected
systems.
Eric Wong [Tue, 2 Feb 2016 22:17:22 +0000 (2 22:17 +0000)]
README: remove cgit and ssoma references
We may not always be cgit, and encouraging tarball snapshot
downloads is a waste of resources
Release tarballs are not, as users aren't expected to know to
do "git clone"; but developers are.
This is also not an appropriate place for advertising ssoma.
Eric Wong [Tue, 2 Feb 2016 22:14:16 +0000 (2 22:14 +0000)]
support idempotent POSIX_MQ#close
IO#close under Ruby 2.3 is idempotent, we shall follow suit
with POSIX_MQ#close
Eric Wong [Tue, 2 Feb 2016 20:11:22 +0000 (2 20:11 +0000)]
enable frozen_string_literal for Ruby 2.3+
No changes for older Rubies, but this reduces garbage under 2.3
Eric Wong [Fri, 16 Jan 2015 20:13:45 +0000 (16 20:13 +0000)]
Ruby posix_mq 2.2.0 - support FD adoption
The major feature of this release is the POSIX_MQ.for_fd class
method thanks to Christopher Lord. The addition of the
POSIX_MQ#autoclose? and POSIX_MQ#autoclose= round out the new
feature set. All of the new methods are analogous to their
counterparts in the core IO class.
The mailing list is also moved to ruby-posix-mq@bogomips.org
and no longer requires subscription. Existing librelist
subscribers will need to resubscribe manually (as I have no
way of doing so automatically):
ruby-posix-mq+subscribe@bogomips.org
HTTP archives and instructions for extracting the mail archives
via git are available at:
http://bogomips.org/ruby-posix-mq/
Christopher Lord (1):
Ability to adopt file descriptors
Eric Wong (16):
for_fd: delay assigning to mq->des until after mq_getattr
test_posix_mq: rewrite test to not depend on DL or alarm
support autoclose= and autoclose?
pack rw_args struct
change mailing list to ruby-posix-mq@bogomips.org
doc: remove --sanitize-html option for pandoc
switch documentation to olddoc
LICENSE: allow all future versions of LGPLv3+
favor comparisons against zero instead of -1
pkg.mk: misc tweaks and updates
gemspec: remove rdoc_options setting
.gitignore: add placeholder
gemspec: use SPDX license abbreviation
misc doc updates
POSIX_MQ#autoclose= propagates to IO
GNUmakefile: ordering fix for building gem
Eric Wong [Fri, 16 Jan 2015 20:12:31 +0000 (16 20:12 +0000)]
GNUmakefile: ordering fix for building gem
Eric Wong [Mon, 12 Jan 2015 08:27:41 +0000 (12 08:27 +0000)]
POSIX_MQ#autoclose= propagates to IO
If a corresponding IO object exists or is created later, propagate
autoclose to the corresponding IO object to avoid simplify autoclose
handling for the user. This hopefully avoids nasty surprises in case
users disable autoclose but want to keep the IO object around.
Eric Wong [Mon, 12 Jan 2015 07:57:32 +0000 (12 07:57 +0000)]
misc doc updates
* Include the email addresses for olddoc
* README: update support status of Rubies
* label link to mailing list archives
Eric Wong [Mon, 12 Jan 2015 07:52:53 +0000 (12 07:52 +0000)]
gemspec: use SPDX license abbreviation
Eric Wong [Mon, 12 Jan 2015 07:47:39 +0000 (12 07:47 +0000)]
.gitignore: add placeholder
Eric Wong [Mon, 12 Jan 2015 07:46:44 +0000 (12 07:46 +0000)]
gemspec: remove rdoc_options setting
We no longer need it for olddoc
Eric Wong [Mon, 12 Jan 2015 07:44:22 +0000 (12 07:44 +0000)]
pkg.mk: misc tweaks and updates
* We're not using isolate anymore
* support EXTCONF_ARGS env for building
* add "make check" as an alias for "make test"
(muscle memory for GNU-autotools projects)
Eric Wong [Sun, 11 Jan 2015 03:19:33 +0000 (11 03:19 +0000)]
favor comparisons against zero instead of -1
This should allow faster instructions to be used in some cases.
Technically this may be less pedantically correct, but there is
enough existing code out there which does the same thing to
discourage kernel/libc developers from overloading negative
return values.
...And glibc even favors comparison against zero, too.
Eric Wong [Sat, 10 Jan 2015 00:14:21 +0000 (10 00:14 +0000)]
LICENSE: allow all future versions of LGPLv3+
In case I'm hit by a bus and FSF comes out with an LGPLv4,
the project will still be able to move forward.
While we're at it, update the gemspec, too.
Eric Wong [Fri, 9 Jan 2015 03:53:45 +0000 (9 03:53 +0000)]
switch documentation to olddoc
wrongdoc was difficult to maintain because of the tidy-ffi
dependency and the HTML5 changes in Darkfish could not be
handled well by Tidy.
olddoc is superior as it generates leaner HTML which loads faster,
requires less scrolling and less processing power to render.
Aesthetic comparisons are subjective of course but completely
unimportant compared to speed and accessibility.
Eric Wong [Fri, 9 Jan 2015 23:10:14 +0000 (9 23:10 +0000)]
doc: remove --sanitize-html option for pandoc
Newer versions of pandoc removed this option
Eric Wong [Fri, 9 Jan 2015 23:02:55 +0000 (9 23:02 +0000)]
change mailing list to ruby-posix-mq@bogomips.org
The public-inbox + mlmmj setup on bogomips.org allows posting
without subscription and offers downloadable archives via git.
The lack of rsyncable archives on librelist nowadays and
subscription-required nature of librelist are points against it.
Repliers are now encouraged to Cc: all recipients (using the
reply-all function of their mail client) since many readers are
not subscribed.
This project has never accepted or encouraged HTML email, but
librelist accepted it. The bogomips.org mail server is
configured to treat HTML mail as spam, so do not send HTML mail
if you expect a response.
Users who wish to subscribe may send a message to:
ruby-posix-mq+subscribe@bogomips.org
Similarly, they may unsubscribe via:
ruby-posix-mq+unsubscribe@bogomips.org
HTTP archives are available via:
http://bogomips.org/ruby-posix-mq/
ssoma users may also use: git://bogomips.org/ruby-posix-mq
(see README change)
Old messages to the librelist addresses will continue to
get routed to the new mailing list.
ref: http://public-inbox.org/
Eric Wong [Fri, 9 Jan 2015 22:10:24 +0000 (9 22:10 +0000)]
pack rw_args struct
This saves one word of stack space, potentially improving
performance a miniscule amount.
Eric Wong [Fri, 9 Jan 2015 04:18:22 +0000 (9 04:18 +0000)]
support autoclose= and autoclose?
These are analogous to the identically-named IO methods and useful
when we're inheriting descriptors (or writing tests for inheriting
descriptors).
Eric Wong [Fri, 9 Jan 2015 07:28:21 +0000 (9 07:28 +0000)]
test_posix_mq: rewrite test to not depend on DL or alarm
DL is removed and deprecated, and we don't actually need
it or alarm to test for EINTR-safety.
Eric Wong [Fri, 9 Jan 2015 04:18:21 +0000 (9 04:18 +0000)]
for_fd: delay assigning to mq->des until after mq_getattr
We do not want to assign to mq->des before verifying we
have a valid message queue, otherwise the GC may misclose
an invalid MQ descriptor (which may be a valid FD).
Christopher Lord [Sat, 3 Jan 2015 17:15:58 +0000 (3 10:15 -0700)]
Ability to adopt file descriptors
This patch adds support for adopting an existing file descriptor, together
with testcases. The need for this comes up when we use systemd with the
ListenMessageQueue directive. For socket activation, systemd opens the POSIX
message queue and expects user code to begin using the file descriptor
without opening it in-process.
To support the systemd model in the `posix_mq` gem, this patch suggests
imitating the behavior on the Socket class, which uses `#for_fd` to create a
socket class from a descriptor.
One confounding factor exists. POSIX queues have a name but it is difficult
to get access to this name in a safe manner from the file descriptor. One
option would be to `readlink(2)` on `/proc/self/fd/N` to get the name[1], but
note that if the descriptor is unlinked we wouldn't get anything usable.
Rather than risk incorrect behavior and extra complexity, I've decided to
just raise an `ArgumentError` if `#name` is called on adopted descriptors.
Typically one wouldn't need the actual name in a systemd socket-activated
situation, anyway.
[1]: http://stackoverflow.com/questions/
1188757/getting-filename-from-file-descriptor-in-c
[ew: simplified type checks to be consistent with IO.for_fd,
fixed test case]
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong [Sat, 15 Feb 2014 13:34:12 +0000 (15 13:34 +0000)]
posix_mq 2.1.0 - ensure compatibility with future Rubies
* avoid deprecated rb_thread_blocking_region in Ruby 2.0/2.1
* prepare for rb_thread_blocking_region removal
Eric Wong [Sat, 15 Feb 2014 13:13:06 +0000 (15 13:13 +0000)]
avoid deprecated rb_thread_blocking_region in Ruby 2.0/2.1
This will be removed in Ruby 2.2, so avoid the deprecation warning.
Eric Wong [Sun, 9 Feb 2014 00:40:11 +0000 (9 00:40 +0000)]
prepare for rb_thread_blocking_region removal
It'll be OK to use rb_thread_call_without_gvl when
rb_thread_blocking_region is not detectable at all.
We still use rb_thread_blocking_region for Ruby 2.0-2.1 because
rb_thread_call_without_gvl was detectable in 1.9.3, but not
usable as an internal symbol.
ref: https://bugs.ruby-lang.org/issues/9502
Eric Wong [Mon, 30 Sep 2013 18:24:33 +0000 (30 18:24 +0000)]
Rakefile: kill raa_update task
RAA is dead.
Eric Wong [Mon, 6 Aug 2012 21:06:38 +0000 (6 21:06 +0000)]
pkg.mk: update
Eric Wong [Mon, 6 Aug 2012 20:58:04 +0000 (6 20:58 +0000)]
posix_mq 2.0.0 - a minor API change + FreeBSD fixes
Blocking methods no longer raise Errno::EINTR (to match
Ruby IO semantics, making code easier to work with).
There are also many FreeBSD-related fixes thanks to
Hleb Valoshka <375gnu@gmail.com> and small code cleanups.
ew@fbsd90-32.(none) [Wed, 11 Jul 2012 02:54:33 +0000 (11 02:54 +0000)]
test: relax test timings for timed* tests
On my i386-freebsd9 VM, this takes just longer than the
maximum allowable time.
ew@fbsd90-32.(none) [Wed, 11 Jul 2012 02:25:44 +0000 (11 02:25 +0000)]
extconf: fix __mq_oshandle() detection on FreeBSD
We need to have -lrt in LDFLAGS before we can detect it.
ew@fbsd90-32.(none) [Wed, 11 Jul 2012 02:02:43 +0000 (11 02:02 +0000)]
test: disable IO.select test if #to_io is missing
ew@fbsd90-32.(none) [Wed, 11 Jul 2012 01:58:57 +0000 (11 01:58 +0000)]
ext: fix type inconsistencies for int vs mqd_t retvals
Somehow I mixed up return values for mq_* functions that
return "int". This was noticed on FreeBSD where mqd_t
is NOT an integer.
Eric Wong [Thu, 12 Jul 2012 19:30:20 +0000 (12 12:30 -0700)]
notify: set lower bound for notify stack size
Some OSes have ridiculously low boundaries and we don't
want mysterious failures on them
Eric Wong [Wed, 4 Jul 2012 00:57:44 +0000 (3 17:57 -0700)]
blocking functions do not raise Errno::EINTR
Blocking functions should not raise Errno::EINTR to match
existing semantics of Ruby IO methods (e.g. IO.select, IO#read,
IO#write). This makes user code easier to read/write.
Like th Ruby methods we emulate, we only reacquire the GVL on
EINTR to fire signal handlers, but otherwise emulate SA_RESTART
semantics.
This is a backwards-incompatible API change (but unlikely
to break existing code).
Hleb Valoshka [Tue, 3 Jul 2012 20:13:49 +0000 (3 23:13 +0300)]
Add libc names for Debian GNU/kFreeBSD and FreeBSD in tests.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Hleb Valoshka [Tue, 3 Jul 2012 20:13:48 +0000 (3 23:13 +0300)]
Fix call to DL::Function.new in tests
The 3rd argument of DL::Function.new is ABI type, not a return type.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong [Thu, 16 Jun 2011 07:41:48 +0000 (16 07:41 +0000)]
fix compiler warnings, oops
CFLAGS=-Wall somehow got disabled in my Ruby installation...
Eric Wong [Tue, 14 Jun 2011 07:44:18 +0000 (14 07:44 +0000)]
num2timespec: remove needless double-assignment
Oops
Eric Wong [Tue, 14 Jun 2011 07:21:25 +0000 (14 07:21 +0000)]
no need to rb_intern("*")
'*' works just the same
Eric Wong [Tue, 1 Mar 2011 09:07:05 +0000 (1 09:07 +0000)]
posix_mq 1.0.0 - kinder, gentler message queues
There is one backwards-incompatible API change:
POSIX_MQ#send returns +true+ on success instead of +nil+
for consistency with POSIX_MQ#trysend.
This release adds the POSIX_MQ#trysend, POSIX_MQ#tryreceive and
POSIX_MQ#tryshift interfaces to avoid exceptions on common
EAGAIN errors for users of non-blocking queues.
Bugfixes: non-blocking behavior changes to a shared descriptor
in a different process are reflected immediately in the child
(this won't fix race conditions in your code, however).
Minor bugfixes for posix-mq-rb(1) and quieted warnings for
1.9.3dev.
Eric Wong [Tue, 1 Mar 2011 08:57:16 +0000 (1 08:57 +0000)]
make methods that should be private, private
So private we won't mention them in the commit message!
Eric Wong [Tue, 1 Mar 2011 08:52:34 +0000 (1 08:52 +0000)]
remove unused tryinit function
Something I considered but decided wasn't worth doing.
Eric Wong [Tue, 1 Mar 2011 08:51:28 +0000 (1 08:51 +0000)]
POSIX_MQ#send returns +true+ on success
This is to be consistent with POSIX_MQ#trysend
Eric Wong [Tue, 1 Mar 2011 08:40:44 +0000 (1 08:40 +0000)]
finalize try* interfaces
Consider them good enough for a 1.0.0 release
Eric Wong [Sun, 27 Feb 2011 11:43:28 +0000 (27 11:43 +0000)]
posix-mq-rb: always prefer write-in-full behavior
In case somebody made the receiving pipe non-blocking,
we want the command-line tool to succeed.
Eric Wong [Sun, 27 Feb 2011 11:40:40 +0000 (27 11:40 +0000)]
fix warnings and enable them for tests
Cleaner code anyways.
Eric Wong [Sun, 27 Feb 2011 11:37:23 +0000 (27 11:37 +0000)]
posix-mq-rb: use IO#binmode to get binary IOs
Avoids warnings this way
Eric Wong [Sun, 27 Feb 2011 11:27:51 +0000 (27 11:27 +0000)]
doc: note that the try* interfaces are not final
But they'll be pushed to the site for greater
visibility.
Eric Wong [Sun, 27 Feb 2011 11:11:19 +0000 (27 11:11 +0000)]
bump version to 0.8.0pre
Remove the VERSION constant, it's cruft.
Eric Wong [Sun, 27 Feb 2011 10:59:09 +0000 (27 10:59 +0000)]
doc: fix doc generation for manpage
Oops
Eric Wong [Sun, 27 Feb 2011 10:54:42 +0000 (27 10:54 +0000)]
add trysend, tryreceive, and tryshift interfaces
These are kinder and less exceptional than their
non-trying counterparts as generating exceptions
is expensive for common EAGAIN errors.
Eric Wong [Sun, 27 Feb 2011 10:19:13 +0000 (27 10:19 +0000)]
eliminate needless global (cPOSIX_MQ)
It can be local variable
Eric Wong [Sun, 27 Feb 2011 10:11:34 +0000 (27 10:11 +0000)]
run GC on ENOSPC when calling mq_open()
It could work...
Eric Wong [Sun, 27 Feb 2011 10:08:48 +0000 (27 10:08 +0000)]
Symbols are VALUEs, not IDs
Oops :x
Eric Wong [Sun, 27 Feb 2011 09:59:11 +0000 (27 09:59 +0000)]
tests: do not require Fiddle for Ruby 1.9
It's only available when compiled with libffi.
Eric Wong [Sun, 27 Feb 2011 09:56:34 +0000 (27 09:56 +0000)]
Do not trust locally cached mq_flags
These flags can be changed in the parent or child
process, so we will always have to run mq_getattr()
to check it. This removes the GVL-keeping non-blocking
optimizations but we'll gain some soon.
Eric Wong [Thu, 24 Feb 2011 04:52:26 +0000 (23 20:52 -0800)]
cleanup DL usage for alarm() test
Eric Wong [Thu, 24 Feb 2011 04:43:09 +0000 (23 20:43 -0800)]
fix test alarm() case for Ruby 1.9
DL in Ruby 1.9 isn't the same
Eric Wong [Thu, 24 Feb 2011 00:09:46 +0000 (23 16:09 -0800)]
posix_mq 0.7.0 - cleanups + portability fixes
This release now works for systems other than Linux and FreeBSD
that support POSIX message queues. This is usable for systems
without mq_timedsend() or mq_timedreceive() but with the
non-timed variants (timeouts wont work).
Thanks to Tadeusz Bochan for testing.
Ruby posix_mq is now dual-licensed under the GPLv2 (as well as the
preferred LGPLv3) for compatibility with existing GPLv2-only code.
Eric Wong [Thu, 24 Feb 2011 00:31:16 +0000 (23 16:31 -0800)]
doc: full rdoc coverage!
Eric Wong [Thu, 24 Feb 2011 00:25:57 +0000 (23 16:25 -0800)]
doc: add copy of GPLv2
For completeness, the LGPLv3 remains the preferred license.
Eric Wong [Thu, 24 Feb 2011 00:19:16 +0000 (23 16:19 -0800)]
doc: note that timeout is not always supported
Maybe people will just upgrade to newer systems eventually.
Eric Wong [Thu, 24 Feb 2011 00:05:36 +0000 (23 16:05 -0800)]
README: update mailing list notes
If it's not clear, we hate HTML.
Eric Wong [Wed, 23 Feb 2011 23:30:02 +0000 (23 15:30 -0800)]
added a note about em-posixmq for EventMachine users
ref: http://mid.gmane.org/AANLkTimNcWKqNSbD5GL76Z9rS3Gfi3uGusPksD2Eo+=P@mail.gmail.com
Eric Wong [Wed, 23 Feb 2011 23:26:40 +0000 (23 15:26 -0800)]
doc: discourage the use of notify
POSIX_MQ#notify(&block) mostly sucks.
Eric Wong [Wed, 23 Feb 2011 23:21:55 +0000 (23 15:21 -0800)]
unindent class methods
No need to waste indentation and make eyes wander.
Eric Wong [Wed, 23 Feb 2011 20:11:18 +0000 (23 20:11 +0000)]
test for alarm() working properly to interrupt
Some systems without mq_timedsend/mq_timedreceive need to
use alarm() or similar (setitimer()) to interrupt timed-out
mq_send/mq_receive calls, so we need to handle EINTR properly.
Eric Wong [Wed, 23 Feb 2011 19:46:53 +0000 (23 19:46 +0000)]
update URLs for git and cgit
While the old URLs still work, bogomips.org went on a URL diet
Eric Wong [Wed, 23 Feb 2011 19:43:38 +0000 (23 19:43 +0000)]
fix MQ_IO_NIL_P and MQ_IO_CLOSE macros
These cannot be cast to void since its value is
meaningful.
Eric Wong [Wed, 23 Feb 2011 19:42:58 +0000 (23 19:42 +0000)]
test: fix GC test for systems without POSIX_MQ#to_io
Not all systems can convert POSIX_MQ to IO objects.
Eric Wong [Wed, 23 Feb 2011 01:42:02 +0000 (22 17:42 -0800)]
LICENSE: dual license, adding GPLv2
This makes us explicitly compatible with GPLv2-only programs.
Eric Wong [Wed, 23 Feb 2011 00:46:26 +0000 (22 16:46 -0800)]
attempt to support systems w/o mq_timedsend/mq_timedreceive
Some ancient systems don't support mq_timedsend and
mq_timedreceive but somehow manage to support other POSIX
mq_* functions.
Eric Wong [Tue, 22 Feb 2011 23:41:22 +0000 (22 15:41 -0800)]
extconf: remove unnecessary dir_config statement
It's all standard C library stuff.
Eric Wong [Tue, 22 Feb 2011 23:32:40 +0000 (22 15:32 -0800)]
use StringValueCStr for paths
RSTRING_PTR may contain '\0' bytes which makes it unsuitable
for mq_unlink() and mq_open()
Eric Wong [Tue, 22 Feb 2011 23:02:31 +0000 (22 15:02 -0800)]
fix broken rb_str_set_len() #define for Ruby 1.8.6
This was too aggressively deleted during cleanups for Rubinius
support in commit
5339d9d693c794c0f20270d5726cb360e31dff30
Noticed-by: Tadeusz Bochan <tad.bochan@bnpparibas.com>
ref:
2a92695fc1958e0370782284c6196625@ruby-forum.com
Eric Wong [Tue, 22 Feb 2011 22:50:59 +0000 (22 14:50 -0800)]
fix for systems that can't convert mqd_t to FD
Apparently there are OSes that don't have methods to convert
mqd_t to FD.
Noticed-by: Tadeusz Bochan <tad.bochan@bnpparibas.com>
ref: <
2a92695fc1958e0370782284c6196625@ruby-forum.com>
Eric Wong [Tue, 22 Feb 2011 22:39:31 +0000 (22 14:39 -0800)]
switch to pkg.mk for packaging needs
I can't stand Rake :x
Eric Wong [Sun, 26 Dec 2010 01:25:27 +0000 (26 01:25 +0000)]
publish_news target is less braindead
Run it by default on releases.
Eric Wong [Sat, 25 Dec 2010 08:23:03 +0000 (25 00:23 -0800)]
posix_mq 0.6.0 - Rubinius support
Rubinius 1.2 as well as Ruby 1.9. Ruby 1.8 works except it will
block the entire interpreter for blocking operations. Spurious
errors during GC for POSIX_MQ#to_io users are now avoided.
Eric Wong [Sat, 25 Dec 2010 08:19:49 +0000 (25 00:19 -0800)]
switch to wrongdoc for documentation
No more JavaScript on our site!
Eric Wong [Sat, 25 Dec 2010 07:56:07 +0000 (24 23:56 -0800)]
add Rubinius support
Cleaner code, too, no more direct RSTRUCT usage.
Eric Wong [Sat, 25 Dec 2010 07:24:29 +0000 (24 23:24 -0800)]
refactor type checks and remove unnecessary guards
StringValuePtr should already be a sufficient guard.
There are more tests while we're at it, too, and we'll
now raise TypeError instead of ArgumentError when a
POSIX_MQ::Attr is not passed properly.
Eric Wong [Sat, 25 Dec 2010 02:11:04 +0000 (24 18:11 -0800)]
remove rb_time_interval() and gettimeofday() dependency
This function isn't exported in the standard Ruby headers,
it returns an aggregate value and isn't available in Rubinius,
either, so nuke it.
While we're at it, use clock_gettime() instead of gettimeofday()
to avoid unnecessary timeval usage since mq_send/mq_receive
rely on higher-precision timespecs instead.
Eric Wong [Fri, 20 Aug 2010 02:37:32 +0000 (19 19:37 -0700)]
tests: use Class#method_defined?
I did not know about this method back in the day...
Eric Wong [Fri, 20 Aug 2010 02:36:23 +0000 (19 19:36 -0700)]
test: avoid leaving queues behind
We shouldn't unnecessarily hog system resources.
Eric Wong [Fri, 20 Aug 2010 02:25:58 +0000 (19 19:25 -0700)]
avoid double close() and EBADF
It can be dangerous to hit (and ignore) EBADF errors in
multi-threaded applications. Users of POSIX_MQ#to_io have two
Ruby objects pointing to the same file descriptor, making
things tricky when it comes time to reap resources.
We'll always prefer to close the Ruby IO object if it exists
(because we have less control over its GC behavior) and
ignore the raw descriptor.
Eric Wong [Mon, 2 Aug 2010 08:28:15 +0000 (2 08:28 +0000)]
open/notify: invoke GC if needed
On ENOMEM, EMFILE, and ENFILE errors, it is customary to
invoke the Ruby GC and free up resources and retry the
system call.
Eric Wong [Sun, 9 May 2010 08:05:56 +0000 (9 01:05 -0700)]
posix_mq 0.5.1
Fix POSIX_MQ#notify(&block) usage, this regression was
introduced in 0.4.0 and our tests for it were broken, as well.
Eric Wong [Sun, 9 May 2010 07:05:03 +0000 (9 00:05 -0700)]
fix POSIX_MQ#notify(&block) aka SIGEV_THREAD
tests for them were stupidly broken and never executed :x