Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/nonsfi/linux/linux_sys_private.c

Issue 1212613002: Non-SFI mode: Add Linux asynchronous signal support (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2014 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /* 7 /*
8 * This file defines various POSIX-like functions directly using Linux 8 * This file defines various POSIX-like functions directly using Linux
9 * syscalls. This is analogous to src/untrusted/nacl/sys_private.c, which 9 * syscalls. This is analogous to src/untrusted/nacl/sys_private.c, which
10 * defines functions using NaCl syscalls directly. 10 * defines functions using NaCl syscalls directly.
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 603
604 int linux_sigprocmask(int how, 604 int linux_sigprocmask(int how,
605 const linux_sigset_t *set, 605 const linux_sigset_t *set,
606 linux_sigset_t *oset) { 606 linux_sigset_t *oset) {
607 return errno_value_call( 607 return errno_value_call(
608 linux_syscall4(__NR_rt_sigprocmask, how, 608 linux_syscall4(__NR_rt_sigprocmask, how,
609 (uintptr_t) set, (uintptr_t) oset, 609 (uintptr_t) set, (uintptr_t) oset,
610 sizeof(*set))); 610 sizeof(*set)));
611 } 611 }
612 612
613 int linux_tgkill(int tgid,
Mark Seaborn 2015/06/26 18:31:59 Nit: args would fit on one line
Luis Héctor Chávez 2015/07/06 23:44:59 Done.
614 int tid,
615 int sig) {
616 return errno_value_call(
617 linux_syscall3(__NR_tgkill, tgid, tid, sig));
618 }
619
613 /* 620 /*
614 * Obtain Linux signal number from portable signal number. 621 * Obtain Linux signal number from portable signal number.
615 */ 622 */
616 static int nacl_signum_to_linux_signum(int signum) { 623 static int nacl_signum_to_linux_signum(int signum) {
617 /* SIGSTKFLT is not defined in newlib, hence no mapping. */ 624 /* SIGSTKFLT is not defined in newlib, hence no mapping. */
618 #define HANDLE_SIGNUM(SIGNUM) case SIGNUM: return LINUX_##SIGNUM; 625 #define HANDLE_SIGNUM(SIGNUM) case SIGNUM: return LINUX_##SIGNUM;
619 switch(signum) { 626 switch(signum) {
620 HANDLE_SIGNUM(SIGHUP); 627 HANDLE_SIGNUM(SIGHUP);
621 HANDLE_SIGNUM(SIGINT); 628 HANDLE_SIGNUM(SIGINT);
622 HANDLE_SIGNUM(SIGQUIT); 629 HANDLE_SIGNUM(SIGQUIT);
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 va_list ap; 858 va_list ap;
852 va_start(ap, arg); 859 va_start(ap, arg);
853 void *ptid = va_arg(ap, void *); 860 void *ptid = va_arg(ap, void *);
854 void *tls = va_arg(ap, void *); 861 void *tls = va_arg(ap, void *);
855 void *ctid = va_arg(ap, void *); 862 void *ctid = va_arg(ap, void *);
856 va_end(ap); 863 va_end(ap);
857 864
858 return errno_value_call(linux_clone_wrapper( 865 return errno_value_call(linux_clone_wrapper(
859 (uintptr_t) fn, (uintptr_t) arg, flags, child_stack, ptid, tls, ctid)); 866 (uintptr_t) fn, (uintptr_t) arg, flags, child_stack, ptid, tls, ctid));
860 } 867 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698