7 static char buf0
[512]; /* buffer of zeros */
9 /* Allocate disk space.
10 * Expects fd's offset to be 0; may also reset fd's offset to 0.
11 * Returns 0 on success, and a positive errno otherwise. */
13 rawfalloc(int fd
, int len
)
17 for (i
= 0; i
< len
; i
+= w
) {
18 w
= write(fd
, buf0
, sizeof buf0
);
19 if (w
== -1) return errno
;
22 lseek(fd
, 0, 0); /* do not care if this fails */