Revision 0da46a6e linux-user/signal.c

b/linux-user/signal.c
438 438
    }
439 439
}
440 440

  
441
/* do_sigaltstack() returns target values and errnos. */
441 442
int do_sigaltstack(const struct target_sigaltstack *uss,
442 443
                   struct target_sigaltstack *uoss,
443 444
                   abi_ulong sp)
......
457 458
    {
458 459
	struct target_sigaltstack ss;
459 460

  
460
	ret = -EFAULT;
461
	ret = -TARGET_EFAULT;
461 462
	if (!access_ok(VERIFY_READ, uss, sizeof(*uss))
462 463
	    || __get_user(ss.ss_sp, &uss->ss_sp)
463 464
	    || __get_user(ss.ss_size, &uss->ss_size)
464 465
	    || __get_user(ss.ss_flags, &uss->ss_flags))
465 466
            goto out;
466 467

  
467
	ret = -EPERM;
468
	ret = -TARGET_EPERM;
468 469
	if (on_sig_stack(sp))
469 470
            goto out;
470 471

  
471
	ret = -EINVAL;
472
	ret = -TARGET_EINVAL;
472 473
	if (ss.ss_flags != TARGET_SS_DISABLE
473 474
            && ss.ss_flags != TARGET_SS_ONSTACK
474 475
            && ss.ss_flags != 0)
......
478 479
            ss.ss_size = 0;
479 480
            ss.ss_sp = 0;
480 481
	} else {
481
            ret = -ENOMEM;
482
            ret = -TARGET_ENOMEM;
482 483
            if (ss.ss_size < MINSIGSTKSZ)
483 484
                goto out;
484 485
	}
......
488 489
    }
489 490

  
490 491
    if (uoss) {
491
        ret = -EFAULT;
492
        ret = -TARGET_EFAULT;
492 493
        if (!access_ok(VERIFY_WRITE, uoss, sizeof(oss)))
493 494
            goto out;
494 495
        memcpy(uoss, &oss, sizeof(oss));
......
499 500
    return ret;
500 501
}
501 502

  
503
/* do_sigaction() return host values and errnos */
502 504
int do_sigaction(int sig, const struct target_sigaction *act,
503 505
                 struct target_sigaction *oact)
504 506
{
505 507
    struct emulated_sigaction *k;
506 508
    struct sigaction act1;
507 509
    int host_sig;
510
    int ret = 0;
508 511

  
509 512
    if (sig < 1 || sig > TARGET_NSIG || sig == SIGKILL || sig == SIGSTOP)
510 513
        return -EINVAL;
......
546 549
            } else {
547 550
                act1.sa_sigaction = host_signal_handler;
548 551
            }
549
            sigaction(host_sig, &act1, NULL);
552
            ret = sigaction(host_sig, &act1, NULL);
550 553
        }
551 554
    }
552
    return 0;
555
    return ret;
553 556
}
554 557

  
555 558
#ifndef offsetof

Also available in: Unified diff