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