svn commit: trunk/uClibc/libc/sysdeps/linux: common i386/bits
aldot at uclibc.org
aldot at uclibc.org
Fri May 2 07:18:29 UTC 2008
Author: aldot
Date: 2008-05-02 00:18:29 -0700 (Fri, 02 May 2008)
New Revision: 21916
Log:
- add vmsplice, splice, tee (Timo Ter?\195?\164s)
- pull bits/fcntl.h from glibc (Timo Ter?\195?\164s)
Added:
trunk/uClibc/libc/sysdeps/linux/common/splice.c
trunk/uClibc/libc/sysdeps/linux/common/tee.c
trunk/uClibc/libc/sysdeps/linux/common/vmsplice.c
Modified:
trunk/uClibc/libc/sysdeps/linux/i386/bits/fcntl.h
Changeset:
Added: trunk/uClibc/libc/sysdeps/linux/common/splice.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/splice.c (rev 0)
+++ trunk/uClibc/libc/sysdeps/linux/common/splice.c 2008-05-02 07:18:29 UTC (rev 21916)
@@ -0,0 +1,28 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * splice() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen at uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <fcntl.h>
+
+libc_hidden_proto(splice)
+
+#ifdef __NR_splice
+_syscall6(ssize_t, splice, int, __fdin, __off64_t *, __offin, int, __fdout,
+ __off64_t *, __offout, size_t, __len, unsigned int, __flags);
+#else
+ssize_t splice(int __fdin, __off64_t *__offin, int __fdout,
+ __off64_t *__offout, size_t __len, unsigned int __flags)
+{
+ __set_errno(ENOSYS);
+ return -1;
+}
+#endif
+
+libc_hidden_def(splice)
+
Added: trunk/uClibc/libc/sysdeps/linux/common/tee.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/tee.c (rev 0)
+++ trunk/uClibc/libc/sysdeps/linux/common/tee.c 2008-05-02 07:18:29 UTC (rev 21916)
@@ -0,0 +1,28 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * tee() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen at uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <fcntl.h>
+
+libc_hidden_proto(tee)
+
+#ifdef __NR_tee
+_syscall4(ssize_t, tee, int, __fdin, int, __fdout, size_t, __len,
+ unsigned int, __flags);
+#else
+ssize_t tee(int __fdin, int __fdout, size_t __len, unsigned int __flags)
+{
+ __set_errno(ENOSYS);
+ return -1;
+}
+#endif
+
+libc_hidden_def(tee)
+
+
Added: trunk/uClibc/libc/sysdeps/linux/common/vmsplice.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/vmsplice.c (rev 0)
+++ trunk/uClibc/libc/sysdeps/linux/common/vmsplice.c 2008-05-02 07:18:29 UTC (rev 21916)
@@ -0,0 +1,28 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * vmsplice() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen at uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <fcntl.h>
+
+libc_hidden_proto(vmsplice)
+
+#ifdef __NR_vmsplice
+_syscall4(ssize_t, vmsplice, int, __fdout, const struct iovec *, __iov,
+ size_t, __count, unsigned int, __flags);
+#else
+ssize_t vmsplice(int __fdout, const struct iovec *__iov, size_t __count,
+ unsigned int __flags)
+{
+ __set_errno(ENOSYS);
+ return -1;
+}
+#endif
+
+libc_hidden_def(vmsplice)
+
Modified: trunk/uClibc/libc/sysdeps/linux/i386/bits/fcntl.h
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/i386/bits/fcntl.h 2008-05-01 19:33:44 UTC (rev 21915)
+++ trunk/uClibc/libc/sysdeps/linux/i386/bits/fcntl.h 2008-05-02 07:18:29 UTC (rev 21916)
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006
+ Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -50,6 +50,7 @@
# define O_DIRECTORY 0200000 /* Must be a directory. */
# define O_NOFOLLOW 0400000 /* Do not follow links. */
# define O_NOATIME 01000000 /* Do not set atime. */
+# define O_CLOEXEC 02000000 /* Set close_on_exec. */
#endif
/* For now Linux has synchronisity options for data and read operations.
@@ -97,9 +98,11 @@
# define F_SETLEASE 1024 /* Set a lease. */
# define F_GETLEASE 1025 /* Enquire what lease is active. */
# define F_NOTIFY 1026 /* Request notfications on a directory. */
+# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
+ close-on-exit set. */
#endif
-/* For F_[GET|SET]FL. */
+/* For F_[GET|SET]FD. */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
@@ -185,6 +188,7 @@
#ifdef __USE_GNU
+/* Flags for SYNC_FILE_RANGE. */
# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
in the range before performing the
write. */
@@ -194,6 +198,14 @@
# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
the range after performing the
write. */
+
+/* Flags for SPLICE and VMSPLICE. */
+# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
+# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
+ (but we may still block on the fd
+ we splice from/to). */
+# define SPLICE_F_MORE 4 /* Expect more data. */
+# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
#endif
__BEGIN_DECLS
@@ -209,20 +221,20 @@
/* Selective file content synch'ing. */
extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
unsigned int __flags);
+#endif
-
/* Splice address range into a pipe. */
-extern int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
- unsigned int __flags);
+extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
+ size_t __count, unsigned int __flags);
/* Splice two files together. */
-extern int splice (int __fdin, int __fdout, size_t __len, unsigned int __flags)
- __THROW;
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+ __off64_t *__offout, size_t __len,
+ unsigned int __flags);
/* In-kernel implementation of tee for pipe buffers. */
-extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
- __THROW;
-#endif
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+ unsigned int __flags);
#endif
More information about the uClibc-cvs
mailing list