Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Jan 2005 09:40:29 GMT
From:      Roman Nikitchenko <roman@trifle.net>
To:        freebsd-threads@FreeBSD.org
Subject:   Re: threads/75795: applications linked with -lc_r can't close() fd opened by kqueue().
Message-ID:  <200501050940.j059eT9N008758@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR threads/75795; it has been noted by GNATS.

From: Roman Nikitchenko <roman@trifle.net>
To: freebsd-gnats-submit@FreeBSD.org, roman@trifle.net
Cc:  
Subject: Re: threads/75795: applications linked with -lc_r can't close() fd
 opened by kqueue().
Date: Wed, 05 Jan 2005 11:33:04 +0200

 The reason was in unimplemented kqueue_stat() call (libc_r close() 
 relays on fstat() ).
 Here is my own version (sys/kern/kern_event.c) i used to workaround problem:
 
 /*ARGSUSED*/
 static int
 kqueue_stat(struct file *fp, struct stat *st, struct ucred *active_cred,
 	struct thread *td)
 {
 	struct kqueue *kq;
 	int error;
 
 	if ((error = kqueue_aquire(fp, &kq)))
 		return ENOENT;
 	KQ_LOCK(kq);
 	bzero((void *)st, sizeof(*st));
 	st->st_size = kq->kq_count;
 	kqueue_release(kq, 1);
 	KQ_UNLOCK(kq);
 	st->st_blksize = sizeof(struct kevent);
 	st->st_mode = S_IFIFO;
         return (0);
 }
 
 Please check / apply this as soon as possible. Any binary transfered from 4.x system and using kevent() subsystem won't work until this will be done. Any application with kevent()'s linked against libc_r too.
 
 -- 
 
 WBR,
 Roman Nikitchenko, http://smartgate.wtelecom.net
 _,,,_|\_/|_,,,_
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200501050940.j059eT9N008758>