2 * Copyright 2007, Ingo Weinhold, bonefish@cs.tu-berlin.de.
3 * Distributed under the terms of the MIT License.
6 #include "compatibility.h"
12 #include "fssh_errors.h"
17 copy_sem_info(fssh_sem_info
* info
, const sem_info
* systemInfo
)
19 info
->sem
= systemInfo
->sem
;
20 info
->team
= systemInfo
->team
;
21 strcpy(info
->name
, systemInfo
->name
);
22 info
->count
= systemInfo
->count
;
23 info
->latest_holder
= systemInfo
->latest_holder
;
31 fssh_create_sem(int32_t count
, const char *name
)
33 return create_sem(count
, name
);
38 fssh_delete_sem(fssh_sem_id id
)
40 return delete_sem(id
);
45 fssh_acquire_sem(fssh_sem_id id
)
47 return acquire_sem(id
);
52 fssh_acquire_sem_etc(fssh_sem_id id
, int32_t count
, uint32_t flags
,
53 fssh_bigtime_t timeout
)
55 return acquire_sem_etc(id
, count
, flags
, timeout
);
60 fssh_release_sem(fssh_sem_id id
)
62 return release_sem(id
);
67 fssh_release_sem_etc(fssh_sem_id id
, int32_t count
, uint32_t flags
)
69 return release_sem_etc(id
, count
, flags
);
74 fssh_get_sem_count(fssh_sem_id id
, int32_t *threadCount
)
76 return get_sem_count(id
, (int32
*)threadCount
);
81 fssh_set_sem_owner(fssh_sem_id id
, fssh_team_id team
)
83 // return set_sem_owner(id, team);
84 // The FS shell is the kernel and no other teams exist.
90 _fssh_get_sem_info(fssh_sem_id id
, struct fssh_sem_info
*info
,
94 status_t result
= get_sem_info(id
, &systemInfo
);
98 copy_sem_info(info
, &systemInfo
);
105 _fssh_get_next_sem_info(fssh_team_id team
, int32_t *cookie
,
106 struct fssh_sem_info
*info
, fssh_size_t infoSize
)
109 status_t result
= get_next_sem_info(team
, (int32
*)cookie
, &systemInfo
);
113 copy_sem_info(info
, &systemInfo
);