4.104.115
Last change
on this file since a00d2e5f was
a00d2e5f,
checked in by Ralf Corsepius <ralf.corsepius@…>, on 10/26/09 at 05:30:29
|
2009-10-26 Ralf Corsépius <ralf.corsepius@…>
- support/src/test_support.c: Add missing prototypes.
|
-
Property mode set to
100644
|
File size:
1.5 KB
|
Line | |
---|
1 | /* long_name |
---|
2 | * |
---|
3 | * This set of routines is create names that are the maximum length or one over |
---|
4 | * the maximum length. |
---|
5 | * |
---|
6 | * Output parameters: constant character string of max length or max length + 1 |
---|
7 | * |
---|
8 | * COPYRIGHT (c) 1989-2008. |
---|
9 | * On-Line Applications Research Corporation (OAR). |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in the file LICENSE in this distribution or at |
---|
13 | * http://www.rtems.com/license/LICENSE. |
---|
14 | * |
---|
15 | * $Id$ |
---|
16 | */ |
---|
17 | |
---|
18 | #include <fcntl.h> |
---|
19 | #include <tmacros.h> |
---|
20 | #include "test_support.h" |
---|
21 | |
---|
22 | static char Too_Long_Name[PATH_MAX + 2]; |
---|
23 | static char Longest_Name[PATH_MAX + 1]; |
---|
24 | |
---|
25 | const char *Get_Too_Long_Name(void) |
---|
26 | { |
---|
27 | int i; |
---|
28 | |
---|
29 | for ( i=0; i <= PATH_MAX; i++ ) |
---|
30 | Too_Long_Name[i] = 'E'; |
---|
31 | Too_Long_Name[i] = '\0'; |
---|
32 | return Too_Long_Name; |
---|
33 | } |
---|
34 | |
---|
35 | const char *Get_Longest_Name(void) |
---|
36 | { |
---|
37 | int i; |
---|
38 | |
---|
39 | for ( i=0; i < PATH_MAX-1; i++ ) |
---|
40 | Longest_Name[i] = 'L'; |
---|
41 | Longest_Name[i] = '\0'; |
---|
42 | return Longest_Name; |
---|
43 | } |
---|
44 | |
---|
45 | void Allocate_majority_of_workspace( int smallest ) |
---|
46 | { |
---|
47 | bool result; |
---|
48 | Heap_Information_block info; |
---|
49 | void *temp; |
---|
50 | |
---|
51 | puts("Allocate_majority_of_workspace: "); |
---|
52 | result = rtems_workspace_get_information( &info ); |
---|
53 | if ( result != TRUE ) |
---|
54 | perror("==> Error Getting workspace information"); |
---|
55 | |
---|
56 | do { |
---|
57 | result = rtems_workspace_allocate( |
---|
58 | info.Free.largest-16, |
---|
59 | &temp |
---|
60 | ); |
---|
61 | if ((!result) || (!temp)) |
---|
62 | perror("Unable to allocate from workspace"); |
---|
63 | result = rtems_workspace_get_information( &info ); |
---|
64 | } while ( info.Free.largest >= smallest ); |
---|
65 | |
---|
66 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.