system programming

2008-01-10 Thread Michael S
Good day all.

I am a computer science student taking the operating
systems course. All of our assignments are supposed
run on Linux and I don't have 
a Linux machine. 
I was wondering mostly if FreeBSD uses the same
functions for process / thread handling, whether the
header files (e.g. unistd.h, stdlib.h, etc) are in the
same locations
and whether the pthread library is present by default.

Haven't almost done any programming on FreeBSD (except
Java).

Thanks in advance,
Michael

Michael Sherman
http://msherman77.blogspot.com/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: system programming

2008-01-10 Thread Heiko Wundram (Beenic)
Am Donnerstag, 10. Januar 2008 16:38:47 schrieb Michael S:
 I am a computer science student taking the operating
 systems course. All of our assignments are supposed
 run on Linux and I don't have
 a Linux machine.
 I was wondering mostly if FreeBSD uses the same
 functions for process / thread handling, whether the
 header files (e.g. unistd.h, stdlib.h, etc) are in the
 same locations
 and whether the pthread library is present by default.

Whereas both systems could be termed mostly POSIX compliant (and thus you 
should be able to recompile program sources freely on each of the two without 
modifications to the source and get equal behaviour), FreeBSD's libc and 
kernel is (in my experience) more and the glibc (i.e., the most commonly used 
libc on Linux) and the Linux kernel generally somewhat less close/compliant 
to the specification in border- or seldom used cases.

This includes (for example) the (still, IIRC) default pthreads implementation 
on Linux (called LinuxThreads, even though a new/better threads 
implementation has been available for quite some time, called NPTL), which 
doesn't properly support thread cancellation (or rather doesn't support them 
at all), and only implements a subset of the POSIX.1c (i.e., POSIX Threads) 
specification. FreeBSDs pthreads library is fully POSIX.1c compliant, IIRC.

Some other things which I've hit when recompiling programs I implemented on 
FreeBSD for Linux generally concern more esoteric differences, like glibc 
missing a sys/endian.h (which is a heavens gift), but sys/endian.h isn't part 
of the POSIX standard anyway.

What's not so esoteric though: socket behaviour isn't specified in the POSIX 
standard either; if you implement networking programs, you'll soon find that 
for example the error return values differ slightly between the two operating 
systems, making proper error recovery all the harder. Preprocessor macros are 
your friend, even in C++.

For the rest, the compiler/linker-toolchain you'll use under Linux is (most 
probably) the exact same as under FreeBSD (i.e., gcc + GNU binutils), and as 
such you'll not have to expect any problems here. Concerning make: if you 
stick to writing GNU make Makefiles under FreeBSD, you'll also be on the safe 
side there, because I've yet to find a properly functioning BSD make 
implementation for Linux. Finally: stay away from the autotools if you can. 
They make your brain cringe.

And, to finish up: generally you'll not feel the differences. And if you do, 
you've (most probably) hit operating system specific (i.e., non 
POSIX-specified) behaviour, anyway, and were on your own from the start.

-- 
Heiko Wundram
Product  Application Development
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: system programming

2008-01-10 Thread Olivier Nicole
Hi,

 I am a computer science student taking the operating
 systems course. All of our assignments are supposed
 run on Linux and I don't have 
 a Linux machine. 

Programming the operating system is very dependent on the operating
system.

Talk your prof to accept a project based on FreeBSD, that would even
broaden the scope of the course by introducing a glimpse to another
OS.

Olivier
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: system programming

2008-01-10 Thread David Christensen
Michael wrote:

 I am a computer science student taking the operating systems course.
 All of our assignments are supposed run on Linux and I don't have a Linux
machine. 

I've taken programming classes and learned the hard way that the only way to
ensure that my software worked correctly on the teacher's machine was to
have a matching development environment.  In practice, this can be very
expensive and/or time consuming to achieve.  Fortunately, matching the Linux
distribution make, model, and version was sufficient.


Now there are more options -- notably, virtual machines.  I suggest that you
ask your instructor to pick a free VMware Linux virtual appliance and that
the teacher and students all use that:

http://www.vmware.com/vmtn/appliances/directory/cat/45


HTH,

David

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]