Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!helios.ee.lbl.gov!ucsd!ucsdhub!hp-sdd!hplabs!hp-ses!hpcuhb!hpcllla!hpclisp!hpclcac!cary From: cary@hpclcac.HP.COM (Cary Coutant) Newsgroups: comp.sys.hp Subject: Re: libc.a error when linking perl3.0 on HP-UX 3.10 Message-ID: <1340087@hpclcac.HP.COM> Date: 28 Nov 89 00:02:23 GMT References: <127@geysir.os.is> Organization: Hewlett-Packard Calif. Language Lab Lines: 30 > #include > #include > #include > main() > { > syscall(SYS_mkdir, "/usr/tmp/tst", 0755); > } > > ====> Core Dump on Series 800s. This problem is due to the fact that syscall() must shift all of its arguments down one before transferring to the system call gateway. Since it doesn't know how many arguments were actually supplied, it always copies enough for the most demanding system call. Unfortunately, in this example, the stack frame for main() is small enough that syscall actually destroys the return address in this process. By adding a local variable, as one poster suggested, or by adding a few dummy parameters -- e.g., syscall(SYS_mkdir, "/usr/tmp/tst", 0755, 0, 0, 0); -- the problem can be avoided. I'm not aware that anyone has discovered this problem before; thanks for reporting it! Cary Coutant, Series 800 Linker Project Manager HP California Languages Lab