Thread: Is fork function portable over different hardware

  1. #1
    Registered User gandalf_bar's Avatar
    Join Date
    Oct 2003
    Posts
    92

    Is fork function portable over different hardware

    Linux is supported in many hardware. Some of them are:
    * Alpha
    * ARM
    * HP PA-RISC
    * Intel x86
    * Intel IA-64
    * Motorola 680x0
    * MIPS
    * MIPS (DEC)
    * PowerPC
    * IBM S/390
    * SPARC
    I make program and use many function like:
    fork(), pipe(), execlv(), semaphore, and so on. However because I only have Intel x86 hardware, I am just curios will my program be compiled correctly in other hardwares?
    A man asked, "Who are you?"
    Buddha answered, "I am awaked."

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    If you write Linux code for one machine, then you can reasonably expect it to compile and run on all other Linux machines without modification. Everything is derived from the same code base, so you'd have to dig pretty deep into some dark corner to get any real idea of the differences between hardware platforms.

    If you stick to the POSIX interface, then you can reasonably expect it to compile on all Unix and Linux machines. This is mostly achieved by the use of "autoconf" to assist with many common portability problems.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  2. Brand new to C need favor
    By dontknowc in forum C Programming
    Replies: 5
    Last Post: 09-21-2007, 10:08 AM
  3. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 11:03 PM
  4. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  5. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM