Ignore:
Timestamp:
Oct 1, 2011, 9:49:54 PM (14 years ago)
Author:
bird
Message:

Applied modified patches for Haiku support from Mike Smith.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/kmkbuiltin/haikufakes.c

    r2545 r2546  
    11/* $Id$ */
    22/** @file
    3  * Fake Unix stuff for Solaris.
     3 * Fake Unix/BSD stuff for Haiku.
    44 */
    55
     
    3333#include <stdlib.h>
    3434#include <sys/stat.h>
    35 #include "solfakes.h"
     35#include "haikufakes.h"
    3636
    3737
    38 int asprintf(char **strp, const char *fmt, ...)
    39 {
    40     int rc;
    41     va_list va;
    42     va_start(va, fmt);
    43     rc = vasprintf(strp, fmt, va);
    44     va_end(va);
    45     return rc;
    46 }
    47 
    48 
    49 int vasprintf(char **strp, const char *fmt, va_list va)
    50 {
    51     int rc;
    52     char *psz;
    53     size_t cb = 1024;
    54 
    55     *strp = NULL;
    56     for (;;)
    57     {
    58         va_list va2;
    59 
    60         psz = malloc(cb);
    61         if (!psz)
    62             return -1;
    63 
    64 #ifdef va_copy
    65         va_copy(va2, va);
    66         rc = snprintf(psz, cb, fmt, va2);
    67         va_end(va2);
    68 #else
    69         va2 = va;
    70         rc = snprintf(psz, cb, fmt, va2);
    71 #endif
    72         if (rc < 0 || (size_t)rc < cb)
    73             break;
    74         cb *= 2;
    75         free(psz);
    76     }
    77 
    78     *strp = psz;
    79     return rc;
    80 }
    81 
    82 
    83 
    84 int sol_lchmod(const char *pszPath, mode_t mode)
     38int haiku_lchmod(const char *pszPath, mode_t mode)
    8539{
    8640    /*
Note: See TracChangeset for help on using the changeset viewer.