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

Side by Side Diff: sandbox/linux/suid/process_util.h

Issue 670183003: Update from chromium 62675d9fb31fb8cedc40f68e78e8445a74f362e7 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // The following is duplicated from base/process_utils.h.
6 // We shouldn't link against C++ code in a setuid binary.
7
8 #ifndef SANDBOX_LINUX_SUID_PROCESS_UTIL_H_
9 #define SANDBOX_LINUX_SUID_PROCESS_UTIL_H_
10
11 #include <stdbool.h>
12 #include <sys/types.h>
13
14 // This adjusts /proc/process/oom_score_adj so the Linux OOM killer
15 // will prefer certain process types over others. The range for the
16 // adjustment is [-1000, 1000], with [0, 1000] being user accessible.
17 //
18 // If the Linux system isn't new enough to use oom_score_adj, then we
19 // try to set the older oom_adj value instead, scaling the score to
20 // the required range of [0, 15]. This may result in some aliasing of
21 // values, of course.
22 bool AdjustOOMScore(pid_t process, int score);
23
24 // This adjusts /sys/kernel/mm/chromeos-low_mem/margin so that
25 // the kernel notifies us that we are low on memory when less than
26 // |margin_mb| megabytes are available. Setting |margin_mb| to -1
27 // turns off low memory notification.
28 bool AdjustLowMemoryMargin(int64_t margin_mb);
29
30 #endif // SANDBOX_LINUX_SUID_PROCESS_UTIL_H_
OLDNEW
« no previous file with comments | « sandbox/linux/suid/common/suid_unsafe_environment_variables.h ('k') | sandbox/linux/suid/process_util_linux.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698