1 /* $Id: wr_bytes.c,v 1.7 1994/06/24 11:19:19 ceriel Exp $ */
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".
9 #define MININT (1 << (sizeof(int) * 8 - 1))
10 #define MAXCHUNK (~MININT) /* Highest count we write(2). */
11 /* Notice that MAXCHUNK itself might be too large with some compilers.
12 You have to put it in an int!
15 static int maxchunk = MAXCHUNK;
18 * Just write "cnt" bytes to file-descriptor "fd".
21 wr_bytes(fd, string, cnt)
22 register char *string;
27 register int n = cnt >= maxchunk ? maxchunk : cnt;
29 if (write(fd, string, n) != n)