Version:
~ [ 0.6-2.3.46 ] ~
Architecture:
~ [ um ] ~
** Warning: Cannot open xref database.
1 #include <unistd.h>
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <termios.h>
5 #include "include/user_util.h"
6
7 char padding[256] = { [ 0 ... 127 ] = ' ', '\0' };
8
9 int main(int argc, char **argv, char **envp)
10 {
11 struct termios tt;
12 int ret, i, n;
13 char **new_argv;
14
15 n = 0;
16 for(i=1;i<argc;i++) n += strlen(argv[i]);
17 if(n < 128){
18 new_argv = malloc((argc + 2) * sizeof(char *));
19 for(i=0;i<argc;i++) new_argv[i] = argv[i];
20 new_argv[argc] = padding;
21 new_argv[argc + 1] = NULL;
22 execve(new_argv[0], new_argv, envp);
23 perror("Failed to exec with padded args");
24 exit(1);
25 }
26 get_profile_timer();
27 tcgetattr(0, &tt);
28 ret = 0;
29 if(linux_main(argc, argv)){
30 printf("\n");
31 execve(argv[0], argv, envp);
32 perror("Failed to exec kernel");
33 ret = 1;
34 }
35 tcsetattr(0, TCSADRAIN, &tt);
36 printf("\n");
37 return(ret);
38 }
39
40 #ifdef PROFILING
41 extern void block_shlib_mem(void);
42 extern void __real___monstartup (unsigned long, unsigned long);
43
44 void __wrap___monstartup (unsigned long lowpc, unsigned long highpc)
45 {
46 block_shlib_mem();
47 __real___monstartup(lowpc, highpc);
48 }
49 #endif
50
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.