Debian Codegraph @

upstream/mageia-cauldron/man3/udev_new.3

raw
1 '\" t
2 .TH "UDEV_NEW" "3" "" "systemd 258.7" "udev_new"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 udev_new, udev_ref, udev_unref \- Create, acquire and release a udev context object
24 .SH "SYNOPSIS"
25 .sp
26 .ft B
27 .nf
28 #include <libudev\&.h>
29 .fi
30 .ft
31 .HP \w'struct\ udev\ *udev_new('u
32 .BI "struct udev *udev_new(" "void" ");"
33 .HP \w'struct\ udev\ *udev_ref('u
34 .BI "struct udev *udev_ref(struct\ udev\ *" "udev" ");"
35 .HP \w'struct\ udev\ *udev_unref('u
36 .BI "struct udev *udev_unref(struct\ udev\ *" "udev" ");"
37 .SH "DESCRIPTION"
38 .PP
39 \fBudev_new()\fR
40 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
41 \fBudev_ref()\fR
42 and
43 \fBudev_unref()\fR\&. Once the reference count hits 0, the context object is destroyed and freed\&.
44 .SH "RETURN VALUE"
45 .PP
46 On success,
47 \fBudev_new()\fR
48 returns a pointer to the allocated udev context\&. On failure,
49 \fBNULL\fR
50 is returned\&.
51 \fBudev_ref()\fR
52 returns the argument that it was passed, unmodified\&.
53 \fBudev_unref()\fR
54 always returns
55 \fBNULL\fR\&.
56 .SH "HISTORY"
57 .PP
58 \fBudev_new()\fR,
59 \fBudev_ref()\fR, and
60 \fBudev_unref()\fR
61 were added in version 221\&.
62 .SH "SEE ALSO"
63 .PP
64 \fBsystemd\fR(1), \fBsystemd-udevd.service\fR(8)