{
xen_sysctl_meminfo_t meminfo = { 0 };
- if ( ni->num_nodes < num_nodes )
- {
- ret = -ENOBUFS;
- i = num_nodes;
- }
- else
- i = 0;
-
- for ( ; i < num_nodes; i++ )
+ if ( num_nodes > ni->num_nodes )
+ num_nodes = ni->num_nodes;
+ for ( i = 0; i < num_nodes; ++i )
{
static uint32_t distance[MAX_NUMNODES];
else
i = num_nodes;
- if ( (!ret || (ret == -ENOBUFS)) && (ni->num_nodes != i) )
+ if ( !ret && (ni->num_nodes != i) )
{
ni->num_nodes = i;
if ( __copy_field_to_guest(u_sysctl, op,
* non-null)
*
* OUT:
- * - If 'num_nodes' is less than the number Xen needs to write, -ENOBUFS shall
- * be returned and 'num_nodes' updated to reflect the intended number.
- * - On success, 'num_nodes' shall indicate the number of entries written, which
- * may be less than the maximum.
+ * - If 'num_nodes' is less than the number Xen wants to write but either
+ * handle is not a NULL one, partial data gets returned and 'num_nodes'
+ * gets updated to reflect the intended number.
+ * - Otherwise, 'num_nodes' shall indicate the number of entries written, which
+ * may be less than the input value.
*/
struct xen_sysctl_numainfo {