View | Details | Raw Unified | Return to bug 192842 | Differences between
and this patch

Collapse All | Expand All

(-)b/sys/amd64/linux32/linux32_dummy.c (-1 lines)
Lines 103-109 DUMMY(inotify_rm_watch); Link Here
103
/* linux 2.6.16: */
103
/* linux 2.6.16: */
104
DUMMY(migrate_pages);
104
DUMMY(migrate_pages);
105
DUMMY(pselect6);
105
DUMMY(pselect6);
106
DUMMY(ppoll);
107
DUMMY(unshare);
106
DUMMY(unshare);
108
/* linux 2.6.17: */
107
/* linux 2.6.17: */
109
DUMMY(splice);
108
DUMMY(splice);
(-)b/sys/amd64/linux32/syscalls.master (-1 / +2 lines)
Lines 505-511 Link Here
505
					l_mode_t mode); }
505
					l_mode_t mode); }
506
307	AUE_FACCESSAT	STD	{ int linux_faccessat(l_int dfd, const char *filename, l_int amode, int flag); }
506
307	AUE_FACCESSAT	STD	{ int linux_faccessat(l_int dfd, const char *filename, l_int amode, int flag); }
507
308	AUE_NULL	STD	{ int linux_pselect6(void); }
507
308	AUE_NULL	STD	{ int linux_pselect6(void); }
508
309	AUE_NULL	STD	{ int linux_ppoll(void); }
508
309	AUE_POLL	STD	{ int linux_ppoll(struct pollfd *fds, unsigned int nfds, \
509
					struct l_timespec *timeout_ts, l_uintptr_t *sigmask); }
509
310	AUE_NULL	STD	{ int linux_unshare(void); }
510
310	AUE_NULL	STD	{ int linux_unshare(void); }
510
; linux 2.6.17:
511
; linux 2.6.17:
511
311	AUE_NULL	STD	{ int linux_set_robust_list(struct linux_robust_list_head *head, \
512
311	AUE_NULL	STD	{ int linux_set_robust_list(struct linux_robust_list_head *head, \
(-)b/sys/compat/linux/linux_misc.c (+91 lines)
Lines 65-70 __FBSDID("$FreeBSD$"); Link Here
65
#include <sys/vnode.h>
65
#include <sys/vnode.h>
66
#include <sys/wait.h>
66
#include <sys/wait.h>
67
#include <sys/cpuset.h>
67
#include <sys/cpuset.h>
68
#include <sys/poll.h>
68
69
69
#include <security/mac/mac_framework.h>
70
#include <security/mac/mac_framework.h>
70
71
Lines 567-572 select_out: Link Here
567
}
568
}
568
569
569
int
570
int
571
linux_ppoll(struct thread *td, struct linux_ppoll_args *pargs)
572
{
573
	struct l_timespec lts;
574
	struct timeval tv, *tvp, tv0, tv1;
575
	sigset_t usigmask, *usigmaskp;
576
	l_sigset_t lsigmask;
577
	int error, retval;
578
579
	/* Get the time */
580
	if (pargs->timeout_ts != NULL)
581
	{
582
		error = copyin(pargs->timeout_ts, &lts, sizeof(lts));
583
		if (error != 0)
584
			return (error);
585
586
		TIMESPEC_TO_TIMEVAL(&tv, &lts);
587
		if (itimerfix(&tv))
588
			return (EINVAL);
589
590
		/* Mark the time before the call */
591
		microtime(&tv0);
592
		tvp = &tv;
593
	} else
594
		tvp = NULL;
595
596
	/* Get the sigmask */
597
	if (pargs->sigmask != NULL) {
598
		error = copyin(pargs->sigmask, &lsigmask, sizeof(lsigmask));
599
		if (error)
600
			return (error);
601
		linux_to_bsd_sigset(&lsigmask, &usigmask);
602
		usigmaskp = &usigmask;
603
	} else
604
		usigmaskp = NULL;
605
606
	/* Create the poll_args struct */
607
	struct poll_args pa, *pap;
608
609
	pa.fds = pargs->fds;
610
	pa.nfds = pargs->nfds;
611
	pap = &pa;
612
613
	/* Linux's ppoll allows NULL timeout which is translated to FreeBSD's INFTIM (-1) */
614
	if (tvp==NULL)
615
		pa.timeout = INFTIM;
616
	else
617
	{
618
		if ( tvp->tv_sec == 0 )
619
			pa.timeout = tvp->tv_usec / 1000;
620
		else
621
			pa.timeout = tvp->tv_sec * 1000 + tvp->tv_usec / 1000;
622
	}
623
624
	error = kern_sigprocmask (td, SIG_SETMASK, usigmaskp, &td->td_oldsigmask, 0);
625
	if (error)
626
		return (error);
627
628
	/* call sys_poll */
629
	retval = sys_poll(td, pap);
630
631
	error = kern_sigprocmask (td, SIG_SETMASK, &td->td_oldsigmask, NULL, 0);
632
	if (error)
633
		return (error);
634
635
	if (retval == 0 && pargs->timeout_ts) {
636
		if (td->td_retval[0]) {
637
		/*
638
		* Compute how much time was left of the timeout,
639
		* by subtracting the current time and the time
640
		* before we started the call, and subtracting
641
		* that result from the user-supplied value.
642
		*/
643
			microtime(&tv1);
644
			timevalsub(&tv1, &tv0);
645
			timevalsub(&tv, &tv1);
646
			if (tv.tv_sec < 0)
647
				timevalclear(&tv);
648
		} else
649
			timevalclear(&tv);
650
651
			TIMEVAL_TO_TIMESPEC(&tv, &lts);
652
653
		error = copyout(&lts, pargs->timeout_ts, sizeof(lts));
654
		if (error)
655
			return (error);
656
	}
657
	return retval;
658
}
659
660
int
570
linux_mremap(struct thread *td, struct linux_mremap_args *args)
661
linux_mremap(struct thread *td, struct linux_mremap_args *args)
571
{
662
{
572
	struct munmap_args /* {
663
	struct munmap_args /* {

Return to bug 192842