From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 23 Jun 2004 12:39:37 +0400 From: Alexey Tourbin To: devel@altlinux.ru Message-ID: <20040623083937.GP1926@solemn.turbinal.org> Mail-Followup-To: devel@altlinux.ru Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Nx8xdmI2KD3LNVVP" Content-Disposition: inline Subject: [devel] system(3) blocks alarm(2) under strace(1) X-BeenThere: devel@altlinux.ru X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ALT Devel discussion list List-Id: ALT Devel discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2004 09:08:07 -0000 Archived-At: List-Archive: List-Post: --Nx8xdmI2KD3LNVVP Content-Type: multipart/mixed; boundary="Vy6UCbb9EK60RK4A" Content-Disposition: inline --Vy6UCbb9EK60RK4A Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable =F3=D4=CF=CC=CB=CE=D5=CC=D3=D1 =D7 =D0=C5=D2=CC=C5, =CE=CF =D7=CF=D3=D0=D2= =CF=C9=DA=D7=CF=C4=C9=D4=D3=D1 =C2=C5=DA =D7=D3=D1=CB=CF=C7=CF =D0=C5=D2=CC= =C1. $ gcc alarm.c $ ./a.out diff=3D3 seconds $ strace -o /dev/null ./a.out diff=3D3 seconds $ strace -f -o /dev/null ./a.out diff=3D6 seconds $ =F7 =DE=C5=CD =DA=C4=C5=D3=D8 =D3=C5=CB=D2=C5=D4? --Vy6UCbb9EK60RK4A Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="alarm.c" #include #include #include #include #include time_t start_time, alarm_time; void alarm_handler(int signo) { alarm_time = time(NULL); } int main() { start_time = time(NULL); signal(SIGALRM, alarm_handler); alarm(3); system("sleep 6"); printf("diff=%d seconds\n", alarm_time - start_time); return 0; } --Vy6UCbb9EK60RK4A-- --Nx8xdmI2KD3LNVVP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFA2UHIfBKgtDjnu0YRAhvUAJ9Ynda0v27V+f3CpRxEoEGPm1l+/wCgw3Wv hCNEwrrND08fExX4mAJbfzM= =7MSh -----END PGP SIGNATURE----- --Nx8xdmI2KD3LNVVP--