[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] unix daemon in gcl

From: Pascal J . Bourguignon
Subject: [Gcl-devel] unix daemon in gcl
Date: Fri, 16 Jul 2004 21:28:53 +0200 (CEST)


I need to write a couple of small unix daemons (sockets, posix shared
memory, posix semaphores, mmap, etc).  I'd rather write them in
Common-Lisp so I'm having a look at gcl.

How can we call unix syscalls or functions (from man2 or man3) from
gcl?  Is there documentation or an example somewhere?

I've found defcfun and defentry but they seem to be defined as empty
macros. Or does it mean that I can use them only in compiled code, not
in the REPL?

I tried:

(compile 'unix-open
         '(defcfun unix-open "int unix_open(char*n n,int f,int m)" 0
                  "return open(n,f,m);"))

(unix-open (make-array (length "/tmp/a.lisp") :element-type 'character
           :initial-contents "/tmp/a.lisp") 1 0)

But I get this puzzling error:

>(compile 'unix-open
         '(defcfun unix-open "int unix_open(char*n n,int f,int m)" 0
                  "return open(n,f,m);"))

Error: def not a lambda expression
Fast links are on: do (si::use-fast-links nil) for debugging
Error signalled by COND.
Broken at ERROR.  Type :H for Help.

__Pascal Bourguignon__                     http://www.informatimago.com/

There is no worse tyranny than to force a man to pay for what he does not
want merely because you think it would be good for him. -- Robert Heinlein

reply via email to

[Prev in Thread] Current Thread [Next in Thread]