[RFC/PATCH 07/10] libbb: add syncfs() support for uClibc

Ari Sundholm ari at tuxera.com
Fri Aug 14 12:49:50 UTC 2015


Hi!

On Thu, 2015-08-13 at 15:57 +0200, Bartosz Golaszewski wrote:
> Currently uClibc declares but doesn't define syncfs(). In versions <= 0.9.33
> it's not even declared in unistd.h. This makes it impossible to compile sync
> with CONFIG_FEATURE_SYNC_FANCY on uClibc.
> 
> Add support for this system call to missing_syscalls.h.
> 

This is very welcome and something I should have included in my sync
changes originally. IIRC, I don't think Android's Bionic libc has a
wrapper for syncfs either?

Please also see my comment to patch 06/10.

Best regards,
Ari Sundholm
ari at tuxera.com

> Signed-off-by: Bartosz Golaszewski <bartekgola at gmail.com>
> ---
>  coreutils/sync.c           | 3 +++
>  include/missing_syscalls.h | 7 +++++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/coreutils/sync.c b/coreutils/sync.c
> index 974e904..7615620 100644
> --- a/coreutils/sync.c
> +++ b/coreutils/sync.c
> @@ -38,6 +38,9 @@
>  //usage:    )
>  
>  #include "libbb.h"
> +#ifdef __UCLIBC__
> +#include "missing_syscalls.h"
> +#endif
>  
>  /* This is a NOFORK applet. Be very careful! */
>  
> diff --git a/include/missing_syscalls.h b/include/missing_syscalls.h
> index 080bb28..ca8617c 100644
> --- a/include/missing_syscalls.h
> +++ b/include/missing_syscalls.h
> @@ -42,6 +42,13 @@ static ALWAYS_INLINE int fanotify_mark(int fanotify_fd, unsigned flags,
>  		       __SYSCALL_LONG_LONG_ARG(mask), dfd, pathname);
>  }
>  
> +/* uClibc declares syncfs, but doesn't define it */
> +
> +static ALWAYS_INLINE int syncfs(int fd)
> +{
> +	return syscall(SYS_syncfs, fd);
> +}
> +
>  #endif /* __UCLIBC__ && __linux__ */
>  
>  #endif /* __BB_MISSING_SYSCALLS_H */




More information about the busybox mailing list