Skip to content

Commit dca286f

Browse files
committed
proc_fuse: add disable_uptime feature
Signed-off-by: Alexander Mikhalitsyn <[email protected]>
1 parent b06c571 commit dca286f

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/bindings.c

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#define ROOTDIR "/lxcfs/root"
4747

4848
feature_t per_instance_features[63] = {
49+
{ .name = "disable_uptime", },
4950
{ }
5051
};
5152

src/bindings.h

+1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ struct pidns_store {
162162
/* Do not free on liblxcfs reload (contains useful persistent data) */
163163
bool keep_on_reload;
164164

165+
#define LXCFS_FEATURES_DISABLE_UPTIME (1 << 0)
165166
/* bit mask for per-instance configuration options (on/off) */
166167
__u64 features;
167168
};

src/proc_fuse.c

+3
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,9 @@ static int proc_uptime_read(char *buf, size_t size, off_t offset,
948948
return total_len;
949949
}
950950

951+
if (check_set_lxcfs_feature(fc->pid, LXCFS_FEATURE_CHECK, LXCFS_FEATURES_DISABLE_UPTIME))
952+
return read_file_fuse("/proc/uptime", buf, size, d);
953+
951954
reaperage = get_reaper_age(fc->pid);
952955
/*
953956
* To understand why this is done, please read the comment to the

0 commit comments

Comments
 (0)