Annotation of dietlibc/t.c, revision 1.1

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

LinuxTV legacy CVS <linuxtv.org/cvs>