#include "copyright.h"#include "debug.h"#include "sysdep.h"#include "stdlib.h"#include "unistd.h"#include "sys/time.h"#include "sys/file.h"#include <sys/socket.h>#include <sys/un.h>#include <signal.h>#include <sys/types.h>#include <sys/mman.h>Go to the source code of this file.
Functions | |
| int | getpagesize (void) |
| unsigned | sleep (unsigned) |
| int | mprotect (char *, unsigned int, int) |
| void | CallOnUserAbort (void(*func)(int)) |
| void | Delay (int seconds) |
| void | Abort () |
| void | Exit (int exitCode) |
| void | RandomInit (unsigned seed) |
| unsigned int | RandomNumber () |
| char* | AllocBoundedArray (int size) |
| void | DeallocBoundedArray (char *ptr, 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) |
|
|
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) |
|
|
CallOnUserAbort Arrange that "func" will be called when the user aborts (e.g., by hitting ctl-C. |
|
|
Close Close a file. Abort on error. |
|
|
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) |
|
|
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. |
|
|
Exit Quit without dropping core. |
|
|
Lseek Change the location within an open file. Abort on error. |
|
|
OpenForReadWrite Open a file for reading or writing. Return the file descriptor, or error if it doesn't exist. "name" -- file name |
|
|
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 |
|
|
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 |
|
|
RandomInit Initialize the pseudo-random number generator. We use the now obsolete "srand" and "rand" because they are more portable! |
|
|
RandomNumber Return a pseudo-random number. Definition at line 154 of file sysdep.cc. Referenced by NetworkOutput::Send(), and Timer::SetInterrupt().
|
|
|
Read Read characters from an open file. Abort if read fails. |
|
|
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. |
|
|
Referenced by AllocBoundedArray(), and DeallocBoundedArray().
|
|
|
Referenced by AllocBoundedArray(), and DeallocBoundedArray().
|
|
|
Referenced by Delay().
|
1.2.8.1 written by Dimitri van Heesch,
© 1997-2001