[PATCH 2/5] add the simple 'stime' syscall, fixes date and rdate

Tias Guns tias at ulyssis.org
Mon Jun 4 20:24:33 UTC 2012


patch modified from 'misc-syscalls' by Dan Drown:
http://dan.drown.org/android/src/busybox/

Signed-off-by: Tias Guns <tias at ulyssis.org>
---
 libbb/Kbuild.src |    2 ++
 libbb/stime.c    |   10 ++++++++++
 2 files changed, 12 insertions(+)
 create mode 100644 libbb/stime.c

diff --git a/libbb/Kbuild.src b/libbb/Kbuild.src
index 98031f4..1435145 100644
--- a/libbb/Kbuild.src
+++ b/libbb/Kbuild.src
@@ -190,3 +190,5 @@ lib-$(CONFIG_FEATURE_FIND_REGEX) += xregcomp.o
 
 # for android-busybox-ndk
 lib-y += getsid.o
+lib-$(CONFIG_DATE) += stime.o
+lib-$(CONFIG_RDATE) += stime.o
diff --git a/libbb/stime.c b/libbb/stime.c
new file mode 100644
index 0000000..04a4e8b
--- /dev/null
+++ b/libbb/stime.c
@@ -0,0 +1,10 @@
+#include <time.h>
+#include <sys/time.h>
+
+int stime(const time_t *t) {
+  struct timeval tv;
+
+  tv.tv_sec = *t;
+  tv.tv_usec = 0;
+  return settimeofday(&tv, NULL);
+}
-- 
1.7.10



More information about the busybox mailing list