Function report |
Source Code:kernel\time\ntp.c |
Create Date:2022-07-28 10:43:46 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:adjtimex mainly allows reading (and writing, if superuser) of* kernel time-keeping variables. used by xntpd.
Proto:int __do_adjtimex(struct __kernel_timex *txc, const struct timespec64 *ts, s32 *time_tai, struct audit_ntp_data *ad)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct __kernel_timex * | txc | |
| const struct timespec64 * | ts | |
| s32 * | time_tai | |
| struct audit_ntp_data * | ad |
| 719 | If mode selector & switch between adjtime/adjtimex modes Then |
| 720 | save_adjust = time_adjust |
| 722 | If Not ( mode selector & ad-only adjtime ) Then |
| 731 | Else |
| 733 | If mode selector Then |
| 737 | audit_ntp_set_old(ad, AUDIT_NTP_TAI, * time_tai) |
| 745 | audit_ntp_set_new(ad, AUDIT_NTP_TAI, * time_tai) |
| 749 | time offset (usec) = Required to safely shift negative values (ime adjustment (nsecs): * NTP_INTERVAL_FREQ, NTP_SCALE_SHIFT) |
| 751 | If Not (clock status bits: & solution (0 = us, 1 = ns) (ro) ) Then time offset (usec) = time offset (usec) / NSEC_PER_USEC |
| 757 | If is_error_status(clock status bits: ) Then result = clock not synchronized |
| 760 | frequency offset (scaled ppm) = Required to safely shift negative values ((quency offset (scaled nsecs/secs): >> PPM_SCALE_INV_SHIFT) * PPM_SCALE_INV, NTP_SCALE_SHIFT) |
| 769 | TAI offset (ro) = time_tai |
| 772 | pps_fill_timex(txc) |
| 775 | tv_usec = nanoseconds |
| 776 | If Not (clock status bits: & solution (0 = us, 1 = ns) (ro) ) Then tv_usec = nanoseconds / NSEC_PER_USEC |
| 797 | Return result |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |