Пример #1
0
int
sys_pselect6(struct tcb *tcp)
{
	int rc = decode_select(tcp, tcp->u_arg, BITNESS_CURRENT);
	if (entering(tcp)) {
		long r;
		struct {
			unsigned long ptr;
			unsigned long len;
		} data;
#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
		if (current_wordsize == 4) {
			struct {
				uint32_t ptr;
				uint32_t len;
			} data32;
			r = umove(tcp, tcp->u_arg[5], &data32);
			data.ptr = data32.ptr;
			data.len = data32.len;
		} else
#endif
			r = umove(tcp, tcp->u_arg[5], &data);
		if (r < 0)
			tprintf(", %#lx", tcp->u_arg[5]);
		else {
			tprints(", {");
			/* NB: kernel requires data.len == NSIG / 8 */
			print_sigset_addr_len(tcp, data.ptr, data.len);
			tprintf(", %lu}", data.len);
		}
	}
	return rc;
}
Пример #2
0
int
verify_datatype_select(struct attropl * pattr, char **err_msg)
{
	struct attribute atr;
	int ret = PBSE_BADATVAL;
	memset(&atr, 0, sizeof(struct attribute));
	ret = decode_select(&atr, pattr->name,
		pattr->resource, pattr->value);
	(void)free(atr.at_val.at_str);
	return ret;
}
Пример #3
0
int
sys_oldselect(struct tcb *tcp)
{
	long args[5];

	if (umoven(tcp, tcp->u_arg[0], sizeof args, (char *) args) < 0) {
		tprints("[...]");
		return 0;
	}
	return decode_select(tcp, args, BITNESS_CURRENT);
}
Пример #4
0
static int
umove_kulong_array_or_printaddr(struct tcb *tcp, const long addr,
				kernel_ulong_t *ptr, size_t n)
{
#if defined X86_64 || defined X32
	if (current_personality == 1) {
#else
	if (current_wordsize < sizeof(*ptr)) {
#endif
		uint32_t ptr32[n];
		int r = umove_or_printaddr(tcp, addr, &ptr32);
		if (!r) {
			size_t i;

			for (i = 0; i < n; ++i)
				ptr[i] = (kernel_ulong_t) ptr32[i];
		}
		return r;
	}
	return umoven_or_printaddr(tcp, addr, n * sizeof(*ptr), ptr);
}

SYS_FUNC(pselect6)
{
	int rc = decode_select(tcp, tcp->u_arg, print_timespec, sprint_timespec);
	if (entering(tcp)) {
		kernel_ulong_t data[2];

		tprints(", ");
		if (!umove_kulong_array_or_printaddr(tcp, tcp->u_arg[5],
						     data, ARRAY_SIZE(data))) {
			tprints("{");
			/* NB: kernel requires data[1] == NSIG / 8 */
			print_sigset_addr_len(tcp, (unsigned long) data[0],
					      (unsigned long) data[1]);
			tprintf(", %llu}", (unsigned long long) data[1]);
		}
	}

	return rc;
}
Пример #5
0
int
sys_pselect6(struct tcb *tcp)
{
	int rc = decode_select(tcp, tcp->u_arg, BITNESS_CURRENT);
	if (entering(tcp)) {
		struct {
			void *ss;
			unsigned long len;
		} data;
		if (umove(tcp, tcp->u_arg[5], &data) < 0)
			tprintf(", %#lx", tcp->u_arg[5]);
		else {
			tprintf(", {");
			if (data.len < sizeof(long))
				tprintf("%#lx", (long)data.ss);
			else
				print_sigset(tcp, (long)data.ss, 0);
			tprintf(", %lu}", data.len);
		}
	}
	return rc;
}
Пример #6
0
int
sys_select(struct tcb *tcp)
{
	return decode_select(tcp, tcp->u_arg, BITNESS_CURRENT);
}
Пример #7
0
int
sys_osf_select(struct tcb *tcp)
{
	long *args = tcp->u_arg;
	return decode_select(tcp, args, BITNESS_32);
}