Files
runc/libcontainer/cgroups/fs
Kir Kolyshkin 0228226e6d libcontainer/cgroups/fscommon: introduce OpenFile
Move the functionality of opening a cgroup file into a separate
function, OpenFile, which, similar to ReadFile and WriteFile,
use separate dir and file arguments.

Change ReadFile and WriteFile to rely on OpenFile, and use lower-level
read and write instead of ones from ioutil.

It changes the semantics of WriteFile a bit -- it no longer uses
O_CREAT flag. This is good for real cgroup as there is no need to try
creating the files in there, but can potentially break WriteFile users
-- previously, EPERM error was returned for non-existing files, and
now it's ENOENT.

This also breaks the fs/fs2 unit tests since they write to pseudo-cgroup
files inside a test directory (not to a real cgroup fs), and now
fscommon.WriteFile do not create or truncate files, so we have to add a
variable that is set by the unit tests.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-10-05 17:08:09 -07:00
..
2019-12-06 15:42:10 +09:00
2020-07-07 10:58:37 -07:00
2019-12-06 15:42:10 +09:00
2019-12-06 15:42:10 +09:00
2019-12-06 15:42:10 +09:00
2019-12-06 15:42:10 +09:00
2019-12-06 15:42:10 +09:00