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