xref: /xnu-10002.61.3/osfmk/man/ledger_create.html (revision 0f4c859e951fba394238ab619495c4e1d54d0f34)
1*0f4c859eSApple OSS Distributions<h2>ledger_create</h2>
2*0f4c859eSApple OSS Distributions<hr>
3*0f4c859eSApple OSS Distributions<p>
4*0f4c859eSApple OSS Distributions<strong>Function</strong> - Create a subordinate ledger.
5*0f4c859eSApple OSS Distributions<h3>SYNOPSIS</h3>
6*0f4c859eSApple OSS Distributions<pre>
7*0f4c859eSApple OSS Distributions<strong>kern_return_t   ledger_create</strong>
8*0f4c859eSApple OSS Distributions                <strong>(ledger_port_t</strong>                    <var>parent_ledger</var>,
9*0f4c859eSApple OSS Distributions                 <strong>ledger_port_t</strong>                    <var>ledger_ledger</var>,
10*0f4c859eSApple OSS Distributions                 <strong>ledger_port_t</strong>                     <var>child_ledger</var>,
11*0f4c859eSApple OSS Distributions                 <strong>ledger_item_t</strong>                         <var>transfer</var><strong>);</strong>
12*0f4c859eSApple OSS Distributions</pre>
13*0f4c859eSApple OSS Distributions<h3>PARAMETERS</h3>
14*0f4c859eSApple OSS Distributions<dl>
15*0f4c859eSApple OSS Distributions<p>
16*0f4c859eSApple OSS Distributions<dt> <var>parent_ledger</var>
17*0f4c859eSApple OSS Distributions<dd>
18*0f4c859eSApple OSS Distributions[in ledger send right]
19*0f4c859eSApple OSS DistributionsThe parent ledger.
20*0f4c859eSApple OSS Distributions<p>
21*0f4c859eSApple OSS Distributions<dt> <var>ledger_ledger</var>
22*0f4c859eSApple OSS Distributions<dd>
23*0f4c859eSApple OSS Distributions[in ledger send right]
24*0f4c859eSApple OSS DistributionsThe wired kernel memory ledger providing the
25*0f4c859eSApple OSS Distributionsspace from which the ledger itself is drawn.
26*0f4c859eSApple OSS Distributions<p>
27*0f4c859eSApple OSS Distributions<dt> <var>child_ledger</var>
28*0f4c859eSApple OSS Distributions<dd>
29*0f4c859eSApple OSS Distributions[out ledger send right]
30*0f4c859eSApple OSS DistributionsThe new child ledger, of the same resource type
31*0f4c859eSApple OSS Distributionsas the parent ledger.
32*0f4c859eSApple OSS Distributions<p>
33*0f4c859eSApple OSS Distributions<dt> <var>transfer</var>
34*0f4c859eSApple OSS Distributions<dd>
35*0f4c859eSApple OSS Distributions[in scalar]
36*0f4c859eSApple OSS DistributionsThe resource amount to transfer to the new ledger.
37*0f4c859eSApple OSS Distributions</dl>
38*0f4c859eSApple OSS Distributions<h3>DESCRIPTION</h3>
39*0f4c859eSApple OSS Distributions<p>
40*0f4c859eSApple OSS DistributionsThe <strong>ledger_create</strong> function creates a subordinate ledger.
41*0f4c859eSApple OSS DistributionsResource limits can be
42*0f4c859eSApple OSS Distributionstransferred from the parent ledger.  The child ledger itself
43*0f4c859eSApple OSS Distributionsis accounted against
44*0f4c859eSApple OSS Distributionsthe <var>ledger_ledger</var>.  A new ledger inherits the remote service port.
45*0f4c859eSApple OSS Distributions<h3>NOTES</h3>
46*0f4c859eSApple OSS Distributions<p>
47*0f4c859eSApple OSS DistributionsThis interface is not implemented in OSF/1 R1.3.
48*0f4c859eSApple OSS Distributions<p>
49*0f4c859eSApple OSS DistributionsA ledger limit of <strong>LEDGER_ITEM_INFINITE</strong> allows any amount (even
50*0f4c859eSApple OSS Distributionsinfinity) to be withdrawn.  The root ledger has such a limit.
51*0f4c859eSApple OSS Distributions<h3>RETURN VALUES</h3>
52*0f4c859eSApple OSS Distributions<dl>
53*0f4c859eSApple OSS Distributions<p>
54*0f4c859eSApple OSS Distributions<dt> <strong>KERN_RESOURCE_SHORTAGE</strong>
55*0f4c859eSApple OSS Distributions<dd>
56*0f4c859eSApple OSS DistributionsTransferring the resources would cause the parent ledger to exceed its
57*0f4c859eSApple OSS Distributionslimits.
58*0f4c859eSApple OSS Distributions<p>
59*0f4c859eSApple OSS Distributions<dt> <strong>KERN_INVALID_LEDGER</strong>
60*0f4c859eSApple OSS Distributions<dd>
61*0f4c859eSApple OSS Distributions<var>ledger_ledger</var> is not a wired kernel memory ledger.
62*0f4c859eSApple OSS Distributions</dl>
63*0f4c859eSApple OSS Distributions<h3>RELATED INFORMATION</h3>
64*0f4c859eSApple OSS Distributions<p>
65*0f4c859eSApple OSS DistributionsFunctions:
66*0f4c859eSApple OSS Distributions<a href="ledger_transfer.html"><strong>ledger_transfer</strong></a>,
67*0f4c859eSApple OSS Distributions<a href="ledger_terminate.html"><strong>ledger_terminate</strong></a>,
68*0f4c859eSApple OSS Distributions<a href="ledger_read.html"><strong>ledger_read</strong></a>,
69*0f4c859eSApple OSS Distributions<a href="ledger_set_remote.html"><strong>ledger_set_remote</strong></a>.
70