Skip to content

Commit 765595e

Browse files
committed
add ptp_clock_caps
1 parent 0a96edd commit 765595e

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

libc-test/semver/linux.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2252,6 +2252,7 @@ PTHREAD_PRIO_PROTECT
22522252
PTHREAD_PROCESS_PRIVATE
22532253
PTHREAD_PROCESS_SHARED
22542254
PTHREAD_STACK_MIN
2255+
PTP_CLOCK_CAPS_RSV_LEN
22552256
PTP_CLOCK_GETCAPS
22562257
PTP_CLOCK_GETCAPS2
22572258
PTP_ENABLE_PPS
@@ -3942,6 +3943,7 @@ pthread_spin_lock
39423943
pthread_spin_trylock
39433944
pthread_spin_unlock
39443945
pthread_spinlock_t
3946+
ptp_clock_caps
39453947
ptp_clock_time
39463948
ptp_extts_event
39473949
ptp_extts_request

src/unix/linux_like/linux/mod.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,6 +1194,33 @@ s! {
11941194
pub chan: ::c_uint,
11951195
pub rsv: [::c_uint; 5],
11961196
}
1197+
1198+
pub struct ptp_clock_caps {
1199+
pub max_adj: ::c_int,
1200+
pub n_alarm: ::c_int,
1201+
pub n_ext_ts: ::c_int,
1202+
pub n_per_out: ::c_int,
1203+
pub pps: ::c_int,
1204+
pub n_pins: ::c_int,
1205+
pub cross_timestamping: ::c_int,
1206+
#[cfg(any(target_arch = "sparc", target_arch = "sparc64"))]
1207+
pub adjust_phase: ::c_int,
1208+
#[cfg(not(any(
1209+
any(target_arch = "sparc", target_arch = "sparc64"),
1210+
any(target_env = "musl", target_env = "ohos"),
1211+
)))]
1212+
pub adjust_phase: ::c_int,
1213+
#[cfg(not(any(
1214+
any(target_arch = "sparc", target_arch = "sparc64"),
1215+
any(target_env = "musl", target_env = "ohos"),
1216+
)))]
1217+
pub max_phase_adj: ::c_int,
1218+
#[cfg(not(any(
1219+
any(target_arch = "sparc", target_arch = "sparc64"),
1220+
any(target_env = "musl", target_env = "ohos"),
1221+
)))]
1222+
pub rsv: [::c_int; PTP_CLOCK_CAPS_RSV_LEN],
1223+
}
11971224
}
11981225

11991226
cfg_if! {
@@ -5623,6 +5650,17 @@ pub const SCHED_FLAG_ALL: ::c_int = SCHED_FLAG_RESET_ON_FORK
56235650
pub const EPIOCSPARAMS: ::Ioctl = 0x40088a01;
56245651
pub const EPIOCGPARAMS: ::Ioctl = 0x80088a02;
56255652

5653+
// ptp_clock.h
5654+
pub const PTP_CLOCK_CAPS_RSV_LEN: usize = {
5655+
if cfg!(any(target_arch = "sparc", target_arch = "sparc64")) {
5656+
12
5657+
} else if cfg!(any(target_env = "musl", target_env = "ohos")) {
5658+
13
5659+
} else {
5660+
11
5661+
}
5662+
};
5663+
56265664
const _IOC_NRBITS: u32 = 8;
56275665
const _IOC_TYPEBITS: u32 = 8;
56285666

0 commit comments

Comments
 (0)