16 #include "copyright.h" 26 extern void Read(
int fd,
char *buffer,
int nBytes);
27 extern int ReadPartial(
int fd,
char *buffer,
int nBytes);
28 extern void WriteFile(
int fd,
const char *buffer,
int nBytes);
29 extern void Lseek(
int fd,
int offset,
int whence);
30 extern int Tell(
int fd);
31 extern void Close(
int fd);
32 extern bool Unlink(
const char *name);
40 extern void ReadFromSocket(
int sockID,
char *buffer,
int packetSize);
41 extern void SendToSocket(
int sockID,
const char *buffer,
int packetSize,
const char *toName);
45 extern void Exit(
int exitCode);
46 extern void Delay(
int seconds);
void Read(int fd, char *buffer, int nBytes)
Read Read characters from an open file. Abort if read fails.
Definition: coff2flat.c:37
void AssignNameToSocket(const char *socketName, int sockID)
AssignNameToSocket Give a UNIX file name to the IPC port, so other instances of Nachos can locate the...
Definition: sysdep.cc:312
void CallOnUserAbort(VoidNoArgFunctionPtr cleanUp)
Initialize system so that cleanUp routine is called when user hits ctl-C.
Definition: sysdep.cc:404
bool Unlink(const char *name)
Unlink Delete a file.
Definition: sysdep.cc:259
void Abort()
Process control: abort, exit, and sleep.
Definition: sysdep.cc:428
void ReadFromSocket(int sockID, char *buffer, int packetSize)
ReadFromSocket Read a fixed size packet off the IPC port. Abort on error.
Definition: sysdep.cc:351
int OpenForWrite(const char *name)
OpenForWrite Open a file for writing. Create it if it doesn't exist; truncate it if it does already e...
Definition: sysdep.cc:151
int OpenForReadWrite(const char *name, bool crashOnError)
OpenForReadWrite Open a file for reading or writing.
Definition: sysdep.cc:168
void Lseek(int fd, int offset, int whence)
Lseek Change the location within an open file. Abort on error.
Definition: sysdep.cc:219
void DeAssignNameToSocket(const char *socketName)
DeAssignNameToSocket Delete the UNIX file name we assigned to our IPC port, on cleanup.
Definition: sysdep.cc:330
void Close(int fd)
Close Close a file. Abort on error.
Definition: sysdep.cc:247
int Tell(int fd)
Tell Report the current location within an open file.
Definition: sysdep.cc:231
void RandomInit(unsigned seed)
Initialize the pseudo random number generator.
Definition: sysdep.cc:451
void SendToSocket(int sockID, const char *buffer, int packetSize, const char *toName)
SendToSocket Transmit a fixed size packet to another Nachos' IPC port. Abort on error.
Definition: sysdep.cc:385
bool PollSocket(int sockID)
PollSocket.
Definition: sysdep.cc:341
void WriteFile(int fd, const char *buffer, int nBytes)
WriteFile Write characters to an open file. Abort if write fails.
Definition: sysdep.cc:207
void DeallocBoundedArray(char *p, int size)
DeallocBoundedArray Deallocate an array of integers, unprotecting its two boundary pages...
Definition: sysdep.cc:499
int ReadPartial(int fd, char *buffer, int nBytes)
ReadPartial Read characters from an open file, returning as many as are available.
Definition: sysdep.cc:195
void Exit(int exitCode)
Exit Quit without dropping core.
Definition: sysdep.cc:439
void CloseSocket(int sockID)
CloseSocket Close the IPC connection.
Definition: sysdep.cc:288
int Random()
Random.
Definition: sysdep.cc:462
void Delay(int seconds)
Sleep Put the UNIX process running Nachos to sleep for x seconds, to give the user time to start up a...
Definition: sysdep.cc:417
char * AllocBoundedArray(int size)
Allocate, de-allocate an array, such that de-referencing just beyond either end of the array will cau...
Definition: sysdep.cc:480
int OpenSocket()
OpenSocket Open an interprocess communication (IPC) connection. For now, just open a datagram port wh...
Definition: sysdep.cc:272
bool PollFile(int fd)
PollFile Check open file or open socket to see if there are any characters that can be read immediate...
Definition: sysdep.cc:117