VirtualBox

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


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

o Ported all kmk builtins to win32.
o Fixed serveral bugs in kmk builtins.
o Probably broke both linux, bsd and OS/2. :-)

File:
1 edited

Legend:

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

    r360 r370  
    3838static char sccsid[] = "@(#)echo.c      8.1 (Berkeley) 5/31/93";
    3939#endif /* not lint */
     40#include <sys/cdefs.h>
     41//__FBSDID("$FreeBSD: src/bin/echo/echo.c,v 1.17 2004/04/06 20:06:46 markm Exp $");
    4042#endif
    41 #ifndef _MSC_VER
    42 #include <sys/cdefs.h>
    43 #endif
    44 //__FBSDID("$FreeBSD: src/bin/echo/echo.c,v 1.17 2004/04/06 20:06:46 markm Exp $");
    4543
    4644#include <sys/types.h>
     
    5755#ifndef _MSC_VER
    5856#include <unistd.h>
     57#else
     58#include "mscfakes.h"
    5959#endif
    6060
     
    6363#endif
    6464
    65 #ifdef _MSC_VER
    66 #include <io.h>
    67 
    68 struct iovec {
    69     char *iov_base;
    70     size_t iov_len;
    71 };
    72 
    73 int writev(int fd, const struct iovec *vector, int count)
    74 {
    75     int size = 0;
    76     int i;
    77     for (i = 0; i < count; i++)
    78     {
    79         int cb = write(fd, vector[i].iov_base, vector[i].iov_len);
    80         if (cb < 0)
    81             return -1;
    82         size += cb;
    83     }
    84     return size;
    85 }
    86 
    87 #define STDERR_FILENO 2
    88 #define STDOUT_FILENO 1
    89 #endif /* _MSC_VER */
    9065
    9166/*
     
    127102        if ((iovfree = vp = iov = malloc((veclen + 1) * sizeof(struct iovec))) == NULL) {
    128103                errexit(progname, "malloc");
    129                 return 1;
     104                exit(1);
    130105        }
    131106
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