Assignment 2 FAQ, Tutorials, Errata, and Addenda
Due Monday, March 3, 2008 5:00 pm on-line
Last update: Saturday, March 1, 2008 10:26 EST
- I've posted a revised socketdemo that includes Makefiles for OS X. I also had to make slight changes to the source. Here's what changed:
-
-
Add a
#include <stdlib.h>to declare functions such as exit. -
Add a
#include <string.h>to declare functions such as strlen and memset. -
changed the casting in
memcpy to(void *). - Changed SIGCLD to SIGCHLD. Sun OS used SIGCLD but the POSIX name is SIGCHLD. Sun OS defines both of them to the same thing.
-
Changed the socket address length from an
int tosocklen_t -
OS X does not have an ERESTART error (interrupted system call that needs to be restarted). I added an
#ifndef ERESTART. You can usemake -f Makefile.linuxto compile it.
-
Add a
- How should the Client/Server handle files that existing with the same name in destination directory? Is this considered an error?
- You don't have to treat this as an error. You're welcome to overwrite them.
- Are the original file location and destination location in the same local locations as the Client and Server respectively?
- Yes. You should just use the current working directory for both the client and server. On the server, you'll be checking that the filename does not contain any "/" characters so you'll be limited to the current directory.
- The original and copied files have the same name?
- No. The client accepts two names on the command line. One is the file you open and the other is the name you send.
- Do optional parameters always come before the two file name parameters?
- Yes. This is the convention for Unix/Linux commands.
- Should the programs compile and run on specific machine(s) at Rutgers and software versions?
- They should run on the cereal systems and/or remus/eden/... . Most likely, they'll run on both. If they run on OS X (10.5) or Windows XP under cygwin, that will work as well since I'll be able to test them.