[PATCH 5/5] add the simple 'adjtimex' syscall
Tito
farmatito at tiscali.it
Tue Jun 5 06:13:10 UTC 2012
On Monday 04 June 2012 22:24:36 Tias Guns wrote:
> patch modified from 'no-sys-timex' from Dan Drown
> http://dan.drown.org/android/src/busybox/
>
> Signed-off-by: Tias Guns <tias at ulyssis.org>
> ---
> libbb/Kbuild.src | 1 +
> libbb/adjtimex.c | 7 +++++++
> 2 files changed, 8 insertions(+)
> create mode 100644 libbb/adjtimex.c
>
> diff --git a/libbb/Kbuild.src b/libbb/Kbuild.src
> index 4ebdcf7..b30bec8 100644
> --- a/libbb/Kbuild.src
> +++ b/libbb/Kbuild.src
> @@ -194,3 +194,4 @@ lib-$(CONFIG_DATE) += stime.o
> lib-$(CONFIG_RDATE) += stime.o
> lib-$(CONFIG_PIVOT_ROOT) += pivot_root.o
> lib-$(CONFIG_HOSTNAME) += sethostname.o
> +lib-$(CONFIG_ADJTIMEX) += adjtimex.o
> diff --git a/libbb/adjtimex.c b/libbb/adjtimex.c
> new file mode 100644
> index 0000000..140e4ec
> --- /dev/null
> +++ b/libbb/adjtimex.c
> @@ -0,0 +1,7 @@
> +#include <time.h>
> +#include <linux/timex.h>
> +#include <sys/syscall.h>
> +
> +int adjtimex(struct timex *buf) {
> + return syscall(__NR_adjtimex, buf);
> +}
>
Hi,
I think that in Kbuild.src you have to add some ifdefs
to compile this functions only for android e.g.
#ifdef ANDROID
> # for android-busybox-ndk
> lib-y += getsid.o
> lib-$(CONFIG_RDATE) += stime.o
> lib-$(CONFIG_PIVOT_ROOT) += pivot_root.o
> lib-$(CONFIG_HOSTNAME) += sethostname.o
> +lib-$(CONFIG_ADJTIMEX) += adjtimex.o
#endif
Ciao,
Tito
More information about the busybox
mailing list