Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: ulimit -a: -r vs -N [was Re: pkgsrc patches for zsh]



On Wed, Jun 25, 2014 at 11:33:35AM +0100, Peter Stephenson wrote:
> I've added compatibility with sh when NTHR is present and RTPRIO isn't
> --- which should be just about specific enough that the additional
> compatibility more than offsets any confusion.

Thanks, but this version doesn't compile since:
rlimits.c: In function 'printulimit':
rlimits.c:398:5: error: duplicate case value
     case RLIMIT_NTHR:
     ^
rlimits.c:379:5: error: previously used here
     case RLIMIT_PTHREAD:
     ^
*** Error code 1

> @@ -387,6 +392,14 @@ printulimit(char *nam, int lim, int hard, int head)
>  	if (head)
>  	    printf("-r: max rt priority                 ");
>  	break;
> +# else
> +#  ifdef HAVE_RLIMIT_NTHR
> +	/* For compatibility with sh on NetBSD */
> +    case RLIMIT_NTHR:
> +	if (head)
> +	    printf("-r: threads                         ");
> +	break;
> +#  endif /* HAVE_RLIMIT_NTHR */
>  # endif /* HAVE_RLIMIT_RTPRIO */
>  # ifdef HAVE_RLIMIT_NPTS
>      case RLIMIT_NPTS:

The #else here is for RTPRIO, so we have cases for RLIMIT_NTHR and
RLIMIT_PTHREAD in the same case statement.
 Thomas



Messages sorted by: Reverse Date, Date, Thread, Author