summaryrefslogtreecommitdiff
path: root/nuttx/syscall
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-09-28 14:47:49 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-09-28 14:47:49 -0600
commitb2bb7e626fd9d3ca2a0a53a179712a30f6f2ab3a (patch)
tree40f60dd2d410a5f0d7b6af5d1e736f59187eabdf /nuttx/syscall
parent7d1166b886638aab648cf27450454ea3b76bfd18 (diff)
downloadnuttx-b2bb7e626fd9d3ca2a0a53a179712a30f6f2ab3a.tar.gz
nuttx-b2bb7e626fd9d3ca2a0a53a179712a30f6f2ab3a.tar.bz2
nuttx-b2bb7e626fd9d3ca2a0a53a179712a30f6f2ab3a.zip
Optimized sendfile() from Max Holtzberg
Diffstat (limited to 'nuttx/syscall')
-rw-r--r--nuttx/syscall/syscall.csv1
-rw-r--r--nuttx/syscall/syscall_lookup.h6
-rw-r--r--nuttx/syscall/syscall_stublookup.c2
3 files changed, 8 insertions, 1 deletions
diff --git a/nuttx/syscall/syscall.csv b/nuttx/syscall/syscall.csv
index 71d800950..e470b91a7 100644
--- a/nuttx/syscall/syscall.csv
+++ b/nuttx/syscall/syscall.csv
@@ -106,6 +106,7 @@
"sem_unlink","semaphore.h","","int","FAR const char*"
"sem_wait","semaphore.h","","int","FAR sem_t*"
"send","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","ssize_t","int","FAR const void*","size_t","int"
+"sendfile","sys/sendfile.h","CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_NET_SENDFILE)","ssize_t","int","int","FAR off_t*","size_t"
"sendto","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","ssize_t","int","FAR const void*","size_t","int","FAR const struct sockaddr*","socklen_t"
"set_errno","errno.h","","void","int"
"setenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","int","const char*","const char*","int"
diff --git a/nuttx/syscall/syscall_lookup.h b/nuttx/syscall/syscall_lookup.h
index d87385f0a..b370bdd5b 100644
--- a/nuttx/syscall/syscall_lookup.h
+++ b/nuttx/syscall/syscall_lookup.h
@@ -182,7 +182,11 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert)
# if CONFIG_NFILE_STREAMS > 0
SYSCALL_LOOKUP(fdopen, 3, STUB_fs_fdopen)
SYSCALL_LOOKUP(sched_getstreams, 0, STUB_sched_getstreams)
-#endif
+# endif
+
+# if defined(CONFIG_NET_SENDFILE)
+ SYSCALL_LOOKUP(sendfile, 4, STUB_fs_sendifile)
+# endif
# if !defined(CONFIG_DISABLE_MOUNTPOINT)
SYSCALL_LOOKUP(fsync, 1, STUB_fsync)
diff --git a/nuttx/syscall/syscall_stublookup.c b/nuttx/syscall/syscall_stublookup.c
index 517c15af3..436637c9e 100644
--- a/nuttx/syscall/syscall_stublookup.c
+++ b/nuttx/syscall/syscall_stublookup.c
@@ -199,6 +199,8 @@ uintptr_t STUB_fs_fdopen(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3);
uintptr_t STUB_sched_getstreams(int nbr);
+ssize_t sendfile(int outfd, int infd, FAR off_t *offset, size_t count);
+
uintptr_t STUB_fsync(int nbr, uintptr_t parm1);
uintptr_t STUB_mkdir(int nbr, uintptr_t parm1, uintptr_t parm2);
uintptr_t STUB_mount(int nbr, uintptr_t parm1, uintptr_t parm2,