Add <limits.h> header

According to the UNIX standard, <pthread.h> does not include some
PTHREAD_* values which are included in <limits.h>. OpenZFS uses
some of these values in its code, and this might cause build failure on
systems that do not have these PTHREAD_* values in <pthread.h>

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Closes #14225
This commit is contained in:
Minsoo Choo 2022-11-28 16:24:17 -05:00 committed by GitHub
parent 077fd55e85
commit adf3b84fc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -28,6 +28,7 @@
#include <signal.h> #include <signal.h>
#include <errno.h> #include <errno.h>
#include <assert.h> #include <assert.h>
#include <limits.h>
#include "thread_pool_impl.h" #include "thread_pool_impl.h"
static pthread_mutex_t thread_pool_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t thread_pool_lock = PTHREAD_MUTEX_INITIALIZER;

View File

@ -31,6 +31,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <limits.h>
#include <libzutil.h> #include <libzutil.h>
#include <sys/crypto/icp.h> #include <sys/crypto/icp.h>
#include <sys/processor.h> #include <sys/processor.h>