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

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-timerfd/timerfd.c

index e360c7fad85da8d392d83790976157f8dceed9a2..75f13f01c0ec35c54796eaa20a83b57ab027ec9d 100644 (file)
@@ -26,6 +26,8 @@
 
 static const char TIMERFD_VOLID[] = "timerfd_vol";
 
+#define TIMERFD_FNAME "timerfd"
+#define TIMERFD_FNAME_LEN (sizeof(TIMERFD_FNAME) - 1)
 
 struct timerfd_node {
        struct itimerspec set;
@@ -299,7 +301,8 @@ int uk_sys_timerfd_create(clockid_t id, int flags)
                mode |= O_NONBLOCK;
        if (flags & TFD_CLOEXEC)
                mode |= O_CLOEXEC;
-       ret = uk_fdtab_open(timerf, mode);
+       ret = uk_fdtab_open_named(timerf, mode, TIMERFD_FNAME,
+                                 TIMERFD_FNAME_LEN);
        uk_file_release(timerf);
        return ret;
 }