2 * Copyright (C) 2011 Mathieu Desnoyers (mathieu.desnoyers@efficios.com)
4 * wrapper around bootid read. Using KALLSYMS to get its address when
5 * available, else we need to have a kernel that exports this function to GPL
8 * Dual LGPL v2.1/GPL v2 license.
11 /* boot_id depends on sysctl */
12 #if defined(CONFIG_SYSCTL)
15 #include <linux/file.h>
16 #include <linux/sched.h>
17 #include <linux/uaccess.h>
21 * Returns string boot id.
23 int wrapper_get_bootid(char *bootid
)
30 file
= filp_open("/proc/sys/kernel/random/boot_id", O_RDONLY
, 0);
37 if (!file
->f_op
|| !file
->f_op
->read
) {
42 len
= file
->f_op
->read(file
, bootid
, BOOT_ID_LEN
- 1, &file
->f_pos
);
43 if (len
!= BOOT_ID_LEN
- 1) {
48 bootid
[BOOT_ID_LEN
- 1] = '\0';
52 filp_close(file
, current
->files
);
58 int wrapper_get_bootid(char *bootid
)
This page took 0.047994 seconds and 4 git commands to generate.