first part of the sysconf(_SC_ASYNCHRONOUS_IO) != 200112L cleanup
PATCH 1/1 first part of the sysconf(_SC_ASYNCHRONOUS_IO) != 200112L cleanup
Hi!
I've started to fix testcases disabled by value from sysconf(_SC_ASYNCHRONOUS_IO) as POSIX from 2008 allows value 200XXXL to be returned. Attached patch fixes all tests in conformance/aio_fsync directory. Each test gets reviewed and issues are fixed. See detailed log below (trivial coding style fixes are not mentoined).
conformance/interfaces/aio_fsync/
1-1.c -- trivial change (test unimplemented)
2-1.c -- looks like test is not finished
(does some work and then return UNTESTED)
3-1.c -- looks like test is not finished
(does some work and then return UNTESTED)
4-1.c -- works
4-2.c -- was broken (testing errno value instead of
value from aio_return())
works now
5-1.c -- works
6-1.c -- trivial change (test unimplemented)
7-1.c -- trivial change (test unimplemented)
8-1.c -- works
8-2.c -- works
8-3.c -- works
8-4.c -- works
9-1.c -- works
10-1.c -- trivial change (test unimplemented)
11-1.c -- trivial change (test unimplemented)
12-1.c -- works
13-1.c -- works
14-1.c -- works
Signature · 2 lines
Cyril Hrubis [email protected]
testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/1-1.c +2 -3
@@ -6,14 +6,13 @@* source tree. */ -#define _XOPEN_SOURCE 600#include <stdlib.h> #include <unistd.h> #include "posixtest.h" -int main () +int main (void ) { -if (sysconf (_SC_ASYNCHRONOUS_IO) !=200112L ) +if (sysconf (_SC_ASYNCHRONOUS_IO) <=0 )exit (PTS_UNSUPPORTED );exit (PTS_UNTESTED ); }
testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/10-1.c +2 -3
@@ -20,14 +20,13 @@* */ -#define _XOPEN_SOURCE 600#include <stdlib.h> #include <unistd.h> #include "posixtest.h" -int main () +int main (void ) { -if (sysconf (_SC_ASYNCHRONOUS_IO) !=200112L ) +if (sysconf (_SC_ASYNCHRONOUS_IO) <=0 )exit (PTS_UNSUPPORTED );exit (PTS_UNTESTED ); }
testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/11-1.c +2 -3
@@ -6,14 +6,13 @@* source tree. */ -#define _XOPEN_SOURCE 600#include <stdlib.h> #include <unistd.h> #include "posixtest.h" -int main () +int main (void ) { -if (sysconf (_SC_ASYNCHRONOUS_IO) !=200112L ) +if (sysconf (_SC_ASYNCHRONOUS_IO) <=0 )exit (PTS_UNSUPPORTED );exit (PTS_UNTESTED ); }
testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/12-1.c +6 -8
@@ -6,7 +6,6 @@* source tree. */ -#define _XOPEN_SOURCE 600#include <stdio.h> #include <sys/types.h> #include <unistd.h>
@@ -21,28 +20,27 @@#define TNAME "aio_fsync/12-1.c" -int main () +int main (void ) {struct aiocb aiocb; -if (sysconf (_SC_ASYNCHRONOUS_IO) !=200112L ) +if (sysconf (_SC_ASYNCHRONOUS_IO) <=0 )return PTS_UNSUPPORTED ;memset (&aiocb,0 ,sizeof (struct aiocb )); aiocb.aio_fildes =-1 ; -if (aio_fsync (O_SYNC , &aiocb) !=-1 ) - { +if (aio_fsync (O_SYNC , &aiocb) !=-1 ) {printf (TNAME " aio_fsync() accepts bad filedes\n" );exit (PTS_FAIL ); } -if (errno !=EBADF ) - { +if (errno !=EBADF ) {printf (TNAME " errno is not EBADF (%d)\n" , errno);exit (PTS_FAIL ); } -printf ("Test PASSED\n" ); +printf ("Test PASSED\n" ); +return PTS_PASS ; }
testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/13-1.c +2 -3
@@ -6,14 +6,13 @@* source tree. */ -#define _XOPEN_SOURCE 600#include <stdlib.h> #include <unistd.h> #include "posixtest.h" -int main () +int main (void ) { -if (sysconf (_SC_ASYNCHRONOUS_IO) !=200112L ) +if (sysconf (_SC_ASYNCHRONOUS_IO) <=0 )exit (PTS_UNSUPPORTED );exit (PTS_UNTESTED ); }
testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c +10 -13
@@ -6,7 +6,6 @@* source tree. */ -#define _XOPEN_SOURCE 600#include <stdio.h> #include <sys/types.h> #include <unistd.h>
@@ -21,16 +20,17 @@#define TNAME "aio_fsync/14-1.c" -int main () +#define BUF_SIZE 111 + +int main (void ) {char tmpfname[256 ]; -#define BUF_SIZE 111char buf[BUF_SIZE ];int fd;struct aiocb aiocb_write;struct aiocb aiocb_fsync; -if (sysconf (_SC_ASYNCHRONOUS_IO) !=200112L ) +if (sysconf (_SC_ASYNCHRONOUS_IO) <=0 )return PTS_UNSUPPORTED ; snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_fsync_14_1_%d",
@@ -38,8 +38,8 @@ int main()unlink (tmpfname); fd =open (tmpfname,O_CREAT |O_RDWR |O_EXCL ,S_IRUSR |S_IWUSR ); -if (fd ==-1 ) - { + +if (fd ==-1 ) {printf (TNAME " Error at open(): %s\n" ,strerror (errno));exit (PTS_UNRESOLVED );
@@ -52,8 +52,7 @@ int main() aiocb_write.aio_buf = buf; aiocb_write.aio_nbytes =BUF_SIZE ; -if (aio_write (&aiocb_write) ==-1 ) - { +if (aio_write (&aiocb_write) ==-1 ) {printf (TNAME " Error at aio_write(): %s\n" ,strerror (errno));exit (PTS_FAIL );
@@ -62,19 +61,17 @@ int main()memset (&aiocb_fsync,0 ,sizeof (aiocb_fsync)); aiocb_fsync.aio_fildes = fd; -if (aio_fsync (-1 , &aiocb_fsync) !=-1 ) - { +if (aio_fsync (-1 , &aiocb_fsync) !=-1 ) {printf (TNAME " aio_fsync() accepts bad op\n" );exit (PTS_FAIL ); } -if (errno !=EINVAL ) - { +if (errno !=EINVAL ) {printf (TNAME " errno is not EINVAL (%d)\n" , errno);exit (PTS_FAIL ); }close (fd); -printf ("Test PASSED\n" ); +printf ("Test PASSED\n" );return PTS_PASS ; }
testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/2-1.c +6 -10
@@ -6,7 +6,6 @@* source tree. */ -#define _XOPEN_SOURCE 600#include <stdio.h> #include <sys/types.h> #include <unistd.h>
@@ -23,8 +22,7 @@#define BUF_SIZE 1024 -int -main (void ) +int main (void ) {char tmpfname[256 ];char buf[BUF_SIZE ];
@@ -32,7 +30,7 @@ main (void)struct aiocb aiocb_write;struct aiocb aiocb_fsync; -if (sysconf (_SC_ASYNCHRONOUS_IO) !=200112L ) +if (sysconf (_SC_ASYNCHRONOUS_IO) <=0 )return PTS_UNSUPPORTED ; snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_fsync_2_1_%d",
@@ -40,8 +38,8 @@ main (void)unlink (tmpfname); fd =open (tmpfname,O_CREAT |O_RDWR |O_EXCL ,S_IRUSR |S_IWUSR ); -if (fd ==-1 ) - { + +if (fd ==-1 ) {printf (TNAME " Error at open(): %s\n" ,strerror (errno));exit (PTS_UNRESOLVED );
@@ -54,8 +52,7 @@ main (void) aiocb_write.aio_buf = buf; aiocb_write.aio_nbytes =BUF_SIZE ; -if (aio_write (&aiocb_write) ==-1 ) - { +if (aio_write (&aiocb_write) ==-1 ) {printf (TNAME " Error at aio_write(): %s\n" ,strerror (errno));exit (PTS_FAIL );
@@ -64,8 +61,7 @@ main (void)memset (&aiocb_fsync,0 ,sizeof (aiocb_fsync)); aiocb_fsync.aio_fildes = fd; -if (aio_fsync (O_DSYNC , &aiocb_fsync) !=0 ) - { +if (aio_fsync (O_DSYNC , &aiocb_fsync) !=0 ) {printf (TNAME " Error at aio_fsync(): %s\n" ,strerror (errno));exit (PTS_FAIL ); }
testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/3-1.c +6 -9
@@ -6,7 +6,6 @@* source tree. */ -#define _XOPEN_SOURCE 600#include <stdio.h> #include <sys/types.h> #include <unistd.h>
@@ -23,7 +22,7 @@#define BUF_SIZE 1024 -int main () +int main (void ) {char tmpfname[256 ];char buf[BUF_SIZE ];
@@ -31,7 +30,7 @@ int main()struct aiocb aiocb_write;struct aiocb aiocb_fsync; -if (sysconf (_SC_ASYNCHRONOUS_IO) !=200112L ) +if (sysconf (_SC_ASYNCHRONOUS_IO) <=0 )return PTS_UNSUPPORTED ; snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_fsync_3_1_%d",
@@ -39,8 +38,8 @@ int main()unlink (tmpfname); fd =open (tmpfname,O_CREAT |O_RDWR |O_EXCL ,S_IRUSR |S_IWUSR ); -if (fd ==-1 ) - { + +if (fd ==-1 ) {printf (TNAME " Error at open(): %s\n" ,strerror (errno));exit (PTS_UNRESOLVED );
@@ -53,8 +52,7 @@ int main() aiocb_write.aio_buf = buf; aiocb_write.aio_nbytes =BUF_SIZE ; -if (aio_write (&aiocb_write) ==-1 ) - { +if (aio_write (&aiocb_write) ==-1 ) {printf (TNAME " Error at aio_write(): %s\n" ,strerror (errno));exit (PTS_FAIL );
@@ -63,8 +61,7 @@ int main()memset (&aiocb_fsync,0 ,sizeof (aiocb_fsync)); aiocb_fsync.aio_fildes = fd; -if (aio_fsync (O_SYNC , &aiocb_fsync) !=0 ) - { +if (aio_fsync (O_SYNC , &aiocb_fsync) !=0 ) {printf (TNAME " Error at aio_fsync(): %s\n" ,strerror (errno));exit (PTS_FAIL ); }
testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/4-1.c +10 -13
@@ -6,7 +6,6 @@* source tree. */ -#define _XOPEN_SOURCE 600#include <stdio.h> #include <sys/types.h> #include <unistd.h>
@@ -21,16 +20,17 @@#define TNAME "aio_fsync/4-1.c" -int main () +#define BUF_SIZE 111 + +int main (void ) {char tmpfname[256 ]; -#define BUF_SIZE 111char buf[BUF_SIZE ];int fd;struct aiocb aiocb_write;struct aiocb aiocb_fsync; -if (sysconf (_SC_ASYNCHRONOUS_IO) !=200112L ) +if (sysconf (_SC_ASYNCHRONOUS_IO) <=0 )return PTS_UNSUPPORTED ; snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_fsync_4_1_%d",
@@ -38,8 +38,8 @@ int main()unlink (tmpfname); fd =open (tmpfname,O_CREAT |O_RDWR |O_EXCL ,S_IRUSR |S_IWUSR ); -if (fd ==-1 ) - { + +if (fd ==-1 ) {printf (TNAME " Error at open(): %s\n" ,strerror (errno));exit (PTS_UNRESOLVED );
@@ -52,8 +52,7 @@ int main() aiocb_write.aio_buf = buf; aiocb_write.aio_nbytes =BUF_SIZE ; -if (aio_write (&aiocb_write) ==-1 ) - { +if (aio_write (&aiocb_write) ==-1 ) {printf (TNAME " Error at aio_write(): %s\n" ,strerror (errno));exit (PTS_FAIL );
@@ -62,19 +61,17 @@ int main()memset (&aiocb_fsync,0 ,sizeof (aiocb_fsync)); aiocb_fsync.aio_fildes = fd; -if (aio_fsync (O_SYNC , &aiocb_fsync) !=0 ) - { +if (aio_fsync (O_SYNC , &aiocb_fsync) !=0 ) {printf (TNAME " Error at aio_fsync()\n" );exit (PTS_FAIL ); } -if (aio_error (&aiocb_fsync) <0 ) - { +if (aio_error (&aiocb_fsync) <0 ) {printf (TNAME " Error at aio_error() : %s\n" ,strerror (errno));exit (PTS_FAIL ); }close (fd); -printf ("Test PASSED\n" ); +printf ("Test PASSED\n" );return PTS_PASS ; }
testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/4-2.c +13 -17
@@ -6,7 +6,6 @@* source tree. */ -#define _XOPEN_SOURCE 600#include <stdio.h> #include <sys/types.h> #include <unistd.h>
@@ -21,16 +20,17 @@#define TNAME "aio_fsync/4-2.c" -int main () +#define BUF_SIZE 111 + +int main (void ) {char tmpfname[256 ]; -#define BUF_SIZE 111char buf[BUF_SIZE ]; -int fd; +int fd, ret;struct aiocb aiocb_write;struct aiocb aiocb_fsync; -if (sysconf (_SC_ASYNCHRONOUS_IO) !=200112L ) +if (sysconf (_SC_ASYNCHRONOUS_IO) <=0 )return PTS_UNSUPPORTED ; snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_fsync_4_2_%d",
@@ -38,8 +38,8 @@ int main()unlink (tmpfname); fd =open (tmpfname,O_CREAT |O_RDWR |O_EXCL ,S_IRUSR |S_IWUSR ); -if (fd ==-1 ) - { + +if (fd ==-1 ) {printf (TNAME " Error at open(): %s\n" ,strerror (errno));exit (PTS_UNRESOLVED );
@@ -52,8 +52,7 @@ int main() aiocb_write.aio_buf = buf; aiocb_write.aio_nbytes =BUF_SIZE ; -if (aio_write (&aiocb_write) ==-1 ) - { +if (aio_write (&aiocb_write) ==-1 ) {printf (TNAME " Error at aio_write(): %s\n" ,strerror (errno));exit (PTS_FAIL );
@@ -62,20 +61,17 @@ int main()memset (&aiocb_fsync,0 ,sizeof (aiocb_fsync)); aiocb_fsync.aio_fildes = fd; -if (aio_fsync (O_SYNC , &aiocb_fsync) !=0 ) - { +if (aio_fsync (O_SYNC , &aiocb_fsync) !=0 ) {printf (TNAME " Error at aio_fsync()\n" );exit (PTS_FAIL ); } - errno =0 ; -aio_return (&aiocb_fsync); -if (errno !=0 ) - { -printf (TNAME " Error at aio_return() : %s\n" ,strerror (errno)); +if ((ret =aio_return (&aiocb_fsync) !=0 )) { +printf (TNAME " Error at aio_return() : %s\n" ,strerror (ret));exit (PTS_FAIL ); } +close (fd); -printf ("Test PASSED\n" ); +printf ("Test PASSED\n" );return PTS_PASS ; }
testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/5-1.c +8 -10
@@ -6,7 +6,6 @@* source tree. */ -#define _XOPEN_SOURCE 600#include <stdio.h> #include <sys/types.h> #include <unistd.h>
@@ -23,7 +22,7 @@#define BUF_SIZE 1024 -int main () +int main (void ) {char tmpfname[256 ];char buf[BUF_SIZE ];
@@ -32,7 +31,7 @@ int main()struct aiocb aiocb_fsync;int ret; -if (sysconf (_SC_ASYNCHRONOUS_IO) !=200112L ) +if (sysconf (_SC_ASYNCHRONOUS_IO) <=0 )return PTS_UNSUPPORTED ; snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_fsync_5_1_%d",
@@ -40,8 +39,8 @@ int main()unlink (tmpfname); fd =open (tmpfname,O_CREAT |O_RDWR |O_EXCL ,S_IRUSR |S_IWUSR ); -if (fd ==-1 ) - { + +if (fd ==-1 ) {printf (TNAME " Error at open(): %s\n" ,strerror (errno));exit (PTS_UNRESOLVED );
@@ -54,8 +53,7 @@ int main() aiocb_write.aio_buf = buf; aiocb_write.aio_nbytes =BUF_SIZE ; -if (aio_write (&aiocb_write) ==-1 ) - { +if (aio_write (&aiocb_write) ==-1 ) {printf (TNAME " Error at aio_write(): %s\n" ,strerror (errno));exit (PTS_FAIL );
@@ -64,8 +62,7 @@ int main()memset (&aiocb_fsync,0 ,sizeof (aiocb_fsync)); aiocb_fsync.aio_fildes = fd; -if (aio_fsync (O_SYNC , &aiocb_fsync) !=0 ) - { +if (aio_fsync (O_SYNC , &aiocb_fsync) !=0 ) {printf (TNAME " Error at aio_fsync(): %s\n" ,strerror (errno));exit (PTS_FAIL ); }
@@ -78,12 +75,13 @@ int main()* something else * otherwise test hangs */ -while (aio_error (&aiocb_fsync) ==EINPROGRESS );close (fd);/* we didn't check if the operation is really performed */ +if (ret ==PTS_PASS ) +printf ("Test PASSED\n" );return ret; }
testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/6-1.c +2 -3
@@ -6,14 +6,13 @@* source tree. */ -#define _XOPEN_SOURCE 600#include <stdlib.h> #include <unistd.h> #include "posixtest.h" -int main () +int main (void ) { -if (sysconf (_SC_ASYNCHRONOUS_IO) !=200112L ) +if (sysconf (_SC_ASYNCHRONOUS_IO) <=0 )exit (PTS_UNSUPPORTED );exit (PTS_UNTESTED ); }
testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/7-1.c +2 -3
@@ -6,14 +6,13 @@* source tree. */ -#define _XOPEN_SOURCE 600#include <stdlib.h> #include <unistd.h> #include "posixtest.h" -int main () +int main (void ) { -if (sysconf (_SC_ASYNCHRONOUS_IO) !=200112L ) +if (sysconf (_SC_ASYNCHRONOUS_IO) <=0 )exit (PTS_UNSUPPORTED );exit (PTS_UNTESTED ); }
testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-1.c +9 -11
@@ -6,7 +6,6 @@* source tree. */ -#define _XOPEN_SOURCE 600#include <stdio.h> #include <sys/types.h> #include <unistd.h>
@@ -21,16 +20,17 @@#define TNAME "aio_fsync/8-1.c" -int main () +#define BUF_SIZE 111 + +int main (void ) {char tmpfname[256 ]; -#define BUF_SIZE 111char buf[BUF_SIZE ];int fd;struct aiocb aiocb_write;struct aiocb aiocb_fsync; -if (sysconf (_SC_ASYNCHRONOUS_IO) !=200112L ) +if (sysconf (_SC_ASYNCHRONOUS_IO) <=0 )return PTS_UNSUPPORTED ; snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_fsync_8_1_%d",
@@ -38,8 +38,8 @@ int main()unlink (tmpfname); fd =open (tmpfname,O_CREAT |O_RDWR |O_EXCL ,S_IRUSR |S_IWUSR ); -if (fd ==-1 ) - { + +if (fd ==-1 ) {printf (TNAME " Error at open(): %s\n" ,strerror (errno));exit (PTS_UNRESOLVED );
@@ -52,8 +52,7 @@ int main() aiocb_write.aio_buf = buf; aiocb_write.aio_nbytes =BUF_SIZE ; -if (aio_write (&aiocb_write) ==-1 ) - { +if (aio_write (&aiocb_write) ==-1 ) {printf (TNAME " Error at aio_write(): %s\n" ,strerror (errno));exit (PTS_FAIL );
@@ -63,13 +62,12 @@ int main() aiocb_fsync.aio_fildes = fd; aiocb_fsync.aio_nbytes =-1 ; -if (aio_fsync (O_SYNC , &aiocb_fsync) !=0 ) - { +if (aio_fsync (O_SYNC , &aiocb_fsync) !=0 ) {printf (TNAME " Error at aio_fsync(): %s\n" ,strerror (errno));exit (PTS_FAIL ); }close (fd); -printf ("Test PASSED\n" ); +printf ("Test PASSED\n" );return PTS_PASS ; }
testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-2.c +9 -11
@@ -6,7 +6,6 @@* source tree. */ -#define _XOPEN_SOURCE 600#include <stdio.h> #include <sys/types.h> #include <unistd.h>
@@ -21,16 +20,17 @@#define TNAME "aio_fsync/8-2.c" -int main () +#define BUF_SIZE 111 + +int main (void ) {char tmpfname[256 ]; -#define BUF_SIZE 111char buf[BUF_SIZE ];int fd;struct aiocb aiocb_write;struct aiocb aiocb_fsync; -if (sysconf (_SC_ASYNCHRONOUS_IO) !=200112L ) +if (sysconf (_SC_ASYNCHRONOUS_IO) <=0 )return PTS_UNSUPPORTED ; snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_fsync_8_2_%d",
@@ -38,8 +38,8 @@ int main()unlink (tmpfname); fd =open (tmpfname,O_CREAT |O_RDWR |O_EXCL ,S_IRUSR |S_IWUSR ); -if (fd ==-1 ) - { + +if (fd ==-1 ) {printf (TNAME " Error at open(): %s\n" ,strerror (errno));exit (PTS_UNRESOLVED );
@@ -52,8 +52,7 @@ int main() aiocb_write.aio_buf = buf; aiocb_write.aio_nbytes =BUF_SIZE ; -if (aio_write (&aiocb_write) ==-1 ) - { +if (aio_write (&aiocb_write) ==-1 ) {printf (TNAME " Error at aio_write(): %s\n" ,strerror (errno));exit (PTS_FAIL );
@@ -63,13 +62,12 @@ int main() aiocb_fsync.aio_fildes = fd; aiocb_fsync.aio_buf =NULL ; -if (aio_fsync (O_SYNC , &aiocb_fsync) !=0 ) - { +if (aio_fsync (O_SYNC , &aiocb_fsync) !=0 ) {printf (TNAME " Error at aio_fsync(): %s\n" ,strerror (errno));exit (PTS_FAIL ); }close (fd); -printf ("Test PASSED\n" ); +printf ("Test PASSED\n" );return PTS_PASS ; }
testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-3.c +9 -11
@@ -6,7 +6,6 @@* source tree. */ -#define _XOPEN_SOURCE 600#include <stdio.h> #include <sys/types.h> #include <unistd.h>
@@ -21,16 +20,17 @@#define TNAME "aio_fsync/8-3.c" -int main () +#define BUF_SIZE 111 + +int main (void ) {char tmpfname[256 ]; -#define BUF_SIZE 111char buf[BUF_SIZE ];int fd;struct aiocb aiocb_write;struct aiocb aiocb_fsync; -if (sysconf (_SC_ASYNCHRONOUS_IO) !=200112L ) +if (sysconf (_SC_ASYNCHRONOUS_IO) <=0 )return PTS_UNSUPPORTED ; snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_fsync_8_3_%d",
@@ -38,8 +38,8 @@ int main()unlink (tmpfname); fd =open (tmpfname,O_CREAT |O_RDWR |O_EXCL ,S_IRUSR |S_IWUSR ); -if (fd ==-1 ) - { + +if (fd ==-1 ) {printf (TNAME " Error at open(): %s\n" ,strerror (errno));exit (PTS_UNRESOLVED );
@@ -52,8 +52,7 @@ int main() aiocb_write.aio_buf = buf; aiocb_write.aio_nbytes =BUF_SIZE ; -if (aio_write (&aiocb_write) ==-1 ) - { +if (aio_write (&aiocb_write) ==-1 ) {printf (TNAME " Error at aio_write(): %s\n" ,strerror (errno));exit (PTS_FAIL );
@@ -63,13 +62,12 @@ int main() aiocb_fsync.aio_fildes = fd; aiocb_fsync.aio_reqprio =-1 ; -if (aio_fsync (O_SYNC , &aiocb_fsync) !=0 ) - { +if (aio_fsync (O_SYNC , &aiocb_fsync) !=0 ) {printf (TNAME " Error at aio_fsync(): %s\n" ,strerror (errno));exit (PTS_FAIL ); }close (fd); -printf ("Test PASSED\n" ); +printf ("Test PASSED\n" );return PTS_PASS ; }
testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-4.c +9 -11
@@ -6,7 +6,6 @@* source tree. */ -#define _XOPEN_SOURCE 600#include <stdio.h> #include <sys/types.h> #include <unistd.h>
@@ -21,16 +20,17 @@#define TNAME "aio_fsync/8-4.c" -int main () +#define BUF_SIZE 111 + +int main (void ) {char tmpfname[256 ]; -#define BUF_SIZE 111char buf[BUF_SIZE ];int fd;struct aiocb aiocb_write;struct aiocb aiocb_fsync; -if (sysconf (_SC_ASYNCHRONOUS_IO) !=200112L ) +if (sysconf (_SC_ASYNCHRONOUS_IO) ==-1 )return PTS_UNSUPPORTED ; snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_fsync_8_4_%d",
@@ -38,8 +38,8 @@ int main()unlink (tmpfname); fd =open (tmpfname,O_CREAT |O_RDWR |O_EXCL ,S_IRUSR |S_IWUSR ); -if (fd ==-1 ) - { + +if (fd ==-1 ) {printf (TNAME " Error at open(): %s\n" ,strerror (errno));exit (PTS_UNRESOLVED );
@@ -52,8 +52,7 @@ int main() aiocb_write.aio_buf = buf; aiocb_write.aio_nbytes =BUF_SIZE ; -if (aio_write (&aiocb_write) ==-1 ) - { +if (aio_write (&aiocb_write) ==-1 ) {printf (TNAME " Error at aio_write(): %s\n" ,strerror (errno));exit (PTS_FAIL );
@@ -63,13 +62,12 @@ int main() aiocb_fsync.aio_fildes = fd; aiocb_fsync.aio_offset =-1 ; -if (aio_fsync (O_SYNC , &aiocb_fsync) !=0 ) - { +if (aio_fsync (O_SYNC , &aiocb_fsync) !=0 ) {printf (TNAME " Error at aio_fsync(): %s\n" ,strerror (errno));exit (PTS_FAIL ); }close (fd); -printf ("Test PASSED\n" ); +printf ("Test PASSED\n" );return PTS_PASS ; }
testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/9-1.c +8 -9
@@ -6,7 +6,6 @@* source tree. */ -#define _XOPEN_SOURCE 600#include <stdio.h> #include <sys/types.h> #include <unistd.h>
@@ -21,16 +20,17 @@#define TNAME "aio_fsync/9-1.c" -int main () +#define BUF_SIZE 111 + +int main (void ) {char tmpfname[256 ]; -#define BUF_SIZE 111char buf[BUF_SIZE ];int fd;struct aiocb aiocb_write;struct aiocb aiocb_fsync; -if (sysconf (_SC_ASYNCHRONOUS_IO) !=200112L ) +if (sysconf (_SC_ASYNCHRONOUS_IO) <=0 )return PTS_UNSUPPORTED ; snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_fsync_9_1_%d",
@@ -38,8 +38,8 @@ int main()unlink (tmpfname); fd =open (tmpfname,O_CREAT |O_RDWR |O_EXCL ,S_IRUSR |S_IWUSR ); -if (fd ==-1 ) - { + +if (fd ==-1 ) {printf (TNAME " Error at open(): %s\n" ,strerror (errno));exit (PTS_UNRESOLVED );
@@ -52,8 +52,7 @@ int main() aiocb_write.aio_buf = buf; aiocb_write.aio_nbytes =BUF_SIZE ; -if (aio_write (&aiocb_write) ==-1 ) - { +if (aio_write (&aiocb_write) ==-1 ) {printf (TNAME " Error at aio_write(): %s\n" ,strerror (errno));exit (PTS_FAIL );
@@ -69,6 +68,6 @@ int main() }close (fd); -printf ("Test PASSED\n" ); +printf ("Test PASSED\n" );return PTS_PASS ; }
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Hi!
Anybody any comments? I'm about to work on next chunk of aio testcases and it would be better to sort out all issues before I create new bunch of patches.
Signature · 13 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list