All homework must be submitted through the CS accounts. More information on remote login into the CSIF computers can be found in the CSIF FAQ.Account Access (SSH)
You may access your CS account via SSH. The hostname you want to connect to is:
Using Minix Manual Pages (
all: cc -g program1.c -o program1 clean: rm -f program1
makefile above, we would compile
program1.c by the following command:
make all(or by typing
To clean up the object files, we could run the command:
This illustrates the basic functionality required for all makefiles in this class.
One way to debug your programs is to make use of the
errno variable in
errno.h. Whenever a system call results in an error, the value of
errno is set. To use
errno in your Minix C programs, do the following:
errno.hto your code.
/usr/include/errno.hand check what message the value of
man errnoand check what message the value of
Take for example the following code snippet:
rval = chdir( path ); if( rval == -1 ) printf( "chdir( %s ) failed... errno: %i\n", path, errno );
If we got the following output:
chdir( nowhere ) failed... errno: 2
We could then look in
/usr/include/errno.h to see that an
errno value of
2 corresponds to the message "
no such file or directory".
You can always find more information from the
man pages. You can also download errno_example.c for another example Minix C code snippet using