Changeset 625 for trunk/libs/mini-libc
- Timestamp:
- Apr 10, 2019, 10:09:39 AM (6 years ago)
- Location:
- trunk/libs/mini-libc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libs/mini-libc/stdio.c
r624 r625 403 403 404 404 // check stream valid 405 if( stream->key != VALID_OPEN_FILE ) return EOF; 405 if( stream->key != VALID_OPEN_FILE ) 406 { 407 printf("\n[error in %s] stream %x non registered\n", __FUNCTION__, stream ); 408 return -1; 409 } 406 410 407 411 va_start( args, format ); … … 409 413 va_end( args ); 410 414 415 // check format 411 416 if ( count < 0 ) 412 417 { 413 display_string( "fprintf : xprintf failure");418 printf("\n[error in %s] unsupported format %s\n", __FUNCTION__, format ); 414 419 return -1; 415 420 } 416 else 417 { 418 // get file descriptor from file pointer 419 fd = stream->fd; 420 421 // set terminating NUL 422 string[count] = 0; 423 424 printf("\n[%s] fd = %d for string : %s\n", __FUNCTION__, fd, string ); 425 426 idbg(); 427 428 // copy string to file 429 writen = write( fd , &string , count ); 430 431 if( writen != count ) 432 { 433 display_string( "fprintf : write failure" ); 434 return -1; 435 } 436 437 idbg(); 438 439 return writen; 440 } 421 422 // get file descriptor from file pointer 423 fd = stream->fd; 424 425 // set terminating NUL 426 string[count] = 0; 427 428 // copy string to file 429 writen = write( fd , &string , count ); 430 431 // check write 432 if(writen != count ) 433 { 434 printf("\n[error in %s] cannot write to stream %s\n", __FUNCTION__, stream ); 435 return -1; 436 } 437 438 return writen; 439 441 440 } // end fprintf() 442 441 -
trunk/libs/mini-libc/unistd.c
r589 r625 2 2 * unistd.c - User level <unistd> library implementation. 3 3 * 4 * Author Alain Greiner (2016,2017,2018 )4 * Author Alain Greiner (2016,2017,2018,2019) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites
Note: See TracChangeset
for help on using the changeset viewer.