forked from Imagelibrary/rtems
* Makefile.am, configure.ac: Add tests for file lock stubs as well as various POSIX methods that access UID, PID, and GID. * psxfilelock01/.cvsignore, psxfilelock01/Makefile.am, psxfilelock01/init.c, psxfilelock01/psxfilelock01.doc, psxfilelock01/psxfilelock01.scn, psxid01/.cvsignore, psxid01/Makefile.am, psxid01/init.c, psxid01/psxid01.doc, psxid01/psxid01.scn: New files.
61 lines
1.2 KiB
C
61 lines
1.2 KiB
C
/*
|
|
* COPYRIGHT (c) 1989-2010.
|
|
* On-Line Applications Research Corporation (OAR).
|
|
*
|
|
* The license and distribution terms for this file may be
|
|
* found in the file LICENSE in this distribution or at
|
|
* http://www.rtems.com/license/LICENSE.
|
|
*
|
|
* $Id$
|
|
*/
|
|
|
|
#include <tmacros.h>
|
|
#include "test_support.h"
|
|
#include <errno.h>
|
|
|
|
rtems_task Init(
|
|
rtems_task_argument argument
|
|
)
|
|
{
|
|
FILE *fd;
|
|
int sc;
|
|
|
|
puts( "\n\n*** TEST FILE LOCK 01 ***" );
|
|
|
|
puts( "Open /testfile" );
|
|
fd = fopen( "/testfile", "w+" );
|
|
rtems_test_assert( fd );
|
|
|
|
puts( "flockfile /testfile" );
|
|
flockfile( fd );
|
|
|
|
puts( "ftrylockfile /testfile" );
|
|
sc = ftrylockfile( fd );
|
|
rtems_test_assert( sc == -1 );
|
|
rtems_test_assert( errno == ENOTSUP );
|
|
|
|
puts( "flockfile /testfile" );
|
|
flockfile( fd );
|
|
|
|
puts( "funlockfile /testfile" );
|
|
funlockfile( fd );
|
|
|
|
puts( "*** END OF TEST FILE LOCK 01 ***" );
|
|
|
|
rtems_test_exit(0);
|
|
}
|
|
|
|
/* configuration information */
|
|
|
|
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
|
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
|
|
|
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4
|
|
#define CONFIGURE_MAXIMUM_TASKS 1
|
|
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
|
|
|
#define CONFIGURE_INIT
|
|
|
|
#include <rtems/confdefs.h>
|
|
/* end of file */
|