Newsgroups: comp.lang.lisp.franz,comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!fs7.ece.cmu.edu!hudson.lm.com!newsfeed.pitt.edu!gatech!howland.reston.ans.net!news.sprintlink.net!EU.net!Austria.EU.net!newsfeed.ACO.net!swidir.switch.ch!news.unige.ch!usenet
From: baujard@cui.unige.ch (BAUJARD Olivier)
Subject: sys:set-sigio-handler trouble
Message-ID: <1994Dec7.112117.8343@news.unige.ch>
Sender: usenet@news.unige.ch
Reply-To: baujard@cui.unige.ch
Organization: University of Geneva - CUI
Date: Wed, 7 Dec 1994 11:21:17 GMT
Lines: 45
Xref: glinda.oz.cs.cmu.edu comp.lang.lisp.franz:414 comp.lang.lisp:15944

Hi, 

I'm currently trying to use the set-sigio-handler function to
handle signals (writtings) on some file descriptor. When calling
that function, I got the following error message : error fcntl

Basically, my code is the following:

I wrote a C foreign function to open a file:

int OpenUnixFile(theFile)
	char* theFile;
{
	int aResult;
	aResult=open(theFile,O_RDWR|O_CREAT|O_EXCL,0777);
	if ((aResult==-1) && (errno==EEXIST))
	{
		perror("OpenUnixFile: file already exists.");
	}
	return aResult;
}

I then load that foreign code and create an Lisp handler.

(defun MyHandler (fd)
	(format t "This is my handler~%")
)

then I call

(sys:set-sigio-handler (openunixfile (ff:string-to-char* "test") 'MyHandler))


Where is the trouble ?
Can I use set-sigio-handler on socket file descriptors ? I tried to do it and
got a similar message.

Any pointers are welcomed.

Cheers,

Olivier



