jessea@homecare.COM (Jesse W. Asher) (05/10/91)
I'd like to write some software that is very portable between different types of Unix. I'm not just talking about BSD vs. SystemV, but also how different system's compilers handle various functions differently. I've written a program that I've compiled on a 386 running SysV, an NCR tower running SysV, and a SparcStation running SunOS, and I had to make modifications all three times. So first, I'd like to find out what functions are most portable, and then find out how to use directives (ifdef, ifndef, etc) to make the software as portable as possible. I'd like to take the tact that I want to eventually post this software to the net, but I don't know how to make it as portable as possible. I've looked at various programs already posted on the net (Cnews, elm, etc) and that has given me ideas. But does anyone know of a good publication on this type of programming? -- Jesse W. Asher NIC Handle: JA268 Phone: (901)386-5061 Health Sphere of America Inc. 5125 Elmore Rd., Suite 1, Memphis, TN 38134 Internet: jessea@homecare.COM UUCP: ...!banana!homecare!jessea
matt@iquery.PIC.COM (Matt Reedy) (05/11/91)
In article <1991May9.181650.12516@homecare.COM> jessea@homecare.COM (Jesse W. Asher) writes: >I'd like to write some software that is very portable between different >types of Unix. I'm not just talking about BSD vs. SystemV, but also how >different system's compilers handle various functions differently. I've > ... >and that has given me ideas. But does anyone know of a good publication >on this type of programming? We've experienced the same difficulties. The problem is compounded by various *versions* of OS's on the same box (e.g. HP-UX V 3.0 and V 7.0 etc). The only way we've found to resolve the problem is to have the programmer's reference manual for 3 Unix environments: SVR3, 4.2BSD, and Xenix. Before we use a new library function or #ifdef, we check the manuals for all three of these platforms. Only if the function/ifdef is available on all three do we use it. (We actually also reference a 4th platform: VAX/VMS, but we won't discuss that here ;-) I'd be very interested also if there are any good publications in this area. matt -- Matthew Reedy UUCP: uunet!iquery!matt Programmed Intelligence Corp. Internet: matt@pic.COM 400 N Loop 1604 E, Suite 100 San Antonio, TX 78232 (512) 490 6684 Fax: (512) 490-3590
bill@camco.Celestial.COM (Bill Campbell) (05/12/91)
In <1991May9.181650.12516@homecare.COM> jessea@homecare.COM (Jesse W. Asher) writes:
:I'd like to write some software that is very portable between different
:types of Unix. I'm not just talking about BSD vs. SystemV, but also how
:different system's compilers handle various functions differently. I've
:written a program that I've compiled on a 386 running SysV, an NCR tower
:running SysV, and a SparcStation running SunOS, and I had to make
:modifications all three times. So first, I'd like to find out what
:functions are most portable, and then find out how to use directives
:(ifdef, ifndef, etc) to make the software as portable as possible. I'd
:like to take the tact that I want to eventually post this software to
:the net, but I don't know how to make it as portable as possible. I've
:looked at various programs already posted on the net (Cnews, elm, etc)
:and that has given me ideas. But does anyone know of a good publication
:on this type of programming?
Two books I've found very useful are:
Portable C & Unix System Programming by J.E. Lapin
Prentice-Hall Software Series ISBN 0-13-686494-5
Reliable Data Structures in C by Thomas Plum
Plum Hall ISBN 0-911537-04-X
--
INTERNET: bill@Celestial.COM Bill Campbell; Celestial Software
UUCP: ...!thebes!camco!bill 6641 East Mercer Way
uunet!camco!bill Mercer Island, WA 98040; (206) 947-5591