Changeset 2647 for branches


Ignore:
Timestamp:
Mar 15, 2006, 4:10:55 AM (20 years ago)
Author:
bird
Message:

read & write logging, and added support for more size flags to the log formatter.

Location:
branches/libc-0.6/src/emx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/libc-0.6/src/emx/ChangeLog.LIBC

    r2646 r2647  
    552006-03-14: knut st. osmundsen <[email protected]>
    66    - libc:
     7
    78        o #68: Implemented the _GETOPT_DECLARED blocker in getopt.h too.
    89
  • branches/libc-0.6/src/emx/src/lib/sys/__read.c

    r2437 r2647  
    1515#include <emx/syscalls.h>
    1616#include "syscalls.h"
     17
     18
    1719
    1820int __read (int handle, void *buf, size_t cbToRead)
    1921{
     22
    2023    int     rc;
    2124    PLIBCFH pFH;
     
    2932    {
    3033        errno = EBADF;
    31         return -1;
     34        ;
    3235    }
    3336
     
    5053            pvBuf_safe = _lmalloc(cbToRead);
    5154            if (!pvBuf_safe)
    52                 return ERROR_NOT_ENOUGH_MEMORY;
     55            {
     56                errno = ENOMEM;
     57                LIBCLOG_ERROR_RETURN_INT(-1);
     58            }
    5359            memcpy(pvBuf_safe, buf, cbToRead);
    5460        }
     
    8995            rc = -EBADF;
    9096        errno = -rc;
    91         return -1;
     97        ;
    9298    }
    93 
    94     return cbRead;
     99    LIBCLOG_RETURN_INT(cbRead);
    95100}
  • branches/libc-0.6/src/emx/src/lib/sys/__write.c

    r2437 r2647  
    1515#include <emx/syscalls.h>
    1616#include "syscalls.h"
     17
     18
    1719
    1820int __write(int handle, const void *buf, size_t cbToWrite)
    1921{
     22
    2023    PLIBCFH pFH;
    2124    int     rc;
     
    3235    {
    3336        errno = EBADF;
    34         return -1;
     37        ;
    3538    }
    3639
     
    5255                pvBuf_safe = _lmalloc(cbToWrite);
    5356                if (!pvBuf_safe)
    54                     return ERROR_NOT_ENOUGH_MEMORY;
     57                {
     58                    errno = ENOMEM;
     59                    LIBCLOG_ERROR_RETURN_INT(-1);
     60                }
    5561                memcpy(pvBuf_safe, buf, cbToWrite);
    5662                buf = pvBuf_safe;
     
    98104            rc = -EBADF;
    99105        errno = -rc;
    100         return -1;
     106        ;
    101107    }
    102     return cbWritten;
     108    ;
    103109}
    104110
  • branches/libc-0.6/src/emx/src/lib/sys/logstrict.c

    r2260 r2647  
    18481848                /* argsize */
    18491849                chArgSize = *pszFormat;
    1850                 if (chArgSize != 'l' && chArgSize != 'L' && chArgSize != 'H')
     1850                if (    chArgSize != 'l' && chArgSize != 'L' && chArgSize != 'h'  && chArgSize != 'H'
     1851                    &&  chArgSize != 'j' && chArgSize != 'z' && chArgSize != 't')
    18511852                    chArgSize = 0;
    1852                 else if (*++pszFormat == 'l' && chArgSize == 'l')
     1853                else
    18531854                {
    1854                     chArgSize = 'L';
    18551855                    pszFormat++;
     1856
     1857
     1858
     1859
     1860
     1861
     1862
     1863
     1864
     1865
    18561866                }
    18571867
     
    19881998                            else if (chArgSize == 'h')
    19891999                                ulValue = va_arg(args, signed /*short*/ int); /* the great GCC pedantically saith use int. */
     2000
     2001
     2002
     2003
     2004
     2005
     2006
     2007
    19902008                            else
    19912009                                ulValue = va_arg(args, signed int);
Note: See TracChangeset for help on using the changeset viewer.