mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Isaac Dunham <idunham@lavabit.com>
To: musl@lists.openwall.com
Subject: Re: [PATCH 2/10] splice
Date: Sun, 22 Jul 2012 18:17:31 -0700	[thread overview]
Message-ID: <20120722181731.051d67d5@newbook> (raw)
In-Reply-To: <20120722181332.191d4fa5@newbook>

[-- Attachment #1: Type: text/plain, Size: 178 bytes --]

This adds a syscall wrapper for splice. 
I trusted git apply too much, so there are two parts to this patch:
one to add the syscall, one to fix the header back up...
Isaac Dunham

[-- Attachment #2: 2-splice.diff --]
[-- Type: text/x-patch, Size: 991 bytes --]

diff --git a/include/fcntl.h b/include/fcntl.h
index fcb622a..b014662 100644
--- a/include/fcntl.h
+++ b/include/fcntl.h
@@ -9,6 +9,11 @@ extern "C" {
 #define __NEED_pid_t
 #define __NEED_mode_t
 
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+#define __NEED_size_t
+#define __NEED_ssize_t
+#endif
+
 #include <bits/alltypes.h>
 
 #include <bits/fcntl.h>
@@ -97,6 +102,7 @@ int posix_fallocate(int, off_t, off_t);
 #define F_TEST  3
 
 int lockf(int, int, off_t);
+ssize_t splice(int, off_t, int, off_t, size_t, unsigned int);
 #endif
 
 #if defined(_GNU_SOURCE)
diff --git a/src/linux/splice.c b/src/linux/splice.c
new file mode 100644
index 0000000..63e4593
--- /dev/null
+++ b/src/linux/splice.c
@@ -0,0 +1,9 @@
+#define _GNU_SOURCE
+#include <fcntl.h>
+#include <sys/types.h>
+#include "syscall.h"
+
+ssize_t splice(int fd_in, off_t *off_in, int fd_out, off_t *off_out, size_t len, unsigned int flags)
+{
+	return syscall(SYS_splice, fd_in, off_in, fd_out, off_out, len, flags);
+}

[-- Attachment #3: 2.5-splice.diff --]
[-- Type: text/x-patch, Size: 616 bytes --]

diff --git a/include/fcntl.h b/include/fcntl.h
index b014662..27ca147 100644
--- a/include/fcntl.h
+++ b/include/fcntl.h
@@ -9,7 +9,7 @@ extern "C" {
 #define __NEED_pid_t
 #define __NEED_mode_t
 
+#ifdef _GNU_SOURCE
+#define __NEED_size_t
 #define __NEED_ssize_t
 #endif
@@ -102,10 +102,10 @@ int posix_fallocate(int, off_t, off_t);
 #define F_TEST  3
 
 int lockf(int, int, off_t);
-ssize_t splice(int, off_t, int, off_t, size_t, unsigned int);
 #endif
 
 #if defined(_GNU_SOURCE)
+ssize_t splice(int, off_t, int, off_t, size_t, unsigned int);
 #define F_OWNER_TID 0
 #define F_OWNER_PID 1
 #define F_OWNER_PGRP 2

  reply	other threads:[~2012-07-23  1:17 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-23  1:13 [PATCH 1/10] ioperm & iopl Isaac Dunham
2012-07-23  1:17 ` Isaac Dunham [this message]
2012-07-23  1:21 ` [PATCH 3/10] xattr syscalls Isaac Dunham
2012-07-24 18:06   ` orc
2012-07-23  1:24 ` [PATCH 4/10] pipe2 Isaac Dunham
2012-07-23  1:28 ` [PATCH 5/10] __sigsetjmp alias Isaac Dunham
2012-07-23  1:32 ` [PATCH 6/10] Provide private versions of locale/ functions Isaac Dunham
2012-07-23  1:33 ` [PATCH 7/10] __fcntl Isaac Dunham
2012-07-23  1:36 ` [PATCH 8/10] finite Isaac Dunham
2012-07-23  7:58   ` Szabolcs Nagy
2012-07-23  1:38 ` [PATCH 9/10] GLIBC ABI patches Isaac Dunham
2012-07-23 15:11   ` Arvid E. Picciani
2012-07-24 18:15     ` Igmar Palsenberg
2012-07-24 18:19       ` Gregor Richards
2012-07-24 18:23         ` Igmar Palsenberg
2012-07-24 18:29           ` Gregor Richards
2012-07-24 18:33             ` Igmar Palsenberg
2012-07-24 23:18               ` Rich Felker
2012-07-25  7:27               ` Arvid E. Picciani
2012-07-25 14:12   ` Luca Barbato
2012-07-25 15:19     ` Rich Felker
2012-07-25 15:52       ` Luca Barbato
2012-07-25 17:35         ` Rich Felker
2012-07-25 23:06       ` idunham
2012-07-23  1:40 ` [PATCH 10/10] More glibc ABI compatability Isaac Dunham
2012-08-07  2:22 ` [PATCH 1/10] ioperm & iopl Isaac Dunham
2012-08-07  3:29   ` Isaac Dunham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120722181731.051d67d5@newbook \
    --to=idunham@lavabit.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).