This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SYS/BIOS POSIX Thread Support

Other Parts Discussed in Thread: SYSBIOS

Hi,

    I am porting applications from a POSIX environment to SYS/BIOS. But I could not find some include file under <ti/sysbios/posix>, such as "sys/time.h", "sys/types.h", "unistd.h", "poll.h". And some macro or constant expressions such as "PTHREAD_MUTEX_INITIALIZER" does not defined in "pthread.h".

    I searched in 'opengroup' and there Headers directory tree contain "sys/time.h", "sys/types.h", "unistd.h", "poll.h". Also the description of "pthread.h" says the <pthread.h> header shall define the compile-time constand expression such as 'PTHREAD_MUTEX_INITIALIZER". Do I miss something before compiling or SYS/BIOS support different posix standard?

    BTW, my SYS/BIOS version is v6.42.03.35

Thanks.

Regards,

Junpeng Ma

  • Hi,

    Moving your post to right forum to be better answered.

    Thanks & regards,
    Sivaraj K
  • Junpeng Ma,

    The SYS/BIOS POSIX support is a subset of the POSIX standard. Unfortunately, not all features are supported. Maybe you can work around this limitation by using runtime initialization instead of compile time initialization.

    The following link might be helpful.

    http://processors.wiki.ti.com/index.php/SYS/BIOS_POSIX_Thread_(pthread)_Support

    ~Ramsey

  • Junpeng Ma,

    Which tool chain are you using? If you are using GNU tool chain, then it should provide sys/time.h and sys/types.h. If you are using IAR or TI tool chain, these are not provided. However, the SYS/BIOS POSIX header file includes some of the basic types from these files. Try removing these includes from your source code and see what comes up as undefined.

    There is also a function called pthread_once. This function can be used to initialize the mutex object. You might find this useful for solving the static initialization issue.

    ~Ramsey

  • Hi Ramsey,

        I used TI c6000 compiler. And I removed missing includes files from my source code to work in subset of the POSIX standard which SYS/BIOS support.

        But now I met a problem that I must use nanosleep() or clock_nanosleep(), but I can not find both of them. How can I use these functions?

    Thanks.

    Regards,

    Junpeng Ma

  • Junpeng Ma,

    It sounds like you are porting an application from some other operating system to SYS/BIOS. In general, you will find many functions which are not available in the target OS (SYS/BIOS in this example). For these functions, you will need to replace them with some equivalent functionality.

    SYS/BIOS offers the Task_sleep API. Maybe this will help. If not, then you can write your own busy wait function using the xdc.runtime.Timestamp module.

    ~Ramsey