Gentoo Archives: gentoo-commits

From: "Ned Ludd (solar)" <solar@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/uclibc/0.9.28.3: 60_all_uClibc-splice-tee.patch
Date: Sun, 04 May 2008 18:53:19
Message-Id: E1JsjKl-0004kh-Me@stork.gentoo.org
1 solar 08/05/04 18:53:15
2
3 Added: 60_all_uClibc-splice-tee.patch
4 Log:
5 [Bug 219598] [PATCH] sys-libs/uclibc-0.9.28.3 - backport of splice(2), tee(2) and vmsplice(2) syscalls
6
7 Revision Changes Path
8 1.1 src/patchsets/uclibc/0.9.28.3/60_all_uClibc-splice-tee.patch
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/uclibc/0.9.28.3/60_all_uClibc-splice-tee.patch?rev=1.1&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/uclibc/0.9.28.3/60_all_uClibc-splice-tee.patch?rev=1.1&content-type=text/plain
12
13 Index: 60_all_uClibc-splice-tee.patch
14 ===================================================================
15 diff -ruN uClibc-0.9.28.3.orig/libc/sysdeps/linux/common/splice.c uClibc-0.9.28.3/libc/sysdeps/linux/common/splice.c
16 --- uClibc-0.9.28.3.orig/libc/sysdeps/linux/common/splice.c 1970-01-01 00:00:00 +0000
17 +++ uClibc-0.9.28.3/libc/sysdeps/linux/common/splice.c 2008-04-28 14:27:39 +0000
18 @@ -0,0 +1,24 @@
19 +/* vi: set sw=4 ts=4: */
20 +/*
21 + * splice() for uClibc
22 + *
23 + * Copyright (C) 2000-2006 Erik Andersen <andersen@××××××.org>
24 + *
25 + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
26 + */
27 +
28 +#include <sys/syscall.h>
29 +#include <fcntl.h>
30 +
31 +#ifdef __NR_splice
32 +_syscall6(ssize_t, splice, int, __fdin, __off64_t *, __offin, int, __fdout,
33 + __off64_t *, __offout, size_t, __len, unsigned int, __flags);
34 +#else
35 +ssize_t splice(int __fdin, __off64_t *__offin, int __fdout,
36 + __off64_t *__offout, size_t __len, unsigned int __flags)
37 +{
38 + __set_errno(ENOSYS);
39 + return -1;
40 +}
41 +#endif
42 +
43 diff -ruN uClibc-0.9.28.3.orig/libc/sysdeps/linux/common/tee.c uClibc-0.9.28.3/libc/sysdeps/linux/common/tee.c
44 --- uClibc-0.9.28.3.orig/libc/sysdeps/linux/common/tee.c 1970-01-01 00:00:00 +0000
45 +++ uClibc-0.9.28.3/libc/sysdeps/linux/common/tee.c 2008-04-28 14:27:39 +0000
46 @@ -0,0 +1,23 @@
47 +/* vi: set sw=4 ts=4: */
48 +/*
49 + * tee() for uClibc
50 + *
51 + * Copyright (C) 2000-2006 Erik Andersen <andersen@××××××.org>
52 + *
53 + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
54 + */
55 +
56 +#include <sys/syscall.h>
57 +#include <fcntl.h>
58 +
59 +#ifdef __NR_tee
60 +_syscall4(ssize_t, tee, int, __fdin, int, __fdout, size_t, __len,
61 + unsigned int, __flags);
62 +#else
63 +ssize_t tee(int __fdin, int __fdout, size_t __len, unsigned int __flags)
64 +{
65 + __set_errno(ENOSYS);
66 + return -1;
67 +}
68 +#endif
69 +
70 diff -ruN uClibc-0.9.28.3.orig/libc/sysdeps/linux/common/vmsplice.c uClibc-0.9.28.3/libc/sysdeps/linux/common/vmsplice.c
71 --- uClibc-0.9.28.3.orig/libc/sysdeps/linux/common/vmsplice.c 1970-01-01 00:00:00 +0000
72 +++ uClibc-0.9.28.3/libc/sysdeps/linux/common/vmsplice.c 2008-04-28 14:27:39 +0000
73 @@ -0,0 +1,24 @@
74 +/* vi: set sw=4 ts=4: */
75 +/*
76 + * vmsplice() for uClibc
77 + *
78 + * Copyright (C) 2000-2006 Erik Andersen <andersen@××××××.org>
79 + *
80 + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
81 + */
82 +
83 +#include <sys/syscall.h>
84 +#include <fcntl.h>
85 +
86 +#ifdef __NR_vmsplice
87 +_syscall4(ssize_t, vmsplice, int, __fdout, const struct iovec *, __iov,
88 + size_t, __count, unsigned int, __flags);
89 +#else
90 +ssize_t vmsplice(int __fdout, const struct iovec *__iov, size_t __count,
91 + unsigned int __flags)
92 +{
93 + __set_errno(ENOSYS);
94 + return -1;
95 +}
96 +#endif
97 +
98 --- uClibc-0.9.28.3.orig/libc/sysdeps/linux/i386/bits/fcntl.h 2008-04-28 14:27:25 +0000
99 +++ uClibc-0.9.28.3/libc/sysdeps/linux/i386/bits/fcntl.h 2008-04-28 14:35:36 +0000
100 @@ -1,5 +1,5 @@
101 /* O_*, F_*, FD_* bit values for Linux.
102 - Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
103 + Copyright (C) 1995, 1996, 1997, 1998, 2000, 2008 Free Software Foundation, Inc.
104 This file is part of the GNU C Library.
105
106 The GNU C Library is free software; you can redistribute it and/or
107 @@ -46,6 +46,7 @@
108 # define O_DIRECTORY 0200000 /* Must be a directory. */
109 # define O_NOFOLLOW 0400000 /* Do not follow links. */
110 # define O_STREAMING 04000000/* streaming access */
111 +# define O_CLOEXEC 02000000 /* Set close_on_exec. */
112 #endif
113
114 /* For now Linux has synchronisity options for data and read operations.
115 @@ -93,9 +94,11 @@
116 # define F_SETLEASE 1024 /* Set a lease. */
117 # define F_GETLEASE 1025 /* Enquire what lease is active. */
118 # define F_NOTIFY 1026 /* Request notfications on a directory. */
119 +# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
120 + close-on-exit set. */
121 #endif
122
123 -/* For F_[GET|SET]FL. */
124 +/* For F_[GET|SET]FD. */
125 #define FD_CLOEXEC 1 /* actually anything with low bit set goes */
126
127 /* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
128 @@ -178,3 +181,25 @@
129 # define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
130 # define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
131 #endif
132 +
133 +#ifdef __USE_GNU
134 +
135 +/* Flags for SPLICE and VMSPLICE. */
136 +# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
137 +# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
138 + (but we may still block on the fd
139 + we splice from/to). */
140 +# define SPLICE_F_MORE 4 /* Expect more data. */
141 +# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
142 +
143 +extern size_t vmsplice (int __fdout, const struct iovec *__iov,
144 + size_t __count, unsigned int __flags);
145 +
146 +extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
147 + __off64_t *__offout, size_t __len,
148 + unsigned int __flags);
149 +
150 +extern ssize_t tee (int __fdin, int __fdout, size_t __len,
151 + unsigned int __flags);
152 +
153 +#endif
154
155
156
157 --
158 gentoo-commits@l.g.o mailing list