Changeset 1052


Ignore:
Timestamp:
Sep 18, 2006, 8:59:48 AM (14 years ago)
Author:
Sam Hocevar
Message:
  • Added errno support to the kernel.
Location:
libcaca/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/cucul/cucul.c

    r1048 r1052  
    9999    if(ret < 0)
    100100    {
    101 #if defined(HAVE_ERRNO_H) && !defined(__KERNEL__)
     101#if defined(HAVE_ERRNO_H)
    102102        int saved_errno = errno;
    103103#endif
     
    105105        free(cv->allchars);
    106106        free(cv);
    107 #if defined(HAVE_ERRNO_H) && !defined(__KERNEL__)
     107#if defined(HAVE_ERRNO_H)
    108108        errno = saved_errno;
    109109#endif
     
    117117
    118118nomem:
    119 #if defined(HAVE_ERRNO_H) && !defined(__KERNEL__)
     119#if defined(HAVE_ERRNO_H)
    120120    errno = ENOMEM;
    121121#endif
     
    153153    if(cv->refcount)
    154154    {
    155 #if defined(HAVE_ERRNO_H) && !defined(__KERNEL__)
     155#if defined(HAVE_ERRNO_H)
    156156        errno = EBUSY;
    157157#endif
     
    247247    if(cv->refcount)
    248248    {
    249 #if defined(HAVE_ERRNO_H) && !defined(__KERNEL__)
     249#if defined(HAVE_ERRNO_H)
    250250        errno = EBUSY;
    251251#endif
     
    317317            if(!cv->allchars[f] || !cv->allattr[f])
    318318            {
    319 #if defined(HAVE_ERRNO_H) && !defined(__KERNEL__)
     319#if defined(HAVE_ERRNO_H)
    320320                errno = ENOMEM;
    321321#endif
     
    406406            if(!cv->allchars[f] || !cv->allattr[f])
    407407            {
    408 #if defined(HAVE_ERRNO_H) && !defined(__KERNEL__)
     408#if defined(HAVE_ERRNO_H)
    409409                errno = ENOMEM;
    410410#endif
  • libcaca/trunk/kernel/kernel.c

    r1049 r1052  
    33 *  libcaca       Colour ASCII-Art library
    44 *  Copyright (c) 2006 Sam Hocevar <sam@zoy.org>
     5 *                2006 Jean-Yves Lamoureux <jylam@lnxscene.org>
    56 *                All Rights Reserved
    67 *
     
    333334}
    334335
     336/* errno.h stuff */
     337int errno = 0;
     338
     339/* arpa/inet.h functions */
    335340
    336341/* XXX FIXME Converts only from little endian to big endian (x86) */
     
    346351}
    347352
    348 
    349 
    350353#endif /* __KERNEL__ */
  • libcaca/trunk/kernel/kernel.h

    r1048 r1052  
    1818 */
    1919
    20 #ifndef __KERNEL_H_
    21 #define __KERNEL_H_
    2220/* Various defines */
    2321#define NULL ((void *)0)
     
    109107int getpid(void);
    110108
    111 
    112109/* time.h functions */
    113110int gettimeofday(struct timeval *tv, struct timezone *tz);
     
    119116double sqrt(double x);
    120117
     118/* errno.h functions */
     119#define ENOENT   2 /* No such file or directory */
     120#define ENOMEM  12 /* Out of memory */
     121#define EBUSY   16 /* Device or resource busy */
     122#define ENODEV  19 /* No such device */
     123#define EINVAL  22 /* Invalid argument */
     124#define ENOTTY  25 /* Not a typewriter */
     125#define ENOSYS  38 /* Function not implemented */
     126extern int errno;
     127
    121128/* arpa/inet.h functions */
    122129unsigned int htonl(unsigned int hostlong);
    123130unsigned short htons(unsigned short hostlong);
    124131
    125 #endif /* __KERNEL_H_ */
Note: See TracChangeset for help on using the changeset viewer.