4.104.114.84.95
Last change
on this file since 4d0bb65 was
4d0bb65,
checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/06 at 22:49:30
|
2006-11-17 Joel Sherrill <joel@…>
- posix/src/keygetspecific.c, posix/src/keysetspecific.c,
posix/src/semtimedwait.c: Correct indexing of key data to use api and
index NOT class and index. Class is always 1.
|
-
Property mode set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | /* |
---|
2 | * $Id$ |
---|
3 | */ |
---|
4 | |
---|
5 | #if HAVE_CONFIG_H |
---|
6 | #include "config.h" |
---|
7 | #endif |
---|
8 | |
---|
9 | #include <errno.h> |
---|
10 | #include <limits.h> |
---|
11 | #include <pthread.h> |
---|
12 | #include <string.h> |
---|
13 | |
---|
14 | #include <rtems/system.h> |
---|
15 | #include <rtems/score/thread.h> |
---|
16 | #include <rtems/score/wkspace.h> |
---|
17 | #include <rtems/posix/key.h> |
---|
18 | |
---|
19 | /*PAGE |
---|
20 | * |
---|
21 | * 17.1.2 Thread-Specific Data Management, P1003.1c/Draft 10, p. 165 |
---|
22 | */ |
---|
23 | |
---|
24 | int pthread_setspecific( |
---|
25 | pthread_key_t key, |
---|
26 | const void *value |
---|
27 | ) |
---|
28 | { |
---|
29 | register POSIX_Keys_Control *the_key; |
---|
30 | uint32_t api; |
---|
31 | uint32_t index; |
---|
32 | Objects_Locations location; |
---|
33 | |
---|
34 | the_key = _POSIX_Keys_Get( key, &location ); |
---|
35 | switch ( location ) { |
---|
36 | case OBJECTS_ERROR: |
---|
37 | case OBJECTS_REMOTE: /* should never happen */ |
---|
38 | return EINVAL; |
---|
39 | case OBJECTS_LOCAL: |
---|
40 | api = _Objects_Get_API( _Thread_Executing->Object.id ); |
---|
41 | index = _Objects_Get_index( _Thread_Executing->Object.id ); |
---|
42 | the_key->Values[ api ][ index ] = (void *) value; |
---|
43 | _Thread_Enable_dispatch(); |
---|
44 | return 0; |
---|
45 | } |
---|
46 | return POSIX_BOTTOM_REACHED(); |
---|
47 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.