Angus Salkeld
82c13bdd2b
IPC: make events always use socket notification
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-06 20:39:23 +11:00
Angus Salkeld
e7aad8fad5
IPC: use poll() to prevent a recv() blocking
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-06 20:39:23 +11:00
Angus Salkeld
e0f942bfee
IPC: teach event_recv() to take a timeout
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-06 20:39:23 +11:00
Angus Salkeld
9c0fa42f17
UTIL: add qb_timespec_add_ms()
...
add X milli seconds to a timespec.
add time defines to qbdefs.h
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-06 20:39:23 +11:00
Angus Salkeld
f1f301724b
IPC: improve resource cleanup/shutdown
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-06 20:39:23 +11:00
Angus Salkeld
b95ed274bc
IPC: make internal message ids negative.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-06 20:39:23 +11:00
Angus Salkeld
dc618488d2
IPC: add a user context_get/set() functions.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-06 20:39:23 +11:00
Angus Salkeld
c1a3b0d029
IPC: add sendv() functions to handle iovecs.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-06 20:39:23 +11:00
Angus Salkeld
e79b3b41a8
IPC: make sure FD_CLOEXEC is set on all sockets
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-06 20:39:23 +11:00
Angus Salkeld
a7bf0518a7
add qbdefs.h with some common defines.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-04 10:04:01 +11:00
Angus Salkeld
4df303f374
POLL: add missing fuction.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-02 21:37:00 +10: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
fcd0ca69d9
IPC: change the ipcs_connection to a pointer (not handle).
...
This is make integrating with corosync easier.
Also technically it doesn't really matter it still
has a reference counter.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-01 22:57:02 +10:00
Angus Salkeld
2aae94eb1d
IPC: make authenticate callback more generic "accept".
...
This is so that it is more obvious that you can use
it for authentication, service availabilty and
process resource constraints.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-01 22:57:02 +10:00
Angus Salkeld
ac6ed91a7d
POLL: gracefully handle running out of file descriptors.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-01 22:57:02 +10:00
Angus Salkeld
93290ebbbd
POLL: Allow modifying POLLIN/POLLOUT state in another thread.
...
while the main thread is blocked in poll system call.
(ported from corosync)
Author: Steven Dake <sdake@redhat.com>
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-01 22:56:56 +10:00
Angus Salkeld
e3a6cd6ad6
Delete unchecked API (to be re-added later).
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-30 20:49:11 +10:00
Angus Salkeld
86c84f6ae0
IPC: new auth improvement and limits work around.
...
Create the queues/ringbuffers on the server so we don't
have to modify proc entries. Then chown them so that
the clients can access them.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-30 20:17:59 +10:00
Angus Salkeld
f2c80cb086
RB: add qb_rb_chown()
...
change the ownership of the two mmap'ed files.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-30 20:07:35 +10:00
Angus Salkeld
9556038195
IPC_SYSV: get sysv ipc to work with non-root processes.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-29 14:35:59 +10:00
Angus Salkeld
a54067bffa
IPC: pack sysv messages into multiple queue items
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-29 14:32:51 +10:00
Angus Salkeld
b6d4fb95b8
IPC: add events back (were dispatch messages in corosync)
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-29 14:32:51 +10:00
Angus Salkeld
682ff31540
IPC: rename dispatch queues to event queues.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-29 14:32:51 +10:00
Angus Salkeld
b29a1809f4
IPC: rename qb_ipcs_connection_pt -> qb_ipcs_connection_handle_t
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-29 14:32:51 +10:00
Angus Salkeld
64b4aac413
IPC: un-const the data pointer in recv()
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-29 14:32:51 +10:00
Angus Salkeld
432e906de8
POLL: check for stop_requested before poll() as well.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-29 10:52:41 +10:00
Angus Salkeld
b28173ee81
IPC: get shm & pmq working
...
Note: pmq needs "sudo make check"
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-07 14:11:42 +10:00
Angus Salkeld
e7de13cd9d
IPC: add a basic tx/rx test case.
...
- cleanup some printf's
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-07 08:56:38 +10:00
Angus Salkeld
eae6c35157
IPC: linux & bsd mq_open returns a poll'able file descriptor.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-06 16:50:19 +10:00
Angus Salkeld
1b84f99ef7
Lindent most c files again.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-06 16:50:05 +10:00
Angus Salkeld
e558ca0d39
IPC: fix crash on failed auth
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-06 16:49:35 +10:00
Angus Salkeld
d27e50c58a
Define new return status policy
...
Good >= 0 (0 = good, or positive value)
Bad < 0 (-errno)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-06 16:49:15 +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
a6285e6f14
RB: add function qb_rb_chunks_used()
...
This is to make it easier to to see if there is
a chunk available to be read.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-08-09 16:59:26 +10:00
Angus Salkeld
fc55f5c5f9
RB: make the timedwait() functions more consistent
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-07-28 21:14:36 +10:00
Angus Salkeld
f04f1abcf0
POLL: add a job API to process non-fd items.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-07-28 21:12:11 +10:00
Angus Salkeld
41c06ef6e6
int -> int32_t
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-06-22 11:55:09 +10:00
Angus Salkeld
60b11eee49
unsigned int -> uint32_t
...
some to int32_t (bugs)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-06-22 11:54:58 +10:00
Angus Salkeld
cdb9d32de4
unsigned long long -> uint64_t
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-06-22 11:28:56 +10:00
Angus Salkeld
edf994dc5c
change name of ringbuffer.h to ringbuffer_int.h
2010-06-22 11:26:34 +10:00
Angus Salkeld
2432ca85b9
list: rename QB_DECLARE_LIST_INIT -> QB_LIST_DECLARE
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-06-16 13:24:14 +10:00
Angus Salkeld
b8a5a74fcc
hdb: move functions into cfile
...
convert int -> int32_t
rename qb_hdb_handle_t -> qb_handle_t
rename DECLARE_HDB_DATABASE -> QB_HDB_DECLARE
rename qb_hdb_handle_database -> qb_hdb
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-06-16 09:12:20 +10:00
Angus Salkeld
87f204469a
ipc: convert int -> int32_t; unsigned int -> uint32_t
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-06-15 14:46:52 +10:00
Angus Salkeld
7deaa935c7
ipc: use a ringbuffer for requests.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-06-15 12:56:33 +10:00
Angus Salkeld
ffd5975da3
ipcc: remove unneccessry goto
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-06-15 12:56:33 +10:00
Angus Salkeld
a4c1f5445e
rb: fix handling of EINTR from sem_wait
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-06-15 12:56:33 +10:00
Angus Salkeld
ec9a050a29
rb: make rb_chunk_peek() wait on the sem like chunk_read()
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-06-15 12:56:23 +10:00
Angus Salkeld
e7975a77e3
rb: add a get name function
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-06-12 11:25:50 +10:00