aboutsummaryrefslogtreecommitdiffstats
path: root/doc/bus_open.3
blob: 0bedf00d616d55514702b6a1f8c1e9c0899a9de0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
.TH BUS_OPEN 1 BUS-%VERSION%
.SH NAME
bus_open - Open a bus
.SH SYNOPSIS
#include <bus.h>

int bus_open(bus_t *bus, const char *file, int flags);
.SH DESCRIPTION
The
.BR bus_open(3)
function acquires resources required for the process to use the bus
associated with the filename stored in \fIfile\fP.  The function also
stores the resource \fIbus\fP for use by other
.BR bus(5)
functions.
.PP
Values for \fIflags\fP are constructed by a bitwise inclusive OR of
flags from the following list.
.TP
.IR BUS_RDONLY
The process will only be using the bus for receiving messages.
.TP
.IR BUS_WRONLY
The process will only be using the bus for sending messages.
.TP
.IR BUS_RDWR
The process will use the bus for both receiving and sending messages.
.SH RETURN VALUES
Upon successful completion the function returns 0.  Otherwise the
function returns -1 and set \fIerrno\fP to indicate the error.
.SH ERRORS
.TP
.IR ENOMEM
The process cannot allocate more memory.
.TP
.IR EACCES
Operation permission is denied to the calling process.
.TP
.IR EINVAL
The described bus does not exist.
.PP
The
.BR bus_open(3)
function may also fail and set \fIerrno\fP to any of the errors
specified for the routine
.BR open(2).
.SH SEE ALSO
bus-create(1), bus(5), libbus(7), bus_open(3), bus_unlink(3), open(2)
.SH AUTHORS
Principal author, Mattias Andrée.  See the LICENSE file for the full
list of authors.
.SH LICENSE
MIT/X Consortium License.
.SH BUGS
Please report bugs to https://github.com/maandree/bus/issues