Skip to content

Commit

Permalink
Add klogctl and KLOG constants on linux_like
Browse files Browse the repository at this point in the history
  • Loading branch information
sgasse committed Jul 19, 2024
1 parent 043e8a3 commit 3cdb3bd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libc-test/semver/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,17 @@ KEY_SPEC_SESSION_KEYRING
KEY_SPEC_THREAD_KEYRING
KEY_SPEC_USER_KEYRING
KEY_SPEC_USER_SESSION_KEYRING
KLOG_CLOSE
KLOG_OPEN
KLOG_READ
KLOG_READ_ALL
KLOG_READ_CLEAR
KLOG_CLEAR
KLOG_CONSOLE_OFF
KLOG_CONSOLE_ON
KLOG_CONSOLE_LEVEL
KLOG_SIZE_UNREAD
KLOG_SIZE_BUFFER
LC_COLLATE
LC_COLLATE_MASK
LC_CTYPE
Expand Down Expand Up @@ -3559,6 +3570,7 @@ j1939_filter
jrand48
key_t
killpg
klogctl
labs
lcong48
lgetxattr
Expand Down
15 changes: 15 additions & 0 deletions src/unix/linux_like/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,18 @@ pub const ARPHRD_IEEE802154: u16 = 804;
pub const ARPHRD_VOID: u16 = 0xFFFF;
pub const ARPHRD_NONE: u16 = 0xFFFE;

pub const KLOG_CLOSE: ::c_int = 0;
pub const KLOG_OPEN: ::c_int = 1;
pub const KLOG_READ: ::c_int = 2;
pub const KLOG_READ_ALL: ::c_int = 3;
pub const KLOG_READ_CLEAR: ::c_int = 4;
pub const KLOG_CLEAR: ::c_int = 5;
pub const KLOG_CONSOLE_OFF: ::c_int = 6;
pub const KLOG_CONSOLE_ON: ::c_int = 7;
pub const KLOG_CONSOLE_LEVEL: ::c_int = 8;
pub const KLOG_SIZE_UNREAD: ::c_int = 9;
pub const KLOG_SIZE_BUFFER: ::c_int = 10;

cfg_if! {
if #[cfg(target_os = "emscripten")] {
// Emscripten does not define any `*_SUPER_MAGIC` constants.
Expand Down Expand Up @@ -1790,6 +1802,9 @@ extern "C" {
locale: ::locale_t,
) -> ::size_t;
pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::tm) -> *mut ::c_char;

// #include<klog.h>
pub fn klogctl(syslog_type: ::c_int, buf: *mut ::c_char, len: ::c_int) -> ::c_int;
}

// LFS64 extensions
Expand Down

0 comments on commit 3cdb3bd

Please sign in to comment.