Linux C Factory Method Example C