source: rtems-libbsd/testsuite/init01/test_main.c @ e599318

4.1155-freebsd-126-freebsd-12freebsd-9.3
Last change on this file since e599318 was e599318, checked in by Sebastian Huber <sebastian.huber@…>, on 10/09/13 at 20:52:54

Update files to match FreeBSD layout

Add compatibility with Newlib header files. Some FreeBSD header files
are mapped by the translation script:

o rtems/bsd/sys/_types.h
o rtems/bsd/sys/errno.h
o rtems/bsd/sys/lock.h
o rtems/bsd/sys/param.h
o rtems/bsd/sys/resource.h
o rtems/bsd/sys/time.h
o rtems/bsd/sys/timespec.h
o rtems/bsd/sys/types.h
o rtems/bsd/sys/unistd.h

It is now possible to include <sys/socket.h> directly for example.

Generate one Makefile which builds everything including tests.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*
2 *  This is the body of the test. It does not do much except ensure
3 *  that the target is alive after initializing the TCP/IP stack.
4 */
5
6#include <stdlib.h>
7#include <stdio.h>
8#include <unistd.h>
9
10#define TEST_NAME "LIBBSD INIT 1"
11
12static void test_main(void)
13{
14  puts( "Sleeping to see what happens" );
15  sleep( 5 );
16
17  puts( "*** END OF " TEST_NAME " TEST ***" );
18  exit( 0 );
19}
20
21/* for old configuration structure */
22#include <rtems/rtems_bsdnet.h>
23
24/*
25 * Network configuration
26 */
27struct rtems_bsdnet_config rtems_bsdnet_config = {
28    NULL,                   /* Network interface */
29    NULL,                   /* Use fixed network configuration */
30    0,                      /* Default network task priority */
31    0,                      /* Default mbuf capacity */
32    0,                      /* Default mbuf cluster capacity */
33    "testSystem",           /* Host name */
34    "nowhere.com",          /* Domain name */
35    "127.0.0.1",            /* Gateway */
36    "127.0.0.1",            /* Log host */
37    {"127.0.0.1" },         /* Name server(s) */
38    {"127.0.0.1" },         /* NTP server(s) */
39    0,
40    0,
41    0,
42    0,
43    0
44};
45
46#include <rtems/bsd/test/default-init.h>
Note: See TracBrowser for help on using the repository browser.