home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.lisp
- Path: sparky!uunet!mcsun!news.funet.fi!cs.joensuu.fi!prikala
- From: prikala@cs.joensuu.fi ( Pasi Rikala)
- Subject: Sun Common Lisp & Foreign functions
- Message-ID: <1992Sep10.122629.8200@cs.joensuu.fi>
- Keywords: foreign functions
- Organization: University of Joensuu
- Date: Thu, 10 Sep 1992 12:26:29 GMT
- Lines: 41
-
- Hello Lisp-Gurus
-
- I have this strange problem with Sun Common Lisp when trying to use
- functions originally written with c.
-
- My c-function is like this:
-
- /* mytest.c */
- int my_sleep()
- {
- int i;
-
- i = sleep(10);
- perror("After Sleep");
- return(i);
- }
-
- I compile it with "cc -c" to "mytest.o"
- And on lisp I say:
- (def-foreign-function (my_sleep (:return-type :signed-32bit)
- (:name "_my_sleep")
- (:language :c)))
-
- (load-foreign-files "mytest.o")
-
-
- When I call it with (my_sleep), it does not sleep 10 seconds as supposed
- but still returns 0:
- > (my_sleep)
- After Sleep: Interrupted system call
- 0
- >
-
- Same thing happens every time I call sleep from my functions.
-
- My question is: What am I doing wrong? Why is sleep interrupted?
- How can I tell lisp not to interrupt foreign functions when they
- seem to be sleeping?
-
-
- Pasi Rikala (prikala@cs.joensuu.fi)
-