Merge "Avoid usage of LONG_BIT in signal headers." am: 2b64e4000d am: e3893280a4

Original change: https://android-review.googlesource.com/c/platform/bionic/+/2038949

Change-Id: I6b7a6370fd0957aa26f887c989c40a31d06db937
Signed-off-by: Automerger Merge Worker
This commit is contained in:
Treehugger Robot 2022-03-24 21:40:34 +00:00 committed by Automerger Merge Worker
commit 8766e86c78
2 changed files with 4 additions and 4 deletions

View file

@ -89,7 +89,7 @@ static __inline int sigismember(const sigset_t *set, int signum) {
errno = EINVAL;
return -1;
}
return (int)((local_set[bit / LONG_BIT] >> (bit % LONG_BIT)) & 1);
return (int)((local_set[bit / (8 * sizeof(long))] >> (bit % (8 * sizeof(long)))) & 1);
}
static __inline int sigaddset(sigset_t *set, int signum) {
@ -100,7 +100,7 @@ static __inline int sigaddset(sigset_t *set, int signum) {
errno = EINVAL;
return -1;
}
local_set[bit / LONG_BIT] |= 1UL << (bit % LONG_BIT);
local_set[bit / (8 * sizeof(long))] |= 1UL << (bit % (8 * sizeof(long)));
return 0;
}
@ -112,7 +112,7 @@ static __inline int sigdelset(sigset_t *set, int signum) {
errno = EINVAL;
return -1;
}
local_set[bit / LONG_BIT] &= ~(1UL << (bit % LONG_BIT));
local_set[bit / (8 * sizeof(long))] &= ~(1UL << (bit % (8 * sizeof(long))));
return 0;
}

View file

@ -61,7 +61,7 @@ typedef __sighandler_t sighandler_t; /* glibc compatibility. */
#if defined(__LP64__)
typedef sigset_t sigset64_t;
#else
typedef struct { unsigned long __bits[_KERNEL__NSIG/LONG_BIT]; } sigset64_t;
typedef struct { unsigned long __bits[_KERNEL__NSIG/(8*sizeof(long))]; } sigset64_t;
#endif
#if defined(__LP64__)