mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-19 10:48:59 +08:00
Added rtems specific version of _pthread_main_np()
This required adding rtems_id rtems_init_task_id to identify the main task.
This commit is contained in:
@@ -130,6 +130,7 @@ C_FILES += lib/libc/db/mpool/mpool.c
|
||||
C_FILES += rtems/syslog.c
|
||||
C_FILES += rtems/rtems-syslog-initialize.c
|
||||
C_FILES += rtems/rtems-getprogname.c
|
||||
C_FILES += rtems/rtems-uthread_main_np.c
|
||||
|
||||
# ping command sources
|
||||
C_FILES += commands/sbin/ping/ping.c
|
||||
|
22
freebsd-userspace/rtems/rtems-uthread_main_np.c
Normal file
22
freebsd-userspace/rtems/rtems-uthread_main_np.c
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* RTEMS version of
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
|
||||
__weak_reference(_pthread_main_np, pthread_main_np);
|
||||
|
||||
/*
|
||||
* Provide the equivalent to Solaris thr_main() function
|
||||
*/
|
||||
int
|
||||
_pthread_main_np()
|
||||
{
|
||||
/* Created and set in rtems_bsd_initialize */
|
||||
extern rtems_id rtems_init_task_id;
|
||||
|
||||
if ( rtems_init_task_id == rtems_task_self() )
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user