VirtualBox

Ignore:
Timestamp:
Jun 4, 2010 8:38:56 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
62400
Message:

NAT: BSD sbuf.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/bsd/kern/subr_sbuf.c

    r30018 r30045  
    2727 */
    2828
     29#ifndef VBOX
    2930#include <sys/cdefs.h>
    3031__FBSDID("$FreeBSD: src/sys/kern/subr_sbuf.c,v 1.30.8.1 2009/04/15 03:14:26 kensmith Exp $");
     
    5960#define min(x,y)                MIN(x,y)
    6061#endif /* _KERNEL */
     62#else /* VBOX */
     63# include <iprt/param.h>
     64# include <iprt/ctype.h>
     65# include <slirp.h>
     66# define SBMALLOC(size) RTMemAlloc((size))
     67# define SBFREE(buf) RTMemFree((buf))
     68#endif
    6169
    6270/*
     
    417425        do {
    418426                va_copy(ap_copy, ap);
     427#ifndef VBOX
    419428                len = vsnprintf(&s->s_buf[s->s_len], SBUF_FREESPACE(s) + 1,
    420429                    fmt, ap_copy);
     430#else
     431                len = RTStrPrintfV(&s->s_buf[s->s_len], SBUF_FREESPACE(s) + 1,
     432                    fmt, ap_copy);
     433#endif
    421434                va_end(ap_copy);
    422435        } while (len > SBUF_FREESPACE(s) &&
     
    492505                return (-1);
    493506
     507#ifndef VBOX
    494508        while (s->s_len && isspace(s->s_buf[s->s_len-1]))
    495509                --s->s_len;
     510#else
     511        while (s->s_len && RT_C_IS_SPACE(s->s_buf[s->s_len-1]))
     512                --s->s_len;
     513#endif
    496514
    497515        return (0);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette