History log of /openbsd-current/lib/libc/gen/alarm.3
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.17 02-Aug-2022 jsg

access(2) alarm(2) pause(2) were not ported from pwb to v7

Alan Glasser describes the incident that led to access(2) in
https://minnie.tuhs.org/pipermail/tuhs/2021-November/024657.html

access(2) alarm(2) pause(2) were also part of the "50 changes" tape

post v6 "50 bugs" / "diff tape" / "50 fixes" tape (Salus QCU, pp 138-139)
"fifty changes" tape
https://www.oreilly.com/openbook/opensources/book/kirkmck.html

"50 changes"
https://archive.org/details/unix_news_november-1976

tuhs/Applications/Spencer_Tapes/unsw3.tar.gz
usr/sys/v6unix/changenotes

45) The "access()" system call checks access permissions on the real
id's of the process regardless of the effective ones. Doesn't return
stats, just does an internal "access()" to set u.u_error.

48) "alarm()" and "pause()" system calls are in to provide a user-mode
timeout capability.

with and ok schwarze@


Revision tags: OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.16 18-Jun-2021 cheloha

alarm.3: miscellaneous improvements to alarm(3) documentation

Improve the alarm(3) manpage:

- Better one-line description of the interface.

- Carefully describe what alarm(3) actually does. In particular, the
first paragraph of the current DESCRIPTION is misleading in several
ways.

- Remove mention of the 100 million second limit. As of kern_time.c v1.154,
setitimer(2) no longer has this limit on OpenBSD.

- An alarm is "pending" if it has been scheduled but has not yet
"expired".

- Rewrite RETURN VALUES. Remind the reader that calling alarm(3)
cancels any pending alarm. Enumerate all the cases where alarm(3)
could return zero.

- Remove all descriptions of errors and errno. With the removal of
the 100 million second limit, alarm(3) basically cannot fail on
OpenBSD unless the stack is corrupted.

Unfortunately, the standard does not prescribe a portable return
value to report an error to the caller.

- Add a CAVEATS section. Discourage use of alarm(3) and setitimer(2)'s
ITIMER_REAL timer in the same program.

With input from millert@, deraadt@, and jmc@.

Thread: https://marc.info/?l=openbsd-tech&m=162403868814857&w=2

ok millert@, jmc@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.15 28-Jan-2016 jmc

sigsuspend is section 2, not 3.


# 1.14 28-Jan-2016 schwarze

The CSRG declared alarm(3) obsolete 30 years ago (before 4.2BSD),
but it is likely to remain in POSIX for the forseeable future,
and there is nothing wrong with using it, so remove the marker.
By contrast, POSIX 2008 now declared setitimer(3) obsolescent.

While here, remove a few cross references pointing to obsolete or
non-standard functions and update the POSIX reference.

Triggered by a question from <ChrisBennett at bennettconstruction dot us>.
OK millert@ tb@


Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.13 17-Jul-2013 schwarze

more library history
facts checked by sobrado@
style tweaks and ok jmc@


# 1.12 05-Jun-2013 tedu

Use the fancy .In macro for includes. From Jan Klemkow. ok jmc schwarze


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.11 31-May-2007 jmc

convert to new .Dd format;


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE
# 1.10 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.9 04-Feb-2001 millert

Add RETURN VALUES section
Max alarm time is 100000000 seconds, not 2147483647 (as enforced by
itimerfix() in kern_time.c)


# 1.8 24-Dec-2000 aaron

Various repairs, mostly to get rid of short lines.


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE
# 1.7 09-Jul-1999 aaron

- remove all trailing whitespace
* except when it is escaped with a `\' at the end of the line
- fix remaining .Nm usage as well
- this is from a patch I received from kwesterback@home.com, who has been
working on some scripts for fixing formatting errors in mdoc'd man pages

Ok, so there could be a cost/benefit debate with this commit, but since I have
the patch we might as well commit it...


# 1.6 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.5 16-May-1999 alex

Cleanup xrefs under SEE ALSO. Specifically:

- Sort xrefs by section, and then alphabetically.
- Add missing commas between xref items.
- Remove commas from the last xref entry.
- Remove duplicate entries.


# 1.4 10-May-1999 aaron

correct some Xr's which referred to the wrong man page sections


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.3 28-Apr-1998 deraadt

use Xr more often


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE OPENBSD_2_2_BASE OPENBSD_2_3_BASE
# 1.2 19-Aug-1996 tholo

Fix RCS ids
Make sure everything uses {SYS,}LIBC_SCCS properly


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.16 18-Jun-2021 cheloha

alarm.3: miscellaneous improvements to alarm(3) documentation

Improve the alarm(3) manpage:

- Better one-line description of the interface.

- Carefully describe what alarm(3) actually does. In particular, the
first paragraph of the current DESCRIPTION is misleading in several
ways.

- Remove mention of the 100 million second limit. As of kern_time.c v1.154,
setitimer(2) no longer has this limit on OpenBSD.

- An alarm is "pending" if it has been scheduled but has not yet
"expired".

- Rewrite RETURN VALUES. Remind the reader that calling alarm(3)
cancels any pending alarm. Enumerate all the cases where alarm(3)
could return zero.

- Remove all descriptions of errors and errno. With the removal of
the 100 million second limit, alarm(3) basically cannot fail on
OpenBSD unless the stack is corrupted.

Unfortunately, the standard does not prescribe a portable return
value to report an error to the caller.

- Add a CAVEATS section. Discourage use of alarm(3) and setitimer(2)'s
ITIMER_REAL timer in the same program.

With input from millert@, deraadt@, and jmc@.

Thread: https://marc.info/?l=openbsd-tech&m=162403868814857&w=2

ok millert@, jmc@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.15 28-Jan-2016 jmc

sigsuspend is section 2, not 3.


# 1.14 28-Jan-2016 schwarze

The CSRG declared alarm(3) obsolete 30 years ago (before 4.2BSD),
but it is likely to remain in POSIX for the forseeable future,
and there is nothing wrong with using it, so remove the marker.
By contrast, POSIX 2008 now declared setitimer(3) obsolescent.

While here, remove a few cross references pointing to obsolete or
non-standard functions and update the POSIX reference.

Triggered by a question from <ChrisBennett at bennettconstruction dot us>.
OK millert@ tb@


Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.13 17-Jul-2013 schwarze

more library history
facts checked by sobrado@
style tweaks and ok jmc@


# 1.12 05-Jun-2013 tedu

Use the fancy .In macro for includes. From Jan Klemkow. ok jmc schwarze


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.11 31-May-2007 jmc

convert to new .Dd format;


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE
# 1.10 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.9 04-Feb-2001 millert

Add RETURN VALUES section
Max alarm time is 100000000 seconds, not 2147483647 (as enforced by
itimerfix() in kern_time.c)


# 1.8 24-Dec-2000 aaron

Various repairs, mostly to get rid of short lines.


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE
# 1.7 09-Jul-1999 aaron

- remove all trailing whitespace
* except when it is escaped with a `\' at the end of the line
- fix remaining .Nm usage as well
- this is from a patch I received from kwesterback@home.com, who has been
working on some scripts for fixing formatting errors in mdoc'd man pages

Ok, so there could be a cost/benefit debate with this commit, but since I have
the patch we might as well commit it...


# 1.6 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.5 16-May-1999 alex

Cleanup xrefs under SEE ALSO. Specifically:

- Sort xrefs by section, and then alphabetically.
- Add missing commas between xref items.
- Remove commas from the last xref entry.
- Remove duplicate entries.


# 1.4 10-May-1999 aaron

correct some Xr's which referred to the wrong man page sections


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.3 28-Apr-1998 deraadt

use Xr more often


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE OPENBSD_2_2_BASE OPENBSD_2_3_BASE
# 1.2 19-Aug-1996 tholo

Fix RCS ids
Make sure everything uses {SYS,}LIBC_SCCS properly


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.15 28-Jan-2016 jmc

sigsuspend is section 2, not 3.


# 1.14 28-Jan-2016 schwarze

The CSRG declared alarm(3) obsolete 30 years ago (before 4.2BSD),
but it is likely to remain in POSIX for the forseeable future,
and there is nothing wrong with using it, so remove the marker.
By contrast, POSIX 2008 now declared setitimer(3) obsolescent.

While here, remove a few cross references pointing to obsolete or
non-standard functions and update the POSIX reference.

Triggered by a question from <ChrisBennett at bennettconstruction dot us>.
OK millert@ tb@


Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.13 17-Jul-2013 schwarze

more library history
facts checked by sobrado@
style tweaks and ok jmc@


# 1.12 05-Jun-2013 tedu

Use the fancy .In macro for includes. From Jan Klemkow. ok jmc schwarze


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.11 31-May-2007 jmc

convert to new .Dd format;


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE
# 1.10 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.9 04-Feb-2001 millert

Add RETURN VALUES section
Max alarm time is 100000000 seconds, not 2147483647 (as enforced by
itimerfix() in kern_time.c)


# 1.8 24-Dec-2000 aaron

Various repairs, mostly to get rid of short lines.


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE
# 1.7 09-Jul-1999 aaron

- remove all trailing whitespace
* except when it is escaped with a `\' at the end of the line
- fix remaining .Nm usage as well
- this is from a patch I received from kwesterback@home.com, who has been
working on some scripts for fixing formatting errors in mdoc'd man pages

Ok, so there could be a cost/benefit debate with this commit, but since I have
the patch we might as well commit it...


# 1.6 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.5 16-May-1999 alex

Cleanup xrefs under SEE ALSO. Specifically:

- Sort xrefs by section, and then alphabetically.
- Add missing commas between xref items.
- Remove commas from the last xref entry.
- Remove duplicate entries.


# 1.4 10-May-1999 aaron

correct some Xr's which referred to the wrong man page sections


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.3 28-Apr-1998 deraadt

use Xr more often


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE OPENBSD_2_2_BASE OPENBSD_2_3_BASE
# 1.2 19-Aug-1996 tholo

Fix RCS ids
Make sure everything uses {SYS,}LIBC_SCCS properly


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision