]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/udev_new.xml
Merge pull request #8417 from brauner/2018-03-09/add_bind_mount_fallback_to_private_d...
[thirdparty/systemd.git] / man / udev_new.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4 <!ENTITY % entities SYSTEM "custom-entities.ent" >
5 %entities;
6 ]>
7
8 <!--
9 SPDX-License-Identifier: LGPL-2.1+
10
11 This file is part of systemd.
12
13 Copyright 2015 David Herrmann <dh.herrmann@gmail.com>
14 -->
15
16 <refentry id="udev_new"
17 xmlns:xi="http://www.w3.org/2001/XInclude">
18
19 <refentryinfo>
20 <title>udev_new</title>
21 <productname>systemd</productname>
22
23 <authorgroup>
24 <author>
25 <contrib>Developer</contrib>
26 <firstname>David</firstname>
27 <surname>Herrmann</surname>
28 <email>dh.herrmann@gmail.com</email>
29 </author>
30 </authorgroup>
31 </refentryinfo>
32
33 <refmeta>
34 <refentrytitle>udev_new</refentrytitle>
35 <manvolnum>3</manvolnum>
36 </refmeta>
37
38 <refnamediv>
39 <refname>udev_new</refname>
40 <refname>udev_ref</refname>
41 <refname>udev_unref</refname>
42
43 <refpurpose>Create, acquire and release a udev context object</refpurpose>
44 </refnamediv>
45
46 <refsynopsisdiv>
47 <funcsynopsis>
48 <funcsynopsisinfo>#include &lt;libudev.h&gt;</funcsynopsisinfo>
49
50 <funcprototype>
51 <funcdef>struct udev *<function>udev_new</function></funcdef>
52 <paramdef><parameter>void</parameter></paramdef>
53 </funcprototype>
54
55 <funcprototype>
56 <funcdef>struct udev *<function>udev_ref</function></funcdef>
57 <paramdef>struct udev *<parameter>udev</parameter></paramdef>
58 </funcprototype>
59
60 <funcprototype>
61 <funcdef>struct udev *<function>udev_unref</function></funcdef>
62 <paramdef>struct udev *<parameter>udev</parameter></paramdef>
63 </funcprototype>
64
65 </funcsynopsis>
66 </refsynopsisdiv>
67
68 <refsect1>
69 <title>Description</title>
70
71 <para><function>udev_new()</function> allocates a new udev context
72 object and returns a pointer to it. This object is opaque and must
73 not be accessed by the caller via different means than functions
74 provided by libudev. Initially, the reference count of the context
75 is 1. You can acquire further references, and drop gained references
76 via <function>udev_ref()</function> and
77 <function>udev_unref()</function>. Once the reference count hits 0,
78 the context object is destroyed and freed.</para>
79 </refsect1>
80
81 <refsect1>
82 <title>Return Value</title>
83
84 <para>On success, <function>udev_new()</function> returns a pointer
85 to the allocated udev context. On failure, <constant>NULL</constant>
86 is returned. <function>udev_ref()</function> returns the argument
87 that it was passed, unmodified. <function>udev_unref()</function>
88 always returns <constant>NULL</constant>.</para>
89 </refsect1>
90
91 <refsect1>
92 <title>See Also</title>
93
94 <para>
95 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
96 </para>
97 </refsect1>
98
99 </refentry>