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