Annotation of dietlibc/t.c, revision 1.11
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>
1.7 fefe 9: #include <time.h>
1.9 fefe 10: #include <sys/stat.h>
1.10 fefe 11: #include <stdio.h>
1.1 cvs 12:
13: int main() {
1.11 ! fefe 14: printf("%-19s %10lu %9lu %9lu %3d%% %s\n","/dev/ide/host0/bus0/target0/lun0/part2",8393688,705683,1337084,85,"/");
! 15: #if 0
1.10 fefe 16: char buf[100];
17: fgets(buf,100,stdin); printf("got %d bytes\n",strlen(buf));
18: fgets(buf,100,stdin); printf("got %d bytes\n",strlen(buf));
1.11 ! fefe 19: #endif
1.9 fefe 20: #if 0
1.7 fefe 21: struct tm duh;
22: time_t t;
1.8 fefe 23: time(&t);
24: gmtime_r(&t,&duh);
25: printf("%s\n",asctime(&duh));
1.9 fefe 26: #endif
1.8 fefe 27: #if 0
1.7 fefe 28: char buf[30];
29: duh.tm_sec=42;
30: duh.tm_min=23;
31: duh.tm_hour=17;
32: duh.tm_mday=2;
33: duh.tm_mon=7;
34: duh.tm_year=100;
35: t=mktime(&duh);
36: printf("%s\n",asctime_r(&duh,buf));
1.8 fefe 37: #endif
1.2 fefe 38: #if 0
1.1 cvs 39: int i;
40: for (i=0; i<5; i++) {
41: fprintf(stdout,"first message\n");
42: fprintf(stdout,"second message\n");
43: fprintf(stdout,"third message\n");
44: printf("foo %d\n",i);
45: }
1.2 fefe 46: #endif
1.1 cvs 47: #if 0
48: char buf[1024];
49: sscanf("foo bar","%s",buf);
50: printf("%s\n",buf);
51: #endif
52: #if 0
53: mount("/dev/scsi/host0/bus0/target2/lun0/cd", "/cd", "iso9660", MS_MGC_VAL|MS_RDONLY, NULL);
54: perror("mount");
55: #endif
56: #if 0
57: char *t="<4>Linux version 2.4.0-test10 (leitner@hellhound) (gcc version 2.95.2 19991024 (release))";
58: int i=strtol(t+1,&t,10);
59: printf("%d %s\n",i,t);
60: #endif
61: #if 0
62: char **tmp;
63: putenv("FOO");
64: assert(1==2);
65: for (tmp=environ; *tmp; tmp++)
66: puts(*tmp);
67: #endif
68: #if 0
69: char buf[1024];
70: printf("%d\n",fprintf(stderr,"duh\n"));
71: #endif
72: #if 0
73: struct passwd *p=getpwuid(100);
74: puts(p->pw_name);
75: #endif
76: #if 0
77: int pid;
78: char name[32];
79: sscanf("1 (init","%d (%15c",&pid,name);
80: printf("pid %d name %s\n",pid,name);
81: #endif
82: #if 0
83: DIR *d=opendir("/proc");
84: if (d) {
85: struct dirent *D;
86: while (D=readdir(d))
87: puts(D->d_name);
88: closedir(d);
89: }
90: #endif
91: #if 0
92: char buf[1024];
93: int fd=open("/etc/passwd",0);
94: pread(fd,buf,30,32);
95: close(fd);
96: write(1,buf,32);
97: #endif
98: #if 0
99: char *argv[] = {"echo","foo",0};
100: char buf[100];
101: buf[5]='x';
102: sprintf(buf,"foo\n");
103: if (buf[5] == 'x')
104: exit(0);
105: else
106: exit(1);
107: execvp(argv[0],argv);
108: #endif
1.10 fefe 109: #if 0
1.1 cvs 110: struct stat64 f;
111: char buf[128];
112: fstat64(0,&f);
113: fprintf(stderr,"%d %d\n",f.st_size,sizeof(f));
114: return 0;
115: #endif
116: #if 0
117: FILE *f=fopen("foo","w");
118: fputc('a',f);
119: fputc('b',f);
120: fputc('c',f);
121: #endif
122: /* fprintf(stdout,"foo\n"); */
123: }
LinuxTV legacy CVS <linuxtv.org/cvs>