Originally posted by: dickdunbar
Well, shipping AIX 5.3 version of sleep doesn't solve anything.
This is just a cover module, that links to the implementation of
sleep() in libc.a, which then calls nsleep in libc.a
Running 5.3 version of sleep results in exactly the same behaviour,
which of course can be expected.
The problem runs deeper ... and longer ... perhaps I can call "nap"
so I can cut my sleep time when the gun goes off.
Observing sleep with truss, no signal handling functions are called.
$ truss ./sleep 10
execve("./sleep", 0x2FF22A44, 0x20012818) argc: 2
_nsleep(0x2FF228E0, 0x2FF22958) (sleeping...)
_nsleep(0x2FF228E0, 0x2FF22958) = 0
kfcntl(1, F_GETFL, 0x2FF22FFC) = 67108866
kfcntl(2, F_GETFL, 0x00000000) = 67108866
_exit(0)
Using example 2 from "man sleep" in a shell script, looks something like this:
#!/bin/ksh # truss -af tsleep.sh #define SIGQUIT 3
/* (*) quit, generated from terminal special char */ #define SIGTERM 15
/* software termination signal */ #define SIGCHLD 20
/* (+) sent to parent on child stop or exit */ #define SIGXFSZ 25
/* file size limit exceeded (see setrlimit()) */ export LANG=C trap
"echo $(/bin/date '+%Y%m%d-%H%M%S sigTERM') ; exit 0 " 15
while
true
do # date ## Skip the date call
for truss. /usr/bin/sleep 5 done
----
AIX 5.3 invocation: truss -af tsleep.sh
$ truss -af tsleep.sh 802866: execve(
"/usr/bin/tsleep.sh", 0x2FF228C8, 0x2000FAE8) argc: 3 . . . 802866: _sigaction(6, 0x00000000, 0x2FF22540) = 0 802866: _sigaction(6, 0x2FF22540, 0x2FF22550) = 0 802866: _sigaction(14, 0x00000000, 0x2FF22540) = 0 802866: _sigaction(14, 0x2FF22540, 0x2FF22550) = 0 802866: _sigaction(10, 0x00000000, 0x2FF22540) = 0 802866: _sigaction(10, 0x2FF22540, 0x2FF22550) = 0 802866: _sigaction(20, 0x00000000, 0x2FF22540) = 0 802866: _sigaction(20, 0x2FF22540, 0x2FF22550) = 0 802866: _sigaction(7, 0x00000000, 0x2FF22540) = 0 802866: _sigaction(7, 0x2FF22540, 0x2FF22550) = 0 802866: _sigaction(8, 0x00000000, 0x2FF22540) = 0 802866: _sigaction(8, 0x2FF22540, 0x2FF22550) = 0 802866: _sigaction(1, 0x00000000, 0x2FF22540) = 0 802866: _sigaction(1, 0x2FF22540, 0x2FF22550) = 0 802866: _sigaction(4, 0x00000000, 0x2FF22540) = 0 802866: _sigaction(4, 0x2FF22540, 0x2FF22550) = 0 802866: _sigaction(2, 0x00000000, 0x2FF224F0) = 0 802866: _sigaction(2, 0x2FF224F0, 0x2FF22500) = 0 802866: _sigaction(13, 0x00000000, 0x2FF22540) = 0 802866: _sigaction(13, 0x2FF22540, 0x2FF22550) = 0 802866: _sigaction(3, 0x00000000, 0x2FF22500) = 0 802866: _sigaction(3, 0x2FF22500, 0x2FF22510) = 0 802866: _sigaction(12, 0x00000000, 0x2FF22540) = 0 802866: _sigaction(12, 0x2FF22540, 0x2FF22550) = 0 802866: _sigaction(15, 0x00000000, 0x2FF22540) = 0 802866: _sigaction(15, 0x2FF22540, 0x2FF22550) = 0 802866: _sigaction(5, 0x00000000, 0x2FF22540) = 0 802866: _sigaction(5, 0x2FF22540, 0x2FF22550) = 0 802866: _sigaction(30, 0x00000000, 0x2FF22540) = 0 802866: _sigaction(30, 0x2FF22540, 0x2FF22550) = 0 802866: _sigaction(31, 0x00000000, 0x2FF22540) = 0 802866: _sigaction(31, 0x2FF22540, 0x2FF22550) = 0 802866: _sigaction(25, 0x00000000, 0x2FF22500) = 0 802866: _sigaction(25, 0x2FF22500, 0x2FF22510) = 0 . . 802866: _sigaction(20, 0x00000000, 0x2FF22010) = 0 802866: _sigaction(20, 0x2FF22010, 0x2FF22020) = 0 802866: kioctl(2, 22528, 0x00000000, 0x00000000) = 0 802866: kioctl(2, 21505, 0x2000C180, 0x00000000) = 0 802866: kfork() = 757900 757900: kfork() (returning as child ...) = 0 802866: _sigaction(20, 0x00000000, 0x2FF22010) = 0 757900: _getpid() = 757900 802866: _sigaction(20, 0x2FF22010, 0x2FF22020) = 0 757900: _sigaction(25, 0x00000000, 0x2FF22030) = 0 757900: _sigaction(25, 0x2FF22030, 0x2FF22040) = 0 757900: _sigaction(15, 0x00000000, 0x2FF22030) = 0 757900: _sigaction(15, 0x2FF22030, 0x2FF22040) = 0 757900: _sigaction(3, 0x00000000, 0x2FF22030) = 0 757900: _sigaction(3, 0x2FF22030, 0x2FF22040) = 0 757900: execve(
"/usr/bin/sleep", 0x20095BF8, 0x20095CC8) argc: 2 757900: argv: /usr/bin/sleep 5 802866: kwaitpid(0x2FF22080, -1, 6, 0x00000000, 0x00000000) (sleeping...) 757900: _nsleep(0x2FF22760, 0x2FF227D8) (sleeping...) 757900: _nsleep(0x2FF22760, 0x2FF227D8) = 0 757900: kfcntl(1, F_GETFL, 0x2FF22FFC) = 2 757900: kfcntl(2, F_GETFL, 0x00000000) = 2 757900: _exit(0)