|
@@ -16,7 +16,7 @@
|
16
|
16
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
17
|
*/
|
18
|
18
|
|
19
|
|
-FILE_LICENCE(GPL2_OR_LATER);
|
|
19
|
+FILE_LICENCE ( GPL2_OR_LATER );
|
20
|
20
|
|
21
|
21
|
/** @file
|
22
|
22
|
*
|
|
@@ -29,86 +29,78 @@ FILE_LICENCE(GPL2_OR_LATER);
|
29
|
29
|
#include <asm/unistd.h>
|
30
|
30
|
#include <string.h>
|
31
|
31
|
|
32
|
|
-int linux_open(const char *pathname, int flags)
|
33
|
|
-{
|
34
|
|
- return linux_syscall(__NR_open, pathname, flags);
|
|
32
|
+int linux_open ( const char *pathname, int flags ) {
|
|
33
|
+ return linux_syscall ( __NR_open, pathname, flags );
|
35
|
34
|
}
|
36
|
35
|
|
37
|
|
-int linux_close(int fd)
|
38
|
|
-{
|
39
|
|
- return linux_syscall(__NR_close, fd);
|
|
36
|
+int linux_close ( int fd ) {
|
|
37
|
+ return linux_syscall ( __NR_close, fd );
|
40
|
38
|
}
|
41
|
39
|
|
42
|
|
-ssize_t linux_read(int fd, void *buf, size_t count)
|
43
|
|
-{
|
44
|
|
- return linux_syscall(__NR_read, fd, buf, count);
|
|
40
|
+__kernel_ssize_t linux_read ( int fd, void *buf, __kernel_size_t count ) {
|
|
41
|
+ return linux_syscall ( __NR_read, fd, buf, count );
|
45
|
42
|
}
|
46
|
43
|
|
47
|
|
-ssize_t linux_write(int fd, const void *buf, size_t count)
|
48
|
|
-{
|
49
|
|
- return linux_syscall(__NR_write, fd, buf, count);
|
|
44
|
+__kernel_ssize_t linux_write ( int fd, const void *buf,
|
|
45
|
+ __kernel_size_t count ) {
|
|
46
|
+ return linux_syscall ( __NR_write, fd, buf, count );
|
50
|
47
|
}
|
51
|
48
|
|
52
|
|
-int linux_fcntl(int fd, int cmd, ...)
|
53
|
|
-{
|
|
49
|
+int linux_fcntl ( int fd, int cmd, ... ) {
|
54
|
50
|
long arg;
|
55
|
51
|
va_list list;
|
56
|
52
|
|
57
|
|
- va_start(list, cmd);
|
58
|
|
- arg = va_arg(list, long);
|
59
|
|
- va_end(list);
|
|
53
|
+ va_start ( list, cmd );
|
|
54
|
+ arg = va_arg ( list, long );
|
|
55
|
+ va_end ( list );
|
60
|
56
|
|
61
|
|
- return linux_syscall(__NR_fcntl, fd, cmd, arg);
|
|
57
|
+ return linux_syscall ( __NR_fcntl, fd, cmd, arg );
|
62
|
58
|
}
|
63
|
59
|
|
64
|
|
-int linux_ioctl(int fd, int request, ...)
|
65
|
|
-{
|
|
60
|
+int linux_ioctl ( int fd, int request, ... ) {
|
66
|
61
|
void *arg;
|
67
|
62
|
va_list list;
|
68
|
63
|
|
69
|
|
- va_start(list, request);
|
70
|
|
- arg = va_arg(list, void *);
|
71
|
|
- va_end(list);
|
|
64
|
+ va_start ( list, request );
|
|
65
|
+ arg = va_arg ( list, void * );
|
|
66
|
+ va_end ( list );
|
72
|
67
|
|
73
|
|
- return linux_syscall(__NR_ioctl, fd, request, arg);
|
|
68
|
+ return linux_syscall ( __NR_ioctl, fd, request, arg );
|
74
|
69
|
}
|
75
|
70
|
|
76
|
|
-int linux_poll(struct pollfd *fds, nfds_t nfds, int timeout)
|
77
|
|
-{
|
78
|
|
- return linux_syscall(__NR_poll, fds, nfds, timeout);
|
|
71
|
+int linux_poll ( struct pollfd *fds, nfds_t nfds, int timeout ) {
|
|
72
|
+ return linux_syscall ( __NR_poll, fds, nfds, timeout );
|
79
|
73
|
}
|
80
|
74
|
|
81
|
|
-int linux_nanosleep(const struct timespec *req, struct timespec *rem)
|
82
|
|
-{
|
83
|
|
- return linux_syscall(__NR_nanosleep, req, rem);
|
|
75
|
+int linux_nanosleep ( const struct timespec *req, struct timespec *rem ) {
|
|
76
|
+ return linux_syscall ( __NR_nanosleep, req, rem );
|
84
|
77
|
}
|
85
|
78
|
|
86
|
|
-int linux_usleep(useconds_t usec)
|
87
|
|
-{
|
|
79
|
+int linux_usleep ( useconds_t usec ) {
|
88
|
80
|
struct timespec ts = {
|
89
|
|
- .tv_sec = (long) (usec / 1000000),
|
90
|
|
- .tv_nsec = (long) (usec % 1000000) * 1000ul
|
|
81
|
+ .tv_sec = ( ( long ) ( usec / 1000000 ) ),
|
|
82
|
+ .tv_nsec = ( ( long ) ( usec % 1000000 ) * 1000UL ),
|
91
|
83
|
};
|
92
|
84
|
|
93
|
|
- return linux_nanosleep(&ts, NULL);
|
|
85
|
+ return linux_nanosleep ( &ts, NULL );
|
94
|
86
|
}
|
95
|
87
|
|
96
|
|
-int linux_gettimeofday(struct timeval *tv, struct timezone *tz)
|
97
|
|
-{
|
98
|
|
- return linux_syscall(__NR_gettimeofday, tv, tz);
|
|
88
|
+int linux_gettimeofday ( struct timeval *tv, struct timezone *tz ) {
|
|
89
|
+ return linux_syscall ( __NR_gettimeofday, tv, tz );
|
99
|
90
|
}
|
100
|
91
|
|
101
|
|
-void *linux_mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset)
|
102
|
|
-{
|
103
|
|
- return (void *)linux_syscall(__SYSCALL_mmap, addr, length, prot, flags, fd, offset);
|
|
92
|
+void * linux_mmap ( void *addr, __kernel_size_t length, int prot, int flags,
|
|
93
|
+ int fd, __kernel_off_t offset ) {
|
|
94
|
+ return ( void * ) linux_syscall ( __SYSCALL_mmap, addr, length, prot,
|
|
95
|
+ flags, fd, offset );
|
104
|
96
|
}
|
105
|
97
|
|
106
|
|
-void *linux_mremap(void *old_address, size_t old_size, size_t new_size, int flags)
|
107
|
|
-{
|
108
|
|
- return (void *)linux_syscall(__NR_mremap, old_address, old_size, new_size, flags);
|
|
98
|
+void * linux_mremap ( void *old_address, __kernel_size_t old_size,
|
|
99
|
+ __kernel_size_t new_size, int flags ) {
|
|
100
|
+ return ( void * ) linux_syscall ( __NR_mremap, old_address, old_size,
|
|
101
|
+ new_size, flags );
|
109
|
102
|
}
|
110
|
103
|
|
111
|
|
-int linux_munmap(void *addr, size_t length)
|
112
|
|
-{
|
113
|
|
- return linux_syscall(__NR_munmap, addr, length);
|
|
104
|
+int linux_munmap ( void *addr, __kernel_size_t length ) {
|
|
105
|
+ return linux_syscall ( __NR_munmap, addr, length );
|
114
|
106
|
}
|