Re: linux_rt_sigpending

From: Justin Smith <justin.richard.smith_at_drexel.edu>
Date: Sun, 01 Oct 2006 15:59:37 -0400
Divacky Roman wrote:
> On Sun, Oct 01, 2006 at 09:04:49AM -0400, Justin Smith wrote:
>   
>> Is this patch in current? It was developed some time ago to enable Maple
>> to run under linux emulation but it certainly hasn't been put into
>> 6-STABLE yet because the patch still applies cleanly (and Maple now
>> runs, while it didn't before).
>>     
>
> what patch?
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
>
>   
I've attached it, although I downloaded it from the web (I don't recall
where --- it was a FreeBSD developer's site.

--- compat/linux/linux_signal.c	Sun Feb 13 21:50:57 2005
+++ compat/linux/linux_signal.c	Tue Jan  3 10:43:51 2006
_at__at_ -406,6 +406,34 _at__at_
 	mask = lset.__bits[0];
 	return (copyout(&mask, args->mask, sizeof(mask)));
 }
+
+/*
+ * MPSAFE
+ */
+int
+linux_rt_sigpending(struct thread *td, struct linux_rt_sigpending_args *args)
+{
+	struct proc *p = td->td_proc;
+	sigset_t bset;
+	l_sigset_t lset;
+
+	if (args->sigsetsize > sizeof(lset))
+		return EINVAL;
+		/* NOT REACHED */
+
+#ifdef DEBUG
+	if (ldebug(rt_sigpending))
+		printf(ARGS(rt_sigpending, "*"));
+#endif
+
+	PROC_LOCK(p);
+	bset = p->p_siglist;
+	SIGSETOR(bset, td->td_siglist);
+	SIGSETAND(bset, td->td_sigmask);
+	PROC_UNLOCK(p);
+	bsd_to_linux_sigset(&bset, &lset);
+	return (copyout(&lset, args->set, args->sigsetsize));
+}
 #endif	/*!__alpha__*/
 
 int
--- amd64/linux32/linux32_dummy.c	Mon Aug 16 10:55:06 2004
+++ amd64/linux32/linux32_dummy.c	Tue Jan  3 10:44:33 2006
_at__at_ -54,7 +54,6 _at__at_
 DUMMY(query_module);
 DUMMY(nfsservctl);
 DUMMY(prctl);
-DUMMY(rt_sigpending);
 DUMMY(rt_sigtimedwait);
 DUMMY(rt_sigqueueinfo);
 DUMMY(capget);
--- amd64/linux32/syscalls.master	Wed Jul 20 20:42:14 2005
+++ amd64/linux32/syscalls.master	Tue Jan  3 10:44:21 2006
_at__at_ -310,7 +310,8 _at__at_
 175	AUE_NULL	MSTD	{ int linux_rt_sigprocmask(l_int how, \
 				    l_sigset_t *mask, l_sigset_t *omask, \
 				    l_size_t sigsetsize); }
-176	AUE_NULL	MSTD	{ int linux_rt_sigpending(void); }
+176	AUE_NULL	MSTD	{ int linux_rt_sigpending(l_sigset_t *set, \
+				    l_size_t sigsetsize); }
 177	AUE_NULL	MSTD	{ int linux_rt_sigtimedwait(void); }
 178	AUE_NULL	MSTD	{ int linux_rt_sigqueueinfo(void); }
 179	AUE_NULL	MSTD	{ int linux_rt_sigsuspend( \
--- amd64/linux32/linux32_proto.h	Wed Feb  1 09:36:43 2006
+++ amd64/linux32/linux32_proto.h	Wed Feb  1 09:37:09 2006
_at__at_ -2,7 +2,7 _at__at_
  * System call prototypes.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/amd64/linux32/linux32_proto.h,v 1.5.2.1 2005/07/20 17:43:52 jhb Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.4.2.1 2005/07/20 17:42:14 jhb Exp 
  */
 
_at__at_ -518,7 +518,8 _at__at_
 	char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)];
 };
 struct linux_rt_sigpending_args {
-	register_t dummy;
+	char set_l_[PADL_(l_sigset_t *)]; l_sigset_t * set; char set_r_[PADR_(l_sigset_t *)];
+	char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)];
 };
 struct linux_rt_sigtimedwait_args {
 	register_t dummy;
--- amd64/linux32/linux32_syscall.h	Wed Feb  1 09:36:43 2006
+++ amd64/linux32/linux32_syscall.h	Wed Feb  1 09:37:09 2006
_at__at_ -2,7 +2,7 _at__at_
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/amd64/linux32/linux32_syscall.h,v 1.5.2.1 2005/07/20 17:43:52 jhb Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.4.2.1 2005/07/20 17:42:14 jhb Exp 
  */
 
--- amd64/linux32/linux32_sysent.c	Wed Feb  1 09:36:43 2006
+++ amd64/linux32/linux32_sysent.c	Wed Feb  1 09:37:09 2006
_at__at_ -2,7 +2,7 _at__at_
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/amd64/linux32/linux32_sysent.c,v 1.5.2.1 2005/07/20 17:43:52 jhb Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.4.2.1 2005/07/20 17:42:14 jhb Exp 
  */
 
_at__at_ -196,7 +196,7 _at__at_
 	{ SYF_MPSAFE | AS(linux_rt_sigreturn_args), (sy_call_t *)linux_rt_sigreturn, AUE_NULL },	/* 173 = linux_rt_sigreturn */
 	{ SYF_MPSAFE | AS(linux_rt_sigaction_args), (sy_call_t *)linux_rt_sigaction, AUE_NULL },	/* 174 = linux_rt_sigaction */
 	{ SYF_MPSAFE | AS(linux_rt_sigprocmask_args), (sy_call_t *)linux_rt_sigprocmask, AUE_NULL },	/* 175 = linux_rt_sigprocmask */
-	{ SYF_MPSAFE | 0, (sy_call_t *)linux_rt_sigpending, AUE_NULL },	/* 176 = linux_rt_sigpending */
+	{ SYF_MPSAFE | AS(linux_rt_sigpending_args), (sy_call_t *)linux_rt_sigpending, AUE_NULL },	/* 176 = linux_rt_sigpending */
 	{ SYF_MPSAFE | 0, (sy_call_t *)linux_rt_sigtimedwait, AUE_NULL },	/* 177 = linux_rt_sigtimedwait */
 	{ SYF_MPSAFE | 0, (sy_call_t *)linux_rt_sigqueueinfo, AUE_NULL },	/* 178 = linux_rt_sigqueueinfo */
 	{ SYF_MPSAFE | AS(linux_rt_sigsuspend_args), (sy_call_t *)linux_rt_sigsuspend, AUE_NULL },	/* 179 = linux_rt_sigsuspend */
--- i386/linux/linux_dummy.c	Wed Feb  1 09:41:23 2006
+++ i386/linux/linux_dummy.c	Wed Feb  1 09:42:33 2006
_at__at_ -58,7 +58,6 _at__at_
 DUMMY(query_module);
 DUMMY(nfsservctl);
 DUMMY(prctl);
-DUMMY(rt_sigpending);
 DUMMY(rt_sigtimedwait);
 DUMMY(rt_sigqueueinfo);
 DUMMY(capget);
--- i386/linux/linux_proto.h	Wed Feb  1 09:41:23 2006
+++ i386/linux/linux_proto.h	Wed Feb  1 09:42:37 2006
_at__at_ -2,7 +2,7 _at__at_
  * System call prototypes.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/i386/linux/linux_proto.h,v 1.64.2.1 2005/07/20 17:43:53 jhb Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.61.2.1 2005/07/20 17:42:15 jhb Exp 
  */
 
_at__at_ -513,7 +513,8 _at__at_
 	char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)];
 };
 struct linux_rt_sigpending_args {
-	register_t dummy;
+	char set_l_[PADL_(l_sigset_t *)]; l_sigset_t * set; char set_r_[PADR_(l_sigset_t *)];
+	char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)];
 };
 struct linux_rt_sigtimedwait_args {
 	register_t dummy;
--- i386/linux/linux_syscall.h	Wed Feb  1 09:41:23 2006
+++ i386/linux/linux_syscall.h	Wed Feb  1 09:42:37 2006
_at__at_ -2,7 +2,7 _at__at_
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/i386/linux/linux_syscall.h,v 1.58.2.1 2005/07/20 17:43:53 jhb Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.61.2.1 2005/07/20 17:42:15 jhb Exp 
  */
 
--- i386/linux/linux_sysent.c	Wed Feb  1 09:41:23 2006
+++ i386/linux/linux_sysent.c	Wed Feb  1 09:42:37 2006
_at__at_ -2,7 +2,7 _at__at_
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/i386/linux/linux_sysent.c,v 1.65.2.1 2005/07/20 17:43:53 jhb Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.61.2.1 2005/07/20 17:42:15 jhb Exp 
  */
 
_at__at_ -196,7 +196,7 _at__at_
 	{ SYF_MPSAFE | AS(linux_rt_sigreturn_args), (sy_call_t *)linux_rt_sigreturn, AUE_NULL },	/* 173 = linux_rt_sigreturn */
 	{ SYF_MPSAFE | AS(linux_rt_sigaction_args), (sy_call_t *)linux_rt_sigaction, AUE_NULL },	/* 174 = linux_rt_sigaction */
 	{ SYF_MPSAFE | AS(linux_rt_sigprocmask_args), (sy_call_t *)linux_rt_sigprocmask, AUE_NULL },	/* 175 = linux_rt_sigprocmask */
-	{ SYF_MPSAFE | 0, (sy_call_t *)linux_rt_sigpending, AUE_NULL },	/* 176 = linux_rt_sigpending */
+	{ SYF_MPSAFE | AS(linux_rt_sigpending_args), (sy_call_t *)linux_rt_sigpending, AUE_NULL },	/* 176 = linux_rt_sigpending */
 	{ SYF_MPSAFE | 0, (sy_call_t *)linux_rt_sigtimedwait, AUE_NULL },	/* 177 = linux_rt_sigtimedwait */
 	{ SYF_MPSAFE | 0, (sy_call_t *)linux_rt_sigqueueinfo, AUE_NULL },	/* 178 = linux_rt_sigqueueinfo */
 	{ SYF_MPSAFE | AS(linux_rt_sigsuspend_args), (sy_call_t *)linux_rt_sigsuspend, AUE_NULL },	/* 179 = linux_rt_sigsuspend */
--- i386/linux/syscalls.master	Wed Feb  1 09:41:23 2006
+++ i386/linux/syscalls.master	Wed Feb  1 09:42:16 2006
_at__at_ -308,7 +308,8 _at__at_
 175	AUE_NULL	MSTD	{ int linux_rt_sigprocmask(l_int how, \
 				    l_sigset_t *mask, l_sigset_t *omask, \
 				    l_size_t sigsetsize); }
-176	AUE_NULL	MSTD	{ int linux_rt_sigpending(void); }
+176	AUE_NULL	MSTD	{ int linux_rt_sigpending(l_sigset_t *set, \
+				    l_size_t sigsetsize); }
 177	AUE_NULL	MSTD	{ int linux_rt_sigtimedwait(void); }
 178	AUE_NULL	MSTD	{ int linux_rt_sigqueueinfo(void); }
 179	AUE_NULL	MSTD	{ int linux_rt_sigsuspend( \
Received on Sun Oct 01 2006 - 17:59:45 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:01 UTC