Changeset f6d2c81 in mainline for uspace/libc/generic/thread.c
- Timestamp:
- 2007-05-30T19:50:24Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c31e536
- Parents:
- 51ec40f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/libc/generic/thread.c
r51ec40f rf6d2c81 78 78 * Zero out the thread local uninitialized data. 79 79 */ 80 memset(data + (&_tbss_start - &_tdata_start), 0, &_tbss_end -81 80 memset(data + (&_tbss_start - &_tdata_start), 0, 81 &_tbss_end - &_tbss_start); 82 82 83 83 return tcb; … … 129 129 * @return Zero on success or a code from @ref errno.h on failure. 130 130 */ 131 int thread_create(void (* function)(void *), void *arg, char *name, thread_id_t *tid) 131 int thread_create(void (* function)(void *), void *arg, char *name, 132 thread_id_t *tid) 132 133 { 133 134 char *stack; 134 135 uspace_arg_t *uarg; 136 int rc; 135 137 136 138 stack = (char *) malloc(getpagesize() * THREAD_INITIAL_STACK_PAGES_NO); … … 150 152 uarg->uspace_uarg = uarg; 151 153 152 return __SYSCALL3(SYS_THREAD_CREATE, (sysarg_t) uarg, (sysarg_t) name, (sysarg_t) tid); 154 rc = __SYSCALL3(SYS_THREAD_CREATE, (sysarg_t) uarg, (sysarg_t) name, 155 (sysarg_t) tid); 156 157 if (!rc) { 158 /* 159 * Failed to create a new thread. 160 * Free up the allocated structures. 161 */ 162 free(uarg); 163 free(stack); 164 } 165 166 return rc; 153 167 } 154 168
Note:
See TracChangeset
for help on using the changeset viewer.