mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
renamed file
This commit is contained in:
parent
36e27af702
commit
44c3efaac7
6 changed files with 46 additions and 7 deletions
2
Makefile
2
Makefile
|
@ -6,7 +6,7 @@ LIBS = libs2ss.so
|
|||
|
||||
# Object files for libs2ss
|
||||
LIB_OBJS = sample.o path.o node.o \
|
||||
linux.o \
|
||||
kernel.o \
|
||||
list.o pool.o queue.o lstack.o \
|
||||
log.o \
|
||||
utils.o \
|
||||
|
|
|
@ -10,6 +10,15 @@
|
|||
#ifndef _LINUX_H_
|
||||
#define _LINUX_H_
|
||||
|
||||
//#include <sys/capability.h>
|
||||
|
||||
/** Check if current process has capability \p cap.
|
||||
*
|
||||
* @retval 0 If capabilty is present.
|
||||
* @retval <0 If capability is not present.
|
||||
*/
|
||||
//int kernel_check_cap(cap_value_t cap):
|
||||
|
||||
/** Checks for realtime (PREEMPT_RT) patched kernel.
|
||||
*
|
||||
* See https://rt.wiki.kernel.org
|
|
@ -17,7 +17,7 @@
|
|||
#include "utils.h"
|
||||
#include "timing.h"
|
||||
#include "utils.h"
|
||||
#include "linux.h"
|
||||
#include "kernel.h"
|
||||
|
||||
static struct pci_access *pacc;
|
||||
|
||||
|
|
2
lib/if.c
2
lib/if.c
|
@ -21,7 +21,7 @@
|
|||
#include "nl.h"
|
||||
#include "socket.h"
|
||||
#include "utils.h"
|
||||
#include "linux.h"
|
||||
#include "kernel.h"
|
||||
|
||||
struct interface * if_create(struct rtnl_link *link)
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include "utils.h"
|
||||
#include "config.h"
|
||||
#include "linux.h"
|
||||
#include "kernel.h"
|
||||
|
||||
int kernel_module_set_param(const char *module, const char *param, const char *value)
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ int kernel_module_set_param(const char *module, const char *param, const char *v
|
|||
snprintf(fn, sizeof(fn), "%s/module/%s/parameters/%s", SYSFS_PATH, module, param);
|
||||
f = fopen(fn, "w");
|
||||
if (f) {
|
||||
debug(5, "Set parameter %s of kernel module %s to %s", module, param, value);
|
||||
debug(DBG_SOCKET | 5, "Set parameter %s of kernel module %s to %s", module, param, value);
|
||||
fprintf(f, "%s", value);
|
||||
fclose(f);
|
||||
}
|
||||
|
@ -121,6 +121,8 @@ int kernel_has_cmdline(const char *substr)
|
|||
|
||||
if (!fgets(cmd, sizeof(cmd), f))
|
||||
return -1;
|
||||
|
||||
fclose(f);
|
||||
|
||||
return strstr(cmd, substr) ? 0 : -1;
|
||||
}
|
||||
|
@ -128,4 +130,32 @@ int kernel_has_cmdline(const char *substr)
|
|||
int kernel_get_cacheline_size()
|
||||
{
|
||||
return sysconf(_SC_LEVEL1_ICACHE_LINESIZE);
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
int kernel_check_cap(cap_value_t cap)
|
||||
{
|
||||
int ret;
|
||||
|
||||
cap_t caps;
|
||||
cap_flag_value_t value;
|
||||
|
||||
caps = cap_get_proc();
|
||||
if (caps == NULL)
|
||||
return -1;
|
||||
|
||||
ret = cap_get_proc(caps);
|
||||
if (ret == -1)
|
||||
return -1;
|
||||
|
||||
ret = cap_get_flag(caps, cap, CAP_EFFECTIVE, &value);
|
||||
if (ret == -1)
|
||||
return -1;
|
||||
|
||||
ret = cap_free(caps);
|
||||
if (ret)
|
||||
return -1;
|
||||
|
||||
return value == CAP_SET ? 0 : -1;
|
||||
}
|
||||
#endif
|
|
@ -11,7 +11,7 @@
|
|||
#include "utils.h"
|
||||
|
||||
#include "pool.h"
|
||||
#include "linux.h"
|
||||
#include "kernel.h"
|
||||
|
||||
int pool_init_mmap(struct pool *p, size_t blocksz, size_t cnt)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue