? cpukit/libcsupport/src/.write.c.rej.swp
RCS file: /usr1/CVS/rtems/cpukit/libcsupport/include/rtems/libio_.h,v
retrieving revision 1.28.2.1
diff -u -r1.28.2.1 libio_.h
|
|
|
124 | 124 | } while (0) |
125 | 125 | |
126 | 126 | /* |
127 | | * rtems_libio_check_permissions |
| 127 | * rtems_libio_check_permissions_with_error |
128 | 128 | * |
129 | 129 | * Macro to check if a file descriptor is open for this operation. |
| 130 | * On failure, return the user specified error. |
130 | 131 | */ |
131 | 132 | |
132 | | #define rtems_libio_check_permissions(_iop, _flag) \ |
133 | | do { \ |
134 | | if (((_iop)->flags & (_flag)) == 0) { \ |
135 | | rtems_set_errno_and_return_minus_one( EINVAL ); \ |
136 | | return -1; \ |
137 | | } \ |
| 133 | #define rtems_libio_check_permissions_with_error(_iop, _flag, _errno) \ |
| 134 | do { \ |
| 135 | if (((_iop)->flags & (_flag)) == 0) { \ |
| 136 | rtems_set_errno_and_return_minus_one( _errno ); \ |
| 137 | return -1; \ |
| 138 | } \ |
138 | 139 | } while (0) |
139 | 140 | |
140 | 141 | /* |
| 142 | * rtems_libio_check_permissions |
| 143 | * |
| 144 | * Macro to check if a file descriptor is open for this operation. |
| 145 | * On failure, return EINVAL |
| 146 | */ |
| 147 | |
| 148 | #define rtems_libio_check_permissions(_iop, _flag) \ |
| 149 | rtems_libio_check_permissions_with_error(_iop, _flag, EINVAL ) |
| 150 | |
| 151 | /* |
141 | 152 | * rtems_filesystem_freenode |
142 | 153 | * |
143 | 154 | * Macro to free a node. |
RCS file: /usr1/CVS/rtems/cpukit/libcsupport/src/fchdir.c,v
retrieving revision 1.8
diff -u -r1.8 fchdir.c
|
|
|
1 | 1 | /* |
2 | 2 | * fchdir() - compatible with SVr4, 4.4BSD and X/OPEN - Change Directory |
3 | 3 | * |
4 | | * COPYRIGHT (c) 1989-2000. |
| 4 | * COPYRIGHT (c) 1989-2011. |
5 | 5 | * On-Line Applications Research Corporation (OAR). |
6 | 6 | * |
7 | 7 | * The license and distribution terms for this file may be |
… |
… |
|
36 | 36 | rtems_libio_check_is_open(iop); |
37 | 37 | |
38 | 38 | /* |
39 | | * Now process the fchmod(). |
40 | | */ |
41 | | |
42 | | rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ ); |
43 | | |
44 | | /* |
45 | 39 | * Verify you can change directory into this node. |
46 | 40 | */ |
47 | 41 | |
RCS file: /usr1/CVS/rtems/cpukit/libcsupport/src/fdatasync.c,v
retrieving revision 1.10
diff -u -r1.10 fdatasync.c
|
|
|
1 | 1 | /* |
2 | 2 | * fdatasync() - POSIX 1003.1b 6.6.2 - Synchronize the Data of a File |
3 | 3 | * |
4 | | * COPYRIGHT (c) 1989-1999. |
| 4 | * COPYRIGHT (c) 1989-2011. |
5 | 5 | * On-Line Applications Research Corporation (OAR). |
6 | 6 | * |
7 | 7 | * The license and distribution terms for this file may be |
… |
… |
|
29 | 29 | rtems_libio_check_fd( fd ); |
30 | 30 | iop = rtems_libio_iop( fd ); |
31 | 31 | rtems_libio_check_is_open(iop); |
32 | | rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); |
| 32 | rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EBADF ); |
33 | 33 | |
34 | 34 | /* |
35 | 35 | * Now process the fdatasync(). |
RCS file: /usr1/CVS/rtems/cpukit/libcsupport/src/fpathconf.c,v
retrieving revision 1.9
diff -u -r1.9 fpathconf.c
|
|
|
1 | 1 | /* |
2 | 2 | * fpathconf() - POSIX 1003.1b - 5.7.1 - Configurable Pathname Varables |
3 | 3 | * |
4 | | * COPYRIGHT (c) 1989-1999. |
| 4 | * COPYRIGHT (c) 1989-2011. |
5 | 5 | * On-Line Applications Research Corporation (OAR). |
6 | 6 | * |
7 | 7 | * The license and distribution terms for this file may be |
… |
… |
|
33 | 33 | rtems_libio_check_fd(fd); |
34 | 34 | iop = rtems_libio_iop(fd); |
35 | 35 | rtems_libio_check_is_open(iop); |
36 | | rtems_libio_check_permissions(iop, LIBIO_FLAGS_READ); |
37 | 36 | |
38 | 37 | /* |
39 | 38 | * Now process the information request. |
RCS file: /usr1/CVS/rtems/cpukit/libcsupport/src/fsync.c,v
retrieving revision 1.11
diff -u -r1.11 fsync.c
|
|
|
1 | 1 | /* |
2 | 2 | * fsync() - POSIX 1003.1b 6.6.1 - Synchronize the State of a File |
3 | 3 | * |
4 | | * COPYRIGHT (c) 1989-1999. |
| 4 | * COPYRIGHT (c) 1989-2011. |
5 | 5 | * On-Line Applications Research Corporation (OAR). |
6 | 6 | * |
7 | 7 | * The license and distribution terms for this file may be |
… |
… |
|
29 | 29 | rtems_libio_check_fd( fd ); |
30 | 30 | iop = rtems_libio_iop( fd ); |
31 | 31 | rtems_libio_check_is_open(iop); |
32 | | rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); |
33 | 32 | |
34 | 33 | /* |
35 | 34 | * Now process the fsync(). |
RCS file: /usr1/CVS/rtems/cpukit/libcsupport/src/read.c,v
retrieving revision 1.13
diff -u -r1.13 read.c
|
|
|
1 | 1 | /* |
2 | 2 | * read() - POSIX 1003.1b 6.4.1 - Read From a File |
3 | 3 | * |
4 | | * COPYRIGHT (c) 1989-1999. |
| 4 | * COPYRIGHT (c) 1989-2011. |
5 | 5 | * On-Line Applications Research Corporation (OAR). |
6 | 6 | * |
7 | 7 | * The license and distribution terms for this file may be |
… |
… |
|
32 | 32 | rtems_libio_check_is_open( iop ); |
33 | 33 | rtems_libio_check_buffer( buffer ); |
34 | 34 | rtems_libio_check_count( count ); |
35 | | rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ ); |
| 35 | rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_READ, EBADF ); |
36 | 36 | |
37 | 37 | /* |
38 | 38 | * Now process the read(). |
RCS file: /usr1/CVS/rtems/cpukit/libcsupport/src/readv.c,v
retrieving revision 1.2
diff -u -r1.2 readv.c
|
|
|
5 | 5 | * |
6 | 6 | * http://www.opengroup.org/onlinepubs/009695399/functions/readv.html |
7 | 7 | * |
8 | | * COPYRIGHT (c) 1989-2007. |
| 8 | * COPYRIGHT (c) 1989-2011. |
9 | 9 | * On-Line Applications Research Corporation (OAR). |
10 | 10 | * |
11 | 11 | * The license and distribution terms for this file may be |
… |
… |
|
40 | 40 | rtems_libio_check_fd( fd ); |
41 | 41 | iop = rtems_libio_iop( fd ); |
42 | 42 | rtems_libio_check_is_open( iop ); |
43 | | rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ ); |
| 43 | rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_READ, EBADF ); |
44 | 44 | |
45 | 45 | /* |
46 | 46 | * Argument validation on IO vector |
RCS file: /usr1/CVS/rtems/cpukit/libcsupport/src/write.c,v
retrieving revision 1.16
diff -u -r1.16 write.c
|
|
|
1 | 1 | /* |
2 | 2 | * write() - POSIX 1003.1b 6.4.2 - Write to a File |
3 | 3 | * |
4 | | * COPYRIGHT (c) 1989-2007. |
| 4 | * COPYRIGHT (c) 1989-2011. |
5 | 5 | * On-Line Applications Research Corporation (OAR). |
6 | 6 | * |
7 | 7 | * The license and distribution terms for this file may be |
… |
… |
|
39 | 39 | rtems_libio_check_is_open( iop ); |
40 | 40 | rtems_libio_check_buffer( buffer ); |
41 | 41 | rtems_libio_check_count( count ); |
42 | | rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); |
| 42 | rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EBADF ); |
43 | 43 | |
44 | 44 | /* |
45 | 45 | * Now process the write() request. |
RCS file: /usr1/CVS/rtems/cpukit/libcsupport/src/writev.c,v
retrieving revision 1.2
diff -u -r1.2 writev.c
|
|
|
5 | 5 | * |
6 | 6 | * http://www.opengroup.org/onlinepubs/009695399/functions/writev.html |
7 | 7 | * |
8 | | * COPYRIGHT (c) 1989-2007. |
| 8 | * COPYRIGHT (c) 1989-2011. |
9 | 9 | * On-Line Applications Research Corporation (OAR). |
10 | 10 | * |
11 | 11 | * The license and distribution terms for this file may be |
… |
… |
|
41 | 41 | rtems_libio_check_fd( fd ); |
42 | 42 | iop = rtems_libio_iop( fd ); |
43 | 43 | rtems_libio_check_is_open( iop ); |
44 | | rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); |
| 44 | rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EBADF ); |
45 | 45 | |
46 | 46 | /* |
47 | 47 | * Argument validation on IO vector |