]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/posix-eventfd: Give name to opened eventfds
authorAndrei Tatar <andrei@unikraft.io>
Wed, 25 Sep 2024 15:34:47 +0000 (17:34 +0200)
committerUnikraft Bot <monkey@unikraft.io>
Tue, 25 Feb 2025 07:58:01 +0000 (07:58 +0000)
This change names newly opened eventfds as "eventfd".

Signed-off-by: Andrei Tatar <andrei@unikraft.io>
Approved-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
GitHub-Closes: #1592

lib/posix-eventfd/eventfd.c

index ef97acfa2d3ddae0229aef22d453e4f543ee43b6..91825fbaa5a82c4d4b59849c2318a925a3ecd5d0 100644 (file)
@@ -21,6 +21,9 @@
 static const char EVENTFD_VOLID[] = "eventfd_vol";
 static const char EVENTFD_SEM_VOLID[] = "eventfd_semaphore_vol";
 
+#define EVENTFD_FNAME "eventfd"
+#define EVENTFD_FNAME_LEN (sizeof(EVENTFD_FNAME) - 1)
+
 #define _IS_EVFVOL(v) ((v) == EVENTFD_VOLID || (v) == EVENTFD_SEM_VOLID)
 
 typedef volatile uint64_t *evfd_node;
@@ -171,7 +174,7 @@ int uk_sys_eventfd(unsigned int count, int flags)
                mode |= O_NONBLOCK;
        if (flags & EFD_CLOEXEC)
                mode |= O_CLOEXEC;
-       ret = uk_fdtab_open(evf, mode);
+       ret = uk_fdtab_open_named(evf, mode, EVENTFD_FNAME, EVENTFD_FNAME_LEN);
        uk_file_release(evf);
        return ret;
 }