Sfoglia il codice sorgente

add linux tee syscall

Rich Felker 12 anni fa
parent
commit
997ba92a0f
2 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 1 0
      include/fcntl.h
  2. 8 0
      src/linux/tee.c

+ 1 - 0
include/fcntl.h

@@ -130,6 +130,7 @@ ssize_t readahead(int, off_t, size_t);
 int sync_file_range(int, off_t, off_t, unsigned);
 ssize_t vmsplice(int, const struct iovec *, size_t, unsigned);
 ssize_t splice(int, off_t *, int, off_t *, size_t, unsigned);
+ssize_t tee(int, int, size_t, unsigned);
 #define loff_t off_t
 #endif
 

+ 8 - 0
src/linux/tee.c

@@ -0,0 +1,8 @@
+#define _GNU_SOURCE
+#include <fcntl.h>
+#include "syscall.h"
+
+ssize_t tee(int src, int dest, size_t len, unsigned flags)
+{
+	return syscall(SYS_tee, src, dest, len, flags);
+}