diff options
author | David 'Digit' Turner <digit@google.com> | 2010-09-27 17:28:38 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2010-09-28 09:17:17 +0200 |
commit | a3ae60d343661784e3f6f4566b276d8e6b8a06a7 (patch) | |
tree | 08c1d005960477585df8fd5e0a14b421f4767643 | |
parent | 307aadb8473744c3d946add8b3e4947ada5481aa (diff) | |
download | bionic-a3ae60d343661784e3f6f4566b276d8e6b8a06a7.zip bionic-a3ae60d343661784e3f6f4566b276d8e6b8a06a7.tar.gz bionic-a3ae60d343661784e3f6f4566b276d8e6b8a06a7.tar.bz2 |
libc: Add missing fdatasync() implementation
Change-Id: I04bb655d77e414021e1f2a973329167ad76ca1c4
-rw-r--r-- | libc/SYSCALLS.TXT | 1 | ||||
-rw-r--r-- | libc/arch-arm/syscalls.mk | 1 | ||||
-rw-r--r-- | libc/arch-arm/syscalls/fdatasync.S | 19 | ||||
-rw-r--r-- | libc/arch-sh/syscalls.mk | 1 | ||||
-rw-r--r-- | libc/arch-sh/syscalls/fdatasync.S | 32 | ||||
-rw-r--r-- | libc/arch-x86/syscalls.mk | 1 | ||||
-rw-r--r-- | libc/arch-x86/syscalls/fdatasync.S | 23 | ||||
-rw-r--r-- | libc/include/sys/linux-syscalls.h | 1 | ||||
-rw-r--r-- | libc/include/sys/linux-unistd.h | 1 |
9 files changed, 80 insertions, 0 deletions
diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT index 4bcccb5..baac5d0 100644 --- a/libc/SYSCALLS.TXT +++ b/libc/SYSCALLS.TXT @@ -118,6 +118,7 @@ int select:_newselect(int, struct fd_set *, struct fd_set *, struct fd_s int ftruncate(int, off_t) 93 int getdents:getdents64(unsigned int, struct dirent *, unsigned int) 217,220 int fsync(int) 118 +int fdatasync(int) 148 int fchown:fchown32(int, uid_t, gid_t) 207 void sync(void) 36 int __fcntl64:fcntl64(int, int, void *) 221 diff --git a/libc/arch-arm/syscalls.mk b/libc/arch-arm/syscalls.mk index 2d944ca..f1d8fb1 100644 --- a/libc/arch-arm/syscalls.mk +++ b/libc/arch-arm/syscalls.mk @@ -72,6 +72,7 @@ syscall_src += arch-arm/syscalls/select.S syscall_src += arch-arm/syscalls/ftruncate.S syscall_src += arch-arm/syscalls/getdents.S syscall_src += arch-arm/syscalls/fsync.S +syscall_src += arch-arm/syscalls/fdatasync.S syscall_src += arch-arm/syscalls/fchown.S syscall_src += arch-arm/syscalls/sync.S syscall_src += arch-arm/syscalls/__fcntl64.S diff --git a/libc/arch-arm/syscalls/fdatasync.S b/libc/arch-arm/syscalls/fdatasync.S new file mode 100644 index 0000000..5981a80 --- /dev/null +++ b/libc/arch-arm/syscalls/fdatasync.S @@ -0,0 +1,19 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + + .text + .type fdatasync, #function + .globl fdatasync + .align 4 + .fnstart + +fdatasync: + .save {r4, r7} + stmfd sp!, {r4, r7} + ldr r7, =__NR_fdatasync + swi #0 + ldmfd sp!, {r4, r7} + movs r0, r0 + bxpl lr + b __set_syscall_errno + .fnend diff --git a/libc/arch-sh/syscalls.mk b/libc/arch-sh/syscalls.mk index b690bbf..3e2274f 100644 --- a/libc/arch-sh/syscalls.mk +++ b/libc/arch-sh/syscalls.mk @@ -75,6 +75,7 @@ syscall_src += arch-sh/syscalls/select.S syscall_src += arch-sh/syscalls/ftruncate.S syscall_src += arch-sh/syscalls/getdents.S syscall_src += arch-sh/syscalls/fsync.S +syscall_src += arch-sh/syscalls/fdatasync.S syscall_src += arch-sh/syscalls/fchown.S syscall_src += arch-sh/syscalls/sync.S syscall_src += arch-sh/syscalls/__fcntl64.S diff --git a/libc/arch-sh/syscalls/fdatasync.S b/libc/arch-sh/syscalls/fdatasync.S new file mode 100644 index 0000000..d81c33a --- /dev/null +++ b/libc/arch-sh/syscalls/fdatasync.S @@ -0,0 +1,32 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + + .text + .type fdatasync, @function + .globl fdatasync + .align 4 + +fdatasync: + + /* invoke trap */ + mov.l 0f, r3 /* trap num */ + trapa #(1 + 0x10) + + /* check return value */ + cmp/pz r0 + bt __NR_fdatasync_end + + /* keep error number */ + sts.l pr, @-r15 + mov.l 1f, r1 + jsr @r1 + mov r0, r4 + lds.l @r15+, pr + +__NR_fdatasync_end: + rts + nop + + .align 2 +0: .long __NR_fdatasync +1: .long __set_syscall_errno diff --git a/libc/arch-x86/syscalls.mk b/libc/arch-x86/syscalls.mk index 27153f9..f0d7a31 100644 --- a/libc/arch-x86/syscalls.mk +++ b/libc/arch-x86/syscalls.mk @@ -75,6 +75,7 @@ syscall_src += arch-x86/syscalls/select.S syscall_src += arch-x86/syscalls/ftruncate.S syscall_src += arch-x86/syscalls/getdents.S syscall_src += arch-x86/syscalls/fsync.S +syscall_src += arch-x86/syscalls/fdatasync.S syscall_src += arch-x86/syscalls/fchown.S syscall_src += arch-x86/syscalls/sync.S syscall_src += arch-x86/syscalls/__fcntl64.S diff --git a/libc/arch-x86/syscalls/fdatasync.S b/libc/arch-x86/syscalls/fdatasync.S new file mode 100644 index 0000000..b86c0f8 --- /dev/null +++ b/libc/arch-x86/syscalls/fdatasync.S @@ -0,0 +1,23 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + + .text + .type fdatasync, @function + .globl fdatasync + .align 4 + +fdatasync: + pushl %ebx + mov 8(%esp), %ebx + movl $__NR_fdatasync, %eax + int $0x80 + cmpl $-129, %eax + jb 1f + negl %eax + pushl %eax + call __set_errno + addl $4, %esp + orl $-1, %eax +1: + popl %ebx + ret diff --git a/libc/include/sys/linux-syscalls.h b/libc/include/sys/linux-syscalls.h index 6a7fc40..b90f20d 100644 --- a/libc/include/sys/linux-syscalls.h +++ b/libc/include/sys/linux-syscalls.h @@ -72,6 +72,7 @@ #define __NR__newselect (__NR_SYSCALL_BASE + 142) #define __NR_ftruncate (__NR_SYSCALL_BASE + 93) #define __NR_fsync (__NR_SYSCALL_BASE + 118) +#define __NR_fdatasync (__NR_SYSCALL_BASE + 148) #define __NR_fchown32 (__NR_SYSCALL_BASE + 207) #define __NR_sync (__NR_SYSCALL_BASE + 36) #define __NR_fcntl64 (__NR_SYSCALL_BASE + 221) diff --git a/libc/include/sys/linux-unistd.h b/libc/include/sys/linux-unistd.h index 7494efe..5e9c2f0 100644 --- a/libc/include/sys/linux-unistd.h +++ b/libc/include/sys/linux-unistd.h @@ -85,6 +85,7 @@ int select (int, struct fd_set *, struct fd_set *, struct fd_set *, int ftruncate (int, off_t); int getdents (unsigned int, struct dirent *, unsigned int); int fsync (int); +int fdatasync (int); int fchown (int, uid_t, gid_t); void sync (void); int __fcntl64 (int, int, void *); |