Changeset 359 in kBuild for trunk/src/gmake/kmkbuiltin/echo.c
- Timestamp:
- Dec 13, 2005 3:51:48 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmake/kmkbuiltin/echo.c
r227 r359 39 39 #endif /* not lint */ 40 40 #endif 41 #ifndef _MSC_VER 41 42 #include <sys/cdefs.h> 43 #endif 42 44 //__FBSDID("$FreeBSD: src/bin/echo/echo.c,v 1.17 2004/04/06 20:06:46 markm Exp $"); 43 45 … … 51 53 #include <stdlib.h> 52 54 #include <string.h> 55 #ifndef _MSC_VER 53 56 #include <unistd.h> 57 #endif 54 58 55 59 #ifndef IOV_MAX 56 60 #define IOV_MAX 1024 57 61 #endif 62 63 #ifdef _MSC_VER 64 #include <io.h> 65 66 struct iovec { 67 char *iov_base; 68 size_t iov_len; 69 }; 70 71 int 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 */ 58 88 59 89 /*
Note:
See TracChangeset
for help on using the changeset viewer.