diff options
author | max99x <max99x@gmail.com> | 2011-09-13 01:30:04 +0300 |
---|---|---|
committer | max99x <max99x@gmail.com> | 2011-09-13 01:30:04 +0300 |
commit | 6486d17674fd10c09bf9f552b7187e02f3eea81b (patch) | |
tree | 4f1a5d047d8f88130405f26feb7f28abf48d0717 | |
parent | b3917d04fc55c766485b15bc1e48984ded73decd (diff) |
Added stub implementations of clock_(get|set)time() and clock_getres().
-rw-r--r-- | src/library.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js index 20492de2..25fd7579 100644 --- a/src/library.js +++ b/src/library.js @@ -4666,6 +4666,28 @@ LibraryManager.library = { // sys/time.h // ========================================================================== + __timespec_struct_layout: Runtime.generateStructInfo(null, '%struct.timespec'), + // TODO: Implement these for real. + clock_gettime__deps: ['__timespec_struct_layout'], + clock_gettime: function(clk_id, tp) { + // int clock_gettime(clockid_t clk_id, struct timespec *tp); + {{{ makeSetValue('tp', '___timespec_struct_layout.tv_sec', '0', 'i32') }}} + {{{ makeSetValue('tp', '___timespec_struct_layout.tv_nsec', '0', 'i32') }}} + return 0; + }, + clock_settime: function(clk_id, tp) { + // int clock_settime(clockid_t clk_id, const struct timespec *tp); + // Nothing. + return 0; + }, + clock_getres__deps: ['__timespec_struct_layout'], + clock_getres: function(clk_id, res) { + // int clock_getres(clockid_t clk_id, struct timespec *res); + {{{ makeSetValue('res', '___timespec_struct_layout.tv_sec', '1', 'i32') }}} + {{{ makeSetValue('res', '___timespec_struct_layout.tv_nsec', '0', 'i32') }}} + return 0; + }, + // TODO: Implement remaining functions. // http://pubs.opengroup.org/onlinepubs/000095399/basedefs/sys/time.h.html gettimeofday: function(ptr) { |