Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
162 user(s) are online (145 user(s) are browsing Forums)

Members: 2
Guests: 160

Raziel, sailor, more...

Support us!

Headlines

 
  Register To Post  

setitimer() / getitimer() undefined reference
Quite a regular
Quite a regular


See User information
Hello.

newlib - sys/time.h has an extern declaration for setitimer, but in no library can I actually find the definition.

A simple program:
#include <sys/time.h>

int main(int argcchar *argv[])
{
    
int ret;
    
ret setitimer(ITIMER_REALNULLNULL);
    return 
0;
}

with:
gcc -o main -mcrt=newlib main.c

results in an undefined reference.

Am I missing a library?


Edited by rjd324 on 2022/3/12 20:53:48
Reason: more realistic title
Edited by rjd324 on 2022/3/12 20:57:19
Reason: fixed title
Edited by rjd324 on 2022/3/17 0:17:36
Go to top
Re: setitimer undefined reference
Home away from home
Home away from home


See User information
@rjd324
Usual way checkign what wrong is once you have undef to some posix based or so function, you then go to SDK directory and to search over all files on that one. In your case on "setitimer" find in sys/time.h, but i didn't find it in any *.a libs, so safe bet to say it's unimplemented. But the fact that it's in the time.h, point out that it was forgotten, or there is some bug, or so.

I wrote to beta-list about, and if it unimplemented i will made feature request.

Through i hope that in clib2 version on which Afxgroup works now that will be implemnted too (if not already).

Go to top
Re: setitimer undefined reference
Quite a regular
Quite a regular


See User information
@kas1e.

Thanks for the tip. I do generally use SDK Browser.

Do you know if setitimer/getitimer are on the list of known unimplemented/forgotten functions for the newlib guys?

Go to top
Re: setitimer undefined reference
Home away from home
Home away from home


See User information
@rjd324
Quote:

Thanks for the tip. I do generally use SDK Browser.


This way you may miss some necessary information , as SDK browser surely didn't search inside of stub *.a libs, or in pure text files, but only autodocs (and maybe includes too, not sure).

So the safe way is always use pure dopus or something, and do search on the whole "SDK" dir.

Quote:

Do you know if setitimer/getitimer are on the list of known unimplemented/forgotten functions for the newlib guys?


In OS4 beta no one answer, but i ask Andrea is he have it in his clib2 , he also didn't have it, and it turns out to be those functions is "too much linux centric" which need kernel changes or so.

Probably those defines for functions in newlib was just left in sys/time by ancident (they just forgot to delete them seems so), and while functions defined, tey isn't implemented anywhere, not in newlib, not in clib2, and never was.

Go to top
Re: setitimer undefined reference
Quite a regular
Quite a regular


See User information
@kas1e

Thanks for the info. I do actually use the find utility also and this searches all files whether they are binaries or whatever. Is this okay? Or is there a faster technique?

Go to top
Re: setitimer undefined reference
Home away from home
Home away from home


See User information
@rjd324
I think find is ok too, i just use dopus4 for, but should all be the same by speed

Go to top
Re: setitimer() / getitimer() / strerror() undefined reference
Quite a regular
Quite a regular


See User information
@kas1e
@afxgroup

I also believe that there is a lack of implementation for strerror() which is causing another undefined reference. Well, actually, the source code is directly using the sys_errlist variable. Either way, this is something else that would be nice to have in newlib (which, since it is closed source may never happen) or CLIB2 - for which there is a chance - if CLIB2 does not have it already.

Go to top
Re: setitimer() / getitimer() / strerror() undefined reference
Quite a regular
Quite a regular


See User information
@rjd324

That's strange. The strerror() function IS included in the newlib and the clib2 library.

Go to top
Re: setitimer() / getitimer() / strerror() undefined reference
Amigans Defender
Amigans Defender


See User information
strerror is present in both libraries

Go to top
Re: setitimer() / getitimer() / strerror() undefined reference
Amigans Defender
Amigans Defender


See User information
Just implemented setitimer (only with ITIMER_REAL that makes sense) in clib2 (with a lot of other functions)

Go to top
Re: setitimer() / getitimer() / strerror() undefined reference
Quite a regular
Quite a regular


See User information
Nice.

Did you do getitimer?

As for strerror, yes it is there. No problem.

Go to top
Re: setitimer() / getitimer() / strerror() undefined reference
Amigans Defender
Amigans Defender


See User information
@rjd324

Quote:

Did you do getitimer?


Working on it. I have to fix setitimer that is not warking correctly in all cases

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project