Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
47
Issues
47
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PPSi
Commits
e1229484
Commit
e1229484
authored
Jan 18, 2012
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pp_adj_freq implemented
virtualization of Linux adjtimex system clock time adjustment
parent
df376863
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
posix-io.c
arch-gnu-linux/posix-io.c
+18
-0
pptp.h
include/pptp/pptp.h
+4
-0
No files found.
arch-gnu-linux/posix-io.c
View file @
e1229484
...
...
@@ -6,8 +6,11 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/timex.h>
#include <pptp/pptp.h>
#define POSIX_IO_ADJ_FREQ_MAX 512000
void
pp_puts
(
const
char
*
s
)
{
fputs
(
s
,
stdout
);
...
...
@@ -55,3 +58,18 @@ void pp_set_tstamp(TimeInternal *t)
exit
(
0
);
}
}
int
pp_adj_freq
(
Integer32
adj
)
{
struct
timex
t
;
if
(
adj
>
POSIX_IO_ADJ_FREQ_MAX
)
adj
=
POSIX_IO_ADJ_FREQ_MAX
;
else
if
(
adj
<
-
POSIX_IO_ADJ_FREQ_MAX
)
adj
=
-
POSIX_IO_ADJ_FREQ_MAX
;
t
.
modes
=
MOD_FREQUENCY
;
t
.
freq
=
adj
*
((
1
<<
16
)
/
1000
);
return
!
adjtimex
(
&
t
);
}
include/pptp/pptp.h
View file @
e1229484
...
...
@@ -275,6 +275,10 @@ extern void set_TimeInternal(TimeInternal *t, Integer32 s, Integer32 ns);
extern
void
pp_get_tstamp
(
TimeInternal
*
t
);
extern
void
pp_set_tstamp
(
TimeInternal
*
t
);
/* Virtualization of Linux adjtimex (or BSD adjtime) system clock time
* adjustment. Boolean: returns 1 in case of success and 0 if failure */
extern
int
pp_adj_freq
(
Integer32
adj
);
/*
* The state machine itself is an array of these structures.
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment