use syscall for doing syswrite stuff -- more portable?
[unix-history] / usr / src / local / sccscmds / sccscmds.ok / util / write.c
CommitLineData
5e5f884d
SL
1# include "errno.h"
2# include "../hdr/macros.h"
9ba5b3ae
SL
3#include <sys/syscall.h>
4#define syswrite(a,b,c) syscall(SYS_write,a,b,c)
5e5f884d
SL
5SCCSID(@(#)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
14write(fildes,buffer,nbytes)
15char *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}