136476Ssam # include "errno.h"
236476Ssam # include "../hdr/macros.h"
3*36477Ssam #include <sys/syscall.h>
4*36477Ssam #define	syswrite(a,b,c)	syscall(SYS_write,a,b,c)
536476Ssam SCCSID(@(#)write	2.1);
636476Ssam 
736476Ssam /*
836476Ssam 	Interface to write(II) (called syswrite) which handles
936476Ssam 	all error conditions.
1036476Ssam 	Returns number of bytes written on success,
1136476Ssam 	returns fatal(<mesg>) on failure.
1236476Ssam */
1336476Ssam 
write(fildes,buffer,nbytes)1436476Ssam write(fildes,buffer,nbytes)
1536476Ssam char *buffer;
1636476Ssam {
1736476Ssam 	register int n;
1836476Ssam 
1936476Ssam 	if (nbytes>0 && (n=syswrite(fildes,buffer,nbytes))!=nbytes)
2036476Ssam 		n = xmsg("","write");
2136476Ssam 	return(n);
2236476Ssam }
23