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