summaryrefslogtreecommitdiff
path: root/components/libc
diff options
context:
space:
mode:
authorzmq810150896 <[email protected]>2023-12-06 13:51:13 +0800
committerGitHub <[email protected]>2023-12-06 13:51:13 +0800
commit2790ce5357bb52dcade2ee0add38e90b392a0a03 (patch)
treed127b280cd22ecec3a93285c7ea76fa7f9cc6db0 /components/libc
parent1b0dae2bb0c522941184f9d17bf54d65455c6ab4 (diff)
Updated issues related to uds capacity and eventfd macro redefinition (#8329)
Diffstat (limited to 'components/libc')
-rw-r--r--components/libc/posix/io/eventfd/eventfd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/components/libc/posix/io/eventfd/eventfd.c b/components/libc/posix/io/eventfd/eventfd.c
index ec3a88ba47..81e3a830ae 100644
--- a/components/libc/posix/io/eventfd/eventfd.c
+++ b/components/libc/posix/io/eventfd/eventfd.c
@@ -25,7 +25,7 @@
#define EFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK)
#define EFD_FLAGS_SET (EFD_SHARED_FCNTL_FLAGS | EFD_SEMAPHORE)
-#define ULLONG_MAX (~0ULL)
+#define EFD_ULLONG_MAX (~0ULL)
#define EVENTFD_MUTEX_NAME "eventfd"
@@ -84,10 +84,10 @@ static int eventfd_poll(struct dfs_file *file, struct rt_pollreq *req)
if (count > 0)
events |= POLLIN;
- if (count == ULLONG_MAX)
+ if (count == EFD_ULLONG_MAX)
events |= POLLERR;
- if ((ULLONG_MAX - 1) > count)
+ if ((EFD_ULLONG_MAX - 1) > count)
events |= POLLOUT;
return events;
@@ -161,14 +161,14 @@ static ssize_t eventfd_write(struct dfs_file *file, const void *buf, size_t coun
counter_num = *(rt_uint64_t *)buf;
- if (counter_num == ULLONG_MAX)
+ if (counter_num == EFD_ULLONG_MAX)
return -EINVAL;
ret = -EAGAIN;
rt_mutex_take(&ctx->lock, RT_WAITING_FOREVER);
- if ((ULLONG_MAX - ctx->count) > counter_num)
+ if ((EFD_ULLONG_MAX - ctx->count) > counter_num)
{
ret = sizeof(counter_num);
}
@@ -176,7 +176,7 @@ static ssize_t eventfd_write(struct dfs_file *file, const void *buf, size_t coun
{
for (;;)
{
- if ((ULLONG_MAX - ctx->count) >= counter_num)
+ if ((EFD_ULLONG_MAX - ctx->count) >= counter_num)
{
ret = sizeof(counter_num);
break;