[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 5/6] tools/dm_depriv: Add first cut RLIMITs
[resending] On Fri, Oct 5, 2018 at 4:17 PM George Dunlap <george.dunlap@xxxxxxxxxx> wrote: > > On Mon, Sep 24, 2018 at 9:35 AM Paul Durrant <Paul.Durrant@xxxxxxxxxx> wrote: > > > + { > > > + .resource = -1 > > > > Is -1 guaranteed not to clash with any defined resource type? > > Hmm... well at the moment /usr/include/bits/resource.h seems to have > them defined as non-negative integers (i.e., starting at 0). But > there's nothing I can see which prevents a new one being defined as -1 > if someone in the Linux community decides to. The POSIX merely > defines this as a int, and I couldn't find anything which says it had > to be non-negative in the spec. > > Linux seems to define RLIMIT_NLIMITS as the total number of limits so > far defined; I'll use that instead. (That also sort of implies they > expect you to use that as an array sizer, and the various limits as > indexes into the array, and thus be non-negative; but whatever.) > > > > + > > > + /* Set various "easy" rlimits */ > > > + for (i=0; rlimits[i].resource != -1; i++) { > > > > Couldn't figure out whether this is a coding style violation or not but I > > think 'i=0' should be 'i = 0' > > Ack. > > -George _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |