aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Terrace <jterrace@gmail.com>2012-01-06 16:02:38 -0500
committerJeff Terrace <jterrace@gmail.com>2012-01-06 19:42:56 -0500
commitb6df55f9ff340ac2c74f306268ff2c7f2e78ccda (patch)
tree6af8d147e06a04830251543a6956b6a6d1b285c7
parent36d076140f80d9ba8e3010955fb2144a8c619663 (diff)
Added pthread function stubs and added getpagesize()
-rw-r--r--src/library.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js
index b2d08f39..7c7d9576 100644
--- a/src/library.js
+++ b/src/library.js
@@ -1863,6 +1863,10 @@ LibraryManager.library = {
return 0;
}
},
+ getpagesize: function() {
+ // int getpagesize(void);
+ return PAGE_SIZE;
+ },
getopt: function(argc, argv, optstring) {
// int getopt(int argc, char * const argv[], const char *optstring);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/getopt.html
@@ -5593,6 +5597,34 @@ LibraryManager.library = {
pthread_mutex_lock: function() {},
pthread_mutex_unlock: function() {},
pthread_cond_broadcast: function() {},
+ pthread_self: function() {
+ //FIXME: assumes only a single thread
+ return 0;
+ },
+ pthread_attr_init: function(attr) {
+ /* int pthread_attr_init(pthread_attr_t *attr); */
+ //FIXME: should allocate a pthread_attr_t
+ return 0;
+ },
+ pthread_getattr_np: function(thread, attr) {
+ /* int pthread_getattr_np(pthread_t thread, pthread_attr_t *attr); */
+ //FIXME: should fill in attributes of the given thread in pthread_attr_t
+ return 0;
+ },
+ pthread_attr_destroy: function(attr) {
+ /* int pthread_attr_destroy(pthread_attr_t *attr); */
+ //FIXME: should destroy the pthread_attr_t struct
+ return 0;
+ },
+ pthread_attr_getstack: function(attr, stackaddr, stacksize) {
+ /* int pthread_attr_getstack(const pthread_attr_t *restrict attr,
+ void **restrict stackaddr, size_t *restrict stacksize); */
+ /*FIXME: assumes that there is only one thread, and that attr is the
+ current thread*/
+ {{{ makeSetValue('stackaddr', '0', 'STACK_ROOT', 'i8*') }}}
+ {{{ makeSetValue('stacksize', '0', 'TOTAL_STACK', 'i32') }}}
+ return 0;
+ },
// ==========================================================================
// malloc.h