[cs631apue] HW#5 grades mailed
Jan Schaumann
jschauma at stevens.edu
Mon Dec 19 19:00:30 EST 2011
Hello,
I just sent out grades for HW#5. If you have not received a grade,
please let me know ASAP. Here are some notes about the assignment:
- Make sure to only run the commands necessary. That is, if the
resulting binary exists (and is 'up to date'), don't rebuilt it (or do
any of the other steps).
- If you are always running 'make clean' as part of your normal 'all'
target, then you're missing the point of using 'make'. :-)
- patching/porting:
You want to make sure not to remove any functionality. To that
extent, consider what each of the things you are tempted to just
remove actually does. For example, the __COPYRIGHT and __RCSID macros
ensure that a given string is embedded in the resulting binary --
taking this out removes this information. (This isn't terrible, and
not a loss in _functionality_ per se, but still undesired.)
You can grep for __RCSID under /usr/include to find that including
bsd/sys/cdefs.h will provide what you need.
'getbsize' should be replaced with a call to getenv("BLOCKSIZE"), but
care must be taken to convert the value using atoi() and checking the
results.
Removing blocks of code is usually undesirable. Instead, try to
determine what the block of code is conditional upon and let the
pre-processor do the magic for you:
+#ifdef S_IFWHT
case S_IFWHT:
(void)putchar('%');
return (1);
+#endif
is preferable over your defining S_IFWHT (which makes no sense if the
OS in question doesn't even have this type of file) or completely
removing the code.
-Jan
More information about the cs631apue
mailing list