[PATCH] support kernels without __ARCH_WANT_SYSCALL_NO_FLAGS

Mike Frysinger vapier at gentoo.org
Fri Apr 27 03:37:13 UTC 2012


On Thursday 26 April 2012 10:18:11 Mark Salter wrote:
> --- a/libc/sysdeps/linux/common/dup2.c
> +++ b/libc/sysdeps/linux/common/dup2.c
> 
> +#ifdef __NR_dup2
>  _syscall2(int, dup2, int, oldfd, int, newfd)
> +#elif defined __NR_dup3
> +#include <fcntl.h>

don't conditionalize the include ... just put it at the top and be done

> +int
> +dup2 (int fd, int fd2)

drop the space and one line it:
int dup2(int fd, in fd2)

> --- a/libc/sysdeps/linux/common/pipe.c
> +++ b/libc/sysdeps/linux/common/pipe.c
> 
> +#if defined(__NR_pipe)
>  _syscall1(int, pipe, int *, filedes)
> +#elif defined(__NR_pipe2)
> +#define __NR___syscall_pipe2 __NR_pipe2
> +static __inline__ _syscall2(int, __syscall_pipe2, int *, filedes,
> +		int, flag)
> +int pipe(int filedes[2])
> +{
> +	return __syscall_pipe2(filedes, 0);
> +}

use INLINE_SYSCALL()
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/uclibc/attachments/20120426/3868f88f/attachment.asc>


More information about the uClibc mailing list