Chromium Code Reviews| Index: sandbox/linux/seccomp-bpf/kernel_return_value_helpers.h |
| diff --git a/sandbox/linux/seccomp-bpf/kernel_return_value_helpers.h b/sandbox/linux/seccomp-bpf/kernel_return_value_helpers.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8ba03115ba7ba3ef6a11a1aeab09086809fcdd98 |
| --- /dev/null |
| +++ b/sandbox/linux/seccomp-bpf/kernel_return_value_helpers.h |
| @@ -0,0 +1,23 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef SANDBOX_LINUX_SERVICES_KERNEL_RETURN_VALUE_HELPERS_H__ |
| +#define SANDBOX_LINUX_SERVICES_KERNEL_RETURN_VALUE_HELPERS_H__ |
| + |
| +#include <signal.h> |
| +#include <stdint.h> |
| + |
| +namespace sandbox { |
| + |
| +// Convert |errno| to the value returned by the kernel when it wants to return |
| +// |errno| to userland after a system call. |
| +int ErrnoToKernelRet(int errno_val); |
|
jln (very slow on Chromium)
2014/06/13 02:47:36
Let's keep the interface of trap handlers as retur
nedeljko
2014/06/18 13:41:00
Done.
|
| + |
| +// Set the registers in |ctx| to match what they would be after a system call |
| +// returning |ret_val|. |
|
jln (very slow on Chromium)
2014/06/13 02:47:36
Let's add: |ret_val| must must follow the SandboxS
nedeljko
2014/06/18 13:41:00
Done.
|
| +void PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx); |
| + |
| +} // namespace sandbox |
| + |
| +#endif // SANDBOX_LINUX_SERVICES_KERNEL_RETURN_VALUE_HELPERS_H__ |