From 2790ce5357bb52dcade2ee0add38e90b392a0a03 Mon Sep 17 00:00:00 2001 From: zmq810150896 <50894086+zmq810150896@users.noreply.github.com> Date: Wed, 6 Dec 2023 13:51:13 +0800 Subject: Updated issues related to uds capacity and eventfd macro redefinition (#8329) --- components/libc/posix/io/eventfd/eventfd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'components/libc') 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; -- cgit v1.3.1