Hi Huang,
>
> I am using RTL 2.2 now .
> I need atoi and sprintf function in my RT task, but failed.
>
> I test it by insert some code into RTL2.2 example frank .
>
> 1. include the stdlib.h
> 2. insert follow lines into thread_code
>
> /*==================================================*/
> char test_sprintf[16];
> int test_atoi;
>
> sprintf(test_sprintf, "%d", fifo);
> rtl_printf("test_sprintf is %s\n", test_sprintf);
>
> test_atoi = (int)atoi(test_sprintf);
> rtl_printf("test_atoi =%d\n", test_atoi);
> /*==================================================*/
>
> 3. do make then insmod frank_module.o , but failed in
>
> frank_module.o: unresolved symbol __strtol_internal
>
> 4. so I did "ld -r -o mod.o frank_module.o -L/usr/lib -lc"
> then insmod mod.o , but failed , too .
>
> What's wrong , can someone point me.
>
Just my first guess: have a look at the size of mod.o and
frank_module.o. If no _substantial_ difference in size, mod.o was
probably linked with shared libraries that are not available in kernel
memory space.
Add -M to your ld option to see which symbols are needed/defined.
Due to lot of interdependecies in standard C functions, atoi/sprintf
may call malloc/calloc not recommended in RT apps.
Cheers,
pa
--
..........................................................................
Pavel Andris | tel: +421 7 5941 2167
Institute of Control Theory and Robotics | fax: +421 7 5477 6045
Slovak Academy of Sciences |
Dubravska cesta 9 | e-mail: [EMAIL PROTECTED]
SK - 842 37 Bratislava |
Slovakia |
..........................................................................
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/