Add pread(0 and pwrite() system calls

This commit is contained in:
Gregory Nutt 2014-10-04 07:31:45 -06:00
parent 948be542a1
commit 032fbb7ace
4 changed files with 18 additions and 8 deletions

View File

@ -232,12 +232,14 @@
# define SYS_ioctl (__SYS_descriptors+1)
# define SYS_read (__SYS_descriptors+2)
# define SYS_write (__SYS_descriptors+3)
# define SYS_pread (__SYS_descriptors+4)
# define SYS_pwrite (__SYS_descriptors+5)
# ifndef CONFIG_DISABLE_POLL
# define SYS_poll (__SYS_descriptors+4)
# define SYS_select (__SYS_descriptors+5)
# define __SYS_filedesc (__SYS_descriptors+6)
# define SYS_poll (__SYS_descriptors+6)
# define SYS_select (__SYS_descriptors+7)
# define __SYS_filedesc (__SYS_descriptors+8)
# else
# define __SYS_filedesc (__SYS_descriptors+4)
# define __SYS_filedesc (__SYS_descriptors+6)
# endif
#else
# define __SYS_filedesc __SYS_descriptors

View File

@ -46,6 +46,8 @@
"pipe","unistd.h","CONFIG_NFILE_DESCRIPTORS > 0","int","int [2]|int*"
"poll","poll.h","!defined(CONFIG_DISABLE_POLL) && (CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0)","int","FAR struct pollfd*","nfds_t","int"
"prctl","sys/prctl.h", "CONFIG_TASK_NAME_SIZE > 0","int","int","..."
"pread","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","ssize_t","int","FAR void*","size_t","off_t"
"pwrite","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","ssize_t","int","FAR const void*","size_t","off_t"
"posix_spawnp","spawn.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS) && defined(CONFIG_BINFMT_EXEPATH)","int","FAR pid_t *","FAR const char *","FAR const posix_spawn_file_actions_t *","FAR const posix_spawnattr_t *","FAR char *const []|FAR char *const *","FAR char *const []"
"posix_spawn","spawn.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS) && !defined(CONFIG_BINFMT_EXEPATH)","int","FAR pid_t *","FAR const char *","FAR const posix_spawn_file_actions_t *","FAR const posix_spawnattr_t *","FAR char *const []|FAR char *const *","FAR char *const []|FAR char *const *"
"pthread_barrier_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrier_t*"

Can't render this file because it has a wrong number of fields in line 2.

View File

@ -163,6 +163,8 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert)
SYSCALL_LOOKUP(ioctl, 3, STUB_ioctl)
SYSCALL_LOOKUP(read, 3, STUB_read)
SYSCALL_LOOKUP(write, 3, STUB_write)
SYSCALL_LOOKUP(pread, 4, STUB_pread)
SYSCALL_LOOKUP(pwrite, 4, STUB_pwrite)
# ifndef CONFIG_DISABLE_POLL
SYSCALL_LOOKUP(poll, 3, STUB_poll)
SYSCALL_LOOKUP(select, 5, STUB_select)

View File

@ -160,14 +160,18 @@ uintptr_t STUB_timer_settime(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t STUB_close(int nbr, uintptr_t parm1);
uintptr_t STUB_ioctl(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3);
uintptr_t STUB_poll(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3);
uintptr_t STUB_read(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3);
uintptr_t STUB_write(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3);
uintptr_t STUB_pread(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3, uintptr_t parm4);
uintptr_t STUB_pwrite(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3, uintptr_t parm4);
uintptr_t STUB_poll(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3);
uintptr_t STUB_select(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5);
uintptr_t STUB_write(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3);
/* The following are defined if file descriptors are enabled */