X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=wrapper%2Frandom.c;h=7b91fc7f3e146a4b8046b7996ecb4855812537a5;hb=5b4ea313ddc10d96388a20a42e118c758479a553;hp=5b88f7edd7a5e60d1d8444b40e3047869ea247f0;hpb=886d51a3d7ed5fa6b41d7f19b3e14ae6c535a44c;p=lttng-modules.git diff --git a/wrapper/random.c b/wrapper/random.c index 5b88f7ed..7b91fc7f 100644 --- a/wrapper/random.c +++ b/wrapper/random.c @@ -1,27 +1,14 @@ -/* +/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) + * * wrapper/random.c * - * wrapper around bootid read. Using KALLSYMS to get its address when - * available, else we need to have a kernel that exports this function to GPL - * modules. + * wrapper around bootid read. Read the boot id through the /proc filesystem. * * Copyright (C) 2011-2012 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; only - * version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + /* boot_id depends on sysctl */ #if defined(CONFIG_SYSCTL) @@ -29,7 +16,7 @@ #include #include #include -#include "random.h" +#include /* * Returns string boot id. @@ -58,7 +45,7 @@ int wrapper_get_bootid(char *bootid) ret = -EINVAL; goto end; } - + bootid[BOOT_ID_LEN - 1] = '\0'; ret = 0; end: @@ -66,6 +53,7 @@ end: filp_close(file, current->files); return ret; } +EXPORT_SYMBOL_GPL(wrapper_get_bootid); #else @@ -73,5 +61,6 @@ int wrapper_get_bootid(char *bootid) { return -ENOSYS; } +EXPORT_SYMBOL_GPL(wrapper_get_bootid); #endif