home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format 56
/
af056sub.adf
/
parnfs.lha
/
netio2.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-12-02
|
2KB
|
89 lines
/*
* $Id: netio2.c,v 1.1 1993/12/02 20:45:46 Rhialto Exp $
* $Log: netio2.c,v $
* Revision 1.1 1993/12/02 20:45:46 Rhialto
* Initial revision
*
*
* Network file system: network I/O for the server only.
* This version for PARNET.DEVICE.
*/
#include "netfs.h"
#include "devices/parnet.h"
#ifdef DEBUG
# include "syslog.h"
#else
# define debug(x)
#endif
Prototype LONG DoReply(struct IOParReq *io, Packet *pkt, ULONG size);
LONG
DoReply(struct IOParReq *io, Packet *pkt, ULONG size)
{
int dest = pkt->p_Origin;
#ifdef DEBUG
int try = 0;
#endif
for(;;) {
#ifdef DEBUG
if (++try > 1)
debug(("*** DoReply try %d error %d len %d actual %d ->%d\n",
try, io->io_Error, size, io->io_Actual, dest));
#endif
io->io_Command = CMD_WRITE;
io->io_Addr = dest;
io->io_Data = pkt;
io->io_Length = size;
io->io_Data2 = NULL;
io->io_Length2 = 0;
pkt->p_Type = pt_Reply;
pkt->p_Origin = MyAddr;
if (DoIO((struct IORequest *)io) == 0)
break;
/* Be friendly - delay a bit */
Delay(2L);
if (SetSignal(0L, 0L) & SIGBREAKF_CTRL_C)
return io->io_Error;
}
return 0;
}
Prototype LONG DoReplyAsync(struct IOParReq *io, Packet *pkt, ULONG size);
LONG
DoReplyAsync(struct IOParReq *io, Packet *pkt, ULONG size)
{
int dest = pkt->p_Origin;
#ifdef DEBUG
int try = 0;
#endif
for(;;) {
#ifdef DEBUG
if (++try > 1)
debug(("*** DoReply try %d error %d len %d actual %d\n",
try, io->io_Error, size, io->io_Actual));
#endif
io->io_Command = CMD_WRITE;
io->io_Addr = dest;
io->io_Data = pkt;
io->io_Length = size;
io->io_Data2 = NULL;
io->io_Length2 = 0;
pkt->p_Type = pt_AsyncReply;
pkt->p_Origin = MyAddr;
debug(("DoIO pt_AsyncReply to %d\n", io->io_Addr));
if (DoIO((struct IORequest *)io) == 0)
break;
if (SetSignal(0L, 0L) & SIGBREAKF_CTRL_C)
return io->io_Error;
}
}