Linux C Factory Method Example