#include "copyright.h"#include "iostream.h"#include "stdlib.h"#include "stdio.h"#include "string.h"Go to the source code of this file.
Functions | |
| void | Abort () |
| void | Exit (int exitCode) |
| void | Delay (int seconds) |
| void | CallOnUserAbort (void(*cleanup)(int)) |
| void | RandomInit (unsigned seed) |
| unsigned int | RandomNumber () |
| char* | AllocBoundedArray (int size) |
| void | DeallocBoundedArray (char *p, int size) |
| bool | PollFile (int fd) |
| int | OpenForWrite (char *name) |
| int | OpenForReadWrite (char *name, bool crashOnError) |
| void | Read (int fd, char *buffer, int nBytes) |
| int | ReadPartial (int fd, char *buffer, int nBytes) |
| void | WriteFile (int fd, char *buffer, int nBytes) |
| void | Lseek (int fd, int offset, int whence) |
| int | Tell (int fd) |
| void | Close (int fd) |
| bool | Unlink (char *name) |
| int | atoi (const char *str) |
| double | atof (const char *str) |
| int | abs (int i) |
|
|
Abort Quit and drop core. |
|
|
AllocBoundedArray Return an array, with the two pages just before and after the array unmapped, to catch illegal references off the end of the array. Particularly useful for catching overflow beyond fixed-size thread execution stacks. Note: Just return the useful part! "size" -- amount of useful space needed (in bytes) Definition at line 172 of file sysdep.cc. Referenced by Thread::StackAllocate().
|
|
|
CallOnUserAbort Arrange that "func" will be called when the user aborts (e.g., by hitting ctl-C. Definition at line 96 of file sysdep.cc. Referenced by main().
|
|
|
|
|
|
DeallocBoundedArray Deallocate an array of integers, unprotecting its two boundary pages. "ptr" -- the array to be deallocated "size" -- amount of useful space in the array (in bytes) Definition at line 196 of file sysdep.cc. Referenced by Thread::~Thread().
|
|
|
Sleep Put the UNIX process running Nachos to sleep for x seconds, to give the user time to start up another invocation of Nachos in a different UNIX shell. |
|
|
This user program is done (status = 0 means exited normally). |
|
|
Lseek Change the location within an open file. Abort on error. Definition at line 318 of file sysdep.cc. Referenced by Disk::Disk(), Disk::ReadRequest(), and Disk::WriteRequest().
|
|
|
OpenForReadWrite Open a file for reading or writing. Return the file descriptor, or error if it doesn't exist. "name" -- file name Definition at line 267 of file sysdep.cc. Referenced by ConsoleInput::ConsoleInput(), and Disk::Disk().
|
|
|
OpenForWrite Open a file for writing. Create it if it doesn't exist; truncate it if it does already exist. Return the file descriptor. "name" -- file name Definition at line 250 of file sysdep.cc. Referenced by ConsoleOutput::ConsoleOutput(), and Disk::Disk().
|
|
|
PollFile Check open file or open socket to see if there are any characters that can be read immediately. If so, read them in, and return TRUE. "fd" -- the file descriptor of the file to be polled Definition at line 219 of file sysdep.cc. Referenced by ConsoleInput::CallBack().
|
|
|
RandomInit Initialize the pseudo-random number generator. We use the now obsolete "srand" and "rand" because they are more portable! Definition at line 143 of file sysdep.cc. Referenced by ThreadedKernel::ThreadedKernel().
|
|
|
RandomNumber Return a pseudo-random number. |
|
|
|
|
|
ReadPartial Read characters from an open file, returning as many as are available. |
|
|
Tell Report the current location within an open file. |
|
|
Unlink Delete a file. |
|
|
WriteFile Write characters to an open file. Abort if write fails. Definition at line 306 of file sysdep.cc. Referenced by Disk::Disk(), ConsoleOutput::PutChar(), and Disk::WriteRequest().
|
|
|
Referenced by Disk::TimeToSeek().
|
|
|
Referenced by NetKernel::NetKernel().
|
|
|
Referenced by HashKey(), NetKernel::NetKernel(), and ThreadedKernel::ThreadedKernel().
|
1.2.8.1 written by Dimitri van Heesch,
© 1997-2001