Skip to contentSkip to conversation

New: timegm() manpage suggests a terrible workaround

Bug 103701 bugzilla-daemon-590EEB7GvNiWaY/[email protected] 1 participant 5 messages Aug 29, 2015 – Mar 10, 2016 1 message not in the archive Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

https://bugzilla.kernel.org/show_bug.cgi?id=103701

Bug ID: 103701
Summary: timegm() manpage suggests a terrible workaround
Product: Documentation
Version: unspecified
Hardware: All
OS: Linux
Status: NEW
Severity: low
Priority: P1
Component: man-pages
Assignee: documentation_man-pages-ztI5WcYan/[email protected]
Reporter: [email protected]
Regression: No

In today's multi-threaded world, is changing an environment variable, calling tzset(), calling mktime(), changing the env variable back, and calling tzset() again really the best way to solve this problem?

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw

[Bug 103701] timegm() manpage suggests a terrible workaround

In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=103701

Michael Kerrisk <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #1 from Michael Kerrisk <[email protected]> --- Stephen,

It's obviously not ideal. I added some words pointing out that it's not thread-safe. But, I have no further idea for changes. Do you?

Cheers,

Michael

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

[Bug 103701] timegm() manpage suggests a terrible workaround

In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=103701

--- Comment #2 from Stephen Hurd <[email protected]> --- I'm not sure why the manpage documents how to not use the function (obviously, documenting *why* not to use it makes sense.)

If there's honestly no good way to emulate timegm() in a threadsafe manner, should its use really be discouraged?

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw

[Bug 103701] timegm() manpage suggests a terrible workaround

In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=103701

Mats Wichmann <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #3 from Mats Wichmann <[email protected]> --- The Gnu glibc documentation has something like this in the portability notes. Often the genesis of comments when there's a strange disclaimer in the manpage :)

I guess I'd suggest the page emphasize the UTC aspect and mention the threadsafe issue, and stop there - not try to document a workaround.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#5 lore raw

[Bug 103701] timegm() manpage suggests a terrible workaround

In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=103701

Michael Kerrisk <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |CODE_FIX

--- Comment #4 from Michael Kerrisk <[email protected]> --- Okay--you two convinced me. I killed the sample timegm() implementation and added mention of UTC. Thread-safety issues are covered already in ATTRIBUTES.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html