This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

About the printf


hello,

I use the newlib and make it support my kernel.

But, I found that the printf can not work nornally.
I used the following program to build the stdin, stdout, stderr. But
the printf can not print anthing but just write data into a buffer.
So, would anybody tell me how to establish the stdin stdout and stderr.

   stdin = fopen("/dev/tty", "r");
   if (stdin == NULL ) {
       printf("stdin: /dev/tty open failed\n");
       return;
   }

   stdout = fopen("/dev/tty", "w");
   if (stdout < 0) {
       printf("stdout: /dev/tty open failed\n");
       return;
   }

   stderr = fopen("/dev/tty", "w");
   if (stderr < 0) {
       printf("stderr: /dev/tty open failed\n");
       return;
   }


best regards

wangqiang


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]