Annotation of dietlibc/t.c, revision 1.134
1.56 fefe 1: #define _GNU_SOURCE
1.47 fefe 2: #define _FILE_OFFSET_BITS 64
1.1 cvs 3: #include <unistd.h>
4: #include <endian.h>
5: #include <stdlib.h>
6: #include <dirent.h>
7: #include <pwd.h>
1.40 fefe 8: #include <shadow.h>
1.1 cvs 9: #include <stdio.h>
10: #include <assert.h>
11: #include <sys/mount.h>
1.7 fefe 12: #include <time.h>
1.9 fefe 13: #include <sys/stat.h>
1.10 fefe 14: #include <stdio.h>
1.12 fefe 15: #include <arpa/inet.h>
1.13 fefe 16: #include <sys/sem.h>
1.14 fefe 17: #include <sys/shm.h>
1.17 fefe 18: #include <math.h>
1.20 fefe 19: #include <termios.h>
1.22 fefe 20: #include <netdb.h>
1.38 fefe 21: #include <sys/mman.h>
1.45 fefe 22: #include <ctype.h>
1.49 fefe 23: #include <mntent.h>
1.53 fefe 24: #include <regex.h>
1.56 fefe 25: #include <sys/types.h>
26: #include <sys/msg.h>
1.63 fefe 27: #include <string.h>
1.76 fefe 28: #include <sys/socket.h>
29: #include <netdb.h>
1.86 fefe 30: #include <signal.h>
1.88 fefe 31: #include <sys/io.h>
1.97 fefe 32: #include <getopt.h>
1.101 fefe 33: #include <arpa/nameser.h>
34: #include <resolv.h>
1.102 fefe 35: #include <fnmatch.h>
1.109 fefe 36: #include <stdarg.h>
1.118 fefe 37: #include <sys/wait.h>
1.133 fefe 38: #include <libgen.h>
1.71 fefe 39:
1.121 fefe 40: #include <errno.h>
41: #include <syslog.h>
42: #include <sys/un.h>
43: #include <fcntl.h>
44:
45: #if 0
46: static const char* Ident;
47: static int Option;
48: static int Facility;
49: static struct sockaddr_un sock;
50: static int fd=-1;
51:
52: static void syslogconnect(void) {
53: sock.sun_family=AF_UNIX;
54: strcpy(sock.sun_path,"/dev/log");
55: if ((fd=socket(AF_UNIX,SOCK_STREAM,0))==-1) return;
56: if (connect(fd,(struct sockaddr*)&sock,sizeof(sock))==-1) {
57: int save=errno;
58: close(fd);
59: fd=-1;
1.109 fefe 60: }
1.121 fefe 61: fcntl(fd,F_SETFL,FD_CLOEXEC); /* doesn't work? too bad */
1.109 fefe 62: }
1.107 fefe 63:
1.121 fefe 64: void openlog(const char *ident, int option, int facility) {
65: Ident=ident;
66: Option=option;
67: Facility=facility;
68: syslogconnect();
1.116 fefe 69: }
70:
1.121 fefe 71: void syslog(int priority, const char *format, ...) {
72: /* write(fd,"<13>Jun 29 19:21:32 leitner: fnord",...) */
73: }
74:
75: void closelog(void) {
76: }
77: #endif
78:
1.97 fefe 79: int main(int argc,char *argv[]) {
1.134 ! fefe 80: #if 0
1.133 fefe 81: char* paths[]={"/usr/lib","/usr/","usr","/",".",".."};
82: char* want[]={"/usr","/",".","/",".","."};
83: int i;
84: for (i=0; i<6; ++i) {
85: printf("%s\t%s\t%s\n",paths[i],want[i],dirname(strdup(paths[i])));
86: }
1.134 ! fefe 87: #endif
1.133 fefe 88: #if 0
89: char* paths[]={"/usr/lib","/usr/","usr","/",".",".."};
90: char* want[]={"lib","usr","usr","/",".",".."};
91: int i;
92: for (i=0; i<6; ++i) {
93: printf("%s\t%s\t%s\n",paths[i],want[i],basename(strdup(paths[i])));
94: }
95: #endif
96: #if 0
1.132 fefe 97: int i;
98: for (i=0; i<255; ++i) {
99: int a=isalpha(i);
100: int b=(i>='a' && i<='z') || (i>='A' && i<='Z');
101: if (a!=b) printf("%d: %d %d\n",i,a,b);
102: }
1.133 fefe 103: #endif
1.131 fefe 104: #if 0
1.130 fefe 105: char* name;
106: int ptyfd,ttyfd;
107: int i=openpty(&ptyfd,&ttyfd,0,0,0);
108: if (i<0) perror("openpty");
109: printf("%d %d\n",ptyfd,ttyfd);
110: printf("%s %s\n",ttyname(ptyfd),ttyname(ttyfd));
1.131 fefe 111: #endif
1.129 fefe 112: #if 0
113: printf("0x%8.7lx\n",0xfefe);
114: #endif
115: #if 0
1.128 fefe 116: puts(ttyname(0));
1.129 fefe 117: #endif
1.125 fefe 118: #if 0
119: char buf[1024];
120: struct hostent* r;
121: while (r=gethostent_r(buf,1024)) {
122: if (r && r->h_name) {
123: printf("name %s\n", r->h_name);
124: }
125: if (r && (r->h_addr_list)[0]) {
126: struct in_addr address;
127: address = *((struct in_addr *) (r->h_addr_list)[0]);
128: printf("addr %s\n", inet_ntoa(address));
129: }
130: }
131: #endif
132: #if 0
1.124 fefe 133: char *tmp;
134: printf("%lu\n",strtol("0xf0000000",&tmp,0));
1.125 fefe 135: #endif
1.128 fefe 136: #if 0
1.123 fefe 137: struct mntent* me;
1.127 fefe 138: FILE* f=fopen("/etc/fstab","r");
1.123 fefe 139: while (me=getmntent(f)) {
140: printf("%s %s %s %s %d %d\n",me->mnt_fsname,me->mnt_dir,me->mnt_type,me->mnt_opts,me->mnt_freq,me->mnt_passno);
141: }
1.124 fefe 142: #endif
1.123 fefe 143: #if 0
144: char *tmp;
145: printf("%x\n",strtol("0Xffff",&tmp,16));
146: #endif
1.122 fefe 147: // putchar('c');
148: // write(1,"fnord\n",6);
1.132 fefe 149: #if 0
1.121 fefe 150: struct addrinfo *ai;
1.131 fefe 151: getaddrinfo("nagus","22",0,&ai);
1.121 fefe 152: #endif
1.122 fefe 153: #if 0
1.121 fefe 154: struct hostent host,*res;
155: char buf[4096];
156: int fnord;
157:
1.131 fefe 158: gethostbyname2_r("nagus",AF_INET,&host,buf,4096,&res,&fnord);
1.122 fefe 159: #endif
1.121 fefe 160: #if 0
1.119 fefe 161: char buf[128];
1.120 fefe 162: strcpy(buf,"/tmp/fnord/foo.XXXXXXX");
1.119 fefe 163: printf("%d\n",mkdtemp(buf));
164: printf("%s\n",buf);
1.120 fefe 165: #endif
1.119 fefe 166: #if 0
1.118 fefe 167: printf("%d\n",WEXITSTATUS(system("exit 17")));
1.119 fefe 168: #endif
1.113 fefe 169: #if 0
1.109 fefe 170: fnord("fnord","foo\n","bar\n",0);
1.112 fefe 171: assert(0);
1.113 fefe 172: #endif
1.105 fefe 173: #if 0
174: printf("%hd %hhd\n",-5,-1234567);
175: #endif
1.103 fefe 176: #if 0
1.102 fefe 177: printf("%d\n",fnmatch("*.o", "x.o", FNM_PATHNAME));
178: printf("%d\n",fnmatch("a/b/*", "a/b/c/d", FNM_PATHNAME));
1.103 fefe 179: #endif
1.102 fefe 180: #if 0
1.101 fefe 181: char buf[1024];
182: int len;
183: len=res_search("fu-berlin.de",ns_c_in,ns_t_ns,buf,sizeof(buf));
1.102 fefe 184: #endif
1.114 fefe 185: #if 0
1.100 fefe 186: regex_t t;
187: regmatch_t rm;
1.103 fefe 188: // regcomp(&t,"^ *read",0);
1.113 fefe 189: regcomp(&t,"\\<foo\\>",0);
190: printf("%d\n",regexec(&t," blub foo,",1,&rm,0));
1.100 fefe 191: printf("ofs %d\n",rm.rm_so);
1.101 fefe 192: #endif
1.100 fefe 193: #if 0
1.98 fefe 194: char buf[100];
1.99 fefe 195: printf("%d\n",fread(buf,1,0,stdin));
1.100 fefe 196: #endif
1.99 fefe 197: #if 0
198: char buf[100];
1.98 fefe 199: memset(buf,17,100);
200: buf[0]=0;
201: strncat(buf,"foobarbaz23",10);
202: puts(buf);
1.99 fefe 203: #endif
1.98 fefe 204: #if 0
1.97 fefe 205: int aflag = 0;
206: int bflag = 0;
207: char *cvalue = NULL;
208: int index;
209: int c;
210:
211: opterr = 1;
212:
213: while ((c = getopt (argc, argv, "abc:")) != -1)
214: switch (c)
215: {
216: case 'a':
217: aflag = 1;
218: break;
219: case 'b':
220: bflag = 1;
221: break;
222: case 'c':
223: cvalue = optarg;
224: break;
225: case '?':
226: if (isprint (optopt))
227: fprintf (stderr, "Unknown option `-%c'.\n", optopt);
228: else
229: fprintf (stderr,
230: "Unknown option character `\\x%x'.\n",
231: optopt);
232: return 1;
233: default:
234: abort ();
235: }
1.96 fefe 236:
1.97 fefe 237: printf ("aflag = %d, bflag = %d, cvalue = %s\n",
238: aflag, bflag, cvalue);
239:
240: for (index = optind; index < argc; index++)
241: printf ("Non-option argument %s\n", argv[index]);
242: return 0;
1.98 fefe 243: #endif
1.97 fefe 244: #if 0
1.96 fefe 245: char *t="foobar";
246: char *c;
247: char buf[1000];
248: puts(strcat(strcpy(buf,"HOME="),t));
1.97 fefe 249: #endif
1.89 fefe 250: #if 0
251: struct netent* n=getnetbyname("loopback");
252: printf("%s %s\n",n->n_name,inet_ntoa(*(struct in_addr*)&n->n_net));
253: #endif
254: #if 0
1.88 fefe 255: fprintf(stdout,"foo\n");
256: sleep(1);
257: fprintf(stdout,"bar");
258: fprintf(stderr,"blonk");
259: sleep(1);
260: fprintf(stdout,"\rbz");
261: sleep(1);
262: fprintf(stdout,"\n");
263: sleep(1);
1.89 fefe 264: #endif
1.87 fefe 265: #if 0
1.86 fefe 266: sigset_t s; /* sigsetops */
267:
268: sigemptyset(&s);
269: sigaddset(&s,SIGCHLD);
270: sigaddset(&s,SIGHUP);
271: sigsuspend(&s);
1.87 fefe 272: #endif
1.85 fefe 273: #if 0
1.84 fefe 274: char buf[1024];
275: FILE *f=popen("uname -srm","r");
276: fgets(buf,1023,f);
277: pclose(f);
278: write(1,buf,strlen(buf));
1.85 fefe 279: #endif
1.84 fefe 280: #if 0
1.82 fefe 281: char type[64];
1.83 fefe 282: char filename[256];
283: int major,minor;
1.82 fefe 284: int len;
1.83 fefe 285: printf("%d\n",sscanf("GET / HTTP/1.0\r\n","%4[A-Z] %255[^ \t\r\n] HTTP/%d.%d",type,filename,&major,&minor));
286: printf("%s %s %d %d\n",type,filename,major,minor);
1.84 fefe 287: #endif
1.82 fefe 288: #if 0
1.81 fefe 289: char buf[100];
290: char ip[16];
291: memset(ip,0,16);
292: printf("%p %p\n",inet_ntop(AF_INET6,ip,buf,100),buf);
293: puts(buf);
1.82 fefe 294: #endif
1.127 fefe 295: #if 0
1.76 fefe 296: struct addrinfo *ai;
1.78 fefe 297: struct addrinfo hints;
1.79 fefe 298: char buf[16];
1.78 fefe 299: hints.ai_family = AF_UNSPEC;
1.79 fefe 300: hints.ai_flags = AI_PASSIVE|AI_CANONNAME;
1.78 fefe 301: hints.ai_socktype = SOCK_STREAM;
1.126 fefe 302: printf("%d\n",getaddrinfo("xorn.continuum.local","ssh",0,&ai));
1.76 fefe 303: while (ai) {
304: printf("found host %s, port %d, family %s, socktype %s\n",ai->ai_canonname,
305: ntohs(ai->ai_family==AF_INET6?((struct sockaddr_in6*)ai->ai_addr)->sin6_port:
306: ((struct sockaddr_in*)ai->ai_addr)->sin_port),
307: ai->ai_family==AF_INET6?"PF_INET6":"PF_INET",
308: ai->ai_socktype==SOCK_STREAM?"SOCK_STREAM":"SOCK_DGRAM");
1.80 fefe 309: {
310: char buf[100];
311: inet_ntop(ai->ai_family,ai->ai_family==AF_INET6?
312: (char*)&(((struct sockaddr_in6*)ai->ai_addr)->sin6_addr):
313: (char*)&(((struct sockaddr_in*)ai->ai_addr)->sin_addr),buf,100);
314: printf(" %s\n",buf);
315: }
1.76 fefe 316: ai=ai->ai_next;
317: }
1.81 fefe 318: #endif
1.76 fefe 319: #if 0
1.71 fefe 320: int i=foo;
1.75 fefe 321: printf("load average is %3.2f\n",0.0);
1.76 fefe 322: #endif
1.70 fefe 323: #if 0
1.69 fefe 324: struct dirent **namelist;
325: int n;
1.16 fefe 326:
1.69 fefe 327: n = scandir(".", &namelist, 0, alphasort);
328: if (n < 0)
329: perror("scandir");
330: else {
331: while(n--) {
332: printf("%s\n", namelist[n]->d_name);
333: free(namelist[n]);
334: }
335: free(namelist);
336: }
1.70 fefe 337: #endif
1.68 fefe 338: #if 0
1.67 fefe 339: char foo[10]="none,zlib";
340: char *tmp,*tmp2=foo;
341: while (tmp=strsep(&tmp2,",")) {
342: puts(tmp);
343: }
1.68 fefe 344: #endif
1.65 fefe 345: #if 0
1.61 fefe 346: char foo[10];
1.64 fefe 347: printf("%d %d\n",abs(-3),abs(23));
1.63 fefe 348: strcpy(foo,"foo");
349: strncat(foo,"barbaz",3);
350: foo[6]=0;
351: puts(foo);
1.65 fefe 352: #endif
1.115 fefe 353: #if 0
1.58 fefe 354: struct hostent * host;
355: struct in_addr i;
1.57 fefe 356:
1.131 fefe 357: host = gethostbyname2("nagus",AF_INET);
1.57 fefe 358:
1.58 fefe 359: if (!host)
360: printf("host null\n");
1.57 fefe 361:
1.58 fefe 362: if (host && host->h_name) {
363: printf("name %s\n", host->h_name);
364: }
365: if (host && (host->h_addr_list)[0]) {
366: struct in_addr address;
367: address = *((struct in_addr *) (host->h_addr_list)[0]);
368: printf("addr %s\n", inet_ntoa(address));
369: }
1.59 fefe 370: #endif
1.57 fefe 371: #if 0
1.56 fefe 372: struct msgbuf bla;
373: bla.mtype=0;
374: bla.mtext[0]='x';
375: msgsnd(327680,&bla,5,IPC_NOWAIT);
1.57 fefe 376: #endif
1.55 fefe 377: #if 0
1.54 fefe 378: char buf[PATH_MAX];
379: printf("%s\n",realpath("../../incoming/..///.zshrc",buf));
1.55 fefe 380: #endif
1.73 fefe 381: #if 0
1.53 fefe 382: regex_t t;
1.68 fefe 383: regcomp(&t,"^OpenSSH_2\\.5\\.[012]",5);
1.65 fefe 384: printf("%d\n",regexec(&t,"OpenSSH_2.5.2p2",0,0,0));
1.56 fefe 385: #endif
1.53 fefe 386: #if 0
1.52 fefe 387: float my_float = 9.2334;
388: char buffer[100];
389:
390: sprintf(buffer, "%.2f", my_float);
391: fprintf(stdout, "%s", buffer);
1.53 fefe 392: #endif
1.52 fefe 393: #if 0
1.51 fefe 394: printf("%d\n",setenv("foo","bar",0));
395: printf("%d\n",setenv("foo","bar",1));
396: execlp("printenv","printenv","foo",0);
1.52 fefe 397: #endif
1.106 fefe 398: #if 0
1.59 fefe 399: printf("%d\n",fnmatch("*c*","bin",0));
1.50 fefe 400: if (!fnmatch("s*", "sub", 0))
401: printf("s* sub\n");
402: if (!fnmatch("s*", "glob", 0))
403: printf("s* glob\n");
404: if (!fnmatch("s*b", "sub", 0))
405: printf("s*b sub\n");
406: if (!fnmatch("s*h", "sub", 0))
407: printf("s*h sub\n");
1.51 fefe 408: #endif
1.49 fefe 409: #if 0
1.48 fefe 410: char*tmp;
411: int n=asprintf(&tmp,"foo %s %d\n","bar",23);
412: write(1,tmp,n);
413: free(tmp);
1.49 fefe 414: #endif
1.41 fefe 415: #if 0
1.40 fefe 416: struct passwd *p=getpwnam("leitner");
1.41 fefe 417: struct spwd *s=getspnam("leitner");
1.39 fefe 418: printf("%g\n",30.0123);
1.41 fefe 419: #endif
1.43 fefe 420: #if 0
1.42 fefe 421: initgroups("root",100);
1.43 fefe 422: #endif
1.38 fefe 423: #if 0
1.37 fefe 424: time_t t=time(0);
425: puts(asctime(localtime(&t)));
1.38 fefe 426: #endif
1.134 ! fefe 427: #if 1
! 428: struct servent *foo=getservbyname("pop-3","tcp");
1.36 fefe 429: if (foo)
430: printf("found service %s on port %d\n",foo->s_name,foo->s_port);
1.37 fefe 431: #endif
1.121 fefe 432: #if 0
1.33 fefe 433: char buf[128];
1.120 fefe 434: strcpy(buf,"/tmp/blub/foo.XXXXXXX");
1.33 fefe 435: printf("%d\n",mkstemp(buf));
1.34 fefe 436: printf("%s\n",buf);
437: unlink(buf);
1.35 fefe 438: #endif
1.33 fefe 439: #if 0
1.32 fefe 440: char buf[512]="foo";
441: strncat(buf,"barbaz",3);
442: puts(buf);
1.33 fefe 443: #endif
1.32 fefe 444: #if 0
1.31 fefe 445: time_t oink=time(0);
446: struct tm *duh=localtime(&oink);
447: strftime(buf,512,"%A %B %Y\n",duh);
448: puts(buf);
1.32 fefe 449: #endif
1.126 fefe 450: #if 0
1.28 fefe 451: struct in_addr bar;
452: struct hostent *foo;
1.125 fefe 453: inet_aton("160.45.10.8",&bar);
454: /* foo=gethostbyname("zeit.fu-berlin.de"); */
455: foo=gethostbyaddr(&bar,4,AF_INET);
1.30 fefe 456: if (foo)
457: printf("%s -> %s\n",foo->h_name,inet_ntoa(*(struct in_addr*)foo->h_addr));
1.22 fefe 458: /* printf("%g %g\n",1e-10,1e10); */
1.31 fefe 459: #endif
1.18 fefe 460: #if 0
1.17 fefe 461: double d=0.0;
462: long long t=0x12345678ABCDEF01;
463: d/=0.0;
464: printf("%d %llx\n",__isnan(d),t,*(long long*)&d);
1.18 fefe 465: #endif
1.17 fefe 466: #if 0
1.16 fefe 467: int i,j;
468: long a,b,c;
469: int *res;
470: printf("%p\n",malloc(0));
471: qsort(array,2,sizeof(int),compint);
472: for (i=0; i<SIZE; ++i)
473: array[i]=rand();
474: rdtscl(a);
475: qsort(array,SIZE,sizeof(int),compint);
476: rdtscl(b);
477: j=array[LOOKFOR];
478: res=bsearch(&j,array,SIZE,sizeof(int),compint);
479: rdtscl(c);
480: printf("%lu cycles sort, %lu cycles bsearch\n",b-a,c-b);
481: for (i=0; i<SIZE-1; ++i)
482: if (array[i]>array[i+1]) {
483: printf("qsort does not work, index %d: %d > %d\n",i,array[i],array[i+1]);
484: return 1;
485: }
486: if (*res!=j)
487: printf("besearch does not work, returned %p (%d) instead of %p (%d)\n",res,res?*res:-1,array+LOOKFOR,j);
488: /* printf("array={%d,%d,%d,%d,%d}\n",array[0],array[1],array[2],array[3],array[4]); */
1.17 fefe 489: #endif
1.13 fefe 490: #if 0
1.12 fefe 491: struct in_addr duh;
492: printf("%d\n",inet_aton(argv[1]?argv[1]:"10.0.0.1",&duh));
493: printf("%x\n",duh.s_addr);
1.13 fefe 494: #endif
1.12 fefe 495: /* printf("%-19s %10lu %9lu %9lu %3d%% %s\n","/dev/ide/host0/bus0/target0/lun0/part2",8393688,705683,1337084,85,"/"); */
1.11 fefe 496: #if 0
1.10 fefe 497: char buf[100];
498: fgets(buf,100,stdin); printf("got %d bytes\n",strlen(buf));
499: fgets(buf,100,stdin); printf("got %d bytes\n",strlen(buf));
1.11 fefe 500: #endif
1.9 fefe 501: #if 0
1.7 fefe 502: struct tm duh;
503: time_t t;
1.8 fefe 504: time(&t);
505: gmtime_r(&t,&duh);
506: printf("%s\n",asctime(&duh));
1.9 fefe 507: #endif
1.8 fefe 508: #if 0
1.7 fefe 509: char buf[30];
510: duh.tm_sec=42;
511: duh.tm_min=23;
512: duh.tm_hour=17;
513: duh.tm_mday=2;
514: duh.tm_mon=7;
515: duh.tm_year=100;
516: t=mktime(&duh);
517: printf("%s\n",asctime_r(&duh,buf));
1.8 fefe 518: #endif
1.2 fefe 519: #if 0
1.1 cvs 520: int i;
521: for (i=0; i<5; i++) {
522: fprintf(stdout,"first message\n");
523: fprintf(stdout,"second message\n");
524: fprintf(stdout,"third message\n");
525: printf("foo %d\n",i);
526: }
1.2 fefe 527: #endif
1.1 cvs 528: #if 0
529: char buf[1024];
530: sscanf("foo bar","%s",buf);
531: printf("%s\n",buf);
532: #endif
533: #if 0
534: mount("/dev/scsi/host0/bus0/target2/lun0/cd", "/cd", "iso9660", MS_MGC_VAL|MS_RDONLY, NULL);
535: perror("mount");
536: #endif
537: #if 0
538: char *t="<4>Linux version 2.4.0-test10 (leitner@hellhound) (gcc version 2.95.2 19991024 (release))";
539: int i=strtol(t+1,&t,10);
540: printf("%d %s\n",i,t);
541: #endif
542: #if 0
543: char **tmp;
1.115 fefe 544: putenv("A=foo");
1.1 cvs 545: for (tmp=environ; *tmp; tmp++)
546: puts(*tmp);
547: #endif
548: #if 0
549: char buf[1024];
550: printf("%d\n",fprintf(stderr,"duh\n"));
551: #endif
552: #if 0
553: struct passwd *p=getpwuid(100);
554: puts(p->pw_name);
555: #endif
556: #if 0
557: int pid;
558: char name[32];
559: sscanf("1 (init","%d (%15c",&pid,name);
560: printf("pid %d name %s\n",pid,name);
561: #endif
1.109 fefe 562: #if 0
1.1 cvs 563: DIR *d=opendir("/proc");
564: if (d) {
565: struct dirent *D;
566: while (D=readdir(d))
567: puts(D->d_name);
568: closedir(d);
569: }
570: #endif
571: #if 0
572: char buf[1024];
573: int fd=open("/etc/passwd",0);
574: pread(fd,buf,30,32);
575: close(fd);
576: write(1,buf,32);
577: #endif
578: #if 0
579: char *argv[] = {"echo","foo",0};
580: char buf[100];
581: buf[5]='x';
582: sprintf(buf,"foo\n");
583: if (buf[5] == 'x')
584: exit(0);
585: else
586: exit(1);
587: execvp(argv[0],argv);
588: #endif
1.10 fefe 589: #if 0
1.1 cvs 590: struct stat64 f;
591: char buf[128];
592: fstat64(0,&f);
593: fprintf(stderr,"%d %d\n",f.st_size,sizeof(f));
594: return 0;
595: #endif
596: #if 0
597: FILE *f=fopen("foo","w");
598: fputc('a',f);
599: fputc('b',f);
600: fputc('c',f);
601: #endif
602: /* fprintf(stdout,"foo\n"); */
603: }
LinuxTV legacy CVS <linuxtv.org/cvs>