Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > How to implement my own ctime() in linux kernel?

Reply
Thread Tools

How to implement my own ctime() in linux kernel?

 
 
Hao Xu
Guest
Posts: n/a
 
      08-16-2004
Hi everyone!

I think that everyone knows ctime() in glibc:

The ctime(), gmtime() and localtime() functions all take an argument
of data type time_t which represents calendar time. When interpreted
as an absolute time value, it represents the number of seconds
elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC).

Now I need to use the function of ctime() in linux kernel, but it
seems that I cannot access ctime() in the linux kernel, right? So I have
to reimplement ctime() in the linux kernel. I found that the algorithm
of glibc ctime() is very complex, I don't understand it. Does anyone has
any good ideas about how to implement ctime()?

Thanks!
 
Reply With Quote
 
 
 
 
Keith Thompson
Guest
Posts: n/a
 
      08-16-2004
Hao Xu <> writes:
> I think that everyone knows ctime() in glibc:


Well, everyone here knows about the ctime() function defined by the C
standard.

[snip]
> Now I need to use the function of ctime() in linux kernel, but it
> seems that I cannot access ctime() in the linux kernel, right?


No idea.

> So I have to reimplement ctime() in the linux kernel. I found that
> the algorithm of glibc ctime() is very complex, I don't understand
> it. Does anyone has any good ideas about how to implement ctime()?


Not here. If you have a working implementation, you might be able to
just copy it into your code, whether you understand the algorithm or
not. If that doesn't work, you'll need to try a Linux-specific
programming group.

--
Keith Thompson (The_Other_Keith) kst- <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
 
Reply With Quote
 
 
 
 
Mark McIntyre
Guest
Posts: n/a
 
      08-17-2004
On Mon, 16 Aug 2004 15:25:24 +0800, in comp.lang.c , Hao Xu
<> wrote:

> Now I need to use the function of ctime() in linux kernel, but it
>seems that I cannot access ctime() in the linux kernel, right?


No idea.

>So I have
>to reimplement ctime() in the linux kernel. I found that the algorithm
>of glibc ctime() is very complex, I don't understand it.


Thats probably because it needs to be. I'd suggest you study the algo and
understand it...

>Does anyone has
>any good ideas about how to implement ctime()?


Ask in comp.unix.progammer. This is not a C question.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
implement my own lib function fprintf --- Segmentation Fault eliweiq001 C Programming 12 10-05-2010 11:46 PM
How to implement your own preprocessor directive _dwin@yahoo.com C++ 5 01-08-2008 02:07 PM
Is Linux Really Dead On The Desktop? Linus's Own Family Doesn't Use Linux!!!!!!!!!!!!1 linux.freak.detector@gmail.com Computer Support 6 10-21-2007 11:47 AM
Using own classloader inside J2EE to load and unload own classes. Stefan Siegl Java 0 09-21-2004 08:11 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57