VirtualBox

Changeset 359 in kBuild for trunk/src/gmake/kmkbuiltin/echo.c


Ignore:
Timestamp:
Dec 13, 2005 3:51:48 AM (19 years ago)
Author:
bird
Message:

Ported to MSC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gmake/kmkbuiltin/echo.c

    r227 r359  
    3939#endif /* not lint */
    4040#endif
     41#ifndef _MSC_VER
    4142#include <sys/cdefs.h>
     43#endif
    4244//__FBSDID("$FreeBSD: src/bin/echo/echo.c,v 1.17 2004/04/06 20:06:46 markm Exp $");
    4345
     
    5153#include <stdlib.h>
    5254#include <string.h>
     55#ifndef _MSC_VER
    5356#include <unistd.h>
     57#endif
    5458
    5559#ifndef IOV_MAX
    5660#define IOV_MAX 1024
    5761#endif
     62
     63#ifdef _MSC_VER
     64#include <io.h>
     65
     66struct iovec {
     67    char *iov_base;
     68    size_t iov_len;
     69};
     70
     71int writev(int fd, const struct iovec *vector, int count)
     72{
     73    int size = 0;
     74    int i;
     75    for (i = 0; i < count; i++)
     76    {
     77        int cb = write(fd, vector[i].iov_base, vector[i].iov_len);
     78        if (cb < 0)
     79            return -1;
     80        size += cb;
     81    }
     82    return size;
     83}
     84
     85#define STDERR_FILENO 2
     86#define STDOUT_FILENO 1
     87#endif /* _MSC_VER */
    5888
    5989/*
Note: See TracChangeset for help on using the changeset viewer.

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