summaryrefslogtreecommitdiffstats
path: root/upstream/fedora-rawhide/man3/udev_new.3
blob: 1e67a77d34a161d0a53a3fce591431542d5d81fb (plain)
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
56
57
58
59
60
61
62
63
64
'\" t
.TH "UDEV_NEW" "3" "" "systemd 255" "udev_new"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
udev_new, udev_ref, udev_unref \- Create, acquire and release a udev context object
.SH "SYNOPSIS"
.sp
.ft B
.nf
#include <libudev\&.h>
.fi
.ft
.HP \w'struct\ udev\ *udev_new('u
.BI "struct udev *udev_new(" "void" ");"
.HP \w'struct\ udev\ *udev_ref('u
.BI "struct udev *udev_ref(struct\ udev\ *" "udev" ");"
.HP \w'struct\ udev\ *udev_unref('u
.BI "struct udev *udev_unref(struct\ udev\ *" "udev" ");"
.SH "DESCRIPTION"
.PP
\fBudev_new()\fR
allocates a new udev context object and returns a pointer to it\&. This object is opaque and must not be accessed by the caller via different means than functions provided by libudev\&. Initially, the reference count of the context is 1\&. You can acquire further references, and drop gained references via
\fBudev_ref()\fR
and
\fBudev_unref()\fR\&. Once the reference count hits 0, the context object is destroyed and freed\&.
.SH "RETURN VALUE"
.PP
On success,
\fBudev_new()\fR
returns a pointer to the allocated udev context\&. On failure,
\fBNULL\fR
is returned\&.
\fBudev_ref()\fR
returns the argument that it was passed, unmodified\&.
\fBudev_unref()\fR
always returns
\fBNULL\fR\&.
.SH "HISTORY"
.PP
\fBudev_new()\fR,
\fBudev_ref()\fR, and
\fBudev_unref()\fR
were added in version 221\&.
.SH "SEE ALSO"
.PP
\fBsystemd\fR(1),