Added more proper checking of F_GETFL and F_SETFL.

Disabled test of F_DUPFD since it does not work.

Added comment to indicate that seekdir(NULL) was being called.
This commit is contained in:
Joel Sherrill
1999-11-02 16:29:56 +00:00
parent 5f2566b5e2
commit 3251b55cc0
2 changed files with 34 additions and 10 deletions

View File

@@ -19,6 +19,7 @@
*
* $Id$
*/
#include <stdio.h>
#include <sys/types.h>
#include <fcntl.h>
@@ -246,17 +247,27 @@ int main(
status = fcntl( fd, F_GETFD, 1 );
assert( status == 1 );
#if 0
printf("fcntl F_DUPFD should return 0\n");
status = fcntl( fd, F_DUPFD, 0 );
assert ( status == 0 );
#else
printf("fcntl F_DUPFD should return 0 -- skip until implemented\n");
#endif
printf("fcntl F_GETFL should return -1\n");
printf("fcntl F_GETFL returns current flags\n");
status = fcntl( fd, F_GETFL, 1 );
assert ( status == -1 );
printf("fcntl F_GETFL returned 0x%x\n", status );
assert( status != -1 );
printf("fcntl F_SETFL should return -1\n");
status = fcntl( fd, F_SETFL, 1 );
assert ( status == -1 );
printf("fcntl F_SETFL to add O_APPEND and O_NONBLOCK\n");
status = fcntl( fd, F_SETFL, O_APPEND|O_NONBLOCK );
assert ( status != -1 );
printf("fcntl F_GETFL return current flags to see changes\n");
status = fcntl( fd, F_GETFL, 1 );
printf("fcntl F_GETFL returned 0x%x\n", status );
assert( status != -1 );
printf("fcntl F_GETLK should return -1\n");
status = fcntl( fd, F_GETLK, 1 );
@@ -363,6 +374,7 @@ int main(
);
}
printf( "Send seekdir a NULL pointer\n");
seekdir( NULL, off );
printf( "\nClosing directory\n" );