git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Trying to use AUTHOR_DATE

From
RARuss Allbery <rra@stanford.edu>
Date
Apr 30, 2005, 18:10 UTC
Message-ID
<87r7gs87a9.fsf@windlord.stanford.edu>
In-Reply-To
<20050430124048.79119cac.froese@gmx.de>
Edgar Toernig <froese@gmx.de> writes:
> Oh btw, when we are about sucking time functions: the %s and %z
> strftime- sequences used further down are also non-standard (POSIX has
> no %s, old libc has neither %s nor %z).
> A possible workaround:
[...]
> 	tm = localtime(&now); /* get timezone and tm_isdst */
> 	tz = -timezone / 60;
> 	if (tm->tm_isdst > 0)
> 		tz += 60;
The global timezone variable isn't available on all systems.  :)

You really cannot get portable behavior in this area without something akin to Autoconf probes, unfortunately. Oh, and you can't assume daylight savings time is an hour; it is sometimes two hours. You have to instead use the altzone variable to get the offset when you're in daylight savings time, but this again isn't available on all systems.

I posted a pointer to the INN source a while back; I'm really not sure that anything less is sufficient to get full portability, although I certainly trust Paul Eggart's implementation.

BTW, the yacc-based thing is exactly what I wrote the INN code to get rid of, since I didn't want a yacc dependency.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>
Previous: Edgar ToernigNext: Linus Torvalds
Message 8 of 31 in “RE: Trying to use AUTHOR_DATE”
  1. Luck, TonyApr 30, 2005
  2. H. Peter AnvinApr 30, 2005
  3. Linus TorvaldsApr 30, 2005
  4. Linus TorvaldsApr 30, 2005
  5. Russ AllberyApr 30, 2005
  6. David WoodhouseApr 30, 2005
  7. Edgar ToernigApr 30, 2005
  8. Russ AllberyApr 30, 2005
  9. Linus TorvaldsApr 30, 2005
  10. Juliusz ChroboczekApr 30, 2005
  11. Edgar ToernigApr 30, 2005
  12. Linus TorvaldsApr 30, 2005
  13. Linus TorvaldsMay 1, 2005
  14. Randy.DunlapMay 1, 2005
  15. Edgar ToernigMay 1, 2005
  16. Junio C HamanoApr 30, 2005
  17. Edgar ToernigApr 30, 2005
  18. David WoodhouseApr 30, 2005
  19. Kay SieversApr 30, 2005
  20. David WoodhouseApr 30, 2005
  21. Edgar ToernigApr 30, 2005
  22. David WoodhouseApr 30, 2005
  23. Edgar ToernigApr 30, 2005
  24. Krzysztof HalasaMay 2, 2005
  25. H. Peter AnvinMay 2, 2005
  26. Krzysztof HalasaMay 2, 2005
  27. H. Peter AnvinMay 2, 2005
  28. Krzysztof HalasaMay 3, 2005
  29. H. Peter AnvinMay 3, 2005
  30. H. Peter AnvinApr 30, 2005
  31. Edgar ToernigApr 30, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.