fix for asmconv - stop translating after .sect .end.
[minix.git] / commands / aal / wr_bytes.c
blob36629da8af3c7ab20737041ca71c458b77c15b5e
1 /* $Header$ */
2 /*
3 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4 * See the copyright notice in the ACK home directory, in the file "Copyright".
5 */
6 #define MININT (1 << (sizeof(int) * 8 - 1))
7 #define MAXCHUNK (~MININT) /* Highest count we write(2). */
8 /* Notice that MAXCHUNK itself might be too large with some compilers.
9 You have to put it in an int!
12 static int maxchunk = MAXCHUNK;
15 * Just write "cnt" bytes to file-descriptor "fd".
17 wr_bytes(fd, string, cnt)
18 register char *string;
19 register long cnt;
22 while (cnt) {
23 register int n = cnt >= maxchunk ? maxchunk : cnt;
25 if (write(fd, string, n) != n)
26 wr_fatal();
27 string += n;
28 cnt -= n;