change log for rtems (2010-07-05)
rtems-vc at rtems.org
rtems-vc at rtems.org
Mon Jul 5 22:13:38 UTC 2010
*joel*:
2010-07-05 Joel Sherrill <joel.sherrill at oarcorp.com>
* Makefile.am, configure.ac, malloc03/init.c: Add test for PPPDDISC.
* termios06/.cvsignore, termios06/Makefile.am, termios06/init.c,
termios06/termios06.doc, termios06/termios06.scn,
termios06/test_pppd.c: New files.
M 1.197 testsuites/libtests/ChangeLog
M 1.35 testsuites/libtests/Makefile.am
M 1.42 testsuites/libtests/configure.ac
M 1.2 testsuites/libtests/malloc03/init.c
A 1.1 testsuites/libtests/termios06/.cvsignore
A 1.1 testsuites/libtests/termios06/Makefile.am
A 1.1 testsuites/libtests/termios06/init.c
A 1.1 testsuites/libtests/termios06/termios06.doc
A 1.1 testsuites/libtests/termios06/termios06.scn
A 1.1 testsuites/libtests/termios06/test_pppd.c
diff -u rtems/testsuites/libtests/ChangeLog:1.196 rtems/testsuites/libtests/ChangeLog:1.197
--- rtems/testsuites/libtests/ChangeLog:1.196 Thu Jul 1 09:37:35 2010
+++ rtems/testsuites/libtests/ChangeLog Mon Jul 5 16:14:39 2010
@@ -1,3 +1,10 @@
+2010-07-05 Joel Sherrill <joel.sherrill at oarcorp.com>
+
+ * Makefile.am, configure.ac, malloc03/init.c: Add test for PPPDDISC.
+ * termios06/.cvsignore, termios06/Makefile.am, termios06/init.c,
+ termios06/termios06.doc, termios06/termios06.scn,
+ termios06/test_pppd.c: New files.
+
2010-07-01 Joel Sherrill <joel.sherrill at oarcorp.com>
* Makefile.am, configure.ac: Add test for GCC C++ library helpers.
diff -u rtems/testsuites/libtests/Makefile.am:1.34 rtems/testsuites/libtests/Makefile.am:1.35
--- rtems/testsuites/libtests/Makefile.am:1.34 Thu Jul 1 09:37:36 2010
+++ rtems/testsuites/libtests/Makefile.am Mon Jul 5 16:14:39 2010
@@ -7,8 +7,8 @@
SUBDIRS = POSIX
SUBDIRS += bspcmdline01 cpuuse gxx01 malloctest malloc02 malloc03 heapwalk \
- putenvtest monitor monitor02 rtmonuse stackchk stackchk01 \
- termios termios01 termios02 termios03 termios04 termios05 \
+ putenvtest monitor monitor02 rtmonuse stackchk stackchk01 tar01 tar02 \
+ termios termios01 termios02 termios03 termios04 termios05 termios06 \
rtems++ tztest block01 block02 block03 block04 block05 block06 block07 \
block08 block09 block10 stringto01
diff -u rtems/testsuites/libtests/configure.ac:1.41 rtems/testsuites/libtests/configure.ac:1.42
--- rtems/testsuites/libtests/configure.ac:1.41 Thu Jul 1 09:37:37 2010
+++ rtems/testsuites/libtests/configure.ac Mon Jul 5 16:14:39 2010
@@ -58,12 +58,15 @@
stackchk/Makefile
stackchk01/Makefile
stringto01/Makefile
+tar01/Makefile
+tar02/Makefile
termios/Makefile
termios01/Makefile
termios02/Makefile
termios03/Makefile
termios04/Makefile
termios05/Makefile
+termios06/Makefile
tztest/Makefile
POSIX/Makefile
])
diff -u rtems/testsuites/libtests/malloc03/init.c:1.1 rtems/testsuites/libtests/malloc03/init.c:1.2
--- rtems/testsuites/libtests/malloc03/init.c:1.1 Tue Jun 22 14:27:12 2010
+++ rtems/testsuites/libtests/malloc03/init.c Mon Jul 5 16:14:39 2010
@@ -17,11 +17,10 @@
)
{
void *p1;
- unsigned int val = 999;
puts( "\n\n*** TEST MALLOC03 ***" );
- p1 = &val;
+ p1 = __builtin_frame_address(0);
printf("Attempt to free stack memory\n");
free( p1 );
diff -u /dev/null rtems/testsuites/libtests/termios06/.cvsignore:1.1
--- /dev/null Mon Jul 5 17:13:36 2010
+++ rtems/testsuites/libtests/termios06/.cvsignore Mon Jul 5 16:14:39 2010
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/libtests/termios06/Makefile.am:1.1
--- /dev/null Mon Jul 5 17:13:36 2010
+++ rtems/testsuites/libtests/termios06/Makefile.am Mon Jul 5 16:14:39 2010
@@ -0,0 +1,27 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = termios06
+termios06_SOURCES = init.c ../termios03/termios_testdriver_polled.c test_pppd.c
+
+dist_rtems_tests_DATA = termios06.scn
+dist_rtems_tests_DATA += termios06.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/termios03
+
+LINK_OBJS = $(termios06_OBJECTS) $(termios06_LDADD)
+LINK_LIBS = $(termios06_LDLIBS)
+
+termios06$(EXEEXT): $(termios06_OBJECTS) $(termios06_DEPENDENCIES)
+ @rm -f termios06$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/libtests/termios06/init.c:1.1
--- /dev/null Mon Jul 5 17:13:37 2010
+++ rtems/testsuites/libtests/termios06/init.c Mon Jul 5 16:14:39 2010
@@ -0,0 +1,144 @@
+/*
+ * 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 "termios_testdriver_polled.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <rtems/dumpbuf.h>
+
+void pppasyncattach(void);
+void ppp_test_driver_set_rx( const char *expected, size_t len );
+
+int Test_fd;
+int InitialDiscipline;
+
+void open_it(void)
+{
+ /* open the file */
+ puts( "open(" TERMIOS_TEST_DRIVER_DEVICE_NAME ") - OK " );
+ Test_fd = open( TERMIOS_TEST_DRIVER_DEVICE_NAME, O_RDWR );
+ rtems_test_assert( Test_fd != -1 );
+}
+
+void set_discipline(void)
+{
+ int pppdisc = PPPDISC;
+ int sc;
+
+ puts( "ioctl - TIOCGETD - OK" );
+ sc = ioctl(Test_fd, TIOCGETD, &InitialDiscipline);
+ rtems_test_assert( sc == 0 );
+
+ puts( "ioctl - TIOCSETD - OK" );
+ sc = ioctl(Test_fd, TIOCSETD, &pppdisc);
+ rtems_test_assert( sc == 0 );
+}
+
+void ioctl_it(void)
+{
+ int rc;
+
+ puts( "ioctl(" TERMIOS_TEST_DRIVER_DEVICE_NAME ") - OK " );
+ rc = ioctl( Test_fd, 0xFFFF, NULL );
+ rtems_test_assert( rc == 0 );
+}
+
+void close_it(void)
+{
+ int rc;
+
+ puts( "close(" TERMIOS_TEST_DRIVER_DEVICE_NAME ") - OK " );
+ rc = close( Test_fd );
+ rtems_test_assert( rc == 0 );
+}
+
+void write_it(void)
+{
+ ssize_t sc;
+ char ch[10] = "PPPD TEST";
+
+ puts( "write(PPPD TEST) - OK " );
+ sc = write(Test_fd, ch, sizeof(ch));
+ rtems_test_assert( sc == sizeof(ch) );
+}
+
+uint8_t read_helper_buffer[256];
+
+void read_helper(
+ int fd,
+ const char *expected
+)
+{
+ int rc;
+ size_t len;
+
+ len = strlen( expected );
+
+ ppp_test_driver_set_rx( expected, len );
+ printf( "\nReading (expected):\n" );
+ rtems_print_buffer( (unsigned char *)expected, len-1 );
+
+ rc = read( fd, read_helper_buffer, sizeof(read_helper_buffer) );
+ rtems_test_assert( rc != -1 );
+
+ printf( "Read %d bytes from read(2)\n", rc );
+ rtems_print_buffer( read_helper_buffer, rc );
+}
+
+void read_it(void)
+{
+ read_helper( Test_fd, "This is test PPP input." );
+}
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ puts( "\n\n*** TEST TERMIOS06 ***" );
+
+ pppasyncattach();
+ open_it();
+ set_discipline();
+ write_it();
+ ioctl_it();
+ read_it();
+ close_it();
+
+ puts( "*** END OF TEST TERMIOS06 ***" );
+
+ rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_EXTRA_DRIVERS TERMIOS_TEST_DRIVER_TABLE_ENTRY
+
+/* one for the console and one for the test port */
+#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 3
+
+/* we need to be able to open the test device */
+#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 */
diff -u /dev/null rtems/testsuites/libtests/termios06/termios06.doc:1.1
--- /dev/null Mon Jul 5 17:13:37 2010
+++ rtems/testsuites/libtests/termios06/termios06.doc Mon Jul 5 16:14:39 2010
@@ -0,0 +1,22 @@
+#
+# $Id$
+#
+# 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.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: termios06
+
+directives:
+
+ various parts of termios that deal with PPPDISC
+
+concepts:
+
++ Exercise PPPDISC functionality in termios
diff -u /dev/null rtems/testsuites/libtests/termios06/termios06.scn:1.1
--- /dev/null Mon Jul 5 17:13:37 2010
+++ rtems/testsuites/libtests/termios06/termios06.scn Mon Jul 5 16:14:39 2010
@@ -0,0 +1,42 @@
+*** TEST TERMIOS06 ***
+open(/dev/test) - OK
+ioctl - TIOCGETD - OK
+ioctl - TIOCSETD - OK
+pppopen called
+write(PPPD TEST) - OK
+pppwrite called - 10 bytes
+50 50 50 44 20 54 45 53 54 00 |PPPD TEST. |
+pppstart called
+ioctl(/dev/test) - OK
+pppioctl called
+
+Reading (expected):
+54 68 69 73 20 69 73 20 74 65 73 74 20 50 50 50 |This is test PPP|
+20 69 6e 70 75 74 | input |
+pppread calledpppinput called - with (T)
+pppinput called - with (h)
+pppinput called - with (i)
+pppinput called - with (s)
+pppinput called - with ( )
+pppinput called - with (i)
+pppinput called - with (s)
+pppinput called - with ( )
+pppinput called - with (t)
+pppinput called - with (e)
+pppinput called - with (s)
+pppinput called - with (t)
+pppinput called - with ( )
+pppinput called - with (P)
+pppinput called - with (P)
+pppinput called - with (P)
+pppinput called - with ( )
+pppinput called - with (i)
+pppinput called - with (n)
+pppinput called - with (p)
+pppinput called - with (u)
+pppinput called - with (t)
+pppinput called - with (.)
+Read 0 bytes from read(2)
+close(/dev/test) - OK
+pppclose called
+*** END OF TEST TERMIOS06 ***
diff -u /dev/null rtems/testsuites/libtests/termios06/test_pppd.c:1.1
--- /dev/null Mon Jul 5 17:13:37 2010
+++ rtems/testsuites/libtests/termios06/test_pppd.c Mon Jul 5 16:14:39 2010
@@ -0,0 +1,101 @@
+/*
+ * 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 <termios.h>
+#include <rtems/termiostypes.h>
+#include <rtems/dumpbuf.h>
+
+int pppopen(struct rtems_termios_tty *tty);
+int pppclose(struct rtems_termios_tty *tty);
+int pppread(struct rtems_termios_tty *tty, rtems_libio_rw_args_t *rw_args);
+int pppwrite(struct rtems_termios_tty *tty, rtems_libio_rw_args_t *rw_args);
+int pppioctl(struct rtems_termios_tty *tty, rtems_libio_ioctl_args_t *args);
+int pppinput(int c, struct rtems_termios_tty *tty);
+int pppstart(struct rtems_termios_tty *tp);
+
+/*
+ * Define the PPP line discipline.
+ */
+
+static struct rtems_termios_linesw pppdisc = {
+ pppopen, pppclose, pppread, pppwrite,
+ pppinput, pppstart, pppioctl, NULL
+};
+
+const char *RXExpected;
+size_t RXLength;
+
+void ppp_test_driver_set_rx( const char *expected, size_t len )
+{
+ RXExpected = expected;
+ RXLength = len;
+}
+
+void pppasyncattach(void)
+{
+ rtems_termios_linesw[PPPDISC] = pppdisc;
+}
+
+int pppopen(struct rtems_termios_tty *tty)
+{
+ puts( "pppopen called" );
+ return 0;
+}
+
+int pppclose(struct rtems_termios_tty *tty)
+{
+ puts( "pppclose called" );
+ return 0;
+}
+
+int pppread(struct rtems_termios_tty *tty, rtems_libio_rw_args_t *rw_args)
+{
+ puts( "pppread called" );
+
+ rtems_termios_enqueue_raw_characters( tty, (char *)RXExpected, RXLength );
+
+ RXExpected = NULL;
+ RXLength = 0;
+ return 0;
+}
+
+int pppwrite(struct rtems_termios_tty *tty, rtems_libio_rw_args_t *rw_args)
+{
+ int maximum = rw_args->count;
+ char *out_buffer = rw_args->buffer;
+
+ printf( "pppwrite called - %d bytes\n", maximum );
+ rtems_print_buffer( (unsigned char *) out_buffer, maximum );
+ rw_args->bytes_moved = maximum;
+ rtems_termios_dequeue_characters( tty, 1 );
+ return 0;
+}
+
+int pppioctl(struct rtems_termios_tty *tty, rtems_libio_ioctl_args_t *args)
+{
+ puts( "pppioctl called" );
+ return 0;
+}
+
+int pppinput(int c, struct rtems_termios_tty *tty)
+{
+ printf( "pppinput called - with (%c)\n", c );
+ return 0;
+}
+
+int pppstart(struct rtems_termios_tty *tp)
+{
+ puts( "pppstart called" );
+ return 0;
+}
+
+
*joel*:
2010-07-05 Joel Sherrill <joel.sherrill at oarcorp.com>
* libcsupport/src/getlogin.c: Formatting. Add EFAULT.
* libcsupport/src/termios.c: Formatting.
M 1.2489 cpukit/ChangeLog
M 1.3 cpukit/libcsupport/src/getlogin.c
M 1.63 cpukit/libcsupport/src/termios.c
diff -u rtems/cpukit/ChangeLog:1.2488 rtems/cpukit/ChangeLog:1.2489
--- rtems/cpukit/ChangeLog:1.2488 Sun Jul 4 09:53:42 2010
+++ rtems/cpukit/ChangeLog Mon Jul 5 16:31:55 2010
@@ -1,3 +1,8 @@
+2010-07-05 Joel Sherrill <joel.sherrill at oarcorp.com>
+
+ * libcsupport/src/getlogin.c: Formatting. Add EFAULT.
+ * libcsupport/src/termios.c: Formatting.
+
2010-07-04 Joel Sherrill <joel.sherrill at oarcorp.com>
* libblock/include/rtems/ide_part_table.h, libblock/src/bdbuf.c,
diff -u rtems/cpukit/libcsupport/src/getlogin.c:1.2 rtems/cpukit/libcsupport/src/getlogin.c:1.3
--- rtems/cpukit/libcsupport/src/getlogin.c:1.2 Sun Apr 18 01:05:34 2004
+++ rtems/cpukit/libcsupport/src/getlogin.c Mon Jul 5 16:31:56 2010
@@ -19,46 +19,40 @@
#include <unistd.h>
#include <pwd.h>
-/*PAGE
- *
+/*
* 4.2.4 Get User Name, P1003.1b-1993, p. 87
*
* NOTE: P1003.1c/D10, p. 49 adds getlogin_r().
*/
-
-/*
- * MACRO in userenv.h
- *
-static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ];
-*/
-
char *getlogin( void )
{
(void) getlogin_r( _POSIX_types_Getlogin_buffer, LOGIN_NAME_MAX );
return _POSIX_types_Getlogin_buffer;
}
-/*PAGE
- *
+/*
* 4.2.4 Get User Name, P1003.1b-1993, p. 87
*
* NOTE: P1003.1c/D10, p. 49 adds getlogin_r().
*/
-
int getlogin_r(
char *name,
size_t namesize
)
{
struct passwd *pw;
+
+ if ( !name )
+ return EFAULT;
+
if ( namesize < LOGIN_NAME_MAX )
return ERANGE;
- pw=getpwuid(getuid());
- if (!pw) {
- strcpy(name,"");
+ pw = getpwuid(getuid());
+ if ( !pw ) {
+ strcpy( name, "" );
} else {
- strncpy(name,pw->pw_name,LOGIN_NAME_MAX);
- };
+ strncpy( name, pw->pw_name, LOGIN_NAME_MAX );
+ }
return 0;
}
diff -u rtems/cpukit/libcsupport/src/termios.c:1.62 rtems/cpukit/libcsupport/src/termios.c:1.63
--- rtems/cpukit/libcsupport/src/termios.c:1.62 Mon Jun 28 13:48:32 2010
+++ rtems/cpukit/libcsupport/src/termios.c Mon Jul 5 16:31:56 2010
@@ -60,13 +60,14 @@
{ NULL, NULL, NULL, NULL, \
NULL, NULL, NULL, NULL }
/*
- * FIXME: change rtems_termios_linesw entries consistant with rtems_termios_linesw entry usage...
+ * FIXME: change rtems_termios_linesw entries consistent
+ * with rtems_termios_linesw entry usage...
*/
struct rtems_termios_linesw rtems_termios_linesw[MAXLDISC] =
{
NODISC(0), /* 0- termios-built-in */
NODISC(1), /* 1- defunct */
- NODISC(2), /* 2- NTTYDISC */
+ NODISC(2), /* 2- NTTYDISC */
NODISC(3), /* TABLDISC */
NODISC(4), /* SLIPDISC */
NODISC(5), /* PPPDISC */
@@ -74,7 +75,8 @@
NODISC(7), /* loadable */
};
-int rtems_termios_nlinesw = sizeof (rtems_termios_linesw) / sizeof (rtems_termios_linesw[0]);
+int rtems_termios_nlinesw =
+ sizeof (rtems_termios_linesw) / sizeof (rtems_termios_linesw[0]);
extern struct rtems_termios_tty *rtems_termios_ttyHead;
extern struct rtems_termios_tty *rtems_termios_ttyTail;
@@ -111,7 +113,7 @@
rtems_device_minor_number minor,
void *arg,
const rtems_termios_callbacks *callbacks
- )
+)
{
rtems_status_code sc;
rtems_libio_open_close_args_t *args = arg;
@@ -120,14 +122,16 @@
/*
* See if the device has already been opened
*/
- sc = rtems_semaphore_obtain (rtems_termios_ttyMutex,
- RTEMS_WAIT, RTEMS_NO_TIMEOUT);
+ sc = rtems_semaphore_obtain(
+ rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
return sc;
+
for (tty = rtems_termios_ttyHead ; tty != NULL ; tty = tty->forw) {
if ((tty->major == major) && (tty->minor == minor))
break;
}
+
if (tty == NULL) {
static char c = 'a';
@@ -307,20 +311,19 @@
args->iop->data1 = tty;
if (!tty->refcount++) {
if (tty->device.firstOpen)
- (*tty->device.firstOpen)(major, minor, arg);
+ (*tty->device.firstOpen)(major, minor, arg);
+
/*
* start I/O tasks, if needed
*/
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
- sc = rtems_task_start(tty->rxTaskId,
- rtems_termios_rxdaemon,
- (rtems_task_argument)tty);
+ sc = rtems_task_start(
+ tty->rxTaskId, rtems_termios_rxdaemon, (rtems_task_argument)tty);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
- sc = rtems_task_start(tty->txTaskId,
- rtems_termios_txdaemon,
- (rtems_task_argument)tty);
+ sc = rtems_task_start(
+ tty->txTaskId, rtems_termios_txdaemon, (rtems_task_argument)tty);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
}
@@ -343,9 +346,8 @@
while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) {
tty->rawOutBufState = rob_wait;
rtems_interrupt_enable (level);
- sc = rtems_semaphore_obtain (tty->rawOutBuf.Semaphore,
- RTEMS_WAIT,
- RTEMS_NO_TIMEOUT);
+ sc = rtems_semaphore_obtain(
+ tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
rtems_interrupt_disable (level);
@@ -371,31 +373,25 @@
* call discipline-specific close
*/
sc = rtems_termios_linesw[tty->t_line].l_close(tty);
- }
- else {
+ } else {
/*
* default: just flush output buffer
*/
- sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
+ sc = rtems_semaphore_obtain(tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL) {
rtems_fatal_error_occurred (sc);
}
- drainOutput (tty);
+ drainOutput (tty);
}
- if (tty->device.outputUsesInterrupts
- == TERMIOS_TASK_DRIVEN) {
+ if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
/*
* send "terminate" to I/O tasks
*/
- sc = rtems_event_send(
- tty->rxTaskId,
- TERMIOS_RX_TERMINATE_EVENT);
+ sc = rtems_event_send( tty->rxTaskId, TERMIOS_RX_TERMINATE_EVENT );
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
- sc = rtems_event_send(
- tty->txTaskId,
- TERMIOS_TX_TERMINATE_EVENT);
+ sc = rtems_event_send( tty->txTaskId, TERMIOS_TX_TERMINATE_EVENT );
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
}
@@ -406,19 +402,19 @@
if ( rtems_termios_ttyTail != NULL ) {
rtems_termios_ttyTail->forw = NULL;
}
- }
- else {
+ } else {
tty->forw->back = tty->back;
}
+
if (tty->back == NULL) {
rtems_termios_ttyHead = tty->forw;
if ( rtems_termios_ttyHead != NULL ) {
rtems_termios_ttyHead->back = NULL;
}
- }
- else {
+ } else {
tty->back->forw = tty->forw;
}
+
rtems_semaphore_delete (tty->isem);
rtems_semaphore_delete (tty->osem);
rtems_semaphore_delete (tty->rawOutBuf.Semaphore);
@@ -467,17 +463,16 @@
tty->flow_ctrl &= ~FL_OSTOP;
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
- /* if chars available, call write function... */
- (*tty->device.write)(tty->minor,
- &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
+ /* if chars available, call write function... */
+ (*tty->device.write)(
+ tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
}
/* reenable interrupts */
rtems_interrupt_enable(level);
}
}
/* check for incoming XON/XOFF flow control switched off */
- if (( tty->flow_ctrl & FL_MDXOF) &&
- !(tty->termios.c_iflag & IXOFF)) {
+ if (( tty->flow_ctrl & FL_MDXOF) && !(tty->termios.c_iflag & IXOFF)) {
/* clear related flags in flow_ctrl */
tty->flow_ctrl &= ~(FL_MDXOF);
/* FIXME: what happens, if we had sent XOFF but not yet XON? */
@@ -551,8 +546,7 @@
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
- }
- else {
+ } else {
tty->vtimeTicks = tty->termios.c_cc[VTIME] *
rtems_clock_get_ticks_per_second() / 10;
if (tty->termios.c_cc[VTIME]) {
@@ -562,14 +556,12 @@
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
else
tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks;
- }
- else {
+ } else {
if (tty->termios.c_cc[VMIN]) {
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
- }
- else {
+ } else {
tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT;
}
}
@@ -615,16 +607,16 @@
*(int*)(args->buffer)=tty->t_line;
break;
#endif
- case FIONREAD:
- {
- int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head;
- if ( rawnc < 0 )
- rawnc += tty->rawInBuf.Size;
- /* Half guess that this is the right operation */
- *(int *)args->buffer = tty->ccount - tty->cindex + rawnc;
+ case FIONREAD: {
+ int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head;
+ if ( rawnc < 0 )
+ rawnc += tty->rawInBuf.Size;
+ /* Half guess that this is the right operation */
+ *(int *)args->buffer = tty->ccount - tty->cindex + rawnc;
}
break;
}
+
rtems_semaphore_release (tty->osem);
args->ioctl_return = sc;
return sc;
@@ -665,9 +657,8 @@
while (newHead == tty->rawOutBuf.Tail) {
tty->rawOutBufState = rob_wait;
rtems_interrupt_enable (level);
- sc = rtems_semaphore_obtain (tty->rawOutBuf.Semaphore,
- RTEMS_WAIT,
- RTEMS_NO_TIMEOUT);
+ sc = rtems_semaphore_obtain(
+ tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
rtems_interrupt_disable (level);
@@ -679,8 +670,7 @@
if (!(tty->flow_ctrl & FL_ORCVXOF)) {
(*tty->device.write)(tty->minor,
(char *)&tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
- }
- else {
+ } else {
/* remember that output has been stopped due to flow ctrl*/
tty->flow_ctrl |= FL_OSTOP;
}
@@ -769,8 +759,7 @@
while (count--)
oproc (*buffer++, tty);
args->bytes_moved = args->count;
- }
- else {
+ } else {
rtems_termios_puts (args->buffer, args->count, tty);
args->bytes_moved = args->count;
}
@@ -784,15 +773,15 @@
static void
echo (unsigned char c, struct rtems_termios_tty *tty)
{
- if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) {
+ if ((tty->termios.c_lflag & ECHOCTL) &&
+ iscntrl(c) && (c != '\t') && (c != '\n')) {
char echobuf[2];
echobuf[0] = '^';
echobuf[1] = c ^ 0x40;
rtems_termios_puts (echobuf, 2, tty);
tty->column += 2;
- }
- else {
+ } else {
oproc (c, tty);
}
}
@@ -820,14 +809,14 @@
return;
}
}
+
while (tty->ccount) {
unsigned char c = tty->cbuf[--tty->ccount];
if (tty->termios.c_lflag & ECHO) {
if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) {
echo (tty->termios.c_cc[VERASE], tty);
- }
- else if (c == '\t') {
+ } else if (c == '\t') {
int col = tty->read_start_column;
int i = 0;
@@ -838,12 +827,10 @@
c = tty->cbuf[i++];
if (c == '\t') {
col = (col | 7) + 1;
- }
- else if (iscntrl (c)) {
+ } else if (iscntrl (c)) {
if (tty->termios.c_lflag & ECHOCTL)
col += 2;
- }
- else {
+ } else {
col++;
}
}
@@ -882,17 +869,19 @@
{
if (tty->termios.c_iflag & ISTRIP)
c &= 0x7f;
+
if (tty->termios.c_iflag & IUCLC)
c = tolower (c);
+
if (c == '\r') {
if (tty->termios.c_iflag & IGNCR)
return 0;
if (tty->termios.c_iflag & ICRNL)
c = '\n';
- }
- else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) {
+ } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) {
c = '\r';
}
+
if ((c != '\0') && (tty->termios.c_lflag & ICANON)) {
if (c == tty->termios.c_cc[VERASE]) {
erase (tty, 0);
@@ -904,15 +893,13 @@
}
else if (c == tty->termios.c_cc[VEOF]) {
return 1;
- }
- else if (c == '\n') {
+ } else if (c == '\n') {
if (tty->termios.c_lflag & (ECHO | ECHONL))
echo (c, tty);
tty->cbuf[tty->ccount++] = c;
return 1;
- }
- else if ((c == tty->termios.c_cc[VEOL])
- || (c == tty->termios.c_cc[VEOL2])) {
+ } else if ((c == tty->termios.c_cc[VEOL]) ||
+ (c == tty->termios.c_cc[VEOL2])) {
if (tty->termios.c_lflag & ECHO)
echo (c, tty);
tty->cbuf[tty->ccount++] = c;
@@ -966,15 +953,14 @@
n = (*tty->device.pollRead)(tty->minor);
if (n < 0) {
rtems_task_wake_after (1);
- }
- else {
+ } else {
if (siproc (n, tty))
break;
}
}
- }
- else {
+ } else {
rtems_interval then, now;
+
then = rtems_clock_get_ticks_since_boot();
for (;;) {
n = (*tty->device.pollRead)(tty->minor);
@@ -986,8 +972,7 @@
break;
}
}
- }
- else {
+ } else {
if (!tty->termios.c_cc[VTIME])
break;
now = rtems_clock_get_ticks_since_boot();
@@ -996,8 +981,7 @@
}
}
rtems_task_wake_after (1);
- }
- else {
+ } else {
siproc (n, tty);
if (tty->ccount >= tty->termios.c_cc[VMIN])
break;
@@ -1041,11 +1025,9 @@
&& ((tty->rawOutBufState == rob_idle)
|| (tty->flow_ctrl & FL_OSTOP))) {
/* XON should be sent now... */
- (*tty->device.write)(tty->minor,
- (void *)&(tty->termios.c_cc[VSTART]),
- 1);
- }
- else if (tty->flow_ctrl & FL_MDRTS) {
+ (*tty->device.write)(
+ tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
+ } else if (tty->flow_ctrl & FL_MDRTS) {
tty->flow_ctrl &= ~FL_IRTSOFF;
/* activate RTS line */
if (tty->device.startRemoteTx != NULL) {
@@ -1056,10 +1038,9 @@
/* continue processing new character */
if (tty->termios.c_lflag & ICANON) {
- if (siproc (c, tty))
+ if (siproc (c, tty))
wait = 0;
- }
- else {
+ } else {
siproc (c, tty);
if (tty->ccount >= tty->termios.c_cc[VMIN])
wait = 0;
@@ -1071,9 +1052,8 @@
* Wait for characters
*/
if ( wait ) {
- sc = rtems_semaphore_obtain (tty->rawInBuf.Semaphore,
- tty->rawInBufSemaphoreOptions,
- timeout);
+ sc = rtems_semaphore_obtain(
+ tty->rawInBuf.Semaphore, tty->rawInBufSemaphoreOptions, timeout);
if (sc != RTEMS_SUCCESSFUL)
break;
}
@@ -1093,20 +1073,23 @@
sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
return sc;
+
if (rtems_termios_linesw[tty->t_line].l_read != NULL) {
sc = rtems_termios_linesw[tty->t_line].l_read(tty,args);
tty->tty_rcvwakeup = 0;
rtems_semaphore_release (tty->isem);
return sc;
}
+
if (tty->cindex == tty->ccount) {
tty->cindex = tty->ccount = 0;
tty->read_start_column = tty->column;
- if (tty->device.pollRead != NULL
- && tty->device.outputUsesInterrupts == TERMIOS_POLLED)
+ if (tty->device.pollRead != NULL &&
+ tty->device.outputUsesInterrupts == TERMIOS_POLLED)
sc = fillBufferPoll (tty);
else
sc = fillBufferQueue (tty);
+
if (sc != RTEMS_SUCCESSFUL)
tty->cindex = tty->ccount = 0;
}
@@ -1199,15 +1182,14 @@
tty->flow_ctrl &= ~FL_OSTOP;
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
- /* if chars available, call write function... */
- (*tty->device.write)(tty->minor,
- &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1);
+ /* if chars available, call write function... */
+ (*tty->device.write)(
+ tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1);
}
/* reenable interrupts */
rtems_interrupt_enable(level);
}
- }
- else {
+ } else {
newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size;
/* if chars_in_buffer > highwater */
rtems_interrupt_disable(level);
@@ -1226,8 +1208,7 @@
(*tty->device.write)(tty->minor,
(void *)&(tty->termios.c_cc[VSTOP]), 1);
}
- }
- else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
+ } else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
tty->flow_ctrl |= FL_IRTSOFF;
/* deactivate RTS line */
if (tty->device.stopRemoteTx != NULL) {
@@ -1241,8 +1222,7 @@
if (newTail == tty->rawInBuf.Head) {
dropped++;
- }
- else {
+ } else {
tty->rawInBuf.theBuf[newTail] = c;
tty->rawInBuf.Tail = newTail;
@@ -1256,6 +1236,7 @@
}
}
}
+
tty->rawInBufDropped += dropped;
rtems_semaphore_release (tty->rawInBuf.Semaphore);
return dropped;
@@ -1277,8 +1258,7 @@
if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF))
== (FL_MDXOF | FL_IREQXOF)) {
/* XOFF should be sent now... */
- (*tty->device.write)(tty->minor,
- (void *)&(tty->termios.c_cc[VSTOP]), 1);
+ (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1);
rtems_interrupt_disable(level);
tty->t_dqlen--;
@@ -1286,8 +1266,8 @@
rtems_interrupt_enable(level);
nToSend = 1;
- }
- else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF)) == FL_ISNTXOF) {
+
+ } else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF)) == FL_ISNTXOF) {
/* NOTE: send XON even, if no longer in XON/XOFF mode... */
/* XON should be sent now... */
/*
@@ -1296,8 +1276,7 @@
* buffer, although the corresponding data is not yet out!
* Therefore the dequeue "length" should be reduced by 1
*/
- (*tty->device.write)(tty->minor,
- (void *)&(tty->termios.c_cc[VSTART]), 1);
+ (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
rtems_interrupt_disable(level);
tty->t_dqlen--;
@@ -1305,8 +1284,7 @@
rtems_interrupt_enable(level);
nToSend = 1;
- }
- else {
+ } else {
if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) {
/*
* buffer was empty
@@ -1333,6 +1311,7 @@
*/
rtems_semaphore_release (tty->rawOutBuf.Semaphore);
}
+
if (newTail == tty->rawOutBuf.Head) {
/*
* Buffer has become empty
@@ -1357,8 +1336,7 @@
tty->rawOutBufState = rob_busy; /*apm*/
rtems_interrupt_enable(level);
nToSend = 0;
- }
- else {
+ } else {
/*
* Buffer not empty, start tranmitter
*/
@@ -1373,9 +1351,8 @@
nToSend = 1;
}
tty->rawOutBufState = rob_busy; /*apm*/
- (*tty->device.write)(tty->minor,
- &tty->rawOutBuf.theBuf[newTail],
- nToSend);
+ (*tty->device.write)(
+ tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend);
}
tty->rawOutBuf.Tail = newTail; /*apm*/
}
@@ -1406,8 +1383,7 @@
/*
* send wake up to transmitter task
*/
- sc = rtems_event_send(tty->txTaskId,
- TERMIOS_TX_START_EVENT);
+ sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
return 0; /* nothing to output in IRQ... */
@@ -1438,27 +1414,28 @@
/*
* wait for rtems event
*/
- rtems_event_receive((TERMIOS_TX_START_EVENT |
- TERMIOS_TX_TERMINATE_EVENT),
- RTEMS_EVENT_ANY | RTEMS_WAIT,
- RTEMS_NO_TIMEOUT,
- &the_event);
+ rtems_event_receive(
+ (TERMIOS_TX_START_EVENT | TERMIOS_TX_TERMINATE_EVENT),
+ RTEMS_EVENT_ANY | RTEMS_WAIT,
+ RTEMS_NO_TIMEOUT,
+ &the_event
+ );
if ((the_event & TERMIOS_TX_TERMINATE_EVENT) != 0) {
tty->txTaskId = 0;
rtems_task_delete(RTEMS_SELF);
}
- else {
- /*
- * call any line discipline start function
- */
- if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
- rtems_termios_linesw[tty->t_line].l_start(tty);
- }
- /*
- * try to push further characters to device
- */
- rtems_termios_refill_transmitter(tty);
+
+ /*
+ * call any line discipline start function
+ */
+ if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
+ rtems_termios_linesw[tty->t_line].l_start(tty);
}
+
+ /*
+ * try to push further characters to device
+ */
+ rtems_termios_refill_transmitter(tty);
}
}
@@ -1471,32 +1448,32 @@
rtems_event_set the_event;
int c;
char c_buf;
+
while (1) {
/*
* wait for rtems event
*/
- rtems_event_receive((TERMIOS_RX_PROC_EVENT |
- TERMIOS_RX_TERMINATE_EVENT),
- RTEMS_EVENT_ANY | RTEMS_WAIT,
- RTEMS_NO_TIMEOUT,
- &the_event);
+ rtems_event_receive(
+ (TERMIOS_RX_PROC_EVENT | TERMIOS_RX_TERMINATE_EVENT),
+ RTEMS_EVENT_ANY | RTEMS_WAIT,
+ RTEMS_NO_TIMEOUT,
+ &the_event
+ );
if ((the_event & TERMIOS_RX_TERMINATE_EVENT) != 0) {
tty->rxTaskId = 0;
rtems_task_delete(RTEMS_SELF);
}
- else {
+
+ /*
+ * do something
+ */
+ c = tty->device.pollRead(tty->minor);
+ if (c != EOF) {
/*
- * do something
+ * pollRead did call enqueue on its own
*/
- c = tty->device.pollRead(tty->minor);
- if (c != EOF) {
- /*
- * pollRead did call enqueue on its own
- */
- c_buf = c;
- rtems_termios_enqueue_raw_characters (
- tty,&c_buf,1);
- }
+ c_buf = c;
+ rtems_termios_enqueue_raw_characters ( tty,&c_buf,1);
}
}
}
*joel*:
2010-07-05 Joel Sherrill <joel.sherrill at oarcorp.com>
* psxid01/init.c, psxid01/psxid01.doc, psxid01/psxid01.scn: Add test
cases.
M 1.284 testsuites/psxtests/ChangeLog
M 1.2 testsuites/psxtests/psxid01/init.c
M 1.2 testsuites/psxtests/psxid01/psxid01.doc
M 1.2 testsuites/psxtests/psxid01/psxid01.scn
diff -u rtems/testsuites/psxtests/ChangeLog:1.283 rtems/testsuites/psxtests/ChangeLog:1.284
--- rtems/testsuites/psxtests/ChangeLog:1.283 Fri Jul 2 13:51:48 2010
+++ rtems/testsuites/psxtests/ChangeLog Mon Jul 5 16:32:46 2010
@@ -1,3 +1,8 @@
+2010-07-05 Joel Sherrill <joel.sherrill at oarcorp.com>
+
+ * psxid01/init.c, psxid01/psxid01.doc, psxid01/psxid01.scn: Add test
+ cases.
+
2010-07-02 Joel Sherrill <joel.sherrill at oarcorp.com>
* psx13/test.c: Fix warning.
diff -u rtems/testsuites/psxtests/psxid01/init.c:1.1 rtems/testsuites/psxtests/psxid01/init.c:1.2
--- rtems/testsuites/psxtests/psxid01/init.c:1.1 Thu Jul 1 09:40:14 2010
+++ rtems/testsuites/psxtests/psxid01/init.c Mon Jul 5 16:32:47 2010
@@ -90,6 +90,33 @@
sc = issetugid();
rtems_test_assert( sc == 0 );
+
+ puts( "getpgrp - return local node - OK" );
+ pid = getpgrp();
+ printf( "getpgrp returned %d\n", pid );
+
+ puts( "getgroups - return 0 - OK" );
+ sc = getgroups( 0, NULL );
+ rtems_test_assert( sc == 0 );
+
+}
+
+void test_getlogin(void)
+{
+ int sc;
+ char ch;
+
+ printf( "getlogin() -- %s\n", getlogin() );
+
+ puts( "getlogin_r(NULL, LOGIN_NAME_MAX) -- EFAULT" );
+ sc = getlogin_r( NULL, LOGIN_NAME_MAX );
+ rtems_test_assert( sc == EFAULT );
+
+ puts( "getlogin_r(buffer, 0) -- ERANGE" );
+ sc = getlogin_r( &ch, 0 );
+ rtems_test_assert( sc == ERANGE );
+
+
}
rtems_task Init(
@@ -107,6 +134,8 @@
test_pid();
puts( "" );
+ test_getlogin();
+
puts( "*** END OF TEST ID 01 ***" );
rtems_test_exit(0);
diff -u rtems/testsuites/psxtests/psxid01/psxid01.doc:1.1 rtems/testsuites/psxtests/psxid01/psxid01.doc:1.2
--- rtems/testsuites/psxtests/psxid01/psxid01.doc:1.1 Thu Jul 1 09:40:14 2010
+++ rtems/testsuites/psxtests/psxid01/psxid01.doc Mon Jul 5 16:32:47 2010
@@ -28,6 +28,10 @@
__getpid
getppid
setsid
+ getpgrp
+ getgroups
+ getlogin
+ getlogin_r
concepts:
diff -u rtems/testsuites/psxtests/psxid01/psxid01.scn:1.1 rtems/testsuites/psxtests/psxid01/psxid01.scn:1.2
--- rtems/testsuites/psxtests/psxid01/psxid01.scn:1.1 Thu Jul 1 09:40:14 2010
+++ rtems/testsuites/psxtests/psxid01/psxid01.scn Mon Jul 5 16:32:48 2010
@@ -16,5 +16,11 @@
__getpid = 1
getppid = 0
setsid - EPERM
+getpgrp - return local node - OK
+getpgrp returned 1
+getgroups - return 0 - OK
+getlogin() --
+getlogin_r(NULL, LOGIN_NAME_MAX) -- EFAULT
+getlogin_r(buffer, 0) -- ERANGE
*** END OF TEST ID 01 ***
*joel*:
2010-07-05 Joel Sherrill <joel.sherrill at oarcorp.com>
* psxid01/init.c, psxid01/psxid01.scn: Actually match an entry in
/etc/passwd and /etc/group.
M 1.285 testsuites/psxtests/ChangeLog
M 1.3 testsuites/psxtests/psxid01/init.c
M 1.3 testsuites/psxtests/psxid01/psxid01.scn
diff -u rtems/testsuites/psxtests/ChangeLog:1.284 rtems/testsuites/psxtests/ChangeLog:1.285
--- rtems/testsuites/psxtests/ChangeLog:1.284 Mon Jul 5 16:32:46 2010
+++ rtems/testsuites/psxtests/ChangeLog Mon Jul 5 17:01:05 2010
@@ -1,5 +1,10 @@
2010-07-05 Joel Sherrill <joel.sherrill at oarcorp.com>
+ * psxid01/init.c, psxid01/psxid01.scn: Actually match an entry in
+ /etc/passwd and /etc/group.
+
+2010-07-05 Joel Sherrill <joel.sherrill at oarcorp.com>
+
* psxid01/init.c, psxid01/psxid01.doc, psxid01/psxid01.scn: Add test
cases.
diff -u rtems/testsuites/psxtests/psxid01/init.c:1.2 rtems/testsuites/psxtests/psxid01/init.c:1.3
--- rtems/testsuites/psxtests/psxid01/init.c:1.2 Mon Jul 5 16:32:47 2010
+++ rtems/testsuites/psxtests/psxid01/init.c Mon Jul 5 17:01:06 2010
@@ -106,7 +106,15 @@
int sc;
char ch;
- printf( "getlogin() -- %s\n", getlogin() );
+ puts( "setuid(5)" );
+ sc = setuid(5);
+ rtems_test_assert( sc == 0 );
+ printf( "getlogin() -- (%s)\n", getlogin() );
+
+ puts( "setuid(0)" );
+ sc = setuid(0);
+ rtems_test_assert( sc == 0 );
+ printf( "getlogin() -- (%s)\n", getlogin() );
puts( "getlogin_r(NULL, LOGIN_NAME_MAX) -- EFAULT" );
sc = getlogin_r( NULL, LOGIN_NAME_MAX );
@@ -146,7 +154,9 @@
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
-#define CONFIGURE_MAXIMUM_TASKS 1
+#define CONFIGURE_MAXIMUM_TASKS 1
+/* so we can write /etc/passwd and /etc/group */
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_INIT
diff -u rtems/testsuites/psxtests/psxid01/psxid01.scn:1.2 rtems/testsuites/psxtests/psxid01/psxid01.scn:1.3
--- rtems/testsuites/psxtests/psxid01/psxid01.scn:1.2 Mon Jul 5 16:32:48 2010
+++ rtems/testsuites/psxtests/psxid01/psxid01.scn Mon Jul 5 17:01:06 2010
@@ -20,7 +20,10 @@
getpgrp returned 1
getgroups - return 0 - OK
-getlogin() --
+setuid(5)
+getlogin() -- ()
+setuid(0)
+getlogin() -- (root)
getlogin_r(NULL, LOGIN_NAME_MAX) -- EFAULT
getlogin_r(buffer, 0) -- ERANGE
*** END OF TEST ID 01 ***
--
Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100705/a42ac954/attachment-0001.html>
More information about the vc
mailing list