mirror of
https://github.com/vivier/EMILE.git
synced 2024-11-14 22:04:43 +00:00
22 lines
410 B
C
22 lines
410 B
C
#include <sys/types.h>
|
|
#include <macos/devices.h>
|
|
|
|
ssize_t write(int fd, const void *buf, size_t count)
|
|
{
|
|
int res;
|
|
ParamBlockRec param;
|
|
|
|
param.ioCompletion = 0;
|
|
param.ioVRefNum = 0;
|
|
param.ioRefNum = fd;
|
|
param.ioBuffer = (u_int32_t)buf;
|
|
param.ioReqCount= count;
|
|
param.ioPosMode = fsAtMark;
|
|
param.ioPosOffset = 0;
|
|
res = PBWriteSync(¶m);
|
|
if (res != noErr)
|
|
return 0;
|
|
|
|
return param.ioActCount;
|
|
}
|