• R/O
  • HTTP
  • SSH
  • HTTPS

uclibc-ng: Commit


Commit MetaInfo

Revision162e01e2e7b2b80711ea4701444f083732861ecf (tree)
Time2016-01-04 21:47:29
AuthorYoshinori Sato <ysato@user...>
CommiterYoshinori Sato

Log Message

openat argument fix.

If argument passing to register case (ex. -mregparam=3).
This case set all parameters set to register from caller.
But callee refer to stack. So can't get parameter.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>

Change Summary

Incremental Difference

--- a/libc/sysdeps/linux/common/openat.c
+++ b/libc/sysdeps/linux/common/openat.c
@@ -8,11 +8,24 @@
88
99 #include <sys/syscall.h>
1010 #include <fcntl.h>
11+#include <stdarg.h>
1112
1213 #ifdef __NR_openat
1314 # define __NR___syscall_openat __NR_openat
1415 static __inline__ _syscall4(int, __syscall_openat, int, fd, const char *, file, int, oflag, mode_t, mode)
15-strong_alias_untyped(__syscall_openat,openat)
16+
17+int __openat(int fd, const char *file, int o_flag, ...)
18+{
19+ va_list ap;
20+ mode_t mode;
21+
22+ va_start(ap, o_flag);
23+ mode = va_arg(ap, int);
24+ va_end(ap);
25+ return __syscall_openat(fd, file, o_flag, mode);
26+}
27+
28+strong_alias_untyped(__openat,openat)
1629 libc_hidden_def(openat)
1730 #else
1831 /* should add emulation with open() and /proc/self/fd/ ... */
Show on old repository browser