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