[cs631apue] HW5 questions

Rob Hoffmann rhoffman at stevens.edu
Thu Dec 8 04:15:38 EST 2011


I am struggling with this issue as well. When I run "gcc -Wall cmp.c 
ls.c main.c print.c util.c -o ls" there are a /lot/ of errors shown. I 
understand that Linux has functionally equivalent functions for some 
things, but many of these errors have to do with undefined constants 
(HN_AUTOSCALE, HN_NOSPACE), missing header files (util.h, tzfile.h), and 
missing data structure members (no st_mtimensec in struct stat).

Even compiling without -Wall, I count 64 warnings and errors.

I don't know if all this was the intent of the assignment, but at what 
point do we draw the line between trying to fix everything and simply 
removing code that is not defined?


On 12/4/2011 5:40 PM, Jan Schaumann wrote:
> Simon Sidhom<ssidhom at stevens.edu>  wrote:
>> I'm not sure if we talked about this in class but I am having a lot of
>> trouble getting the NetBSD version of ls to compile on the linux lab. There
>> is no util.h and I get a long list of errors from references to functions
>> that don't exist. Did you teach us a more practical way of dealing with
>> this instead of re-writing all of the missing functions?
> You don't have to write any new functions yourself.  Whatever functions
> are called that are not available on linux can be replaced with
> functionally equivalent calls to existing functions or with minor tweaks
> here and there.
>> I feel like I'm working too hard for this to be a homework about CVS,
>> diff, and patch.
> The "porting" of the software is one of the so-called "hidden
> requirements", but in this case the changes you'd have to make to have
> this version of ls build and function on the linux systems are not very
> large.
> -Jan
> _______________________________________________
> cs631apue mailing list
> cs631apue at lists.stevens.edu
> https://lists.stevens.edu/cgi-bin/mailman/listinfo/cs631apue

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stevens.edu/pipermail/cs631apue/attachments/20111208/488ace0e/attachment.html>

More information about the cs631apue mailing list