Ignore:
Timestamp:
Oct 11, 2018, 8:51:21 AM (14 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
35eab84
Parents:
68799dac
git-author:
Sebastian Huber <sebastian.huber@…> (10/11/18 08:51:21)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/18/18 09:11:24)
Message:

Support O_DIRECTORY open() flag

Close #3545.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/psxfile01/test.c

    r68799dac r4af18b3  
    129129  }
    130130
     131}
     132
     133static void test_open_directory(void)
     134{
     135  static const char file[] = "somefile";
     136  int status;
     137  int fd;
     138
     139  fd = open( file, O_CREAT, S_IRWXU );
     140  rtems_test_assert( fd >= 0 );
     141
     142  status = close( fd );
     143  rtems_test_assert( status == 0 );
     144
     145#ifdef O_DIRECTORY
     146  errno = 0;
     147  fd = open( file, O_DIRECTORY, S_IRWXU );
     148  rtems_test_assert( fd == -1 );
     149  rtems_test_assert( errno == ENOTDIR );
     150#endif
     151
     152  status = unlink( file );
     153  rtems_test_assert( status == 0 );
    131154}
    132155
     
    162185  TEST_BEGIN();
    163186
     187  test_open_directory();
     188
    164189  /*
    165190   *  Grab the maximum size of an in-memory file.
Note: See TracChangeset for help on using the changeset viewer.