Commit Graph

163 Commits

Author SHA1 Message Date
Angus Salkeld
ce1da1f28f Get the example socket includes right.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-04 09:51:28 +10:00
Angus Salkeld
26491555ef POLL: seperate out the poll/epoll and add kqueue
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-04 00:26:20 +10:00
Jan Friesse
d99c585941 Test existence of getpeer* functions
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-03 21:23:18 +10:00
Jan Friesse
59784de1e1 NetBSD doesn't have semun defined
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-03 20:49:56 +10:00
Angus Salkeld
3d291540b1 Cleanup the selection of semaphores to use
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-27 20:57:06 +11:00
Angus Salkeld
1af214d91d Try and improve the portability on bsd variants.
Also add a QB_IPC_NATIVE type that selects the best ipc type available.

Signed-off-by: Angus <angus@anguss-mac-mini>
2012-03-24 22:43:37 +11:00
Angus Salkeld
f21cdb5a57 LOG: turn off __attribute__(section) for powerpc (not working)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-07 20:40:25 +11:00
Angus Salkeld
002f009941 Remove timerfd usage and go back to timelist.
timefd is using too much cpu and it is using up
file descriptors.

timelist is also more portable and now I have less
code to maintain.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-24 11:40:45 +11:00
Angus Salkeld
7a6382f0b6 Use safer versions of string functions (strcpy -> strlcpy)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-08 22:00:49 +11:00
Angus Salkeld
ab3dc60f7f Merge some portability changes from the mingw branch
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-21 14:23:43 +11:00
Angus Salkeld
3554d145fc Re-add new automake options
I like the automake options (and encourage other developers to
install the neccessary autotools).

Here is a handy script to install the newest autotools
into a private directory (if you can't get them pre-packaged).
http://people.redhat.com/meyering/autotools-install

autotools-install --prefix=$HOME/autotools --skip-check

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-21 14:23:23 +11:00
Andrew Beekhof
61d166abbc Support compilation on Mac OSX
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-19 22:16:30 +11:00
Angus Salkeld
30ba4cee83 make -rt configurable (not needed on mac)
Thanks to Andrew Beekhof

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-19 22:12:08 +11:00
Angus Salkeld
b69ca79c7f By default don't build in the slow benchlog
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-25 11:12:27 +11:00
Angus Salkeld
e1e83aa746 Move simple-log.c to examples/
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-10-23 22:40:26 +11:00
Angus Salkeld
1591075873 LOG: serialize the va_list, don't snprintf
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-08-22 10:29:48 +10:00
Angus Salkeld
ea8dfea7a0 LOG: allow the thread priority to be set.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-08-07 22:37:42 +10:00
Angus Salkeld
0cb84fcda2 configure: improve arch & os detection output.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-06-26 23:29:19 +10:00
Angus Salkeld
4a3536e72c Re-fix mmap() woes on sparc.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-06-07 19:53:26 +10:00
Angus Salkeld
5b5a6c65d4 Make building a bit quieter by default.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-06-02 11:40:50 +10:00
Jim Meyering
8ac48bac1b avoid autoconf warning
Autoconf warned about this:
configure.ac:72: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE\
  call detected in body
That's warning about the use via AC_COMPILE_IFELSE without
specifying a language.  The easiest way to work around that is
to avoid the use of CC altogether and instead to use the preprocessor.
* configure.ac (cc_supports_flag): Use AC_PREPROC_IFELSE in place
of AC_COMPILE_IFELSE (and CPPFLAGS in place of CFLAGS).

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-17 21:32:29 +10:00
Jim Meyering
58bfc75dc6 make the tests run in parallel
I ran "make check" in libqb and watched impatiently ;-)
as the tests ran in serial on my multi-core system.
If you add automake's "parallel-tests" option below, they'll
run in parallel.

The color-tests option makes it so the "PASS" and "FAIL" words
are colored green and red respectively.  Nice, but no big deal.
Similarly nice-to-have is the "dist-xz" option.
That makes is so when you run "make dist" it creates xz-compressed
tarballs in addition to the usual gzip-compressed ones.
The advantage of also using xz is that it compresses significantly better:

    $ du -sh *z
    1.2M    libqb-0.4.1.75-3737-dirty.tar.gz
    812K    libqb-0.4.1.75-3737-dirty.tar.xz

Now, whenever a project releases both gzip-compressed and
xz-compressed tarballs, I always download only the latter, smaller ones.
Not only does it save time on the download (minimal in this case),
but it occupies less space on disk and uncompresses faster.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-17 21:25:46 +10:00
Angus Salkeld
d8b1c2564c Compile on FreeBSD
Also re-run autoscan.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-15 14:01:36 +10:00
Angus Salkeld
dc0865ba61 TEST: make a way of testing both with and without __attribute__((section))
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-14 22:21:39 +10:00
Angus Salkeld
17bdc93f88 LOG: fix the building of write_logs.c (for bench-log)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-14 16:58:29 +10:00
Angus Salkeld
b7e83fd3b2 LOG: add dynamic callsites (for platforms that don't support __attribute__(section)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-14 16:05:38 +10:00
Angus Salkeld
9aa50b2ece LOG: fix shared library callsites
This finds all the callsites in shared libraries
(using dl_iterate_phdr()) at the time qb_log_init()
is called.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>

Conflicts:

	lib/log.c
2011-04-06 22:09:46 +10:00
Angus Salkeld
cf27f4f6b4 BUILD: only set -g and -O options if explicitly requested.
compiler debug & optimization flags are only set with either
  --enable-debug or --enable-coverage.
 This prevents defaults and environmental flags from
 been overridden.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-01-31 11:25:32 +11:00
Angus Salkeld
957b1a81d8 Remove unneccessary check for library "dl"
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-01-09 17:23:37 +11:00
Angus Salkeld
487f611cb9 BUILD: improve the rpm building
copy corosync's rpm build system.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-01-09 17:22:24 +11:00
The Quarterback Library Release Team
f647c79693 Bump version to 0.4.0
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2011-01-05 21:56:53 +11:00
Angus Salkeld
b07b65df42 IPC: change service instance from handle to pointer.
Mainly to be consistent with the other objects.

Also:
- splint warnings(-weak) are now zero.
- Added a reference counter to replace the handle.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-11-03 21:41:05 +11:00
Angus Salkeld
920a927116 Cleanup config defines & add a check_all script
Run:
./check_all
to build with and without some common configurations.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-11-01 22:05:46 +11:00
Angus Salkeld
dc08661297 LOOP: add support for timerfd
If available use timerfd_create() as it is
much more accurate than tlist.h

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-11-01 10:14:08 +11:00
Angus Salkeld
cdc953384f Fix or ignore splint errors
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-22 14:50:04 +11:00
Angus Salkeld
cf12f09b31 fix some build issues on FreeBSD
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-22 14:49:54 +11:00
Angus Salkeld
ca8fd021f3 TEST: add glib mainloop option to bms
Note: glib is only linked into the test app, so
libqb not dependant on glib. This is just testing
integration.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-20 11:31:44 +11:00
Angus Salkeld
875a4f8d53 ATOMIC: fix the memory barrier setup.
This was horribly broken.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-20 11:31:44 +11:00
Angus Salkeld
9d8d6bfdce LINT: get the lint target working.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-19 22:36:08 +11:00
The Quarterback Library Release Team
01838c18c6 Bump version to 0.3.0
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2010-10-19 12:46:11 +11:00
Angus Salkeld
43d8b36518 Add atomic operations.
This was initially copied from glib. How ever I have
simplified it to only support proper atomic operations
with gcc builtin __sync calls. The backup is pthread_spin_lock().
I have also obviously namespaced the code to qb_.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-18 11:24:07 +11:00
The Quarterback Library Release Team
21fc479b92 Bump version to 0.2.0
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2010-10-18 10:07:46 +11:00
Angus Salkeld
7384c0a823 configure: re-add check for pthread_spin_lock
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-14 10:06:44 +11:00
Angus Salkeld
487eb57dd2 LOOP: add epoll support
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-12 21:53:52 +11:00
Angus Salkeld
69f2c88081 IPC: add a service_id and merge qb_ipcs_create() + qb_ipcs_service_handlers_set()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-02 21:06:12 +10:00
Angus Salkeld
22c46a341a cleanup the configure script.
Remove (now) unused checks.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-30 21:26:50 +10:00
Angus Salkeld
e5ffd5a210 BSD: port new changes to BSD
- check for doxygen
- no RLIMIT_MSGQUEUE on bsd
- change ENODATA to ENOMSG

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-03 14:04:00 +10:00
Angus Salkeld
8a6b8d78db IPC: rewrite (simpler API & more structured layout).
- implement using posix message queues
- implement using sys-v message queues
- implement shared memory ringbuffers
- add auth via unix sockets
- add items to the TODO

This is still a bit rough, more work to follow...

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-08-23 12:46:36 +10:00
Angus Salkeld
5221880227 automake: check for more headers
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-08-22 22:06:59 +10:00
Angus Salkeld
7cfb5e472f Roll all little libs into libqb.
This really makes things simpler (to produce and use).

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-05-27 11:34:58 +10:00
Angus Salkeld
092da9a03f Add pkg-config files.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-05-26 13:49:48 +10:00
Angus Salkeld
2e2e6761bf Fix make doxygen (for html output)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-05-25 20:30:37 +10:00
Angus Salkeld
95a4815f59 Fix manpage generation when builddir != srcdir
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-05-25 18:45:37 +10:00
Angus Salkeld
40f235a889 libtool and code re-structure
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-04-15 23:25:29 +10:00
Angus Salkeld
c6134b367c add a unit test for hash & cleanup.
Fix make distcheck
    Add qbhash.h to the makefiles
    Fix make rpm.
    Make sure the makefiles are generatd for hash

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-04-15 12:19:08 +10:00
Angus Salkeld
b64457e19e add logsys from corosync.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-03-20 21:40:03 +11:00
Angus Salkeld
2bea1f4f65 Add wthread & queue.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-03-20 21:23:19 +11:00
Angus Salkeld
ceff27f370 Add ipcc from corosync
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-03-19 14:42:25 +11:00
Angus Salkeld
c7e93f2f5c add the plugin library.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-03-19 14:36:04 +11:00
Angus Salkeld
3b8ba3ba5d tsafe: replace _XOPEN_SOURCE with HAVE_(function)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-03-19 14:33:02 +11:00
Angus Salkeld
1aee5e128b Add timer.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-03-19 14:25:35 +11:00
Angus Salkeld
81facf8267 Add poll, list & tlist
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-03-11 15:54:03 +11:00
Angus Salkeld
69d77500df Initial Commit.
-autotools build system
-tsafe

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-03-11 14:19:39 +11:00