1 # include "errno.h" 2 # include "../hdr/macros.h" 3 #include <sys/syscall.h> 4 #define syswrite(a,b,c) syscall(SYS_write,a,b,c) 5 SCCSID(@(#)write 2.1); 6 7 /* 8 Interface to write(II) (called syswrite) which handles 9 all error conditions. 10 Returns number of bytes written on success, 11 returns fatal(<mesg>) on failure. 12 */ 13 14 write(fildes,buffer,nbytes) 15 char *buffer; 16 { 17 register int n; 18 19 if (nbytes>0 && (n=syswrite(fildes,buffer,nbytes))!=nbytes) 20 n = xmsg("","write"); 21 return(n); 22 } 23