This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 3/3] Linux: Port fexecve to <fd_to_filename.h>


---
 sysdeps/unix/sysv/linux/fexecve.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/fexecve.c b/sysdeps/unix/sysv/linux/fexecve.c
index 23c9799f5d..d8cf924faf 100644
--- a/sysdeps/unix/sysv/linux/fexecve.c
+++ b/sysdeps/unix/sysv/linux/fexecve.c
@@ -25,6 +25,7 @@
 #include <sysdep.h>
 #include <sys/syscall.h>
 #include <kernel-features.h>
+#include <fd_to_filename.h>
 
 
 /* Execute the file FD refers to, overlaying the running program image.
@@ -50,11 +51,10 @@ fexecve (int fd, char *const argv[], char *const envp[])
 #ifndef __ASSUME_EXECVEAT
   /* We use the /proc filesystem to get the information.  If it is not
      mounted we fail.  */
-  char buf[sizeof "/proc/self/fd/" + sizeof (int) * 3];
-  __snprintf (buf, sizeof (buf), "/proc/self/fd/%d", fd);
+  struct fd_to_filename storage;
 
   /* We do not need the return value.  */
-  __execve (buf, argv, envp);
+  __execve (__fd_to_filename (fd, &storage), argv, envp);
 
   int save = errno;
 
-- 
2.24.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]