Subversion Repositories Kolibri OS

Rev

Rev 1693 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1693 Rev 1906
Line 14... Line 14...
14
 
14
 
15
#include 
15
#include 
16
#include 
16
#include 
17
#include 
17
#include 
-
 
18
#include 
-
 
19
#include 
-
 
20
#include 
18
#include 
21
 
Line 19... Line 22...
19
#include "cpu_features.h"
22
#include "cpu_features.h"
20
 
23
 
Line 49... Line 52...
49
{
52
{
50
    return NULL;
53
    return NULL;
51
}
54
}
Line 52... Line 55...
52
 
55
 
53
void __main (){};
-
 
54
 
-
 
55
 
56
void __main (){};
Line 56... Line 57...
56
void init_reent();
57
void init_reent();
57
 
58
 
58
void  __attribute__((noreturn))
59
void  __attribute__((noreturn))
Line 71... Line 72...
71
    retval = entry(param);              // call user thread function
72
    retval = entry(param);              // call user thread function
Line 72... Line 73...
72
 
73
 
73
    _exit(retval);
74
    _exit(retval);
Line -... Line 75...
-
 
75
};
-
 
76
 
-
 
77
struct app_hdr
-
 
78
{
-
 
79
    char  banner[8];
-
 
80
    int   version;
-
 
81
    int   start;
-
 
82
    int   iend;
-
 
83
    int   memsize;
-
 
84
    int   stacktop;
-
 
85
    char  *cmdline;
-
 
86
    char  *path;
-
 
87
};
74
};
88
 
75
 
89
 
76
void  __attribute__((noreturn))
90
void  __attribute__((noreturn))
77
__crt_startup (void)
91
__crt_startup (void)
-
 
92
{
-
 
93
    int nRet;
Line 78... Line 94...
78
{
94
    struct   app_hdr *header;
Line 79... Line 95...
79
    int nRet;
95
 
80
 
96
 
Line 87... Line 103...
87
//  _fpreset ();              /* Supplied by the runtime library. */
103
//  _fpreset ();              /* Supplied by the runtime library. */
Line 88... Line 104...
88
 
104
 
Line 89... Line 105...
89
    __initPOSIXHandles();
105
    __initPOSIXHandles();
90
 
-
 
91
    __appcwdlen = strrchr(&__pgmname, '/') - &__pgmname + 1;
106
 
92
 
-
 
93
    __appcwdlen = __appcwdlen > 1023 ? 1023 : __appcwdlen;
107
    __appcwdlen = strrchr(&__pgmname, '/') - &__pgmname + 1;
94
 
108
    __appcwdlen = __appcwdlen > 1023 ? 1023 : __appcwdlen;
Line -... Line 109...
-
 
109
    memcpy(__appcwd, &__pgmname, __appcwdlen);
-
 
110
    __appcwd[__appcwdlen] = 0;
95
    strncpy(__appcwd, &__pgmname, __appcwdlen);
111
 
Line 96... Line 112...
96
    __appcwd[__appcwdlen] = 0;
112
    set_cwd(__appcwd);
97
 
113
 
98
    arg[0] = &__pgmname;
114
    arg[0] = &__pgmname;
Line 111... Line 127...
111
   * and stderr, as well
127
   * and stderr, as well
112
   * NOTE: DLLs don't do this because that would be rude!
128
   * NOTE: DLLs don't do this because that would be rude!
113
   */
129
   */
114
//  _mingw32_init_fmode ();
130
//  _mingw32_init_fmode ();
Line -... Line 131...
-
 
131
 
115
 
132
 
Line 116... Line 133...
116
    nRet = main (_argc, _argv, NULL);
133
    nRet = main (_argc, _argv, NULL);
117
 
134
 
118
  /*
135
  /*
119
   * Perform exit processing for the C library. This means
136
   * Perform exit processing for the C library. This means
120
   * flushing output and calling 'atexit' registered functions.
137
   * flushing output and calling 'atexit' registered functions.
121
   */
138
   */