Annotation of dietlibc/t.c, revision 1.3
1.1 cvs 1: #include <unistd.h>
2: #include <endian.h>
3: #include <stdlib.h>
4: #include <dirent.h>
5: #include <pwd.h>
6: #include <stdio.h>
7: #include <assert.h>
8: #include <sys/mount.h>
9:
10: int main() {
1.2 fefe 11: printf("%d\n",strcmp("ustar","ustar"));
1.3 ! fefe 12: sleep(1);
! 13: printf("duh\n");
1.2 fefe 14: #if 0
1.1 cvs 15: int i;
16: for (i=0; i<5; i++) {
17: fprintf(stdout,"first message\n");
18: fprintf(stdout,"second message\n");
19: fprintf(stdout,"third message\n");
20: printf("foo %d\n",i);
21: }
1.2 fefe 22: #endif
1.1 cvs 23: #if 0
24: char buf[1024];
25: sscanf("foo bar","%s",buf);
26: printf("%s\n",buf);
27: #endif
28: #if 0
29: mount("/dev/scsi/host0/bus0/target2/lun0/cd", "/cd", "iso9660", MS_MGC_VAL|MS_RDONLY, NULL);
30: perror("mount");
31: #endif
32: #if 0
33: char *t="<4>Linux version 2.4.0-test10 (leitner@hellhound) (gcc version 2.95.2 19991024 (release))";
34: int i=strtol(t+1,&t,10);
35: printf("%d %s\n",i,t);
36: #endif
37: #if 0
38: char **tmp;
39: putenv("FOO");
40: assert(1==2);
41: for (tmp=environ; *tmp; tmp++)
42: puts(*tmp);
43: #endif
44: #if 0
45: char buf[1024];
46: printf("%d\n",fprintf(stderr,"duh\n"));
47: #endif
48: #if 0
49: struct passwd *p=getpwuid(100);
50: puts(p->pw_name);
51: #endif
52: #if 0
53: int pid;
54: char name[32];
55: sscanf("1 (init","%d (%15c",&pid,name);
56: printf("pid %d name %s\n",pid,name);
57: #endif
58: #if 0
59: DIR *d=opendir("/proc");
60: if (d) {
61: struct dirent *D;
62: while (D=readdir(d))
63: puts(D->d_name);
64: closedir(d);
65: }
66: #endif
67: #if 0
68: char buf[1024];
69: int fd=open("/etc/passwd",0);
70: pread(fd,buf,30,32);
71: close(fd);
72: write(1,buf,32);
73: #endif
74: #if 0
75: char *argv[] = {"echo","foo",0};
76: char buf[100];
77: buf[5]='x';
78: sprintf(buf,"foo\n");
79: if (buf[5] == 'x')
80: exit(0);
81: else
82: exit(1);
83: execvp(argv[0],argv);
84: #endif
85: #if 0
86: struct stat64 f;
87: char buf[128];
88: fstat64(0,&f);
89: fprintf(stderr,"%d %d\n",f.st_size,sizeof(f));
90: return 0;
91: #endif
92: #if 0
93: FILE *f=fopen("foo","w");
94: fputc('a',f);
95: fputc('b',f);
96: fputc('c',f);
97: #endif
98: /* fprintf(stdout,"foo\n"); */
99: }
LinuxTV legacy CVS <linuxtv.org/cvs>