basic: turn off stdio locking for a couple of helper calls
These helper calls are potentially called often, and allocate FILE* objects internally for a very short period of time, let's turn off locking for them too.
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include <limits.h>
|
||||
#include <signal.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio_ext.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -1032,6 +1033,8 @@ int cg_pid_get_path(const char *controller, pid_t pid, char **path) {
|
||||
if (!f)
|
||||
return errno == ENOENT ? -ESRCH : -errno;
|
||||
|
||||
(void) __fsetlocking(f, FSETLOCKING_BYCALLER);
|
||||
|
||||
FOREACH_LINE(line, f, return -errno) {
|
||||
char *e, *p;
|
||||
|
||||
@@ -2371,6 +2374,8 @@ int cg_kernel_controllers(Set **ret) {
|
||||
return -errno;
|
||||
}
|
||||
|
||||
(void) __fsetlocking(f, FSETLOCKING_BYCALLER);
|
||||
|
||||
/* Ignore the header line */
|
||||
(void) read_line(f, (size_t) -1, NULL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user